openCARP
Doxygen code documentation for the open cardiac electrophysiology simulator openCARP
Classes | Typedefs | Enumerations | Functions | Variables
limpet Namespace Reference

Classes

union  _event_class
 
union  _stretch
 
struct  action_potential
 
struct  ap_event
 
struct  ap_events
 
struct  auxotonicStretch
 
struct  cell_geom
 
struct  Clamp
 
struct  d_OdeVec
 
struct  event_mx_rate
 
struct  event_mx_val
 
struct  event_timing
 
struct  event_x_threshold
 
struct  GVEC_DUMP
 
struct  IMPinfo
 
struct  IOCtrl
 
class  IonIf
 Child class of IonIfBase specialized for each ionic model type. More...
 
class  IonIfBase
 Represents the ionic model and plug-in (IMP) data structure. More...
 
class  IonType
 Abstract class representing an ionic model type. More...
 
struct  isoSarcoStretch
 
struct  isoStretch
 
class  LimpetData
 
struct  LUT
 lookup table structure More...
 
class  MULTI_IF
 
struct  pulseStretch
 
struct  restitute_dynamic
 
struct  restitute_S1S2
 
struct  restitution
 
struct  steady_state_ap
 
struct  SV_DUMP
 data structure to manage state variable file dumps More...
 
struct  SV_TAB
 array of stat variable structures More...
 
struct  TargetAllocator
 Allocator structure for dynamically allocating memory on multiple targets. More...
 
struct  tc_grp
 time constant groups More...
 
struct  trace
 manage input, output, resampling of traces More...
 
struct  Trace_Info
 data structure to manage trace dumps. Should eventually be combined with the state variable dumps, but I'm keeping it separate for now for my own sanity. More...
 
struct  TrgList
 
struct  ts
 time stepper More...
 

Typedefs

typedef enum limpet::_act_events act_events
 
typedef enum limpet::_repol_events repol_events
 
typedef enum limpet::_ampl_events ampl_events
 
typedef enum limpet::_event_meth event_meth
 
typedef union limpet::_event_class event_class
 
typedef enum limpet::_ap_states ap_states
 
typedef float Gatetype
 
typedef GlobalData_t(* SVgetfcn) (IonIfBase &, int, int)
 
typedef void(* SVputfcn) (IonIfBase &, int, int, GlobalData_t)
 
typedef char IIF_Mask_t
 
using IonTypeList = std::vector< std::reference_wrapper< IonType > >
 
typedef SF_real GlobalData_t
 
typedef double LUT_data_t
 
typedef double Real
 
typedef enum limpet::_r_protocol r_prtcl
 
typedef enum limpet::_stretch_protocol s_prtcl
 
typedef union limpet::_stretch stretch
 
typedef enum limpet::ip_method IpMeth_t
 

Enumerations

enum  _act_events { xAPD90, VmDotMx, nActEvents }
 
enum  _repol_events { APD90, APD30, nRepolEvents }
 
enum  _ampl_events { VmMX, VmMN, nAmplEvents }
 
enum  _event_meth { X_THRESHOLD, MX_RATE, MX_VAL }
 
enum  _ap_states { AP_STATE, DI_STATE }
 
enum  TimerIDs {
  CON_TM_IDX, SVD_TM_IDX, STA_TM_IDX, SSV_TM_IDX,
  STM_TM_IDX, LIGHT_TM_IDX, TRACE_TM_IDX, CLAMP_TM_IDX,
  DOPPLE_TM_IDX, RES_SAVE_TM_IDX, N_TIMERS
}
 
enum  timingIDs {
  SETUP_IDX, INIT_IDX, LOOP_IDX, ODE_IDX,
  N_TIMINGS
}
 
enum  DataType {
  dtype_Gatetype, dtype_Real, dtype_Float, dtype_Char,
  dtype_Integer, dtype_Double, dtype_Short, dtype_GlobalData_t,
  dtype_long, dtype_bool
}
 data type IDs More...
 
enum  _r_protocol { S1S2, DYNAMIC, S1S2_fast }
 
enum  _stretch_protocol { STRAIN_PULSE, ISOMETRIC, ISOSARCOMETRIC, AUXOTONIC }
 
enum  Target {
  AUTO = -2, UNKNOWN = -1, CPU, MLIR_CPU,
  MLIR_ROCM, MLIR_CUDA, N_TARGETS
}
 enum that represents different targets to run ionic models on. More...
 
enum  ip_method { _LINEAR_IP, _NEAREST_IP }
 

Functions

void shift_vm_trace (double vm, action_potential *AP, timer_manager *tm)
 
bool check_threshold (ap_event *e, timer_manager *tm)
 
bool check_mx_rate (ap_event *e, timer_manager *tm)
 
bool check_mx_val (ap_event *e, timer_manager *tm)
 
bool update_steady_state (action_potential *AP)
 
void print_AP_stats (action_potential *AP)
 
int initialize_AP_analysis (action_potential *AP)
 
void cleanup_AP_analysis (action_potential *AP)
 
void calibrate_thresholds (action_potential *AP)
 
bool check_events (double vm, action_potential *AP, timer_manager *tm)
 
bool check_steady_state (steady_state_ap *ss)
 
void print_AP_stats_header (action_potential *AP, FILE *outbuf)
 
bool check_events (double vm, action_potential *AP, opencarp::timer_manager *tm)
 
void determine_stim_list (char *stl, TrgList *trg, bool DIAs)
 
int write_dump_header (GVEC_DUMP *gvd, SV_DUMP *svd, const char *ExpID)
 
void open_globalvec_dump (FILE **fhdls, GVEC_DUMP *gvd, MULTI_IF *pMIIF, char *base_name, IOCtrl *io)
 
void globalvec_dump (FILE **fhdls, GVEC_DUMP *gvd, MULTI_IF *pMIIF, timer_manager *tmo, IOCtrl *io, int numNode)
 
void close_globalvec_dump (FILE **fhdls, GVEC_DUMP *gvd, IOCtrl *io)
 
void dump_all (MULTI_IF *MIIF, int reg, char *imp, char *plugs, double t, double ddt, char *fout)
 
void initialize_timings (event_timing *t)
 
void update_timing (event_timing *t, double event_duration)
 
double getCellVal (sf_vec *v, int ind)
 
void initial_SVs (MULTI_IF *miif, char *SVs, char *imp, char *plgins, int num)
 
void print_param_help (IonType *im, IonTypeList &plugs)
 
float determine_duration (struct gengetopt_args_info *p, TrgList *stim_lst)
 determine time of last stimulus More...
 
void globalvec_dump (FILE **fhdls, GVEC_DUMP *gvd, MULTI_IF *pMIIF, opencarp::timer_manager *tm, IOCtrl *io, int numNode)
 
double getCellVal (opencarp::sf_vec *v, int ind)
 
bool initialize_clamp (Clamp *cl, double cl_val, double ini_val, double start, double dur, const char *f, int trans, float *duration)
 
void clamp_signal (MULTI_IF *pMIIF, Clamp *cl, timer_manager *tm)
 
void initialize_sv_clamp (Clamp *cl, const char *sv, char *file, double dt)
 
void sv_clamp (Clamp *cl, timer_manager *tm, MULTI_IF *miif, bool trigger)
 
void AP_clamp (Clamp *cl, timer_manager *tm, sf_vec *v, bool trigger)
 
int process_sv_clamps (char *SVs, char *files, Clamp **clamps, double dt)
 
void clamp_signal (MULTI_IF *pMIIF, Clamp *cl, opencarp::timer_manager *tm)
 
void sv_clamp (Clamp *cl, opencarp::timer_manager *tm, MULTI_IF *, bool trigger)
 
void initialize_AP_clamp (Clamp *cl, char *f, double)
 
void AP_clamp (Clamp *cl, opencarp::timer_manager *tm, opencarp::sf_vec *v, bool trigger)
 
char * tokstr_r (char *s1, const char *s2, char **lasts)
 
void initialize_ts (Target target, ts *tstp, int ng, int *skp, double dt)
 
void update_ts (ts *ptstp)
 
void * memmem (void *haystack, int sz_hay, void *needle, int sz_n)
 
