Nektar++
Monodomain.h
Go to the documentation of this file.
1///////////////////////////////////////////////////////////////////////////////
2//
3// File: Monodomain.h
4//
5// For more information, please see: http://www.nektar.info
6//
7// The MIT License
8//
9// Copyright (c) 2006 Division of Applied Mathematics, Brown University (USA),
10// Department of Aeronautics, Imperial College London (UK), and Scientific
11// Computing and Imaging Institute, University of Utah (USA).
12//
13// Permission is hereby granted, free of charge, to any person obtaining a
14// copy of this software and associated documentation files (the "Software"),
15// to deal in the Software without restriction, including without limitation
16// the rights to use, copy, modify, merge, publish, distribute, sublicense,
17// and/or sell copies of the Software, and to permit persons to whom the
18// Software is furnished to do so, subject to the following conditions:
19//
20// The above copyright notice and this permission notice shall be included
21// in all copies or substantial portions of the Software.
22//
23// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
24// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
25// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
26// THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
27// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
28// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
29// DEALINGS IN THE SOFTWARE.
30//
31// Description: Monodomain cardiac electrophysiology homogenised model.
32//
33///////////////////////////////////////////////////////////////////////////////
34
35#ifndef NEKTAR_SOLVERS_ADRSOLVER_EQUATIONSYSTEMS_MONODOMAIN_H
36#define NEKTAR_SOLVERS_ADRSOLVER_EQUATIONSYSTEMS_MONODOMAIN_H
37
41
42using namespace Nektar::SolverUtils;
43
44namespace Nektar
45{
46
47/// A model for cardiac conduction.
49{
50public:
51 friend class MemoryManager<Monodomain>;
52
53 /// Creates an instance of this class
57 {
60 p->InitObject();
61 return p;
62 }
63
64 /// Name of class
65 static std::string className;
66
67 /// Desctructor
68 ~Monodomain() override;
69
70protected:
71 /// Constructor
74
75 void v_InitObject(bool DeclareField = true) override;
76
77 /// Solve for the diffusion term.
78 void DoImplicitSolve(
79 const Array<OneD, const Array<OneD, NekDouble>> &inarray,
81 NekDouble lambda);
82
83 /// Computes the reaction terms \f$f(u,v)\f$ and \f$g(u,v)\f$.
84 void DoOdeRhs(const Array<OneD, const Array<OneD, NekDouble>> &inarray,
86 const NekDouble time);
87
88 /// Sets a custom initial condition.
89 void v_SetInitialConditions(NekDouble initialtime,
90 bool dumpInitialConditions,
91 const int domain) override;
92
93 /// Prints a summary of the model parameters.
94 void v_GenerateSummary(SummaryList &s) override;
95
96private:
97 /// Cell model.
99
100 std::vector<StimulusSharedPtr> m_stimulus;
101
102 /// Variable diffusivity
104
107
108 /// Stimulus current
110
112};
113
114} // namespace Nektar
115
116#endif
General purpose memory allocation routines with the ability to allocate from thread specific memory p...
static std::shared_ptr< DataType > AllocateSharedPtr(const Args &...args)
Allocate a shared pointer from the memory pool.
A model for cardiac conduction.
Definition: Monodomain.h:49
void DoImplicitSolve(const Array< OneD, const Array< OneD, NekDouble > > &inarray, Array< OneD, Array< OneD, NekDouble > > &outarray, NekDouble time, NekDouble lambda)
Solve for the diffusion term.
Definition: Monodomain.cpp:312
void v_SetInitialConditions(NekDouble initialtime, bool dumpInitialConditions, const int domain) override
Sets a custom initial condition.
Definition: Monodomain.cpp:367
void DoOdeRhs(const Array< OneD, const Array< OneD, NekDouble > > &inarray, Array< OneD, Array< OneD, NekDouble > > &outarray, const NekDouble time)
Computes the reaction terms and .
Definition: Monodomain.cpp:350
NekDouble m_stimDuration
Stimulus current.
Definition: Monodomain.h:109
Monodomain(const LibUtilities::SessionReaderSharedPtr &pSession, const SpatialDomains::MeshGraphSharedPtr &pGraph)
Constructor.
Definition: Monodomain.cpp:70
~Monodomain() override
Desctructor.
Definition: Monodomain.cpp:302
CellModelSharedPtr m_cell
Cell model.
Definition: Monodomain.h:98
StdRegions::VarCoeffMap m_vardiff
Variable diffusivity.
Definition: Monodomain.h:103
static EquationSystemSharedPtr create(const LibUtilities::SessionReaderSharedPtr &pSession, const SpatialDomains::MeshGraphSharedPtr &pGraph)
Creates an instance of this class.
Definition: Monodomain.h:54
NekDouble m_capMembrane
Definition: Monodomain.h:106
void v_InitObject(bool DeclareField=true) override
Init object for UnsteadySystem class.
Definition: Monodomain.cpp:79
std::vector< StimulusSharedPtr > m_stimulus
Definition: Monodomain.h:100
static std::string className
Name of class.
Definition: Monodomain.h:65
void v_GenerateSummary(SummaryList &s) override
Prints a summary of the model parameters.
Definition: Monodomain.cpp:379
Base class for unsteady solvers.
std::shared_ptr< SessionReader > SessionReaderSharedPtr
std::vector< std::pair< std::string, std::string > > SummaryList
Definition: Misc.h:46
std::shared_ptr< EquationSystem > EquationSystemSharedPtr
A shared pointer to an EquationSystem object.
std::shared_ptr< MeshGraph > MeshGraphSharedPtr
Definition: MeshGraph.h:174
std::map< StdRegions::VarCoeffType, VarCoeffEntry > VarCoeffMap
Definition: StdRegions.hpp:346
std::shared_ptr< CellModel > CellModelSharedPtr
A shared pointer to an EquationSystem object.
Definition: CellModel.h:55
double NekDouble