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::CellModelFitzHughNagumo Class Reference

FitzHugh-Nagumo model. More...

#include <FitzhughNagumo.h>

Inheritance diagram for Nektar::CellModelFitzHughNagumo:
Inheritance graph
[legend]
Collaboration diagram for Nektar::CellModelFitzHughNagumo:
Collaboration graph
[legend]

Public Member Functions

 CellModelFitzHughNagumo (const LibUtilities::SessionReaderSharedPtr &pSession, const MultiRegions::ExpListSharedPtr &pField)
virtual ~CellModelFitzHughNagumo ()
- 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_beta
NekDouble m_epsilon
Array< OneD, NekDoublem_uuu
 Temporary space for storing $u^3$ when 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

FitzHugh-Nagumo model.

Definition at line 44 of file FitzhughNagumo.h.

Constructor & Destructor Documentation

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

Definition at line 53 of file FitzhughNagumo.cpp.

References m_beta, Nektar::CellModel::m_concentrations, m_epsilon, Nektar::CellModel::m_nq, Nektar::CellModel::m_nvar, and m_uuu.

: CellModel(pSession, pField)
{
pSession->LoadParameter("beta", m_beta, 0.0);
pSession->LoadParameter("epsilon", m_epsilon, 1.0);
m_uuu = Array<OneD, NekDouble>(m_nq, 0.0);
m_nvar = 2;
m_concentrations.push_back(1);
}
virtual Nektar::CellModelFitzHughNagumo::~CellModelFitzHughNagumo ( )
inlinevirtual

Definition at line 62 of file FitzhughNagumo.h.

{}

Member Function Documentation

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

Creates an instance of this class.

Definition at line 48 of file FitzhughNagumo.h.

void Nektar::CellModelFitzHughNagumo::v_GenerateSummary ( SummaryList s)
protectedvirtual

Implements Nektar::CellModel.

Definition at line 97 of file FitzhughNagumo.cpp.

References Nektar::SolverUtils::AddSummaryItem(), and m_beta.

{
SolverUtils::AddSummaryItem(s, "Cell model","FitzHugh-Nagumo");
SolverUtils::AddSummaryItem(s, "Cell model beta", m_beta);
}
void Nektar::CellModelFitzHughNagumo::v_SetInitialConditions ( )
protectedvirtual

Implements Nektar::CellModel.

Definition at line 107 of file FitzhughNagumo.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::CellModelFitzHughNagumo::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 68 of file FitzhughNagumo.cpp.

References m_beta, m_epsilon, Nektar::CellModel::m_nq, m_uuu, Vmath::Sadd(), Vmath::Smul(), Vmath::Svtvp(), Vmath::Vmul(), and Vmath::Vsub().

{
NekDouble m_gamma = 0.5;
// compute u^2: m_u = u*u
Vmath::Vmul(m_nq, &inarray[0][0], 1, &inarray[0][0], 1, &m_uuu[0], 1);
// compute u^3: m_u = u*u*u
Vmath::Vmul(m_nq, &inarray[0][0], 1, &m_uuu[0], 1, &m_uuu[0], 1);
// For u: (1/m_epsilon)*( u*-u*u*u/3 - v )
// physfield = u - (1.0/3.0)*u*u*u
Vmath::Svtvp(m_nq, (-1.0/3.0), &m_uuu[0], 1, &inarray[0][0], 1, &outarray[0][0], 1);
Vmath::Vsub(m_nq, &inarray[1][0], 1, &outarray[0][0], 1, &outarray[0][0], 1);
Vmath::Smul(m_nq, -1.0/m_epsilon, &outarray[0][0], 1, &outarray[0][0], 1);
// For v: m_epsilon*( u + m_beta - m_gamma*v )
Vmath::Svtvp(m_nq, -1.0*m_gamma, &inarray[1][0], 1, &inarray[0][0], 1, &outarray[1][0], 1);
Vmath::Sadd(m_nq, m_beta, &outarray[1][0], 1, &outarray[1][0], 1);
Vmath::Smul(m_nq, m_epsilon, &outarray[1][0], 1, &outarray[1][0], 1);
}

Member Data Documentation

std::string Nektar::CellModelFitzHughNagumo::className
static
Initial value:
"FitzHughNagumo",
"Phenomological model of squid nerve cell.")

Name of class.

Registers the class with the Factory.

Definition at line 56 of file FitzhughNagumo.h.

NekDouble Nektar::CellModelFitzHughNagumo::m_beta
private

Definition at line 75 of file FitzhughNagumo.h.

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

NekDouble Nektar::CellModelFitzHughNagumo::m_epsilon
private

Definition at line 76 of file FitzhughNagumo.h.

Referenced by CellModelFitzHughNagumo(), and v_Update().

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

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

Definition at line 79 of file FitzhughNagumo.h.

Referenced by CellModelFitzHughNagumo(), and v_Update().