char * get_next_list (char *lst, char delimiter)
 
bool verify_flags (const char *flags, const char *given)
 
bool flag_set (const char *flags, const char *target)
 
void initialize_ts (ts *tstp, int ng, int *skp, double dt)
 
void SV_alloc (SV_TAB *psv, int numSeg, int struct_size)
 
void SV_free (SV_TAB *psv)
 
void free_sv_table (void *)
 
void print_IMPs (void)
 
void print_models (bool)
 
float modify_param (float a, char *expr)
 
int process_param_mod (char *pstr, char *par, char *mod)
 
char * get_typename (int type)
 
int load_ionic_module (const char *)
 
SVputfcn getPutSV (SVgetfcn)
 
template<class T >
constexpr T max (T a, T b)
 
template<class T >
constexpr T min (T a, T b)
 
IonTypeget_ion_type (const std::string &name)
 
void LUT_alloc (LUT *plut, int cols, float mn, float mx, float res, const char *name, Target target)
 
int LUT_dump (LUT *plut, const char *fname)
 
void destroy_lut (LUT *plut, Target target)
 
int check_LUT (LUT *lut)
 
void IIF_warn (const int wv, const char error[])
 
void LUT_problem (LUT *lt, double val, int wv, const char *tabname)
 
int LUT_index (LUT *tab, GlobalData_t val, int locind)
 
int LUT_out_of_bounds (LUT *tab, GlobalData_t val)
 
LUT_data_t LUT_interp (LUT *t, int i, int j, GlobalData_t x)
 
LUT_data_t LUT_derror (LUT *t, int idx, GlobalData_t x)
 
LUT_data_t LUT_interpRow (LUT *const tab, GlobalData_t val, int i, LUT_data_t *row)
 
LUT_data_tLUT_row (LUT *lut, GlobalData_t val, int locind)
 
void LUT_interpRow_n_elements (char *table, char *val_ptr, int offset, int distance, int index, int n, char *row_ptr, int lut_numelements)
 
void IIF_warn (const int wv, const char *error)
 
template<typename T >
T ** build_matrix_ns (int m, int n, int size, Target target)
 
void LUT_interpRow_mlir (char *table, int i, char *row_ptr, int lut_num_elements, int vector_size)
 
void LUT_problem_mlir (char *tab, GlobalData_t val, int locind)
 
void initialize_params_MIIF (MULTI_IF *pMIIF)
 
void initialize_ionic_IF (MULTI_IF *pMIIF)
 
void CreateIIFLocalNodeLsts (MULTI_IF *pMIIF)
 
void CreateIIFNodeLsts_ (int, char *, int **, int ***, int)
 
void alloc_MIIF (MULTI_IF *pMIIF)
 
void initializeIMPData (MULTI_IF *pMIIF)
 
void freeIMPData (MULTI_IF *pMIIF)
 
void allocate_shared_data (MULTI_IF *)
 
int getGlobalNodalIndex (IonIfBase &pIF, int relIdx)
 
void CreateIIFGlobalNodeLsts (MULTI_IF *pMIIF)
 
bool isIMPdata (const char *)
 
int current_global_node (int local_node)
 
float current_global_time ()
 
int should_print_bounds_exceeded_messages ()
 
int set_print_bounds_exceeded_messages (int newval)
 
int int_cmp (const void *a, const void *b)
 
void open_trace (MULTI_IF *MIIF, int n_traceNodes, int *traceNodes, int *label, opencarp::sf_mesh *imesh)
 Set up ionic model traces at some global node numbers. More...
 
void dump_trace (MULTI_IF *MIIF, limpet::Real time)
 
void close_trace (MULTI_IF *MIIF)
 
char * get_sv (void *tab, int offset, int n, int svSize, int size, int dlo_vector_size)
 
int get_plug_flag (char *plgstr, int *out_num_plugins, IonTypeList &out_plugins)
 
int determine_write_ranges (int N, size_t *offset, size_t bufsize, int **ranges)
 
void free_doppel (MULTI_IF *m)
 
void doppel_update (MULTI_IF *orig, MULTI_IF *miif_doppel)
 
void doppel_MIIF (MULTI_IF *orig, MULTI_IF *miif_doppel)
 
int IMPdataLabel2Index (const char *sv)
 
void dup_IMP_node_state (IonIfBase &IF, int from, int to, GlobalData_t **localdata)
 
void * get_IIF_plugparam (IonIfBase &, int)
 
void ODEint_RK (GlobalData_t *y, GlobalData_t *ydot, void f(GlobalData_t *, GlobalData_t *, void *), void *f_data, int len, GlobalData_t dt)
 
void ODEint_FE (GlobalData_t *y, GlobalData_t *ydot, void *f, void *f_data, int len, GlobalData_t dt)
 
void d_ODEint_RK (d_OdeVec *y, d_OdeVec *ydot, void f(GlobalData_t *, d_OdeVec *, void *), void *f_data, GlobalData_t dt)
 
void d_ODEint_FE (d_OdeVec *y, d_OdeVec *ydot, void *f, void *f_data, GlobalData_t dt)
 
void get_protocol_definition (char *r_file, restitution *r, bool useS1S2)
 
int read_restitution_protocol_def (char *r_file, restitution *r)
 
void restitution_trigger_list (char *r_file, restitution *r, char *protocol, int *n_dop, double **t_dop)
 
void restitution_save_sv (MULTI_IF *miif, int R1, restitution *r, action_potential *AP)
 
void rbCalcKi (float **K, float **, float *X, int *ludI, void(*calcDX)(float *, float *, void *), void *params, float h, int N, int i)
 
void rbSolver (float **, float *, float *, int N)
 
void fludcmp0 (float **, int n, int *indx, float *)
 
void flubksb0 (float **, int n, int *indx, float *)
 
void fludcmp (float **, int, int *, float *)
 
void flubksb (float **, int, int *, float *)
 
void rbStepX (float *X, void(*calcDX)(float *, float *, void *), void(*calcJ)(float **, float *, void *, int), void *params, float h, int N)
 
void apply_stretch_pulse (MULTI_IF *miif, pulseStretch *s, timer_manager *tm)
 
void initializePulseStretch (float strain, float onset, float duration, float rise, float fall, stretch *s)
 
void apply_stretch (MULTI_IF *miif, stretch *s, timer_manager *tm)
 
void apply_stretch (MULTI_IF *miif, stretch *s, opencarp::timer_manager *tm)
 
int read_sv (MULTI_IF *, int, const char *)
 
void save_sv (MULTI_IF *, int, const char *)
 
void open_trace (MULTI_IF *, int, int *, int *)
 
void set_start_time (const float)
 
Target get_target_from_string (std::string const str)
 Returns a value from the Target enum from a given string. More...
 
std::string get_string_from_target (Target const target)
 Get a string representation of a given target. More...
 
std::string get_target_list_string ()
 Returns a string containing the list of available targets. More...
 
bool is_gpu (Target const target)
 Checks if this is a GPU target. More...
 
bool is_concrete (Target const target)
 Checks if target is a real, concrete target. More...
 
template<typename T >
T * allocate_on_target (Target target, std::size_t n, bool always_managed=false, bool do_zero=true)
 Utility function for allocating memory on a target. See TargetAllocator. More...
 
template<typename T >
void deallocate_on_target (Target target, T *ptr)
 Utility function for deallocating memory on a target. See TargetAllocator. More...
 
bool IsEquDistSampling (trace *tr)
 
int read_trace (trace *tr, const char *name)
 
void free_trace (trace *tr)
 
void resample_trace (trace *tr, double dt)
 
double trace_duration (trace *tr, const char *f)
 
void interp1 (const double *x, const float *y, int N, double *xi, float *yi, int NI, double dxi, IpMeth_t meth)
 

Variables

FILE_SPEC _nc_logf = NULL
 
int * curr_node_list
 needed to determine the global node number More...
 

Detailed Description

Note
All numerical IDs and flags are automatically generated

Units for all IMPS must be

