Nektar++
Public Member Functions | Static Public Member Functions | Public Attributes | Static Public Attributes | Protected Member Functions | Protected Attributes | Friends | List of all members
Nektar::MMFMaxwell Class Reference

#include <MMFMaxwell.h>

Inheritance diagram for Nektar::MMFMaxwell:
[legend]

Public Member Functions

virtual void v_InitObject ()
 Initialise the object. More...
 
virtual void v_DoSolve ()
 Solves an unsteady problem. More...
 
virtual ~MMFMaxwell ()
 Destructor. More...
 
- Public Member Functions inherited from Nektar::SolverUtils::MMFSystem
SOLVER_UTILS_EXPORT MMFSystem (const LibUtilities::SessionReaderSharedPtr &pSession, const SpatialDomains::MeshGraphSharedPtr &pGraph)
 
virtual SOLVER_UTILS_EXPORT ~MMFSystem ()
 
SOLVER_UTILS_EXPORT void MMFInitObject (const Array< OneD, const Array< OneD, NekDouble >> &Anisotropy, const int TangentXelem=-1)
 
SOLVER_UTILS_EXPORT void CopyBoundaryTrace (const Array< OneD, const NekDouble > &Fwd, Array< OneD, NekDouble > &Bwd, const BoundaryCopyType BDCopyType, const int var=0, const std::string btype="NoUserDefined")
 
- Public Member Functions inherited from Nektar::SolverUtils::UnsteadySystem
virtual SOLVER_UTILS_EXPORT ~UnsteadySystem ()
 Destructor. More...
 
SOLVER_UTILS_EXPORT NekDouble GetTimeStep (const Array< OneD, const Array< OneD, NekDouble >> &inarray)
 Calculate the larger time-step mantaining the problem stable. More...
 
- Public Member Functions inherited from Nektar::SolverUtils::EquationSystem
virtual SOLVER_UTILS_EXPORT ~EquationSystem ()
 Destructor. More...
 
SOLVER_UTILS_EXPORT void SetUpTraceNormals (void)
 
SOLVER_UTILS_EXPORT void InitObject ()
 Initialises the members of this object. More...
 
SOLVER_UTILS_EXPORT void DoInitialise ()
 Perform any initialisation necessary before solving the problem. More...
 
SOLVER_UTILS_EXPORT void DoSolve ()
 Solve the problem. More...
 
SOLVER_UTILS_EXPORT void TransCoeffToPhys ()
 Transform from coefficient to physical space. More...
 
SOLVER_UTILS_EXPORT void TransPhysToCoeff ()
 Transform from physical to coefficient space. More...
 
SOLVER_UTILS_EXPORT void Output ()
 Perform output operations after solve. More...
 
SOLVER_UTILS_EXPORT NekDouble LinfError (unsigned int field, const Array< OneD, NekDouble > &exactsoln=NullNekDouble1DArray)
 Linf error computation. More...
 
SOLVER_UTILS_EXPORT std::string GetSessionName ()
 Get Session name. More...
 
template<class T >
std::shared_ptr< T > as ()
 
SOLVER_UTILS_EXPORT void ResetSessionName (std::string newname)
 Reset Session name. More...
 
SOLVER_UTILS_EXPORT LibUtilities::SessionReaderSharedPtr GetSession ()
 Get Session name. More...
 
SOLVER_UTILS_EXPORT MultiRegions::ExpListSharedPtr GetPressure ()
 Get pressure field if available. More...
 
SOLVER_UTILS_EXPORT void ExtraFldOutput (std::vector< Array< OneD, NekDouble > > &fieldcoeffs, std::vector< std::string > &variables)
 
SOLVER_UTILS_EXPORT void PrintSummary (std::ostream &out)
 Print a summary of parameters and solver characteristics. More...
 
SOLVER_UTILS_EXPORT void SetLambda (NekDouble lambda)
 Set parameter m_lambda. More...
 
SOLVER_UTILS_EXPORT SessionFunctionSharedPtr GetFunction (std::string name, const MultiRegions::ExpListSharedPtr &field=MultiRegions::NullExpListSharedPtr, bool cache=false)
 Get a SessionFunction by name. More...
 
SOLVER_UTILS_EXPORT void SetInitialConditions (NekDouble initialtime=0.0, bool dumpInitialConditions=true, const int domain=0)
 Initialise the data in the dependent fields. More...
 
SOLVER_UTILS_EXPORT void EvaluateExactSolution (int field, Array< OneD, NekDouble > &outfield, const NekDouble time)
 Evaluates an exact solution. More...
 
SOLVER_UTILS_EXPORT NekDouble L2Error (unsigned int field, const Array< OneD, NekDouble > &exactsoln, bool Normalised=false)
 Compute the L2 error between fields and a given exact solution. More...
 
SOLVER_UTILS_EXPORT NekDouble L2Error (unsigned int field, bool Normalised=false)
 Compute the L2 error of the fields. More...
 
SOLVER_UTILS_EXPORT Array< OneD, NekDoubleErrorExtraPoints (unsigned int field)
 Compute error (L2 and L_inf) over an larger set of quadrature points return [L2 Linf]. More...
 
SOLVER_UTILS_EXPORT void Checkpoint_Output (const int n)
 Write checkpoint file of m_fields. More...
 
SOLVER_UTILS_EXPORT void Checkpoint_Output (const int n, MultiRegions::ExpListSharedPtr &field, std::vector< Array< OneD, NekDouble > > &fieldcoeffs, std::vector< std::string > &variables)
 Write checkpoint file of custom data fields. More...
 
SOLVER_UTILS_EXPORT void Checkpoint_BaseFlow (const int n)
 Write base flow file of m_fields. More...
 
SOLVER_UTILS_EXPORT void WriteFld (const std::string &outname)
 Write field data to the given filename. More...
 
SOLVER_UTILS_EXPORT void WriteFld (const std::string &outname, MultiRegions::ExpListSharedPtr &field, std::vector< Array< OneD, NekDouble > > &fieldcoeffs, std::vector< std::string > &variables)
 Write input fields to the given filename. More...
 
SOLVER_UTILS_EXPORT void ImportFld (const std::string &infile, Array< OneD, MultiRegions::ExpListSharedPtr > &pFields)
 Input field data from the given file. More...
 
SOLVER_UTILS_EXPORT void ImportFldToMultiDomains (const std::string &infile, Array< OneD, MultiRegions::ExpListSharedPtr > &pFields, const int ndomains)
 Input field data from the given file to multiple domains. More...
 
SOLVER_UTILS_EXPORT void ImportFld (const std::string &infile, std::vector< std::string > &fieldStr, Array< OneD, Array< OneD, NekDouble > > &coeffs)
 Output a field. Input field data into array from the given file. More...
 
SOLVER_UTILS_EXPORT void ImportFld (const std::string &infile, MultiRegions::ExpListSharedPtr &pField, std::string &pFieldName)
 Output a field. Input field data into ExpList from the given file. More...
 
SOLVER_UTILS_EXPORT void SessionSummary (SummaryList &vSummary)
 Write out a session summary. More...
 
SOLVER_UTILS_EXPORT Array< OneD, MultiRegions::ExpListSharedPtr > & UpdateFields ()
 
SOLVER_UTILS_EXPORT LibUtilities::FieldMetaDataMapUpdateFieldMetaDataMap ()
 Get hold of FieldInfoMap so it can be updated. More...
 
SOLVER_UTILS_EXPORT NekDouble GetFinalTime ()
 Return final time. More...
 
SOLVER_UTILS_EXPORT int GetNcoeffs ()
 
SOLVER_UTILS_EXPORT int GetNcoeffs (const int eid)
 
SOLVER_UTILS_EXPORT int GetNumExpModes ()
 
SOLVER_UTILS_EXPORT const Array< OneD, int > GetNumExpModesPerExp ()
 
SOLVER_UTILS_EXPORT int GetNvariables ()
 
SOLVER_UTILS_EXPORT const std::string GetVariable (unsigned int i)
 
SOLVER_UTILS_EXPORT int GetTraceTotPoints ()
 
SOLVER_UTILS_EXPORT int GetTraceNpoints ()
 
SOLVER_UTILS_EXPORT int GetExpSize ()
 
SOLVER_UTILS_EXPORT int GetPhys_Offset (int n)
 
SOLVER_UTILS_EXPORT int GetCoeff_Offset (int n)
 
SOLVER_UTILS_EXPORT int GetTotPoints ()
 
SOLVER_UTILS_EXPORT int GetTotPoints (int n)
 
SOLVER_UTILS_EXPORT int GetNpoints ()
 
SOLVER_UTILS_EXPORT int GetSteps ()
 
SOLVER_UTILS_EXPORT NekDouble GetTimeStep ()
 
SOLVER_UTILS_EXPORT void CopyFromPhysField (const int i, Array< OneD, NekDouble > &output)
 
SOLVER_UTILS_EXPORT void CopyToPhysField (const int i, Array< OneD, NekDouble > &output)
 
SOLVER_UTILS_EXPORT void SetSteps (const int steps)
 
SOLVER_UTILS_EXPORT void ZeroPhysFields ()
 
SOLVER_UTILS_EXPORT void FwdTransFields ()
 
SOLVER_UTILS_EXPORT void SetModifiedBasis (const bool modbasis)
 
SOLVER_UTILS_EXPORT int GetCheckpointNumber ()
 
SOLVER_UTILS_EXPORT void SetCheckpointNumber (int num)
 
SOLVER_UTILS_EXPORT int GetCheckpointSteps ()
 
SOLVER_UTILS_EXPORT void SetCheckpointSteps (int num)
 
SOLVER_UTILS_EXPORT void SetTime (const NekDouble time)
 
SOLVER_UTILS_EXPORT void SetInitialStep (const int step)
 
SOLVER_UTILS_EXPORT void SetBoundaryConditions (NekDouble time)
 Evaluates the boundary conditions at the given time. More...
 
virtual SOLVER_UTILS_EXPORT bool v_NegatedOp ()
 Virtual function to identify if operator is negated in DoSolve. More...
 

Static Public Member Functions

static SolverUtils::EquationSystemSharedPtr create (const LibUtilities::SessionReaderSharedPtr &pSession, const SpatialDomains::MeshGraphSharedPtr &pGraph)
 Creates an instance of this class. More...
 

Public Attributes

CloakType m_CloakType
 
SourceType m_SourceType
 
bool m_DispersiveCloak
 
- Public Attributes inherited from Nektar::SolverUtils::MMFSystem
NekDouble m_pi
 
int m_shapedim
 
SurfaceType m_surfaceType
 
UpwindType m_upwindType
 
TestMaxwellType m_TestMaxwellType
 
PolType m_PolType
 
IncType m_IncType
 
Array< OneD, NekDoublem_MMFfactors
 
- Public Attributes inherited from Nektar::SolverUtils::UnsteadySystem
NekDouble m_cflSafetyFactor
 CFL safety factor (comprise between 0 to 1). More...
 

Static Public Attributes

static std::string className
 Name of class. More...
 

Protected Member Functions

 MMFMaxwell (const LibUtilities::SessionReaderSharedPtr &pSession, const SpatialDomains::MeshGraphSharedPtr &pGraph)
 Session reader. More...
 
void DoOdeRhs (const Array< OneD, const Array< OneD, NekDouble >> &inarray, Array< OneD, Array< OneD, NekDouble >> &outarray, const NekDouble time)
 Compute the RHS. More...
 
void DoOdeProjection (const Array< OneD, const Array< OneD, NekDouble >> &inarray, Array< OneD, Array< OneD, NekDouble >> &outarray, const NekDouble time)
 Compute the projection. More...
 
void AddGreenDerivCompensate (const Array< OneD, const Array< OneD, NekDouble >> &physarray, Array< OneD, Array< OneD, NekDouble >> &outarray)
 
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 \( \langle\phi, \hat{F}\cdot n\rangle - (\nabla \phi \cdot F) \). More...
 
NekDouble ComputeEnergyDensity (Array< OneD, Array< OneD, NekDouble >> &fields)
 
Array< OneD, NekDoubleTestMaxwell1D (const NekDouble time, unsigned int field)
 
Array< OneD, NekDoubleTestMaxwell2DPEC (const NekDouble time, unsigned int field, const SolverUtils::PolType Polarization)
 
Array< OneD, NekDoubleTestMaxwell2DPMC (const NekDouble time, unsigned int field, const SolverUtils::PolType Polarization)
 
Array< OneD, NekDoubleTestMaxwellSphere (const NekDouble time, const NekDouble omega, unsigned int field)
 
void Printout_SurfaceCurrent (Array< OneD, Array< OneD, NekDouble >> &fields, const int time)
 
Array< OneD, NekDoubleComputeSurfaceCurrent (const int time, const Array< OneD, const Array< OneD, NekDouble >> &fields)
 
void GenerateSigmaPML (const NekDouble PMLthickness, const NekDouble PMLstart, const NekDouble PMLmaxsigma, Array< OneD, Array< OneD, NekDouble >> &SigmaPML)
 
void ComputeMaterialVector (Array< OneD, Array< OneD, NekDouble >> &epsvec, Array< OneD, Array< OneD, NekDouble >> &muvec)
 
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 ComputeMaterialMicroWaveCloak (const Array< OneD, const NekDouble > &radvec, Array< OneD, Array< OneD, NekDouble >> &epsvec, Array< OneD, Array< OneD, NekDouble >> &muvec)
 
void Checkpoint_TotalFieldOutput (const int n, const NekDouble time, const Array< OneD, const Array< OneD, NekDouble >> &fieldphys)
 
