openCARP
Doxygen code documentation for the open cardiac electrophysiology simulator openCARP
Public Member Functions | Public Attributes | List of all members
limpet::MULTI_IF Class Reference

#include <MULTI_ION_IF.h>

Collaboration diagram for limpet::MULTI_IF:

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< int > &indices, const SF::vector< double > &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_tprocdata [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_Infotrace_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< Targettargets
 target for each region More...
 
IIF_Mask_tIIFmask
 region for each node More...
 
std::vector< IonTypeListplugtypes
 plugins types for each region More...
 
opencarp::sf_vecgdata [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...
 

Detailed Description

hold different ionic model information

Definition at line 195 of file MULTI_ION_IF.h.

Constructor & Destructor Documentation

◆ MULTI_IF()

limpet::MULTI_IF::MULTI_IF ( )
inline

Definition at line 226 of file MULTI_ION_IF.h.

◆ ~MULTI_IF()

limpet::MULTI_IF::~MULTI_IF ( )
inline

Definition at line 231 of file MULTI_ION_IF.h.

Member Function Documentation

◆ adjust_MIIF_variables()

int limpet::MULTI_IF::adjust_MIIF_variables ( const char *  variable,
const SF::vector< int > &  indices,
const SF::vector< double > &  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.

Parameters
pMIIFmulti-ion interface
nameName 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"
numNodesSize of the following two arrays
indicesArray of local node numbers, mapping into our local mesh
valuesArray of values we want to be setting.
Returns
the number of items set

Definition at line 869 of file MULTI_ION_IF.cc.

Here is the caller graph for this function:

◆ close_svs_dumps()

void limpet::MULTI_IF::close_svs_dumps ( )

close sv table IO files

Parameters
MIIFpointer to MULTI_IF structure

Definition at line 509 of file MULTI_ION_IF.cc.

Here is the caller graph for this function:

◆ compute_ionic_current()

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.

Here is the caller graph for this function:

◆ dump_luts_MIIF()

void limpet::MULTI_IF::dump_luts_MIIF ( bool  zipped)

dump LUTs of all IIFs

Parameters
MIIFpointer to MULTI_IF structure
zippedtoggle between zipped||unzipped dump

Definition at line 483 of file MULTI_ION_IF.cc.

Here is the caller graph for this function:

◆ dump_state()

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:

  1. dump identifier (char *)
  2. format version (unsigned int)
  3. program version number (unsigned int)
  4. time file is created (time_t)
  5. simulation time (float)
  6. total #nodes in model (int)
  7. number of used global data vectors (int)
  8. for each used global data vector
    1. the length of its name (int)
    2. its name (char *)
    3. the array (Real *) in canonical order
  9. number of IIF regions (int)
  10. for each IIF region
    1. length of the IMP name (int)
    2. IMP name (char *)
    3. size of state variable info (int)
    4. number of plug-ins (int)
    5. for each plug-in
      1. length of the IMP name (int)
      2. IMP name (char *)
      3. size of state variable info (int)
  11. the node mask specifying the regions (IIF_Mask_t *) in canonical order
  12. for each node
    1. state variables for the base IMP (IMP_SV)
    2. for each plug-in
      1. state variables (PLUGIN_SV)
Parameters
fnameoutput file name
simtimesimulation time at which dump occurs
gidID of the mesh we operate on
appendtrue to append to existing file
revisioncalling program version

Definition at line 1057 of file MULTI_ION_IF.cc.

Here is the caller graph for this function:

◆ dump_svs()

int limpet::MULTI_IF::dump_svs ( opencarp::base_timer )

dump state variables

Parameters
MIIFpointer to MULTI_IF structure
iotIO timer
Returns
the number of data written per dump variable

Definition at line 551 of file MULTI_ION_IF.cc.

Here is the caller graph for this function:

◆ free_MIIF()

void limpet::MULTI_IF::free_MIIF ( )

Definition at line 673 of file MULTI_ION_IF.cc.

Here is the caller graph for this function:

◆ getRealData()

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.

Here is the caller graph for this function:

◆ initialize_currents()

void limpet::MULTI_IF::initialize_currents ( double  idt,
int  subDt 
)

initialize the computation functions

Parameters
MIIFpointer to MULTI_IF structure
dttime step (milliseconds)
subDtnumber of sub time steps per global time step

Definition at line 468 of file MULTI_ION_IF.cc.

Here is the caller graph for this function:

◆ initialize_MIIF()

void limpet::MULTI_IF::initialize_MIIF ( )

create lists and allocate memory for IMPs

Parameters
MIIFmulti yyion interface

Definition at line 295 of file MULTI_ION_IF.cc.

Here is the caller graph for this function:

◆ MIIF_change_dt()

void limpet::MULTI_IF::MIIF_change_dt ( double  Dt)

change the time step

Parameters
miifthe ionic model iinterface
Dtthe new time step

Definition at line 1779 of file MULTI_ION_IF.cc.

◆ releaseRealData()

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.

Here is the caller graph for this function:

◆ releaseRealDataDuringInit()

void limpet::MULTI_IF::releaseRealDataDuringInit ( )

Copy both reqqed and modded data back into the global vectors.

Parameters
mMIIF

Definition at line 274 of file MULTI_ION_IF.cc.

Here is the caller graph for this function:

◆ restore_state()

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.

Parameters
fnameinput file name, if NULL use open file stream
gidthe ID of the mesh we operate on (usually intra_elec_msh)
closeclose the file stream afterwards?
Precondition
The IMPs have all been allocated
Note
all ranks process the file
There are static variables, the input file stream and file name
Returns
the time at which the simulation was saved

Definition at line 1272 of file MULTI_ION_IF.cc.

Here is the caller graph for this function:

◆ sv_dump_add()

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

Parameters
miifMulti ion IF structure
regionregion containing the state variable
impID of IMP within the region
offsetoffset of SV within the IMP SV structure
sizesize of the SV
dtypeID of data type
filenameoutput file name
impnamestring specifying the IMP
regnamename of the region
Note
It is much easier to call this function with the ::SV_add macro or with the ::sv_dump_add_by_name function than directly.

Definition at line 1555 of file MULTI_ION_IF.cc.

Here is the caller graph for this function:

◆ sv_dump_add_by_name()

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

Parameters
miifMulti ion IF structure
regionregion containing the state variable
impnamestring specifying the IMP
svnamestring specifying the state variable to dump
regnamename of the region
filenameoutput file name

Definition at line 1624 of file MULTI_ION_IF.cc.

Here is the caller graph for this function:

◆ sv_dump_add_by_name_list()

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

Parameters
pmiifmulti-ionic interface structure
regionIIF number
imp_namename of IMP
reg_namename of region
sv_lstionic model state variable list we want to dump
plg_lstplugin list of this ionic model
plg_sv_lstplugin state variable list we want to dump

Definition at line 1496 of file MULTI_ION_IF.cc.

Here is the caller graph for this function:

◆ thread_initialize_MIIF()

void* limpet::MULTI_IF::thread_initialize_MIIF ( )

◆ transmem_stim_species()

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

Parameters
miifionic models
chargetransmembrane charge=current*dt (µA*ms/cm^2)
speciesionic species carrying current
betaeffective surface to volume ratio of cells (per micrometer)
nodelist of stimulated nodes
numnode#nodes in list
Note
extracellular concentrations are not affected since it is assumed that electrons at the electrode interface cause depletion/creation of ions and the ground electrode is located far away
The voltage is NOT affected. This must be done separately.

Definition at line 1708 of file MULTI_ION_IF.cc.

Here is the caller graph for this function:

◆ use_stretch()

bool limpet::MULTI_IF::use_stretch ( )

test whether we have any mechanics enabled

Parameters
[in]miifMulti ion IF structure
Returns
true, if mechanics is used false, otherwise

Definition at line 1677 of file MULTI_ION_IF.cc.

Here is the caller graph for this function:

◆ zero_data()

void limpet::MULTI_IF::zero_data ( )
inline

Definition at line 233 of file MULTI_ION_IF.h.

Here is the caller graph for this function:

Member Data Documentation

◆ contiguous

bool* limpet::MULTI_IF::contiguous

whether a region is contiguously numbered

Definition at line 206 of file MULTI_ION_IF.h.

◆ doppel

bool limpet::MULTI_IF::doppel

is this a shallow clone?

Definition at line 199 of file MULTI_ION_IF.h.

◆ dt

double limpet::MULTI_IF::dt

time step (ms)

Definition at line 219 of file MULTI_ION_IF.h.

◆ extUpdateVm

bool limpet::MULTI_IF::extUpdateVm

flag indicating update function for Vm

Definition at line 208 of file MULTI_ION_IF.h.

◆ gdata

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.

◆ IIF

std::vector<IonIfBase*> limpet::MULTI_IF::IIF

array of IIF's

Definition at line 202 of file MULTI_ION_IF.h.

◆ IIFmask

IIF_Mask_t* limpet::MULTI_IF::IIFmask

region for each node

Definition at line 214 of file MULTI_ION_IF.h.

◆ iontypes

IonTypeList limpet::MULTI_IF::iontypes

type for each region

Definition at line 212 of file MULTI_ION_IF.h.

◆ ldata

GlobalData_t*** limpet::MULTI_IF::ldata

data local to each IMP

Definition at line 205 of file MULTI_ION_IF.h.

◆ logger

opencarp::FILE_SPEC limpet::MULTI_IF::logger

Definition at line 217 of file MULTI_ION_IF.h.

◆ N_IIF

int limpet::MULTI_IF::N_IIF

how many different IIF's

Definition at line 211 of file MULTI_ION_IF.h.

◆ N_Nodes

int* limpet::MULTI_IF::N_Nodes

#nodes for each IMP

Definition at line 200 of file MULTI_ION_IF.h.

◆ name

std::string limpet::MULTI_IF::name

name for MIIF region

Definition at line 198 of file MULTI_ION_IF.h.

◆ NodeLists

int** limpet::MULTI_IF::NodeLists

local partitioned node lists for each IMP stored

Definition at line 201 of file MULTI_ION_IF.h.

◆ numNode

int limpet::MULTI_IF::numNode

local number of nodes

Definition at line 210 of file MULTI_ION_IF.h.

◆ numplugs

int* limpet::MULTI_IF::numplugs

number of plugins for each region

Definition at line 209 of file MULTI_ION_IF.h.

◆ numSubDt

int limpet::MULTI_IF::numSubDt

number of sub-dt time steps

Definition at line 220 of file MULTI_ION_IF.h.

◆ plugtypes

std::vector<IonTypeList> limpet::MULTI_IF::plugtypes

plugins types for each region

Definition at line 215 of file MULTI_ION_IF.h.

◆ procdata

GlobalData_t* limpet::MULTI_IF::procdata[NUM_IMP_DATA_TYPES]

data for this processor

Definition at line 204 of file MULTI_ION_IF.h.

◆ svd

SV_DUMP limpet::MULTI_IF::svd

state variable dump

Definition at line 203 of file MULTI_ION_IF.h.

◆ targets

std::vector<Target> limpet::MULTI_IF::targets

target for each region

Definition at line 213 of file MULTI_ION_IF.h.

◆ trace_info

Trace_Info* limpet::MULTI_IF::trace_info

Information about traces.

Definition at line 207 of file MULTI_ION_IF.h.


The documentation for this class was generated from the following files: