openCARP
Doxygen code documentation for the open cardiac electrophysiology simulator openCARP
Classes | Public Types | Public Member Functions | Public Attributes | List of all members
opencarp::eikonal_solver Class Reference

#include <electrics_eikonal.h>

Collaboration diagram for opencarp::eikonal_solver:

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_initial_cv ()
 Set the initial conduction velocity (CV) parameters for the nodes in the mesh. 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)
 Checks if Vm crosses the repolarization threshold during each time step of the parabolic solver and updates T_R accordingly. More...
 
void compute_diffusion_current (const double &time, sf_vec &vm)
 Compute the diffusion current approximation I_diff in all activated nodes. Only converged nodes are considered. More...
 
void compute_bc ()
 Computes and updates boundary counditions in cycFIM. More...
 

Public Attributes

size_t num_pts
 
mesh_int_t numPtsxElem
 
SF_real time2stop_eikonal
 
SF_real CV_l
 
mesh_int_t Index_currStim
 
const double inf = std::numeric_limits<double>::infinity()
 
SF_real A
 
SF_real B
 
SF_real C
 
SF_real lam
 
SF_real ae
 
SF_real be
 
SF_real ce
 
SF_real det
 
SF_real Num
 
SF_real Frac
 
SF_real TA
 
SF_real TA_ori
 
SF_real p1
 
SF_real p2
 
node_stats nodeData
 
SF_real c1
 
SF_real c2
 
SF_real c3
 
SF_real c4
 
SF_real c5
 
SF_real c6
 
SF_real a1
 
SF_real s1
 
SF_real s2
 
SF_real s3
 
SF_real a2
 
SF_real s4
 
SF_real b1
 
SF_real b2
 
SF_real R1
 
SF_real R2
 
SF_real R3
 
SF_real R4
 
SF_real R5
 
SF_real asol
 
SF_real bsol
 
SF_real a
 
SF_real b
 
SF_real derivat_a
 
SF_real derivat_b
 
double DI
 
Idiff_t Idiff_tech = FOOT
 
SF::vector< diffusion_currentdiff_cur
 
SF::vector< SF_realT_A
 
SF::vector< SF_realT_R
 
SF::vector< SF_realTA_old
 
SF::vector< SF_realD_I
 
SF::vector< mesh_int_tList
 
SF::vector< mesh_int_tnum_changes
 
SF::vector< mesh_int_tnReadded2List
 
SF::vector< mesh_int_tstim_status
 
SF::vector< mesh_int_tStimulusPoints
 
SF::vector< SF_realStimulusTimes
 
SF::vector< mesh_int_te2n_con
 
SF::vector< mesh_int_telem_start
 
bool twoFib
 
SF::vector< SF_realfiber_node
 
SF::vector< SF_realsheet_node
 
SF::vector< SF_realx_coord
 
SF::vector< SF_realy_coord
 
SF::vector< SF_realz_coord
 
SF::vector< SF_realCVnodes
 
SF::vector< SF_realCVnodes_mod
 
SF::vector< SF_realp_cvrest
 
SF::vector< SF_realk_cvrest
 
SF::vector< SF_realj_cvrest
 
SF::vector< SF_reall_cvrest
 
SF::vector< SF_realcv_ar_t
 
SF::vector< SF_realcv_ar_n
 
sf_vecIdiff = nullptr
 
sf_vecAT = nullptr
 
sf_vecRT = nullptr
 
std::vector< mesh_int_tn2n_connect
 
std::vector< mesh_int_tn2n_dsp
 
SF::vector< mesh_int_te2n_cnt
 
SF::vector< mesh_int_tn2e_cnt
 
SF::vector< mesh_int_tn2e_con
 
SF::vector< mesh_int_tn2e_dsp
 
SF::dmat< double > D
 
SF::dmat< double > iD
 
SF_real actMIN = 0
 
SF_real actMAX = 0
 
eikonal_solver_stats stats
 
bool condign1
 
bool condign2
 
bool condign3
 
bool condign4
 

Detailed Description

Definition at line 78 of file electrics_eikonal.h.

Member Enumeration Documentation

◆ Idiff_t

Enumerator
FOOT 
GAUSS 

Definition at line 117 of file electrics_eikonal.h.

Constructor & Destructor Documentation

◆ eikonal_solver()

opencarp::eikonal_solver::eikonal_solver ( )
inline