vm - mV (transmembrane potential) [Ca]_i - micromolar (intracellular calcium) [Ca]_b - micromolar (troponin bound calcium) t - ms (time) Lambda - normalized (stretch ratio) delLambda - 1/ms (stretch rate) Tension - kPa (active stress) [Na]_e - millimolar (extracellular sodium) [K]_e - millimolar (extracellular potassium) [Ca]_e - micromolar (extracellular calcium) Iion - uA/cm^2 (ionic current)

Typedef Documentation

◆ act_events

◆ ampl_events

◆ ap_states

◆ event_class

◆ event_meth

◆ Gatetype

typedef float limpet::Gatetype

Definition at line 45 of file ion_type.h.

◆ GlobalData_t

Definition at line 27 of file limpet_types.h.

◆ IIF_Mask_t

typedef char limpet::IIF_Mask_t

Definition at line 50 of file ion_type.h.

◆ IonTypeList

using limpet::IonTypeList = typedef std::vector<std::reference_wrapper<IonType> >

Definition at line 288 of file ion_type.h.

◆ IpMeth_t

◆ LUT_data_t

typedef double limpet::LUT_data_t

Definition at line 34 of file LUT.h.

◆ r_prtcl

◆ Real

typedef double limpet::Real

Definition at line 151 of file MULTI_ION_IF.h.

◆ repol_events

◆ s_prtcl

◆ stretch

◆ SVgetfcn

typedef GlobalData_t(* limpet::SVgetfcn) (IonIfBase &, int, int)

Definition at line 48 of file ion_type.h.

◆ SVputfcn

typedef void(* limpet::SVputfcn) (IonIfBase &, int, int, GlobalData_t)

Definition at line 49 of file ion_type.h.

Enumeration Type Documentation

◆ _act_events

Enumerator
xAPD90 
VmDotMx 
nActEvents 

Definition at line 56 of file ap_analyzer.cc.

◆ _ampl_events

Enumerator
VmMX 
VmMN 
nAmplEvents 

Definition at line 58 of file ap_analyzer.cc.

◆ _ap_states

Enumerator
AP_STATE 
DI_STATE 

Definition at line 85 of file ap_analyzer.h.

◆ _event_meth

Enumerator
X_THRESHOLD 
MX_RATE 
MX_VAL 

Definition at line 35 of file ap_analyzer.h.

◆ _r_protocol

Enumerator
S1S2 
DYNAMIC 
S1S2_fast 

Definition at line 27 of file restitute.h.

◆ _repol_events

Enumerator
APD90 
APD30 
nRepolEvents 

Definition at line 57 of file ap_analyzer.cc.

◆ _stretch_protocol

Enumerator
STRAIN_PULSE 
ISOMETRIC 
ISOSARCOMETRIC 
AUXOTONIC 

Definition at line 27 of file stretch.h.

◆ DataType

data type IDs

Enumerator
dtype_Gatetype 
dtype_Real 
dtype_Float 
dtype_Char 
dtype_Integer 
dtype_Double 
dtype_Short 
dtype_GlobalData_t 
dtype_long 
dtype_bool 

Definition at line 83 of file bench_utils.h.

◆ ip_method

Enumerator
_LINEAR_IP 
_NEAREST_IP 

Definition at line 36 of file trace.h.

◆ Target

enum that represents different targets to run ionic models on.

Enumerator
AUTO 
UNKNOWN 

special value to handle unknown targets

CPU 

baseline CPU model generated with the original opencarp code generator

MLIR_CPU 

vectorized CPU code generated with MLIR

MLIR_ROCM 

ROCM code for AMD GPUs generated with MLIR.

MLIR_CUDA 

CUDA code for NVIDIA GPUs generated with MLIR.

N_TARGETS 

a token to indicate the maximum number of targets

Definition at line 45 of file target.h.

◆ TimerIDs

Enumerator
CON_TM_IDX 
SVD_TM_IDX 
STA_TM_IDX 
SSV_TM_IDX 
STM_TM_IDX 
LIGHT_TM_IDX 
TRACE_TM_IDX 
CLAMP_TM_IDX 
DOPPLE_TM_IDX 
RES_SAVE_TM_IDX 
N_TIMERS 

Definition at line 27 of file bench_utils.h.

◆ timingIDs

Enumerator
SETUP_IDX 

timing for setup phase

INIT_IDX 

timing for initialization

LOOP_IDX 

timing for main loop (including IO and ODE solve)

ODE_IDX 

timing for ODE solve

N_TIMINGS 

number of benchmark timings we use

Definition at line 74 of file bench_utils.h.

Function Documentation

◆ alloc_MIIF()

void limpet::alloc_MIIF ( MULTI_IF pMIIF)

allocate memory for MIIF structure

Parameters
pMIIFMIIF
Postcondition
IMPs are usable

Definition at line 221 of file MULTI_ION_IF.cc.

Here is the caller graph for this function:

◆ allocate_on_target()

template<typename T >
T* limpet::allocate_on_target ( Target  target,
std::size_t  n,
bool  always_managed = false,
bool  do_zero = true 
)

Utility function for allocating memory on a target. See TargetAllocator.

Parameters
targettarget to allocate on
nsize of the memory to allocate (size of the array of type T)
always_managedwhether to use managed memory for GPU allocations

Definition at line 300 of file target.h.

◆ allocate_shared_data()

void limpet::allocate_shared_data ( MULTI_IF miif)

allocate the global vectors which are shared amongst IMPs

They may be manually allocated. If the Vm vector is preallocated, all vectors copy its distribution

Parameters
[in]miifMulti ion IF structure
Precondition
Vm is allocated for PETsc runs
Postcondition
all required shared data vectors are allocated

Definition at line 1657 of file MULTI_ION_IF.cc.

Here is the caller graph for this function:

◆ AP_clamp() [1/2]

void limpet::AP_clamp ( Clamp cl,
opencarp::timer_manager tm,
opencarp::sf_vec v,
bool  trigger 
)

◆ AP_clamp() [2/2]

void limpet::AP_clamp ( Clamp cl,
timer_manager *  tm,
sf_vec *  v,
bool  trigger 
)

apply a Action potential clamp, let it float if outside the trace

Parameters
clclamp
tmtimer manager
miifVm
triggertrue if current stimulus started

Definition at line 178 of file clamp.cc.

Here is the caller graph for this function:

◆ apply_stretch() [1/2]

void limpet::apply_stretch ( MULTI_IF miif,
stretch s,
timer_manager *  tm 
)

Definition at line 55 of file stretch.cc.

Here is the caller graph for this function:

◆ apply_stretch() [2/2]

void limpet::apply_stretch ( MULTI_IF miif,
stretch s,
opencarp::timer_manager tm 
)

◆ apply_stretch_pulse()

void limpet::apply_stretch_pulse ( MULTI_IF miif,
pulseStretch s,
timer_manager *  tm 
)

Definition at line 73 of file stretch.cc.

Here is the caller graph for this function:

◆ build_matrix_ns()

template<typename T >
T** limpet::build_matrix_ns ( int  m,
int  n,
int  size,
Target  target 
)

build an mXn matrix

Parameters
mnumber of rows
nnumber of columns
sizesize in bytes of each entry
Returns
pointer to an array of pointers to the matrix rows

Definition at line 99 of file LUT.h.

◆ calibrate_thresholds()

void limpet::calibrate_thresholds ( action_potential AP)

calibrate threshold values based on current AP amplitudes

Parameters
APaction potential statistics
Postcondition
thresholds for APD90 and APD30 adjusted

Definition at line 227 of file ap_analyzer.cc.

Here is the caller graph for this function:

◆ check_events() [1/2]

bool limpet::check_events ( double  vm,
action_potential AP,
opencarp::timer_manager tm 
)

◆ check_events() [2/2]

bool limpet::check_events ( double  vm,
action_potential AP,
timer_manager *  tm 
)

check whether an event has been detected and update parameters such as APD or DI accordingly

Parameters
vmcurrent value of AP
APaction potential statistics
tmtimer manager
Returns
true, if an activation has been triggered, false otherwise

Definition at line 263 of file ap_analyzer.cc.

Here is the caller graph for this function:

◆ check_LUT()

int limpet::check_LUT ( LUT lut)

