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
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 void v_InitObject(bool DeclareFields = true) override;
97
98 void v_DoSolve() override;
99
100 /// Destructor
101 ~MMFMaxwell() override;
102
103protected:
108
111
113
117
120
124
126
127 /// Session reader
130
132
136
141
143
145
146 /// Compute the RHS
147 void DoOdeRhs(const Array<OneD, const Array<OneD, NekDouble>> &inarray,
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,
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
237 Array<OneD, Array<OneD, NekDouble>> &outarray);
238
239 Array<OneD, NekDouble> ComputeRadCloak(const int Nlayer = 5);
240
241 /// Print Summary
243
244 void v_SetInitialConditions(const NekDouble initialtime,
245 bool dumpInitialConditions,
246 const int domain) override;
247
248 void v_EvaluateExactSolution(unsigned int field,
249 Array<OneD, NekDouble> &outfield,
250 const NekDouble time) override;
252
253private:
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:115
NekDouble m_PSduration
Definition: MMFMaxwell.h:123
CloakType m_CloakType
Definition: MMFMaxwell.h:78
Array< OneD, NekDouble > m_mu
Definition: MMFMaxwell.h:135
NekDouble m_PMLmaxsigma
Definition: MMFMaxwell.h:139
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:888
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
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:139
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:121
NekDouble ComputeEnergyDensity(Array< OneD, Array< OneD, NekDouble > > &fields)
NekDouble m_Cloakraddelta
Definition: MMFMaxwell.h:116
static std::string className
Name of class.
Definition: MMFMaxwell.h:93
void Checkpoint_EnergyOutput(const int n, const NekDouble time, const Array< OneD, const Array< OneD, NekDouble > > &fieldphys)
~MMFMaxwell() override
Destructor.
Definition: MMFMaxwell.cpp:444
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:140
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:134
MMFMaxwell(const LibUtilities::SessionReaderSharedPtr &pSession, const SpatialDomains::MeshGraphSharedPtr &pGraph)
Session reader.
Definition: MMFMaxwell.cpp:55
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:64
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:79
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:83
NekDouble m_freq
Definition: MMFMaxwell.h:131
int m_PrintoutSurfaceCurrent
Definition: MMFMaxwell.h:107
void GenerateSigmaPML(const NekDouble PMLthickness, const NekDouble PMLstart, const NekDouble PMLmaxsigma, Array< OneD, Array< OneD, NekDouble > > &SigmaPML)
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)
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:118
void v_DoSolve() override
Solves an unsteady problem.
Definition: MMFMaxwell.cpp:448
Array< OneD, NekDouble > m_wp2
Definition: MMFMaxwell.h:119
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