Definition at line 81 of file electrics_eikonal.h.

◆ ~eikonal_solver()

opencarp::eikonal_solver::~eikonal_solver ( )
inline

Definition at line 167 of file electrics_eikonal.h.

Member Function Documentation

◆ clean_list()

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:

  • Updates the old activation time (TA_old[j]) with the current activation time (T_A[j]).
  • Resets the status of the node to 0.
  • Resets the change counter of number of times the node reenter the list (num_changes2[j]) to 0.
  • If the node is marked as active in the list (List[j] == 1), it marks it as inactive (List[j] = 0).
Note
The function depends on the existence of the global variables 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 907 of file electrics_eikonal.cc.

Here is the caller graph for this function:

◆ compute_bc()

void opencarp::eikonal_solver::compute_bc ( )

Computes and updates boundary counditions in cycFIM.

This function handles the application of stimulus to nodes in the system based on their activation times and other relevant parameters. It iterates through a list of stimulus points and updates node status, activation times based on the refractory states at the time of each stimuli. It dynamically adapts to the state of the simulation when the boundary condition is computed.

Definition at line 963 of file electrics_eikonal.cc.

◆ compute_diffusion_current()

void opencarp::eikonal_solver::compute_diffusion_current ( const double &  time,
sf_vec vm 
)

Compute the diffusion current approximation I_diff in all activated nodes. Only converged nodes are considered.

Parameters
timeCurrent simulation time.
vmReference to pointer holding current Vm values.

Definition at line 1751 of file electrics_eikonal.cc.

Here is the caller graph for this function:

◆ cycFIM()

void opencarp::eikonal_solver::cycFIM ( )

Implementation of the cyclical fast iterative method used in step A of the DREAM model.

Definition at line 1144 of file electrics_eikonal.cc.

Here is the caller graph for this function:

◆ determine_model_to_run()

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.

Parameters
timeThe current time step in the RD model used to evaluate the conditions.
Returns
A boolean indicating whether to run the RD model (true) or the Eikonal model (false).

Definition at line 804 of file electrics_eikonal.cc.

Here is the caller graph for this function:

◆ FIM()

void opencarp::eikonal_solver::FIM ( )

Standard fast iterative method to solve eikonal equation with active list approach.

Definition at line 1072 of file electrics_eikonal.cc.

Here is the caller graph for this function:

◆ init()

void opencarp::eikonal_solver::init ( )

Initialize vectors and variables in the eikonal_solver class.

Definition at line 686 of file electrics_eikonal.cc.

Here is the caller graph for this function:

◆ save_eikonal_state()

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.

Parameters
tsav_extExtension to append to the file name.

Definition at line 1654 of file electrics_eikonal.cc.

Here is the caller graph for this function:

◆ set_initial_cv()

void opencarp::eikonal_solver::set_initial_cv ( )

Set the initial conduction velocity (CV) parameters for the nodes in the mesh.

This function initializes the reference conduction velocity and related parameters of restitution for each node in the mesh based on predefined global regions. It iterates over the regions and their respective IDs, retrieving the vertices for each region and setting the corresponding CV parameters. Additionally, it handles the scaling of CV based on external data if specified.

Note
The function also initializes the CV values with scaling factors if an external scaling vector file is provided.

Definition at line 816 of file electrics_eikonal.cc.

Here is the caller graph for this function:

◆ set_stimuli()

void opencarp::eikonal_solver::set_stimuli ( SF::vector< stimulus > &  stimuli)
inline

Simple setter for stimulus vector.

Definition at line 201 of file electrics_eikonal.h.

Here is the caller graph for this function:

◆ update_repolarization_times()

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.

Parameters
ionThe Ionics object containing information about the ionic model.

Definition at line 1685 of file electrics_eikonal.cc.

Here is the caller graph for this function:

◆ update_repolarization_times_from_rd()

void opencarp::eikonal_solver::update_repolarization_times_from_rd ( sf_vec Vmv,
sf_vec Vmv_old,
double  time 
)

Checks if Vm crosses the repolarization threshold during each time step of the parabolic solver and updates T_R accordingly.

Parameters
VmvReference to pointer holding current Vm values.
Vmv_oldReference to pointer holding previous Vm values.
timeCurrent simulation time, used to update T_R[ind_nodes] when a recovery event is detected.
Remarks
The function assumes that Vmv and Vmv_old have the same length (num_pts). Upon completion, the function releases the pointers of Vmv_old and Vmv.