Definition at line 129 of file LUT.cc.

◆ check_mx_rate()

bool limpet::check_mx_rate ( ap_event e,
timer_manager *  tm 
)

check whether a maximum rate of change event has occurred

Parameters
eevent
tmtimer manager
Returns
true, if a maximum rate event has occured, false otherwise

Definition at line 445 of file ap_analyzer.cc.

Here is the caller graph for this function:

◆ check_mx_val()

bool limpet::check_mx_val ( ap_event e,
timer_manager *  tm 
)

check whether a maximum value event has occurred

Parameters
eevent
tmtimer manager
Returns
true, if a maximum value event has occurred, false otherwise

Definition at line 475 of file ap_analyzer.cc.

Here is the caller graph for this function:

◆ check_steady_state()

bool limpet::check_steady_state ( steady_state_ap ss)

check whether we are in steady state

Parameters
APaction potential statistics
Returns
true, if AP is in steady state, false otherwise

Definition at line 398 of file ap_analyzer.cc.

Here is the caller graph for this function:

◆ check_threshold()

bool limpet::check_threshold ( ap_event e,
timer_manager *  tm 
)

check whether a threshold crossing event has occurred

Parameters
eevent
tmtimer manager
Returns
true, if a threshold has been crossed, false otherwise

Definition at line 415 of file ap_analyzer.cc.

Here is the caller graph for this function:

◆ clamp_signal() [1/2]

void limpet::clamp_signal ( MULTI_IF pMIIF,
Clamp cl,
opencarp::timer_manager tm 
)

◆ clamp_signal() [2/2]

void limpet::clamp_signal ( MULTI_IF pMIIF,
Clamp cl,
timer_manager *  tm 
)

Definition at line 69 of file clamp.cc.

Here is the caller graph for this function:

◆ cleanup_AP_analysis()

void limpet::cleanup_AP_analysis ( action_potential AP)

clean up AP analysis, free memory and close files

Parameters
APaction potential statistics
Postcondition
dynamically allocated data freed, files closed

Definition at line 169 of file ap_analyzer.cc.

Here is the caller graph for this function:

◆ close_globalvec_dump()

void limpet::close_globalvec_dump ( FILE **  fhdls,
GVEC_DUMP gvd,
IOCtrl io 
)

Definition at line 315 of file bench_utils.cc.

Here is the caller graph for this function:

◆ close_trace()

void limpet::close_trace ( MULTI_IF MIIF)

Definition at line 452 of file MULTI_ION_IF.cc.

Here is the caller graph for this function:

◆ CreateIIFGlobalNodeLsts()

void limpet::CreateIIFGlobalNodeLsts ( MULTI_IF pMIIF)

◆ CreateIIFLocalNodeLsts()

void limpet::CreateIIFLocalNodeLsts ( MULTI_IF pMIIF)

map the node order to the ionic model node order

Definition at line 141 of file MULTI_ION_IF.cc.

Here is the caller graph for this function:

◆ CreateIIFNodeLsts_()

void limpet::CreateIIFNodeLsts_ ( int  N_IIF,
IIF_Mask_t IIF_Mask,
int **  N_Nodes,
int ***  NodeLists,
int  numNode 
)

map the node order to the ionic model node order

Parameters
N_IIFNumber of IIFs
IIF_Mask
[out]N_NodesNumber of nodes per IIF
[out]NodeListsList of node number for each IIF
lowlower bound of partition
highhigher bound of partition
Postcondition
N_Nodes and NodeLists allocated and filled in.

Definition at line 157 of file MULTI_ION_IF.cc.

Here is the caller graph for this function:

◆ current_global_node()

int limpet::current_global_node ( int  local_node)

Definition at line 118 of file MULTI_ION_IF.cc.

◆ current_global_time()

float limpet::current_global_time ( )

Definition at line 122 of file MULTI_ION_IF.cc.

◆ d_ODEint_FE()

void limpet::d_ODEint_FE ( d_OdeVec y,
d_OdeVec ydot,
void *  f,
void *  f_data,
GlobalData_t  dt 
)

ODEint_FE

Simple forward Euler ODE integrator

Integration of ydot = f(y,t)

y[t+dt] = y[t] + f(y[t])*dt

Parameters
yvalue
ydotvalue of f(y,t)
ffunction f(y,t)
f_datadata needed for function evaluation
dttime step

Definition at line 134 of file ODEint.cc.

◆ d_ODEint_RK()

void limpet::d_ODEint_RK ( d_OdeVec y,
d_OdeVec ydot,
void   fGlobalData_t *, d_OdeVec *, void *,
void *  f_data,
GlobalData_t  dt 
)

ODEint_RK

Runge Kutta first order ODE integrator

Integration of ydot = f(y,t)

k1 = dt*f( t, y(t) ) k2 = dt*f( t+0.5*dt, y(t)+0.5*k1 ); y(t+dt) = y(t) + k2 + O(dt^3)

Parameters
yvalue
ydotvalue of f(y,t)
ffunction f(y,t)
f_datadata needed for function evaluation
dttime step

Definition at line 99 of file ODEint.cc.

◆ deallocate_on_target()

template<typename T >
void limpet::deallocate_on_target ( Target  target,
T *  ptr 
)

Utility function for deallocating memory on a target. See TargetAllocator.

Parameters
targettarget to deallocate on (this should be the target on which memory was allocated)
ptrpointer to memory to deallocate

Definition at line 314 of file target.h.

Here is the caller graph for this function:

◆ destroy_lut()

void limpet::destroy_lut ( LUT plut,
Target  target 
)

destroy LUT

Parameters
plutpointer to lut

Definition at line 101 of file LUT.cc.

Here is the caller graph for this function:

◆ determine_duration()

float limpet::determine_duration ( struct gengetopt_args_info *  p,
TrgList stim_lst 
)

determine time of last stimulus

Parameters
pcommand line options
stim_lststimulus list
Returns
the time of the last stimulus

Definition at line 503 of file bench_utils.cc.

Here is the caller graph for this function:

◆ determine_stim_list()

void limpet::determine_stim_list ( char *  stl,
TrgList trg,
bool  DIAs 
)

determine the stimulation times from the list

Parameters
stlstimulus timing list separated by commas
trgstructure to hold the info
DIAsinterpret times as diastolic intervals?
Postcondition
memory allocated in the trigger for the sorted list of stimulus times

Definition at line 101 of file bench_utils.cc.

Here is the caller graph for this function:

◆ determine_write_ranges()

int limpet::determine_write_ranges ( int  N,
size_t *  offset,
size_t  bufsize,
int **  ranges 
)

determine which variables are output each write

This troutine assumes there is an output buffer of size bufsize which is continuously filled and then output. Each node has a certain amount of data associated with it, contained in offset. This routine determines how many times the buffer must be filled and output, as well as deermining the range of nodes to be output with each buffer write

Parameters
Ntotal number of nodes
offsetbyte offsets of nodes, significant only on root
bufsizeoutput buffer size
[out]rangesnode range of each write
Note
ranges is allocated and can be free()'d
Returns
the number of writes

Definition at line 993 of file MULTI_ION_IF.cc.

◆ doppel_MIIF()

void limpet::doppel_MIIF ( MULTI_IF orig,
MULTI_IF miif_doppel 
)

make the minimal copy of a MIIF to run independently

Parameters
origthe original MIIF
doppelthe copy
Note
the only memory copied is that for the state variables and private data of the ionic models. All other dynamically allocated chunks are shared. Private data cannot have dynamically allocated chunks which are updated

Definition at line 1855 of file MULTI_ION_IF.cc.

Here is the caller graph for this function:

◆ doppel_update()

void limpet::doppel_update ( MULTI_IF orig,
MULTI_IF miif_doppel 
)

update the data of a doppel MIIF without allocating any memory

Parameters
doppelthe copy
origthe one to copy
Postcondition
doppel will be in the same state os orig

Definition at line 1827 of file MULTI_ION_IF.cc.

Here is the caller graph for this function:

◆ dump_all()

void limpet::dump_all ( MULTI_IF MIIF,
int  reg,
char *  imp,
char *  plugs,
double  t,
double  ddt,
char *  fout 
)

