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",
67  "PointSource",
68  "PlanarSource",
69 };
70 
71 namespace Nektar
72 {
74 {
75 public:
76  friend class MemoryManager<MMFMaxwell>;
77 
81 
82  /// Creates an instance of this class
86  {
89  p->InitObject();
90  return p;
91  }
92  /// Name of class
93  static std::string className;
94 
95  /// Initialise the object
96  virtual void v_InitObject(bool DeclareFields = true) override;
97 
98  virtual void v_DoSolve() override;
99 
100  /// Destructor
101  virtual ~MMFMaxwell();
102 
103 protected:
108 
109  int m_AddPML;
111 
113 
117 
120 
124 
126 
127  /// Session reader
129  const SpatialDomains::MeshGraphSharedPtr &pGraph);
130 
132 
136 
141 
142  int m_NoInc;
143 
145 
146  /// Compute the RHS
147  void DoOdeRhs(const Array<OneD, const Array<OneD, NekDouble>> &inarray,
148  Array<OneD, Array<OneD, NekDouble>> &outarray,
149  const NekDouble time);
150 
151  /// Compute the projection
152  void DoOdeProjection(
153  const Array<OneD, const Array<OneD, NekDouble>> &inarray,
154  Array<OneD, Array<OneD, NekDouble>> &outarray, const NekDouble time);
155 
157  const Array<OneD, const Array<OneD, NekDouble>> &physarray,
158  Array<OneD, Array<OneD, NekDouble>> &outarray);
159 
161  const Array<OneD, const Array<OneD, NekDouble>> &InField,
162  Array<OneD, Array<OneD, NekDouble>> &OutField,
163  const NekDouble time = 0.0);
164 
166 
168  unsigned int field);
170  const NekDouble time, unsigned int field,
171  const SolverUtils::PolType Polarization);
172 
174  const NekDouble time, unsigned int field,
175  const SolverUtils::PolType Polarization);
176 
178  const NekDouble omega,
179  unsigned int field);
180 
182  const int time);
183 
185  const int time,
186  const Array<OneD, const Array<OneD, NekDouble>> &fields);
187 
188  void GenerateSigmaPML(const NekDouble PMLthickness,
189  const NekDouble PMLstart, const NekDouble PMLmaxsigma,
190  Array<OneD, Array<OneD, NekDouble>> &SigmaPML);
191 
194 
196  const Array<OneD, const NekDouble> &radvec,
199  const bool Dispersion = false);
200 
202  const Array<OneD, const NekDouble> &radvec,
205 
207  const int n, const NekDouble time,
208  const Array<OneD, const Array<OneD, NekDouble>> &fieldphys);
209 
211  const int n,
212  const Array<OneD, const Array<OneD, NekDouble>> &fieldphys);
213 
215  const int n, const NekDouble time,
216  const Array<OneD, const Array<OneD, NekDouble>> &fieldphys);
217 
219  const int n, const NekDouble time,
220  const Array<OneD, const Array<OneD, NekDouble>> &fieldphys);
221 
223  const int n, const NekDouble time,
224  const Array<OneD, const Array<OneD, NekDouble>> &fieldphys);
225 
227  const NekDouble Psx,
228  const NekDouble Psy,
229  const NekDouble Psz,
230  const NekDouble Gaussianradius);
231 
232  void AddPML(const Array<OneD, const Array<OneD, NekDouble>> &physarray,
233  Array<OneD, Array<OneD, NekDouble>> &outarray);
234 
236  void AddCoriolis(Array<OneD, Array<OneD, NekDouble>> &physarray,
237  Array<OneD, Array<OneD, NekDouble>> &outarray);
238 
239  Array<OneD, NekDouble> ComputeRadCloak(const int Nlayer = 5);
240 
241  /// Print Summary
242  virtual void v_GenerateSummary(SolverUtils::SummaryList &s) override;
243 
244  virtual void v_SetInitialConditions(const NekDouble initialtime,
245  bool dumpInitialConditions,
246  const int domain) override;
247 
248  virtual void v_EvaluateExactSolution(unsigned int field,
249  Array<OneD, NekDouble> &outfield,
250  const NekDouble time) override;
251  void print_MMF(Array<OneD, Array<OneD, NekDouble>> &inarray);
252 
253 private:
254 };
255 } // namespace Nektar
256 
257 #endif
const char *const CloakTypeMap[]
Definition: MMFMaxwell.h:51
SourceType
Definition: MMFMaxwell.h:58
@ eNoSource
Definition: MMFMaxwell.h:59
@ ePointSource
Definition: MMFMaxwell.h:60
@ ePlanarSource
Definition: MMFMaxwell.h:61
@ SIZE_SourceType
Definition: MMFMaxwell.h:62
const char *const SourceTypeMap[]
Definition: MMFMaxwell.h:65
CloakType
Definition: MMFMaxwell.h:42
@ eOpticalCloak
Definition: MMFMaxwell.h:44
@ eMicroWaveCloak
Definition: MMFMaxwell.h:47
@ eOpticalDispersiveCloak
Definition: MMFMaxwell.h:46
@ eOpticalConstCloak
Definition: MMFMaxwell.h:45
@ eNoCloak
Definition: MMFMaxwell.h:43
@ SIZE_CloakType
Definition: MMFMaxwell.h:48
NekDouble m_CloakNlayer
Definition: MMFMaxwell.h:115
NekDouble m_PSduration
Definition: MMFMaxwell.h:123
CloakType m_CloakType
Definition: MMFMaxwell.h:78
Array< OneD, NekDouble > m_mu
Definition: MMFMaxwell.h:135
void ComputeMaterialVector(Array< OneD, Array< OneD, NekDouble >> &epsvec, Array< OneD, Array< OneD, NekDouble >> &muvec)
NekDouble m_PMLmaxsigma
Definition: MMFMaxwell.h:139
Array< OneD, NekDouble > TestMaxwellSphere(const NekDouble time, const NekDouble omega, unsigned int field)
Array< OneD, NekDouble > m_coriolis
Definition: MMFMaxwell.h:144
Array< OneD, Array< OneD, NekDouble > > m_CrossProductMF
Definition: MMFMaxwell.h:125
NekDouble m_Gaussianradius
Definition: MMFMaxwell.h:123
NekDouble m_PMLstart
Definition: MMFMaxwell.h:139
void Checkpoint_TotalFieldOutput(const int n, const NekDouble time, const Array< OneD, const Array< OneD, NekDouble >> &fieldphys)
void Checkpoint_EnergyOutput(const int n, const NekDouble time, const Array< OneD, const Array< OneD, NekDouble >> &fieldphys)
void Checkpoint_TotPlotOutput(const int n, const NekDouble time, const Array< OneD, const Array< OneD, NekDouble >> &fieldphys)
void GenerateSigmaPML(const NekDouble PMLthickness, const NekDouble PMLstart, const NekDouble PMLmaxsigma, Array< OneD, Array< OneD, NekDouble >> &SigmaPML)
void Checkpoint_PlotOutput(const int n, const Array< OneD, const Array< OneD, NekDouble >> &fieldphys)
Array< OneD, NekDouble > ComputeRadCloak(const int Nlayer=5)
Array< OneD, NekDouble > TestMaxwell2DPEC(const NekDouble time, unsigned int field, const SolverUtils::PolType Polarization)
void DoOdeProjection(const Array< OneD, const Array< OneD, NekDouble >> &inarray, Array< OneD, Array< OneD, NekDouble >> &outarray, const NekDouble time)
Compute the projection.
Array< OneD, NekDouble > m_SourceVector
Definition: MMFMaxwell.h:121
virtual ~MMFMaxwell()
Destructor.
Definition: MMFMaxwell.cpp:445
void AddPML(const Array< OneD, const Array< OneD, NekDouble >> &physarray, Array< OneD, Array< OneD, NekDouble >> &outarray)
NekDouble m_Cloakraddelta
Definition: MMFMaxwell.h:116
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:889
static std::string className
Name of class.
Definition: MMFMaxwell.h:93
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 .
void ComputeMaterialMicroWaveCloak(const Array< OneD, const NekDouble > &radvec, Array< OneD, Array< OneD, NekDouble >> &epsvec, Array< OneD, Array< OneD, NekDouble >> &muvec)
Array< OneD, Array< OneD, NekDouble > > m_SigmaPML
Definition: MMFMaxwell.h:140
Array< OneD, NekDouble > m_varepsilon
Definition: MMFMaxwell.h:134
void AddGreenDerivCompensate(const Array< OneD, const Array< OneD, NekDouble >> &physarray, Array< OneD, Array< OneD, NekDouble >> &outarray)
MMFMaxwell(const LibUtilities::SessionReaderSharedPtr &pSession, const SpatialDomains::MeshGraphSharedPtr &pGraph)
Session reader.
Definition: MMFMaxwell.cpp:56
void Printout_SurfaceCurrent(Array< OneD, Array< OneD, NekDouble >> &fields, const int time)
virtual void v_InitObject(bool DeclareFields=true) override
Initialise the object.
Definition: MMFMaxwell.cpp:65
SourceType m_SourceType
Definition: MMFMaxwell.h:79
static SolverUtils::EquationSystemSharedPtr create(const LibUtilities::SessionReaderSharedPtr &pSession, const SpatialDomains::MeshGraphSharedPtr &pGraph)
Creates an instance of this class.
Definition: MMFMaxwell.h:83
NekDouble m_freq
Definition: MMFMaxwell.h:131
int m_PrintoutSurfaceCurrent
Definition: MMFMaxwell.h:107
NekDouble m_PMLthickness
Definition: MMFMaxwell.h:139
Array< OneD, NekDouble > GaussianPulse(const NekDouble time, const NekDouble Psx, const NekDouble Psy, const NekDouble Psz, const NekDouble Gaussianradius)
virtual void v_EvaluateExactSolution(unsigned int field, Array< OneD, NekDouble > &outfield, const NekDouble time) override
NekDouble m_wp2Tol
Definition: MMFMaxwell.h:118
virtual void v_DoSolve() override
Solves an unsteady problem.
Definition: MMFMaxwell.cpp:449
void AddCoriolis(Array< OneD, Array< OneD, NekDouble >> &physarray, Array< OneD, Array< OneD, NekDouble >> &outarray)
void print_MMF(Array< OneD, Array< OneD, NekDouble >> &inarray)
Array< OneD, NekDouble > m_wp2
Definition: MMFMaxwell.h:119
virtual void v_GenerateSummary(SolverUtils::SummaryList &s) override
Print Summary.
void Checkpoint_EDFluxOutput(const int n, const NekDouble time, const Array< OneD, const Array< OneD, NekDouble >> &fieldphys)
virtual void v_SetInitialConditions(const NekDouble initialtime, bool dumpInitialConditions, const int domain) override
void ComputeMaterialOpticalCloak(const Array< OneD, const NekDouble > &radvec, Array< OneD, Array< OneD, NekDouble >> &epsvec, Array< OneD, Array< OneD, NekDouble >> &muvec, const bool Dispersion=false)
Array< OneD, NekDouble > TestMaxwell2DPMC(const NekDouble time, unsigned int field, const SolverUtils::PolType Polarization)
Array< OneD, NekDouble > EvaluateCoriolis()
Array< OneD, NekDouble > TestMaxwell1D(const NekDouble time, unsigned int field)
NekDouble ComputeEnergyDensity(Array< OneD, Array< OneD, NekDouble >> &fields)
Array< OneD, NekDouble > ComputeSurfaceCurrent(const int time, const Array< OneD, const Array< OneD, NekDouble >> &fields)
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
The above copyright notice and this permission notice shall be included.
Definition: CoupledSolver.h:2
double NekDouble