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 
39 #include <SolverUtils/MMFSystem.h>
40 
41 //using namespace Nektar::SolverUtils;
42 
43 namespace Nektar
44 {
45 
46  enum TestType
47  {
55  SIZE_TestType ///< Length of enum list
56  };
57 
58  const char* const TestTypeMap[] =
59  {
60  "TestPlane",
61  "TestCube",
62  "TestLinearSphere",
63  "TestNonlinearSphere",
64  "FHNStandard",
65  "FHNRogers",
66  "FHNAlievPanf",
67  };
68 
70  {
77  SIZE_InitWaveType ///< Length of enum list
78  };
79 
80  const char* const InitWaveTypeMap[] =
81  {
82  "Left",
83  "BothEnd",
84  "Center",
85  "LeftBottomCorner",
86  "Point",
87  "SpiralDock",
88  };
89 
90  /// A model for cardiac conduction.
92  {
93  public:
94  friend class MemoryManager<MMFDiffusion>;
95 
96  /// Creates an instance of this class
100  {
102  p->InitObject();
103  return p;
104  }
105 
106  /// Name of class
107  static std::string className;
108 
110 
111  /// Desctructor
112  virtual ~MMFDiffusion();
113 
114  protected:
115  /// Constructor
117  const SpatialDomains::MeshGraphSharedPtr& pGraph);
118 
120 
121 
122  virtual void v_InitObject();
123 
124  /// Solve for the diffusion term.
125  void DoImplicitSolve(
126  const Array<OneD, const Array<OneD, NekDouble> >&inarray,
127  Array<OneD, Array<OneD, NekDouble> >&outarray,
128  NekDouble time,
129  NekDouble lambda);
130 
131  /// Computes the reaction terms \f$f(u,v)\f$ and \f$g(u,v)\f$.
132  void DoOdeRhs(
133  const Array<OneD, const Array<OneD, NekDouble> >&inarray,
134  Array<OneD, Array<OneD, NekDouble> >&outarray,
135  const NekDouble time);
136 
137  void TestPlaneProblem(const NekDouble time,
138  Array<OneD, NekDouble> &outfield);
139 
140  void TestCubeProblem(const NekDouble time,
141  Array<OneD, NekDouble> &outfield);
142 
143  void Morphogenesis(const NekDouble time,
144  unsigned int field,
145  Array<OneD, NekDouble> &outfield);
146 
148 
149  /// Sets a custom initial condition.
150  virtual void v_SetInitialConditions(NekDouble initialtime,
151  bool dumpInitialConditions,
152  const int domain);
153 
154  /// Prints a summary of the model parameters.
156 
157 
158  virtual void v_EvaluateExactSolution(unsigned int field,
159  Array<OneD, NekDouble> &outfield,
160  const NekDouble time);
161 
163 
164  private:
165  /// Variable diffusivity
167 
170  };
171 
172 }
173 
174 #endif
A model for cardiac conduction.
Definition: MMFDiffusion.h:92
StdRegions::VarCoeffMap m_varcoeff
Variable diffusivity.
Definition: MMFDiffusion.h:166
virtual ~MMFDiffusion()
Desctructor.
void Morphogenesis(const NekDouble time, unsigned int field, Array< OneD, NekDouble > &outfield)
InitWaveType m_InitWaveType
Definition: MMFDiffusion.h:119
MMFDiffusion(const LibUtilities::SessionReaderSharedPtr &pSession, const SpatialDomains::MeshGraphSharedPtr &pGraph)
Constructor.
Array< OneD, NekDouble > m_epsu
Definition: MMFDiffusion.h:169
void TestCubeProblem(const NekDouble time, Array< OneD, NekDouble > &outfield)
virtual void v_InitObject()
Init object for UnsteadySystem class.
Array< OneD, NekDouble > m_epsilon
Definition: MMFDiffusion.h:168
void DoOdeRhs(const Array< OneD, const Array< OneD, NekDouble > > &inarray, Array< OneD, Array< OneD, NekDouble > > &outarray, const NekDouble time)
Computes the reaction terms and .
virtual void v_GenerateSummary(SolverUtils::SummaryList &s)
Prints a summary of the model parameters.
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:107
void TestPlaneProblem(const NekDouble time, Array< OneD, NekDouble > &outfield)
virtual void v_EvaluateExactSolution(unsigned int field, Array< OneD, NekDouble > &outfield, const NekDouble time)
virtual void v_SetInitialConditions(NekDouble initialtime, bool dumpInitialConditions, const int domain)
Sets a custom initial condition.
static SolverUtils::EquationSystemSharedPtr create(const LibUtilities::SessionReaderSharedPtr &pSession, const SpatialDomains::MeshGraphSharedPtr &pGraph)
Creates an instance of this class.
Definition: MMFDiffusion.h:97
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:141
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, Array< OneD, NekDouble > > VarCoeffMap
Definition: StdRegions.hpp:272
The above copyright notice and this permission notice shall be included.
Definition: CoupledSolver.h:1
const char *const InitWaveTypeMap[]
Definition: MMFDiffusion.h:80
@ SIZE_InitWaveType
Length of enum list.
Definition: MMFDiffusion.h:77
@ eLeftBottomCorner
Definition: MMFDiffusion.h:74
@ eBothEnds
Definition: MMFDiffusion.h:72
@ eSpiralDock
Definition: MMFDiffusion.h:76
@ 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