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
40
42{
49};
50
51const char *const CloakTypeMap[] = {
52 "NoCloak", "OpticalCloak",
53 "OpticalConstCloak", "OpticalDispersiveCloak",
54 "MicroWaveCloak",
55};
56
58{
63};
64
65const char *const SourceTypeMap[] = {
66 "NoSource",
67 "PointSource",
68 "PlanarSource",
69};
70
71namespace Nektar
72{
74{
75public:
76 friend class MemoryManager<MMFMaxwell>;
77
78 /// Creates an instance of this class
82 {
85 p->InitObject();
86 return p;
87 }
88
89 /// Name of class
90 static std::string className;
91
92protected:
96
101
104
106
110
113
117
119
121
125
130
132
134
137
138 ~MMFMaxwell() override = default;
139
140 /// Initialise the object
141 void v_InitObject(bool DeclareFields = true) override;
142
143 void v_DoSolve() override;
144
145 /// Compute the RHS
146 void DoOdeRhs(const Array<OneD, const Array<OneD, NekDouble>> &inarray,
148 const NekDouble time);
149
150 /// Compute the projection
151 void DoOdeProjection(
152 const Array<OneD, const Array<OneD, NekDouble>> &inarray,
153 Array<OneD, Array<OneD, NekDouble>> &outarray, const NekDouble time);
154
156 const Array<OneD, const Array<OneD, NekDouble>> &physarray,
157 Array<OneD, Array<OneD, NekDouble>> &outarray);
158
160 const Array<OneD, const Array<OneD, NekDouble>> &InField,
162 const NekDouble time = 0.0);
163
165
167 unsigned int field);
169 const NekDouble time, unsigned int field,
170 const SolverUtils::PolType Polarization);
171
173 const NekDouble time, unsigned int field,
174 const SolverUtils::PolType Polarization);
175
177 const NekDouble omega,
178 unsigned int field);
179
181 const int time);
182
184 const int time,
185 const Array<OneD, const Array<OneD, NekDouble>> &fields);
186
187 void GenerateSigmaPML(const NekDouble PMLthickness,
188 const NekDouble PMLstart, const NekDouble PMLmaxsigma,
189 Array<OneD, Array<OneD, NekDouble>> &SigmaPML);
190
193
195 const Array<OneD, const NekDouble> &radvec,
198 const bool Dispersion = false);
199
201 const Array<OneD, const NekDouble> &radvec,
204
206 const int n, const NekDouble time,
207 const Array<OneD, const Array<OneD, NekDouble>> &fieldphys);
208
210 const int n,
211 const Array<OneD, const Array<OneD, NekDouble>> &fieldphys);
212
214 const int n, const NekDouble time,
215 const Array<OneD, const Array<OneD, NekDouble>> &fieldphys);
216
218 const int n, const NekDouble time,
219 const Array<OneD, const Array<OneD, NekDouble>> &fieldphys);
220
222 const int n, const NekDouble time,
223 const Array<OneD, const Array<OneD, NekDouble>> &fieldphys);
224
226 const NekDouble Psx,
227 const NekDouble Psy,
228 const NekDouble Psz,
229 const NekDouble Gaussianradius);
230
231 void AddPML(const Array<OneD, const Array<OneD, NekDouble>> &physarray,
232 Array<OneD, Array<OneD, NekDouble>> &outarray);
233
236 Array<OneD, Array<OneD, NekDouble>> &outarray);
237
238 Array<OneD, NekDouble> ComputeRadCloak(const int Nlayer = 5);
239
240 /// Print Summary
242
243 void v_SetInitialConditions(const NekDouble initialtime,
244 bool dumpInitialConditions,
245 const int domain) override;
246
247 void v_EvaluateExactSolution(unsigned int field,
248 Array<OneD, NekDouble> &outfield,
249 const NekDouble time) override;
251
252private:
253};
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
void Checkpoint_EDFluxOutput(const int n, const NekDouble time, const Array< OneD, const Array< OneD, NekDouble > > &fieldphys)
NekDouble m_CloakNlayer
Definition: MMFMaxwell.h:108
NekDouble m_PSduration
Definition: MMFMaxwell.h:116
CloakType m_CloakType
Definition: MMFMaxwell.h:93
Array< OneD, NekDouble > m_mu
Definition: MMFMaxwell.h:124
NekDouble m_PMLmaxsigma
Definition: MMFMaxwell.h:128
void AddCoriolis(Array< OneD, Array< OneD, NekDouble > > &physarray, Array< OneD, Array< OneD, NekDouble > > &outarray)
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:883
Array< OneD, NekDouble > TestMaxwellSphere(const NekDouble time, const NekDouble omega, unsigned int field)
Array< OneD, NekDouble > m_coriolis
Definition: MMFMaxwell.h:133
Array< OneD, Array< OneD, NekDouble > > m_CrossProductMF
Definition: MMFMaxwell.h:118
NekDouble m_Gaussianradius
Definition: MMFMaxwell.h:116
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_PMLstart
Definition: MMFMaxwell.h:128
Array< OneD, NekDouble > ComputeRadCloak(const int Nlayer=5)
void print_MMF(Array< OneD, Array< OneD, NekDouble > > &inarray)
Array< OneD, NekDouble > TestMaxwell2DPEC(const NekDouble time, unsigned int field, const SolverUtils::PolType Polarization)
Array< OneD, NekDouble > m_SourceVector
Definition: MMFMaxwell.h:114
NekDouble ComputeEnergyDensity(Array< OneD, Array< OneD, NekDouble > > &fields)
NekDouble m_Cloakraddelta
Definition: MMFMaxwell.h:109
~MMFMaxwell() override=default
static std::string className
Name of class.
Definition: MMFMaxwell.h:90
void Checkpoint_EnergyOutput(const int n, const NekDouble time, const Array< OneD, const Array< OneD, NekDouble > > &fieldphys)
void Checkpoint_TotalFieldOutput(const int n, const NekDouble time, const Array< OneD, const Array< OneD, NekDouble > > &fieldphys)
void ComputeMaterialMicroWaveCloak(const Array< OneD, const NekDouble > &radvec, Array< OneD, Array< OneD, NekDouble > > &epsvec, Array< OneD, Array< OneD, NekDouble > > &muvec)
Array< OneD, NekDouble > ComputeSurfaceCurrent(const int time, const Array< OneD, const Array< OneD, NekDouble > > &fields)
Array< OneD, Array< OneD, NekDouble > > m_SigmaPML
Definition: MMFMaxwell.h:129
void Checkpoint_TotPlotOutput(const int n, const NekDouble time, const Array< OneD, const Array< OneD, NekDouble > > &fieldphys)
Array< OneD, NekDouble > m_varepsilon
Definition: MMFMaxwell.h:123
MMFMaxwell(const LibUtilities::SessionReaderSharedPtr &pSession, const SpatialDomains::MeshGraphSharedPtr &pGraph)
Definition: MMFMaxwell.cpp:56
void DoOdeProjection(const Array< OneD, const Array< OneD, NekDouble > > &inarray, Array< OneD, Array< OneD, NekDouble > > &outarray, const NekDouble time)
Compute the projection.
void v_InitObject(bool DeclareFields=true) override
Initialise the object.
Definition: MMFMaxwell.cpp:65
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 AddGreenDerivCompensate(const Array< OneD, const Array< OneD, NekDouble > > &physarray, Array< OneD, Array< OneD, NekDouble > > &outarray)
SourceType m_SourceType
Definition: MMFMaxwell.h:94
void ComputeMaterialVector(Array< OneD, Array< OneD, NekDouble > > &epsvec, Array< OneD, Array< OneD, NekDouble > > &muvec)
static SolverUtils::EquationSystemSharedPtr create(const LibUtilities::SessionReaderSharedPtr &pSession, const SpatialDomains::MeshGraphSharedPtr &pGraph)
Creates an instance of this class.
Definition: MMFMaxwell.h:79
NekDouble m_freq
Definition: MMFMaxwell.h:120
int m_PrintoutSurfaceCurrent
Definition: MMFMaxwell.h:100
void GenerateSigmaPML(const NekDouble PMLthickness, const NekDouble PMLstart, const NekDouble PMLmaxsigma, Array< OneD, Array< OneD, NekDouble > > &SigmaPML)
NekDouble m_PMLthickness
Definition: MMFMaxwell.h:128
Array< OneD, NekDouble > GaussianPulse(const NekDouble time, const NekDouble Psx, const NekDouble Psy, const NekDouble Psz, const NekDouble Gaussianradius)
void Printout_SurfaceCurrent(Array< OneD, Array< OneD, NekDouble > > &fields, const int time)
void v_EvaluateExactSolution(unsigned int field, Array< OneD, NekDouble > &outfield, const NekDouble time) override
NekDouble m_wp2Tol
Definition: MMFMaxwell.h:111
void v_DoSolve() override
Solves an unsteady problem.
Definition: MMFMaxwell.cpp:443
Array< OneD, NekDouble > m_wp2
Definition: MMFMaxwell.h:112
void v_GenerateSummary(SolverUtils::SummaryList &s) override
Print Summary.
void AddPML(const Array< OneD, const Array< OneD, NekDouble > > &physarray, Array< OneD, Array< OneD, NekDouble > > &outarray)
void v_SetInitialConditions(const NekDouble initialtime, bool dumpInitialConditions, const int domain) override
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)
void Checkpoint_PlotOutput(const int n, const Array< OneD, const Array< OneD, NekDouble > > &fieldphys)
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:144
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
double NekDouble