Nektar++
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
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:
Inheritance graph
[legend]
Collaboration diagram for Nektar::CellModelAlievPanfilov:
Collaboration graph
[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.
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.
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.
void GenerateSummary (SummaryList &s)
 Print a summary of the cell model.
unsigned int GetNumCellVariables ()
std::string GetCellVarName (unsigned int idx)
Array< OneD, NekDoubleGetCellSolutionCoeffs (unsigned int idx)
Array< OneD, NekDoubleGetCellSolution (unsigned int idx)

Static Public Member Functions

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

Static Public Attributes

static std::string className
 Name of class.

Protected Member Functions

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

Private Attributes

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

Additional Inherited Members

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

Detailed Description

Aliev Panfilov model.

Definition at line 44 of file AlievPanfilov.h.

Constructor & Destructor Documentation

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

Definition at line 53 of file AlievPanfilov.cpp.

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.

: CellModel(pSession, pField)
{
pSession->LoadParameter("k", m_k, 0.0);
pSession->LoadParameter("a", m_a, 0.0);
pSession->LoadParameter("mu1", m_mu1, 0.0);
pSession->LoadParameter("mu2", m_mu2, 0.0);
pSession->LoadParameter("eps", m_eps, 0.0);
m_uu = Array<OneD, NekDouble>(m_nq, 0.0);
m_uuu = Array<OneD, NekDouble>(m_nq, 0.0);
m_tmp1 = Array<OneD, NekDouble>(m_nq, 0.0);
m_tmp2 = Array<OneD, NekDouble>(m_nq, 0.0);
m_nvar = 2;
m_concentrations.push_back(1);
}
virtual Nektar::CellModelAlievPanfilov::~CellModelAlievPanfilov ( )
inlinevirtual

Definition at line 61 of file AlievPanfilov.h.

{}

Member Function Documentation

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

Creates an instance of this class.

Definition at line 48 of file AlievPanfilov.h.

void Nektar::CellModelAlievPanfilov::v_GenerateSummary ( SummaryList s)
protectedvirtual
void Nektar::CellModelAlievPanfilov::v_SetInitialConditions ( )
protectedvirtual

Implements Nektar::CellModel.

Definition at line 200 of file AlievPanfilov.cpp.

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

{
Vmath::Fill(m_nq, 0.0, m_cellSol[0], 1);
Vmath::Fill(m_nq, 0.0, m_cellSol[1], 1);
}
void Nektar::CellModelAlievPanfilov::v_Update ( const Array< OneD, const Array< OneD, NekDouble > > &  inarray,
Array< OneD, Array< OneD, NekDouble > > &  outarray,
const NekDouble  time 
)
protectedvirtual

Implements Nektar::CellModel.

Definition at line 74 of file AlievPanfilov.cpp.

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().

{
// inarray[0] holds initial physical u values throughout
// inarray[1] holds initial physical v values throughout
// compute u^2: m_u = u*u
Vmath::Vmul(m_nq, &inarray[0][0], 1, &inarray[0][0], 1, &m_uu[0], 1);
// compute u^3: m_u = u*u*u
Vmath::Vmul(m_nq, &inarray[0][0], 1, &m_uu[0], 1, &m_uuu[0], 1);
// --------------------------------------
// Compute reaction term f(u,v)
// --------------------------------------
// if (m_spatialParameters->Exists("a"))
// {
// Vmath::Vmul(m_nq, &m_spatialParameters->GetData("a")->GetPhys()[0], 1,
// &inarray[0][0], 1, &m_tmp1[0], 1);
//
// Vmath::Vvtvm(m_nq, &m_spatialParameters->GetData("a")->GetPhys()[0], 1,
// &m_uu[0], 1, &m_tmp1[0], 1, &m_tmp1[0], 1);
//
// Vmath::Svtvm(m_nq, -1.0, &m_uu[0], 1, &m_tmp1[0], 1, &m_tmp1[0], 1);
// }
// else
// {
// Ru = au
Vmath::Smul(m_nq, m_a, &inarray[0][0], 1, &m_tmp1[0], 1);
// Ru = (-1-a)u*u + au
Vmath::Svtvp(m_nq, (-1.0-m_a), &m_uu[0], 1, &m_tmp1[0], 1,
&m_tmp1[0], 1);
// }
// Ru = u*u*u - (1+a)u*u + au
Vmath::Vadd(m_nq, &m_uuu[0], 1, &m_tmp1[0], 1, &m_tmp1[0], 1);
// Ru = k(u*u*u - (1+a)u*u + au)
// if (m_spatialParameters->Exists("k"))
// {
// Vmath::Vmul(m_nq, &m_spatialParameters->GetData("k")->GetPhys()[0], 1,
// &m_tmp1[0], 1, &m_tmp1[0], 1);
// }
// else
// {
Vmath::Smul(m_nq, m_k, &m_tmp1[0], 1, &m_tmp1[0], 1);
// }
// Ru = k(u*u*u - (1+a)u*u + au) + I_stim
Vmath::Vadd(m_nq, &outarray[0][0], 1, &m_tmp1[0], 1, &outarray[0][0], 1);
// Ru = k(u*u*u - (1+a)u*u + au) + uv + I_stim
Vmath::Vvtvp(m_nq, &inarray[0][0], 1, &inarray[1][0], 1, &m_tmp1[0], 1,
&outarray[0][0], 1);
// Ru = -k(u*u*u - (1+a)u*u + au) - uv - I_stim
Vmath::Neg(m_nq, &outarray[0][0], 1);
// --------------------------------------
// Compute reaction term g(u,v)
// --------------------------------------
// tmp2 = mu2 + u
Vmath::Sadd(m_nq, m_mu2, &inarray[0][0], 1, &m_tmp2[0], 1);
// tmp2 = v/(mu2 + u)
Vmath::Vdiv(m_nq, &inarray[1][0], 1, &m_tmp2[0], 1, &m_tmp2[0], 1);
// tmp2 = mu1*v/(mu2 + u)
Vmath::Smul(m_nq, m_mu1, &m_tmp2[0], 1, &m_tmp2[0], 1);
// tmp1 = Eps + mu1*v/(mu2+u)
Vmath::Sadd(m_nq, m_eps, &m_tmp2[0], 1, &m_tmp2[0], 1);
// tmp1 = (-a-1) + u
// if (m_spatialParameters->Exists("a"))
// {
// Vmath::Vsub(m_nq, &inarray[0][0], 1,
// &m_spatialParameters->GetData("a")->GetPhys()[0], 1,
// &m_tmp1[0], 1);
//
// Vmath::Sadd(m_nq, -1.0, &inarray[0][0], 1, &m_tmp1[0], 1);
// }
// else
// {
Vmath::Sadd(m_nq, (-m_a-1), &inarray[0][0], 1, &m_tmp1[0], 1);
// }
// tmp1 = k(u-a-1)
// if (m_spatialParameters->Exists("k"))
// {
// Vmath::Vmul(m_nq, &m_spatialParameters->GetData("k")->GetPhys()[0], 1,
// &m_tmp1[0], 1, &m_tmp1[0], 1);
// }
// else
// {
Vmath::Smul(m_nq, m_k, &m_tmp1[0], 1, &m_tmp1[0], 1);
// }
// tmp1 = ku(u-a-1) + v
Vmath::Vvtvp(m_nq, &inarray[0][0], 1, &m_tmp1[0], 1, &inarray[1][0], 1,
&m_tmp1[0], 1);
// tmp1 = -ku(u-a-1)-v
// outarray = [Eps + mu1*v/(mu2+u)] * [-ku(u-a-1)-v]
Vmath::Vmul(m_nq, &m_tmp1[0], 1, &m_tmp2[0], 1, &outarray[1][0], 1);
}

Member Data Documentation

std::string Nektar::CellModelAlievPanfilov::className
static
Initial value:
"AlievPanfilov",
"Phenomological model of canine cardiac electrophysiology.")

