Nektar++
MMFMaxwell.h
Go to the documentation of this file.
1 ///////////////////////////////////////////////////////////////////////////////
2 //
3 // File MMFMaxwell.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: MMF Maxwell solve routines
32 //
33 ///////////////////////////////////////////////////////////////////////////////
34 
35 #ifndef NEKTAR_SOLVERS_ADRSOLVER_EQUATIONSYSTEMS_MMFMAXWELL_H
36 #define NEKTAR_SOLVERS_ADRSOLVER_EQUATIONSYSTEMS_MMFMAXWELL_H
37 
38 #include <SolverUtils/MMFSystem.h>
40 
42 {
49 };
50 
51 const char *const CloakTypeMap[] = {
52  "NoCloak", "OpticalCloak",
53  "OpticalConstCloak", "OpticalDispersiveCloak",
54  "MicroWaveCloak",
55 };
56 
58 {
63 };
64 
65 const char *const SourceTypeMap[] = {
66  "NoSource", "PointSource", "PlanarSource",
67 };
68 
69 namespace Nektar
70 {
72 {
73 public:
74  friend class MemoryManager<MMFMaxwell>;
75 
79 
80  /// Creates an instance of this class
84  {
87  p->InitObject();
88  return p;
89  }
90  /// Name of class
91  static std::string className;
92 
93  /// Initialise the object
94  virtual void v_InitObject();
95 
96  virtual void v_DoSolve();
97 
98  /// Destructor
99  virtual ~MMFMaxwell();
100 
101 protected:
106 
107  int m_AddPML;
109 
111 
115 
118 
122 
124 
125  /// Session reader
127  const SpatialDomains::MeshGraphSharedPtr& pGraph);
128 
130 
134 
139 
140  int m_NoInc;
141 
143 
144  /// Compute the RHS
145  void DoOdeRhs(const Array<OneD, const Array<OneD, NekDouble>> &inarray,
146  Array<OneD, Array<OneD, NekDouble>> &outarray,
147  const NekDouble time);
148 
149  /// Compute the projection
150  void DoOdeProjection(
151  const Array<OneD, const Array<OneD, NekDouble>> &inarray,
152  Array<OneD, Array<OneD, NekDouble>> &outarray, const NekDouble time);
153 
155  const Array<OneD, const Array<OneD, NekDouble>> &physarray,
156  Array<OneD, Array<OneD, NekDouble>> &outarray);
157 
159  const Array<OneD, const Array<OneD, NekDouble>> &InField,
160  Array<OneD, Array<OneD, NekDouble>> &OutField,
161  const NekDouble time = 0.0);
162 
164 
166  unsigned int field);
168  const NekDouble time, unsigned int field,
169  const SolverUtils::PolType Polarization);
170 
172  const NekDouble time, unsigned int field,
173  const SolverUtils::PolType Polarization);
174 
176  const NekDouble omega,
177  unsigned int field);
178 
180  const int time);
181 
183  const int time,
184  const Array<OneD, const Array<OneD, NekDouble>> &fields);
185 
186  void GenerateSigmaPML(const NekDouble PMLthickness,
187  const NekDouble PMLstart, const NekDouble PMLmaxsigma,
188  Array<OneD, Array<OneD, NekDouble>> &SigmaPML);
189 
192 
194  const Array<OneD, const NekDouble> &radvec,
197  const bool Dispersion = false);
198 
200  const Array<OneD, const NekDouble> &radvec,
203 
205  const int n, const NekDouble time,
206  const Array<OneD, const Array<OneD, NekDouble>> &fieldphys);
207 
209  const int n,
210  const Array<OneD, const Array<OneD, NekDouble>> &fieldphys);
211 
213  const int n, const NekDouble time,
214  const Array<OneD, const Array<OneD, NekDouble>> &fieldphys);
215 
217  const int n, const NekDouble time,
218  const Array<OneD, const Array<OneD, NekDouble>> &fieldphys);
219 
221  const int n, const NekDouble time,
222  const Array<OneD, const Array<OneD, NekDouble>> &fieldphys);
223 
225  const NekDouble Psx,
226  const NekDouble Psy,
227  const NekDouble Psz,
228  const NekDouble Gaussianradius);
229 
230  void AddPML(const Array<OneD, const Array<OneD, NekDouble>> &physarray,
231  Array<OneD, Array<OneD, NekDouble>> &outarray);
232 
234  void AddCoriolis(Array<OneD, Array<OneD, NekDouble>> &physarray,
235  Array<OneD, Array<OneD, NekDouble>> &outarray);
236 
237  Array<OneD, NekDouble> ComputeRadCloak(const int Nlayer = 5);
238 
239  /// Print Summary
241 
242  virtual void v_SetInitialConditions(const NekDouble initialtime,
243  bool dumpInitialConditions,
244  const int domain);
245 
246  virtual void v_EvaluateExactSolution(unsigned int field,
247  Array<OneD, NekDouble> &outfield,
248  const NekDouble time);
249  void print_MMF(Array<OneD, Array<OneD, NekDouble>> &inarray);
250 
251 private:
252 };
253 }
254 
255 #endif
Array< OneD, NekDouble > TestMaxwell2DPEC(const NekDouble time, unsigned int field, const SolverUtils::PolType Polarization)
Array< OneD, NekDouble > TestMaxwell2DPMC(const NekDouble time, unsigned int field, const SolverUtils::PolType Polarization)
NekDouble m_PSduration
Definition: MMFMaxwell.h:121
virtual void v_DoSolve()
Solves an unsteady problem.
Definition: MMFMaxwell.cpp:447
std::shared_ptr< MeshGraph > MeshGraphSharedPtr
Definition: MeshGraph.h:163
void DoOdeRhs(const Array< OneD, const Array< OneD, NekDouble >> &inarray, Array< OneD, Array< OneD, NekDouble >> &outarray, const NekDouble time)
Compute the RHS.
Definition: MMFMaxwell.cpp:892
virtual ~MMFMaxwell()
Destructor.
Definition: MMFMaxwell.cpp:443
Array< OneD, NekDouble > m_coriolis
Definition: MMFMaxwell.h:142
virtual void v_InitObject()
Initialise the object.
Definition: MMFMaxwell.cpp:63
CloakType m_CloakType
Definition: MMFMaxwell.h:76
int m_PrintoutSurfaceCurrent
Definition: MMFMaxwell.h:105
Array< OneD, NekDouble > TestMaxwell1D(const NekDouble time, unsigned int field)
A base class for PDEs which include an advection component.
Definition: MMFSystem.h:140
NekDouble m_PMLthickness
Definition: MMFMaxwell.h:137
General purpose memory allocation routines with the ability to allocate from thread specific memory p...
Array< OneD, NekDouble > m_wp2
Definition: MMFMaxwell.h:117
std::vector< std::pair< std::string, std::string > > SummaryList
Definition: Misc.h:46
NekDouble m_Gaussianradius
Definition: MMFMaxwell.h:121
MMFMaxwell(const LibUtilities::SessionReaderSharedPtr &pSession, const SpatialDomains::MeshGraphSharedPtr &pGraph)
Session reader.
Definition: MMFMaxwell.cpp:54
void Checkpoint_TotPlotOutput(const int n, const NekDouble time, const Array< OneD, const Array< OneD, NekDouble >> &fieldphys)
void Printout_SurfaceCurrent(Array< OneD, Array< OneD, NekDouble >> &fields, const int time)
void DoOdeProjection(const Array< OneD, const Array< OneD, NekDouble >> &inarray, Array< OneD, Array< OneD, NekDouble >> &outarray, const NekDouble time)
Compute the projection.
void ComputeMaterialMicroWaveCloak(const Array< OneD, const NekDouble > &radvec, Array< OneD, Array< OneD, NekDouble >> &epsvec, Array< OneD, Array< OneD, NekDouble >> &muvec)
Array< OneD, NekDouble > GaussianPulse(const NekDouble time, const NekDouble Psx, const NekDouble Psy, const NekDouble Psz, const NekDouble Gaussianradius)
void AddPML(const Array< OneD, const Array< OneD, NekDouble >> &physarray, Array< OneD, Array< OneD, NekDouble >> &outarray)
Array< OneD, NekDouble > m_varepsilon
Definition: MMFMaxwell.h:132
NekDouble m_Cloakraddelta
Definition: MMFMaxwell.h:114
Array< OneD, NekDouble > m_SourceVector
Definition: MMFMaxwell.h:119
Array< OneD, Array< OneD, NekDouble > > m_SigmaPML
Definition: MMFMaxwell.h:138
NekDouble m_PMLstart
Definition: MMFMaxwell.h:137
void ComputeMaterialOpticalCloak(const Array< OneD, const NekDouble > &radvec, Array< OneD, Array< OneD, NekDouble >> &epsvec, Array< OneD, Array< OneD, NekDouble >> &muvec, const bool Dispersion=false)
void Checkpoint_EnergyOutput(const int n, const NekDouble time, const Array< OneD, const Array< OneD, NekDouble >> &fieldphys)
CloakType
Definition: MMFMaxwell.h:41
static std::shared_ptr< DataType > AllocateSharedPtr(const Args &...args)
Allocate a shared pointer from the memory pool.
void Checkpoint_TotalFieldOutput(const int n, const NekDouble time, const Array< OneD, const Array< OneD, NekDouble >> &fieldphys)
void print_MMF(Array< OneD, Array< OneD, NekDouble >> &inarray)
double NekDouble
static SolverUtils::EquationSystemSharedPtr create(const LibUtilities::SessionReaderSharedPtr &pSession, const SpatialDomains::MeshGraphSharedPtr &pGraph)
Creates an instance of this class.
Definition: MMFMaxwell.h:81
NekDouble m_freq
Definition: MMFMaxwell.h:129
SourceType
Definition: MMFMaxwell.h:57
const char *const CloakTypeMap[]
Definition: MMFMaxwell.h:51
void GenerateSigmaPML(const NekDouble PMLthickness, const NekDouble PMLstart, const NekDouble PMLmaxsigma, Array< OneD, Array< OneD, NekDouble >> &SigmaPML)
void WeakDGMaxwellDirDeriv(const Array< OneD, const Array< OneD, NekDouble >> &InField, Array< OneD, Array< OneD, NekDouble >> &OutField, const NekDouble time=0.0)
Calculate weak DG advection in the form .
NekDouble m_wp2Tol
Definition: MMFMaxwell.h:116
NekDouble m_PMLmaxsigma
Definition: MMFMaxwell.h:137
void Checkpoint_EDFluxOutput(const int n, const NekDouble time, const Array< OneD, const Array< OneD, NekDouble >> &fieldphys)
SourceType m_SourceType
Definition: MMFMaxwell.h:77
virtual void v_SetInitialConditions(const NekDouble initialtime, bool dumpInitialConditions, const int domain)
static std::string className
Name of class.
Definition: MMFMaxwell.h:91
virtual void v_EvaluateExactSolution(unsigned int field, Array< OneD, NekDouble > &outfield, const NekDouble time)
void AddCoriolis(Array< OneD, Array< OneD, NekDouble >> &physarray, Array< OneD, Array< OneD, NekDouble >> &outarray)
NekDouble m_CloakNlayer
Definition: MMFMaxwell.h:113
Array< OneD, Array< OneD, NekDouble > > m_CrossProductMF
Definition: MMFMaxwell.h:123
void Checkpoint_PlotOutput(const int n, const Array< OneD, const Array< OneD, NekDouble >> &fieldphys)
virtual void v_GenerateSummary(SolverUtils::SummaryList &s)
Print Summary.
Array< OneD, NekDouble > ComputeRadCloak(const int Nlayer=5)
NekDouble ComputeEnergyDensity(Array< OneD, Array< OneD, NekDouble >> &fields)
Array< OneD, NekDouble > EvaluateCoriolis()
const char *const SourceTypeMap[]
Definition: MMFMaxwell.h:65
void ComputeMaterialVector(Array< OneD, Array< OneD, NekDouble >> &epsvec, Array< OneD, Array< OneD, NekDouble >> &muvec)
std::shared_ptr< SessionReader > SessionReaderSharedPtr
Array< OneD, NekDouble > TestMaxwellSphere(const NekDouble time, const NekDouble omega, unsigned int field)
std::shared_ptr< EquationSystem > EquationSystemSharedPtr
A shared pointer to an EquationSystem object.
Array< OneD, NekDouble > ComputeSurfaceCurrent(const int time, const Array< OneD, const Array< OneD, NekDouble >> &fields)
void AddGreenDerivCompensate(const Array< OneD, const Array< OneD, NekDouble >> &physarray, Array< OneD, Array< OneD, NekDouble >> &outarray)
Array< OneD, NekDouble > m_mu
Definition: MMFMaxwell.h:133