void Checkpoint_PlotOutput (const int n, 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 Checkpoint_EDFluxOutput (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)
 
Array< OneD, NekDoubleGaussianPulse (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, NekDoubleEvaluateCoriolis ()
 
void AddCoriolis (Array< OneD, Array< OneD, NekDouble >> &physarray, Array< OneD, Array< OneD, NekDouble >> &outarray)
 
Array< OneD, NekDoubleComputeRadCloak (const int Nlayer=5)
 
virtual void v_GenerateSummary (SolverUtils::SummaryList &s)
 Print Summary. More...
 
virtual void v_SetInitialConditions (const NekDouble initialtime, bool dumpInitialConditions, const int domain)
 
virtual void v_EvaluateExactSolution (unsigned int field, Array< OneD, NekDouble > &outfield, const NekDouble time)
 
void print_MMF (Array< OneD, Array< OneD, NekDouble >> &inarray)
 
- Protected Member Functions inherited from Nektar::SolverUtils::MMFSystem
void SetUpMovingFrames (const Array< OneD, const Array< OneD, NekDouble >> &Anisotropy, const int TangentXelem)
 
void CheckMovingFrames (const Array< OneD, const Array< OneD, NekDouble >> &movingframes)
 
SOLVER_UTILS_EXPORT void ComputencdotMF ()
 
SOLVER_UTILS_EXPORT void ComputeDivCurlMF ()
 
SOLVER_UTILS_EXPORT void ComputeMFtrace ()
 
SOLVER_UTILS_EXPORT void VectorDotProd (const Array< OneD, const Array< OneD, NekDouble >> &v1, const Array< OneD, const Array< OneD, NekDouble >> &v2, Array< OneD, NekDouble > &v3)
 
SOLVER_UTILS_EXPORT void VectorCrossProd (const Array< OneD, const Array< OneD, NekDouble >> &v1, const Array< OneD, const Array< OneD, NekDouble >> &v2, Array< OneD, Array< OneD, NekDouble >> &v3)
 
SOLVER_UTILS_EXPORT void VectorCrossProd (const Array< OneD, NekDouble > &v1, const Array< OneD, NekDouble > &v2, Array< OneD, NekDouble > &v3)
 
SOLVER_UTILS_EXPORT void ComputeCurl (const Array< OneD, const Array< OneD, NekDouble >> &inarray, Array< OneD, Array< OneD, NekDouble >> &outarray)
 
SOLVER_UTILS_EXPORT Array< OneD, NekDoubleCartesianToMovingframes (const Array< OneD, const Array< OneD, NekDouble >> &uvec, unsigned int field)
 
SOLVER_UTILS_EXPORT void DeriveCrossProductMF (Array< OneD, Array< OneD, NekDouble >> &CrossProductMF)
 
SOLVER_UTILS_EXPORT void ComputeNtimesMF ()
 
SOLVER_UTILS_EXPORT void ComputeNtimesFz (const int dir, const Array< OneD, Array< OneD, NekDouble >> &Fwd, const Array< OneD, Array< OneD, NekDouble >> &Bwd, const Array< OneD, const NekDouble > &imFwd, const Array< OneD, const NekDouble > &imBwd, Array< OneD, NekDouble > &outarrayFwd, Array< OneD, NekDouble > &outarrayBwd)
 
SOLVER_UTILS_EXPORT void ComputeNtimesF12 (const Array< OneD, Array< OneD, NekDouble >> &Fwd, const Array< OneD, Array< OneD, NekDouble >> &Bwd, const Array< OneD, const NekDouble > &im1Fwd, const Array< OneD, const NekDouble > &im1Bwd, const Array< OneD, const NekDouble > &im2Fwd, const Array< OneD, const NekDouble > &im2Bwd, Array< OneD, NekDouble > &outarrayFwd, Array< OneD, NekDouble > &outarrayBwd)
 
SOLVER_UTILS_EXPORT void ComputeNtimestimesdFz (const int dir, const Array< OneD, Array< OneD, NekDouble >> &Fwd, const Array< OneD, Array< OneD, NekDouble >> &Bwd, const Array< OneD, const NekDouble > &imFwd, const Array< OneD, const NekDouble > &imBwd, Array< OneD, NekDouble > &outarrayFwd, Array< OneD, NekDouble > &outarrayBwd)
 
SOLVER_UTILS_EXPORT void ComputeNtimestimesdF12 (const Array< OneD, Array< OneD, NekDouble >> &Fwd, const Array< OneD, Array< OneD, NekDouble >> &Bwd, const Array< OneD, const NekDouble > &im1Fwd, const Array< OneD, const NekDouble > &im1Bwd, const Array< OneD, const NekDouble > &im2Fwd, const Array< OneD, const NekDouble > &im2Bwd, Array< OneD, NekDouble > &outarrayFwd, Array< OneD, NekDouble > &outarrayBwd)
 
SOLVER_UTILS_EXPORT void CartesianToSpherical (const NekDouble x0j, const NekDouble x1j, const NekDouble x2j, NekDouble &sin_varphi, NekDouble &cos_varphi, NekDouble &sin_theta, NekDouble &cos_theta)
 
SOLVER_UTILS_EXPORT void ComputeZimYim (Array< OneD, Array< OneD, NekDouble >> &epsvec, Array< OneD, Array< OneD, NekDouble >> &muvec)
 
SOLVER_UTILS_EXPORT void AdddedtMaxwell (const Array< OneD, const Array< OneD, NekDouble >> &physarray, Array< OneD, Array< OneD, NekDouble >> &outarray)
 
SOLVER_UTILS_EXPORT void GetMaxwellFluxVector (const int var, const Array< OneD, const Array< OneD, NekDouble >> &physfield, Array< OneD, Array< OneD, NekDouble >> &flux)
 
SOLVER_UTILS_EXPORT void GetMaxwellFlux1D (const int var, const Array< OneD, const Array< OneD, NekDouble >> &physfield, Array< OneD, Array< OneD, NekDouble >> &flux)
 
SOLVER_UTILS_EXPORT void GetMaxwellFlux2D (const int var, const Array< OneD, const Array< OneD, NekDouble >> &physfield, Array< OneD, Array< OneD, NekDouble >> &flux)
 
SOLVER_UTILS_EXPORT void LaxFriedrichMaxwellFlux1D (Array< OneD, Array< OneD, NekDouble >> &physfield, Array< OneD, Array< OneD, NekDouble >> &numfluxFwd, Array< OneD, Array< OneD, NekDouble >> &numfluxBwd)
 
SOLVER_UTILS_EXPORT void UpwindMaxwellFlux1D (Array< OneD, Array< OneD, NekDouble >> &physfield, Array< OneD, Array< OneD, NekDouble >> &numfluxFwd, Array< OneD, Array< OneD, NekDouble >> &numfluxBwd)
 
SOLVER_UTILS_EXPORT void AverageMaxwellFlux1D (Array< OneD, Array< OneD, NekDouble >> &physfield, Array< OneD, Array< OneD, NekDouble >> &numfluxFwd, Array< OneD, Array< OneD, NekDouble >> &numfluxBwd)
 
SOLVER_UTILS_EXPORT void NumericalMaxwellFlux (Array< OneD, Array< OneD, NekDouble >> &physfield, Array< OneD, Array< OneD, NekDouble >> &numfluxFwd, Array< OneD, Array< OneD, NekDouble >> &numfluxBwd, const NekDouble time=0.0)
 
SOLVER_UTILS_EXPORT void NumericalMaxwellFluxTM (Array< OneD, Array< OneD, NekDouble >> &physfield, Array< OneD, Array< OneD, NekDouble >> &numfluxFwd, Array< OneD, Array< OneD, NekDouble >> &numfluxBwd, const NekDouble time)
 
SOLVER_UTILS_EXPORT void NumericalMaxwellFluxTE (Array< OneD, Array< OneD, NekDouble >> &physfield, Array< OneD, Array< OneD, NekDouble >> &numfluxFwd, Array< OneD, Array< OneD, NekDouble >> &numfluxBwd, const NekDouble time)
 
SOLVER_UTILS_EXPORT Array< OneD, NekDoubleGetIncidentField (const int var, const NekDouble time)
 
SOLVER_UTILS_EXPORT void Computedemdxicdote ()
 
SOLVER_UTILS_EXPORT NekDouble AvgInt (const Array< OneD, const NekDouble > &inarray)
 
SOLVER_UTILS_EXPORT NekDouble AvgAbsInt (const Array< OneD, const NekDouble > &inarray)
 
SOLVER_UTILS_EXPORT NekDouble AbsIntegral (const Array< OneD, const NekDouble > &inarray)
 
SOLVER_UTILS_EXPORT NekDouble RootMeanSquare (const Array< OneD, const NekDouble > &inarray)
 
SOLVER_UTILS_EXPORT NekDouble VectorAvgMagnitude (const Array< OneD, const Array< OneD, NekDouble >> &inarray)
 
SOLVER_UTILS_EXPORT void GramSchumitz (const Array< OneD, const Array< OneD, NekDouble >> &v1, const Array< OneD, const Array< OneD, NekDouble >> &v2, Array< OneD, Array< OneD, NekDouble >> &outarray, bool KeepTheMagnitude=true)
 
SOLVER_UTILS_EXPORT void BubbleSort (Array< OneD, NekDouble > &refarray, Array< OneD, NekDouble > &sortarray)
 
- Protected Member Functions inherited from Nektar::SolverUtils::UnsteadySystem
SOLVER_UTILS_EXPORT UnsteadySystem (const LibUtilities::SessionReaderSharedPtr &pSession, const SpatialDomains::MeshGraphSharedPtr &pGraph)
 Initialises UnsteadySystem class members. More...
 
SOLVER_UTILS_EXPORT NekDouble MaxTimeStepEstimator ()
 Get the maximum timestep estimator for cfl control. More...
 
virtual SOLVER_UTILS_EXPORT void v_DoInitialise ()
 Sets up initial conditions. More...
 
virtual SOLVER_UTILS_EXPORT void v_AppendOutput1D (Array< OneD, Array< OneD, NekDouble >> &solution1D)
 Print the solution at each solution point in a txt file. More...
 
virtual SOLVER_UTILS_EXPORT NekDouble v_GetTimeStep (const Array< OneD, const Array< OneD, NekDouble >> &inarray)
 Return the timestep to be used for the next step in the time-marching loop. More...
 
virtual SOLVER_UTILS_EXPORT bool v_PreIntegrate (int step)
 
virtual SOLVER_UTILS_EXPORT bool v_PostIntegrate (int step)
 
virtual SOLVER_UTILS_EXPORT bool v_RequireFwdTrans ()
 
SOLVER_UTILS_EXPORT void CheckForRestartTime (NekDouble &time, int &nchk)
 
SOLVER_UTILS_EXPORT void SVVVarDiffCoeff (const Array< OneD, Array< OneD, NekDouble >> vel, StdRegions::VarCoeffMap &varCoeffMap)
 Evaluate the SVV diffusion coefficient according to Moura's paper where it should proportional to h time velocity. More...
 
- Protected Member Functions inherited from Nektar::SolverUtils::EquationSystem
SOLVER_UTILS_EXPORT EquationSystem (const LibUtilities::SessionReaderSharedPtr &pSession, const SpatialDomains::MeshGraphSharedPtr &pGraph)
 Initialises EquationSystem class members. More...
 
virtual SOLVER_UTILS_EXPORT NekDouble v_LinfError (unsigned int field, const Array< OneD, NekDouble > &exactsoln=NullNekDouble1DArray)
 Virtual function for the L_inf error computation between fields and a given exact solution. More...
 
virtual SOLVER_UTILS_EXPORT NekDouble v_L2Error (unsigned int field, const Array< OneD, NekDouble > &exactsoln=NullNekDouble1DArray, bool Normalised=false)
 Virtual function for the L_2 error computation between fields and a given exact solution. More...
 
virtual SOLVER_UTILS_EXPORT void v_TransCoeffToPhys ()
 Virtual function for transformation to physical space. More...
 
virtual SOLVER_UTILS_EXPORT void v_TransPhysToCoeff ()
 Virtual function for transformation to coefficient space. More...
 
virtual SOLVER_UTILS_EXPORT void v_Output (void)
 
virtual SOLVER_UTILS_EXPORT MultiRegions::ExpListSharedPtr v_GetPressure (void)
 
virtual SOLVER_UTILS_EXPORT void v_ExtraFldOutput (std::vector< Array< OneD, NekDouble > > &fieldcoeffs, std::vector< std::string > &variables)
 

Protected Attributes

int m_ElemtGroup0
 
int m_ElemtGroup1
 
int m_boundaryforSF
 
int m_PrintoutSurfaceCurrent
 
int m_AddPML
 
int m_PMLorder
 
int m_AddRotation
 
bool m_Cloaking
 
NekDouble m_CloakNlayer
 
NekDouble m_Cloakraddelta
 
NekDouble m_wp2Tol
 
Array< OneD, NekDoublem_wp2
 
Array< OneD, NekDoublem_SourceVector
 
NekDouble m_Psx
 
NekDouble m_Psy
 
NekDouble m_Psz
 
NekDouble m_PSduration
 
NekDouble m_Gaussianradius
 
Array< OneD, Array< OneD, NekDouble > > m_CrossProductMF
 
NekDouble m_freq
 
NekDouble m_n1
 
NekDouble m_n2
 
NekDouble m_n3
 
Array< OneD, NekDoublem_varepsilon
 
Array< OneD, NekDoublem_mu
 
int m_TestPML
 
int m_PMLelement
 
int m_RecPML
 
NekDouble m_PMLthickness
 
NekDouble m_PMLstart
 
NekDouble m_PMLmaxsigma
 
Array< OneD, Array< OneD, NekDouble > > m_SigmaPML
 
int m_NoInc
 
Array< OneD, NekDoublem_coriolis
 
- Protected Attributes inherited from Nektar::SolverUtils::MMFSystem
NekDouble m_alpha
 
NekDouble m_Incfreq
 
int m_SmoothFactor
 
NekDouble m_SFinit
 
Array< OneD, Array< OneD, NekDouble > > m_movingframes
 
Array< OneD, Array< OneD, NekDouble > > m_surfaceNormal
 
Array< OneD, Array< OneD, NekDouble > > m_ncdotMFFwd
 
Array< OneD, Array< OneD, NekDouble > > m_ncdotMFBwd
 
Array< OneD, Array< OneD, NekDouble > > m_nperpcdotMFFwd
 
Array< OneD, Array< OneD, NekDouble > > m_nperpcdotMFBwd
 
Array< OneD, Array< OneD, NekDouble > > m_DivMF
 
Array< OneD, Array< OneD, Array< OneD, NekDouble > > > m_CurlMF
 
Array< OneD, Array< OneD, Array< OneD, NekDouble > > > m_MFtraceFwd
 
Array< OneD, Array< OneD, Array< OneD, NekDouble > > > m_MFtraceBwd
 
Array< OneD, Array< OneD, Array< OneD, NekDouble > > > m_ntimesMFFwd
 
Array< OneD, Array< OneD, Array< OneD, NekDouble > > > m_ntimesMFBwd
 
Array< OneD, Array< OneD, Array< OneD, NekDouble > > > m_ntimes_ntimesMFFwd
 
Array< OneD, Array< OneD, Array< OneD, NekDouble > > > m_ntimes_ntimesMFBwd
 
Array< OneD, Array< OneD, NekDouble > > m_ZimFwd
 
Array< OneD, Array< OneD, NekDouble > > m_ZimBwd
 
Array< OneD, Array< OneD, NekDouble > > m_YimFwd
 
Array< OneD, Array< OneD, NekDouble > > m_YimBwd
 
Array< OneD, Array< OneD, NekDouble > > m_epsvec
 
Array< OneD, Array< OneD, NekDouble > > m_muvec
 
Array< OneD, Array< OneD, NekDouble > > m_negepsvecminus1
 
Array< OneD, Array< OneD, NekDouble > > m_negmuvecminus1
 
Array< OneD, Array< OneD, Array< OneD, Array< OneD, NekDouble > > > > m_dedxi_cdot_e
 
SpatialDomains::GeomMMF m_MMFdir
 
Array< OneD, NekDoublem_MFlength
 
- Protected Attributes inherited from Nektar::SolverUtils::UnsteadySystem
int m_infosteps
 Number of time steps between outputting status information. More...
 
int m_abortSteps
 Number of steps between checks for abort conditions. More...
 
int m_filtersInfosteps
 Number of time steps between outputting filters information. More...
 
int m_nanSteps
 
LibUtilities::TimeIntegrationWrapperSharedPtr m_intScheme
 Wrapper to the time integration scheme. More...
 
LibUtilities::TimeIntegrationSchemeOperators m_ode
 The time integration scheme operators to use. More...
 
LibUtilities::TimeIntegrationSolutionSharedPtr m_intSoln
 
NekDouble m_epsilon
 
bool m_explicitDiffusion
 Indicates if explicit or implicit treatment of diffusion is used. More...
 
bool m_explicitAdvection
 Indicates if explicit or implicit treatment of advection is used. More...
 
bool m_explicitReaction
 Indicates if explicit or implicit treatment of reaction is used. More...
 
bool m_homoInitialFwd
 Flag to determine if simulation should start in homogeneous forward transformed state. More...
 
NekDouble m_steadyStateTol
 Tolerance to which steady state should be evaluated at. More...
 
int m_steadyStateSteps
 Check for steady state at step interval. More...
 
Array< OneD, Array< OneD, NekDouble > > m_previousSolution
 Storage for previous solution for steady-state check. More...
 
std::ofstream m_errFile
 
std::vector< int > m_intVariables
 
std::vector< std::pair< std::string, FilterSharedPtr > > m_filters
 
NekDouble m_filterTimeWarning
 Number of time steps between outputting status information. More...
 
- Protected Attributes inherited from Nektar::SolverUtils::EquationSystem
LibUtilities::CommSharedPtr m_comm
 Communicator. More...
 
LibUtilities::SessionReaderSharedPtr m_session
 The session reader. More...
 
std::map< std::string, SolverUtils::SessionFunctionSharedPtrm_sessionFunctions
 Map of known SessionFunctions. More...
 
LibUtilities::FieldIOSharedPtr m_fld
 Field input/output. More...
 
Array< OneD, MultiRegions::ExpListSharedPtrm_fields
 Array holding all dependent variables. More...
 
SpatialDomains::BoundaryConditionsSharedPtr m_boundaryConditions
 Pointer to boundary conditions object. More...
 
SpatialDomains::MeshGraphSharedPtr m_graph
 Pointer to graph defining mesh. More...
 
std::string m_sessionName
 Name of the session. More...
 
NekDouble m_time
 Current time of simulation. More...
 
int m_initialStep
 Number of the step where the simulation should begin. More...
 
NekDouble m_fintime
 Finish time of the simulation. More...
 
NekDouble m_timestep
 Time step size. More...
 
NekDouble m_lambda
 Lambda constant in real system if one required. More...
 
NekDouble m_checktime
 Time between checkpoints. More...
 
int m_nchk
 Number of checkpoints written so far. More...
 
int m_steps
 Number of steps to take. More...
 
int m_checksteps
 Number of steps between checkpoints. More...
 
int m_spacedim
 Spatial dimension (>= expansion dim). More...
 
int m_expdim
 Expansion dimension. More...
 
bool m_singleMode
 Flag to determine if single homogeneous mode is used. More...
 
bool m_halfMode
 Flag to determine if half homogeneous mode is used. More...
 
bool m_multipleModes
 Flag to determine if use multiple homogenenous modes are used. More...
 
bool m_useFFT
 Flag to determine if FFT is used for homogeneous transform. More...
 
bool m_homogen_dealiasing
 Flag to determine if dealiasing is used for homogeneous simulations. More...
 
bool m_specHP_dealiasing
 Flag to determine if dealisising is usde for the Spectral/hp element discretisation. More...
 
enum MultiRegions::ProjectionType m_projectionType
 Type of projection; e.g continuous or discontinuous. More...
 
Array< OneD, Array< OneD, NekDouble > > m_traceNormals
 Array holding trace normals for DG simulations in the forwards direction. More...
 
Array< OneD, bool > m_checkIfSystemSingular
 Flag to indicate if the fields should be checked for singularity. More...
 
LibUtilities::FieldMetaDataMap m_fieldMetaDataMap
 Map to identify relevant solver info to dump in output fields. More...
 
int m_NumQuadPointsError
 Number of Quadrature points used to work out the error. More...
 
enum HomogeneousType m_HomogeneousType
 
NekDouble m_LhomX
 physical length in X direction (if homogeneous) More...
 
NekDouble m_LhomY
 physical length in Y direction (if homogeneous) More...
 
NekDouble m_LhomZ
 physical length in Z direction (if homogeneous) More...
 
int m_npointsX
 number of points in X direction (if homogeneous) More...
 
int m_npointsY
 number of points in Y direction (if homogeneous) More...
 
int m_npointsZ
 number of points in Z direction (if homogeneous) More...
 
int m_HomoDirec
 number of homogenous directions More...
 

Friends

class MemoryManager< MMFMaxwell >
 

Additional Inherited Members

- Protected Types inherited from Nektar::SolverUtils::EquationSystem
enum  HomogeneousType { eHomogeneous1D, eHomogeneous2D, eHomogeneous3D, eNotHomogeneous }
 Parameter for homogeneous expansions. More...
 
- Static Protected Attributes inherited from Nektar::SolverUtils::EquationSystem
static std::string equationSystemTypeLookupIds []
 

Detailed Description

Definition at line 71 of file MMFMaxwell.h.

Constructor & Destructor Documentation

◆ ~MMFMaxwell()

Nektar::MMFMaxwell::~MMFMaxwell ( )
virtual

Destructor.

Unsteady linear advection equation destructor.

Definition at line 443 of file MMFMaxwell.cpp.

444 {
445 }

◆ MMFMaxwell()

Nektar::MMFMaxwell::MMFMaxwell ( const LibUtilities::SessionReaderSharedPtr pSession,
const SpatialDomains::MeshGraphSharedPtr pGraph 
)
protected

Session reader.

Definition at line 54 of file MMFMaxwell.cpp.

56  : UnsteadySystem(pSession, pGraph), MMFSystem(pSession, pGraph)
57 {
58 }
SOLVER_UTILS_EXPORT UnsteadySystem(const LibUtilities::SessionReaderSharedPtr &pSession, const SpatialDomains::MeshGraphSharedPtr &pGraph)
Initialises UnsteadySystem class members.
SOLVER_UTILS_EXPORT MMFSystem(const LibUtilities::SessionReaderSharedPtr &pSession, const SpatialDomains::MeshGraphSharedPtr &pGraph)
Definition: MMFSystem.cpp:43

Member Function Documentation

◆ AddCoriolis()

void Nektar::MMFMaxwell::AddCoriolis ( Array< OneD, Array< OneD, NekDouble >> &  physarray,
Array< OneD, Array< OneD, NekDouble >> &  outarray 
)
protected

Definition at line 2871 of file MMFMaxwell.cpp.

References Nektar::SolverUtils::eTransElectric, Nektar::SolverUtils::eTransMagnetic, m_coriolis, Nektar::SolverUtils::MMFSystem::m_epsvec, Nektar::SolverUtils::MMFSystem::m_muvec, Nektar::SolverUtils::MMFSystem::m_PolType, Nektar::SolverUtils::MMFSystem::m_shapedim, Vmath::Neg(), Vmath::Vadd(), and Vmath::Vmul().

Referenced by DoOdeRhs().

2873 {
2874  int nq = physarray[0].num_elements();
2875 
2876  Array<OneD, NekDouble> tmp(nq);
2877 
2878  int indx;
2879  for (int j = 0; j < m_shapedim; ++j)
2880  {
2881  if (j == 0)
2882  {
2883  indx = 2;
2884  }
2885 
2886  else if (j == 1)
2887  {
2888  indx = 1;
2889  }
2890 
2891  Vmath::Vmul(nq, m_coriolis, 1, physarray[indx], 1, tmp, 1);
2892 
2893  switch (m_PolType)
2894  {
2896  {
2897  Vmath::Vmul(nq, m_muvec[indx], 1, tmp, 1, tmp, 1);
2898  }
2899  break;
2900 
2902  {
2903  Vmath::Vmul(nq, m_epsvec[indx], 1, tmp, 1, tmp, 1);
2904  }
2905  break;
2906 
2907  default:
2908  break;
2909  }
2910 
2911  if (j == 1)
2912  {
2913  Vmath::Neg(nq, tmp, 1);
2914  }
2915 
2916  Vmath::Vadd(nq, tmp, 1, outarray[j], 1, outarray[j], 1);
2917  }
2918 }
Array< OneD, NekDouble > m_coriolis
Definition: MMFMaxwell.h:142
Array< OneD, Array< OneD, NekDouble > > m_epsvec
Definition: MMFSystem.h:206
Array< OneD, Array< OneD, NekDouble > > m_muvec
Definition: MMFSystem.h:207
void Neg(int n, T *x, const int incx)
Negate x = -x.
Definition: Vmath.cpp:399
void Vadd(int n, const T *x, const int incx, const T *y, const int incy, T *z, const int incz)
Add vector z = x+y.
Definition: Vmath.cpp:302
void Vmul(int n, const T *x, const int incx, const T *y, const int incy, T *z, const int incz)
Multiply vector z = x*y.
Definition: Vmath.cpp:186

◆ AddGreenDerivCompensate()

void Nektar::MMFMaxwell::AddGreenDerivCompensate ( const Array< OneD, const Array< OneD, NekDouble >> &  physarray,
Array< OneD, Array< OneD, NekDouble >> &  outarray 
)
protected

Definition at line 1174 of file MMFMaxwell.cpp.

References Nektar::SolverUtils::eELF2DSurface, Nektar::SolverUtils::eMaxwellSphere, Nektar::SolverUtils::eScatField2D, Nektar::SolverUtils::eTestMaxwell2DPEC, Nektar::SolverUtils::eTestMaxwell2DPECAVGFLUX, Nektar::SolverUtils::eTestMaxwell2DPMC, Nektar::SolverUtils::eTotField2D, Nektar::SolverUtils::MMFSystem::GetMaxwellFluxVector(), Nektar::SolverUtils::MMFSystem::m_CurlMF, Nektar::SolverUtils::EquationSystem::m_fields, Nektar::SolverUtils::MMFSystem::m_shapedim, Nektar::SolverUtils::MMFSystem::m_TestMaxwellType, Vmath::Neg(), Vmath::Vadd(), Vmath::Vmul(), and Vmath::Vvtvm().

Referenced by DoOdeRhs().

1177 {
1178  // routine works for both primitive and conservative formulations
1179  int ncoeffs = outarray[0].num_elements();
1180  int nq = physarray[0].num_elements();
1181 
1182  Array<OneD, NekDouble> tmp(nq);
1183  Array<OneD, NekDouble> tmpc(ncoeffs);
1184 
1185  Array<OneD, Array<OneD, NekDouble>> fluxvector(m_shapedim);
1186  for (int j = 0; j < m_shapedim; ++j)
1187  {
1188  fluxvector[j] = Array<OneD, NekDouble>(nq);
1189  }
1190 
1191  // m_CurlMF[0][0] = e^3 \cdot (\nabla \times e^1) [ NEW m_CurlMF[0][2] ]
1192  // m_CurlMF[0][1] = 0.0
1193  // m_CurlMF[1][0] = 0.0,
1194  // m_CurlMF[1][1] = e^3 \cdot (\nabla \times e^2) [ NEW m_CurlMF[1][2] ]
1195  // m_CurlMF[2][0] = e^1 \cdot (\nabla \times e^3) [ NEW m_CurlMF[2][0] ]
1196  // m_CurlMF[2][1] = e^2 \cdot (\nabla \times e^3) [ NEW m_CurlMF[2][1] ]
1197 
1198  int var;
1199 
1200  switch (m_TestMaxwellType)
1201  {
1209  {
1210  var = 0;
1211  GetMaxwellFluxVector(var, physarray, fluxvector);
1212  Vmath::Vmul(nq, &fluxvector[0][0], 1, &m_CurlMF[0][2][0], 1,
1213  &tmp[0], 1);
1214  m_fields[var]->IProductWRTBase(tmp, tmpc);
1215  Vmath::Vadd(ncoeffs, tmpc, 1, outarray[var], 1, outarray[var], 1);
1216 
1217  var = 1;
1218  GetMaxwellFluxVector(var, physarray, fluxvector);
1219  Vmath::Vmul(nq, &fluxvector[1][0], 1, &m_CurlMF[1][2][0], 1,
1220  &tmp[0], 1);
1221  Vmath::Neg(nq, tmp, 1);
1222  m_fields[var]->IProductWRTBase(tmp, tmpc);
1223  Vmath::Vadd(ncoeffs, tmpc, 1, outarray[var], 1, outarray[var], 1);
1224 
1225  var = 2;
1226  GetMaxwellFluxVector(var, physarray, fluxvector);
1227  Vmath::Vmul(nq, &fluxvector[0][0], 1, &m_CurlMF[2][0][0], 1,
1228  &tmp[0], 1);
1229  Vmath::Vvtvm(nq, &fluxvector[1][0], 1, &m_CurlMF[2][1][0], 1,
1230  &tmp[0], 1, &tmp[0], 1);
1231  m_fields[var]->IProductWRTBase(tmp, tmpc);
1232  Vmath::Vadd(ncoeffs, tmpc, 1, outarray[var], 1, outarray[var], 1);
1233  }
1234  break;
1235 
1236  default:
1237  break;
1238  }
1239 }
Array< OneD, Array< OneD, Array< OneD, NekDouble > > > m_CurlMF
Definition: MMFSystem.h:190
TestMaxwellType m_TestMaxwellType
Definition: MMFSystem.h:150
void Neg(int n, T *x, const int incx)
Negate x = -x.
Definition: Vmath.cpp:399
Array< OneD, MultiRegions::ExpListSharedPtr > m_fields
Array holding all dependent variables.
void Vvtvm(int n, const T *w, const int incw, const T *x, const int incx, const T *y, const int incy, T *z, const int incz)
vvtvm (vector times vector plus vector): z = w*x - y
Definition: Vmath.cpp:468
SOLVER_UTILS_EXPORT void GetMaxwellFluxVector(const int var, const Array< OneD, const Array< OneD, NekDouble >> &physfield, Array< OneD, Array< OneD, NekDouble >> &flux)
Definition: MMFSystem.cpp:1614
void Vadd(int n, const T *x, const int incx, const T *y, const int incy, T *z, const int incz)
Add vector z = x+y.
Definition: Vmath.cpp:302
void Vmul(int n, const T *x, const int incx, const T *y, const int incy, T *z, const int incz)
Multiply vector z = x*y.
Definition: Vmath.cpp:186

◆ AddPML()

void Nektar::MMFMaxwell::AddPML ( const Array< OneD, const Array< OneD, NekDouble >> &  physarray,
Array< OneD, Array< OneD, NekDouble >> &  outarray 
)
protected

Definition at line 2427 of file MMFMaxwell.cpp.

References Nektar::SolverUtils::eTransElectric, Nektar::SolverUtils::eTransMagnetic, m_DispersiveCloak, Nektar::SolverUtils::EquationSystem::m_fields, Nektar::SolverUtils::MMFSystem::m_PolType, m_SigmaPML, m_wp2, Vmath::Neg(), Vmath::Vadd(), Vmath::Vmul(), Vmath::Vsub(), and Vmath::Vvtvp().

Referenced by DoOdeRhs().

2430 {
2431  int nq = m_fields[0]->GetTotPoints();
2432  Array<OneD, NekDouble> tmp(nq);
2433 
2434  Array<OneD, NekDouble> Sigma0plus1Neg(nq);
2435  Array<OneD, NekDouble> Sigma0minus1(nq);
2436  Array<OneD, NekDouble> Sigma1minus0(nq);
2437 
2438  Vmath::Vsub(nq, &m_SigmaPML[1][0], 1, &m_SigmaPML[0][0], 1,
2439  &Sigma1minus0[0], 1);
2440  Vmath::Vsub(nq, &m_SigmaPML[0][0], 1, &m_SigmaPML[1][0], 1,
2441  &Sigma0minus1[0], 1);
2442  Vmath::Vadd(nq, &m_SigmaPML[0][0], 1, &m_SigmaPML[1][0], 1,
2443  &Sigma0plus1Neg[0], 1);
2444  Vmath::Neg(nq, Sigma0plus1Neg, 1);
2445 
2446  switch (m_PolType)
2447  {
2449  {
2450  int indxH0 = 0;
2451  int indxH1 = 1;
2452  int indxE2 = 2;
2453  int indxQ0 = 3;
2454  int indxQ1 = 4;
2455  int indxP2 = 5;
2456 
2457  // dH0/dt: Add (sigma_0 - \sigma_1) H0 + Q0
2458  Vmath::Vvtvp(nq, &Sigma0minus1[0], 1, &physarray[indxH0][0], 1,
2459  &outarray[indxH0][0], 1, &outarray[indxH0][0], 1);
2460  Vmath::Vadd(nq, &physarray[indxQ0][0], 1, &outarray[indxH0][0], 1,
2461  &outarray[indxH0][0], 1);
2462 
2463  // dH1/dt: Add (sigma_1 - \sigma_0) H1 + Q1
2464  Vmath::Vvtvp(nq, &Sigma1minus0[0], 1, &physarray[indxH1][0], 1,
2465  &outarray[indxH1][0], 1, &outarray[indxH1][0], 1);
2466  Vmath::Vadd(nq, &physarray[indxQ1][0], 1, &outarray[indxH1][0], 1,
2467  &outarray[indxH1][0], 1);
2468 
2469  // dHz/dt: Add -(\sigma_0 + \sigma_1) Ez + Pz
2470  Vmath::Vvtvp(nq, &Sigma0plus1Neg[0], 1, &physarray[indxE2][0], 1,
2471  &outarray[indxE2][0], 1, &outarray[indxE2][0], 1);
2472  Vmath::Vadd(nq, &physarray[indxP2][0], 1, &outarray[indxE2][0], 1,
2473  &outarray[indxE2][0], 1);
2474 
2475  // dQ0/dt: Assign -\sigma_0 * ( Q0 + (\sigma_0 - \sigma_1) * H0 )
2476  Vmath::Vvtvp(nq, &Sigma0minus1[0], 1, &physarray[indxH0][0], 1,
2477  &physarray[indxQ0][0], 1, &outarray[indxQ0][0], 1);
2478  Vmath::Vmul(nq, &m_SigmaPML[0][0], 1, &outarray[indxQ0][0], 1,
2479  &outarray[indxQ0][0], 1);
2480  Vmath::Neg(nq, &outarray[indxQ0][0], 1);
2481 
2482  // dQ1/dt: Assign -\sigma_1 * ( Q1 + (\sigma_1 - \sigma_0) * H1 )
2483  Vmath::Vvtvp(nq, &Sigma1minus0[0], 1, &physarray[indxH1][0], 1,
2484  &physarray[indxQ1][0], 1, &outarray[indxQ1][0], 1);
2485  Vmath::Vmul(nq, &m_SigmaPML[1][0], 1, &outarray[indxQ1][0], 1,
2486  &outarray[indxQ1][0], 1);
2487  Vmath::Neg(nq, &outarray[indxQ1][0], 1);
2488 
2489  if (m_DispersiveCloak)
2490  {
2491  Vmath::Vvtvp(nq, &m_wp2[0], 1, &physarray[indxH1][0], 1,
2492  &outarray[indxQ1][0], 1, &outarray[indxQ1][0], 1);
2493  }
2494 
2495  // dP3/dt: Assign - \sigma_1 * \sigma_2 * E_z
2496  Vmath::Vmul(nq, &m_SigmaPML[0][0], 1, &m_SigmaPML[1][0], 1,
2497  &outarray[indxP2][0], 1);
2498  Vmath::Vmul(nq, &physarray[indxE2][0], 1, &outarray[indxP2][0], 1,
2499  &outarray[indxP2][0], 1);
2500  Vmath::Neg(nq, &outarray[indxP2][0], 1);
2501  }
2502  break;
2503 
2505  {
2506  int indxE0 = 0;
2507  int indxE1 = 1;
2508  int indxH2 = 2;
2509  int indxQ0 = 3;
2510  int indxQ1 = 4;
2511  int indxP2 = 5;
2512 
2513  // dE0/dt: Add (sigma_0 - \sigma_1) E0 - Q0
2514  Vmath::Vvtvp(nq, &Sigma0minus1[0], 1, &physarray[indxE0][0], 1,
2515  &outarray[indxE0][0], 1, &outarray[indxE0][0], 1);
2516  Vmath::Vsub(nq, &outarray[indxE0][0], 1, &physarray[indxQ0][0], 1,
2517  &outarray[indxE0][0], 1);
2518 
2519  // dE1/dt: Add (sigma_1 - \sigma_0) E1 - Q1
2520  Vmath::Vvtvp(nq, &Sigma1minus0[0], 1, &physarray[indxE1][0], 1,
2521  &outarray[indxE1][0], 1, &outarray[indxE1][0], 1);
2522  Vmath::Vsub(nq, &outarray[indxE1][0], 1, &physarray[indxQ1][0], 1,
2523  &outarray[indxE1][0], 1);
2524 
2525  // dHz/dt: Add -(\sigma_0 + \sigma_1) Hz - Pz
2526  Vmath::Vvtvp(nq, &Sigma0plus1Neg[0], 1, &physarray[indxH2][0], 1,
2527  &outarray[indxH2][0], 1, &outarray[indxH2][0], 1);
2528  Vmath::Vsub(nq, &outarray[indxH2][0], 1, &physarray[indxP2][0], 1,
2529  &outarray[indxH2][0], 1);
2530 
2531  // dQ0/dt: Assign -\sigma_0 * ( Q0 + (\sigma_1 - \sigma_0) * E0 )
2532  Vmath::Vvtvp(nq, &Sigma1minus0[0], 1, &physarray[indxE0][0], 1,
2533  &physarray[indxQ0][0], 1, &outarray[indxQ0][0], 1);
2534  Vmath::Vmul(nq, &m_SigmaPML[0][0], 1, &outarray[indxQ0][0], 1,
2535  &outarray[indxQ0][0], 1);
2536  Vmath::Neg(nq, &outarray[indxQ0][0], 1);
2537 
2538  // dQ1/dt: Assign -\sigma_1 * ( Q1 + (\sigma_0 - \sigma_1) * E1 )
2539  Vmath::Vvtvp(nq, &Sigma0minus1[0], 1, &physarray[indxE1][0], 1,
2540  &physarray[indxQ1][0], 1, &outarray[indxQ1][0], 1);
2541  Vmath::Vmul(nq, &m_SigmaPML[1][0], 1, &outarray[indxQ1][0], 1,
2542  &outarray[indxQ1][0], 1);
2543  Vmath::Neg(nq, &outarray[indxQ1][0], 1);
2544 
2545  if (m_DispersiveCloak)
2546  {
2547  Vmath::Vvtvp(nq, &m_wp2[0], 1, &physarray[indxE1][0], 1,
2548  &outarray[indxQ1][0], 1, &outarray[indxQ1][0], 1);
2549  }
2550 
2551  // dP3/dt: Assign \sigma_1 * \sigma_2 * H_z
2552  Vmath::Vmul(nq, &m_SigmaPML[0][0], 1, &m_SigmaPML[1][0], 1,
2553  &outarray[indxP2][0], 1);
2554  Vmath::Vmul(nq, &physarray[indxH2][0], 1, &outarray[indxP2][0], 1,
2555  &outarray[indxP2][0], 1);
2556  }
2557  break;
2558 
2559  default:
2560  break;
2561  }
2562 }
Array< OneD, NekDouble > m_wp2
Definition: MMFMaxwell.h:117
void Vvtvp(int n, const T *w, const int incw, const T *x, const int incx, const T *y, const int incy, T *z, const int incz)
vvtvp (vector times vector plus vector): z = w*x + y
Definition: Vmath.cpp:445
Array< OneD, Array< OneD, NekDouble > > m_SigmaPML
Definition: MMFMaxwell.h:138
void Neg(int n, T *x, const int incx)
Negate x = -x.
Definition: Vmath.cpp:399
void Vsub(int n, const T *x, const int incx, const T *y, const int incy, T *z, const int incz)
Subtract vector z = x-y.
Definition: Vmath.cpp:346
Array< OneD, MultiRegions::ExpListSharedPtr > m_fields
Array holding all dependent variables.
void Vadd(int n, const T *x, const int incx, const T *y, const int incy, T *z, const int incz)
Add vector z = x+y.
Definition: Vmath.cpp:302
void Vmul(int n, const T *x, const int incx, const T *y, const int incy, T *z, const int incz)
Multiply vector z = x*y.
Definition: Vmath.cpp:186

◆ Checkpoint_EDFluxOutput()

void Nektar::MMFMaxwell::Checkpoint_EDFluxOutput ( const int  n,
const NekDouble  time,
const Array< OneD, const Array< OneD, NekDouble >> &  fieldphys 
)
protected

Definition at line 2686 of file MMFMaxwell.cpp.

References Nektar::SolverUtils::eTransMagnetic, Nektar::SolverUtils::EquationSystem::m_boundaryConditions, Nektar::SolverUtils::EquationSystem::m_fields, Nektar::SolverUtils::MMFSystem::m_movingframes, Nektar::SolverUtils::MMFSystem::m_PolType, Nektar::SolverUtils::EquationSystem::m_sessionName, Nektar::SolverUtils::EquationSystem::m_spacedim, Vmath::Neg(), Vmath::Vmul(), Vmath::Vvtvm(), and Nektar::SolverUtils::EquationSystem::WriteFld().

Referenced by v_DoSolve().

2689 {
2690  boost::ignore_unused(time);
2691 
2692  int nvar = m_fields.num_elements();
2693  int nq = m_fields[0]->GetTotPoints();
2694  int ncoeffs = m_fields[0]->GetNcoeffs();
2695 
2696  std::string outname = m_sessionName + "EDFlux_" +
2697  boost::lexical_cast<std::string>(n) + ".chk";
2698 
2699  std::vector<std::string> variables(nvar);
2700  variables[0] = "EDFx";
2701  variables[1] = "EDFy";
2702  variables[2] = "EDFz";
2703  for (int i = 3; i < nvar; ++i)
2704  {
2705  variables[i] = m_boundaryConditions->GetVariable(i);
2706  }
2707 
2708  std::vector<Array<OneD, NekDouble>> fieldcoeffs(nvar);
2709  for (int i = 0; i < nvar; ++i)
2710  {
2711  fieldcoeffs[i] = Array<OneD, NekDouble>(ncoeffs);
2712  }
2713 
2714  Array<OneD, NekDouble> tmp(nq);
2715 
2716  // TE: H^3 (E^2 e^1 - E^1 e^2 )
2717  // TM: -E^3 (H^2 e^1 - H^1 e^2 )
2718  for (int k = 0; k < m_spacedim; ++k)
2719  {
2720  Vmath::Vmul(nq, &fieldphys[0][0], 1, &m_movingframes[1][k * nq], 1,
2721  &tmp[0], 1);
2722  Vmath::Vvtvm(nq, &fieldphys[1][0], 1, &m_movingframes[0][k * nq], 1,
2723  &tmp[0], 1, &tmp[0], 1);
2724 
2725  Vmath::Vmul(nq, &fieldphys[2][0], 1, &tmp[0], 1, &tmp[0], 1);
2726 
2728  {
2729  Vmath::Neg(nq, tmp, 1);
2730  }
2731 
2732  m_fields[k]->FwdTrans(tmp, fieldcoeffs[k]);
2733  }
2734 
2735  WriteFld(outname, m_fields[0], fieldcoeffs, variables);
2736 }
std::string m_sessionName
Name of the session.
Array< OneD, Array< OneD, NekDouble > > m_movingframes
Definition: MMFSystem.h:180
SpatialDomains::BoundaryConditionsSharedPtr m_boundaryConditions
Pointer to boundary conditions object.
int m_spacedim
Spatial dimension (>= expansion dim).
void Neg(int n, T *x, const int incx)
Negate x = -x.
Definition: Vmath.cpp:399
SOLVER_UTILS_EXPORT void WriteFld(const std::string &outname)
Write field data to the given filename.
Array< OneD, MultiRegions::ExpListSharedPtr > m_fields
Array holding all dependent variables.
void Vvtvm(int n, const T *w, const int incw, const T *x, const int incx, const T *y, const int incy, T *z, const int incz)
vvtvm (vector times vector plus vector): z = w*x - y
Definition: Vmath.cpp:468
void Vmul(int n, const T *x, const int incx, const T *y, const int incy, T *z, const int incz)
Multiply vector z = x*y.
Definition: Vmath.cpp:186

◆ Checkpoint_EnergyOutput()

void Nektar::MMFMaxwell::Checkpoint_EnergyOutput ( const int  n,
const NekDouble  time,
const Array< OneD, const Array< OneD, NekDouble >> &  fieldphys 
)
protected

Definition at line 2738 of file MMFMaxwell.cpp.

References Nektar::SolverUtils::EquationSystem::m_boundaryConditions, Nektar::SolverUtils::EquationSystem::m_fields, Nektar::SolverUtils::EquationSystem::m_sessionName, Nektar::SolverUtils::EquationSystem::m_spacedim, Vmath::Smul(), Vmath::Vmul(), Vmath::Vsqrt(), Vmath::Vvtvp(), Nektar::SolverUtils::EquationSystem::WriteFld(), and Vmath::Zero().

Referenced by v_DoSolve().

2741 {
2742  boost::ignore_unused(time);
2743 
2744  int nvar = m_fields.num_elements();
2745  int nq = m_fields[0]->GetTotPoints();
2746  int ncoeffs = m_fields[0]->GetNcoeffs();
2747 
2748  std::string outname = m_sessionName + "Energy_" +
2749  boost::lexical_cast<std::string>(n) + ".chk";
2750 
2751  std::vector<std::string> variables(nvar);
2752  variables[0] = "Energy";
2753  variables[1] = "EnergyFlux";
2754  variables[2] = "Zero";
2755  for (int i = 3; i < nvar; ++i)
2756  {
2757  variables[i] = m_boundaryConditions->GetVariable(i);
2758  }
2759 
2760  std::vector<Array<OneD, NekDouble>> fieldcoeffs(nvar);
2761  for (int i = 0; i < nvar; ++i)
2762  {
2763  fieldcoeffs[i] = Array<OneD, NekDouble>(ncoeffs);
2764  }
2765 
2766  // Energy = 0.5 * ( E^2 + H^2 )
2767  Array<OneD, NekDouble> energy(nq, 0.0);
2768  Array<OneD, NekDouble> totfield(nq);
2769  for (int k = 0; k < m_spacedim; ++k)
2770  {
2771  // totfield = GetIncidentField(k,time);
2772  // Vmath::Vadd(nq, &fieldphys[k][0], 1, &totfield[0], 1, &totfield[0],
2773  // 1);
2774 
2775  Vmath::Vvtvp(nq, &fieldphys[k][0], 1, &fieldphys[k][0], 1, &energy[0],
2776  1, &energy[0], 1);
2777  }
2778  Vmath::Smul(nq, 0.5, energy, 1, energy, 1);
2779  m_fields[0]->FwdTrans(energy, fieldcoeffs[0]);
2780 
2781  // EnergyFlux = F3* sqrt( F1^2 + F2^2 )
2782  Array<OneD, NekDouble> energyflux(nq, 0.0);
2783  Array<OneD, NekDouble> Zero(nq, 0.0);
2784  for (int k = 0; k < 2; ++k)
2785  {
2786  // totfield = GetIncidentField(k,time);
2787  // Vmath::Vadd(nq, &fieldphys[k][0], 1, &totfield[0], 1, &totfield[0],
2788  // 1);
2789 
2790  Vmath::Vvtvp(nq, &fieldphys[k][0], 1, &fieldphys[k][0], 1,
2791  &energyflux[0], 1, &energyflux[0], 1);
2792  }
2793 
2794  Vmath::Vsqrt(nq, energyflux, 1, energyflux, 1);
2795  Vmath::Vmul(nq, &fieldphys[2][0], 1, &energyflux[0], 1, &energyflux[0], 1);
2796 
2797  m_fields[1]->FwdTrans(energyflux, fieldcoeffs[1]);
2798  m_fields[2]->FwdTrans(Zero, fieldcoeffs[2]);
2799 
2800  WriteFld(outname, m_fields[0], fieldcoeffs, variables);
2801 }
void Vsqrt(int n, const T *x, const int incx, T *y, const int incy)
sqrt y = sqrt(x)
Definition: Vmath.cpp:411
void Vvtvp(int n, const T *w, const int incw, const T *x, const int incx, const T *y, const int incy, T *z, const int incz)
vvtvp (vector times vector plus vector): z = w*x + y
Definition: Vmath.cpp:445
std::string m_sessionName
Name of the session.
void Smul(int n, const T alpha, const T *x, const int incx, T *y, const int incy)
Scalar multiply y = alpha*y.
Definition: Vmath.cpp:216
SpatialDomains::BoundaryConditionsSharedPtr m_boundaryConditions
Pointer to boundary conditions object.
int m_spacedim
Spatial dimension (>= expansion dim).
SOLVER_UTILS_EXPORT void WriteFld(const std::string &outname)
Write field data to the given filename.
Array< OneD, MultiRegions::ExpListSharedPtr > m_fields
Array holding all dependent variables.
void Zero(int n, T *x, const int incx)
Zero vector.
Definition: Vmath.cpp:376
void Vmul(int n, const T *x, const int incx, const T *y, const int incy, T *z, const int incz)
Multiply vector z = x*y.
Definition: Vmath.cpp:186

◆ Checkpoint_PlotOutput()

void Nektar::MMFMaxwell::Checkpoint_PlotOutput ( const int  n,
const Array< OneD, const Array< OneD, NekDouble >> &  fieldphys 
)
protected

Definition at line 2597 of file MMFMaxwell.cpp.

References Nektar::SolverUtils::EquationSystem::m_fields, Nektar::SolverUtils::MMFSystem::m_movingframes, Nektar::SolverUtils::EquationSystem::m_sessionName, Nektar::SolverUtils::EquationSystem::m_spacedim, Vmath::Vmul(), Vmath::Vvtvp(), and Nektar::SolverUtils::EquationSystem::WriteFld().

Referenced by v_DoSolve(), and v_SetInitialConditions().

2599 {
2600  int nvar = m_fields.num_elements();
2601  int nq = m_fields[0]->GetTotPoints();
2602  int ncoeffs = m_fields[0]->GetNcoeffs();
2603 
2604  std::string outname =
2605  m_sessionName + "Plot_" + boost::lexical_cast<std::string>(n) + ".chk";
2606 
2607  std::vector<std::string> variables(nvar);
2608  variables[0] = "Fx";
2609  variables[1] = "Fy";
2610  variables[2] = "Fz";
2611 
2612  std::vector<Array<OneD, NekDouble>> fieldcoeffs(nvar);
2613  for (int i = 0; i < nvar; ++i)
2614  {
2615  fieldcoeffs[i] = Array<OneD, NekDouble>(ncoeffs);
2616  }
2617 
2618  Array<OneD, NekDouble> tmp(nq);
2619  for (int k = 0; k < m_spacedim; ++k)
2620  {
2621  Vmath::Vmul(nq, &fieldphys[0][0], 1, &m_movingframes[0][k * nq], 1,
2622  &tmp[0], 1);
2623  Vmath::Vvtvp(nq, &fieldphys[1][0], 1, &m_movingframes[1][k * nq], 1,
2624  &tmp[0], 1, &tmp[0], 1);
2625 
2626  m_fields[k]->FwdTrans(tmp, fieldcoeffs[k]);
2627  }
2628 
2629  WriteFld(outname, m_fields[0], fieldcoeffs, variables);
2630 }
void Vvtvp(int n, const T *w, const int incw, const T *x, const int incx, const T *y, const int incy, T *z, const int incz)
vvtvp (vector times vector plus vector): z = w*x + y
Definition: Vmath.cpp:445
std::string m_sessionName
Name of the session.
Array< OneD, Array< OneD, NekDouble > > m_movingframes
Definition: MMFSystem.h:180
int m_spacedim
Spatial dimension (>= expansion dim).
SOLVER_UTILS_EXPORT void WriteFld(const std::string &outname)
Write field data to the given filename.
Array< OneD, MultiRegions::ExpListSharedPtr > m_fields
Array holding all dependent variables.
void Vmul(int n, const T *x, const int incx, const T *y, const int incy, T *z, const int incz)
Multiply vector z = x*y.
Definition: Vmath.cpp:186

◆ Checkpoint_TotalFieldOutput()

void Nektar::MMFMaxwell::Checkpoint_TotalFieldOutput ( const int  n,
const NekDouble  time,
const Array< OneD, const Array< OneD, NekDouble >> &  fieldphys 
)
protected

Definition at line 2564 of file MMFMaxwell.cpp.

References Nektar::SolverUtils::MMFSystem::GetIncidentField(), Nektar::SolverUtils::EquationSystem::m_boundaryConditions, Nektar::SolverUtils::EquationSystem::m_fields, Nektar::SolverUtils::EquationSystem::m_sessionName, Vmath::Vadd(), and Nektar::SolverUtils::EquationSystem::WriteFld().

Referenced by v_DoSolve().

2567 {
2568  int nvar = m_fields.num_elements();
2569  int nq = m_fields[0]->GetTotPoints();
2570  int ncoeffs = m_fields[0]->GetNcoeffs();
2571 
2572  std::string outname =
2573  m_sessionName + "Tot_" + boost::lexical_cast<std::string>(n) + ".chk";
2574 
2575  std::vector<std::string> variables(nvar);
2576  std::vector<Array<OneD, NekDouble>> fieldcoeffs(nvar);
2577 
2578  for (int i = 0; i < nvar; ++i)
2579  {
2580  fieldcoeffs[i] = Array<OneD, NekDouble>(ncoeffs);
2581  }
2582 
2583  Array<OneD, NekDouble> totfield(nq);
2584  for (int i = 0; i < nvar; ++i)
2585  {
2586  totfield = GetIncidentField(i, time);
2587  Vmath::Vadd(nq, fieldphys[i], 1, totfield, 1, totfield, 1);
2588 
2589  m_fields[i]->FwdTrans(totfield, fieldcoeffs[i]);
2590  variables[i] = m_boundaryConditions->GetVariable(i);
2591  }
2592 
2593  WriteFld(outname, m_fields[0], fieldcoeffs, variables);
2594 }
SOLVER_UTILS_EXPORT Array< OneD, NekDouble > GetIncidentField(const int var, const NekDouble time)
Definition: MMFSystem.cpp:2034
std::string m_sessionName
Name of the session.
SpatialDomains::BoundaryConditionsSharedPtr m_boundaryConditions
Pointer to boundary conditions object.
SOLVER_UTILS_EXPORT void WriteFld(const std::string &outname)
Write field data to the given filename.
Array< OneD, MultiRegions::ExpListSharedPtr > m_fields
Array holding all dependent variables.
void Vadd(int n, const T *x, const int incx, const T *y, const int incy, T *z, const int incz)
Add vector z = x+y.
Definition: Vmath.cpp:302

◆ Checkpoint_TotPlotOutput()

void Nektar::MMFMaxwell::Checkpoint_TotPlotOutput ( const int  n,
const NekDouble  time,
const Array< OneD, const Array< OneD, NekDouble >> &  fieldphys 
)
protected

Definition at line 2632 of file MMFMaxwell.cpp.

References Nektar::SolverUtils::MMFSystem::GetIncidentField(), Nektar::SolverUtils::EquationSystem::m_boundaryConditions, Nektar::SolverUtils::EquationSystem::m_fields, Nektar::SolverUtils::MMFSystem::m_movingframes, Nektar::SolverUtils::EquationSystem::m_sessionName, Nektar::SolverUtils::EquationSystem::m_spacedim, Vmath::Vadd(), Vmath::Vmul(), Vmath::Vvtvp(), and Nektar::SolverUtils::EquationSystem::WriteFld().

Referenced by v_DoSolve().

2635 {
2636  int nvar = m_fields.num_elements();
2637  int nq = m_fields[0]->GetTotPoints();
2638  int ncoeffs = m_fields[0]->GetNcoeffs();
2639 
2640  std::string outname = m_sessionName + "TotPlot_" +
2641  boost::lexical_cast<std::string>(n) + ".chk";
2642 
2643  std::vector<std::string> variables(nvar);
2644  variables[0] = "Frx";
2645  variables[1] = "Fry";
2646  variables[2] = "Frz";
2647  for (int i = 3; i < nvar; ++i)
2648  {
2649  variables[i] = m_boundaryConditions->GetVariable(i);
2650  }
2651 
2652  std::vector<Array<OneD, NekDouble>> fieldcoeffs(nvar);
2653  for (int i = 0; i < nvar; ++i)
2654  {
2655  fieldcoeffs[i] = Array<OneD, NekDouble>(ncoeffs);
2656  }
2657 
2658  Array<OneD, NekDouble> tmp(nq);
2659  Array<OneD, NekDouble> totfield0(nq);
2660  Array<OneD, NekDouble> totfield1(nq);
2661 
2662  totfield0 = GetIncidentField(0, time);
2663  Vmath::Vadd(nq, fieldphys[0], 1, totfield0, 1, totfield0, 1);
2664 
2665  totfield1 = GetIncidentField(1, time);
2666  Vmath::Vadd(nq, fieldphys[1], 1, totfield1, 1, totfield1, 1);
2667 
2668  for (int k = 0; k < m_spacedim; ++k)
2669  {
2670  Vmath::Vmul(nq, &totfield0[0], 1, &m_movingframes[0][k * nq], 1,
2671  &tmp[0], 1);
2672  Vmath::Vvtvp(nq, &totfield1[0], 1, &m_movingframes[1][k * nq], 1,
2673  &tmp[0], 1, &tmp[0], 1);
2674 
2675  m_fields[k]->FwdTrans(tmp, fieldcoeffs[k]);
2676  }
2677 
2678  for (int j = 3; j < nvar; ++j)
2679  {
2680  m_fields[j]->FwdTrans(fieldphys[j], fieldcoeffs[j]);
2681  }
2682 
2683  WriteFld(outname, m_fields[0], fieldcoeffs, variables);
2684 }
SOLVER_UTILS_EXPORT Array< OneD, NekDouble > GetIncidentField(const int var, const NekDouble time)
Definition: MMFSystem.cpp:2034
void Vvtvp(int n, const T *w, const int incw, const T *x, const int incx, const T *y, const int incy, T *z, const int incz)
vvtvp (vector times vector plus vector): z = w*x + y
Definition: Vmath.cpp:445
std::string m_sessionName
Name of the session.
Array< OneD, Array< OneD, NekDouble > > m_movingframes
Definition: MMFSystem.h:180
SpatialDomains::BoundaryConditionsSharedPtr m_boundaryConditions
Pointer to boundary conditions object.
int m_spacedim
Spatial dimension (>= expansion dim).
SOLVER_UTILS_EXPORT void WriteFld(const std::string &outname)
Write field data to the given filename.
Array< OneD, MultiRegions::ExpListSharedPtr > m_fields
Array holding all dependent variables.
void Vadd(int n, const T *x, const int incx, const T *y, const int incy, T *z, const int incz)
Add vector z = x+y.
Definition: Vmath.cpp:302
void Vmul(int n, const T *x, const int incx, const T *y, const int incy, T *z, const int incz)
Multiply vector z = x*y.
Definition: Vmath.cpp:186

◆ ComputeEnergyDensity()

NekDouble Nektar::MMFMaxwell::ComputeEnergyDensity ( Array< OneD, Array< OneD, NekDouble >> &  fields)
protected

Definition at line 2187 of file MMFMaxwell.cpp.

References Nektar::SolverUtils::EquationSystem::GetTotPoints(), Nektar::SolverUtils::EquationSystem::m_fields, and Vmath::Vvtvp().

Referenced by v_DoSolve().

2189 {
2190  int nq = GetTotPoints();
2191  NekDouble energy;
2192 
2193  Array<OneD, NekDouble> tmp(nq, 0.0);
2194 
2195  for (int i = 0; i < 3; ++i)
2196  {
2197  Vmath::Vvtvp(nq, &fields[i][0], 1, &fields[i][0], 1, &tmp[0], 1,
2198  &tmp[0], 1);
2199  }
2200 
2201  energy = 0.5 * (m_fields[0]->PhysIntegral(tmp));
2202  return energy;
2203 }
void Vvtvp(int n, const T *w, const int incw, const T *x, const int incx, const T *y, const int incy, T *z, const int incz)
vvtvp (vector times vector plus vector): z = w*x + y
Definition: Vmath.cpp:445
SOLVER_UTILS_EXPORT int GetTotPoints()
double NekDouble
Array< OneD, MultiRegions::ExpListSharedPtr > m_fields
Array holding all dependent variables.

◆ ComputeMaterialMicroWaveCloak()

void Nektar::MMFMaxwell::ComputeMaterialMicroWaveCloak ( const Array< OneD, const NekDouble > &  radvec,
Array< OneD, Array< OneD, NekDouble >> &  epsvec,
Array< OneD, Array< OneD, NekDouble >> &  muvec 
)
protected

Definition at line 2373 of file MMFMaxwell.cpp.

References Nektar::SolverUtils::EquationSystem::GetNpoints(), m_Cloakraddelta, m_ElemtGroup0, m_ElemtGroup1, Nektar::SolverUtils::EquationSystem::m_fields, Nektar::SolverUtils::MMFSystem::m_pi, and Vmath::Vsub().

Referenced by v_InitObject().

2377 {
2378  int nq = GetNpoints();
2379 
2380  NekDouble m_b = 2.67;
2381  NekDouble m_a = 1.33;
2382  NekDouble m_adel;
2383 
2384  m_adel = m_a - m_Cloakraddelta;
2385 
2386  Array<OneD, NekDouble> Cloakregion(nq, 0.0);
2387  NekDouble ExactCloakArea = m_pi * (m_b * m_b - m_a * m_a);
2388  m_fields[0]->GenerateElementVector(m_ElemtGroup1, 1.0, 0.0, Cloakregion);
2389 
2390  if (m_ElemtGroup0 > 0)
2391  {
2392  Array<OneD, NekDouble> Vacregion(nq, 0.0);
2393  m_fields[0]->GenerateElementVector(m_ElemtGroup0, 1.0, 0.0, Vacregion);
2394 
2395  Vmath::Vsub(nq, Cloakregion, 1, Vacregion, 1, Cloakregion, 1);
2396  }
2397 
2398  ExactCloakArea = ExactCloakArea - (m_fields[0]->PhysIntegral(Cloakregion));
2399  std::cout << "*** Error of Cloakregion area = " << ExactCloakArea
2400  << std::endl;
2401 
2402  epsvec[0] = Array<OneD, NekDouble>(nq, 1.0);
2403  epsvec[1] = Array<OneD, NekDouble>(nq, 1.0);
2404 
2405  muvec[0] = Array<OneD, NekDouble>(nq, 1.0);
2406  muvec[1] = Array<OneD, NekDouble>(nq, 1.0);
2407  for (int i = 0; i < nq; ++i)
2408  {
2409  if (Cloakregion[i] > 0)
2410  {
2411  // relrad = m_a +
2412  // (m_b-m_a)*(radvec[i]-Cloakradmin)/(Cloakradmax-Cloakradmin);
2413  // ratio = (relrad - m_a + m_Cloakraddelta)/relrad;
2414 
2415  epsvec[0][i] = radvec[i] / (radvec[i] - m_adel);
2416  epsvec[1][i] = (radvec[i] - m_adel) / radvec[i];
2417  muvec[2][i] = (m_b / (m_b - m_adel)) * (m_b / (m_b - m_adel)) *
2418  (radvec[i] - m_adel) / radvec[i];
2419 
2420  muvec[0][i] = epsvec[0][i];
2421  muvec[1][i] = epsvec[1][i];
2422  epsvec[2][i] = muvec[2][i];
2423  }
2424  }
2425 }
NekDouble m_Cloakraddelta
Definition: MMFMaxwell.h:114
double NekDouble
void Vsub(int n, const T *x, const int incx, const T *y, const int incy, T *z, const int incz)
Subtract vector z = x-y.
Definition: Vmath.cpp:346
SOLVER_UTILS_EXPORT int GetNpoints()
Array< OneD, MultiRegions::ExpListSharedPtr > m_fields
Array holding all dependent variables.

◆ ComputeMaterialOpticalCloak()

void Nektar::MMFMaxwell::ComputeMaterialOpticalCloak ( const Array< OneD, const NekDouble > &  radvec,
Array< OneD, Array< OneD, NekDouble >> &  epsvec,
Array< OneD, Array< OneD, NekDouble >> &  muvec,
const bool  Dispersion = false 
)
protected

Definition at line 2300 of file MMFMaxwell.cpp.

References Nektar::SolverUtils::EquationSystem::GetNpoints(), m_Cloakraddelta, m_DispersiveCloak, m_ElemtGroup1, Nektar::SolverUtils::EquationSystem::m_fields, Nektar::SolverUtils::MMFSystem::m_Incfreq, Nektar::SolverUtils::MMFSystem::m_MMFfactors, Nektar::SolverUtils::MMFSystem::m_pi, m_wp2, and m_wp2Tol.

Referenced by v_InitObject().

2304 {
2305  boost::ignore_unused(muvec, Dispersion);
2306 
2307  int nq = GetNpoints();
2308 
2309  // Cloaking metamaterial
2310  // \varepsilon_\theta = (b/(b-a))^2
2311  // \varepsilon_r = (b/(b-a))^2 ((r-a)/r)^2
2312  // \mu_z = 1.0m_CloakingOn
2313 
2314  NekDouble m_b = 1.0 / 0.314;
2315  NekDouble m_a = 1.0;
2316 
2317  NekDouble m_adel = m_a - m_Cloakraddelta;
2318 
2319  NekDouble boveradel = m_b / (m_b - m_adel);
2320 
2321  Array<OneD, NekDouble> Cloakregion(nq, 0.0);
2322 
2323  NekDouble la = m_MMFfactors[0];
2324  NekDouble lb = m_MMFfactors[1];
2325 
2326  NekDouble ExactCloakArea;
2327  if (fabs(la * lb - 1.0) < 0.00001)
2328  {
2329  ExactCloakArea = m_pi * (m_b * m_b - m_a * m_a);
2330  }
2331 
2332  else
2333  {
2334  ExactCloakArea = m_pi * (3.0 * lb * 3.0 * la - lb * la);
2335  }
2336 
2337  m_fields[0]->GenerateElementVector(m_ElemtGroup1, 1.0, 0.0, Cloakregion);
2338 
2339  ExactCloakArea = ExactCloakArea - (m_fields[0]->PhysIntegral(Cloakregion));
2340  std::cout << "*** Error of Cloakregion area = " << ExactCloakArea
2341  << std::endl;
2342 
2343  NekDouble ratio;
2344 
2345  epsvec[0] = Array<OneD, NekDouble>(nq, 1.0);
2346  epsvec[1] = Array<OneD, NekDouble>(nq, 1.0);
2347  m_wp2 = Array<OneD, NekDouble>(nq, 0.0);
2348  for (int i = 0; i < nq; ++i)
2349  {
2350  if (Cloakregion[i] > 0)
2351  {
2352  // relrad = m_a +
2353  // (m_b-m_adel)*(radvec[i]-m_adel)/(Cloakradmax-m_adel);
2354  ratio = (radvec[i] - m_adel) / radvec[i];
2355 
2356  epsvec[0][i] = boveradel * boveradel;
2357  if (m_DispersiveCloak)
2358  {
2359  epsvec[1][i] = 1.0;
2360  m_wp2[i] = m_Incfreq * m_Incfreq *
2361  (1.0 - boveradel * boveradel * ratio * ratio) +
2362  m_wp2Tol;
2363  }
2364 
2365  else
2366  {
2367  epsvec[1][i] = boveradel * boveradel * (ratio * ratio);
2368  }
2369  }
2370  }
2371 }
Array< OneD, NekDouble > m_wp2
Definition: MMFMaxwell.h:117
NekDouble m_Cloakraddelta
Definition: MMFMaxwell.h:114
double NekDouble
Array< OneD, NekDouble > m_MMFfactors
Definition: MMFSystem.h:154
NekDouble m_wp2Tol
Definition: MMFMaxwell.h:116
SOLVER_UTILS_EXPORT int GetNpoints()
Array< OneD, MultiRegions::ExpListSharedPtr > m_fields
Array holding all dependent variables.

◆ ComputeMaterialVector()

void Nektar::MMFMaxwell::ComputeMaterialVector ( Array< OneD, Array< OneD, NekDouble >> &  epsvec,
Array< OneD, Array< OneD, NekDouble >> &  muvec 
)
protected

Definition at line 2205 of file MMFMaxwell.cpp.

References Nektar::SolverUtils::eMaxwell1D, Nektar::SolverUtils::eScatField2D, Nektar::SolverUtils::eTestMaxwell2DPEC, Nektar::SolverUtils::eTestMaxwell2DPECAVGFLUX, Nektar::SolverUtils::eTestMaxwell2DPMC, Nektar::SolverUtils::eTotField2D, Nektar::SolverUtils::eTransElectric, Nektar::SolverUtils::eTransMagnetic, m_ElemtGroup1, Nektar::SolverUtils::EquationSystem::m_fields, m_mu, Nektar::SolverUtils::MMFSystem::m_PolType, Nektar::SolverUtils::MMFSystem::m_TestMaxwellType, and m_varepsilon.

Referenced by v_InitObject().

2208 {
2209  switch (m_TestMaxwellType)
2210  {
2212  {
2213  m_fields[0]->GenerateElementVector(m_ElemtGroup1, m_varepsilon[0],
2214  m_varepsilon[1], epsvec[0]);
2215  m_fields[0]->GenerateElementVector(m_ElemtGroup1, 1.0, 1.0,
2216  muvec[0]);
2217  }
2218  break;
2219 
2225  {
2226  switch (m_PolType)
2227  {
2229  {
2230  m_fields[0]->GenerateElementVector(m_ElemtGroup1, m_mu[0],
2231  1.0, muvec[0]);
2232  m_fields[0]->GenerateElementVector(m_ElemtGroup1, m_mu[1],
2233  1.0, muvec[1]);
2234  m_fields[0]->GenerateElementVector(
2235  m_ElemtGroup1, m_varepsilon[2], 1.0, epsvec[2]);
2236 
2237  // // ONLY FOR VARIABLE ANISOTROPY TEST
2238  // int nq = GetTotPoints();
2239 
2240  // Array<OneD, NekDouble> tmpIN(nq);
2241 
2242  // m_fields[0]->GenerateElementVector(m_ElemtGroup1, 1.0,
2243  // 0.0, tmpIN);
2244 
2245  // Array<OneD, NekDouble> x0(nq);
2246  // Array<OneD, NekDouble> x1(nq);
2247  // Array<OneD, NekDouble> x2(nq);
2248 
2249  // m_fields[0]->GetCoords(x0,x1,x2);
2250 
2251  // for (int i=0; i<nq; i++)
2252  // {
2253  // muvec[1][i] = tmpIN[i]*(1.0 - 2*x0[i]*x0[i]) +
2254  // (1.0-tmpIN[i]);
2255  // }
2256  }
2257  break;
2258 
2260  {
2261  m_fields[0]->GenerateElementVector(
2262  m_ElemtGroup1, m_varepsilon[0], 1.0, epsvec[0]);
2263  m_fields[0]->GenerateElementVector(
2264  m_ElemtGroup1, m_varepsilon[1], 1.0, epsvec[1]);
2265  m_fields[0]->GenerateElementVector(m_ElemtGroup1, m_mu[2],
2266  1.0, muvec[2]);
2267 
2268  // // ONLY FOR VARIABLE ANISOTROPY TEST
2269  // int nq = GetTotPoints();
2270 
2271  // Array<OneD, NekDouble> tmpIN(nq);
2272 
2273  // m_fields[0]->GenerateElementVector(m_ElemtGroup1, 1.0,
2274  // 0.0, tmpIN);
2275 
2276  // Array<OneD, NekDouble> x0(nq);
2277  // Array<OneD, NekDouble> x1(nq);
2278  // Array<OneD, NekDouble> x2(nq);
2279 
2280  // m_fields[0]->GetCoords(x0,x1,x2);
2281 
2282  // for (int i=0; i<nq; i++)
2283  // {
2284  // epsvec[1][i] = tmpIN[i]*(1.0 - 2*x0[i]*x0[i]) +
2285  // (1.0-tmpIN[i]);
2286  // }
2287  }
2288  break;
2289 
2290  default:
2291  break; // Pol
2292  }
2293  }
2294 
2295  default:
2296  break; // TestType
2297  }
2298 }
Array< OneD, NekDouble > m_varepsilon
Definition: MMFMaxwell.h:132
TestMaxwellType m_TestMaxwellType
Definition: MMFSystem.h:150
Array< OneD, MultiRegions::ExpListSharedPtr > m_fields
Array holding all dependent variables.
Array< OneD, NekDouble > m_mu
Definition: MMFMaxwell.h:133

◆ ComputeRadCloak()

Array< OneD, NekDouble > Nektar::MMFMaxwell::ComputeRadCloak ( const int  Nlayer = 5)
protected

Definition at line 2920 of file MMFMaxwell.cpp.

References Nektar::SpatialDomains::eTangentCircular, Nektar::SpatialDomains::eTangentIrregular, Nektar::SpatialDomains::eTangentNonconvex, Nektar::SolverUtils::EquationSystem::GetNpoints(), Nektar::SolverUtils::EquationSystem::m_fields, Nektar::SolverUtils::MMFSystem::m_MMFdir, Nektar::SolverUtils::MMFSystem::m_MMFfactors, Vmath::Svtvp(), Vmath::Vcopy(), and Vmath::Vsub().

Referenced by v_InitObject().

2921 {
2922  int nq = GetNpoints();
2923 
2924  NekDouble m_b = 1.0 / 0.314;
2925  NekDouble m_a = 1.0;
2926 
2927  Array<OneD, int> Layer(CloakNlayer);
2928 
2929  NekDouble la = m_MMFfactors[0];
2930  NekDouble lb = m_MMFfactors[1];
2931  if (CloakNlayer == 8)
2932  {
2933  // Circular 8 layer
2934  if (fabs(la * lb - 1.0) < 0.0001)
2935  {
2936  Layer[0] = 119;
2937  Layer[1] = 239;
2938  Layer[2] = 323;
2939  Layer[3] = 459;
2940  Layer[4] = 575;
2941  Layer[5] = 727;
2942  Layer[6] = 891;
2943  Layer[7] = 1059;
2944  }
2945 
2946  // Ellipsoid 8 layer
2947  else
2948  {
2949  Layer[0] = 115;
2950  Layer[1] = 219;
2951  Layer[2] = 335;
2952  Layer[3] = 459;
2953  Layer[4] = 607;
2954  Layer[5] = 767;
2955  Layer[6] = 951;
2956  Layer[7] = 1155;
2957  }
2958  }
2959 
2960  if (CloakNlayer == 16)
2961  {
2962  // Circular 16 layer
2963  if (fabs(la * lb - 1.0) < 0.0001)
2964  {
2965  Layer[0] = 43;
2966  Layer[1] = 87;
2967  Layer[2] = 135;
2968  Layer[3] = 187;
2969  Layer[4] = 239;
2970  Layer[5] = 295;
2971  Layer[6] = 355;
2972  Layer[7] = 415;
2973  Layer[8] = 479;
2974  Layer[9] = 555;
2975  Layer[10] = 639;
2976  Layer[11] = 727;
2977  Layer[12] = 823;
2978  Layer[13] = 927;
2979  Layer[14] = 1039;
2980  Layer[15] = 1159;
2981  }
2982 
2983  // Ellipsoid 8 layer
2984  else
2985  {
2986  Layer[0] = 135;
2987  Layer[1] = 259;
2988  Layer[2] = 387;
2989  Layer[3] = 523;
2990  Layer[4] = 667;
2991  Layer[5] = 803;
2992  Layer[6] = 939;
2993  Layer[7] = 1083;
2994  Layer[8] = 1235;
2995  Layer[9] = 1387;
2996  Layer[10] = 1539;
2997  Layer[11] = 1699;
2998  Layer[12] = 1867;
2999  Layer[13] = 2035;
3000  Layer[14] = 2203;
3001  Layer[15] = 2379;
3002  }
3003  }
3004 
3005  Array<OneD, NekDouble> x0(nq);
3006  Array<OneD, NekDouble> x1(nq);
3007  Array<OneD, NekDouble> x2(nq);
3008 
3009  m_fields[0]->GetCoords(x0, x1, x2);
3010 
3011  Array<OneD, NekDouble> Formertmp(nq, 0.0);
3012  Array<OneD, NekDouble> Currenttmp(nq, 0.0);
3013  Array<OneD, NekDouble> Cloakregion(nq, 0.0);
3014 
3015  m_fields[0]->GenerateElementVector(Layer[0], 1.0, 0.0, Currenttmp);
3016  Vmath::Vcopy(nq, Currenttmp, 1, Cloakregion, 1);
3017  for (int i = 1; i < CloakNlayer; ++i)
3018  {
3019  m_fields[0]->GenerateElementVector(Layer[i], 1.0, 0.0, Currenttmp);
3020  m_fields[0]->GenerateElementVector(Layer[i - 1], 1.0, 0.0, Formertmp);
3021 
3022  Vmath::Vsub(nq, Currenttmp, 1, Formertmp, 1, Currenttmp, 1);
3023 
3024  Vmath::Svtvp(nq, 1.0 * (i + 1), Currenttmp, 1, Cloakregion, 1,
3025  Cloakregion, 1);
3026  }
3027 
3028  Array<OneD, NekDouble> radvec(nq);
3029 
3030  for (int i = 0; i < nq; ++i)
3031  {
3032  switch (m_MMFdir)
3033  {
3035  {
3036  if ((Cloakregion[i] > 0) && (CloakNlayer > 0))
3037  {
3038  radvec[i] =
3039  1.0 +
3040  (m_b - m_a) / CloakNlayer * (Cloakregion[i] - 0.5);
3041  }
3042 
3043  else
3044  {
3045  radvec[i] =
3046  sqrt(x0[i] * x0[i] / la / la + x1[i] * x1[i] / lb / lb);
3047  }
3048  }
3049  break;
3050 
3052  {
3053  radvec[i] = sqrt(2.0 * x0[i] * x0[i] +
3054  x1[i] * x1[i] * x1[i] * x1[i] + x1[i] * x1[i]);
3055  }
3056  break;
3057 
3059  {
3060  radvec[i] = sqrt(3.0 * x0[i] * x0[i] +
3061  x1[i] * x1[i] * x1[i] * x1[i] - x1[i] * x1[i]);
3062  }
3063  break;
3064 
3065  default:
3066  break;
3067  }
3068  }
3069 
3070  return radvec;
3071 }
Circular around the centre of domain.
void Svtvp(int n, const T alpha, const T *x, const int incx, const T *y, const int incy, T *z, const int incz)
svtvp (scalar times vector plus vector): z = alpha*x + y
Definition: Vmath.cpp:488
Circular around the centre of domain.
double NekDouble
Array< OneD, NekDouble > m_MMFfactors
Definition: MMFSystem.h:154
void Vsub(int n, const T *x, const int incx, const T *y, const int incy, T *z, const int incz)
Subtract vector z = x-y.
Definition: Vmath.cpp:346
SOLVER_UTILS_EXPORT int GetNpoints()
Array< OneD, MultiRegions::ExpListSharedPtr > m_fields
Array holding all dependent variables.
Circular around the centre of domain.
void Vcopy(int n, const T *x, const int incx, T *y, const int incy)
Definition: Vmath.cpp:1064
SpatialDomains::GeomMMF m_MMFdir
Definition: MMFSystem.h:216

◆ ComputeSurfaceCurrent()

Array< OneD, NekDouble > Nektar::MMFMaxwell::ComputeSurfaceCurrent ( const int  time,
const Array< OneD, const Array< OneD, NekDouble >> &  fields 
)
protected

Definition at line 1986 of file MMFMaxwell.cpp.

References Nektar::SolverUtils::eTransElectric, Nektar::SolverUtils::eTransMagnetic, Nektar::SolverUtils::MMFSystem::GetIncidentField(), Nektar::SolverUtils::EquationSystem::GetTraceTotPoints(), Nektar::SolverUtils::EquationSystem::m_fields, Nektar::SolverUtils::MMFSystem::m_ntimesMFFwd, Nektar::SolverUtils::MMFSystem::m_PolType, Vmath::Vadd(), and Vmath::Vvtvp().

Referenced by Printout_SurfaceCurrent().

1988 {
1989  int nq = m_fields[0]->GetTotPoints();
1990  int nTraceNumPoints = GetTraceTotPoints();
1991 
1992  Array<OneD, NekDouble> outfield(nTraceNumPoints, 0.0);
1993 
1994  switch (m_PolType)
1995  {
1996  // (n \times H^r)_z = H1r (n \times e^1)_z + H2r (n \times e^2)_z,
1998  {
1999  Array<OneD, NekDouble> tmp(nq);
2000  Array<OneD, NekDouble> tmpFwd(nTraceNumPoints);
2001 
2002  for (int i = 0; i < 2; i++)
2003  {
2004  tmp = GetIncidentField(i, time);
2005  Vmath::Vadd(nq, fields[i], 1, tmp, 1, tmp, 1);
2006 
2007  m_fields[0]->ExtractTracePhys(tmp, tmpFwd);
2008  Vmath::Vvtvp(nTraceNumPoints, &m_ntimesMFFwd[i][2][0], 1,
2009  &tmpFwd[0], 1, &outfield[0], 1, &outfield[0], 1);
2010  }
2011  }
2012  break;
2013 
2015  {
2016  Array<OneD, NekDouble> tmp(nq);
2017 
2018  tmp = GetIncidentField(2, time);
2019  Vmath::Vadd(nq, fields[2], 1, tmp, 1, tmp, 1);
2020  m_fields[0]->ExtractTracePhys(tmp, outfield);
2021  }
2022  break;
2023 
2024  default:
2025  break;
2026  }
2027 
2028  return outfield;
2029 }
SOLVER_UTILS_EXPORT Array< OneD, NekDouble > GetIncidentField(const int var, const NekDouble time)
Definition: MMFSystem.cpp:2034
void Vvtvp(int n, const T *w, const int incw, const T *x, const int incx, const T *y, const int incy, T *z, const int incz)
vvtvp (vector times vector plus vector): z = w*x + y
Definition: Vmath.cpp:445
SOLVER_UTILS_EXPORT int GetTraceTotPoints()
Array< OneD, MultiRegions::ExpListSharedPtr > m_fields
Array holding all dependent variables.
Array< OneD, Array< OneD, Array< OneD, NekDouble > > > m_ntimesMFFwd
Definition: MMFSystem.h:196
void Vadd(int n, const T *x, const int incx, const T *y, const int incy, T *z, const int incz)
Add vector z = x+y.
Definition: Vmath.cpp:302

◆ create()

static SolverUtils::EquationSystemSharedPtr Nektar::MMFMaxwell::create ( const LibUtilities::SessionReaderSharedPtr pSession,
const SpatialDomains::MeshGraphSharedPtr pGraph 
)
inlinestatic

Creates an instance of this class.

Definition at line 81 of file MMFMaxwell.h.

References Nektar::MemoryManager< DataType >::AllocateSharedPtr(), and CellMLToNektar.cellml_metadata::p.

84  {
87  p->InitObject();
88  return p;
89  }
static std::shared_ptr< DataType > AllocateSharedPtr(const Args &...args)
Allocate a shared pointer from the memory pool.
std::shared_ptr< EquationSystem > EquationSystemSharedPtr
A shared pointer to an EquationSystem object.

◆ DoOdeProjection()

void Nektar::MMFMaxwell::DoOdeProjection ( const Array< OneD, const Array< OneD, NekDouble >> &  inarray,
Array< OneD, Array< OneD, NekDouble >> &  outarray,
const NekDouble  time 
)
protected

Compute the projection.

Compute the projection for the linear advection equation.

Parameters
inarrayGiven fields.
outarrayCalculated solution.
timeTime.

Definition at line 1323 of file MMFMaxwell.cpp.

References Nektar::SolverUtils::EquationSystem::GetNpoints(), and Vmath::Vcopy().

Referenced by v_InitObject().

1326 {
1327  boost::ignore_unused(time);
1328 
1329  int var = inarray.num_elements();
1330 
1331  // SetBoundaryConditions(time);
1332 
1333  int nq = GetNpoints();
1334  for (int i = 0; i < var; ++i)
1335  {
1336  Vmath::Vcopy(nq, inarray[i], 1, outarray[i], 1);
1337  }
1338 }
SOLVER_UTILS_EXPORT int GetNpoints()
void Vcopy(int n, const T *x, const int incx, T *y, const int incy)
Definition: Vmath.cpp:1064

◆ DoOdeRhs()

void Nektar::MMFMaxwell::DoOdeRhs ( const Array< OneD, const Array< OneD, NekDouble >> &  inarray,
Array< OneD, Array< OneD, NekDouble >> &  outarray,
const NekDouble  time 
)
protected

Compute the RHS.

Compute the right-hand side for the linear advection equation.

Parameters
inarrayGiven fields.
outarrayCalculated solution.
timeTime.

Definition at line 892 of file MMFMaxwell.cpp.

References AddCoriolis(), Nektar::SolverUtils::MMFSystem::AdddedtMaxwell(), AddGreenDerivCompensate(), AddPML(), Nektar::SolverUtils::eMaxwell1D, Nektar::SolverUtils::eMaxwellSphere, Nektar::SolverUtils::eScatField2D, Nektar::SolverUtils::eTestMaxwell2DPEC, Nektar::SolverUtils::eTestMaxwell2DPECAVGFLUX, Nektar::SolverUtils::eTotField2D, Nektar::SolverUtils::eTransElectric, Nektar::SolverUtils::eTransMagnetic, Nektar::SolverUtils::MMFSystem::GetIncidentField(), Nektar::SolverUtils::EquationSystem::GetNcoeffs(), Nektar::SolverUtils::EquationSystem::GetTotPoints(), m_AddPML, m_AddRotation, m_DispersiveCloak, m_ElemtGroup1, Nektar::SolverUtils::MMFSystem::m_epsvec, Nektar::SolverUtils::EquationSystem::m_fields, m_freq, Nektar::SolverUtils::MMFSystem::m_muvec, Nektar::SolverUtils::MMFSystem::m_negepsvecminus1, Nektar::SolverUtils::MMFSystem::m_negmuvecminus1, Nektar::SolverUtils::MMFSystem::m_PolType, Nektar::SolverUtils::MMFSystem::m_TestMaxwellType, m_wp2, TestMaxwell2DPEC(), TestMaxwellSphere(), Vmath::Vadd(), Vmath::Vcopy(), Vmath::Vdiv(), Vmath::Vmul(), Vmath::Vsub(), Vmath::Vvtvp(), and WeakDGMaxwellDirDeriv().

Referenced by v_InitObject().

895 {
896  int i;
897  int nvar = inarray.num_elements();
898  int ncoeffs = GetNcoeffs();
899  int nq = GetTotPoints();
900 
901  Array<OneD, Array<OneD, NekDouble>> physarray(nvar);
902  Array<OneD, Array<OneD, NekDouble>> modarray(nvar);
903  for (i = 0; i < nvar; ++i)
904  {
905  physarray[i] = Array<OneD, NekDouble>(nq);
906  modarray[i] = Array<OneD, NekDouble>(ncoeffs, 0.0);
907 
908  Vmath::Vcopy(nq, &inarray[i][0], 1, &physarray[i][0], 1);
909  }
910 
911  for (i = 0; i < nvar; i++)
912  {
913  m_fields[i]->SetPhysState(true);
914  }
915 
916  // Compute Curl
917  switch (m_TestMaxwellType)
918  {
921 
922  {
923 
924  // Imaginary part is computed the same as Real part
925  Array<OneD, Array<OneD, NekDouble>> tmpin(3);
926  Array<OneD, Array<OneD, NekDouble>> tmpout(3);
927 
928  for (int i = 0; i < 3; ++i)
929  {
930  tmpin[i] = Array<OneD, NekDouble>(nq);
931  tmpout[i] = Array<OneD, NekDouble>(ncoeffs, 0.0);
932 
933  Vmath::Vcopy(nq, &physarray[i][0], 1, &tmpin[i][0], 1);
934  }
935 
936  WeakDGMaxwellDirDeriv(tmpin, tmpout, time);
937  AddGreenDerivCompensate(tmpin, tmpout);
938 
939  for (int i = 0; i < 3; ++i)
940  {
941  // For E and H
942  Vmath::Vcopy(ncoeffs, &tmpout[i][0], 1, &modarray[i][0], 1);
943  }
944  }
945  break;
946 
947  default:
948  {
949 
950  WeakDGMaxwellDirDeriv(physarray, modarray, time);
951  AddGreenDerivCompensate(physarray, modarray);
952  }
953  break;
954  }
955 
956  for (i = 0; i < nvar; ++i)
957  {
958  m_fields[i]->MultiplyByElmtInvMass(modarray[i], modarray[i]);
959  m_fields[i]->BwdTrans(modarray[i], outarray[i]);
960  }
961 
963  {
964  Array<OneD, NekDouble> F(nq);
965  for (int j = 0; j < 2; ++j)
966  {
967  F = TestMaxwellSphere(time, m_freq, 3 + j);
968  Vmath::Vadd(nq, &F[0], 1, &outarray[j][0], 1, &outarray[j][0], 1);
969  }
970  }
971 
972  // Add Absorbing Boundary Conditions
973  if (m_AddPML > 0)
974  {
975  AddPML(physarray, outarray);
976  }
977 
978  // Add dedt component
979  if (m_AddRotation)
980  {
981  AddCoriolis(physarray, outarray);
982  AdddedtMaxwell(physarray, outarray);
983  }
984 
985  // Divide it by varepsilon or mu
986  Array<OneD, NekDouble> dFdt(nq, 0.0);
987  switch (m_TestMaxwellType)
988  {
990  {
991  Vmath::Vdiv(nq, outarray[0], 1, m_epsvec[0], 1, outarray[0], 1);
992  Vmath::Vdiv(nq, outarray[1], 1, m_muvec[0], 1, outarray[1], 1);
993  }
994  break;
995 
996  // TO BE CHANGED
998  {
999  Array<OneD, NekDouble> Hxdt(nq, 0.0);
1000  Array<OneD, NekDouble> Hydt(nq, 0.0);
1001 
1002  Hxdt = TestMaxwell2DPEC(time, 10, m_PolType);
1003  Hydt = TestMaxwell2DPEC(time, 11, m_PolType);
1004 
1005  Array<OneD, NekDouble> x0(nq);
1006  Array<OneD, NekDouble> x1(nq);
1007  Array<OneD, NekDouble> x2(nq);
1008 
1009  m_fields[0]->GetCoords(x0, x1, x2);
1010 
1011  NekDouble theta, tmpx, tmpy;
1012  NekDouble uxx, uxy, uyy, detu, uti, uri;
1013  Array<OneD, NekDouble> utvec(nq, 1.0);
1014  Array<OneD, NekDouble> urvec(nq, 1.0);
1015  Array<OneD, NekDouble> tmpIN(nq);
1016 
1017  // Case I: ut = 4.0, ur = 0.5
1018  // NekDouble ut=4.0;
1019  // NekDouble ur=0.5;
1020 
1021  // m_fields[0]->GenerateElementVector(m_ElemtGroup1, ut, 1.0,
1022  // utvec);
1023  // m_fields[0]->GenerateElementVector(m_ElemtGroup1, ur, 1.0,
1024  // urvec);
1025 
1026  // Case II: ut = 0.5, ur = 1 - 2x^2
1027  NekDouble ut = 0.5;
1028  m_fields[0]->GenerateElementVector(m_ElemtGroup1, ut, 1.0, utvec);
1029 
1030  m_fields[0]->GenerateElementVector(m_ElemtGroup1, 1.0, 0.0, tmpIN);
1031 
1032  for (int i = 0; i < nq; i++)
1033  {
1034  urvec[i] =
1035  tmpIN[i] * (1.0 - 2 * x0[i] * x0[i]) + (1.0 - tmpIN[i]);
1036  }
1037 
1038  for (int i = 0; i < nq; ++i)
1039  {
1040  theta = atan2((x1[i] + 2.0), (x0[i] + 2.0));
1041 
1042  uti = utvec[i];
1043  uri = urvec[i];
1044 
1045  uxx = uti * cos(theta) * cos(theta) +
1046  uri * sin(theta) * sin(theta);
1047  uyy = uti * sin(theta) * sin(theta) +
1048  uri * cos(theta) * cos(theta);
1049  uxy = (uti - uri) * cos(theta) * sin(theta);
1050 
1051  detu = uxx * uyy - uxy * uxy;
1052 
1053  tmpx = outarray[0][i] + (1.0 - uxx) * Hxdt[i] - uxy * Hydt[i];
1054  tmpy = outarray[1][i] - uxy * Hxdt[i] + (1.0 - uyy) * Hydt[i];
1055 
1056  outarray[0][i] = (1 / detu) * (uyy * tmpx - uxy * tmpy);
1057  outarray[1][i] = (1 / detu) * (-uxy * tmpx + uxx * tmpy);
1058  }
1059  }
1060  break;
1061 
1065  {
1066  switch (m_PolType)
1067  {
1069  {
1071  {
1072  dFdt = TestMaxwell2DPEC(time, 10, m_PolType);
1073  Vmath::Vvtvp(nq, m_negmuvecminus1[0], 1, dFdt, 1,
1074  outarray[0], 1, outarray[0], 1);
1075 
1076  dFdt = TestMaxwell2DPEC(time, 11, m_PolType);
1077  Vmath::Vvtvp(nq, m_negmuvecminus1[1], 1, dFdt, 1,
1078  outarray[1], 1, outarray[1], 1);
1079 
1080  dFdt = TestMaxwell2DPEC(time, 12, m_PolType);
1081  Vmath::Vvtvp(nq, m_negepsvecminus1[2], 1, dFdt, 1,
1082  outarray[2], 1, outarray[2], 1);
1083  }
1084 
1086  {
1087  dFdt = GetIncidentField(10, time);
1088  Vmath::Vvtvp(nq, m_negmuvecminus1[0], 1, dFdt, 1,
1089  outarray[0], 1, outarray[0], 1);
1090 
1091  dFdt = GetIncidentField(11, time);
1092  Vmath::Vvtvp(nq, m_negmuvecminus1[1], 1, dFdt, 1,
1093  outarray[1], 1, outarray[1], 1);
1094 
1095  dFdt = GetIncidentField(12, time);
1096  Vmath::Vvtvp(nq, m_negepsvecminus1[2], 1, dFdt, 1,
1097  outarray[2], 1, outarray[2], 1);
1098  }
1099 
1100  Vmath::Vdiv(nq, outarray[0], 1, m_muvec[0], 1, outarray[0],
1101  1);
1102  Vmath::Vdiv(nq, outarray[1], 1, m_muvec[1], 1, outarray[1],
1103  1);
1104  Vmath::Vdiv(nq, outarray[2], 1, m_epsvec[2], 1, outarray[2],
1105  1);
1106  }
1107  break;
1108 
1110  {
1112  {
1113  // (I - \mu^i) d F^{inc} / dt
1114  dFdt = TestMaxwell2DPEC(time, 10, m_PolType);
1115  Vmath::Vvtvp(nq, m_negepsvecminus1[0], 1, dFdt, 1,
1116  outarray[0], 1, outarray[0], 1);
1117 
1118  dFdt = TestMaxwell2DPEC(time, 11, m_PolType);
1119  Vmath::Vvtvp(nq, m_negepsvecminus1[1], 1, dFdt, 1,
1120  outarray[1], 1, outarray[1], 1);
1121 
1122  dFdt = TestMaxwell2DPEC(time, 12, m_PolType);
1123  Vmath::Vvtvp(nq, m_negmuvecminus1[2], 1, dFdt, 1,
1124  outarray[2], 1, outarray[2], 1);
1125  }
1126 
1128  {
1129  dFdt = GetIncidentField(10, time);
1130  Vmath::Vvtvp(nq, m_negepsvecminus1[0], 1, dFdt, 1,
1131  outarray[0], 1, outarray[0], 1);
1132 
1133  // Add - wp^2 \int E_2^{inc}
1134  dFdt = GetIncidentField(21, time);
1135  if (m_DispersiveCloak)
1136  {
1137  Vmath::Vmul(nq, m_wp2, 1, dFdt, 1, dFdt, 1);
1138  Vmath::Vsub(nq, outarray[1], 1, dFdt, 1,
1139  outarray[1], 1);
1140  }
1141 
1142  else
1143  {
1144  Vmath::Vvtvp(nq, m_negepsvecminus1[1], 1, dFdt, 1,
1145  outarray[1], 1, outarray[1], 1);
1146  }
1147 
1148  dFdt = GetIncidentField(12, time);
1149  Vmath::Vvtvp(nq, m_negmuvecminus1[2], 1, dFdt, 1,
1150  outarray[2], 1, outarray[2], 1);
1151  }
1152 
1153  Vmath::Vdiv(nq, outarray[0], 1, m_epsvec[0], 1, outarray[0],
1154  1);
1155  Vmath::Vdiv(nq, outarray[1], 1, m_epsvec[1], 1, outarray[1],
1156  1);
1157  Vmath::Vdiv(nq, outarray[2], 1, m_muvec[2], 1, outarray[2],
1158  1);
1159  }
1160  break;
1161 
1162  default:
1163  break;
1164  }
1165  }
1166  break; // case SolverUtils::eTestMaxwell2DPEC:
1167 
1168  default:
1169  break;
1170 
1171  } // switch(m_TestMaxwellType)
1172 }
Array< OneD, NekDouble > TestMaxwell2DPEC(const NekDouble time, unsigned int field, const SolverUtils::PolType Polarization)
SOLVER_UTILS_EXPORT void AdddedtMaxwell(const Array< OneD, const Array< OneD, NekDouble >> &physarray, Array< OneD, Array< OneD, NekDouble >> &outarray)
Definition: MMFSystem.cpp:1369
SOLVER_UTILS_EXPORT Array< OneD, NekDouble > GetIncidentField(const int var, const NekDouble time)
Definition: MMFSystem.cpp:2034
Array< OneD, NekDouble > m_wp2
Definition: MMFMaxwell.h:117
Array< OneD, Array< OneD, NekDouble > > m_negepsvecminus1
Definition: MMFSystem.h:209
void Vvtvp(int n, const T *w, const int incw, const T *x, const int incx, const T *y, const int incy, T *z, const int incz)
vvtvp (vector times vector plus vector): z = w*x + y
Definition: Vmath.cpp:445
void Vdiv(int n, const T *x, const int incx, const T *y, const int incy, T *z, const int incz)
Multiply vector z = x/y.
Definition: Vmath.cpp:244
void AddPML(const Array< OneD, const Array< OneD, NekDouble >> &physarray, Array< OneD, Array< OneD, NekDouble >> &outarray)
Array< OneD, Array< OneD, NekDouble > > m_epsvec
Definition: MMFSystem.h:206
SOLVER_UTILS_EXPORT int GetTotPoints()
TestMaxwellType m_TestMaxwellType
Definition: MMFSystem.h:150
Array< OneD, Array< OneD, NekDouble > > m_muvec
Definition: MMFSystem.h:207
double NekDouble
NekDouble m_freq
Definition: MMFMaxwell.h:129
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 .
Array< OneD, Array< OneD, NekDouble > > m_negmuvecminus1
Definition: MMFSystem.h:210
void Vsub(int n, const T *x, const int incx, const T *y, const int incy, T *z, const int incz)
Subtract vector z = x-y.
Definition: Vmath.cpp:346
void AddCoriolis(Array< OneD, Array< OneD, NekDouble >> &physarray, Array< OneD, Array< OneD, NekDouble >> &outarray)
Array< OneD, MultiRegions::ExpListSharedPtr > m_fields
Array holding all dependent variables.
SOLVER_UTILS_EXPORT int GetNcoeffs()
void Vcopy(int n, const T *x, const int incx, T *y, const int incy)
Definition: Vmath.cpp:1064
void Vadd(int n, const T *x, const int incx, const T *y, const int incy, T *z, const int incz)
Add vector z = x+y.
Definition: Vmath.cpp:302
void Vmul(int n, const T *x, const int incx, const T *y, const int incy, T *z, const int incz)
Multiply vector z = x*y.
Definition: Vmath.cpp:186
Array< OneD, NekDouble > TestMaxwellSphere(const NekDouble time, const NekDouble omega, unsigned int field)
void AddGreenDerivCompensate(const Array< OneD, const Array< OneD, NekDouble >> &physarray, Array< OneD, Array< OneD, NekDouble >> &outarray)

◆ EvaluateCoriolis()

Array< OneD, NekDouble > Nektar::MMFMaxwell::EvaluateCoriolis ( )
protected

Definition at line 2840 of file MMFMaxwell.cpp.

References Nektar::SolverUtils::MMFSystem::CartesianToSpherical(), Nektar::SolverUtils::EquationSystem::GetTotPoints(), and Nektar::SolverUtils::EquationSystem::m_fields.

Referenced by v_InitObject().

2841 {
2842  int nq = GetTotPoints();
2843 
2844  NekDouble m_Omega = 1.5486 * 0.000001;
2845 
2846  NekDouble x0j, x1j, x2j;
2847  NekDouble sin_theta, cos_theta, sin_varphi, cos_varphi;
2848 
2849  Array<OneD, NekDouble> x(nq);
2850  Array<OneD, NekDouble> y(nq);
2851  Array<OneD, NekDouble> z(nq);
2852 
2853  m_fields[0]->GetCoords(x, y, z);
2854 
2855  Array<OneD, NekDouble> outarray(nq, 0.0);
2856  for (int j = 0; j < nq; ++j)
2857  {
2858  x0j = x[j];
2859  x1j = y[j];
2860  x2j = z[j];
2861 
2862  CartesianToSpherical(x0j, x1j, x2j, sin_varphi, cos_varphi, sin_theta,
2863  cos_theta);
2864 
2865  outarray[j] = 2.0 * m_Omega * sin_theta;
2866  }
2867 
2868  return outarray;
2869 }
SOLVER_UTILS_EXPORT int GetTotPoints()
double NekDouble
SOLVER_UTILS_EXPORT void CartesianToSpherical(const NekDouble x0j, const NekDouble x1j, const NekDouble x2j, NekDouble &sin_varphi, NekDouble &cos_varphi, NekDouble &sin_theta, NekDouble &cos_theta)
Definition: MMFSystem.cpp:795
Array< OneD, MultiRegions::ExpListSharedPtr > m_fields
Array holding all dependent variables.

◆ GaussianPulse()

Array< OneD, NekDouble > Nektar::MMFMaxwell::GaussianPulse ( const NekDouble  time,
const NekDouble  Psx,
const NekDouble  Psy,
const NekDouble  Psz,
const NekDouble  Gaussianradius 
)
protected

Definition at line 2803 of file MMFMaxwell.cpp.

References Nektar::SolverUtils::EquationSystem::m_fields, m_PSduration, and Nektar::LibUtilities::rad().

Referenced by v_DoSolve(), and v_SetInitialConditions().

2808 {
2809  int nq = m_fields[0]->GetTotPoints();
2810  int ncoeffs = m_fields[0]->GetNcoeffs();
2811 
2812  Array<OneD, NekDouble> x(nq);
2813  Array<OneD, NekDouble> y(nq);
2814  Array<OneD, NekDouble> z(nq);
2815 
2816  m_fields[0]->GetCoords(x, y, z);
2817 
2818  Array<OneD, NekDouble> outarray(nq, 0.0);
2819  Array<OneD, NekDouble> tmpc(ncoeffs);
2820  NekDouble rad;
2821 
2822  NekDouble SFradius = m_PSduration * 0.1;
2823  NekDouble SmoothFactor =
2824  1.0 / (1.0 + exp(-0.5 * (time - m_PSduration) / SFradius));
2825 
2826  for (int j = 0; j < nq; ++j)
2827  {
2828  rad = sqrt((x[j] - Psx) * (x[j] - Psx) + (y[j] - Psy) * (y[j] - Psy) +
2829  (z[j] - Psz) * (z[j] - Psz));
2830  outarray[j] = SmoothFactor * exp(-1.0 * (rad / Gaussianradius) *
2831  (rad / Gaussianradius));
2832  }
2833 
2834  m_fields[0]->FwdTrans_IterPerExp(outarray, tmpc);
2835  m_fields[0]->BwdTrans(tmpc, outarray);
2836 
2837  return outarray;
2838 }
NekDouble m_PSduration
Definition: MMFMaxwell.h:121
double NekDouble
static NekDouble rad(NekDouble x, NekDouble y)
Definition: Interpreter.cpp:86
Array< OneD, MultiRegions::ExpListSharedPtr > m_fields
Array holding all dependent variables.

◆ GenerateSigmaPML()

void Nektar::MMFMaxwell::GenerateSigmaPML ( const NekDouble  PMLthickness,
const NekDouble  PMLstart,
const NekDouble  PMLmaxsigma,
Array< OneD, Array< OneD, NekDouble >> &  SigmaPML 
)
protected

Definition at line 2031 of file MMFMaxwell.cpp.

References m_AddPML, Nektar::SolverUtils::EquationSystem::m_fields, Nektar::SolverUtils::MMFSystem::m_MMFfactors, m_PMLelement, m_PMLorder, m_RecPML, Nektar::SolverUtils::MMFSystem::m_shapedim, Nektar::LibUtilities::rad(), Vmath::Vmax(), Vmath::Vmin(), and Vmath::Vsub().

Referenced by v_InitObject().

2035 {
2036  int nq = m_fields[0]->GetNpoints();
2037 
2038  // Construct sigmaX and sigmaY for UPML
2039  Array<OneD, NekDouble> x(nq);
2040  Array<OneD, NekDouble> y(nq);
2041  Array<OneD, NekDouble> z(nq);
2042 
2043  m_fields[0]->GetCoords(x, y, z);
2044 
2045  // Construction of SigmaPML
2046  SigmaPML = Array<OneD, Array<OneD, NekDouble>>(m_shapedim);
2047  for (int j = 0; j < m_shapedim; j++)
2048  {
2049  SigmaPML[j] = Array<OneD, NekDouble>(nq, 0.0);
2050  }
2051 
2052  // PML region indicator: [ 0 : curvedPML : RecPML]
2053  // RecPML = [0 : 0 : 1]
2054  // PMLRegion = [0 : 1 : 1], CurvedPML = PMLRegion - RecPML = [0: 1: 0]
2055  Array<OneD, NekDouble> RecPML(nq);
2056  Array<OneD, NekDouble> CurvedPML(nq);
2057  Array<OneD, NekDouble> PMLRegion(nq);
2058  m_fields[0]->GenerateElementVector(m_RecPML, 0.0, 1.0, RecPML);
2059  m_fields[0]->GenerateElementVector(m_PMLelement, 0.0, 1.0, PMLRegion);
2060  Vmath::Vsub(nq, PMLRegion, 1, RecPML, 1, CurvedPML, 1);
2061 
2062  switch (m_AddPML)
2063  {
2064  // RecPML only
2065  case 1:
2066  {
2067  // Rectangular PML
2068  NekDouble xRlayer, xLlayer, yRlayer, yLlayer;
2069 
2070  xRlayer = Vmath::Vmax(nq, x, 1) - PMLthickness;
2071  xLlayer = Vmath::Vmin(nq, x, 1) + PMLthickness;
2072  yRlayer = Vmath::Vmax(nq, y, 1) - PMLthickness;
2073  yLlayer = Vmath::Vmin(nq, y, 1) + PMLthickness;
2074 
2075  NekDouble xd, yd;
2076  for (int i = 0; i < nq; i++)
2077  {
2078  // SimgaPML along e^1
2079  if (x[i] >= xRlayer)
2080  {
2081  xd = (x[i] - xRlayer) / PMLthickness;
2082  }
2083 
2084  else if (x[i] <= xLlayer)
2085  {
2086  xd = (xLlayer - x[i]) / PMLthickness;
2087  }
2088 
2089  else
2090  {
2091  xd = 0.0;
2092  }
2093 
2094  SigmaPML[0][i] = RecPML[i] * PMLmaxsigma * (xd * xd * xd);
2095 
2096  // SigmaPML along e^2
2097  if (y[i] >= yRlayer)
2098  {
2099  yd = (y[i] - yRlayer) / PMLthickness;
2100  }
2101 
2102  else if (y[i] <= yLlayer)
2103  {
2104  yd = (yLlayer - y[i]) / PMLthickness;
2105  }
2106 
2107  else
2108  {
2109  yd = 0.0;
2110  }
2111 
2112  SigmaPML[1][i] = PMLRegion[i] * PMLmaxsigma * (yd * yd * yd);
2113  }
2114  }
2115  break;
2116 
2117  // CurvedPML only
2118  case 2:
2119  {
2120  // Curved PML
2121  NekDouble relrad, rad;
2122  for (int i = 0; i < nq; i++)
2123  {
2124  rad = sqrt(x[i] * x[i] / m_MMFfactors[0] / m_MMFfactors[0] +
2125  y[i] * y[i] / m_MMFfactors[1] / m_MMFfactors[1]);
2126 
2127  if (rad >= PMLstart)
2128  {
2129  relrad = (rad - PMLstart) / PMLthickness;
2130  SigmaPML[1][i] =
2131  PMLRegion[i] * PMLmaxsigma * pow(relrad, m_PMLorder);
2132  }
2133  }
2134  }
2135  break;
2136 
2137  // Slanted PML
2138  case 3:
2139  {
2140  NekDouble relrad, radon, radtw, radth, radfo;
2141  for (int i = 0; i < nq; i++)
2142  {
2143  radon = -1.0 * x[i] + y[i] - 7;
2144  radtw = x[i] + y[i] - 7;
2145  radth = -x[i] - y[i] - 7;
2146  radfo = x[i] - y[i] - 7;
2147 
2148  if (radon >= 0.0)
2149  {
2150  relrad = radon / PMLthickness;
2151  SigmaPML[1][i] =
2152  PMLRegion[i] * PMLmaxsigma * pow(relrad, m_PMLorder);
2153  }
2154 
2155  if (radtw >= 0.0)
2156  {
2157  relrad = radtw / PMLthickness;
2158  SigmaPML[0][i] =
2159  PMLRegion[i] * PMLmaxsigma * pow(relrad, m_PMLorder);
2160  }
2161 
2162  if (radth >= 0.0)
2163  {
2164  relrad = radth / PMLthickness;
2165  SigmaPML[0][i] =
2166  PMLRegion[i] * PMLmaxsigma * pow(relrad, m_PMLorder);
2167  }
2168 
2169  if (radfo >= 0.0)
2170  {
2171  relrad = radfo / PMLthickness;
2172  SigmaPML[1][i] =
2173  PMLRegion[i] * PMLmaxsigma * pow(relrad, m_PMLorder);
2174  }
2175  }
2176  }
2177  break;
2178  }
2179 
2180  std::cout << "*** sigma1 = [ " << Vmath::Vmin(nq, &SigmaPML[0][0], 1)
2181  << " , " << Vmath::Vmax(nq, &SigmaPML[0][0], 1)
2182  << " ] , sigma2 = [ " << Vmath::Vmin(nq, &SigmaPML[1][0], 1)
2183  << " , " << Vmath::Vmax(nq, &SigmaPML[1][0], 1) << " ] "
2184  << std::endl;
2185 }
T Vmax(int n, const T *x, const int incx)
Return the maximum element in x – called vmax to avoid conflict with max.
Definition: Vmath.cpp:782
T Vmin(int n, const T *x, const int incx)
Return the minimum element in x - called vmin to avoid conflict with min.
Definition: Vmath.cpp:874
double NekDouble
Array< OneD, NekDouble > m_MMFfactors
Definition: MMFSystem.h:154
void Vsub(int n, const T *x, const int incx, const T *y, const int incy, T *z, const int incz)
Subtract vector z = x-y.
Definition: Vmath.cpp:346
static NekDouble rad(NekDouble x, NekDouble y)
Definition: Interpreter.cpp:86
Array< OneD, MultiRegions::ExpListSharedPtr > m_fields
Array holding all dependent variables.

◆ print_MMF()

void Nektar::MMFMaxwell::print_MMF ( Array< OneD, Array< OneD, NekDouble >> &  inarray)
protected

Definition at line 3141 of file MMFMaxwell.cpp.

3142 {
3143  int Ntot = inarray.num_elements();
3144 
3145  NekDouble reval = 0.0;
3146  for (int i = 0; i < Ntot; ++i)
3147  {
3148  std::cout << "[" << i << "] = " << inarray[2][i] << std::endl;
3149  // reval = reval + inarray[i]*inarray[i];
3150  }
3151  reval = sqrt(reval / Ntot);
3152 }
double NekDouble

◆ Printout_SurfaceCurrent()

void Nektar::MMFMaxwell::Printout_SurfaceCurrent ( Array< OneD, Array< OneD, NekDouble >> &  fields,
const int  time 
)
protected

Definition at line 1907 of file MMFMaxwell.cpp.

References ComputeSurfaceCurrent(), Nektar::SolverUtils::EquationSystem::GetTraceTotPoints(), m_boundaryforSF, Nektar::SolverUtils::EquationSystem::m_fields, Nektar::SolverUtils::MMFSystem::m_MMFfactors, and Vmath::Vcopy().

Referenced by v_DoSolve().

1909 {
1910  int nq = m_fields[0]->GetTotPoints();
1911  int nTraceNumPoints = GetTraceTotPoints();
1912 
1913  int totbdryexp =
1914  m_fields[0]->GetBndCondExpansions()[m_boundaryforSF]->GetExpSize();
1915  int npts = m_fields[0]
1916  ->GetBndCondExpansions()[m_boundaryforSF]
1917  ->GetExp(0)
1918  ->GetNumPoints(0);
1919  int totnpts = totbdryexp * npts;
1920 
1921  Array<OneD, NekDouble> Jphi(totnpts);
1922  Array<OneD, NekDouble> Jrad(totnpts);
1923  Array<OneD, NekDouble> Jcurrent(totnpts);
1924 
1925  Array<OneD, NekDouble> phiFwd(nTraceNumPoints);
1926  Array<OneD, NekDouble> radFwd(nTraceNumPoints);
1927 
1928  // Compute phiFwd = acos(-x/r) along the trace
1929  Array<OneD, NekDouble> x(nq);
1930  Array<OneD, NekDouble> y(nq);
1931  Array<OneD, NekDouble> z(nq);
1932 
1933  m_fields[0]->GetCoords(x, y, z);
1934 
1935  Array<OneD, NekDouble> xFwd(nTraceNumPoints);
1936  Array<OneD, NekDouble> yFwd(nTraceNumPoints);
1937 
1938  m_fields[0]->ExtractTracePhys(x, xFwd);
1939  m_fields[0]->ExtractTracePhys(y, yFwd);
1940 
1941  for (int i = 0; i < nTraceNumPoints; ++i)
1942  {
1943  radFwd[i] = sqrt(xFwd[i] * xFwd[i] / m_MMFfactors[0] / m_MMFfactors[0] +
1944  yFwd[i] * yFwd[i] / m_MMFfactors[1] / m_MMFfactors[1]);
1945  phiFwd[i] = atan2(yFwd[i] / radFwd[i], -1.0 * xFwd[i] / radFwd[i]);
1946  }
1947 
1948  Array<OneD, NekDouble> ntimesHFwd(nTraceNumPoints);
1949  ntimesHFwd = ComputeSurfaceCurrent(time, fields);
1950 
1951  // The surface for current should be the first boundary
1952  int id2, cnt = 0;
1953  for (int e = 0; e < totbdryexp; ++e)
1954  {
1955  id2 = m_fields[0]->GetTrace()->GetPhys_Offset(
1956  m_fields[0]->GetTraceMap()->GetBndCondCoeffsToGlobalCoeffsMap(cnt +
1957  e));
1958 
1959  Vmath::Vcopy(npts, &phiFwd[id2], 1, &Jphi[e * npts], 1);
1960  Vmath::Vcopy(npts, &radFwd[id2], 1, &Jrad[e * npts], 1);
1961  Vmath::Vcopy(npts, &ntimesHFwd[id2], 1, &Jcurrent[e * npts], 1);
1962  }
1963 
1964  // Vmath::Vmul(totnpts, tmpr, 1, tmpr, 1, Jcurrent, 1);
1965  // Vmath::Vvtvp(totnpts, tmpi, 1, tmpi, 1, Jcurrent, 1, Jcurrent, 1);
1966  // Vmath::Vsqrt(totnpts, Jcurrent, 1, Jcurrent, 1);
1967 
1968  std::cout << "========================================================"
1969  << std::endl;
1970 
1971  std::cout << "phi = " << std::endl;
1972  for (int i = 0; i < totnpts; ++i)
1973  {
1974  std::cout << Jphi[i] << ", ";
1975  }
1976  std::cout << std::endl << std::endl;
1977 
1978  std::cout << "J = " << std::endl;
1979  for (int i = 0; i < totnpts; ++i)
1980  {
1981  std::cout << Jcurrent[i] << ", ";
1982  }
1983  std::cout << std::endl << std::endl;
1984 }
Array< OneD, NekDouble > m_MMFfactors
Definition: MMFSystem.h:154
SOLVER_UTILS_EXPORT int GetTraceTotPoints()
Array< OneD, MultiRegions::ExpListSharedPtr > m_fields
Array holding all dependent variables.
void Vcopy(int n, const T *x, const int incx, T *y, const int incy)
Definition: Vmath.cpp:1064
Array< OneD, NekDouble > ComputeSurfaceCurrent(const int time, const Array< OneD, const Array< OneD, NekDouble >> &fields)

◆ TestMaxwell1D()

Array< OneD, NekDouble > Nektar::MMFMaxwell::TestMaxwell1D ( const NekDouble  time,
unsigned int  field 
)
protected

Definition at line 1471 of file MMFMaxwell.cpp.

References Nektar::SolverUtils::EquationSystem::m_fields, m_n1, m_n2, and Nektar::SolverUtils::MMFSystem::m_pi.

Referenced by v_EvaluateExactSolution(), and v_SetInitialConditions().

1473 {
1474  int nq = m_fields[0]->GetNpoints();
1475 
1476  Array<OneD, NekDouble> x0(nq);
1477  Array<OneD, NekDouble> x1(nq);
1478  Array<OneD, NekDouble> x2(nq);
1479 
1480  m_fields[0]->GetCoords(x0, x1, x2);
1481 
1482  Array<OneD, NekDouble> E(nq);
1483  Array<OneD, NekDouble> H(nq);
1484 
1485  // Derive the frequency \omega
1486  NekDouble omega;
1487  NekDouble Tol = 0.000000001;
1488  if (fabs(m_n1 - m_n2) < Tol)
1489  {
1490  omega = m_pi / m_n1;
1491  }
1492 
1493  else
1494  {
1495  omega = 2.0 * m_pi / m_n2;
1496 
1497  NekDouble newomega, F, Fprime;
1498  for (int i = 0; i < 10000; ++i)
1499  {
1500  F = m_n1 * tan(m_n2 * omega) + m_n2 * tan(m_n1 * omega);
1501  Fprime =
1502  m_n1 * m_n2 * (1.0 / cos(m_n2 * omega) / cos(m_n2 * omega) +
1503  1.0 / cos(m_n1 * omega) / cos(m_n1 * omega));
1504 
1505  newomega = omega - F / Fprime;
1506 
1507  if (fabs(newomega - omega) > Tol)
1508  {
1509  omega = newomega;
1510  }
1511 
1512  else
1513  {
1514  break;
1515  }
1516  }
1517  }
1518 
1519  // Generate A^k and B^k
1520  std::complex<double> im = sqrt(std::complex<double>(-1));
1521  std::complex<double> A1, A2, B1, B2;
1522  std::complex<double> Ak, Bk, nk;
1523  std::complex<double> Ec, Hc;
1524 
1525  A1 = m_n2 * cos(m_n2 * omega) / (m_n1 * cos(m_n1 * omega));
1526  A2 = exp(-1.0 * im * omega * (m_n1 + m_n2));
1527  B1 = A1 * exp(-2.0 * im * m_n1 * omega);
1528  B2 = A2 * exp(2.0 * im * m_n2 * omega);
1529 
1530  for (int i = 0; i < nq; ++i)
1531  {
1532  if (x0[i] > 0)
1533  {
1534  Ak = A2;
1535  Bk = B2;
1536  nk = m_n2;
1537  }
1538 
1539  else
1540  {
1541  Ak = A1;
1542  Bk = B1;
1543  nk = m_n1;
1544  }
1545 
1546  Ec = (Ak * exp(im * nk * omega * x0[i]) -
1547  Bk * exp(-im * nk * omega * x0[i])) *
1548  exp(im * omega * time);
1549  Hc = nk * (Ak * exp(im * nk * omega * x0[i]) +
1550  Bk * exp(-im * nk * omega * x0[i])) *
1551  exp(im * omega * time);
1552 
1553  E[i] = Ec.real();
1554  H[i] = Hc.real();
1555  }
1556 
1557  Array<OneD, NekDouble> outfield;
1558  switch (field)
1559  {
1560  case (0):
1561  {
1562  outfield = E;
1563  }
1564  break;
1565 
1566  case (1):
1567  {
1568  outfield = H;
1569  }
1570  break;
1571  }
1572 
1573  return outfield;
1574 }
double NekDouble
Array< OneD, MultiRegions::ExpListSharedPtr > m_fields
Array holding all dependent variables.

◆ TestMaxwell2DPEC()

Array< OneD, NekDouble > Nektar::MMFMaxwell::TestMaxwell2DPEC ( const NekDouble  time,
unsigned int  field,
const SolverUtils::PolType  Polarization 
)
protected

Definition at line 1576 of file MMFMaxwell.cpp.

References Nektar::SolverUtils::eTransElectric, Nektar::SolverUtils::eTransMagnetic, Nektar::SolverUtils::EquationSystem::m_fields, Nektar::SolverUtils::MMFSystem::m_movingframes, and Nektar::SolverUtils::MMFSystem::m_pi.

Referenced by DoOdeRhs(), v_EvaluateExactSolution(), and v_SetInitialConditions().

1579 {
1580  int nq = m_fields[0]->GetNpoints();
1581 
1582  Array<OneD, NekDouble> x0(nq);
1583  Array<OneD, NekDouble> x1(nq);
1584  Array<OneD, NekDouble> x2(nq);
1585 
1586  m_fields[0]->GetCoords(x0, x1, x2);
1587 
1588  NekDouble freqm = 1.0, freqn = 1.0;
1589  NekDouble omega = m_pi * sqrt(freqm * freqm + freqn * freqn);
1590  NekDouble mpi = freqm * m_pi;
1591  NekDouble npi = freqn * m_pi;
1592 
1593  Array<OneD, NekDouble> F1(nq);
1594  Array<OneD, NekDouble> F2(nq);
1595  Array<OneD, NekDouble> Fz(nq);
1596  Array<OneD, NekDouble> dF1dt(nq);
1597  Array<OneD, NekDouble> dF2dt(nq);
1598  Array<OneD, NekDouble> dFzdt(nq);
1599  NekDouble Fx, Fy, dFxdt, dFydt;
1600 
1601  for (int i = 0; i < nq; ++i)
1602  {
1603  switch (Polarization)
1604  {
1606  {
1607  Fx = -1.0 * (npi / omega) * sin(mpi * x0[i]) *
1608  cos(npi * x1[i]) * sin(omega * time);
1609  Fy = (mpi / omega) * cos(mpi * x0[i]) * sin(npi * x1[i]) *
1610  sin(omega * time);
1611 
1612  F1[i] =
1613  Fx * m_movingframes[0][i] + Fy * m_movingframes[0][i + nq];
1614  F2[i] =
1615  Fx * m_movingframes[1][i] + Fy * m_movingframes[1][i + nq];
1616  Fz[i] = sin(mpi * x0[i]) * sin(npi * x1[i]) * cos(omega * time);
1617 
1618  dFxdt = (npi)*sin(mpi * x0[i]) * cos(npi * x1[i]) *
1619  cos(omega * time);
1620  dFydt = -1.0 * (mpi)*cos(mpi * x0[i]) * sin(npi * x1[i]) *
1621  cos(omega * time);
1622 
1623  dF1dt[i] = dFxdt * m_movingframes[0][i] +
1624  dFydt * m_movingframes[0][i + nq];
1625  dF2dt[i] = dFxdt * m_movingframes[1][i] +
1626  dFydt * m_movingframes[1][i + nq];
1627  dFzdt[i] = omega * sin(mpi * x0[i]) * sin(npi * x1[i]) *
1628  sin(omega * time);
1629  }
1630  break;
1631 
1633  {
1634  Fx = -1.0 * (npi / omega) * cos(mpi * x0[i]) *
1635  sin(npi * x1[i]) * sin(omega * time);
1636  Fy = (mpi / omega) * sin(mpi * x0[i]) * cos(npi * x1[i]) *
1637  sin(omega * time);
1638 
1639  F1[i] =
1640  Fx * m_movingframes[0][i] + Fy * m_movingframes[0][i + nq];
1641  F2[i] =
1642  Fx * m_movingframes[1][i] + Fy * m_movingframes[1][i + nq];
1643  Fz[i] = cos(mpi * x0[i]) * cos(npi * x1[i]) * cos(omega * time);
1644 
1645  dFxdt = (npi)*cos(mpi * x0[i]) * sin(npi * x1[i]) *
1646  cos(omega * time);
1647  dFydt = -1.0 * (mpi)*sin(mpi * x0[i]) * cos(npi * x1[i]) *
1648  cos(omega * time);
1649 
1650  dF1dt[i] = dFxdt * m_movingframes[0][i] +
1651  dFydt * m_movingframes[0][i + nq];
1652  dF2dt[i] = dFxdt * m_movingframes[1][i] +
1653  dFydt * m_movingframes[1][i + nq];
1654  dFzdt[i] = omega * cos(mpi * x0[i]) * cos(npi * x1[i]) *
1655  sin(omega * time);
1656  }
1657  break;
1658 
1659  default:
1660  break;
1661  }
1662  }
1663 
1664  Array<OneD, NekDouble> outfield;
1665  switch (field)
1666  {
1667  case (0):
1668  {
1669  outfield = F1;
1670  }
1671  break;
1672 
1673  case (1):
1674  {
1675  outfield = F2;
1676  }
1677  break;
1678 
1679  case (2):
1680  {
1681  outfield = Fz;
1682  }
1683  break;
1684 
1685  case (10):
1686  {
1687  outfield = dF1dt;
1688  }
1689  break;
1690 
1691  case (11):
1692  {
1693  outfield = dF2dt;
1694  }
1695  break;
1696 
1697  case (12):
1698  {
1699  outfield = dFzdt;
1700  }
1701  break;
1702  }
1703 
1704  return outfield;
1705 }
Array< OneD, Array< OneD, NekDouble > > m_movingframes
Definition: MMFSystem.h:180
double NekDouble
Array< OneD, MultiRegions::ExpListSharedPtr > m_fields
Array holding all dependent variables.

◆ TestMaxwell2DPMC()

Array< OneD, NekDouble > Nektar::MMFMaxwell::TestMaxwell2DPMC ( const NekDouble  time,
unsigned int  field,
const SolverUtils::PolType  Polarization 
)
protected

Definition at line 1707 of file MMFMaxwell.cpp.

References Nektar::SolverUtils::eTransElectric, Nektar::SolverUtils::eTransMagnetic, Nektar::SolverUtils::EquationSystem::m_fields, Nektar::SolverUtils::MMFSystem::m_movingframes, and Nektar::SolverUtils::MMFSystem::m_pi.

Referenced by v_EvaluateExactSolution(), and v_SetInitialConditions().

1710 {
1711  int nq = m_fields[0]->GetNpoints();
1712 
1713  Array<OneD, NekDouble> x0(nq);
1714  Array<OneD, NekDouble> x1(nq);
1715  Array<OneD, NekDouble> x2(nq);
1716 
1717  m_fields[0]->GetCoords(x0, x1, x2);
1718 
1719  NekDouble freqm = 1.0, freqn = 1.0;
1720  NekDouble omega = m_pi * sqrt(freqm * freqm + freqn * freqn);
1721  NekDouble mpi = freqm * m_pi;
1722  NekDouble npi = freqn * m_pi;
1723 
1724  Array<OneD, NekDouble> F1(nq);
1725  Array<OneD, NekDouble> F2(nq);
1726  Array<OneD, NekDouble> Fz(nq);
1727  NekDouble Fx, Fy;
1728 
1729  for (int i = 0; i < nq; ++i)
1730  {
1731  switch (Polarization)
1732  {
1734  {
1735  Fx = (npi / omega) * cos(mpi * x0[i]) * sin(npi * x1[i]) *
1736  sin(omega * time);
1737  Fy = -(mpi / omega) * sin(mpi * x0[i]) * cos(npi * x1[i]) *
1738  sin(omega * time);
1739 
1740  F1[i] =
1741  Fx * m_movingframes[0][i] + Fy * m_movingframes[0][i + nq];
1742  F2[i] =
1743  Fx * m_movingframes[1][i] + Fy * m_movingframes[1][i + nq];
1744  Fz[i] = cos(mpi * x0[i]) * cos(npi * x1[i]) * cos(omega * time);
1745  }
1746  break;
1747 
1749  {
1750  Fx = (npi / omega) * sin(mpi * x0[i]) * cos(npi * x1[i]) *
1751  sin(omega * time);
1752  Fy = -(mpi / omega) * cos(mpi * x0[i]) * sin(npi * x1[i]) *
1753  sin(omega * time);
1754 
1755  F1[i] =
1756  Fx * m_movingframes[0][i] + Fy * m_movingframes[0][i + nq];
1757  F2[i] =
1758  Fx * m_movingframes[1][i] + Fy * m_movingframes[1][i + nq];
1759  Fz[i] = sin(mpi * x0[i]) * sin(npi * x1[i]) * cos(omega * time);
1760  }
1761  break;
1762 
1763  default:
1764  break;
1765  }
1766  }
1767 
1768  Array<OneD, NekDouble> outfield;
1769  switch (field)
1770  {
1771  case (0):
1772  {
1773  outfield = F1;
1774  }
1775  break;
1776 
1777  case (1):
1778  {
1779  outfield = F2;
1780  }
1781  break;
1782 
1783  case (2):
1784  {
1785  outfield = Fz;
1786  }
1787  break;
1788  }
1789 
1790  return outfield;
1791 }
Array< OneD, Array< OneD, NekDouble > > m_movingframes
Definition: MMFSystem.h:180
double NekDouble
Array< OneD, MultiRegions::ExpListSharedPtr > m_fields
Array holding all dependent variables.

◆ TestMaxwellSphere()

Array< OneD, NekDouble > Nektar::MMFMaxwell::TestMaxwellSphere ( const NekDouble  time,
const NekDouble  omega,
unsigned int  field 
)
protected

Definition at line 1793 of file MMFMaxwell.cpp.

References Nektar::SolverUtils::MMFSystem::CartesianToMovingframes(), Nektar::SolverUtils::MMFSystem::CartesianToSpherical(), Nektar::SolverUtils::EquationSystem::m_fields, Nektar::SolverUtils::EquationSystem::m_spacedim, and Vmath::Smul().

Referenced by DoOdeRhs(), v_EvaluateExactSolution(), and v_SetInitialConditions().

1796 {
1797  int nq = m_fields[0]->GetTotPoints();
1798 
1799  Array<OneD, NekDouble> outfield(nq);
1800 
1801  Array<OneD, NekDouble> x(nq);
1802  Array<OneD, NekDouble> y(nq);
1803  Array<OneD, NekDouble> z(nq);
1804 
1805  m_fields[0]->GetCoords(x, y, z);
1806 
1807  Array<OneD, NekDouble> H1(nq);
1808  Array<OneD, NekDouble> H2(nq);
1809  Array<OneD, NekDouble> E3(nq);
1810  Array<OneD, NekDouble> F1(nq);
1811  Array<OneD, NekDouble> F2(nq);
1812 
1813  Array<OneD, NekDouble> curlv(nq);
1814  Array<OneD, Array<OneD, NekDouble>> velvec(m_spacedim);
1815  Array<OneD, Array<OneD, NekDouble>> Fvec(m_spacedim);
1816  for (int i = 0; i < m_spacedim; ++i)
1817  {
1818  velvec[i] = Array<OneD, NekDouble>(nq, 0.0);
1819  Fvec[i] = Array<OneD, NekDouble>(nq, 0.0);
1820  }
1821 
1822  NekDouble xj, yj, zj, sin_varphi, cos_varphi, sin_theta, cos_theta;
1823  NekDouble vth, vphi, Fth, Fphi;
1824  for (int i = 0; i < nq; i++)
1825  {
1826  xj = x[i];
1827  yj = y[i];
1828  zj = z[i];
1829 
1830  CartesianToSpherical(xj, yj, zj, sin_varphi, cos_varphi, sin_theta,
1831  cos_theta);
1832 
1833  vth = -4.0 * sin_varphi * cos_varphi * cos_theta * cos_theta *
1834  cos_theta * sin_theta;
1835  vphi =
1836  -1.0 * sin_varphi * sin_varphi * cos_theta * cos_theta * cos_theta;
1837  velvec[0][i] = -vth * sin_theta * cos_varphi - vphi * sin_varphi;
1838  velvec[1][i] = -vth * sin_theta * sin_varphi + vphi * cos_varphi;
1839  velvec[2][i] = vth * cos_theta;
1840 
1841  E3[i] = (-4.0 * cos_theta * cos_theta * sin_theta * cos_varphi *
1842  cos_varphi) *
1843  (1.0 / omega * sin(omega * time));
1844 
1845  Fth = -omega * vth -
1846  (8.0 / omega) * cos_theta * sin_theta * cos_varphi * sin_varphi;
1847  Fphi = -omega * vphi +
1848  (4.0 / omega) * cos_varphi * cos_varphi * cos_theta *
1849  (2.0 * sin_theta * sin_theta - cos_theta * cos_theta);
1850  Fvec[0][i] = -Fth * sin_theta * cos_varphi - Fphi * sin_varphi;
1851  Fvec[1][i] = -Fth * sin_theta * sin_varphi + Fphi * cos_varphi;
1852  Fvec[2][i] = Fth * cos_theta;
1853  }
1854 
1855  H1 = CartesianToMovingframes(velvec, 0);
1856  H2 = CartesianToMovingframes(velvec, 1);
1857 
1858  Vmath::Smul(nq, cos(omega * time), H1, 1, H1, 1);
1859  Vmath::Smul(nq, cos(omega * time), H2, 1, H2, 1);
1860 
1861  F1 = CartesianToMovingframes(Fvec, 0);
1862  F2 = CartesianToMovingframes(Fvec, 1);
1863 
1864  Vmath::Smul(nq, sin(omega * time), F1, 1, F1, 1);
1865  Vmath::Smul(nq, sin(omega * time), F2, 1, F2, 1);
1866 
1867  switch (field)
1868  {
1869  // return H1
1870  case 0:
1871  {
1872  outfield = H1;
1873  }
1874  break;
1875 
1876  case 1:
1877  {
1878  outfield = H2;
1879  }
1880  break;
1881 
1882  case 2:
1883  {
1884  outfield = E3;
1885  }
1886  break;
1887 
1888  case 3:
1889  {
1890  outfield = F1;
1891  }
1892  break;
1893 
1894  case 4:
1895  {
1896  outfield = F2;
1897  }
1898  break;
1899 
1900  default:
1901  break;
1902  }
1903 
1904  return outfield;
1905 }
void Smul(int n, const T alpha, const T *x, const int incx, T *y, const int incy)
Scalar multiply y = alpha*y.
Definition: Vmath.cpp:216
SOLVER_UTILS_EXPORT Array< OneD, NekDouble > CartesianToMovingframes(const Array< OneD, const Array< OneD, NekDouble >> &uvec, unsigned int field)
Definition: MMFSystem.cpp:774
int m_spacedim
Spatial dimension (>= expansion dim).
double NekDouble
SOLVER_UTILS_EXPORT void CartesianToSpherical(const NekDouble x0j, const NekDouble x1j, const NekDouble x2j, NekDouble &sin_varphi, NekDouble &cos_varphi, NekDouble &sin_theta, NekDouble &cos_theta)
Definition: MMFSystem.cpp:795
Array< OneD, MultiRegions::ExpListSharedPtr > m_fields
Array holding all dependent variables.

◆ v_DoSolve()

void Nektar::MMFMaxwell::v_DoSolve ( void  )
virtual

Solves an unsteady problem.

Initialises the time integration scheme (as specified in the session file), and perform the time integration.

Reimplemented from Nektar::SolverUtils::UnsteadySystem.

Definition at line 447 of file MMFMaxwell.cpp.

References ASSERTL0, Checkpoint_EDFluxOutput(), Checkpoint_EnergyOutput(), Nektar::SolverUtils::EquationSystem::Checkpoint_Output(), Checkpoint_PlotOutput(), Checkpoint_TotalFieldOutput(), Checkpoint_TotPlotOutput(), ComputeEnergyDensity(), ePlanarSource, ePointSource, Nektar::SolverUtils::eScatField2D, GaussianPulse(), Nektar::SolverUtils::MMFSystem::GetIncidentField(), Nektar::SolverUtils::EquationSystem::GetTotPoints(), Nektar::SolverUtils::EquationSystem::GetTraceNpoints(), Nektar::NekConstants::kNekZeroTol, Nektar::SolverUtils::EquationSystem::m_checksteps, Nektar::SolverUtils::EquationSystem::m_checktime, Nektar::SolverUtils::EquationSystem::m_fields, Nektar::SolverUtils::EquationSystem::m_fintime, m_Gaussianradius, Nektar::SolverUtils::UnsteadySystem::m_infosteps, Nektar::SolverUtils::UnsteadySystem::m_intScheme, Nektar::SolverUtils::UnsteadySystem::m_intSoln, Nektar::SolverUtils::UnsteadySystem::m_intVariables, Nektar::SolverUtils::UnsteadySystem::m_ode, m_PrintoutSurfaceCurrent, m_PSduration, m_Psx, m_Psy, m_Psz, Nektar::SolverUtils::EquationSystem::m_session, m_SourceType, m_SourceVector, Nektar::SolverUtils::EquationSystem::m_steps, Nektar::SolverUtils::MMFSystem::m_TestMaxwellType, m_TestPML, Nektar::SolverUtils::EquationSystem::m_time, Nektar::SolverUtils::EquationSystem::m_timestep, Printout_SurfaceCurrent(), Nektar::LibUtilities::rad(), Nektar::SolverUtils::MMFSystem::RootMeanSquare(), Nektar::LibUtilities::Timer::Start(), Nektar::LibUtilities::Timer::Stop(), Nektar::LibUtilities::Timer::TimePerTest(), Vmath::Vadd(), Vmath::Vamax(), Vmath::Vcopy(), and Vmath::Vmul().

448 {
449  ASSERTL0(m_intScheme != 0, "No time integration scheme.");
450 
451  int i, nchk = 1;
452  int nq = GetTotPoints();
453  int nvariables = 0;
454  int nfields = m_fields.num_elements();
455 
456  if (m_intVariables.empty())
457  {
458  for (i = 0; i < nfields; ++i)
459  {
460  m_intVariables.push_back(i);
461  }
462  nvariables = nfields;
463  }
464  else
465  {
466  nvariables = m_intVariables.size();
467  }
468 
469  // Set up wrapper to fields data storage.
470  Array<OneD, Array<OneD, NekDouble>> fields(nvariables);
471  Array<OneD, Array<OneD, NekDouble>> tmp(nvariables);
472 
473  // Order storage to list time-integrated fields first.
474  for (i = 0; i < nvariables; ++i)
475  {
476  fields[i] = m_fields[m_intVariables[i]]->GetPhys();
477  m_fields[m_intVariables[i]]->SetPhysState(false);
478  }
479 
480  // Initialise time integration scheme
481  m_intSoln =
482  m_intScheme->InitializeScheme(m_timestep, fields, m_time, m_ode);
483 
484  // Check uniqueness of checkpoint output
485  ASSERTL0((m_checktime == 0.0 && m_checksteps == 0) ||
486  (m_checktime > 0.0 && m_checksteps == 0) ||
487  (m_checktime == 0.0 && m_checksteps > 0),
488  "Only one of IO_CheckTime and IO_CheckSteps "
489  "should be set!");
490 
491  int Ntot = m_steps / m_checksteps + 1;
492 
493  Array<OneD, NekDouble> TimeSeries(Ntot);
494  Array<OneD, NekDouble> Energy(Ntot);
495 
496  LibUtilities::Timer timer;
497  bool doCheckTime = false;
498  int step = 0;
499  NekDouble intTime = 0.0;
500  NekDouble cpuTime = 0.0;
501  NekDouble elapsed = 0.0;
502 
503  int cntap = 0;
504  Array<OneD, NekDouble> Ezantipod;
505  int indxantipod = 0;
506 
507  switch (m_SourceType)
508  {
509  case ePointSource:
510  {
511  Ezantipod = Array<OneD, NekDouble>(m_steps / m_checksteps);
512 
513  Array<OneD, NekDouble> x(nq);
514  Array<OneD, NekDouble> y(nq);
515  Array<OneD, NekDouble> z(nq);
516 
517  m_fields[0]->GetCoords(x, y, z);
518 
519  NekDouble Tol = 0.000001;
520  NekDouble rad;
521  for (i = 0; i < nq; ++i)
522  {
523  rad = sqrt((x[i] + m_Psx) * (x[i] + m_Psx) +
524  (y[i] + m_Psy) * (y[i] + m_Psy) +
525  (z[i] + m_Psz) * (z[i] + m_Psz));
526  std::cout << "rad" << rad << std::endl;
527  if (rad < Tol)
528  {
529  indxantipod = i;
530  break;
531  }
532  }
533  }
534  break;
535 
536  case ePlanarSource:
537  {
538  m_SourceVector = Array<OneD, NekDouble>(nq, 0.0);
539 
540  Array<OneD, NekDouble> x(nq);
541  Array<OneD, NekDouble> y(nq);
542  Array<OneD, NekDouble> z(nq);
543 
544  m_fields[0]->GetCoords(x, y, z);
545 
546  NekDouble Tol = 0.000001;
547  NekDouble rad;
548  for (i = 0; i < nq; ++i)
549  {
550  rad = sqrt((x[i] - m_Psx) * (x[i] - m_Psx));
551  if (rad < Tol)
552  {
553  m_SourceVector[i] = 1.0;
554  }
555  }
556 
557  std::cout << "*** Area of Planar Source = "
558  << m_fields[0]->PhysIntegral(m_SourceVector) << std::endl;
559  }
560  break;
561 
562  default:
563  break;
564  }
565 
566  int cntpml = 0;
567  int P1indx = 0, P2indx = 0, P3indx = 0;
568  Array<OneD, NekDouble> P1;
569  Array<OneD, NekDouble> P2;
570  Array<OneD, NekDouble> P3;
571  if (m_TestPML)
572  {
573  P1 = Array<OneD, NekDouble>(m_steps / m_checksteps);
574  P2 = Array<OneD, NekDouble>(m_steps / m_checksteps);
575  P3 = Array<OneD, NekDouble>(m_steps / m_checksteps);
576 
577  Array<OneD, NekDouble> x(nq);
578  Array<OneD, NekDouble> y(nq);
579  Array<OneD, NekDouble> z(nq);
580 
581  m_fields[0]->GetCoords(x, y, z);
582 
583  NekDouble Tol = 0.000001;
584  NekDouble rad;
585  for (int i = 0; i < nq; ++i)
586  {
587  rad = sqrt((x[i] + 3.0) * (x[i] + 3.0) + (y[i]) * (y[i]));
588 
589  if (rad < Tol)
590  {
591  P1indx = i;
592  break;
593  }
594  }
595 
596  for (int i = 0; i < nq; ++i)
597  {
598  rad =
599  sqrt((x[i] + 3.0) * (x[i] + 3.0) + (y[i] - 1.5) * (y[i] - 1.5));
600  if (rad < Tol)
601  {
602  P2indx = i;
603  break;
604  }
605  }
606 
607  for (int i = 0; i < nq; ++i)
608  {
609  rad =
610  sqrt((x[i] + 3.0) * (x[i] + 3.0) + (y[i] - 3.0) * (y[i] - 3.0));
611  if (rad < Tol)
612  {
613  P3indx = i;
614  break;
615  }
616  }
617  }
618 
619  int indx;
620  while (step < m_steps || m_time < m_fintime - NekConstants::kNekZeroTol)
621  {
622 
623  timer.Start();
624  fields = m_intScheme->TimeIntegrate(step, m_timestep, m_intSoln, m_ode);
625  timer.Stop();
626 
627  /*std::cout << typeid(m_intSoln->GetValue(0)).name() << std::endl;
628  for (int i=0; i< Ntot; ++i)
629  {
630  std::cout << "[" << i << "] = " << inarray[i] <<std::endl;
631  reval = reval + inarray[i]*inarray[i];
632  }*/
633 
634  m_time += m_timestep;
635  elapsed = timer.TimePerTest(1);
636  intTime += elapsed;
637  cpuTime += elapsed;
638 
639  // Write out status information
640  if (m_session->GetComm()->GetRank() == 0 && !((step + 1) % m_infosteps))
641  {
642  std::cout << "Steps: " << std::setw(8) << std::left << step + 1 << " "
643  << "Time: " << std::setw(12) << std::left << m_time;
644 
645  std::stringstream ss;
646  ss << cpuTime / 60.0 << " min.";
647  std::cout << " CPU Time: " << std::setw(8) << std::left << ss.str()
648  << std::endl;
649 
650  cpuTime = 0.0;
651  }
652 
653  switch (m_SourceType)
654  {
655  case ePointSource:
656  {
657  if (m_time <= m_PSduration)
658  {
659  Array<OneD, NekDouble> Impulse(nq);
660  Impulse = GaussianPulse(m_time, m_Psx, m_Psy, m_Psz,
662  Vmath::Vadd(nq, &Impulse[0], 1,
663  &fields[m_intVariables[2]][0], 1,
664  &fields[m_intVariables[2]][0], 1);
665  }
666  }
667  break;
668 
669  case ePlanarSource:
670  {
671  Array<OneD, NekDouble> Impulse(nq);
672  for (int i = 0; i < 3; ++i)
673  {
674  Impulse = GetIncidentField(i, m_time);
675  Vmath::Vmul(nq, m_SourceVector, 1, Impulse, 1, Impulse, 1);
676  Vmath::Vadd(nq, &Impulse[0], 1,
677  &fields[m_intVariables[i]][0], 1,
678  &fields[m_intVariables[i]][0], 1);
679  }
680  }
681  break;
682 
683  default:
684  break;
685  }
686 
687  // Transform data into coefficient space
688  for (i = 0; i < nvariables; ++i)
689  {
690  m_fields[m_intVariables[i]]->SetPhys(fields[i]);
691  m_fields[m_intVariables[i]]->FwdTrans_IterPerExp(
692  fields[i], m_fields[m_intVariables[i]]->UpdateCoeffs());
693  m_fields[m_intVariables[i]]->SetPhysState(false);
694  }
695  // for (i = 0; i < nq; ++i)
696  // std::cout << m_fields[0][0][i] <<std::endl;
697 
698  // Write out checkpoint files
699  if ((m_checksteps && step && !((step + 1) % m_checksteps)) ||
700  doCheckTime)
701  {
702  indx = (step + 1) / m_checksteps;
703  TimeSeries[indx] = m_time;
704 
706  {
707  Checkpoint_TotalFieldOutput(nchk, m_time, fields);
708  Checkpoint_TotPlotOutput(nchk, m_time, fields);
709  }
710  Checkpoint_PlotOutput(nchk, fields);
711  Checkpoint_EDFluxOutput(nchk, m_time, fields);
712  Checkpoint_EnergyOutput(nchk, m_time, fields);
713  Checkpoint_Output(nchk++);
714 
715  Energy[indx] = ComputeEnergyDensity(fields);
716 
717  std::cout << "|EHr|: F1 = " << RootMeanSquare(fields[0])
718  << ", F2 = " << RootMeanSquare(fields[1])
719  << ", F3 = " << RootMeanSquare(fields[2])
720  << ", Energy = " << Energy[indx] << std::endl;
721  if (nfields > 3)
722  {
723  std::cout << "|DBr|: D1 = " << RootMeanSquare(fields[3])
724  << ", D2 = " << RootMeanSquare(fields[4])
725  << ", D3 = " << RootMeanSquare(fields[5]) << std::endl;
726 
727  int nTraceNumPoints = GetTraceNpoints();
728  int totbdryexp =
729  m_fields[0]->GetBndCondExpansions()[0]->GetExpSize();
730  int npts = m_fields[0]
731  ->GetBndCondExpansions()[0]
732  ->GetExp(0)
733  ->GetNumPoints(0);
734 
735  Array<OneD, NekDouble> x0(nq);
736  Array<OneD, NekDouble> x1(nq);
737  Array<OneD, NekDouble> x2(nq);
738 
739  m_fields[0]->GetCoords(x0, x1, x2);
740 
741  Array<OneD, NekDouble> E1Fwd(nTraceNumPoints);
742  Array<OneD, NekDouble> E2Fwd(nTraceNumPoints);
743  Array<OneD, NekDouble> H3Fwd(nTraceNumPoints);
744 
745  m_fields[0]->ExtractTracePhys(fields[0], E1Fwd);
746  m_fields[0]->ExtractTracePhys(fields[1], E2Fwd);
747  m_fields[0]->ExtractTracePhys(fields[2], H3Fwd);
748 
749  int id2, cnt = 0;
750  NekDouble E1atPECloc, E1atPEC = 0.0;
751  NekDouble E2atPECloc, E2atPEC = 0.0;
752  NekDouble H3atPECloc, H3atPEC = 0.0;
753 
754  Array<OneD, NekDouble> E1Fwdloc(npts);
755  Array<OneD, NekDouble> E2Fwdloc(npts);
756  Array<OneD, NekDouble> H3Fwdloc(npts);
757 
758  for (int e = 0; e < totbdryexp; ++e)
759  {
760  id2 = m_fields[0]->GetTrace()->GetPhys_Offset(
761  m_fields[0]
762  ->GetTraceMap()
763  ->GetBndCondCoeffsToGlobalCoeffsMap(cnt + e));
764 
765  Vmath::Vcopy(npts, &E1Fwd[id2], 1, &E1Fwdloc[0], 1);
766  Vmath::Vcopy(npts, &E2Fwd[id2], 1, &E2Fwdloc[0], 1);
767  Vmath::Vcopy(npts, &H3Fwd[id2], 1, &H3Fwdloc[0], 1);
768 
769  E1atPECloc = Vmath::Vamax(npts, E1Fwdloc, 1);
770  E2atPECloc = Vmath::Vamax(npts, E2Fwdloc, 1);
771  H3atPECloc = Vmath::Vamax(npts, H3Fwdloc, 1);
772 
773  if (E1atPEC < E1atPECloc)
774  {
775  E1atPEC = E1atPECloc;
776  }
777 
778  if (E2atPEC < E2atPECloc)
779  {
780  E2atPEC = E2atPECloc;
781  }
782 
783  if (H3atPEC < H3atPECloc)
784  {
785  H3atPEC = H3atPECloc;
786  }
787  }
788 
789  std::cout << "At PEC, Max. E1 = " << E1atPEC
790  << ", E2 = " << E2atPEC << ", H3 = " << H3atPEC
791  << std::endl;
792  }
793 
794  if (m_SourceType == ePointSource)
795  {
796  Ezantipod[cntap++] = fields[2][indxantipod];
797  }
798 
799  if (m_TestPML)
800  {
801  P1[cntpml] = fields[2][P1indx];
802  P2[cntpml] = fields[2][P2indx];
803  P3[cntpml] = fields[2][P3indx];
804  cntpml++;
805  }
806  doCheckTime = false;
807  }
808 
809  // Step advance
810  ++step;
811  }
812 
813  // Print out summary statistics
814  if (m_session->GetComm()->GetRank() == 0)
815  {
816  std::cout << "Time-integration : " << intTime << "s" << std::endl;
817 
818  std::cout << "TimeSeries = " << std::endl;
819  for (int i = 0; i < m_steps / m_checksteps; ++i)
820  {
821  std::cout << TimeSeries[i] << ", ";
822  }
823  std::cout << std::endl << std::endl;
824 
825  std::cout << "Energy Density = " << std::endl;
826  for (int i = 0; i < m_steps / m_checksteps; ++i)
827  {
828  std::cout << Energy[i] << ", ";
829  }
830  std::cout << std::endl << std::endl;
831 
833  {
834  Printout_SurfaceCurrent(fields, m_time);
835  }
836 
837  if (m_SourceType == ePointSource)
838  {
839  std::cout << "Ez at antipod = " << std::endl;
840  for (int i = 0; i < m_steps / m_checksteps; ++i)
841  {
842  std::cout << Ezantipod[i] << ", ";
843  }
844  std::cout << std::endl << std::endl;
845  }
846 
847  if (m_TestPML)
848  {
849  std::cout << "P1 = " << std::endl;
850  for (int i = 0; i < m_steps / m_checksteps; ++i)
851  {
852  std::cout << P1[i] << ", ";
853  }
854  std::cout << std::endl << std::endl;
855 
856  std::cout << "P2 = " << std::endl;
857  for (int i = 0; i < m_steps / m_checksteps; ++i)
858  {
859  std::cout << P2[i] << ", ";
860  }
861  std::cout << std::endl << std::endl;
862 
863  std::cout << "P3 = " << std::endl;
864  for (int i = 0; i < m_steps / m_checksteps; ++i)
865  {
866  std::cout << P3[i] << ", ";
867  }
868  std::cout << std::endl << std::endl;
869  }
870  }
871 
872  for (i = 0; i < nvariables; ++i)
873  {
874  m_fields[m_intVariables[i]]->SetPhys(fields[i]);
875  m_fields[m_intVariables[i]]->SetPhysState(true);
876  }
877 
878  for (i = 0; i < nvariables; ++i)
879  {
880  m_fields[i]->FwdTrans(m_fields[i]->GetPhys(),
881  m_fields[i]->UpdateCoeffs());
882  }
883 }
NekDouble m_PSduration
Definition: MMFMaxwell.h:121
#define ASSERTL0(condition, msg)
Definition: ErrorUtil.hpp:216
NekDouble m_time
Current time of simulation.
int m_PrintoutSurfaceCurrent
Definition: MMFMaxwell.h:105
LibUtilities::TimeIntegrationSchemeOperators m_ode
The time integration scheme operators to use.
NekDouble m_timestep
Time step size.
SOLVER_UTILS_EXPORT Array< OneD, NekDouble > GetIncidentField(const int var, const NekDouble time)
Definition: MMFSystem.cpp:2034
NekDouble m_Gaussianradius
Definition: MMFMaxwell.h:121
void Checkpoint_TotPlotOutput(const int n, const NekDouble time, const Array< OneD, const Array< OneD, NekDouble >> &fieldphys)
SOLVER_UTILS_EXPORT void Checkpoint_Output(const int n)
Write checkpoint file of m_fields.
void Printout_SurfaceCurrent(Array< OneD, Array< OneD, NekDouble >> &fields, const int time)
NekDouble m_checktime
Time between checkpoints.
int m_checksteps
Number of steps between checkpoints.
Array< OneD, NekDouble > GaussianPulse(const NekDouble time, const NekDouble Psx, const NekDouble Psy, const NekDouble Psz, const NekDouble Gaussianradius)
SOLVER_UTILS_EXPORT int GetTotPoints()
NekDouble m_fintime
Finish time of the simulation.
int m_steps
Number of steps to take.
Array< OneD, NekDouble > m_SourceVector
Definition: MMFMaxwell.h:119
TestMaxwellType m_TestMaxwellType
Definition: MMFSystem.h:150
static const NekDouble kNekZeroTol
void Checkpoint_EnergyOutput(const int n, const NekDouble time, const Array< OneD, const Array< OneD, NekDouble >> &fieldphys)
SOLVER_UTILS_EXPORT NekDouble RootMeanSquare(const Array< OneD, const NekDouble > &inarray)
Definition: MMFSystem.cpp:2367
void Checkpoint_TotalFieldOutput(const int n, const NekDouble time, const Array< OneD, const Array< OneD, NekDouble >> &fieldphys)
double NekDouble
T Vamax(int n, const T *x, const int incx)
Return the maximum absolute element in x called vamax to avoid conflict with max. ...
Definition: Vmath.cpp:828
void Checkpoint_EDFluxOutput(const int n, const NekDouble time, const Array< OneD, const Array< OneD, NekDouble >> &fieldphys)
SourceType m_SourceType
Definition: MMFMaxwell.h:77
static NekDouble rad(NekDouble x, NekDouble y)
Definition: Interpreter.cpp:86
Array< OneD, MultiRegions::ExpListSharedPtr > m_fields
Array holding all dependent variables.
LibUtilities::SessionReaderSharedPtr m_session
The session reader.
SOLVER_UTILS_EXPORT int GetTraceNpoints()
void Checkpoint_PlotOutput(const int n, const Array< OneD, const Array< OneD, NekDouble >> &fieldphys)
LibUtilities::TimeIntegrationWrapperSharedPtr m_intScheme
Wrapper to the time integration scheme.
int m_infosteps
Number of time steps between outputting status information.
NekDouble ComputeEnergyDensity(Array< OneD, Array< OneD, NekDouble >> &fields)
void Vcopy(int n, const T *x, const int incx, T *y, const int incy)
Definition: Vmath.cpp:1064
LibUtilities::TimeIntegrationSolutionSharedPtr m_intSoln
void Vadd(int n, const T *x, const int incx, const T *y, const int incy, T *z, const int incz)
Add vector z = x+y.
Definition: Vmath.cpp:302
void Vmul(int n, const T *x, const int incx, const T *y, const int incy, T *z, const int incz)
Multiply vector z = x*y.
Definition: Vmath.cpp:186

◆ v_EvaluateExactSolution()

void Nektar::MMFMaxwell::v_EvaluateExactSolution ( unsigned int  field,
Array< OneD, NekDouble > &  outfield,
const NekDouble  time 
)
protectedvirtual

Reimplemented from Nektar::SolverUtils::EquationSystem.

Definition at line 1429 of file MMFMaxwell.cpp.

References Nektar::SolverUtils::eMaxwell1D, Nektar::SolverUtils::eMaxwellSphere, Nektar::SolverUtils::eTestMaxwell2DPEC, Nektar::SolverUtils::eTestMaxwell2DPECAVGFLUX, Nektar::SolverUtils::eTestMaxwell2DPMC, Nektar::SolverUtils::EquationSystem::m_fields, m_freq, Nektar::SolverUtils::MMFSystem::m_PolType, Nektar::SolverUtils::MMFSystem::m_TestMaxwellType, TestMaxwell1D(), TestMaxwell2DPEC(), TestMaxwell2DPMC(), and TestMaxwellSphere().

1432 {
1433  int nq = m_fields[0]->GetNpoints();
1434  outfield = Array<OneD, NekDouble>(nq);
1435 
1436  switch (m_TestMaxwellType)
1437  {
1439  {
1440  outfield = TestMaxwell1D(time, field);
1441  }
1442  break;
1443 
1446  {
1447  outfield = TestMaxwell2DPEC(time, field, m_PolType);
1448  }
1449  break;
1450 
1452  {
1453  outfield = TestMaxwell2DPMC(time, field, m_PolType);
1454  }
1455  break;
1456 
1458  {
1459  outfield = TestMaxwellSphere(time, m_freq, field);
1460  }
1461  break;
1462 
1463  default:
1464  {
1465  outfield = Array<OneD, NekDouble>(nq, 0.0);
1466  }
1467  break;
1468  }
1469 }
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)
Array< OneD, NekDouble > TestMaxwell1D(const NekDouble time, unsigned int field)
TestMaxwellType m_TestMaxwellType
Definition: MMFSystem.h:150
NekDouble m_freq
Definition: MMFMaxwell.h:129
Array< OneD, MultiRegions::ExpListSharedPtr > m_fields
Array holding all dependent variables.
Array< OneD, NekDouble > TestMaxwellSphere(const NekDouble time, const NekDouble omega, unsigned int field)

◆ v_GenerateSummary()

void Nektar::MMFMaxwell::v_GenerateSummary ( SolverUtils::SummaryList s)
protectedvirtual

Print Summary.

Reimplemented from Nektar::SolverUtils::MMFSystem.

Definition at line 3073 of file MMFMaxwell.cpp.

References Nektar::SolverUtils::AddSummaryItem(), CloakTypeMap, Nektar::SolverUtils::IncTypeMap, m_AddPML, m_AddRotation, m_boundaryforSF, m_CloakNlayer, m_Cloakraddelta, m_CloakType, m_DispersiveCloak, m_ElemtGroup1, m_Gaussianradius, Nektar::SolverUtils::MMFSystem::m_IncType, m_mu, m_PMLelement, m_PMLmaxsigma, m_PMLorder, m_PMLstart, m_PMLthickness, Nektar::SolverUtils::MMFSystem::m_PolType, m_PSduration, m_Psx, m_Psy, m_Psz, m_RecPML, m_SourceType, Nektar::SolverUtils::MMFSystem::m_TestMaxwellType, m_varepsilon, Nektar::SolverUtils::PolTypeMap, SourceTypeMap, Nektar::SolverUtils::TestMaxwellTypeMap, and Nektar::SolverUtils::MMFSystem::v_GenerateSummary().

3074 {
3077  s, "TestMaxwellType",
3079  SolverUtils::AddSummaryItem(s, "PolType",
3081  SolverUtils::AddSummaryItem(s, "IncType",
3083 
3084  if (m_varepsilon[0] * m_varepsilon[1] * m_varepsilon[2] > 1.0)
3085  {
3086  SolverUtils::AddSummaryItem(s, "varepsilon1", m_varepsilon[0]);
3087  SolverUtils::AddSummaryItem(s, "varepsilon2", m_varepsilon[1]);
3088  SolverUtils::AddSummaryItem(s, "varepsilon3", m_varepsilon[2]);
3089  }
3090 
3091  if (m_mu[0] * m_mu[1] * m_mu[2] > 1.0)
3092  {
3093  SolverUtils::AddSummaryItem(s, "mu1", m_mu[0]);
3094  SolverUtils::AddSummaryItem(s, "mu2", m_mu[1]);
3095  SolverUtils::AddSummaryItem(s, "mu3", m_mu[2]);
3096  }
3097 
3098  if (m_boundaryforSF > 0)
3099  {
3100  SolverUtils::AddSummaryItem(s, "boundarySF", m_boundaryforSF);
3101  }
3102 
3103  if (m_ElemtGroup1 > 0)
3104  {
3105  SolverUtils::AddSummaryItem(s, "CloakNlayer", m_CloakNlayer);
3106  SolverUtils::AddSummaryItem(s, "ElemtGroup1", m_ElemtGroup1);
3107  }
3108 
3109  SolverUtils::AddSummaryItem(s, "AddRotation", m_AddRotation);
3110 
3111  if (m_AddPML > 0)
3112  {
3113  SolverUtils::AddSummaryItem(s, "AddPML", m_AddPML);
3114  SolverUtils::AddSummaryItem(s, "PMLelement", m_PMLelement);
3115  SolverUtils::AddSummaryItem(s, "RecPML", m_RecPML);
3116  SolverUtils::AddSummaryItem(s, "PMLorder", m_PMLorder);
3117  SolverUtils::AddSummaryItem(s, "PMLthickness", m_PMLthickness);
3118  SolverUtils::AddSummaryItem(s, "PMLstart", m_PMLstart);
3119  SolverUtils::AddSummaryItem(s, "PMLmaxsigma", m_PMLmaxsigma);
3120  }
3121 
3122  if (m_SourceType)
3123  {
3124  SolverUtils::AddSummaryItem(s, "SourceType",
3129  SolverUtils::AddSummaryItem(s, "PSduration", m_PSduration);
3130  SolverUtils::AddSummaryItem(s, "Gaussianradius", m_Gaussianradius);
3131  }
3132 
3133  if (m_CloakType)
3134  {
3136  SolverUtils::AddSummaryItem(s, "DispersiveCloak", m_DispersiveCloak);
3137  SolverUtils::AddSummaryItem(s, "CloakNlayer", m_CloakNlayer);
3138  SolverUtils::AddSummaryItem(s, "Cloakraddelta", m_Cloakraddelta);
3139  }
3140 }
NekDouble m_PSduration
Definition: MMFMaxwell.h:121
CloakType m_CloakType
Definition: MMFMaxwell.h:76
NekDouble m_PMLthickness
Definition: MMFMaxwell.h:137
NekDouble m_Gaussianradius
Definition: MMFMaxwell.h:121
const char *const IncTypeMap[]
Definition: MMFSystem.h:135
Array< OneD, NekDouble > m_varepsilon
Definition: MMFMaxwell.h:132
NekDouble m_Cloakraddelta
Definition: MMFMaxwell.h:114
NekDouble m_PMLstart
Definition: MMFMaxwell.h:137
TestMaxwellType m_TestMaxwellType
Definition: MMFSystem.h:150
const char *const TestMaxwellTypeMap[]
Definition: MMFSystem.h:108
void AddSummaryItem(SummaryList &l, const std::string &name, const std::string &value)
Adds a summary item to the summary info list.
Definition: Misc.cpp:49
const char *const PolTypeMap[]
Definition: MMFSystem.h:123
const char *const CloakTypeMap[]
Definition: MMFMaxwell.h:51
NekDouble m_PMLmaxsigma
Definition: MMFMaxwell.h:137
SourceType m_SourceType
Definition: MMFMaxwell.h:77
NekDouble m_CloakNlayer
Definition: MMFMaxwell.h:113
virtual SOLVER_UTILS_EXPORT void v_GenerateSummary(SummaryList &s)
Print a summary of time stepping parameters.
Definition: MMFSystem.cpp:2492
const char *const SourceTypeMap[]
Definition: MMFMaxwell.h:65
Array< OneD, NekDouble > m_mu
Definition: MMFMaxwell.h:133

◆ v_InitObject()

void Nektar::MMFMaxwell::v_InitObject ( )
virtual

Initialise the object.

Initialisation object for the unsteady linear advection equation.

Reimplemented from Nektar::SolverUtils::UnsteadySystem.

Definition at line 63 of file MMFMaxwell.cpp.

References ASSERTL0, CloakTypeMap, Nektar::SolverUtils::MMFSystem::Computedemdxicdote(), ComputeMaterialMicroWaveCloak(), ComputeMaterialOpticalCloak(), ComputeMaterialVector(), Nektar::SolverUtils::MMFSystem::ComputeNtimesMF(), ComputeRadCloak(), Nektar::SolverUtils::MMFSystem::ComputeZimYim(), Nektar::LibUtilities::TimeIntegrationSchemeOperators::DefineOdeRhs(), Nektar::LibUtilities::TimeIntegrationSchemeOperators::DefineProjection(), Nektar::SolverUtils::MMFSystem::DeriveCrossProductMF(), DoOdeProjection(), DoOdeRhs(), eMicroWaveCloak, eOpticalCloak, eOpticalConstCloak, eOpticalDispersiveCloak, Nektar::SolverUtils::eTransElectric, Nektar::SolverUtils::eTransMagnetic, EvaluateCoriolis(), GenerateSigmaPML(), Nektar::SolverUtils::IncTypeMap, m_AddPML, m_AddRotation, m_boundaryforSF, m_CloakNlayer, m_Cloakraddelta, m_CloakType, m_coriolis, m_CrossProductMF, m_DispersiveCloak, m_ElemtGroup0, m_ElemtGroup1, Nektar::SolverUtils::MMFSystem::m_epsvec, Nektar::SolverUtils::UnsteadySystem::m_explicitAdvection, Nektar::SolverUtils::EquationSystem::m_fields, m_freq, m_Gaussianradius, Nektar::SolverUtils::MMFSystem::m_Incfreq, Nektar::SolverUtils::MMFSystem::m_IncType, m_mu, Nektar::SolverUtils::MMFSystem::m_muvec, m_n1, m_n2, m_n3, Nektar::SolverUtils::MMFSystem::m_negepsvecminus1, Nektar::SolverUtils::MMFSystem::m_negmuvecminus1, m_NoInc, Nektar::SolverUtils::UnsteadySystem::m_ode, m_PMLelement, m_PMLmaxsigma, m_PMLorder, m_PMLstart, m_PMLthickness, Nektar::SolverUtils::MMFSystem::m_PolType, m_PrintoutSurfaceCurrent, m_PSduration, m_Psx, m_Psy, m_Psz, m_RecPML, Nektar::SolverUtils::EquationSystem::m_session, m_SigmaPML, m_SourceType, Nektar::SolverUtils::EquationSystem::m_spacedim, Nektar::SolverUtils::MMFSystem::m_TestMaxwellType, m_TestPML, m_varepsilon, m_wp2, m_wp2Tol, Nektar::SolverUtils::MMFSystem::MMFInitObject(), Vmath::Neg(), Nektar::SolverUtils::PolTypeMap, Nektar::SolverUtils::MMFSystem::RootMeanSquare(), Vmath::Sadd(), SIZE_CloakType, Nektar::SolverUtils::SIZE_IncType, Nektar::SolverUtils::SIZE_PolType, SIZE_SourceType, Nektar::SolverUtils::SIZE_TestMaxwellType, Vmath::Smul(), SourceTypeMap, Nektar::SolverUtils::TestMaxwellTypeMap, Nektar::SolverUtils::UnsteadySystem::v_InitObject(), Vmath::Vmax(), and Vmath::Vmin().

64 {
65  // Call to the initialisation object
67 
68  int nq = m_fields[0]->GetNpoints();
69  int shapedim = m_fields[0]->GetShapeDimension();
70 
71  m_session->LoadParameter("ElemtGroup0", m_ElemtGroup0, 0);
72  m_session->LoadParameter("ElemtGroup1", m_ElemtGroup1, 0);
73  m_session->LoadParameter("boundaryforSF", m_boundaryforSF, 0);
74  m_session->LoadParameter("PrintoutSurfaceCurrent", m_PrintoutSurfaceCurrent,
75  0);
76 
77  m_session->LoadParameter("AddRotation", m_AddRotation, 0);
78 
79  m_session->LoadParameter("NoInc", m_NoInc, 0);
80 
81  // PML parameters
82  m_session->LoadParameter("TestPML", m_TestPML, 0);
83  m_session->LoadParameter("PMLelement", m_PMLelement, 0);
84  m_session->LoadParameter("RecPML", m_RecPML, 0);
85 
86  m_session->LoadParameter("AddPML", m_AddPML, 0);
87  if (m_AddPML == 1)
88  {
90  }
91  m_session->LoadParameter("PMLorder", m_PMLorder, 3);
92 
93  m_session->LoadParameter("PMLthickness", m_PMLthickness, 0.0);
94  m_session->LoadParameter("PMLstart", m_PMLstart, 0.0);
95  m_session->LoadParameter("PMLmaxsigma", m_PMLmaxsigma, 100.0);
96 
97  // Point Source parmaters
98  m_session->LoadParameter("Psx", m_Psx, 0.0);
99  m_session->LoadParameter("Psy", m_Psy, 0.0);
100  m_session->LoadParameter("Psz", m_Psz, 0.0);
101  m_session->LoadParameter("PSduration", m_PSduration, 1.0);
102  m_session->LoadParameter("Gaussianradius", m_Gaussianradius, 1.0);
103 
104  // Cloaking parameter
105  m_session->LoadParameter("CloakNlayer", m_CloakNlayer, 5);
106  m_session->LoadParameter("Cloakraddelta", m_Cloakraddelta, 0.0);
107 
108  m_varepsilon = Array<OneD, NekDouble>(m_spacedim);
109  m_session->LoadParameter("varepsilon1", m_varepsilon[0], 1.0);
110  m_session->LoadParameter("varepsilon2", m_varepsilon[1], 1.0);
111  m_session->LoadParameter("varepsilon3", m_varepsilon[2], 1.0);
112  m_n1 = sqrt(m_varepsilon[0]);
113  m_n2 = sqrt(m_varepsilon[1]);
114  m_n3 = sqrt(m_varepsilon[2]);
115 
116  m_mu = Array<OneD, NekDouble>(m_spacedim);
117  m_session->LoadParameter("mu1", m_mu[0], 1.0);
118  m_session->LoadParameter("mu2", m_mu[1], 1.0);
119  m_session->LoadParameter("mu3", m_mu[2], 1.0);
120 
121  Array<OneD, Array<OneD, NekDouble>> Anisotropy(shapedim);
122  for (int j = 0; j < shapedim; ++j)
123  {
124  Anisotropy[j] = Array<OneD, NekDouble>(nq, 1.0);
125  }
126 
127  // Add Rectangular PML
128  MMFSystem::MMFInitObject(Anisotropy, m_RecPML);
129 
130  // Compute the cross producted MF
132 
133  m_session->LoadParameter("Frequency", m_freq, 1.0);
134 
135  // Define TestMaxwellType
136  if (m_session->DefinesSolverInfo("TESTMAXWELLTYPE"))
137  {
138  std::string TestMaxwellTypeStr =
139  m_session->GetSolverInfo("TESTMAXWELLTYPE");
140  for (int i = 0; i < (int)SolverUtils::SIZE_TestMaxwellType; ++i)
141  {
142  if (boost::iequals(SolverUtils::TestMaxwellTypeMap[i],
143  TestMaxwellTypeStr))
144  {
146  break;
147  }
148  }
149  }
150 
151  else
152  {
154  }
155 
156  // Define Polarization
157  if (m_session->DefinesSolverInfo("POLTYPE"))
158  {
159  std::string PolTypeStr = m_session->GetSolverInfo("POLTYPE");
160  for (int i = 0; i < (int)SolverUtils::SIZE_PolType; ++i)
161  {
162  if (boost::iequals(SolverUtils::PolTypeMap[i], PolTypeStr))
163  {
165  break;
166  }
167  }
168  }
169  else
170  {
172  }
173 
174  // Define Incident wave Type
175  if (m_session->DefinesSolverInfo("INCTYPE"))
176  {
177  std::string IncTypeStr = m_session->GetSolverInfo("INCTYPE");
178  for (int i = 0; i < (int)SolverUtils::SIZE_IncType; ++i)
179  {
180  if (boost::iequals(SolverUtils::IncTypeMap[i], IncTypeStr))
181  {
183  break;
184  }
185  }
186  }
187  else
188  {
190  }
191 
192  // Define Cloak Type
193  if (m_session->DefinesSolverInfo("CLOAKTYPE"))
194  {
195  std::string CloakTypeStr = m_session->GetSolverInfo("CLOAKTYPE");
196  for (int i = 0; i < (int)SIZE_CloakType; ++i)
197  {
198  if (boost::iequals(CloakTypeMap[i], CloakTypeStr))
199  {
200  m_CloakType = (CloakType)i;
201  break;
202  }
203  }
204  }
205  else
206  {
207  m_CloakType = (CloakType)0;
208  }
209 
210  // Define Source Type
211  if (m_session->DefinesSolverInfo("SOURCETYPE"))
212  {
213  std::string SourceTypeStr = m_session->GetSolverInfo("SOURCETYPE");
214  for (int i = 0; i < (int)SIZE_SourceType; ++i)
215  {
216  if (boost::iequals(SourceTypeMap[i], SourceTypeStr))
217  {
219  break;
220  }
221  }
222  }
223  else
224  {
226  }
227 
228  // Compute n_timesMFFwd and m_times_timesMFFwd
229  ComputeNtimesMF();
230 
231  // Compute vaepsilon and mu vector (m_epsveci, m_muvec0);
232  m_epsvec = Array<OneD, Array<OneD, NekDouble>>(m_spacedim);
233  m_muvec = Array<OneD, Array<OneD, NekDouble>>(m_spacedim);
234  for (int k = 0; k < m_spacedim; ++k)
235  {
236  m_epsvec[k] = Array<OneD, NekDouble>(nq, 1.0);
237  m_muvec[k] = Array<OneD, NekDouble>(nq, 1.0);
238  }
239 
240  Array<OneD, NekDouble> radvec(nq);
241  m_DispersiveCloak = false;
242  switch (m_CloakType)
243  {
244  case eOpticalCloak:
245  {
246  radvec = ComputeRadCloak();
248  }
249  break;
250 
251  case eOpticalConstCloak:
252  {
253  radvec = ComputeRadCloak(m_CloakNlayer);
255 
256  std::cout << "*** rad = [ " << Vmath::Vmax(nq, radvec, 1) << " , "
257  << Vmath::Vmin(nq, radvec, 1) << " ) " << std::endl;
258  }
259  break;
260 
262  {
263  m_DispersiveCloak = true;
264  m_wp2Tol = 0.01;
265  radvec = ComputeRadCloak();
267 
268  std::cout << "*** rad = [ " << Vmath::Vmax(nq, radvec, 1) << " , "
269  << Vmath::Vmin(nq, radvec, 1) << " ) " << std::endl;
270  std::cout << "*** wp2 = [ " << Vmath::Vmax(nq, m_wp2, 1) << " , "
271  << Vmath::Vmin(nq, m_wp2, 1) << " ) " << std::endl;
272  }
273  break;
274 
275  case eMicroWaveCloak:
276  {
277  radvec = ComputeRadCloak();
279  }
280  break;
281 
282  default:
283  {
285  }
286  break;
287  }
288 
289  NekDouble eps1min, eps1max, eps2min, eps2max, eps3min, eps3max;
290  NekDouble mu1min, mu1max, mu2min, mu2max, mu3min, mu3max;
291 
292  eps1min = Vmath::Vmin(nq, m_epsvec[0], 1);
293  eps3min = Vmath::Vmin(nq, m_epsvec[2], 1);
294  eps1max = Vmath::Vmax(nq, m_epsvec[0], 1);
295  eps3max = Vmath::Vmax(nq, m_epsvec[2], 1);
296 
297  if (m_DispersiveCloak)
298  {
299  Array<OneD, NekDouble> realepsr(nq);
300  Vmath::Sadd(nq, -m_wp2Tol, m_wp2, 1, realepsr, 1);
301  Vmath::Smul(nq, 1.0 / (m_Incfreq * m_Incfreq), realepsr, 1, realepsr,
302  1);
303  Vmath::Neg(nq, realepsr, 1);
304  Vmath::Sadd(nq, 1.0, realepsr, 1, realepsr, 1);
305 
306  eps2min = Vmath::Vmin(nq, realepsr, 1);
307  eps2max = Vmath::Vmax(nq, realepsr, 1);
308  }
309 
310  else
311  {
312  eps2min = Vmath::Vmin(nq, m_epsvec[1], 1);
313  eps2max = Vmath::Vmax(nq, m_epsvec[1], 1);
314  }
315 
316  mu1min = Vmath::Vmin(nq, m_muvec[0], 1);
317  mu2min = Vmath::Vmin(nq, m_muvec[1], 1);
318  mu3min = Vmath::Vmin(nq, m_muvec[2], 1);
319  mu1max = Vmath::Vmax(nq, m_muvec[0], 1);
320  mu2max = Vmath::Vmax(nq, m_muvec[1], 1);
321  mu3max = Vmath::Vmax(nq, m_muvec[2], 1);
322 
323  std::cout << "muvec0 = " << RootMeanSquare(m_muvec[0])
324  << ", muvec1 = " << RootMeanSquare(m_muvec[1]) << std::endl;
325 
326  std::cout << "*** epsvec1 = [ " << eps1min << " , " << eps1max
327  << " ], epsvec2 = [ " << eps2min << " , " << eps2max
328  << " ], epsvec3 = [ " << eps3min << " , " << eps3max << " ] "
329  << std::endl;
330  std::cout << "*** muvec1 = [ " << mu1min << " , " << mu1max
331  << " ], muvec2 = [ " << mu2min << " , " << mu2max
332  << " ], muvec3 = [ " << mu3min << " , " << mu3max << " ] "
333  << std::endl;
334 
335  NekDouble dtFactor;
336  switch (m_PolType)
337  {
338  // eTransMagnetic
340  {
341  dtFactor = mu1min * eps3min;
342  if (mu1min > mu2min)
343  {
344  dtFactor = mu2min * eps3min;
345  }
346  }
347  break;
348 
350  {
351  dtFactor = eps1min * mu3min;
352  if (eps1min > eps2min)
353  {
354  dtFactor = eps2min * mu3min;
355  }
356  }
357  break;
358 
359  default:
360  {
361  dtFactor = 1.0;
362  }
363  break;
364  }
365  std::cout << "*** dt factor proportional to varepsilon * mu is " << dtFactor
366  << std::endl;
367 
368  // Compute m_Zim and m_Yim
370 
371  // Compute m_epsvecminus1 and m_muminus1
372  m_negepsvecminus1 = Array<OneD, Array<OneD, NekDouble>>(m_spacedim);
373  m_negmuvecminus1 = Array<OneD, Array<OneD, NekDouble>>(m_spacedim);
374  for (int k = 0; k < m_spacedim; ++k)
375  {
376  m_negepsvecminus1[k] = Array<OneD, NekDouble>(nq, 0.0);
377  m_negmuvecminus1[k] = Array<OneD, NekDouble>(nq, 0.0);
378 
379  if (!m_NoInc)
380  {
381  Vmath::Sadd(nq, -1.0, m_muvec[k], 1, m_negmuvecminus1[k], 1);
382  Vmath::Sadd(nq, -1.0, m_epsvec[k], 1, m_negepsvecminus1[k], 1);
383 
384  Vmath::Neg(nq, m_negmuvecminus1[k], 1);
385  Vmath::Neg(nq, m_negepsvecminus1[k], 1);
386  }
387  }
388 
389  eps1min = Vmath::Vmin(nq, m_negepsvecminus1[0], 1);
390  eps2min = Vmath::Vmin(nq, m_negepsvecminus1[1], 1);
391  eps3min = Vmath::Vmin(nq, m_negepsvecminus1[2], 1);
392  eps1max = Vmath::Vmax(nq, m_negepsvecminus1[0], 1);
393  eps2max = Vmath::Vmax(nq, m_negepsvecminus1[1], 1);
394  eps3max = Vmath::Vmax(nq, m_negepsvecminus1[2], 1);
395 
396  mu1min = Vmath::Vmin(nq, m_negmuvecminus1[0], 1);
397  mu2min = Vmath::Vmin(nq, m_negmuvecminus1[1], 1);
398  mu3min = Vmath::Vmin(nq, m_negmuvecminus1[2], 1);
399  mu1max = Vmath::Vmax(nq, m_negmuvecminus1[0], 1);
400  mu2max = Vmath::Vmax(nq, m_negmuvecminus1[1], 1);
401  mu3max = Vmath::Vmax(nq, m_negmuvecminus1[2], 1);
402 
403  std::cout << "*** negepsvecminus1 = [ " << eps1min << " , " << eps1max
404  << " ], negepsvecminus1 = [ " << eps2min << " , " << eps2max
405  << " ], negepsvecminus1 = [ " << eps3min << " , " << eps3max
406  << " ] " << std::endl;
407  std::cout << "*** negmuvecminus1 = [ " << mu1min << " , " << mu1max
408  << " ], negmuvecminus1 = [ " << mu2min << " , " << mu2max
409  << " ], negmuvecminus1 = [ " << mu3min << " , " << mu3max << " ] "
410  << std::endl;
411 
412  // Compute de^m/dt \cdot e^k
413  if (m_AddRotation)
414  {
415  m_coriolis = Array<OneD, NekDouble>(nq);
417 
419  }
420 
421  // Generate Sigma Block with thicknes of m_PMLthickness and m_PMLmax
422  if (m_AddPML > 0)
423  {
425  }
426 
427  // If explicit it computes RHS and PROJECTION for the time integration
429  {
432  }
433  // Otherwise it gives an error (no implicit integration)
434  else
435  {
436  ASSERTL0(false, "Implicit unsteady Advection not set up.");
437  }
438 }
NekDouble m_PSduration
Definition: MMFMaxwell.h:121
#define ASSERTL0(condition, msg)
Definition: ErrorUtil.hpp:216
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
Array< OneD, NekDouble > m_coriolis
Definition: MMFMaxwell.h:142
CloakType m_CloakType
Definition: MMFMaxwell.h:76
int m_PrintoutSurfaceCurrent
Definition: MMFMaxwell.h:105
T Vmax(int n, const T *x, const int incx)
Return the maximum element in x – called vmax to avoid conflict with max.
Definition: Vmath.cpp:782
LibUtilities::TimeIntegrationSchemeOperators m_ode
The time integration scheme operators to use.
NekDouble m_PMLthickness
Definition: MMFMaxwell.h:137
Array< OneD, NekDouble > m_wp2
Definition: MMFMaxwell.h:117
Array< OneD, Array< OneD, NekDouble > > m_negepsvecminus1
Definition: MMFSystem.h:209
NekDouble m_Gaussianradius
Definition: MMFMaxwell.h:121
T Vmin(int n, const T *x, const int incx)
Return the minimum element in x - called vmin to avoid conflict with min.
Definition: Vmath.cpp:874
const char *const IncTypeMap[]
Definition: MMFSystem.h:135
SOLVER_UTILS_EXPORT void DeriveCrossProductMF(Array< OneD, Array< OneD, NekDouble >> &CrossProductMF)
Definition: MMFSystem.cpp:571
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)
SOLVER_UTILS_EXPORT void ComputeZimYim(Array< OneD, Array< OneD, NekDouble >> &epsvec, Array< OneD, Array< OneD, NekDouble >> &muvec)
Definition: MMFSystem.cpp:1107
SOLVER_UTILS_EXPORT void Computedemdxicdote()
Definition: MMFSystem.cpp:1279
Array< OneD, Array< OneD, NekDouble > > m_epsvec
Definition: MMFSystem.h:206
Array< OneD, NekDouble > m_varepsilon
Definition: MMFMaxwell.h:132
NekDouble m_Cloakraddelta
Definition: MMFMaxwell.h:114
Array< OneD, Array< OneD, NekDouble > > m_SigmaPML
Definition: MMFMaxwell.h:138
NekDouble m_PMLstart
Definition: MMFMaxwell.h:137
void DefineProjection(FuncPointerT func, ObjectPointerT obj)
TestMaxwellType m_TestMaxwellType
Definition: MMFSystem.h:150
const char *const TestMaxwellTypeMap[]
Definition: MMFSystem.h:108
Array< OneD, Array< OneD, NekDouble > > m_muvec
Definition: MMFSystem.h:207
void Smul(int n, const T alpha, const T *x, const int incx, T *y, const int incy)
Scalar multiply y = alpha*y.
Definition: Vmath.cpp:216
bool m_explicitAdvection
Indicates if explicit or implicit treatment of advection is used.
void DefineOdeRhs(FuncPointerT func, ObjectPointerT obj)
void ComputeMaterialOpticalCloak(const Array< OneD, const NekDouble > &radvec, Array< OneD, Array< OneD, NekDouble >> &epsvec, Array< OneD, Array< OneD, NekDouble >> &muvec, const bool Dispersion=false)
SOLVER_UTILS_EXPORT NekDouble RootMeanSquare(const Array< OneD, const NekDouble > &inarray)
Definition: MMFSystem.cpp:2367
CloakType
Definition: MMFMaxwell.h:41
const char *const PolTypeMap[]
Definition: MMFSystem.h:123
int m_spacedim
Spatial dimension (>= expansion dim).
SOLVER_UTILS_EXPORT void ComputeNtimesMF()
Definition: MMFSystem.cpp:618
void Neg(int n, T *x, const int incx)
Negate x = -x.
Definition: Vmath.cpp:399
double NekDouble
SOLVER_UTILS_EXPORT void MMFInitObject(const Array< OneD, const Array< OneD, NekDouble >> &Anisotropy, const int TangentXelem=-1)
Definition: MMFSystem.cpp:53
virtual SOLVER_UTILS_EXPORT void v_InitObject()
Init object for UnsteadySystem class.
NekDouble m_freq
Definition: MMFMaxwell.h:129
SourceType
Definition: MMFMaxwell.h:57
void Sadd(int n, const T alpha, const T *x, const int incx, T *y, const int incy)
Add vector y = alpha + x.
Definition: Vmath.cpp:318
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)
NekDouble m_wp2Tol
Definition: MMFMaxwell.h:116
NekDouble m_PMLmaxsigma
Definition: MMFMaxwell.h:137
SourceType m_SourceType
Definition: MMFMaxwell.h:77
Array< OneD, Array< OneD, NekDouble > > m_negmuvecminus1
Definition: MMFSystem.h:210
NekDouble m_CloakNlayer
Definition: MMFMaxwell.h:113
Array< OneD, MultiRegions::ExpListSharedPtr > m_fields
Array holding all dependent variables.
LibUtilities::SessionReaderSharedPtr m_session
The session reader.
Array< OneD, Array< OneD, NekDouble > > m_CrossProductMF
Definition: MMFMaxwell.h:123
Array< OneD, NekDouble > ComputeRadCloak(const int Nlayer=5)
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)
Array< OneD, NekDouble > m_mu
Definition: MMFMaxwell.h:133

◆ v_SetInitialConditions()

void Nektar::MMFMaxwell::v_SetInitialConditions ( const NekDouble  initialtime,
bool  dumpInitialConditions,
const int  domain 
)
protectedvirtual

Set the physical fields based on a restart file, or a function describing the initial condition given in the session.

Parameters
initialtimeTime at which to evaluate the function.
dumpInitialConditionsWrite the initial condition to file?

Reimplemented from Nektar::SolverUtils::EquationSystem.

Definition at line 1340 of file MMFMaxwell.cpp.

References Checkpoint_PlotOutput(), Nektar::SolverUtils::eELF2DSurface, Nektar::SolverUtils::eMaxwell1D, Nektar::SolverUtils::eMaxwellSphere, Nektar::SolverUtils::eScatField2D, Nektar::SolverUtils::eTestMaxwell2DPEC, Nektar::SolverUtils::eTestMaxwell2DPECAVGFLUX, Nektar::SolverUtils::eTestMaxwell2DPMC, Nektar::SolverUtils::eTotField2D, GaussianPulse(), Nektar::SolverUtils::EquationSystem::GetTotPoints(), Nektar::SolverUtils::EquationSystem::m_fields, m_freq, m_Gaussianradius, Nektar::SolverUtils::MMFSystem::m_PolType, m_Psx, m_Psy, m_Psz, Nektar::SolverUtils::EquationSystem::m_sessionName, Nektar::SolverUtils::MMFSystem::m_TestMaxwellType, TestMaxwell1D(), TestMaxwell2DPEC(), TestMaxwell2DPMC(), TestMaxwellSphere(), and Nektar::SolverUtils::EquationSystem::WriteFld().

1343 {
1344  boost::ignore_unused(domain);
1345 
1346  int nq = GetTotPoints();
1347  int nvar = m_fields.num_elements();
1348 
1349  switch (m_TestMaxwellType)
1350  {
1352  {
1353  m_fields[0]->SetPhys(TestMaxwell1D(initialtime, 0));
1354  m_fields[1]->SetPhys(TestMaxwell1D(initialtime, 1));
1355  }
1356  break;
1357 
1360  {
1361  m_fields[0]->SetPhys(TestMaxwell2DPEC(initialtime, 0, m_PolType));
1362  m_fields[1]->SetPhys(TestMaxwell2DPEC(initialtime, 1, m_PolType));
1363  m_fields[2]->SetPhys(TestMaxwell2DPEC(initialtime, 2, m_PolType));
1364  }
1365  break;
1366 
1368  {
1369  m_fields[0]->SetPhys(TestMaxwell2DPMC(initialtime, 0, m_PolType));
1370  m_fields[1]->SetPhys(TestMaxwell2DPMC(initialtime, 1, m_PolType));
1371  m_fields[2]->SetPhys(TestMaxwell2DPMC(initialtime, 2, m_PolType));
1372  }
1373  break;
1374 
1377  {
1378  Array<OneD, NekDouble> Zeros(nq, 0.0);
1379 
1380  for (int i = 0; i < nvar; i++)
1381  {
1382  m_fields[i]->SetPhys(Zeros);
1383  }
1384  }
1385  break;
1386 
1388  {
1389  m_fields[0]->SetPhys(TestMaxwellSphere(initialtime, m_freq, 0));
1390  m_fields[1]->SetPhys(TestMaxwellSphere(initialtime, m_freq, 1));
1391  m_fields[2]->SetPhys(TestMaxwellSphere(initialtime, m_freq, 2));
1392  }
1393  break;
1394 
1396  {
1397  m_fields[2]->SetPhys(GaussianPulse(initialtime, m_Psx, m_Psy, m_Psz,
1398  m_Gaussianradius));
1399  }
1400  break;
1401 
1402  default:
1403  break;
1404  }
1405 
1406  // forward transform to fill the modal coeffs
1407  for (int i = 0; i < nvar; ++i)
1408  {
1409  m_fields[i]->SetPhysState(true);
1410  m_fields[i]->FwdTrans(m_fields[i]->GetPhys(),
1411  m_fields[i]->UpdateCoeffs());
1412  }
1413 
1414  if (dumpInitialConditions)
1415  {
1416  std::string outname = m_sessionName + "_initial.chk";
1417  WriteFld(outname);
1418 
1419  Array<OneD, Array<OneD, NekDouble>> fields(nvar);
1420  for (int i = 0; i < nvar; ++i)
1421  {
1422  fields[i] = m_fields[i]->GetPhys();
1423  }
1424 
1425  Checkpoint_PlotOutput(0, fields);
1426  }
1427 }
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)
Array< OneD, NekDouble > TestMaxwell1D(const NekDouble time, unsigned int field)
NekDouble m_Gaussianradius
Definition: MMFMaxwell.h:121
std::string m_sessionName
Name of the session.
Array< OneD, NekDouble > GaussianPulse(const NekDouble time, const NekDouble Psx, const NekDouble Psy, const NekDouble Psz, const NekDouble Gaussianradius)
SOLVER_UTILS_EXPORT int GetTotPoints()
TestMaxwellType m_TestMaxwellType
Definition: MMFSystem.h:150
NekDouble m_freq
Definition: MMFMaxwell.h:129
SOLVER_UTILS_EXPORT void WriteFld(const std::string &outname)
Write field data to the given filename.
Array< OneD, MultiRegions::ExpListSharedPtr > m_fields
Array holding all dependent variables.
void Checkpoint_PlotOutput(const int n, const Array< OneD, const Array< OneD, NekDouble >> &fieldphys)
Array< OneD, NekDouble > TestMaxwellSphere(const NekDouble time, const NekDouble omega, unsigned int field)

◆ WeakDGMaxwellDirDeriv()

void Nektar::MMFMaxwell::WeakDGMaxwellDirDeriv ( const Array< OneD, const Array< OneD, NekDouble >> &  InField,
Array< OneD, Array< OneD, NekDouble >> &  OutField,
const NekDouble  time = 0.0 
)
protected

Calculate weak DG advection in the form \( \langle\phi, \hat{F}\cdot n\rangle - (\nabla \phi \cdot F) \).

Parameters
InFieldFields.
OutFieldStorage for result.
NumericalFluxIncludesNormalDefault: true.
InFieldIsPhysSpaceDefault: false.
nvariablesNumber of fields.

Definition at line 1251 of file MMFMaxwell.cpp.

References Nektar::SolverUtils::MMFSystem::GetMaxwellFluxVector(), Nektar::SolverUtils::EquationSystem::GetNcoeffs(), Nektar::SolverUtils::EquationSystem::GetNpoints(), Nektar::SolverUtils::EquationSystem::GetTraceNpoints(), m_CrossProductMF, Nektar::SolverUtils::EquationSystem::m_fields, Nektar::SolverUtils::MMFSystem::m_shapedim, Vmath::Neg(), Nektar::SolverUtils::MMFSystem::NumericalMaxwellFlux(), and Vmath::Vadd().

Referenced by DoOdeRhs().

1254 {
1255  int i;
1256  int nq = GetNpoints();
1257  int ncoeffs = GetNcoeffs();
1258  int nTracePointsTot = GetTraceNpoints();
1259  int nvar = 3;
1260 
1261  Array<OneD, Array<OneD, NekDouble>> fluxvector(m_shapedim);
1262  for (i = 0; i < m_shapedim; ++i)
1263  {
1264  fluxvector[i] = Array<OneD, NekDouble>(nq);
1265  }
1266 
1267  Array<OneD, Array<OneD, NekDouble>> physfield(nvar);
1268  for (i = 0; i < nvar; ++i)
1269  {
1270  physfield[i] = InField[i];
1271  }
1272 
1273  Array<OneD, NekDouble> tmpc(ncoeffs);
1274  for (i = 0; i < nvar; ++i)
1275  {
1276  GetMaxwellFluxVector(i, physfield, fluxvector);
1277 
1278  OutField[i] = Array<OneD, NekDouble>(ncoeffs, 0.0);
1279  for (int j = 0; j < m_shapedim; ++j)
1280  {
1281  // Directional derivation with respect to the j'th moving frame
1282  // tmp_j = ( \nabla \phi, fluxvector[j] \mathbf{e}^j )
1283  m_fields[i]->IProductWRTDirectionalDerivBase(m_CrossProductMF[j],
1284  fluxvector[j], tmpc);
1285  Vmath::Vadd(ncoeffs, &tmpc[0], 1, &OutField[i][0], 1,
1286  &OutField[i][0], 1);
1287  }
1288  }
1289 
1290  // V the numerical flux and add to the modal coeffs
1291  // if the NumericalFlux function does not include the
1292  // normal in the output
1293  Array<OneD, Array<OneD, NekDouble>> numfluxFwd(nvar);
1294  Array<OneD, Array<OneD, NekDouble>> numfluxBwd(nvar);
1295 
1296  for (i = 0; i < nvar; ++i)
1297  {
1298  numfluxFwd[i] = Array<OneD, NekDouble>(nTracePointsTot, 0.0);
1299  numfluxBwd[i] = Array<OneD, NekDouble>(nTracePointsTot, 0.0);
1300  }
1301 
1302  // Evaluate numerical flux in physical space which may in
1303  // general couple all component of vectors
1304  NumericalMaxwellFlux(physfield, numfluxFwd, numfluxBwd, time);
1305 
1306  // Evaulate <\phi, \hat{F}\cdot n> - OutField[i]
1307  for (i = 0; i < nvar; ++i)
1308  {
1309  Vmath::Neg(ncoeffs, OutField[i], 1);
1310  m_fields[i]->AddFwdBwdTraceIntegral(numfluxFwd[i], numfluxBwd[i],
1311  OutField[i]);
1312  m_fields[i]->SetPhysState(false);
1313  }
1314 }
SOLVER_UTILS_EXPORT void NumericalMaxwellFlux(Array< OneD, Array< OneD, NekDouble >> &physfield, Array< OneD, Array< OneD, NekDouble >> &numfluxFwd, Array< OneD, Array< OneD, NekDouble >> &numfluxBwd, const NekDouble time=0.0)
Definition: MMFSystem.cpp:1735
void Neg(int n, T *x, const int incx)
Negate x = -x.
Definition: Vmath.cpp:399
SOLVER_UTILS_EXPORT int GetNpoints()
Array< OneD, MultiRegions::ExpListSharedPtr > m_fields
Array holding all dependent variables.
Array< OneD, Array< OneD, NekDouble > > m_CrossProductMF
Definition: MMFMaxwell.h:123
SOLVER_UTILS_EXPORT int GetTraceNpoints()
SOLVER_UTILS_EXPORT int GetNcoeffs()
SOLVER_UTILS_EXPORT void GetMaxwellFluxVector(const int var, const Array< OneD, const Array< OneD, NekDouble >> &physfield, Array< OneD, Array< OneD, NekDouble >> &flux)
Definition: MMFSystem.cpp:1614
void Vadd(int n, const T *x, const int incx, const T *y, const int incy, T *z, const int incz)
Add vector z = x+y.
Definition: Vmath.cpp:302

Friends And Related Function Documentation

◆ MemoryManager< MMFMaxwell >

friend class MemoryManager< MMFMaxwell >
friend

Definition at line 74 of file MMFMaxwell.h.

Member Data Documentation

◆ className

std::string Nektar::MMFMaxwell::className
static
Initial value:

Name of class.

Definition at line 91 of file MMFMaxwell.h.

◆ m_AddPML

int Nektar::MMFMaxwell::m_AddPML
protected

Definition at line 107 of file MMFMaxwell.h.

Referenced by DoOdeRhs(), GenerateSigmaPML(), v_GenerateSummary(), and v_InitObject().

◆ m_AddRotation

int Nektar::MMFMaxwell::m_AddRotation
protected

Definition at line 110 of file MMFMaxwell.h.

Referenced by DoOdeRhs(), v_GenerateSummary(), and v_InitObject().

◆ m_boundaryforSF

int Nektar::MMFMaxwell::m_boundaryforSF
protected

Definition at line 104 of file MMFMaxwell.h.

Referenced by Printout_SurfaceCurrent(), v_GenerateSummary(), and v_InitObject().

◆ m_Cloaking

bool Nektar::MMFMaxwell::m_Cloaking
protected

Definition at line 112 of file MMFMaxwell.h.

◆ m_CloakNlayer

NekDouble Nektar::MMFMaxwell::m_CloakNlayer
protected

Definition at line 113 of file MMFMaxwell.h.

Referenced by v_GenerateSummary(), and v_InitObject().

◆ m_Cloakraddelta

NekDouble Nektar::MMFMaxwell::m_Cloakraddelta
protected

◆ m_CloakType

CloakType Nektar::MMFMaxwell::m_CloakType

Definition at line 76 of file MMFMaxwell.h.

Referenced by v_GenerateSummary(), and v_InitObject().

◆ m_coriolis

Array<OneD, NekDouble> Nektar::MMFMaxwell::m_coriolis
protected

Definition at line 142 of file MMFMaxwell.h.

Referenced by AddCoriolis(), and v_InitObject().

◆ m_CrossProductMF

Array<OneD, Array<OneD, NekDouble> > Nektar::MMFMaxwell::m_CrossProductMF
protected

Definition at line 123 of file MMFMaxwell.h.

Referenced by v_InitObject(), and WeakDGMaxwellDirDeriv().

◆ m_DispersiveCloak

bool Nektar::MMFMaxwell::m_DispersiveCloak

◆ m_ElemtGroup0

int Nektar::MMFMaxwell::m_ElemtGroup0
protected

Definition at line 102 of file MMFMaxwell.h.

Referenced by ComputeMaterialMicroWaveCloak(), and v_InitObject().

◆ m_ElemtGroup1

int Nektar::MMFMaxwell::m_ElemtGroup1
protected

◆ m_freq

NekDouble Nektar::MMFMaxwell::m_freq
protected

◆ m_Gaussianradius

NekDouble Nektar::MMFMaxwell::m_Gaussianradius
protected

Definition at line 121 of file MMFMaxwell.h.

Referenced by v_DoSolve(), v_GenerateSummary(), v_InitObject(), and v_SetInitialConditions().

◆ m_mu

Array<OneD, NekDouble> Nektar::MMFMaxwell::m_mu
protected

Definition at line 133 of file MMFMaxwell.h.

Referenced by ComputeMaterialVector(), v_GenerateSummary(), and v_InitObject().

◆ m_n1

NekDouble Nektar::MMFMaxwell::m_n1
protected

Definition at line 131 of file MMFMaxwell.h.

Referenced by TestMaxwell1D(), and v_InitObject().

◆ m_n2

NekDouble Nektar::MMFMaxwell::m_n2
protected

Definition at line 131 of file MMFMaxwell.h.

Referenced by TestMaxwell1D(), and v_InitObject().

◆ m_n3

NekDouble Nektar::MMFMaxwell::m_n3
protected

Definition at line 131 of file MMFMaxwell.h.

Referenced by v_InitObject().

◆ m_NoInc

int Nektar::MMFMaxwell::m_NoInc
protected

Definition at line 140 of file MMFMaxwell.h.

Referenced by v_InitObject().

◆ m_PMLelement

int Nektar::MMFMaxwell::m_PMLelement
protected

Definition at line 136 of file MMFMaxwell.h.

Referenced by GenerateSigmaPML(), v_GenerateSummary(), and v_InitObject().

◆ m_PMLmaxsigma

NekDouble Nektar::MMFMaxwell::m_PMLmaxsigma
protected

Definition at line 137 of file MMFMaxwell.h.

Referenced by v_GenerateSummary(), and v_InitObject().

◆ m_PMLorder

int Nektar::MMFMaxwell::m_PMLorder
protected

Definition at line 108 of file MMFMaxwell.h.

Referenced by GenerateSigmaPML(), v_GenerateSummary(), and v_InitObject().

◆ m_PMLstart

NekDouble Nektar::MMFMaxwell::m_PMLstart
protected

Definition at line 137 of file MMFMaxwell.h.

Referenced by v_GenerateSummary(), and v_InitObject().

◆ m_PMLthickness

NekDouble Nektar::MMFMaxwell::m_PMLthickness
protected

Definition at line 137 of file MMFMaxwell.h.

Referenced by v_GenerateSummary(), and v_InitObject().

◆ m_PrintoutSurfaceCurrent

int Nektar::MMFMaxwell::m_PrintoutSurfaceCurrent
protected

Definition at line 105 of file MMFMaxwell.h.

Referenced by v_DoSolve(), and v_InitObject().

◆ m_PSduration

NekDouble Nektar::MMFMaxwell::m_PSduration
protected

Definition at line 121 of file MMFMaxwell.h.

Referenced by GaussianPulse(), v_DoSolve(), v_GenerateSummary(), and v_InitObject().

◆ m_Psx

NekDouble Nektar::MMFMaxwell::m_Psx
protected

Definition at line 120 of file MMFMaxwell.h.

Referenced by v_DoSolve(), v_GenerateSummary(), v_InitObject(), and v_SetInitialConditions().

◆ m_Psy

NekDouble Nektar::MMFMaxwell::m_Psy
protected

Definition at line 120 of file MMFMaxwell.h.

Referenced by v_DoSolve(), v_GenerateSummary(), v_InitObject(), and v_SetInitialConditions().

◆ m_Psz

NekDouble Nektar::MMFMaxwell::m_Psz
protected

Definition at line 120 of file MMFMaxwell.h.

Referenced by v_DoSolve(), v_GenerateSummary(), v_InitObject(), and v_SetInitialConditions().

◆ m_RecPML

int Nektar::MMFMaxwell::m_RecPML
protected

Definition at line 136 of file MMFMaxwell.h.

Referenced by GenerateSigmaPML(), v_GenerateSummary(), and v_InitObject().

◆ m_SigmaPML

Array<OneD, Array<OneD, NekDouble> > Nektar::MMFMaxwell::m_SigmaPML
protected

Definition at line 138 of file MMFMaxwell.h.

Referenced by AddPML(), and v_InitObject().

◆ m_SourceType

SourceType Nektar::MMFMaxwell::m_SourceType

Definition at line 77 of file MMFMaxwell.h.

Referenced by v_DoSolve(), v_GenerateSummary(), and v_InitObject().

◆ m_SourceVector

Array<OneD, NekDouble> Nektar::MMFMaxwell::m_SourceVector
protected

Definition at line 119 of file MMFMaxwell.h.

Referenced by v_DoSolve().

◆ m_TestPML

int Nektar::MMFMaxwell::m_TestPML
protected

Definition at line 135 of file MMFMaxwell.h.

Referenced by v_DoSolve(), and v_InitObject().

◆ m_varepsilon

Array<OneD, NekDouble> Nektar::MMFMaxwell::m_varepsilon
protected

Definition at line 132 of file MMFMaxwell.h.

Referenced by ComputeMaterialVector(), v_GenerateSummary(), and v_InitObject().

◆ m_wp2

Array<OneD, NekDouble> Nektar::MMFMaxwell::m_wp2
protected

Definition at line 117 of file MMFMaxwell.h.

Referenced by AddPML(), ComputeMaterialOpticalCloak(), DoOdeRhs(), and v_InitObject().

◆ m_wp2Tol

NekDouble Nektar::MMFMaxwell::m_wp2Tol
protected

Definition at line 116 of file MMFMaxwell.h.

Referenced by ComputeMaterialOpticalCloak(), and v_InitObject().