Definition at line 344 of file bench_utils.cc.

Here is the caller graph for this function:

◆ dump_trace()

void limpet::dump_trace ( MULTI_IF MIIF,
limpet::Real  time 
)

dump the traces from a node

Parameters
MIIFthe ionic region
timetime of dump

We need the trace output in a buffer so we can pass it to the root for output. The trace function of the IMPs requires a file stream for the fprintf statements and on the GPU, there is a print statement which really copies the data to the host for printing on stdout which we redirect to our desired file stream. We use fmemopen() to associate a file stream with memory and trick everyone into writing into the buffer.

Note
A maximum line length of 8196 bytes is supported

Definition at line 409 of file MULTI_ION_IF.cc.

Here is the caller graph for this function:

◆ dup_IMP_node_state()

void limpet::dup_IMP_node_state ( IonIfBase IF,
int  from,
int  to,
GlobalData_t **  localdata 
)

Definition at line 1912 of file MULTI_ION_IF.cc.

Here is the caller graph for this function:

◆ flag_set()

bool limpet::flag_set ( const char *  flags,
const char *  target 
)

determine if a flag is present in a string of flags separated by "|"

Parameters
flagsthe string of all flags
targetthe specific flag
Returns
true if target is in flags, false otherwise

Definition at line 551 of file ION_IF.cc.

Here is the caller graph for this function:

◆ flubksb()

void limpet::flubksb ( float **  a,
int  n,
int *  indx,
float *  b 
)

Definition at line 378 of file Rosenbrock.cc.

Here is the caller graph for this function:

◆ flubksb0()

void limpet::flubksb0 ( float **  a,
int  n,
int *  indx,
float *  b 
)

solve an LU decomposed dense float matrix by back/forward substitution

Parameters
athe matrix
norder of a
indxpermutation vector
bRHS
Postcondition
b is modified to the solution
Note
base 0 vectors and matrices

Definition at line 285 of file Rosenbrock.cc.

Here is the caller graph for this function:

◆ fludcmp()

void limpet::fludcmp ( float **  a,
int  n,
int *  indx,
float *  d 
)

Definition at line 301 of file Rosenbrock.cc.

Here is the caller graph for this function:

◆ fludcmp0()

void limpet::fludcmp0 ( float **  a,
int  n,
int *  indx,
float *  d 
)

LU decompose a dense float matrix

Parameters
athe matrix
norder of a
indxpermutation vector
dneeded for the determinant
Postcondition
a is LU decomposed
Note
base 0 vectors and matrices

Definition at line 258 of file Rosenbrock.cc.

Here is the caller graph for this function:

◆ free_doppel()

void limpet::free_doppel ( MULTI_IF m)

release the memory of the doppel

Parameters
doppelthe doppel of course
Postcondition
doppel is zeroed

Definition at line 1803 of file MULTI_ION_IF.cc.

Here is the caller graph for this function:

◆ free_sv_table()

void limpet::free_sv_table ( void *  )
Here is the caller graph for this function:

◆ free_trace()

void limpet::free_trace ( trace tr)

free memory used to read trace from a file

Parameters
trtrace
Postcondition
trace memory freed.

Definition at line 76 of file trace.cc.

Here is the caller graph for this function:

◆ freeIMPData()

void limpet::freeIMPData ( MULTI_IF pMIIF)

Definition at line 797 of file MULTI_ION_IF.cc.

Here is the caller graph for this function:

◆ get_IIF_plugparam()

void* limpet::get_IIF_plugparam ( IonIfBase ,
int   
)
Here is the caller graph for this function:

◆ get_ion_type()

IonType* limpet::get_ion_type ( const std::string &  name)
Here is the caller graph for this function:

◆ get_next_list()

char * limpet::get_next_list ( char *  lst,
char  delimiter 
)

return pointer to the next item in a list

the next delimiter in lst is replaced with a '\0'

Parameters
lststring of separated items
delimiterlist item separator
Return values
NULLthe end of the list has been reached
pointerto the next item in the list

Definition at line 506 of file ION_IF.cc.

Here is the caller graph for this function:

◆ get_plug_flag()

int limpet::get_plug_flag ( char *  plgstr,
int *  out_num_plugins,
IonTypeList out_plugins 
)

determine IMP plugin flag

Parameters
plgstrcolon separated list of plugin names
out_num_pluginsnumber of plugins found
out_pluginsplugin array
Postcondition
out_plugins is allocated and out_num_plugins set
Returns
1 if found and 0 if not found

Definition at line 821 of file MULTI_ION_IF.cc.

Here is the caller graph for this function:

◆ get_protocol_definition()

void limpet::get_protocol_definition ( char *  r_file,
restitution r,
bool  useS1S2 
)

Definition at line 169 of file restitute.cc.

Here is the caller graph for this function:

◆ get_string_from_target()

std::string limpet::get_string_from_target ( Target const  target)

Get a string representation of a given target.

Parameters
targettarget to get the string of
Returns
a string representing the given enum value target. returns "unknown" if the target is unknown.

Definition at line 46 of file target.cc.

Here is the caller graph for this function:

◆ get_sv()

char* limpet::get_sv ( void *  tab,
int  offset,
int  n,
int  svSize,
int  size,
int  dlo_vector_size 
)

load a particular state variable into an array

Parameters
tabstate variable array
offsetoffset of variable into table
n#nodes
svSizesize of structure holding all SVs
sizesize of state variable
Returns
pointer to a buffer which must be free'd afterwards

Definition at line 530 of file MULTI_ION_IF.cc.

Here is the caller graph for this function:

◆ get_target_from_string()

Target limpet::get_target_from_string ( std::string const  str)

Returns a value from the Target enum from a given string.

Parameters
strlower case string corresponding to an enum member
Returns
an enum value corresponding to the given string, or Target::UNKNOWN if the string cannot be matched

Definition at line 36 of file target.cc.

Here is the caller graph for this function:

◆ get_target_list_string()

std::string limpet::get_target_list_string ( )

Returns a string containing the list of available targets.

Returns
a string containing a comma-separated list of targets.

Definition at line 55 of file target.cc.

Here is the caller graph for this function:

◆ get_typename()

char* limpet::get_typename ( int  type)
Here is the caller graph for this function:

◆ getCellVal() [1/2]

double limpet::getCellVal ( opencarp::sf_vec v,
int  ind 
)

◆ getCellVal() [2/2]

double limpet::getCellVal ( sf_vec *  v,
int  ind 
)

Definition at line 392 of file bench_utils.cc.

Here is the caller graph for this function:

◆ getGlobalNodalIndex()

int limpet::getGlobalNodalIndex ( IonIfBase pIF,
int  rIdx 
)

helper function to retrieve global nodal index number from within an imp

Parameters
[in]pIFpointer to imp
[in]rIdxrelative index of cell within imp
Returns
global index of cell

Definition at line 205 of file MULTI_ION_IF.cc.

◆ getPutSV()

SVputfcn limpet::getPutSV ( SVgetfcn  )
Here is the caller graph for this function:

◆ globalvec_dump() [1/2]

void limpet::globalvec_dump ( FILE **  fhdls,
GVEC_DUMP gvd,
MULTI_IF pMIIF,
opencarp::timer_manager tm,
IOCtrl io,
int  numNode 
)

◆ globalvec_dump() [2/2]

void limpet::globalvec_dump ( FILE **  fhdls,
GVEC_DUMP gvd,
MULTI_IF pMIIF,
timer_manager *  tmo,
IOCtrl io,
int  numNode 
)

dump the global vectors

Parameters
fhdlsoutput file
gvd
pMIIFIMP structure
tmotimer
io

Definition at line 272 of file bench_utils.cc.

Here is the caller graph for this function:

◆ IIF_warn() [1/2]

void limpet::IIF_warn ( const int  wv,
const char *  error 
)

◆ IIF_warn() [2/2]

void limpet::IIF_warn ( const int  wv,
const char  error[] 
)

print an error message to the terminaldetermine why index into a lookup table failed

Parameters
errorstring error message.
Note
if IMP_FAST is defined, this function is implemented as a macro which does no bounds checking

