87 const double inf = std::numeric_limits<double>::infinity();
132 std::vector<SF::dmat<double>>
S;
151 if (stimuliRef)
delete stimuliRef;
371 void precompute_squared_anisotropy_metric();
374 inline void add_to_active(std::vector<mesh_int_t>& active,
375 std::vector<char>& in_active,
378 if (!in_active[node]) {
380 active.push_back(node);
384 inline void remove_from_active(std::vector<char>& in_active,
mesh_int_t node)
397 void update_Ta_in_active_list();
573 bool is_not_valid_update(
const std::array<int, N>& nodeIDs,
double time);
585 void translate_stim_to_eikonal();
613 void create_node_to_node_graph();
616 void load_state_file();
716 void solve_EIKONAL();
725 void setup_stimuli();
727 void stimulate_intracellular();
733 void setup_solvers();
736 void setup_mappings();
742 void dump_matrices();
744 void checkpointing();
755 template <
int MESH_SIZE>
760 std::array<SF::Point, MESH_SIZE>& points;
761 std::array<double, MESH_SIZE>& values;
781 double tsitsiklis_update_line(
const std::array<SF::Point, 2>& base,
783 const double& value);
806 double tsitsiklis_update_triangle(
const std::array<SF::Point, 3>& base,
808 const std::array<double, 2>& values);
832 double tsitsiklis_update_tetra(
const std::array<SF::Point, 4>& base,
834 const std::array<double, 3>& values);
838 : D(D), points(points), values(values) {}
845 template class LocalSolver<2>;
847 template class LocalSolver<3>;
849 template class LocalSolver<4>;
double SF_real
Use the general double as real type.
Basic utility structs and functions, mostly IO related.
A vector storing arbitrary data.
The abstract physics interface we can use to trigger all physics.
virtual void output_timings()
FILE_SPEC logger
The logger of the physic, each physic should have one.
const char * name
The name of the physic, each physic should have one.
std::string timer_unit(const int timer_id)
figure out units of a signal linked to a given timer
Eikonal()
Most of the initialization is done with initialize()
SF::vector< stimulus > stimuli
the electrical stimuli
parabolic_solver parab_solver
Solver for the parabolic bidomain equation.
MaterialType mtype[2]
the material types of intra_grid and extra_grid grids.
void destroy()
Currently we only need to close the file logger.
double timer_val(const int timer_id)
figure out current value of a signal linked to a given timer
sf_vec * phie_dummy
no elliptic solver needed, but we need a dummy for phie to use parabolic solver
eikonal_solver eik_solver
Solver for the eikonal equation.
LAT_detector lat
the activation time detector
gvec_data gvec
datastruct holding global IMP state variable output
generic_timing_stats IO_stats
grid_t
An electrics grid identifier to distinguish between intra and extra grids.
igb_output_manager output_manager_cycle
void initialize()
Initialize the Eikonal class.
igb_output_manager output_manager_time
class handling the igb output
LocalSolver(SF::dmat< double > &D, std::array< SF::Point, MESH_SIZE > &points, std::array< double, MESH_SIZE > &values)
void FIM()
Standard fast iterative method to solve eikonal equation with active list approach.
void update_repolarization_times_from_rd(sf_vec &Vmv, sf_vec &Vmv_old, double time)
Updates node repolarization times based on transmembrane voltage crossing.
SF::vector< SF_real > T_R
void init_imp_region_properties()
Initializes diffusion current models and CV restitution parameters per mesh node.
SF::vector< mesh_int_t > n2e_dsp
SF::vector< SF_real > T_A
mesh_int_t Index_currStim
SF::vector< SF_real > TA_old
SF::vector< diffusion_current > diff_cur
void init()
Initialize vectors and variables in the eikonal_solver class.
SF::vector< mesh_int_t > e2n_con
bool determine_model_to_run(double &time)
Determine the next model to run in the alternation between RD and Eikonal.
SF::vector< mesh_int_t > stim_status
SF::vector< mesh_int_t > elem_start
SF::vector< mesh_int_t > StimulusPoints
SF::vector< SF_real > rho_cvrest
std::vector< double > CV_L
void save_eikonal_state(const char *tsav_ext)
Save the current state of variables related to the Eikonal simulation to a file to initialize a futur...
SF::vector< SF_real > denom_cvrest
void compute_diffusion_current(const double &time, sf_vec &vm)
Computes the stimulus-driven diffusion current at mesh nodes.
std::vector< mesh_int_t > n2n_connect
void set_stimuli(SF::vector< stimulus > &stimuli)
Simple setter for stimulus vector.
SF::vector< mesh_int_t > e2n_cnt
SF::vector< mesh_int_t > n2e_con
void clean_list()
Clean the list of nodes by resetting their status and tracking changes based on the time step of the ...
SF::vector< SF_real > D_I
SF::vector< mesh_int_t > nReadded2List
SF::vector< SF_real > theta_cvrest
SF::vector< mesh_int_t > num_changes
std::vector< mesh_int_t > n2n_dsp
SF::vector< SF_real > StimulusTimes
SF::vector< SF_real > kappa_cvrest
SF::vector< mesh_int_t > n2e_cnt
void cycFIM()
Implementation of the cyclical fast iterative method used in step A of the DREAM model.
void update_repolarization_times(const Ionics &ion)
Estimates initial repolarization times (T_R) in Step D of DREAM.
eikonal_solver_stats stats
SF::vector< mesh_int_t > List
std::vector< SF::dmat< double > > S
Tissue level electrics, main Electrics physics class.
Electrical ionics functions and LIMPET wrappers.
constexpr T min(T a, T b)
void f_close(FILE_SPEC &f)
Close a FILE_SPEC.
Simulator-level utility execution control functions.
Electrical stimulation functions.
description of materal properties in a mesh
for analysis of the computations done to solve the eikonal model
for analysis of the #iterations to solve CG
Struct used for debugging purposes.
const char * reasonOut
reason for list entry
SF_real T_R
repolarization time
void init_logger(const char *filename)
void log_stats(double tm, bool cflg)
SF_real D_I
diastolic interval
mesh_int_t idXNB
neighboring node index responsible for list entry
const char * reasonIn
reason for list entry
SF_real T_A_
previous activation time
SF_real T_A
current activation time
SF_real nbn_T_A
activation time of neighboring node
mesh_int_t cycle
DREAM cycle.
void update_status(enum status s, enum reason r)