openCARP
Doxygen code documentation for the open cardiac electrophysiology simulator openCARP
|
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) |
IonType * | get_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_t * | LUT_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... | |
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 enum limpet::_act_events limpet::act_events |
typedef enum limpet::_ampl_events limpet::ampl_events |
typedef enum limpet::_ap_states limpet::ap_states |
typedef union limpet::_event_class limpet::event_class |
typedef enum limpet::_event_meth limpet::event_meth |
typedef float limpet::Gatetype |
Definition at line 45 of file ion_type.h.
typedef SF_real limpet::GlobalData_t |
Definition at line 27 of file limpet_types.h.
typedef char limpet::IIF_Mask_t |
Definition at line 50 of file ion_type.h.
using limpet::IonTypeList = typedef std::vector<std::reference_wrapper<IonType> > |
Definition at line 289 of file ion_type.h.
typedef enum limpet::ip_method limpet::IpMeth_t |
typedef double limpet::LUT_data_t |
typedef enum limpet::_r_protocol limpet::r_prtcl |
typedef double limpet::Real |
Definition at line 151 of file MULTI_ION_IF.h.
typedef enum limpet::_repol_events limpet::repol_events |
typedef enum limpet::_stretch_protocol limpet::s_prtcl |
typedef union limpet::_stretch limpet::stretch |
typedef GlobalData_t(* limpet::SVgetfcn) (IonIfBase &, int, int) |
Definition at line 48 of file ion_type.h.
typedef void(* limpet::SVputfcn) (IonIfBase &, int, int, GlobalData_t) |
Definition at line 49 of file ion_type.h.
enum limpet::_act_events |
Enumerator | |
---|---|
xAPD90 | |
VmDotMx | |
nActEvents |
Definition at line 56 of file ap_analyzer.cc.
enum limpet::_ampl_events |
Enumerator | |
---|---|
VmMX | |
VmMN | |
nAmplEvents |
Definition at line 58 of file ap_analyzer.cc.
enum limpet::_ap_states |
Enumerator | |
---|---|
AP_STATE | |
DI_STATE |
Definition at line 85 of file ap_analyzer.h.
enum limpet::_event_meth |
Enumerator | |
---|---|
X_THRESHOLD | |
MX_RATE | |
MX_VAL |
Definition at line 35 of file ap_analyzer.h.
enum limpet::_r_protocol |
Enumerator | |
---|---|
S1S2 | |
DYNAMIC | |
S1S2_fast |
Definition at line 27 of file restitute.h.
Enumerator | |
---|---|
APD90 | |
APD30 | |
nRepolEvents |
Definition at line 57 of file ap_analyzer.cc.
enum limpet::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.
enum limpet::ip_method |
enum limpet::Target |
enum that represents different targets to run ionic models on.
enum limpet::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.
enum limpet::timingIDs |
Definition at line 74 of file bench_utils.h.
void limpet::alloc_MIIF | ( | MULTI_IF * | pMIIF | ) |
allocate memory for MIIF structure
pMIIF | MIIF |
Definition at line 221 of file MULTI_ION_IF.cc.
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.
target | target to allocate on |
n | size of the memory to allocate (size of the array of type T) |
always_managed | whether to use managed memory for GPU allocations |
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
[in] | miif | Multi ion IF structure |
Definition at line 1657 of file MULTI_ION_IF.cc.
void limpet::AP_clamp | ( | Clamp * | cl, |
opencarp::timer_manager * | tm, | ||
opencarp::sf_vec * | v, | ||
bool | trigger | ||
) |
void limpet::AP_clamp | ( | Clamp * | cl, |
timer_manager * | tm, | ||
sf_vec * | v, | ||
bool | trigger | ||
) |
void limpet::apply_stretch | ( | MULTI_IF * | miif, |
stretch * | s, | ||
opencarp::timer_manager * | tm | ||
) |
void limpet::apply_stretch_pulse | ( | MULTI_IF * | miif, |
pulseStretch * | s, | ||
timer_manager * | tm | ||
) |
T** limpet::build_matrix_ns | ( | int | m, |
int | n, | ||
int | size, | ||
Target | target | ||
) |
void limpet::calibrate_thresholds | ( | action_potential * | AP | ) |
calibrate threshold values based on current AP amplitudes
AP | action potential statistics |
Definition at line 227 of file ap_analyzer.cc.
bool limpet::check_events | ( | double | vm, |
action_potential * | AP, | ||
opencarp::timer_manager * | tm | ||
) |
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
vm | current value of AP |
AP | action potential statistics |
tm | timer manager |
Definition at line 263 of file ap_analyzer.cc.
bool limpet::check_mx_rate | ( | ap_event * | e, |
timer_manager * | tm | ||
) |
check whether a maximum rate of change event has occurred
e | event |
tm | timer manager |
Definition at line 445 of file ap_analyzer.cc.
bool limpet::check_mx_val | ( | ap_event * | e, |
timer_manager * | tm | ||
) |
check whether a maximum value event has occurred
e | event |
tm | timer manager |
Definition at line 475 of file ap_analyzer.cc.
bool limpet::check_steady_state | ( | steady_state_ap * | ss | ) |
check whether we are in steady state
AP | action potential statistics |
Definition at line 398 of file ap_analyzer.cc.
bool limpet::check_threshold | ( | ap_event * | e, |
timer_manager * | tm | ||
) |
check whether a threshold crossing event has occurred
e | event |
tm | timer manager |
Definition at line 415 of file ap_analyzer.cc.
void limpet::clamp_signal | ( | MULTI_IF * | pMIIF, |
Clamp * | cl, | ||
opencarp::timer_manager * | tm | ||
) |
void limpet::cleanup_AP_analysis | ( | action_potential * | AP | ) |
clean up AP analysis, free memory and close files
AP | action potential statistics |
Definition at line 169 of file ap_analyzer.cc.
void limpet::close_trace | ( | MULTI_IF * | MIIF | ) |
void limpet::CreateIIFGlobalNodeLsts | ( | MULTI_IF * | pMIIF | ) |
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.
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
N_IIF | Number of IIFs | |
IIF_Mask | ||
[out] | N_Nodes | Number of nodes per IIF |
[out] | NodeLists | List of node number for each IIF |
low | lower bound of partition | |
high | higher bound of partition |
Definition at line 157 of file MULTI_ION_IF.cc.
int limpet::current_global_node | ( | int | local_node | ) |
Definition at line 118 of file MULTI_ION_IF.cc.
float limpet::current_global_time | ( | ) |
Definition at line 122 of file MULTI_ION_IF.cc.
void limpet::d_ODEint_FE | ( | d_OdeVec * | y, |
d_OdeVec * | ydot, | ||
void * | f, | ||
void * | f_data, | ||
GlobalData_t | dt | ||
) |
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)
y | value |
ydot | value of f(y,t) |
f | function f(y,t) |
f_data | data needed for function evaluation |
dt | time step |
void limpet::deallocate_on_target | ( | Target | target, |
T * | ptr | ||
) |
Utility function for deallocating memory on a target. See TargetAllocator.
target | target to deallocate on (this should be the target on which memory was allocated) |
ptr | pointer to memory to deallocate |
Definition at line 318 of file target.h.
float limpet::determine_duration | ( | struct gengetopt_args_info * | p, |
TrgList * | stim_lst | ||
) |
determine time of last stimulus
p | command line options |
stim_lst | stimulus list |
Definition at line 503 of file bench_utils.cc.
void limpet::determine_stim_list | ( | char * | stl, |
TrgList * | trg, | ||
bool | DIAs | ||
) |
determine the stimulation times from the list
stl | stimulus timing list separated by commas |
trg | structure to hold the info |
DIAs | interpret times as diastolic intervals? |
Definition at line 101 of file bench_utils.cc.
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
N | total number of nodes | |
offset | byte offsets of nodes, significant only on root | |
bufsize | output buffer size | |
[out] | ranges | node range of each write |
Definition at line 993 of file MULTI_ION_IF.cc.
make the minimal copy of a MIIF to run independently
orig | the original MIIF |
doppel | the copy |
Definition at line 1855 of file MULTI_ION_IF.cc.
update the data of a doppel MIIF without allocating any memory
doppel | the copy |
orig | the one to copy |
doppel
will be in the same state os orig
Definition at line 1827 of file MULTI_ION_IF.cc.
void limpet::dump_all | ( | MULTI_IF * | MIIF, |
int | reg, | ||
char * | imp, | ||
char * | plugs, | ||
double | t, | ||
double | ddt, | ||
char * | fout | ||
) |
void limpet::dump_trace | ( | MULTI_IF * | MIIF, |
limpet::Real | time | ||
) |
dump the traces from a node
MIIF | the ionic region |
time | time 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.
Definition at line 409 of file MULTI_ION_IF.cc.
void limpet::dup_IMP_node_state | ( | IonIfBase & | IF, |
int | from, | ||
int | to, | ||
GlobalData_t ** | localdata | ||
) |
bool limpet::flag_set | ( | const char * | flags, |
const char * | target | ||
) |
void limpet::flubksb | ( | float ** | a, |
int | n, | ||
int * | indx, | ||
float * | b | ||
) |
void limpet::flubksb0 | ( | float ** | a, |
int | n, | ||
int * | indx, | ||
float * | b | ||
) |
solve an LU decomposed dense float matrix by back/forward substitution
a | the matrix |
n | order of a |
indx | permutation vector |
b | RHS |
Definition at line 285 of file Rosenbrock.cc.
void limpet::fludcmp | ( | float ** | a, |
int | n, | ||
int * | indx, | ||
float * | d | ||
) |
void limpet::fludcmp0 | ( | float ** | a, |
int | n, | ||
int * | indx, | ||
float * | d | ||
) |
LU decompose a dense float matrix
a | the matrix |
n | order of a |
indx | permutation vector |
d | needed for the determinant |
Definition at line 258 of file Rosenbrock.cc.
void limpet::free_doppel | ( | MULTI_IF * | m | ) |
release the memory of the doppel
doppel | the doppel of course |
Definition at line 1803 of file MULTI_ION_IF.cc.
void limpet::free_sv_table | ( | void * | ) |
void limpet::free_trace | ( | trace * | tr | ) |
void limpet::freeIMPData | ( | MULTI_IF * | pMIIF | ) |
void* limpet::get_IIF_plugparam | ( | IonIfBase & | , |
int | |||
) |
IonType* limpet::get_ion_type | ( | const std::string & | name | ) |
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'
lst | string of separated items |
delimiter | list item separator |
NULL | the end of the list has been reached |
pointer | to the next item in the list |
Definition at line 512 of file ION_IF.cc.
int limpet::get_plug_flag | ( | char * | plgstr, |
int * | out_num_plugins, | ||
IonTypeList & | out_plugins | ||
) |
determine IMP plugin flag
plgstr | colon separated list of plugin names |
out_num_plugins | number of plugins found |
out_plugins | plugin array |
out_plugins
is allocated and out_num_plugins
set Definition at line 821 of file MULTI_ION_IF.cc.
void limpet::get_protocol_definition | ( | char * | r_file, |
restitution * | r, | ||
bool | useS1S2 | ||
) |
std::string limpet::get_string_from_target | ( | Target const | target | ) |
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
tab | state variable array |
offset | offset of variable into table |
n | #nodes |
svSize | size of structure holding all SVs |
size | size of state variable |
Definition at line 530 of file MULTI_ION_IF.cc.
Target limpet::get_target_from_string | ( | std::string const | str | ) |
Returns a value from the Target enum from a given string.
str | lower case string corresponding to an enum member |
Definition at line 36 of file target.cc.
std::string limpet::get_target_list_string | ( | ) |
char* limpet::get_typename | ( | int | type | ) |
double limpet::getCellVal | ( | opencarp::sf_vec * | v, |
int | ind | ||
) |
double limpet::getCellVal | ( | sf_vec * | v, |
int | ind | ||
) |
int limpet::getGlobalNodalIndex | ( | IonIfBase & | pIF, |
int | rIdx | ||
) |
helper function to retrieve global nodal index number from within an imp
[in] | pIF | pointer to imp |
[in] | rIdx | relative index of cell within imp |
Definition at line 205 of file MULTI_ION_IF.cc.
void limpet::globalvec_dump | ( | FILE ** | fhdls, |
GVEC_DUMP * | gvd, | ||
MULTI_IF * | pMIIF, | ||
opencarp::timer_manager * | tm, | ||
IOCtrl * | io, | ||
int | numNode | ||
) |
void limpet::globalvec_dump | ( | FILE ** | fhdls, |
GVEC_DUMP * | gvd, | ||
MULTI_IF * | pMIIF, | ||
timer_manager * | tmo, | ||
IOCtrl * | io, | ||
int | numNode | ||
) |
dump the global vectors
fhdls | output file |
gvd | |
pMIIF | IMP structure |
tmo | timer |
io |
Definition at line 272 of file bench_utils.cc.
void limpet::IIF_warn | ( | const int | wv, |
const char * | error | ||
) |
void limpet::IIF_warn | ( | const int | wv, |
const char | error[] | ||
) |
print an error message to the terminaldetermine why index into a lookup table failed
error | string error message. |
IMP_FAST
is defined, this function is implemented as a macro which does no bounds checking Definition at line 155 of file LUT.cc.
int limpet::IMPdataLabel2Index | ( | const char * | sv | ) |
figure out global IMP data vector index within array from a given name
[in] | sv | name of IMP data vector |
Definition at line 1894 of file MULTI_ION_IF.cc.
void limpet::initial_SVs | ( | MULTI_IF * | miif, |
char * | SVs, | ||
char * | imp, | ||
char * | plgins, | ||
int | num | ||
) |
int limpet::initialize_AP_analysis | ( | action_potential * | AP | ) |
initialize AP structure for gathering AP statistics
AP | action potential statistics |
Definition at line 71 of file ap_analyzer.cc.
void limpet::initialize_AP_clamp | ( | Clamp * | cl, |
char * | f, | ||
double | |||
) |
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
cl | clamp structure |
val | value of clamp |
dur | duration |
start | when to start |
f | file to read for clamp signal |
trans | false for clamping outside of pulse, o.w. index of timer |
duration | OUT duration of clamp |
Definition at line 45 of file clamp.cc.
void limpet::initialize_ionic_IF | ( | MULTI_IF * | pMIIF | ) |
initlaize the ionic interfaces
pMIIF | MIIF |
Definition at line 261 of file MULTI_ION_IF.cc.
void limpet::initialize_params_MIIF | ( | MULTI_IF * | pMIIF | ) |
initialize the parameters of the ionic models with default values
pMIIF | MIIF |
Definition at line 252 of file MULTI_ION_IF.cc.
void limpet::initialize_sv_clamp | ( | Clamp * | cl, |
const char * | sv, | ||
char * | file, | ||
double | dt | ||
) |
void limpet::initialize_timings | ( | event_timing * | t | ) |
initialize_ts
Initialize the time stepping structure which determines whether or not a particular time constant group needs to be updated or not.
target | target on which data will be allocated |
ts | pointer to time stepper structure |
ng | number of time constant groups |
skp | skip values for each group relative to the fastest group |
dt | time step of fastest group |
Definition at line 437 of file ION_IF.cc.
void limpet::initialize_ts | ( | ts * | tstp, |
int | ng, | ||
int * | skp, | ||
double | dt | ||
) |
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
Definition at line 689 of file MULTI_ION_IF.cc.
void limpet::initializePulseStretch | ( | float | strain, |
float | onset, | ||
float | duration, | ||
float | rise, | ||
float | fall, | ||
stretch * | s | ||
) |
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.
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.
x | discrete x axis |
y | discrete function y |
N | length of vectors x and y |
xi | discrete interpolated x axis |
yi | discrete interpolated y axis |
NI | length of vectors xi and yi |
dxi | step size of xi |
meth | interpolation method, either LINEAR or NEAREST |
Definition at line 189 of file trace.cc.
bool limpet::is_concrete | ( | Target const | target | ) |
bool limpet::is_gpu | ( | Target const | target | ) |
bool limpet::IsEquDistSampling | ( | trace * | tr | ) |
bool limpet::isIMPdata | ( | const char * | sv | ) |
check whether global IMP data vector of a given name exist
[in] | sv | name of IMP data vector |
Definition at line 1883 of file MULTI_ION_IF.cc.
int limpet::load_ionic_module | ( | const char * | ) |
|
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 where X is the value used in the lookup up, x[i] is the closest table value and
is the table resolution
t | table |
idx | closest lower index |
x | value to lookup |
Definition at line 242 of file LUT.cc.
int limpet::LUT_dump | ( | LUT * | plut, |
const char * | fname | ||
) |
int limpet::LUT_index | ( | LUT * | tab, |
GlobalData_t | val, | ||
int | locind | ||
) |
do a safe table lookup with error reporting
tab | pointer to lookup table |
val | value to lookup. |
locind | index of value in its local array |
Definition at line 193 of file LUT.cc.
|
inline |
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
tab | the table |
val | current value for which we are looking up the dependent values |
i | local index of the vertex for which we are doing the lookup |
row | interpolated values |
Definition at line 258 of file LUT.cc.
void limpet::LUT_interpRow_mlir | ( | char * | table, |
int | i, | ||
char * | row_ptr, | ||
int | lut_num_elements, | ||
int | vector_size | ||
) |
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
tab | the table |
val | pointer for which we are looking up the dependent values |
n | number of lookup tables to fill up |
row | interpolated values |
lut_numelements | number of elements of this lut |
Definition at line 304 of file LUT.cc.
int limpet::LUT_out_of_bounds | ( | LUT * | tab, |
GlobalData_t | val | ||
) |
void limpet::LUT_problem | ( | LUT * | lt, |
double | val, | ||
int | wv, | ||
const char * | tabname | ||
) |
determine why index into a lookup table failed
lt | lookup table |
val | bad value for computing look up |
wv | local index associated with val |
tabname | name of table being accessed |
newval | table edge boundary |
IMP_FAST
is defined, this function is implemented as a macro which does no bounds checking Definition at line 171 of file LUT.cc.
void limpet::LUT_problem_mlir | ( | char * | tab, |
GlobalData_t | val, | ||
int | locind | ||
) |
LUT_data_t * limpet::LUT_row | ( | LUT * | lut, |
GlobalData_t | val, | ||
int | locind | ||
) |
|
inline |
void* limpet::memmem | ( | void * | haystack, |
int | sz_hay, | ||
void * | needle, | ||
int | sz_n | ||
) |
|
inline |
float limpet::modify_param | ( | float | a, |
char * | expr | ||
) |
void limpet::ODEint_FE | ( | GlobalData_t * | y, |
GlobalData_t * | ydot, | ||
void * | f, | ||
void * | f_data, | ||
int | len, | ||
GlobalData_t | dt | ||
) |
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)
y | value |
ydot | value of f(y,t) |
f | function f(y,t) |
f_data | data needed for function evaluation |
len | length of vector |
dt | time step |
void limpet::open_trace | ( | MULTI_IF * | , |
int | , | ||
int * | , | ||
int * | |||
) |
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:
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.
MIIF | The MIIF state struct. |
n_traceNodes | number of nodes in the following array |
traceNodes | global node numbers of the nodes we want to trace. |
label | output node number, if NULL, use traceNodes |
imesh | The intracellular mesh, may be NULL if called from bench. |
Definition at line 340 of file MULTI_ION_IF.cc.
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
AP | action potential statistics data |
Definition at line 498 of file ap_analyzer.cc.
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
AP | action potential statistics data |
Definition at line 526 of file ap_analyzer.cc.
void limpet::print_IMPs | ( | void | ) |
void limpet::print_models | ( | bool | ) |
void limpet::print_param_help | ( | IonType * | im, |
IonTypeList & | plugs | ||
) |
int limpet::process_param_mod | ( | char * | pstr, |
char * | par, | ||
char * | mod | ||
) |
int limpet::process_sv_clamps | ( | char * | SVs, |
char * | files, | ||
Clamp ** | clamps, | ||
double | dt | ||
) |
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
K | 4xN matrix K in row-major order |
J | NxN Jacobian matrix in row-major order |
X | N variables to be integrated |
calcDX | function that populates a vector (F) with the instantaneous time derivatives of the variables in X |
params | structure necessary for the calculation of F and J, defined by user |
h | time step |
N | number of variables to be integrated |
i | row of the 4xN matrix K to be populated |
Definition at line 170 of file Rosenbrock.cc.
void limpet::rbSolver | ( | float ** | A, |
float * | x, | ||
float * | b, | ||
int | N | ||
) |
solve the system Ax = b
A | pointer to the NxN matrix A |
x | pointer to the Nx1 vector x |
b | pointer to the Nx1 vector b |
N | number of nodes in the system |
Definition at line 222 of file Rosenbrock.cc.
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
X | pointer to N variables to be integrated |
calcDX | pointer to a function that populates a vector (F) with the instantaneous time derivatives of the variables in X |
calcJ | pointer to a function that populates the NxN Jacobian matrix (J), given by dF/dX |
params | data necessary for the calculation of F and J, defined by user |
h | time step |
N | number of variables to be integrated |
Definition at line 101 of file Rosenbrock.cc.
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.
int limpet::read_sv | ( | MULTI_IF * | , |
int | , | ||
const char * | |||
) |
int limpet::read_trace | ( | trace * | tr, |
const char * | name | ||
) |
void limpet::resample_trace | ( | trace * | tr, |
double | dt | ||
) |
void limpet::restitution_save_sv | ( | MULTI_IF * | miif, |
int | R1, | ||
restitution * | r, | ||
action_potential * | AP | ||
) |
save state vectors during restitution protocol
[in] | miif | ionic models |
[in] | R1 | region ID |
[in] | r | restitution protocol being used |
[in] | AP | AP analysis data |
Definition at line 275 of file restitute.cc.
void limpet::restitution_trigger_list | ( | char * | r_file, |
restitution * | r, | ||
char * | protocol, | ||
int * | n_dop, | ||
double ** | t_dop | ||
) |
determine triggers for restitution protocols
r_file | restitution file |
r | parameters for restitution protocol |
protocol | use S1S2, dynamic or fast S1S2 protocol |
n_dop[out] | number of resumed states |
t_dop[out] | times at which to revert state |
Definition at line 45 of file restitute.cc.
void limpet::save_sv | ( | MULTI_IF * | , |
int | , | ||
const char * | |||
) |
int limpet::set_print_bounds_exceeded_messages | ( | int | newval | ) |
Definition at line 132 of file MULTI_ION_IF.cc.
void limpet::set_start_time | ( | const float | ) |
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
vm | current value of AP |
AP | action potential statistics |
tm | timer manager |
Definition at line 207 of file ap_analyzer.cc.
int limpet::should_print_bounds_exceeded_messages | ( | ) |
Definition at line 128 of file MULTI_ION_IF.cc.
void limpet::SV_alloc | ( | SV_TAB * | psv, |
int | numSeg, | ||
int | struct_size | ||
) |
void limpet::sv_clamp | ( | Clamp * | cl, |
opencarp::timer_manager * | tm, | ||
MULTI_IF * | , | ||
bool | trigger | ||
) |
void limpet::SV_free | ( | SV_TAB * | psv | ) |
char * limpet::tokstr_r | ( | char * | s1, |
const char * | s2, | ||
char ** | lasts | ||
) |
double limpet::trace_duration | ( | trace * | tr, |
const char * | f | ||
) |
bool limpet::update_steady_state | ( | action_potential * | AP | ) |
update data for steady state check and determine whether we are in steady state or not
AP | action potential statistics |
Definition at line 355 of file ap_analyzer.cc.
void limpet::update_timing | ( | event_timing * | t, |
double | event_duration | ||
) |
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.
ptstp | time step group |
Definition at line 466 of file ION_IF.cc.
bool limpet::verify_flags | ( | const char * | flags, |
const char * | given | ||
) |
opencarp::FILE_SPEC limpet::_nc_logf = NULL |