Definition at line 155 of file LUT.cc.

Here is the caller graph for this function:

◆ IMPdataLabel2Index()

int limpet::IMPdataLabel2Index ( const char *  sv)

figure out global IMP data vector index within array from a given name

Parameters
[in]svname of IMP data vector
Returns
index of IMP data vector within array

Definition at line 1894 of file MULTI_ION_IF.cc.

Here is the caller graph for this function:

◆ initial_SVs()

void limpet::initial_SVs ( MULTI_IF miif,
char *  SVs,
char *  imp,
char *  plgins,
int  num 
)

Definition at line 412 of file bench_utils.cc.

Here is the caller graph for this function:

◆ initialize_AP_analysis()

int limpet::initialize_AP_analysis ( action_potential AP)

initialize AP structure for gathering AP statistics

Parameters
APaction potential statistics
Postcondition
action potential structure initialized
Allocates : event lists
Returns
for now we return 0 only

Definition at line 71 of file ap_analyzer.cc.

Here is the caller graph for this function:

◆ initialize_AP_clamp()

void limpet::initialize_AP_clamp ( Clamp cl,
char *  f,
double   
)

◆ initialize_clamp()

bool limpet::initialize_clamp ( Clamp cl,
double  cl_val,
double  ini_val,
double  start,
double  dur,
const char *  f,
int  trans,
float *  duration 
)

voltage clamp experiment

Parameters
clclamp structure
valvalue of clamp
durduration
startwhen to start
ffile to read for clamp signal
transfalse for clamping outside of pulse, o.w. index of timer
durationOUT duration of clamp

Definition at line 45 of file clamp.cc.

Here is the caller graph for this function:

◆ initialize_ionic_IF()

void limpet::initialize_ionic_IF ( MULTI_IF pMIIF)

initlaize the ionic interfaces

Parameters
pMIIFMIIF

Definition at line 261 of file MULTI_ION_IF.cc.

Here is the caller graph for this function:

◆ initialize_params_MIIF()

void limpet::initialize_params_MIIF ( MULTI_IF pMIIF)

initialize the parameters of the ionic models with default values

Parameters
pMIIFMIIF

Definition at line 252 of file MULTI_ION_IF.cc.

Here is the caller graph for this function:

◆ initialize_sv_clamp()

void limpet::initialize_sv_clamp ( Clamp cl,
const char *  sv,
char *  file,
double  dt 
)

initialize a [Ca]_i transient

Parameters
clclamp
svstate variable
filefile from which to read transient
dttime step

Definition at line 117 of file clamp.cc.

Here is the caller graph for this function:

◆ initialize_timings()

void limpet::initialize_timings ( event_timing t)

Definition at line 366 of file bench_utils.cc.

Here is the caller graph for this function:

◆ initialize_ts() [1/2]

void limpet::initialize_ts ( Target  target,
ts tstp,
int  ng,
int *  skp,
double  dt 
)

initialize_ts

Initialize the time stepping structure which determines whether or not a particular time constant group needs to be updated or not.

Parameters
targettarget on which data will be allocated
tspointer to time stepper structure
ngnumber of time constant groups
skpskip values for each group relative to the fastest group
dttime step of fastest group

Definition at line 431 of file ION_IF.cc.

Here is the caller graph for this function:

◆ initialize_ts() [2/2]

void limpet::initialize_ts ( ts tstp,
int  ng,
int *  skp,
double  dt 
)

◆ initializeIMPData()

void limpet::initializeIMPData ( MULTI_IF pMIIF)

allocate memory for the structures to hold real data for IMPs and check that all needed data is passed

Postcondition
For each Ionic model, an array of IMPDataStruct is created with each entry pointing to the local portion of the data

Definition at line 689 of file MULTI_ION_IF.cc.

Here is the caller graph for this function:

◆ initializePulseStretch()

void limpet::initializePulseStretch ( float  strain,
float  onset,
float  duration,
float  rise,
float  fall,
stretch s 
)

Definition at line 38 of file stretch.cc.

Here is the caller graph for this function:

◆ int_cmp()

int limpet::int_cmp ( const void *  a,
const void *  b 
)

compare 2 integers for bsearch o qsort

Definition at line 309 of file MULTI_ION_IF.cc.

Here is the caller graph for this function:

◆ interp1()

void limpet::interp1 ( const double *  x,
const float *  y,
int  N,
double *  xi,
float *  yi,
int  NI,
double  dxi,
IpMeth_t  meth 
)

Interpolate function given by vectors x and y at grid xi to obtain yi where the discrete step size of xi is constant. Further, it is assumed that step size in xi is constant as well.

Parameters
xdiscrete x axis
ydiscrete function y
Nlength of vectors x and y
xidiscrete interpolated x axis
yidiscrete interpolated y axis
NIlength of vectors xi and yi
dxistep size of xi
methinterpolation method, either LINEAR or NEAREST

Definition at line 189 of file trace.cc.

Here is the caller graph for this function:

◆ is_concrete()

bool limpet::is_concrete ( Target const  target)

Checks if target is a real, concrete target.

Parameters
targettarget to check
Return values
falseif the target is not concrete (Target::UNKNOWN, Target::AUTO, ...) or invalid
trueif the target is valid and concrete

Definition at line 68 of file target.cc.

Here is the caller graph for this function:

◆ is_gpu()

bool limpet::is_gpu ( Target const  target)

Checks if this is a GPU target.

Parameters
targettarget to check
Returns
true for GPU targets, false otherwise

Definition at line 64 of file target.cc.

Here is the caller graph for this function:

◆ IsEquDistSampling()

bool limpet::IsEquDistSampling ( trace tr)

check whether the sampling of a trace is regular

Parameters
trtrace
Returns
true if equidistant, false otherwise

Definition at line 90 of file trace.cc.

Here is the caller graph for this function:

◆ isIMPdata()

bool limpet::isIMPdata ( const char *  sv)

check whether global IMP data vector of a given name exist

Parameters
[in]svname of IMP data vector
Returns
true, if vector exists false, otherwise

Definition at line 1883 of file MULTI_ION_IF.cc.

◆ load_ionic_module()

int limpet::load_ionic_module ( const char *  )
Here is the caller graph for this function:

◆ LUT_alloc()

void limpet::LUT_alloc ( LUT plut,
int  cols,
float  mn,
float  mx,
float  res,
const char *  name,
Target  target 
)

Definition at line 45 of file LUT.cc.

◆ LUT_derror()

LUT_data_t limpet::LUT_derror ( LUT t,
int  idx,
GlobalData_t  x 
)
inline

compute normalized disretization error

This is defined as the distance of the lookup value from the closest lower value used by the table lookup. It is computed as $ e = (X-x[i])/\Delta x$ where X is the value used in the lookup up, x[i] is the closest table value and $\Delta x$ is the table resolution

Parameters
ttable
idxclosest lower index
xvalue to lookup
Returns
the normalized error

Definition at line 242 of file LUT.cc.

Here is the caller graph for this function:

◆ LUT_dump()

int limpet::LUT_dump ( LUT plut,
const char *  fname 
)

Definition at line 74 of file LUT.cc.

Here is the caller graph for this function:

◆ LUT_index()

int limpet::LUT_index ( LUT tab,
GlobalData_t  val,
int  locind 
)

do a safe table lookup with error reporting

Parameters
tabpointer to lookup table
valvalue to lookup.
locindindex of value in its local array
Returns
the index into the table
Note
An out-of-bounds value (including infinity) will be brought to the nearest edge. NaN will die.

Definition at line 193 of file LUT.cc.

Here is the caller graph for this function:

◆ LUT_interp()

LUT_data_t limpet::LUT_interp ( LUT t,
int  i,
int  j,
GlobalData_t  x 
)
inline

interpolate in a lookup table

Parameters
tthe table
ithe row in the table
jthe column in the table
xnormalized discretizaton error
Returns
a linear interpolation of table values

Definition at line 223 of file LUT.cc.

Here is the caller graph for this function:

◆ LUT_interpRow()

LUT_data_t limpet::LUT_interpRow ( LUT *const  tab,
GlobalData_t  val,
int  i,
LUT_data_t row 
)

