Nektar++
Public Member Functions | Static Public Member Functions | Static Public Attributes | Protected Member Functions | Private Attributes | List of all members
Nektar::CellModelAlievPanfilov Class Reference

Aliev Panfilov model. More...

#include <AlievPanfilov.h>

Inheritance diagram for Nektar::CellModelAlievPanfilov:
[legend]

Public Member Functions

 CellModelAlievPanfilov (const LibUtilities::SessionReaderSharedPtr &pSession, const MultiRegions::ExpListSharedPtr &pField)
 
virtual ~CellModelAlievPanfilov ()
 
- Public Member Functions inherited from Nektar::CellModel
 CellModel (const LibUtilities::SessionReaderSharedPtr &pSession, const MultiRegions::ExpListSharedPtr &pField)
 
virtual ~CellModel ()
 
void Initialise ()
 Initialise the cell model storage and set initial conditions. More...
 
void TimeIntegrate (const Array< OneD, const Array< OneD, NekDouble > > &inarray, Array< OneD, Array< OneD, NekDouble > > &outarray, const NekDouble time)
 Time integrate the cell model by one PDE timestep. More...
 
void Update (const Array< OneD, const Array< OneD, NekDouble > > &inarray, Array< OneD, Array< OneD, NekDouble > > &outarray, const NekDouble time)
 Compute the derivatives of cell model variables. More...
 
void GenerateSummary (SummaryList &s)
 Print a summary of the cell model. More...
 
size_t GetNumCellVariables ()
 
std::string GetCellVarName (size_t idx)
 
Array< OneD, NekDoubleGetCellSolutionCoeffs (size_t idx)
 
Array< OneD, NekDoubleGetCellSolution (size_t idx)
 

Static Public Member Functions

static CellModelSharedPtr create (const LibUtilities::SessionReaderSharedPtr &pSession, const MultiRegions::ExpListSharedPtr &pField)
 Creates an instance of this class. More...
 

Static Public Attributes

static std::string className
 Name of class. More...
 

Protected Member Functions

virtual void v_Update (const Array< OneD, const Array< OneD, NekDouble > > &inarray, Array< OneD, Array< OneD, NekDouble > > &outarray, const NekDouble time) override
 
virtual void v_GenerateSummary (SummaryList &s) override
 
virtual void v_SetInitialConditions () override
 
- Protected Member Functions inherited from Nektar::CellModel
virtual void v_Update (const Array< OneD, const Array< OneD, NekDouble > > &inarray, Array< OneD, Array< OneD, NekDouble > > &outarray, const NekDouble time)=0
 
virtual void v_GenerateSummary (SummaryList &s)=0
 
virtual std::string v_GetCellVarName (size_t idx)
 
virtual void v_SetInitialConditions ()=0
 
void LoadCellModel ()
 

Private Attributes

NekDouble m_a
 Trigger parameter a. More...
 
NekDouble m_k
 Scaling parameter k. More...
 
NekDouble m_mu1
 Restitution parameter \(\mu_1\). More...
 
NekDouble m_mu2
 Restitution parameter \(\mu_2\). More...
 
NekDouble m_eps
 Restitution parameter \(\epsilon\). More...
 
Array< OneD, NekDoublem_uu
 Temporary space for storing \(u^2\) when computing reaction term. More...
 
Array< OneD, NekDoublem_uuu
 Temporary space for storing \(u^3\) when computing reaction term. More...
 
Array< OneD, NekDoublem_tmp1
 Workspace for computing reaction term. More...
 
Array< OneD, NekDoublem_tmp2
 Workspace for computing reaction term. More...
 

Additional Inherited Members

- Protected Attributes inherited from Nektar::CellModel
LibUtilities::SessionReaderSharedPtr m_session
 Session. More...
 
MultiRegions::ExpListSharedPtr m_field
 Transmembrane potential field from PDE system. More...
 
size_t m_nq
 Number of physical points. More...
 
size_t m_nvar
 Number of variables in cell model (inc. transmembrane voltage) More...
 
NekDouble m_lastTime
 Timestep for pde model. More...
 
size_t m_substeps
 Number of substeps to take. More...
 
Array< OneD, Array< OneD, NekDouble > > m_cellSol
 Cell model solution variables. More...
 
Array< OneD, Array< OneD, NekDouble > > m_wsp
 Cell model integration workspace. More...
 
