|
openCARP
Doxygen code documentation for the open cardiac electrophysiology simulator openCARP
|
#include <electrics_eikonal.h>
Classes | |
| struct | diffusion_current |
Public Types | |
| enum | Idiff_t { FOOT = 0 , GAUSS = 1 } |
Public Member Functions | |
| eikonal_solver () | |
| ~eikonal_solver () | |
| void | init () |
| Initialize vectors and variables in the eikonal_solver class. More... | |
| bool | determine_model_to_run (double &time) |
| Determine the next model to run in the alternation between RD and Eikonal. More... | |
| void | set_stimuli (SF::vector< stimulus > &stimuli) |
| Simple setter for stimulus vector. More... | |
| void | clean_list () |
| Clean the list of nodes by resetting their status and tracking changes based on the time step of the RD model. More... | |
| 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 future simulation. More... | |
| void | update_repolarization_times (const Ionics &ion) |
| Estimates initial repolarization times (T_R) in Step D of DREAM. More... | |
| void | cycFIM () |
| Implementation of the cyclical fast iterative method used in step A of the DREAM model. More... | |
| void | FIM () |
| Standard fast iterative method to solve eikonal equation with active list approach. More... | |
| void | update_repolarization_times_from_rd (sf_vec &Vmv, sf_vec &Vmv_old, double time) |
| Updates node repolarization times based on transmembrane voltage crossing. More... | |
| void | compute_diffusion_current (const double &time, sf_vec &vm) |
| Computes the stimulus-driven diffusion current at mesh nodes. More... | |
| void | init_imp_region_properties () |
| Initializes diffusion current models and CV restitution parameters per mesh node. More... | |
Definition at line 67 of file electrics_eikonal.h.
| Enumerator | |
|---|---|
| FOOT | |
| GAUSS | |
Definition at line 78 of file electrics_eikonal.h.
|
inline |
Definition at line 70 of file electrics_eikonal.h.
|
inline |
Definition at line 131 of file electrics_eikonal.h.
| void opencarp::eikonal_solver::clean_list | ( | ) |
Clean the list of nodes by resetting their status and tracking changes based on the time step of the RD model.
This function iterates through a list of nodes and checks if their activation time (T_A[j]) is less than the current time managed by user_globals::tm_manager->time. If so, it performs the following operations:
List, T_A, TA_old, Status, and num_changes2. user_globals::tm_manager->time for the current time threshold. It makes sure that activation times behind the time step of the RD model are not considered. Definition at line 1395 of file electrics_eikonal.cc.
| void opencarp::eikonal_solver::compute_diffusion_current | ( | const double & | time, |
| sf_vec & | vm | ||
| ) |
Computes the stimulus-driven diffusion current at mesh nodes.
This function evaluates the time-dependent diffusion (stimulus) current for algebraic nodes in the mesh, based on the activation times and node-specific diffusion current models. The result is stored in Idiff for later use in the parabolic solver.
| time | Current simulation time. |
| vm | Vector of nodal transmembrane voltages, used to evaluate voltage-dependent stimulus models. |
List[node] == 0.
, producing:
if dT ≥ 0 else 0,
if vm < V_th else 0.Idiff at the PETSc local index corresponding to the node.stats.slvtime_B.Definition at line 1499 of file electrics_eikonal.cc.
| void opencarp::eikonal_solver::cycFIM | ( | ) |
Implementation of the cyclical fast iterative method used in step A of the DREAM model.
Definition at line 968 of file electrics_eikonal.cc.
| bool opencarp::eikonal_solver::determine_model_to_run | ( | double & | time | ) |
Determine the next model to run in the alternation between RD and Eikonal.
This function decides which model to run next based on the DREAM condition. If the output value is true, it will run the RD model; if false, it will run the Eikonal model.
| time | The current time step in the RD model used to evaluate the conditions. |
Definition at line 1364 of file electrics_eikonal.cc.
| void opencarp::eikonal_solver::FIM | ( | ) |
Standard fast iterative method to solve eikonal equation with active list approach.
Definition at line 866 of file electrics_eikonal.cc.
| void opencarp::eikonal_solver::init | ( | ) |
Initialize vectors and variables in the eikonal_solver class.
Definition at line 547 of file electrics_eikonal.cc.
| void opencarp::eikonal_solver::init_imp_region_properties | ( | ) |
Initializes diffusion current models and CV restitution parameters per mesh node.
This function prepares per-node properties required for computing stimulus-driven diffusion currents and conduction velocity restitution effects, based on region-specific parameters defined in param_globals::imp_region.
diff_cur : diffusion current model parametersrho_cvrest, kappa_cvrest, theta_cvrest, denom_cvrest : restitution parametersregion_mask() to resolve region IDs from tags.
).
).

