svMultiPhysics
Loading...
Searching...
No Matches
CepMod.h
1// SPDX-FileCopyrightText: Copyright (c) Stanford University, The Regents of the University of California, and others.
2// SPDX-License-Identifier: BSD-3-Clause
3
4// The classes defined here duplicate the data structures in the Fortran CEPMOD module
5// defined in CEPMOD.f.
6
7// This module defines data structures for cardiac electrophysiology
8// model equation. It also interfaces with individual modules for
9// the cellular activation model.
10
11#ifndef CEP_MOD_H
12#define CEP_MOD_H
13
14#include "consts.h"
15#include "ionic_model.h"
16
17#include "Array.h"
18#include "Vector.h"
19#include <map>
20#include <memory>
21
22/// @brief Type of cardiac electrophysiology models.
23enum class ElectrophysiologyModelType {
24 NA = 100,
25 AP = 101,
26 BO = 102,
27 FN = 103,
28 TTP = 104
29};
30
31extern const std::map<ElectrophysiologyModelType, std::string> cep_model_type_to_name;
32extern const std::map<std::string,ElectrophysiologyModelType> cep_model_name_to_type;
33
34/// @brief Print ElectrophysiologyModelType as a string.
35static std::ostream &operator << ( std::ostream& strm, ElectrophysiologyModelType type)
36{
37 const std::map<ElectrophysiologyModelType, std::string> names = {
38 {ElectrophysiologyModelType::NA, "NA"},
39 {ElectrophysiologyModelType::AP,"AP"},
40 {ElectrophysiologyModelType::BO, "BO"},
41 {ElectrophysiologyModelType::FN, "FN"},
42 {ElectrophysiologyModelType::TTP, "TTP"},
43 };
44 return strm << names.at(type);
45}
46
47/// @brief External stimulus type
49{
50 public:
51 /// @brief start time
52 double Ts = 0.0;
53
54 /// @brief duration of stimulus
55 double Td = 0.0;
56
57 /// @brief cycle length
58 double CL = 0.0;
59
60 /// @brief stimulus amplitude
61 double A = 0.0;
62};
63
64/// @brief ECG leads type
66{
67 public:
68 /// @brief Number of leads
69 int num_leads = 0;
70
71 /// @brief x coordinates
73
74 /// @brief y coordinates
76
77 /// @brief z coordinates
79
80 /// @brief Pseudo ECG over each lead
82
83 /// @brief Output files
84 std::vector<std::string> out_files;
85};
86
87/// @brief Cardiac electrophysiology model type
89{
90 public:
93
94 /// @brief Type of cardiac electrophysiology model
95 ElectrophysiologyModelType cepType = ElectrophysiologyModelType::NA;
96
97 /// @brief Number of state variables
98 int nX = 0;
99
100 /// @brief Number of gating variables
101 int nG = 0;
102
103 /// @brief Number of fiber directions
104 int nFn = 0;
105
106 /// @brief Myocardium zone id, default to epicardium.
107 int imyo = 1;
108
109 /// @brief Time step for integration
110 double dt = 0.0;
111
112 /// @brief Constant for stretch-activated-currents
113 double Ksac = 0.0;
114
115 /// @brief Isotropic conductivity
116 double Diso = 0.0;
117
118 /// @brief Anisotropic conductivity
120
121 /// @brief External stimulus
123
124 /// @brief Time integration options
126
127 /// @brief Ionic model instance.
128 std::shared_ptr<IonicModel> ionic_model;
129};
130
131/// @brief Cardiac electromechanics model type
133{
134 public:
135 /// @brief Whether electrophysiology and mechanics are coupled
136 bool cpld = false;
137 //bool cpld = .FALSE.
138
139 /// @brief Whether active stress formulation is employed
140 bool aStress = false;
141 //bool aStress = .FALSE.
142
143 /// @brief Whether active strain formulation is employed
144 bool aStrain = false;
145 //bool aStrain = .FALSE.
146
147 /// @brief Local variable integrated in time
148 /// := activation force for active stress model
149 /// := fiber stretch for active strain model
151};
152
153class CepMod
154{
155 public:
156
157 /// @brief Whether cardiac electrophysiology is solved
158 bool cepEq;
159
160 /// @brief Max. dof in cellular activation model
161 int nXion = 0;
162
163 /// @brief Unknowns stored at all nodes
164 Array<double> Xion;
165
166 /// @brief Cardiac electromechanics type
168
169 /// @brief ECG leads
171};
172
173#endif
174
Definition CepMod.h:154
int nXion
Max. dof in cellular activation model.
Definition CepMod.h:161
bool cepEq
Whether cardiac electrophysiology is solved.
Definition CepMod.h:158
cemModelType cem
Cardiac electromechanics type.
Definition CepMod.h:167
Array< double > Xion
Unknowns stored at all nodes.
Definition CepMod.h:164
ecgLeadsType ecgleads
ECG leads.
Definition CepMod.h:170
Ten Tusscher-Panfilov ionic model.
Definition ionic_ttp.h:31
The Vector template class is used for storing int and double data.
Definition Vector.h:24
Cardiac electromechanics model type.
Definition CepMod.h:133
bool aStress
Whether active stress formulation is employed.
Definition CepMod.h:140
bool cpld
Whether electrophysiology and mechanics are coupled.
Definition CepMod.h:136
bool aStrain
Whether active strain formulation is employed.
Definition CepMod.h:144
Vector< double > Ya
Local variable integrated in time := activation force for active stress model := fiber stretch for ac...
Definition CepMod.h:150
Cardiac electrophysiology model type.
Definition CepMod.h:89
double Diso
Isotropic conductivity.
Definition CepMod.h:116
int nFn
Number of fiber directions.
Definition CepMod.h:104
double Ksac
Constant for stretch-activated-currents.
Definition CepMod.h:113
odeType odes
Time integration options.
Definition CepMod.h:125
ElectrophysiologyModelType cepType
Type of cardiac electrophysiology model.
Definition CepMod.h:95
int nX
Number of state variables.
Definition CepMod.h:98
Vector< double > Dani
Anisotropic conductivity.
Definition CepMod.h:119
int nG
Number of gating variables.
Definition CepMod.h:101
std::shared_ptr< IonicModel > ionic_model
Ionic model instance.
Definition CepMod.h:128
double dt
Time step for integration.
Definition CepMod.h:110
stimType Istim
External stimulus.
Definition CepMod.h:122
int imyo
Myocardium zone id, default to epicardium.
Definition CepMod.h:107
ECG leads type.
Definition CepMod.h:66
Vector< double > pseudo_ECG
Pseudo ECG over each lead.
Definition CepMod.h:81
Vector< double > x_coords
x coordinates
Definition CepMod.h:72
int num_leads
Number of leads.
Definition CepMod.h:69
Vector< double > y_coords
y coordinates
Definition CepMod.h:75
Vector< double > z_coords
z coordinates
Definition CepMod.h:78
std::vector< std::string > out_files
Output files.
Definition CepMod.h:84
Time integration scheme and related parameters.
Definition ionic_model.h:48
External stimulus type.
Definition CepMod.h:49
double Ts
start time
Definition CepMod.h:52
double A
stimulus amplitude
Definition CepMod.h:61
double CL
cycle length
Definition CepMod.h:58
double Td
duration of stimulus
Definition CepMod.h:55