Definition at line 1669 of file electrics_eikonal.cc.

Here is the caller graph for this function:

Member Data Documentation

◆ A

SF_real opencarp::eikonal_solver::A

Definition at line 93 of file electrics_eikonal.h.

◆ a

SF_real opencarp::eikonal_solver::a

Definition at line 111 of file electrics_eikonal.h.

◆ a1

SF_real opencarp::eikonal_solver::a1

Definition at line 108 of file electrics_eikonal.h.

◆ a2

SF_real opencarp::eikonal_solver::a2

Definition at line 108 of file electrics_eikonal.h.

◆ actMAX

SF_real opencarp::eikonal_solver::actMAX = 0

Definition at line 160 of file electrics_eikonal.h.

◆ actMIN

SF_real opencarp::eikonal_solver::actMIN = 0

Definition at line 160 of file electrics_eikonal.h.

◆ ae

SF_real opencarp::eikonal_solver::ae

Definition at line 95 of file electrics_eikonal.h.

◆ asol

SF_real opencarp::eikonal_solver::asol

Definition at line 110 of file electrics_eikonal.h.

◆ AT

sf_vec* opencarp::eikonal_solver::AT = nullptr

Definition at line 152 of file electrics_eikonal.h.

◆ B

SF_real opencarp::eikonal_solver::B

Definition at line 93 of file electrics_eikonal.h.

◆ b

SF_real opencarp::eikonal_solver::b

Definition at line 111 of file electrics_eikonal.h.

◆ b1

SF_real opencarp::eikonal_solver::b1

Definition at line 108 of file electrics_eikonal.h.

◆ b2

SF_real opencarp::eikonal_solver::b2

Definition at line 108 of file electrics_eikonal.h.

◆ be

SF_real opencarp::eikonal_solver::be

Definition at line 96 of file electrics_eikonal.h.

◆ bsol

SF_real opencarp::eikonal_solver::bsol

Definition at line 110 of file electrics_eikonal.h.

◆ C

SF_real opencarp::eikonal_solver::C

Definition at line 93 of file electrics_eikonal.h.

◆ c1

SF_real opencarp::eikonal_solver::c1

Definition at line 107 of file electrics_eikonal.h.

◆ c2

SF_real opencarp::eikonal_solver::c2

Definition at line 107 of file electrics_eikonal.h.

◆ c3

SF_real opencarp::eikonal_solver::c3

Definition at line 107 of file electrics_eikonal.h.

◆ c4

SF_real opencarp::eikonal_solver::c4

Definition at line 107 of file electrics_eikonal.h.

◆ c5

SF_real opencarp::eikonal_solver::c5

Definition at line 107 of file electrics_eikonal.h.

◆ c6

SF_real opencarp::eikonal_solver::c6

Definition at line 107 of file electrics_eikonal.h.

◆ ce

SF_real opencarp::eikonal_solver::ce

Definition at line 97 of file electrics_eikonal.h.

◆ condign1

bool opencarp::eikonal_solver::condign1

Definition at line 165 of file electrics_eikonal.h.

◆ condign2

bool opencarp::eikonal_solver::condign2

Definition at line 165 of file electrics_eikonal.h.

◆ condign3

bool opencarp::eikonal_solver::condign3

Definition at line 165 of file electrics_eikonal.h.

◆ condign4

bool opencarp::eikonal_solver::condign4

Definition at line 165 of file electrics_eikonal.h.

◆ cv_ar_n

SF::vector<SF_real> opencarp::eikonal_solver::cv_ar_n

Definition at line 150 of file electrics_eikonal.h.

◆ cv_ar_t

SF::vector<SF_real> opencarp::eikonal_solver::cv_ar_t

Definition at line 150 of file electrics_eikonal.h.

◆ CV_l

SF_real opencarp::eikonal_solver::CV_l

Definition at line 87 of file electrics_eikonal.h.

◆ CVnodes

SF::vector<SF_real> opencarp::eikonal_solver::CVnodes

Definition at line 150 of file electrics_eikonal.h.

◆ CVnodes_mod

SF::vector<SF_real> opencarp::eikonal_solver::CVnodes_mod

Definition at line 150 of file electrics_eikonal.h.

◆ D

SF::dmat<double> opencarp::eikonal_solver::D

