openCARP
Doxygen code documentation for the open cardiac electrophysiology simulator openCARP
|
Abstract class representing an ionic model type. More...
#include <ion_type.h>
Public Types | |
using | params_type = void |
type of this model's parameter structure More... | |
using | state_type = void |
type of this model's state variable structure More... | |
using | private_type = void |
type of this model's private structure More... | |
using | private_type_vector = void |
Public Member Functions | |
IonType (std::string name, bool plugin) | |
const std::string & | get_name () const |
Gets the model name. More... | |
bool | is_plugin () const |
Returns whether this model is a plugin or not. More... | |
virtual size_t | params_size () const =0 |
Gets the size in bytes needed to represent the parameters of this model. More... | |
virtual size_t | dlo_vector_size () const =0 |
Gets the vector size when using data layout optimization (DLO). More... | |
virtual uint32_t | reqdat () const =0 |
Gets data flags for this IMP's required data. More... | |
virtual uint32_t | moddat () const =0 |
Gets data flags for this IMP's modified data. More... | |
virtual void | initialize_params (IonIfBase &imp) const =0 |
Initializes the parameters in the given IMP. More... | |
virtual void | construct_tables (IonIfBase &imp) const =0 |
Contructs lookup tables. More... | |
virtual void | destroy (IonIfBase &imp) const =0 |
Destroys the given IMP. More... | |
virtual void | initialize_sv (IonIfBase &imp, GlobalData_t **data) const =0 |
Initializes the state variables of the given IMP. More... | |
virtual Target | select_target (Target target) const =0 |
Gets a supported target from the given target. More... | |
virtual void | compute (Target target, int start, int end, IonIfBase &imp, GlobalData_t **data) const =0 |
Performs computation for 1 time step. More... | |
virtual bool | has_trace () const =0 |
Returns whether the trace method is available or not. More... | |
virtual void | trace (IonIfBase &imp, int node, FILE *file, GlobalData_t **data) const =0 |
Write the values of traced variables to file . More... | |
virtual void | tune (IonIfBase &imp, const char *im_par) const =0 |
Handles setting of this model's parameters. More... | |
virtual int | read_svs (IonIfBase &imp, FILE *file) const =0 |
Reads state variable values for one cell from a file. More... | |
virtual int | write_svs (IonIfBase &imp, FILE *file, int node) const =0 |
Write state variable values for one cell to a file/. More... | |
virtual SVgetfcn | get_sv_offset (const char *svname, int *off, int *sz) const =0 |
Get the offset and size of a state variable of the model, as well as an access function. More... | |
virtual int | get_sv_list (char ***list) const =0 |
Returns a list of SVs. More... | |
virtual int | get_sv_type (const char *svname, int *type, char **type_name) const =0 |
Determines the type of a SV. More... | |
virtual void | print_params () const =0 |
Prints the parameters of this model. More... | |
virtual void | print_metadata () const =0 |
Prints the metadata of this model. More... | |
virtual IonIfBase * | make_ion_if (Target target, int num_node, const std::vector< std::reference_wrapper< IonType >> &plugins) const =0 |
Generate an IonIf object from this type. More... | |
virtual void | destroy_ion_if (IonIfBase *imp) const =0 |
Destroy an IonIf object. More... | |
bool | operator== (const IonType &other) const |
bool | operator!= (const IonType &other) const |
Abstract class representing an ionic model type.
This class acts as an interface for ionic models. Each ionic model generated from EasyML or some other language will define this class' abstract functions and used data types.
Definition at line 59 of file ion_type.h.
using limpet::IonType::params_type = void |
type of this model's parameter structure
Definition at line 61 of file ion_type.h.
using limpet::IonType::private_type = void |
type of this model's private structure
Definition at line 63 of file ion_type.h.
using limpet::IonType::private_type_vector = void |
Definition at line 64 of file ion_type.h.
using limpet::IonType::state_type = void |
type of this model's state variable structure
Definition at line 62 of file ion_type.h.
|
inline |
Definition at line 70 of file ion_type.h.
|
pure virtual |
Performs computation for 1 time step.
State and private variables of imp
will be updated as well as external variables (data
) for nodes that are in the start
to end
range.
target | to run the computation on (see limpet::Target) |
start | index of the first node (cell) to compute |
end | index of the last node (cell) to compute |
imp | IMP holding all necessary data |
data | external variables |
|
pure virtual |
Contructs lookup tables.
imp | IMP structure to constructure the tables in |
|
pure virtual |
Destroys the given IMP.
This frees the lookup tables and state variables.
imp | IMP to destroy |
|
pure virtual |
Destroy an IonIf object.
imp | IMP to destroy |
|
pure virtual |
Gets the vector size when using data layout optimization (DLO).
1 | if DLO isn't used (or if vector size is 1) |
const std::string & limpet::IonType::get_name | ( | ) | const |
Gets the model name.
Definition at line 23 of file ion_type.cc.
|
pure virtual |
Returns a list of SVs.
list | list of SVs |
|
pure virtual |
Get the offset and size of a state variable of the model, as well as an access function.
svname | of the state variable | |
[out] | off | offset of the variable (or 0 if svname is "ALL_SV") |
[out] | sz | size of the state variable (or size of the SV structure if svname is "ALL_SV"), not the size of the whole sv array in case of DLO e.g. if vector size is 8, sz is still 4 for a float and not 32 |
|
pure virtual |
Determines the type of a SV.
svname | name of the sv |
type | type of a sv |
type_name | name of the type |
0 | the combination imp_id/svname was found |
1 | the combination imp_id/svname was not found |
|
pure virtual |
Returns whether the trace method is available or not.
true
if the trace method is available, or false
otherwise
|
pure virtual |
Initializes the parameters in the given IMP.
imp | IMP to initialize the parameters of |
|
pure virtual |
Initializes the state variables of the given IMP.
imp | IMP to initialize the SVs of |
data | external variables data (can be written by this functions) |
bool limpet::IonType::is_plugin | ( | ) | const |
Returns whether this model is a plugin or not.
true
if this model is a plugin, or false
otherwise Definition at line 27 of file ion_type.cc.
|
pure virtual |
Gets data flags for this IMP's modified data.
bool limpet::IonType::operator!= | ( | const IonType & | other | ) | const |
bool limpet::IonType::operator== | ( | const IonType & | other | ) | const |
|
pure virtual |
Gets the size in bytes needed to represent the parameters of this model.
|
pure virtual |
Prints the metadata of this model.
|
pure virtual |
Prints the parameters of this model.
|
pure virtual |
Reads state variable values for one cell from a file.
0 | good |
1 | temporary table allocated |
>1 | error |
|
pure virtual |
Gets data flags for this IMP's required data.
Gets a supported target from the given target.
If the given target is Target::AUTO
the returned target will be the first available, else for other targets it either returns the same if supported or Target::UNKNOWN
.
target | the given target |
Target::UNKNOWN
if the selection failed
|
pure virtual |
Write the values of traced variables to file
.
imp | IMP holding model data |
node | node for which to trace the data |
file | file to write to |
data | external variables array |
|
pure virtual |
Handles setting of this model's parameters.
imp | IMP holding this model's data |
im_par | string to be parsed for parameter initialization |
|
pure virtual |
Write state variable values for one cell to a file/.
imp | IMP holding the model's data |
out | file to write to |
node | number for the cell we want to write the SVs of |