bool m_useNodal
 Flag indicating whether nodal projection in use. More...
 
StdRegions::StdNodalTriExpSharedPtr m_nodalTri
 StdNodalTri for cell model calculations. More...
 
StdRegions::StdNodalTetExpSharedPtr m_nodalTet
 
Array< OneD, Array< OneD, NekDouble > > m_nodalTmp
 Temporary array for nodal projection. More...
 
std::vector< int > m_concentrations
 Indices of cell model variables which are concentrations. More...
 
std::vector< int > m_gates
 Indices of cell model variables which are gates. More...
 
Array< OneD, Array< OneD, NekDouble > > m_gates_tau
 Storage for gate tau values. More...
 

Detailed Description

Aliev Panfilov model.

Definition at line 43 of file AlievPanfilov.h.

Constructor & Destructor Documentation

◆ CellModelAlievPanfilov()

Nektar::CellModelAlievPanfilov::CellModelAlievPanfilov ( const LibUtilities::SessionReaderSharedPtr pSession,
const MultiRegions::ExpListSharedPtr pField 
)

Definition at line 51 of file AlievPanfilov.cpp.

54 : CellModel(pSession, pField)
55{
56 pSession->LoadParameter("k", m_k, 0.0);
57 pSession->LoadParameter("a", m_a, 0.0);
58 pSession->LoadParameter("mu1", m_mu1, 0.0);
59 pSession->LoadParameter("mu2", m_mu2, 0.0);
60 pSession->LoadParameter("eps", m_eps, 0.0);
61
62 m_uu = Array<OneD, NekDouble>(m_nq, 0.0);
63 m_uuu = Array<OneD, NekDouble>(m_nq, 0.0);
64 m_tmp1 = Array<OneD, NekDouble>(m_nq, 0.0);
65 m_tmp2 = Array<OneD, NekDouble>(m_nq, 0.0);
66
67 m_nvar = 2;
68 m_concentrations.push_back(1);
69}
Array< OneD, NekDouble > m_tmp1
Workspace for computing reaction term.
Definition: AlievPanfilov.h:92
Array< OneD, NekDouble > m_uuu
Temporary space for storing when computing reaction term.
Definition: AlievPanfilov.h:90
Array< OneD, NekDouble > m_uu
Temporary space for storing when computing reaction term.
Definition: AlievPanfilov.h:88
NekDouble m_a
Trigger parameter a.
Definition: AlievPanfilov.h:77
NekDouble m_k
Scaling parameter k.
Definition: AlievPanfilov.h:79
NekDouble m_mu1
Restitution parameter .
Definition: AlievPanfilov.h:81
Array< OneD, NekDouble > m_tmp2
Workspace for computing reaction term.
Definition: AlievPanfilov.h:94
NekDouble m_eps
Restitution parameter .
Definition: AlievPanfilov.h:85
NekDouble m_mu2
Restitution parameter .
Definition: AlievPanfilov.h:83
std::vector< int > m_concentrations
Indices of cell model variables which are concentrations.
Definition: CellModel.h:139
size_t m_nq
Number of physical points.
Definition: CellModel.h:117
size_t m_nvar
Number of variables in cell model (inc. transmembrane voltage)
Definition: CellModel.h:119
CellModel(const LibUtilities::SessionReaderSharedPtr &pSession, const MultiRegions::ExpListSharedPtr &pField)
Definition: CellModel.cpp:66

References m_a, Nektar::CellModel::m_concentrations, m_eps, m_k, m_mu1, m_mu2, Nektar::CellModel::m_nq, Nektar::CellModel::m_nvar, m_tmp1, m_tmp2, m_uu, and m_uuu.

◆ ~CellModelAlievPanfilov()

virtual Nektar::CellModelAlievPanfilov::~CellModelAlievPanfilov ( )
inlinevirtual

Definition at line 61 of file AlievPanfilov.h.

62 {
63 }

Member Function Documentation

◆ create()

static CellModelSharedPtr Nektar::CellModelAlievPanfilov::create ( const LibUtilities::SessionReaderSharedPtr pSession,
const MultiRegions::ExpListSharedPtr pField 
)
inlinestatic

Creates an instance of this class.

Definition at line 47 of file AlievPanfilov.h.