Definition at line 158 of file electrics_eikonal.h.

◆ D_I

SF::vector<SF_real> opencarp::eikonal_solver::D_I

Definition at line 139 of file electrics_eikonal.h.

◆ derivat_a

SF_real opencarp::eikonal_solver::derivat_a

Definition at line 112 of file electrics_eikonal.h.

◆ derivat_b

SF_real opencarp::eikonal_solver::derivat_b

Definition at line 112 of file electrics_eikonal.h.

◆ det

SF_real opencarp::eikonal_solver::det

Definition at line 98 of file electrics_eikonal.h.

◆ DI

double opencarp::eikonal_solver::DI

Definition at line 114 of file electrics_eikonal.h.

◆ diff_cur

SF::vector<diffusion_current> opencarp::eikonal_solver::diff_cur

Definition at line 138 of file electrics_eikonal.h.

◆ e2n_cnt

SF::vector<mesh_int_t> opencarp::eikonal_solver::e2n_cnt

Definition at line 156 of file electrics_eikonal.h.

◆ e2n_con

SF::vector<mesh_int_t> opencarp::eikonal_solver::e2n_con

Definition at line 144 of file electrics_eikonal.h.

◆ elem_start

SF::vector<mesh_int_t> opencarp::eikonal_solver::elem_start

Definition at line 145 of file electrics_eikonal.h.

◆ fiber_node

SF::vector<SF_real> opencarp::eikonal_solver::fiber_node

Definition at line 148 of file electrics_eikonal.h.

◆ Frac

SF_real opencarp::eikonal_solver::Frac

Definition at line 99 of file electrics_eikonal.h.

◆ iD

SF::dmat<double> opencarp::eikonal_solver::iD

Definition at line 158 of file electrics_eikonal.h.

◆ Idiff

sf_vec* opencarp::eikonal_solver::Idiff = nullptr

Definition at line 151 of file electrics_eikonal.h.

◆ Idiff_tech

Idiff_t opencarp::eikonal_solver::Idiff_tech = FOOT

Definition at line 119 of file electrics_eikonal.h.

◆ Index_currStim

mesh_int_t opencarp::eikonal_solver::Index_currStim

Definition at line 88 of file electrics_eikonal.h.

◆ inf

const double opencarp::eikonal_solver::inf = std::numeric_limits<double>::infinity()

Definition at line 90 of file electrics_eikonal.h.

◆ j_cvrest

SF::vector<SF_real> opencarp::eikonal_solver::j_cvrest

Definition at line 150 of file electrics_eikonal.h.

◆ k_cvrest

SF::vector<SF_real> opencarp::eikonal_solver::k_cvrest

Definition at line 150 of file electrics_eikonal.h.

◆ l_cvrest

SF::vector<SF_real> opencarp::eikonal_solver::l_cvrest

Definition at line 150 of file electrics_eikonal.h.

◆ lam

SF_real opencarp::eikonal_solver::lam

Definition at line 94 of file electrics_eikonal.h.

◆ List

SF::vector<mesh_int_t> opencarp::eikonal_solver::List

Definition at line 140 of file electrics_eikonal.h.

◆ n2e_cnt

SF::vector<mesh_int_t> opencarp::eikonal_solver::n2e_cnt

Definition at line 156 of file electrics_eikonal.h.

◆ n2e_con

SF::vector<mesh_int_t> opencarp::eikonal_solver::n2e_con

Definition at line 156 of file electrics_eikonal.h.

◆ n2e_dsp

SF::vector<mesh_int_t> opencarp::eikonal_solver::n2e_dsp

Definition at line 156 of file electrics_eikonal.h.

◆ n2n_connect

std::vector<mesh_int_t> opencarp::eikonal_solver::n2n_connect

Definition at line 155 of file electrics_eikonal.h.

◆ n2n_dsp

std::vector<mesh_int_t> opencarp::eikonal_solver::n2n_dsp

Definition at line 155 of file electrics_eikonal.h.

◆ nodeData

node_stats opencarp::eikonal_solver::nodeData

Definition at line 104 of file electrics_eikonal.h.

◆ nReadded2List

SF::vector<mesh_int_t> opencarp::eikonal_solver::nReadded2List

Definition at line 140 of file electrics_eikonal.h.

◆ Num

SF_real opencarp::eikonal_solver::Num

