Nektar++
MMFDiffusion.h
Go to the documentation of this file.
1 ///////////////////////////////////////////////////////////////////////////////
2 //
3 // File: MMFDiffusion.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: MMFDiffusion
32 //
33 ///////////////////////////////////////////////////////////////////////////////
34 
35 #ifndef NEKTAR_SOLVERS_ADRSOLVER_EQUATIONSYSTEMS_MMFDIFFUSION_H
36 #define NEKTAR_SOLVERS_ADRSOLVER_EQUATIONSYSTEMS_MMFDIFFUSION_H
37 
38 #include <SolverUtils/MMFSystem.h>
40 
41 // using namespace Nektar::SolverUtils;
42 
43 namespace Nektar
44 {
45 
47 {
55  SIZE_TestType ///< Length of enum list
56 };
57 
58 const char *const TestTypeMap[] = {
59  "TestPlane", "TestCube", "TestLinearSphere", "TestNonlinearSphere",
60  "FHNStandard", "FHNRogers", "FHNAlievPanf",
61 };
62 
64 {
71  SIZE_InitWaveType ///< Length of enum list
72 };
73 
74 const char *const InitWaveTypeMap[] = {
75  "Left", "BothEnd", "Center", "LeftBottomCorner", "Point", "SpiralDock",
76 };
77 
78 /// A model for cardiac conduction.
80 {
81 public:
82  friend class MemoryManager<MMFDiffusion>;
83 
84  /// Creates an instance of this class
88  {
91  p->InitObject();
92  return p;
93  }
94 
95  /// Name of class
96  static std::string className;
97 
99 
100  /// Desctructor
101  virtual ~MMFDiffusion();
102 
103 protected:
104  /// Constructor
106  const SpatialDomains::MeshGraphSharedPtr &pGraph);
107 
109 
110  virtual void v_InitObject(bool DeclareField = true) override;
111 
112  /// Solve for the diffusion term.
113  void DoImplicitSolve(
114  const Array<OneD, const Array<OneD, NekDouble>> &inarray,
115  Array<OneD, Array<OneD, NekDouble>> &outarray, NekDouble time,
116  NekDouble lambda);
117 
118  /// Computes the reaction terms \f$f(u,v)\f$ and \f$g(u,v)\f$.
119  void DoOdeRhs(const Array<OneD, const Array<OneD, NekDouble>> &inarray,
120  Array<OneD, Array<OneD, NekDouble>> &outarray,
121  const NekDouble time);
122 
123  void TestPlaneProblem(const NekDouble time,
124  Array<OneD, NekDouble> &outfield);
125 
126  void TestCubeProblem(const NekDouble time,
127  Array<OneD, NekDouble> &outfield);
128 
129  void Morphogenesis(const NekDouble time, unsigned int field,
130  Array<OneD, NekDouble> &outfield);
131 
133 
134  /// Sets a custom initial condition.
135  virtual void v_SetInitialConditions(NekDouble initialtime,
136  bool dumpInitialConditions,
137  const int domain) override;
138 
139  /// Prints a summary of the model parameters.
140  virtual void v_GenerateSummary(SolverUtils::SummaryList &s) override;
141 
142  virtual void v_EvaluateExactSolution(unsigned int field,
143  Array<OneD, NekDouble> &outfield,
144  const NekDouble time) override;
145 
147 
148 private:
149  /// Variable diffusivity
151 
154 };
155 
156 } // namespace Nektar
157 
158 #endif
A model for cardiac conduction.
Definition: MMFDiffusion.h:80
StdRegions::VarCoeffMap m_varcoeff
Variable diffusivity.
Definition: MMFDiffusion.h:150
virtual ~MMFDiffusion()
Desctructor.
virtual void v_GenerateSummary(SolverUtils::SummaryList &s) override
Prints a summary of the model parameters.
void Morphogenesis(const NekDouble time, unsigned int field, Array< OneD, NekDouble > &outfield)
virtual void v_InitObject(bool DeclareField=true) override
Init object for UnsteadySystem class.
InitWaveType m_InitWaveType
Definition: MMFDiffusion.h:108
MMFDiffusion(const LibUtilities::SessionReaderSharedPtr &pSession, const SpatialDomains::MeshGraphSharedPtr &pGraph)
Constructor.
Array< OneD, NekDouble > m_epsu
Definition: MMFDiffusion.h:153
void TestCubeProblem(const NekDouble time, Array< OneD, NekDouble > &outfield)
Array< OneD, NekDouble > m_epsilon
Definition: MMFDiffusion.h:152
virtual void v_SetInitialConditions(NekDouble initialtime, bool dumpInitialConditions, const int domain) override
Sets a custom initial condition.
void DoOdeRhs(const Array< OneD, const Array< OneD, NekDouble >> &inarray, Array< OneD, Array< OneD, NekDouble >> &outarray, const NekDouble time)
Computes the reaction terms and .
Array< OneD, NekDouble > PlanePhiWave()
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.
static std::string className
Name of class.
Definition: MMFDiffusion.h:96
void TestPlaneProblem(const NekDouble time, Array< OneD, NekDouble > &outfield)
virtual void v_EvaluateExactSolution(unsigned int field, Array< OneD, NekDouble > &outfield, const NekDouble time) override
static SolverUtils::EquationSystemSharedPtr create(const LibUtilities::SessionReaderSharedPtr &pSession, const SpatialDomains::MeshGraphSharedPtr &pGraph)
Creates an instance of this class.
Definition: MMFDiffusion.h:85
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 base class for PDEs which include an advection component.
Definition: MMFSystem.h:147
std::shared_ptr< SessionReader > SessionReaderSharedPtr
std::vector< std::pair< std::string, std::string > > SummaryList
Definition: Misc.h:48
std::shared_ptr< EquationSystem > EquationSystemSharedPtr
A shared pointer to an EquationSystem object.
std::shared_ptr< MeshGraph > MeshGraphSharedPtr
Definition: MeshGraph.h:172
std::map< StdRegions::VarCoeffType, VarCoeffEntry > VarCoeffMap
Definition: StdRegions.hpp:343
The above copyright notice and this permission notice shall be included.
Definition: CoupledSolver.h:2
const char *const InitWaveTypeMap[]
Definition: MMFDiffusion.h:74
@ SIZE_InitWaveType
Length of enum list.
Definition: MMFDiffusion.h:71
@ eLeftBottomCorner
Definition: MMFDiffusion.h:68
@ eBothEnds
Definition: MMFDiffusion.h:66
@ eSpiralDock
Definition: MMFDiffusion.h:70
@ eFHNStandard
Definition: MMFDiffusion.h:52
@ eTestLinearSphere
Definition: MMFDiffusion.h:50
@ eTestPlane
Definition: MMFDiffusion.h:48
@ eTestCube
Definition: MMFDiffusion.h:49
@ SIZE_TestType
Length of enum list.
Definition: MMFDiffusion.h:55
@ eTestNonlinearSphere
Definition: MMFDiffusion.h:51
@ eFHNRogers
Definition: MMFDiffusion.h:53
@ eFHNAlievPanf
Definition: MMFDiffusion.h:54
const char *const TestTypeMap[]
Definition: MMFDiffusion.h:58
double NekDouble