openCARP
Doxygen code documentation for the open cardiac electrophysiology simulator openCARP
LIMPET: Library of IMPs (Ionic Model & Plug-ins) for Electrophysiological Theorization
devil-4.jpg

Purpose

This purpose of this library is to create a a consistent interface for a set of efficiently implemented ionic models. The library is designed to be able to specify different regions within a tissue and assign different models within each region. Furthermore, plug-ins may be added on to basic ionic models to enhance functionality. For example, an electroporation channel is available as a plug-in.

The library tries to be as efficient as possible. It is also designed to work on sequential machines, under OMP, under distributed systems using PETSc, or on GPUs.

Usage

Filling the appropriate data structures is outlined in MULTI_ION_IF.cc.
An example of using the library is found in bench.cc.

Compilation

To compile code that uses the IMP library, include the header

#include "MULTI_ION_IF.h"

and link the library

gcc ... -limp -lm

Adding Ionic Models

To add a new ionic model or plugin (an IMP), one must firsty modify imp_list.txt. See the file for details. Many files are generated from this file.

When adding an IMP called <IMP>, the source code for the IMP must be in <IMP>.h and <IMP>.cc. Note, the IMP name must contain at least one uppercase character. The following functions must be declared:

initialize_sv_<IMP>() allocate and initialize the state variable table entriesgengetopt
initialize_params_<IMP>()set modifiable IMP parameters to defaults
construct_tables_<IMP>() allocate memory for and fill lookup table
compute_<IMP>() compute desired quantities
destroy_<IMP>() free IMP memory

and
define 2 structures, one <IMP>_state which contains the state variables for a node, and <IMP>_Params which contains IMP specific parameters in <IMP>.h. A script called skeleton.pl will create the outline of the code for a new IMP.

IMPs may require data not intrinsically provided by the IMP. You must define a mask in <IMP>.h specifying what data must be passed in and another mask specifying what data are modified. The mask is OR'ed together from the IMP data type flags (see ION_IF.h)
#define <IMP>_REQDAT mask
#define <IMP>_MODDAT mask
The length of these data vectors must be equal to the total number of nodes even if not all nodes use all data types. Data passed like this typically signify interaction between IMPS and other procedures, beyond the scope of an IMP, in the program. Look at MBRDR.h and MBRDR.c for an example of a relatively simple IMP.

State variables of the parent ionic model may be accessed by plug-ins. A common naming scheme is necessary so that this interaction may be automated. The following variables are currently defined:

State variableMeaningUnits
Ki[K]imillimolar
Nai[Na]imillimolar
Cai[Ca]imicromolar
Cab[Ca] bound to troponinmicromolar
CaRel[Ca] in release compartment of SRmicromolar
CaUp[Ca] in uptake compartment of SRmicromolar
ATP[ATP]imillimolar
ADP[ADP]imicromolar

Plug-ins access these state variables using two helper functions provided
get_sv_offset()
getPutSV()