output_level is enabled.Definition at line 613 of file electrics_eikonal.cc.
| void opencarp::eikonal_solver::save_eikonal_state | ( | const char * | tsav_ext | ) |
Save the current state of variables related to the Eikonal simulation to a file to initialize a future simulation.
This function saves the current state of variables, including activation times (T_A), repolazitaion times (T_R), old activation times (TA_old), and other required variables
The data is saved in a structured format where each line corresponds to a node: The file is named based on the param_globals::write_statef and tsav_ext parameters.
| tsav_ext | Extension to append to the file name. |
Definition at line 1545 of file electrics_eikonal.cc.
|
inline |
Simple setter for stimulus vector.
Definition at line 153 of file electrics_eikonal.h.
| void opencarp::eikonal_solver::update_repolarization_times | ( | const Ionics & | ion | ) |
Estimates initial repolarization times (T_R) in Step D of DREAM.
This function performs a short run of the ionic model (not a full RD simulation) to update T_R. It only iterates over nodes that do not have an up to date value of T_R. When detected, the current simulation time is stored in T_R[ind_nodes]. The function resets state variables to their pre-call values.
| ion | The Ionics object containing information about the ionic model. |
Definition at line 1433 of file electrics_eikonal.cc.
| void opencarp::eikonal_solver::update_repolarization_times_from_rd | ( | sf_vec & | Vmv, |
| sf_vec & | Vmv_old, | ||
| double | time | ||
| ) |
Updates node repolarization times based on transmembrane voltage crossing.
This function scans all mesh nodes and records the time at which each node’s transmembrane potential falls below a given threshold, marking the end of its action potential (repolarization). Uses Vm from the parabolic solver.
| Vmv | Vector of current transmembrane voltages at all nodes. |
| Vmv_old | Vector of transmembrane voltages from the previous timestep. |
| time | Current simulation time, recorded as the repolarization time for nodes that cross the threshold during this step. |
param_globals::dream.repol_time_thresh.ind_nodes: Vmv_old[ind_nodes] ≥ threshold and Vmv[ind_nodes] < threshold, the repolarization time T_R[ind_nodes] is set to time.Vmv and Vmv_old are explicitly managed via ptr() and release_ptr().Definition at line 1416 of file electrics_eikonal.cc.
| SF_real opencarp::eikonal_solver::actMAX = 0 |
Definition at line 105 of file electrics_eikonal.h.
| SF_real opencarp::eikonal_solver::actMIN = 0 |
Definition at line 105 of file electrics_eikonal.h.
| sf_vec* opencarp::eikonal_solver::AT = nullptr |
Definition at line 125 of file electrics_eikonal.h.
| std::vector<double> opencarp::eikonal_solver::CV_L |
Definition at line 118 of file electrics_eikonal.h.
| SF::vector<SF_real> opencarp::eikonal_solver::D_I |
Definition at line 100 of file electrics_eikonal.h.
| SF::vector<SF_real> opencarp::eikonal_solver::denom_cvrest |
Definition at line 121 of file electrics_eikonal.h.
| SF::vector<diffusion_current> opencarp::eikonal_solver::diff_cur |
Definition at line 99 of file electrics_eikonal.h.
| SF::vector<mesh_int_t> opencarp::eikonal_solver::e2n_cnt |
Definition at line 114 of file electrics_eikonal.h.
| SF::vector<mesh_int_t> opencarp::eikonal_solver::e2n_con |
Definition at line 111 of file electrics_eikonal.h.
| SF::vector<mesh_int_t> opencarp::eikonal_solver::elem_start |
Definition at line 112 of file electrics_eikonal.h.
| sf_vec* opencarp::eikonal_solver::Idiff = nullptr |
Definition at line 124 of file electrics_eikonal.h.
Definition at line 80 of file electrics_eikonal.h.
| mesh_int_t opencarp::eikonal_solver::Index_currStim |
Definition at line 104 of file electrics_eikonal.h.
| const double opencarp::eikonal_solver::inf = std::numeric_limits<double>::infinity() |
Definition at line 72 of file electrics_eikonal.h.
| SF::vector<SF_real> opencarp::eikonal_solver::kappa_cvrest |
Definition at line 121 of file electrics_eikonal.h.
| SF::vector<mesh_int_t> opencarp::eikonal_solver::List |
Definition at line 101 of file electrics_eikonal.h.
| mesh_int_t opencarp::eikonal_solver::MESH_SIZE |
Definition at line 108 of file electrics_eikonal.h.
| SF::vector<mesh_int_t> opencarp::eikonal_solver::n2e_cnt |
Definition at line 114 of file electrics_eikonal.h.
| SF::vector<mesh_int_t> opencarp::eikonal_solver::n2e_con |
Definition at line 114 of file electrics_eikonal.h.
| SF::vector<mesh_int_t> opencarp::eikonal_solver::n2e_dsp |
Definition at line 114 of file electrics_eikonal.h.
| std::vector<mesh_int_t> opencarp::eikonal_solver::n2n_connect |
Definition at line 113 of file electrics_eikonal.h.
| std::vector<mesh_int_t> opencarp::eikonal_solver::n2n_dsp |
Definition at line 113 of file electrics_eikonal.h.
| node_stats opencarp::eikonal_solver::nodeData |
Definition at line 75 of file electrics_eikonal.h.
| SF::vector<mesh_int_t> opencarp::eikonal_solver::nReadded2List |
Definition at line 101 of file electrics_eikonal.h.
| SF::vector<mesh_int_t> opencarp::eikonal_solver::num_changes |
Definition at line 101 of file electrics_eikonal.h.
| size_t opencarp::eikonal_solver::num_pts |
Definition at line 110 of file electrics_eikonal.h.
| SF::vector<SF_real> opencarp::eikonal_solver::rho_cvrest |
Definition at line 121 of file electrics_eikonal.h.
| sf_vec* opencarp::eikonal_solver::RT = nullptr |
Definition at line 126 of file electrics_eikonal.h.
| std::vector<SF::dmat<double> > opencarp::eikonal_solver::S |
Definition at line 117 of file electrics_eikonal.h.
| eikonal_solver_stats opencarp::eikonal_solver::stats |
Definition at line 129 of file electrics_eikonal.h.
| SF::vector<mesh_int_t> opencarp::eikonal_solver::stim_status |
Definition at line 101 of file electrics_eikonal.h.
| SF::vector<mesh_int_t> opencarp::eikonal_solver::StimulusPoints |
Definition at line 102 of file electrics_eikonal.h.
| SF::vector<SF_real> opencarp::eikonal_solver::StimulusTimes |
Definition at line 103 of file electrics_eikonal.h.
| SF::vector<SF_real> opencarp::eikonal_solver::T_A |
Definition at line 100 of file electrics_eikonal.h.
| SF::vector<SF_real> opencarp::eikonal_solver::T_R |
Definition at line 100 of file electrics_eikonal.h.
| SF::vector<SF_real> opencarp::eikonal_solver::TA_old |
Definition at line 100 of file electrics_eikonal.h.
| SF::vector<SF_real> opencarp::eikonal_solver::theta_cvrest |
Definition at line 121 of file electrics_eikonal.h.
| bool opencarp::eikonal_solver::twoFib |
Definition at line 109 of file electrics_eikonal.h.