interpolate a row of a lookup table

Parameters
tabthe table
valcurrent value for which we are looking up the dependent values
ilocal index of the vertex for which we are doing the lookup
rowinterpolated values
Returns
discretization error
Precondition
row is allocated
Note
This is now threadsafe

Definition at line 258 of file LUT.cc.

Here is the caller graph for this function:

◆ LUT_interpRow_mlir()

void limpet::LUT_interpRow_mlir ( char *  table,
int  i,
char *  row_ptr,
int  lut_num_elements,
int  vector_size 
)
Here is the caller graph for this function:

◆ LUT_interpRow_n_elements()

void limpet::LUT_interpRow_n_elements ( char *  table,
char *  val_ptr,
int  offset,
int  distance,
int  index,
int  n,
char *  row_ptr,
int  lut_numelements 
)

LUT function for MLIR ionic models interpolate one rows of n lookup tables

Parameters
tabthe table
valpointer for which we are looking up the dependent values
nnumber of lookup tables to fill up
rowinterpolated values
lut_numelementsnumber of elements of this lut
Returns
discretization error
Precondition
row is allocated
Note
This is now threadsafe

Definition at line 304 of file LUT.cc.

Here is the caller graph for this function:

◆ LUT_out_of_bounds()

int limpet::LUT_out_of_bounds ( LUT tab,
GlobalData_t  val 
)

Definition at line 210 of file LUT.cc.

Here is the caller graph for this function:

◆ LUT_problem()

void limpet::LUT_problem ( LUT lt,
double  val,
int  wv,
const char *  tabname 
)

determine why index into a lookup table failed

Parameters
ltlookup table
valbad value for computing look up
wvlocal index associated with val
tabnamename of table being accessed
newvaltable edge boundary
Note
if IMP_FAST is defined, this function is implemented as a macro which does no bounds checking

Definition at line 171 of file LUT.cc.

Here is the caller graph for this function:

◆ LUT_problem_mlir()

void limpet::LUT_problem_mlir ( char *  tab,
GlobalData_t  val,
int  locind 
)
Here is the caller graph for this function:

◆ LUT_row()

LUT_data_t * limpet::LUT_row ( LUT lut,
GlobalData_t  val,
int  locind 
)

return the row of a lookup table

Parameters
lutthe lookup table
valthe val to index
locindlocal index of val

Definition at line 280 of file LUT.cc.

Here is the caller graph for this function:

◆ max()

template<class T >
constexpr T limpet::max ( a,
b 
)
inline

Definition at line 31 of file ion_type.h.

Here is the caller graph for this function:

◆ memmem()

void* limpet::memmem ( void *  haystack,
int  sz_hay,
void *  needle,
int  sz_n 
)

find a byte sequence in memory

Parameters
haystackwhere to look
sz_haysize of search space
needleobject to look for
sz_nsize of object
Returns
the address if found, NULL o.w.

Definition at line 480 of file ION_IF.cc.

◆ min()

template<class T >
constexpr T limpet::min ( a,
b 
)
inline

Definition at line 33 of file ion_type.h.

Here is the caller graph for this function:

◆ modify_param()

float limpet::modify_param ( float  a,
char *  expr 
)
Here is the caller graph for this function:

◆ ODEint_FE()

void limpet::ODEint_FE ( GlobalData_t y,
GlobalData_t ydot,
void *  f,
void *  f_data,
int  len,
GlobalData_t  dt 
)

ODEint_FE

Simple forward Euler ODE integrator

Integration of ydot = f(y,t)

y[t+dt] = y[t] + f(y[t])*dt

Parameters
yvalue
ydotvalue of f(y,t)
ffunction f(y,t)
f_datadata needed for function evaluation
lenlength of vector
dttime step

Definition at line 75 of file ODEint.cc.

◆ ODEint_RK()

void limpet::ODEint_RK ( GlobalData_t y,
GlobalData_t ydot,
void   fGlobalData_t *, GlobalData_t *, void *,
void *  f_data,
int  len,
GlobalData_t  dt 
)

ODEint_RK

Runge Kutta first order ODE integrator

Integration of ydot = f(y,t)

k1 = dt*f( t, y(t) ) k2 = dt*f( t+0.5*dt, y(t)+0.5*k1 ); y(t+dt) = y(t) + k2 + O(dt^3)

Parameters
yvalue
ydotvalue of f(y,t)
ffunction f(y,t)
f_datadata needed for function evaluation
lenlength of vector
dttime step

Definition at line 40 of file ODEint.cc.

◆ open_globalvec_dump()

void limpet::open_globalvec_dump ( FILE **  fhdls,
GVEC_DUMP gvd,
MULTI_IF pMIIF,
char *  base_name,
IOCtrl io 
)

Definition at line 176 of file bench_utils.cc.

Here is the caller graph for this function:

◆ open_trace() [1/2]

void limpet::open_trace ( MULTI_IF ,
int  ,
int *  ,
int *   
)

◆ open_trace() [2/2]

void limpet::open_trace ( MULTI_IF MIIF,
int  n_traceNodes,
int *  traceNodes,
int *  label,
opencarp::sf_mesh imesh 
)

Set up ionic model traces at some global node numbers.

Usage for the following three functions:

  1. open_trace();
  2. while(running){ if (timer_triggered) dump_trace(time); }
  3. close_trace();

By default, each model has a NULL pointer for their trace() function. Those models that implement a trace function need only redefine this NULL pointer in their init_parameters function.

Each trace function invocation should print a list of whatever variables it wants delimited by tabs. The dumping routine will take care of inserting extra tabs between models and plugins, and will take responsibilty for printing the trailing new line on each line.

Note
This is not meant for many many nodes.
Parameters
MIIFThe MIIF state struct.
n_traceNodesnumber of nodes in the following array
traceNodesglobal node numbers of the nodes we want to trace.
labeloutput node number, if NULL, use traceNodes
imeshThe intracellular mesh, may be NULL if called from bench.

Definition at line 340 of file MULTI_ION_IF.cc.

Here is the caller graph for this function:

◆ print_AP_stats()

void limpet::print_AP_stats ( action_potential AP)

Write AP statistic parameters to a file. Written parameters include:

Beat Number Prematurity APD DI(n) DI(n-1) Triangulation Vm_mx Vm_mn

Parameters
APaction potential statistics data

Definition at line 498 of file ap_analyzer.cc.

Here is the caller graph for this function:

◆ print_AP_stats_header()

void limpet::print_AP_stats_header ( action_potential AP,
FILE *  outbuf 
)

Write AP statistic header to stderr

Beat Number Prematurity APD DI(n) DI(n-1) Triangulation Vm_mx Vm_mn

Parameters
APaction potential statistics data

Definition at line 526 of file ap_analyzer.cc.

Here is the caller graph for this function:

◆ print_IMPs()

void limpet::print_IMPs ( void  )
Here is the caller graph for this function:

◆ print_models()

void limpet::print_models ( bool  )
Here is the caller graph for this function:

◆ print_param_help()

void limpet::print_param_help ( IonType im,
IonTypeList plugs 
)

Definition at line 468 of file bench_utils.cc.

Here is the caller graph for this function:

◆ process_param_mod()

int limpet::process_param_mod ( char *  pstr,
char *  par,
char *  mod 
)
Here is the caller graph for this function:

◆ process_sv_clamps()

int limpet::process_sv_clamps ( char *  SVs,
char *  files,
Clamp **  clamps,
double  dt 
)

process SV clamp lists

Parameters
SVsIN colon separated state variable list
filesIN colon separated file list of SV traces corresponding to SVs
clampsOUT list of clamps
Returns
the number of clamps

Definition at line 197 of file clamp.cc.

Here is the caller graph for this function:

◆ rbCalcKi()

void limpet::rbCalcKi ( float **  K,
float **  A,
float *  X,
int *  ludI,
void(*)(float *, float *, void *)  calcDX,
void *  params,
float  h,
int  N,
int  i 
)

populate the i^th row of the coefficient matrix K