50 {
52 pSession, pField);
53 }
static std::shared_ptr< DataType > AllocateSharedPtr(const Args &...args)
Allocate a shared pointer from the memory pool.

References Nektar::MemoryManager< DataType >::AllocateSharedPtr().

◆ v_GenerateSummary()

void Nektar::CellModelAlievPanfilov::v_GenerateSummary ( SummaryList s)
overrideprotectedvirtual

Implements Nektar::CellModel.

Definition at line 187 of file AlievPanfilov.cpp.

188{
189 SolverUtils::AddSummaryItem(s, "Cell model", "Aliev-Panfilov");
195}
void AddSummaryItem(SummaryList &l, const std::string &name, const std::string &value)
Adds a summary item to the summary info list.
Definition: Misc.cpp:49

References Nektar::SolverUtils::AddSummaryItem(), m_a, m_eps, m_k, m_mu1, and m_mu2.

◆ v_SetInitialConditions()

void Nektar::CellModelAlievPanfilov::v_SetInitialConditions ( )
overrideprotectedvirtual

Implements Nektar::CellModel.

Definition at line 200 of file AlievPanfilov.cpp.

201{
202 Vmath::Fill(m_nq, 0.0, m_cellSol[0], 1);
203 Vmath::Fill(m_nq, 0.0, m_cellSol[1], 1);
204}
Array< OneD, Array< OneD, NekDouble > > m_cellSol
Cell model solution variables.
Definition: CellModel.h:126
void Fill(int n, const T alpha, T *x, const int incx)
Fill a vector with a constant value.
Definition: Vmath.cpp:43

References Vmath::Fill(), Nektar::CellModel::m_cellSol, and Nektar::CellModel::m_nq.

◆ v_Update()

void Nektar::CellModelAlievPanfilov::v_Update ( const Array< OneD, const Array< OneD, NekDouble > > &  inarray,
Array< OneD, Array< OneD, NekDouble > > &  outarray,
const NekDouble  time 
)
overrideprotectedvirtual

Implements Nektar::CellModel.

Definition at line 71 of file AlievPanfilov.cpp.