Name of class.

Registers the class with the Factory.

Definition at line 55 of file AlievPanfilov.h.

NekDouble Nektar::CellModelAlievPanfilov::m_a
private

Trigger parameter a.

Definition at line 75 of file AlievPanfilov.h.

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

NekDouble Nektar::CellModelAlievPanfilov::m_eps
private

Restitution parameter $\epsilon$.

Definition at line 83 of file AlievPanfilov.h.

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

NekDouble Nektar::CellModelAlievPanfilov::m_k
private

Scaling parameter k.

Definition at line 77 of file AlievPanfilov.h.

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

NekDouble Nektar::CellModelAlievPanfilov::m_mu1
private

Restitution parameter $\mu_1$.

Definition at line 79 of file AlievPanfilov.h.

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

NekDouble Nektar::CellModelAlievPanfilov::m_mu2
private

Restitution parameter $\mu_2$.

Definition at line 81 of file AlievPanfilov.h.

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

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

Workspace for computing reaction term.

Definition at line 90 of file AlievPanfilov.h.

Referenced by CellModelAlievPanfilov(), and v_Update().

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

Workspace for computing reaction term.

Definition at line 92 of file AlievPanfilov.h.

Referenced by CellModelAlievPanfilov(), and v_Update().

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

Temporary space for storing $u^2$ when computing reaction term.

Definition at line 86 of file AlievPanfilov.h.

Referenced by CellModelAlievPanfilov(), and v_Update().

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

Temporary space for storing $u^3$ when computing reaction term.

Definition at line 88 of file AlievPanfilov.h.

Referenced by CellModelAlievPanfilov(), and v_Update().