Parameters
K4xN matrix K in row-major order
JNxN Jacobian matrix in row-major order
XN variables to be integrated
calcDXfunction that populates a vector (F) with the instantaneous time derivatives of the variables in X
paramsstructure necessary for the calculation of F and J, defined by user
htime step
Nnumber of variables to be integrated
irow of the 4xN matrix K to be populated
Note
Typically, this function should not be called by users.

Definition at line 170 of file Rosenbrock.cc.

Here is the caller graph for this function:

◆ rbSolver()

void limpet::rbSolver ( float **  A,
float *  x,
float *  b,
int  N 
)

solve the system Ax = b

Parameters
Apointer to the NxN matrix A
xpointer to the Nx1 vector x
bpointer to the Nx1 vector b
Nnumber of nodes in the system
Note
Typically, this function should not be called by users.
Because A tends to be near-singular in the context of the integration scheme, Gaussian elimination is employed to solve the system. It is altogether likely that this method could be improved computationally.

Definition at line 222 of file Rosenbrock.cc.

◆ rbStepX()

void limpet::rbStepX ( float *  X,
void(*)(float *, float *, void *)  calcDX,
void(*)(float **, float *, void *, int)  calcJ,
void *  params,
float  h,
int  N 
)

semi-implicit integration of X over one time step

Parameters
Xpointer to N variables to be integrated
calcDXpointer to a function that populates a vector (F) with the instantaneous time derivatives of the variables in X
calcJpointer to a function that populates the NxN Jacobian matrix (J), given by dF/dX
paramsdata necessary for the calculation of F and J, defined by user
htime step
Nnumber of variables to be integrated
Note
The functions pointed to by calcDX and calcJ, as well as the structure pointed to by params, must be defined by the user in the context of the file calling this function. A simple example is presented at the end of this header file. A full example can be found in the Pandit ionic model.
Warning
F cannot contain any terms that are explicitly time-dependent, otherwise this implementation will fail, due to the omission of the non-autonomous gradient term.

Definition at line 101 of file Rosenbrock.cc.

Here is the caller graph for this function:

◆ read_restitution_protocol_def()

int limpet::read_restitution_protocol_def ( char *  r_file,
restitution r 
)

read restitution curve protocol definition from a file

lines of the file for S1S2 1 # prepacing beats S1 BCL longest S2 shortest S2 #S1 beats between S2's decrement of S2's

for dynamic protocols 0 #prepacing beats starting BCL ending BCL beats per BCL BCL decrement

Definition at line 222 of file restitute.cc.

Here is the caller graph for this function:

◆ read_sv()

int limpet::read_sv ( MULTI_IF ,
int  ,
const char *   
)
Here is the caller graph for this function:

◆ read_trace()

int limpet::read_trace ( trace tr,
const char *  name 
)

read a trace from a file

Parameters
trtrace
namename of trace file
Postcondition
trace structure allocated and filled

Definition at line 43 of file trace.cc.

Here is the caller graph for this function:

◆ resample_trace()

void limpet::resample_trace ( trace tr,
double  dt 
)

resample a trace at a different sampling interval

Parameters
trtrace
dttime step for resampling the trace
Postcondition
the trace is assumed to start at 0

Definition at line 115 of file trace.cc.

Here is the caller graph for this function:

◆ restitution_save_sv()

void limpet::restitution_save_sv ( MULTI_IF miif,
int  R1,
restitution r,
action_potential AP 
)

save state vectors during restitution protocol

Parameters
[in]miifionic models
[in]R1region ID
[in]rrestitution protocol being used
[in]APAP analysis data
Postcondition
state vector written before every step change in CI

Definition at line 275 of file restitute.cc.

Here is the caller graph for this function:

◆ restitution_trigger_list()

void limpet::restitution_trigger_list ( char *  r_file,
restitution r,
char *  protocol,
int *  n_dop,
double **  t_dop 
)

determine triggers for restitution protocols

Parameters
r_filerestitution file
rparameters for restitution protocol
protocoluse S1S2, dynamic or fast S1S2 protocol
n_dop[out]number of resumed states
t_dop[out]times at which to revert state
Postcondition
restitution structure filled in
Allocates : trigger lists
Assigns : restitution parameters

Definition at line 45 of file restitute.cc.

Here is the caller graph for this function:

◆ save_sv()

void limpet::save_sv ( MULTI_IF ,
int  ,
const char *   
)
Here is the caller graph for this function:

◆ set_print_bounds_exceeded_messages()

int limpet::set_print_bounds_exceeded_messages ( int  newval)

Definition at line 132 of file MULTI_ION_IF.cc.

◆ set_start_time()

void limpet::set_start_time ( const float  )

◆ shift_vm_trace()

void limpet::shift_vm_trace ( double  vm,
action_potential AP,
timer_manager *  tm 
)

shifts the Vm buffer by one and enters the current Vm value at position 0 of the buffer

Parameters
vmcurrent value of AP
APaction potential statistics
tmtimer manager

Definition at line 207 of file ap_analyzer.cc.

Here is the caller graph for this function:

◆ should_print_bounds_exceeded_messages()

int limpet::should_print_bounds_exceeded_messages ( )

Definition at line 128 of file MULTI_ION_IF.cc.

◆ SV_alloc()

void limpet::SV_alloc ( SV_TAB psv,
int  numSeg,
int  struct_size 
)
Here is the caller graph for this function:

◆ sv_clamp() [1/2]

void limpet::sv_clamp ( Clamp cl,
opencarp::timer_manager tm,
MULTI_IF ,
bool  trigger 
)

◆ sv_clamp() [2/2]

void limpet::sv_clamp ( Clamp cl,
timer_manager *  tm,
MULTI_IF miif,
bool  trigger 
)

apply a state variable transient, let it float if outside the trace

Parameters
clclamp
tmtimer manager
miifionic model
triggertrue if current stimulus started

Definition at line 138 of file clamp.cc.

Here is the caller graph for this function:

◆ SV_free()

void limpet::SV_free ( SV_TAB psv)
Here is the caller graph for this function:

◆ tokstr_r()

char * limpet::tokstr_r ( char *  s1,
const char *  s2,
char **  lasts 
)

Definition at line 82 of file ION_IF.cc.

Here is the caller graph for this function:

◆ trace_duration()

double limpet::trace_duration ( trace tr,
const char *  f 
)

determine the length (duration) of a trace either from a trace file or a trace structure

Parameters
trtrace
ftrace file where we look in the case that tr is void
Returns
duration of the trace

Definition at line 147 of file trace.cc.

Here is the caller graph for this function:

◆ update_steady_state()

bool limpet::update_steady_state ( action_potential AP)

update data for steady state check and determine whether we are in steady state or not

Parameters
APaction potential statistics
Returns
true, if AP is in steady state, false otherwise

Definition at line 355 of file ap_analyzer.cc.

Here is the caller graph for this function:

◆ update_timing()

void limpet::update_timing ( event_timing t,
double  event_duration 
)

Definition at line 376 of file bench_utils.cc.

Here is the caller graph for this function:

◆ update_ts()

void limpet::update_ts ( ts ptstp)

update_ts

Update the time stepping structure, mainly increment the linear counter and compute the modulus for each time group to decide whether an update is required for the current time step.

Parameters
ptstptime step group

Definition at line 460 of file ION_IF.cc.

Here is the caller graph for this function:

◆ verify_flags()

bool limpet::verify_flags ( const char *  flags,
const char *  given 
)

verify that the specified flags are legal values

Parameters
flagsall possible flags
givenspecified flags
Returns
true iif all given flags are found in flags

Definition at line 529 of file ION_IF.cc.

Here is the caller graph for this function:

◆ write_dump_header()

int limpet::write_dump_header ( GVEC_DUMP gvd,
SV_DUMP svd,
const char *  ExpID 
)

Definition at line 135 of file bench_utils.cc.

Here is the caller graph for this function:

Variable Documentation

◆ _nc_logf

opencarp::FILE_SPEC limpet::_nc_logf = NULL

Definition at line 78 of file ION_IF.cc.

◆ curr_node_list

int* limpet::curr_node_list

needed to determine the global node number

Definition at line 108 of file ION_IF.cc.