74{
75 boost::ignore_unused(time);
76
77 // inarray[0] holds initial physical u values throughout
78 // inarray[1] holds initial physical v values throughout
79
80 // compute u^2: m_u = u*u
81 Vmath::Vmul(m_nq, &inarray[0][0], 1, &inarray[0][0], 1, &m_uu[0], 1);
82
83 // compute u^3: m_u = u*u*u
84 Vmath::Vmul(m_nq, &inarray[0][0], 1, &m_uu[0], 1, &m_uuu[0], 1);
85
86 // --------------------------------------
87 // Compute reaction term f(u,v)
88 // --------------------------------------
89 // if (m_spatialParameters->Exists("a"))
90 // {
91 // Vmath::Vmul(m_nq,
92 // &m_spatialParameters->GetData("a")->GetPhys()[0], 1,
93 // &inarray[0][0], 1, &m_tmp1[0], 1);
94 //
95 // Vmath::Vvtvm(m_nq,
96 // &m_spatialParameters->GetData("a")->GetPhys()[0], 1,
97 // &m_uu[0], 1, &m_tmp1[0], 1, &m_tmp1[0], 1);
98 //
99 // Vmath::Svtvm(m_nq, -1.0, &m_uu[0], 1, &m_tmp1[0], 1, &m_tmp1[0],
100 // 1);
101 // }
102 // else
103 // {
104 // Ru = au
105 Vmath::Smul(m_nq, m_a, &inarray[0][0], 1, &m_tmp1[0], 1);
106 // Ru = (-1-a)u*u + au
107 Vmath::Svtvp(m_nq, (-1.0 - m_a), &m_uu[0], 1, &m_tmp1[0], 1, &m_tmp1[0], 1);
108 // }
109 // Ru = u*u*u - (1+a)u*u + au
110 Vmath::Vadd(m_nq, &m_uuu[0], 1, &m_tmp1[0], 1, &m_tmp1[0], 1);
111 // Ru = k(u*u*u - (1+a)u*u + au)
112 // if (m_spatialParameters->Exists("k"))
113 // {
114 // Vmath::Vmul(m_nq,
115 // &m_spatialParameters->GetData("k")->GetPhys()[0], 1,
116 // &m_tmp1[0], 1, &m_tmp1[0], 1);
117 // }
118 // else
119 // {
120 Vmath::Smul(m_nq, m_k, &m_tmp1[0], 1, &m_tmp1[0], 1);
121 // }
122
123 // Ru = k(u*u*u - (1+a)u*u + au) + I_stim
124 Vmath::Vadd(m_nq, &outarray[0][0], 1, &m_tmp1[0], 1, &outarray[0][0], 1);
125
126 // Ru = k(u*u*u - (1+a)u*u + au) + uv + I_stim
127 Vmath::Vvtvp(m_nq, &inarray[0][0], 1, &inarray[1][0], 1, &m_tmp1[0], 1,
128 &outarray[0][0], 1);
129 // Ru = -k(u*u*u - (1+a)u*u + au) - uv - I_stim
130 Vmath::Neg(m_nq, &outarray[0][0], 1);
131
132 // --------------------------------------
133 // Compute reaction term g(u,v)
134 // --------------------------------------
135 // tmp2 = mu2 + u
136 Vmath::Sadd(m_nq, m_mu2, &inarray[0][0], 1, &m_tmp2[0], 1);
137
138 // tmp2 = v/(mu2 + u)
139 Vmath::Vdiv(m_nq, &inarray[1][0], 1, &m_tmp2[0], 1, &m_tmp2[0], 1);
140
141 // tmp2 = mu1*v/(mu2 + u)
142 Vmath::Smul(m_nq, m_mu1, &m_tmp2[0], 1, &m_tmp2[0], 1);
143
144 // tmp1 = Eps + mu1*v/(mu2+u)
145 Vmath::Sadd(m_nq, m_eps, &m_tmp2[0], 1, &m_tmp2[0], 1);
146
147 // tmp1 = (-a-1) + u
148 // if (m_spatialParameters->Exists("a"))
149 // {
150 // Vmath::Vsub(m_nq, &inarray[0][0], 1,
151 // &m_spatialParameters->GetData("a")->GetPhys()[0],
152 // 1, &m_tmp1[0], 1);
153 //
154 // Vmath::Sadd(m_nq, -1.0, &inarray[0][0], 1, &m_tmp1[0], 1);
155 // }
156 // else
157 // {
158 Vmath::Sadd(m_nq, (-m_a - 1), &inarray[0][0], 1, &m_tmp1[0], 1);
159 // }
160
161 // tmp1 = k(u-a-1)
162 // if (m_spatialParameters->Exists("k"))
163 // {
164 // Vmath::Vmul(m_nq,
165 // &m_spatialParameters->GetData("k")->GetPhys()[0], 1,
166 // &m_tmp1[0], 1, &m_tmp1[0], 1);
167 // }
168 // else
169 // {
170 Vmath::Smul(m_nq, m_k, &m_tmp1[0], 1, &m_tmp1[0], 1);
171 // }
172
173 // tmp1 = ku(u-a-1) + v
174 Vmath::Vvtvp(m_nq, &inarray[0][0], 1, &m_tmp1[0], 1, &inarray[1][0], 1,
175 &m_tmp1[0], 1);
176
177 // tmp1 = -ku(u-a-1)-v
178 Vmath::Neg(m_nq, &m_tmp1[0], 1);
179
180 // outarray = [Eps + mu1*v/(mu2+u)] * [-ku(u-a-1)-v]
181 Vmath::Vmul(m_nq, &m_tmp1[0], 1, &m_tmp2[0], 1, &outarray[1][0], 1);
182}
void Vmul(int n, const T *x, const int incx, const T *y, const int incy, T *z, const int incz)
Multiply vector z = x*y.
Definition: Vmath.cpp:207
void Svtvp(int n, const T alpha, const T *x, const int incx, const T *y, const int incy, T *z, const int incz)
svtvp (scalar times vector plus vector): z = alpha*x + y
Definition: Vmath.cpp:617
void Neg(int n, T *x, const int incx)
Negate x = -x.
Definition: Vmath.cpp:513
void Vvtvp(int n, const T *w, const int incw, const T *x, const int incx, const T *y, const int incy, T *z, const int incz)
vvtvp (vector times vector plus vector): z = w*x + y
Definition: Vmath.cpp:569
void Vadd(int n, const T *x, const int incx, const T *y, const int incy, T *z, const int incz)
Add vector z = x+y.
Definition: Vmath.cpp:354
void Smul(int n, const T alpha, const T *x, const int incx, T *y, const int incy)
Scalar multiply y = alpha*x.
Definition: Vmath.cpp:245
void Vdiv(int n, const T *x, const int incx, const T *y, const int incy, T *z, const int incz)
Multiply vector z = x/y.
Definition: Vmath.cpp:280
void Sadd(int n, const T alpha, const T *x, const int incx, T *y, const int incy)
Add scalar y = alpha + x.
Definition: Vmath.cpp:379