Definition at line 99 of file electrics_eikonal.h.

◆ num_changes

SF::vector<mesh_int_t> opencarp::eikonal_solver::num_changes

Definition at line 140 of file electrics_eikonal.h.

◆ num_pts

size_t opencarp::eikonal_solver::num_pts

Definition at line 83 of file electrics_eikonal.h.

◆ numPtsxElem

mesh_int_t opencarp::eikonal_solver::numPtsxElem

Definition at line 85 of file electrics_eikonal.h.

◆ p1

SF_real opencarp::eikonal_solver::p1

Definition at line 101 of file electrics_eikonal.h.

◆ p2

SF_real opencarp::eikonal_solver::p2

Definition at line 101 of file electrics_eikonal.h.

◆ p_cvrest

SF::vector<SF_real> opencarp::eikonal_solver::p_cvrest

Definition at line 150 of file electrics_eikonal.h.

◆ R1

SF_real opencarp::eikonal_solver::R1

Definition at line 109 of file electrics_eikonal.h.

◆ R2

SF_real opencarp::eikonal_solver::R2

Definition at line 109 of file electrics_eikonal.h.

◆ R3

SF_real opencarp::eikonal_solver::R3

Definition at line 109 of file electrics_eikonal.h.

◆ R4

SF_real opencarp::eikonal_solver::R4

Definition at line 109 of file electrics_eikonal.h.

◆ R5

SF_real opencarp::eikonal_solver::R5

Definition at line 109 of file electrics_eikonal.h.

◆ RT

sf_vec* opencarp::eikonal_solver::RT = nullptr

Definition at line 153 of file electrics_eikonal.h.

◆ s1

SF_real opencarp::eikonal_solver::s1

Definition at line 108 of file electrics_eikonal.h.

◆ s2

SF_real opencarp::eikonal_solver::s2

Definition at line 108 of file electrics_eikonal.h.

◆ s3

SF_real opencarp::eikonal_solver::s3

Definition at line 108 of file electrics_eikonal.h.

◆ s4

SF_real opencarp::eikonal_solver::s4

Definition at line 108 of file electrics_eikonal.h.

◆ sheet_node

SF::vector<SF_real> opencarp::eikonal_solver::sheet_node

Definition at line 148 of file electrics_eikonal.h.

◆ stats

eikonal_solver_stats opencarp::eikonal_solver::stats

Definition at line 163 of file electrics_eikonal.h.

◆ stim_status

SF::vector<mesh_int_t> opencarp::eikonal_solver::stim_status

Definition at line 140 of file electrics_eikonal.h.

◆ StimulusPoints

SF::vector<mesh_int_t> opencarp::eikonal_solver::StimulusPoints

Definition at line 141 of file electrics_eikonal.h.

◆ StimulusTimes

SF::vector<SF_real> opencarp::eikonal_solver::StimulusTimes

Definition at line 142 of file electrics_eikonal.h.

◆ T_A

SF::vector<SF_real> opencarp::eikonal_solver::T_A

Definition at line 139 of file electrics_eikonal.h.

◆ T_R

SF::vector<SF_real> opencarp::eikonal_solver::T_R

Definition at line 139 of file electrics_eikonal.h.

◆ TA

SF_real opencarp::eikonal_solver::TA

Definition at line 100 of file electrics_eikonal.h.

◆ TA_old

SF::vector<SF_real> opencarp::eikonal_solver::TA_old

Definition at line 139 of file electrics_eikonal.h.

◆ TA_ori

SF_real opencarp::eikonal_solver::TA_ori

Definition at line 100 of file electrics_eikonal.h.

◆ time2stop_eikonal

SF_real opencarp::eikonal_solver::time2stop_eikonal

Definition at line 86 of file electrics_eikonal.h.

◆ twoFib

bool opencarp::eikonal_solver::twoFib

Definition at line 146 of file electrics_eikonal.h.

◆ x_coord

SF::vector<SF_real> opencarp::eikonal_solver::x_coord

Definition at line 149 of file electrics_eikonal.h.

◆ y_coord

SF::vector<SF_real> opencarp::eikonal_solver::y_coord

Definition at line 149 of file electrics_eikonal.h.

◆ z_coord

SF::vector<SF_real> opencarp::eikonal_solver::z_coord

Definition at line 149 of file electrics_eikonal.h.


The documentation for this class was generated from the following files: