openCARP
Doxygen code documentation for the open cardiac electrophysiology simulator openCARP
|
#include <MULTI_ION_IF.h>
Public Member Functions | |
MULTI_IF () | |
~MULTI_IF () | |
void | zero_data () |
void | initialize_MIIF () |
void | initialize_currents (double, int) |
void | compute_ionic_current (bool flag_send=1, bool flag_receive=1) |
GPU kernel to emulate the add_scaled call made to adjust the Vm values when the update to Vm is not made externally. This is to avoid computing the Vm update on CPU when runnign a GPU model. More... | |
void | free_MIIF () |
void | sv_dump_add (int, const IonType &, int, int, int, const char *, const char *) |
int | sv_dump_add_by_name (int, char *, char *, char *, char *) |
void | sv_dump_add_by_name_list (int, char *, char *, char *, char *, char *, double, double) |
int | dump_svs (opencarp::base_timer *) |
void | close_svs_dumps () |
void | dump_luts_MIIF (bool) |
void | dump_state (char *, float, opencarp::mesh_t gid, bool, unsigned int) |
void | transmem_stim_species (float, const char *, float, int *, int) |
float | restore_state (const char *, opencarp::mesh_t gid, bool) |
void | releaseRealData () |
void | releaseRealDataDuringInit () |
void | getRealData () |
int | adjust_MIIF_variables (const char *variable, const SF::vector< SF_int > &indices, const SF::vector< SF_real > &values) |
void | MIIF_change_dt (double) |
bool | use_stretch () |
void * | thread_initialize_MIIF () |
Public Attributes | |
std::string | name |
name for MIIF region More... | |
bool | doppel |
is this a shallow clone? More... | |
int * | N_Nodes |
#nodes for each IMP More... | |
int ** | NodeLists |
local partitioned node lists for each IMP stored More... | |
std::vector< IonIfBase * > | IIF |
array of IIF's More... | |
SV_DUMP | svd |
state variable dump More... | |
GlobalData_t * | procdata [NUM_IMP_DATA_TYPES] |
data for this processor More... | |
GlobalData_t *** | ldata |
data local to each IMP More... | |
bool * | contiguous |
whether a region is contiguously numbered More... | |
Trace_Info * | trace_info |
Information about traces. More... | |
bool | extUpdateVm |
flag indicating update function for Vm More... | |
int * | numplugs |
number of plugins for each region More... | |
int | numNode |
local number of nodes More... | |
int | N_IIF |
how many different IIF's More... | |
IonTypeList | iontypes |
type for each region More... | |
std::vector< Target > | targets |
target for each region More... | |
IIF_Mask_t * | IIFmask |
region for each node More... | |
std::vector< IonTypeList > | plugtypes |
plugins types for each region More... | |
opencarp::sf_vec * | gdata [NUM_IMP_DATA_TYPES] |
data used by all IMPs More... | |
opencarp::FILE_SPEC | logger |
double | dt |
time step (ms) More... | |
int | numSubDt |
number of sub-dt time steps More... | |
hold different ionic model information
Definition at line 195 of file MULTI_ION_IF.h.
|
inline |
Definition at line 226 of file MULTI_ION_IF.h.
|
inline |
Definition at line 231 of file MULTI_ION_IF.h.
int limpet::MULTI_IF::adjust_MIIF_variables | ( | const char * | variable, |
const SF::vector< SF_int > & | indices, | ||
const SF::vector< SF_real > & | values | ||
) |
adjust a state variable within a model.
Right now, state variables are the only variables in a model that vary on a nodal basis. By setting state variables, we can adjust some parameters on a per-node basis in individual ionic models. This will allow people to run simulations that would otherwise be impossible without using thousands of regions.
pMIIF | multi-ion interface |
name | Name of parameter to adjust. The name should be in the format "external_var" or "Model_name.state_variable", i.e. "Lambda" or "LRDII_F.m" |
numNodes | Size of the following two arrays |
indices | Array of local node numbers, mapping into our local mesh |
values | Array of values we want to be setting. |
Definition at line 869 of file MULTI_ION_IF.cc.
void limpet::MULTI_IF::close_svs_dumps | ( | ) |
close sv table IO files
MIIF | pointer to MULTI_IF structure |
Definition at line 509 of file MULTI_ION_IF.cc.
void limpet::MULTI_IF::compute_ionic_current | ( | bool | flag_send = 1 , |
bool | flag_receive = 1 |
||
) |
GPU kernel to emulate the add_scaled
call made to adjust the Vm values when the update to Vm is not made externally. This is to avoid computing the Vm update on CPU when runnign a GPU model.
Definition at line 586 of file MULTI_ION_IF.cc.
void limpet::MULTI_IF::dump_luts_MIIF | ( | bool | zipped | ) |
dump LUTs of all IIFs
MIIF | pointer to MULTI_IF structure |
zipped | toggle between zipped||unzipped dump |
Definition at line 483 of file MULTI_ION_IF.cc.
void limpet::MULTI_IF::dump_state | ( | char * | , |
float | , | ||
opencarp::mesh_t | gid, | ||
bool | , | ||
unsigned | int | ||
) |
dump the IIF's to a file so that they can later be restored
the following is output as binary data in order:
fname | output file name |
simtime | simulation time at which dump occurs |
gid | ID of the mesh we operate on |
append | true to append to existing file |
revision | calling program version |
Definition at line 1057 of file MULTI_ION_IF.cc.
int limpet::MULTI_IF::dump_svs | ( | opencarp::base_timer * | ) |
dump state variables
MIIF | pointer to MULTI_IF structure |
iot | IO timer |
Definition at line 551 of file MULTI_ION_IF.cc.
void limpet::MULTI_IF::free_MIIF | ( | ) |
void limpet::MULTI_IF::getRealData | ( | ) |
for each IMP data vector, get the local portion corresponding to each ionic model
If PETSc is used, we need to get the local data first
If nodes for a particular region are noncontigous in the original vector, they must be copied to a local contiguous vector
Definition at line 725 of file MULTI_ION_IF.cc.
void limpet::MULTI_IF::initialize_currents | ( | double | idt, |
int | subDt | ||
) |
initialize the computation functions
MIIF | pointer to MULTI_IF structure |
dt | time step (milliseconds) |
subDt | number of sub time steps per global time step |
Definition at line 468 of file MULTI_ION_IF.cc.
void limpet::MULTI_IF::initialize_MIIF | ( | ) |
create lists and allocate memory for IMPs
MIIF | multi yyion interface |
Definition at line 295 of file MULTI_ION_IF.cc.
void limpet::MULTI_IF::MIIF_change_dt | ( | double | Dt | ) |
change the time step
miif | the ionic model iinterface |
Dt | the new time step |
Definition at line 1779 of file MULTI_ION_IF.cc.
void limpet::MULTI_IF::releaseRealData | ( | ) |
copy data back into original vectors
If the data passed from the main is noncontiguous in memory, the data values must first be copied from the local contiguous array
If PETSc is used, the vector must be restored
Definition at line 761 of file MULTI_ION_IF.cc.
void limpet::MULTI_IF::releaseRealDataDuringInit | ( | ) |
Copy both reqqed and modded data back into the global vectors.
m | MIIF |
Definition at line 274 of file MULTI_ION_IF.cc.
float limpet::MULTI_IF::restore_state | ( | const char * | , |
opencarp::mesh_t | gid, | ||
bool | |||
) |
restore the IIF's from a file
The model saved must agree with the model being run. This is checked by ensuring the #nodes agree. See dump_state()
Compatible IIF's are restored. To be compatible, the ionic model and ionic model size for an IIF must match. Plug-ins and their order may change. Only compatible plug-ins (matching type and size) are restored, others are ignored.
fname | input file name, if NULL use open file stream |
gid | the ID of the mesh we operate on (usually intra_elec_msh) |
close | close the file stream afterwards? |
Definition at line 1272 of file MULTI_ION_IF.cc.
void limpet::MULTI_IF::sv_dump_add | ( | int | region, |
const IonType & | type, | ||
int | offset, | ||
int | size, | ||
int | dtype, | ||
const char * | filename, | ||
const char * | regname | ||
) |
add a state variable to the list to be dumped
miif | Multi ion IF structure |
region | region containing the state variable |
imp | ID of IMP within the region |
offset | offset of SV within the IMP SV structure |
size | size of the SV |
dtype | ID of data type |
filename | output file name |
impname | string specifying the IMP |
regname | name of the region |
Definition at line 1555 of file MULTI_ION_IF.cc.
int limpet::MULTI_IF::sv_dump_add_by_name | ( | int | region, |
char * | impname, | ||
char * | svname, | ||
char * | regname, | ||
char * | filename | ||
) |
add a state variable by name to the list to be dumped
miif | Multi ion IF structure |
region | region containing the state variable |
impname | string specifying the IMP |
svname | string specifying the state variable to dump |
regname | name of the region |
filename | output file name |
Definition at line 1624 of file MULTI_ION_IF.cc.
void limpet::MULTI_IF::sv_dump_add_by_name_list | ( | int | region, |
char * | imp_name, | ||
char * | reg_name, | ||
char * | sv_lst, | ||
char * | plg_lst, | ||
char * | plg_sv_lst, | ||
double | t, | ||
double | dump_dt | ||
) |
wrapper function to add sv's for dumping using a colon separated list
pmiif | multi-ionic interface structure |
region | IIF number |
imp_name | name of IMP |
reg_name | name of region |
sv_lst | ionic model state variable list we want to dump |
plg_lst | plugin list of this ionic model |
plg_sv_lst | plugin state variable list we want to dump |
Definition at line 1496 of file MULTI_ION_IF.cc.
void* limpet::MULTI_IF::thread_initialize_MIIF | ( | ) |
void limpet::MULTI_IF::transmem_stim_species | ( | float | charge, |
const char * | species, | ||
float | beta, | ||
int * | node, | ||
int | numnode | ||
) |
assign transmembrane current stimulus to an ionic species and adjust concentration of species
miif | ionic models |
charge | transmembrane charge=current*dt (µA*ms/cm^2) |
species | ionic species carrying current |
beta | effective surface to volume ratio of cells (per micrometer) |
node | list of stimulated nodes |
numnode | #nodes in list |
Definition at line 1708 of file MULTI_ION_IF.cc.
bool limpet::MULTI_IF::use_stretch | ( | ) |
test whether we have any mechanics enabled
[in] | miif | Multi ion IF structure |
Definition at line 1677 of file MULTI_ION_IF.cc.
|
inline |
bool* limpet::MULTI_IF::contiguous |
whether a region is contiguously numbered
Definition at line 206 of file MULTI_ION_IF.h.
bool limpet::MULTI_IF::doppel |
is this a shallow clone?
Definition at line 199 of file MULTI_ION_IF.h.
double limpet::MULTI_IF::dt |
time step (ms)
Definition at line 219 of file MULTI_ION_IF.h.
bool limpet::MULTI_IF::extUpdateVm |
flag indicating update function for Vm
Definition at line 208 of file MULTI_ION_IF.h.
opencarp::sf_vec* limpet::MULTI_IF::gdata[NUM_IMP_DATA_TYPES] |
data used by all IMPs
Definition at line 216 of file MULTI_ION_IF.h.
std::vector<IonIfBase*> limpet::MULTI_IF::IIF |
array of IIF's
Definition at line 202 of file MULTI_ION_IF.h.
IIF_Mask_t* limpet::MULTI_IF::IIFmask |
region for each node
Definition at line 214 of file MULTI_ION_IF.h.
IonTypeList limpet::MULTI_IF::iontypes |
type for each region
Definition at line 212 of file MULTI_ION_IF.h.
GlobalData_t*** limpet::MULTI_IF::ldata |
data local to each IMP
Definition at line 205 of file MULTI_ION_IF.h.
opencarp::FILE_SPEC limpet::MULTI_IF::logger |
Definition at line 217 of file MULTI_ION_IF.h.
int limpet::MULTI_IF::N_IIF |
how many different IIF's
Definition at line 211 of file MULTI_ION_IF.h.
int* limpet::MULTI_IF::N_Nodes |
#nodes for each IMP
Definition at line 200 of file MULTI_ION_IF.h.
std::string limpet::MULTI_IF::name |
name for MIIF region
Definition at line 198 of file MULTI_ION_IF.h.
int** limpet::MULTI_IF::NodeLists |
local partitioned node lists for each IMP stored
Definition at line 201 of file MULTI_ION_IF.h.
int limpet::MULTI_IF::numNode |
local number of nodes
Definition at line 210 of file MULTI_ION_IF.h.
int* limpet::MULTI_IF::numplugs |
number of plugins for each region
Definition at line 209 of file MULTI_ION_IF.h.
int limpet::MULTI_IF::numSubDt |
number of sub-dt time steps
Definition at line 220 of file MULTI_ION_IF.h.
std::vector<IonTypeList> limpet::MULTI_IF::plugtypes |
plugins types for each region
Definition at line 215 of file MULTI_ION_IF.h.
GlobalData_t* limpet::MULTI_IF::procdata[NUM_IMP_DATA_TYPES] |
data for this processor
Definition at line 204 of file MULTI_ION_IF.h.
SV_DUMP limpet::MULTI_IF::svd |
state variable dump
Definition at line 203 of file MULTI_ION_IF.h.
std::vector<Target> limpet::MULTI_IF::targets |
target for each region
Definition at line 213 of file MULTI_ION_IF.h.
Trace_Info* limpet::MULTI_IF::trace_info |
Information about traces.
Definition at line 207 of file MULTI_ION_IF.h.