References m_a, m_eps, m_k, m_mu1, m_mu2, Nektar::CellModel::m_nq, m_tmp1, m_tmp2, m_uu, m_uuu, Vmath::Neg(), Vmath::Sadd(), Vmath::Smul(), Vmath::Svtvp(), Vmath::Vadd(), Vmath::Vdiv(), Vmath::Vmul(), and Vmath::Vvtvp().

Member Data Documentation

◆ className

std::string Nektar::CellModelAlievPanfilov::className
static
Initial value:
=
"Phenomological model of canine cardiac electrophysiology.")
static CellModelSharedPtr create(const LibUtilities::SessionReaderSharedPtr &pSession, const MultiRegions::ExpListSharedPtr &pField)
Creates an instance of this class.
Definition: AlievPanfilov.h:47
tKey RegisterCreatorFunction(tKey idKey, CreatorFunction classCreator, std::string pDesc="")
Register a class with the factory.
Definition: NekFactory.hpp:198
CellModelFactory & GetCellModelFactory()
Definition: CellModel.cpp:46

Name of class.

Registers the class with the Factory.

Definition at line 56 of file AlievPanfilov.h.

◆ m_a

NekDouble Nektar::CellModelAlievPanfilov::m_a
private

Trigger parameter a.

Definition at line 77 of file AlievPanfilov.h.

Referenced by CellModelAlievPanfilov(), v_GenerateSummary(), and v_Update().

◆ m_eps

NekDouble Nektar::CellModelAlievPanfilov::m_eps
private

Restitution parameter \(\epsilon\).

Definition at line 85 of file AlievPanfilov.h.

Referenced by CellModelAlievPanfilov(), v_GenerateSummary(), and v_Update().

◆ m_k

NekDouble Nektar::CellModelAlievPanfilov::m_k
private

Scaling parameter k.

Definition at line 79 of file AlievPanfilov.h.

Referenced by CellModelAlievPanfilov(), v_GenerateSummary(), and v_Update().

◆ m_mu1

NekDouble Nektar::CellModelAlievPanfilov::m_mu1
private

Restitution parameter \(\mu_1\).

Definition at line 81 of file AlievPanfilov.h.

Referenced by CellModelAlievPanfilov(), v_GenerateSummary(), and v_Update().

◆ m_mu2

NekDouble Nektar::CellModelAlievPanfilov::m_mu2
private

Restitution parameter \(\mu_2\).

Definition at line 83 of file AlievPanfilov.h.

Referenced by CellModelAlievPanfilov(), v_GenerateSummary(), and v_Update().

◆ m_tmp1

Array<OneD, NekDouble> Nektar::CellModelAlievPanfilov::m_tmp1
private

Workspace for computing reaction term.

Definition at line 92 of file AlievPanfilov.h.

Referenced by CellModelAlievPanfilov(), and v_Update().

◆ m_tmp2

Array<OneD, NekDouble> Nektar::CellModelAlievPanfilov::m_tmp2
private

Workspace for computing reaction term.

Definition at line 94 of file AlievPanfilov.h.

Referenced by CellModelAlievPanfilov(), and v_Update().

◆ m_uu

Array<OneD, NekDouble> Nektar::CellModelAlievPanfilov::m_uu
private

Temporary space for storing \(u^2\) when computing reaction term.

Definition at line 88 of file AlievPanfilov.h.

Referenced by CellModelAlievPanfilov(), and v_Update().

◆ m_uuu

Array<OneD, NekDouble> Nektar::CellModelAlievPanfilov::m_uuu
private

Temporary space for storing \(u^3\) when computing reaction term.

Definition at line 90 of file AlievPanfilov.h.

Referenced by CellModelAlievPanfilov(), and v_Update().