Nektar++
Loading...
Searching...
No Matches
Static Public Member Functions | Static Public Attributes | Protected Member Functions | Protected Attributes | Friends | List of all members
Nektar::UnsteadyADR Class Reference

#include <UnsteadyADR.h>

Inheritance diagram for Nektar::UnsteadyADR:
[legend]

Static Public Member Functions

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

Static Public Attributes

static std::string className0
 Name of class.
 
static std::string className1
 
static std::string className2
 
- Static Public Attributes inherited from Nektar::SolverUtils::UnsteadySystem
static std::string cmdSetStartTime
 
static std::string cmdSetStartChkNum
 

Protected Member Functions

 UnsteadyADR (const LibUtilities::SessionReaderSharedPtr &pSession, const SpatialDomains::MeshGraphSharedPtr &pGraph)
 
 ~UnsteadyADR () override=default
 
void DoProjection (LibUtilities::Field< double, FieldState::Phys > &in, LibUtilities::Field< double, FieldState::Phys > &out, const double &time)
 Project onto the solution space: a copy for DG, a forward and backward transform with the Dirichlet values at time for CG.
 
void DoImplicit (LibUtilities::Field< double, FieldState::Phys > &inout, LibUtilities::Field< double, FieldState::Phys > &out, const double &time, const double &lambda)
 
void DoExplicitRhs (LibUtilities::Field< double, FieldState::Phys > &in, LibUtilities::Field< double, FieldState::Phys > &out, const double &time, const double &dt)
 
void v_InitObject (bool declareExpansionLists=true) override
 Initialisation object for the UnsteadyADR problem.
 
CFLVelocity v_GetCFLVelocity () override
 Offer the advection velocity to the Courant estimate.
 
void v_GenerateSummary (SummaryList &s) override
 Virtual function for generating summary information.
 
void LoadSessionParameters ()
 
void SetAdvectionVel ()
 
void SetDiffusionCoeff ()
 Set the diffusion Coeff. the diff. coeff., diffCoeff_{ij} := \epslion * D_{ij} where, \epslion is scalar part D_{ij} is a 2D tensor for enforcing anisotropy Note, it is assumed that, diffCoeff_{ij} = diffCoeff_{ji}.
 
void v_InitialiseOperators () override
 
CoefficientFieldViews v_GetOutputFieldViews () override
 Project the solution to coefficients and return views of them.
 
- Protected Member Functions inherited from Nektar::SolverUtils::UnsteadySystem
SOLVER_UTILS_EXPORT UnsteadySystem (const LibUtilities::SessionReaderSharedPtr &pSession, const SpatialDomains::MeshGraphSharedPtr &pGraph)
 Initialises UnsteadySystem class members.
 
SOLVER_UTILS_EXPORT void v_InitObject (bool DeclareField=true) override
 Init object for UnsteadySystem class.
 
SOLVER_UTILS_EXPORT void v_DoSolve () override
 Solves an unsteady problem.
 
virtual SOLVER_UTILS_EXPORT void v_PrintStatusInformation (const int step, const NekDouble cpuTime)
 Print Status Information.
 
virtual SOLVER_UTILS_EXPORT void v_PrintSummaryStatistics (const NekDouble intTime)
 Print Summary Statistics.
 
SOLVER_UTILS_EXPORT void v_DoInitialise (bool dumpInitialConditions=true) override
 Sets up initial conditions.
 
SOLVER_UTILS_EXPORT void v_GenerateSummary (SummaryList &s) override
 Print a summary of time stepping parameters.
 
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.
 
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 ()
 
virtual SOLVER_UTILS_EXPORT void v_SteadyStateResidual (int step, Array< OneD, NekDouble > &L2)
 
virtual SOLVER_UTILS_EXPORT bool v_UpdateTimeStepCheck ()
 
SOLVER_UTILS_EXPORT NekDouble MaxTimeStepEstimator ()
 Get the maximum timestep estimator for cfl control.
 
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.
 
SOLVER_UTILS_EXPORT void DoDummyProjection (const Array< OneD, const Array< OneD, NekDouble > > &inarray, Array< OneD, Array< OneD, NekDouble > > &outarray, const NekDouble time)
 Perform dummy projection.
 
- Protected Member Functions inherited from Nektar::SolverUtils::EquationSystem
SOLVER_UTILS_EXPORT EquationSystem (const LibUtilities::SessionReaderSharedPtr &pSession, const SpatialDomains::MeshGraphSharedPtr &pGraph)
 Initialises EquationSystem class members.
 
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.
 
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.
 
virtual SOLVER_UTILS_EXPORT NekDouble v_H1Error (unsigned int field, const Array< OneD, NekDouble > &exactsoln=NullNekDouble1DArray, bool Normalised=false)
 Virtual function for the H_1 error computation between fields and a given exact solution.
 
virtual SOLVER_UTILS_EXPORT void v_TransCoeffToPhys ()
 Virtual function for transformation to physical space.
 
virtual SOLVER_UTILS_EXPORT void v_TransPhysToCoeff ()
 Virtual function for transformation to coefficient space.
 
virtual SOLVER_UTILS_EXPORT void v_SetInitialConditions (NekDouble initialtime=0.0, bool dumpInitialConditions=true, const int domain=0)
 
virtual SOLVER_UTILS_EXPORT void v_EvaluateExactSolution (unsigned int field, Array< OneD, NekDouble > &outfield, const NekDouble time)
 
virtual SOLVER_UTILS_EXPORT void v_Output (void)
 
virtual SOLVER_UTILS_EXPORT MultiRegions::ExpListSharedPtr v_GetPressure (void)
 
virtual SOLVER_UTILS_EXPORT bool v_NegatedOp (void)
 Virtual function to identify if operator is negated in DoSolve.
 
virtual SOLVER_UTILS_EXPORT void v_ExtraFldOutput (std::vector< Array< OneD, NekDouble > > &fieldcoeffs, std::vector< std::string > &variables)
 

Protected Attributes

double m_epsilon
 
std::vector< double > m_diffCoeff
 
LibUtilities::Field< double, FieldState::Phys > m_varDiffCoeff
 
SessionFunctionSharedPtr m_varDiffCoeffFunction
 
bool m_isTimeDependentDiffCoeff = false
 
double m_lambda
 
bool m_advection = false
 
bool m_diffusion = false
 
bool m_explicitAdvection = false
 
bool m_explicitDiffusion = false
 
bool m_implicitAdvection = false
 
bool m_implicitDiffusion = false
 
LibUtilities::Field< double, FieldState::Phys > m_advectionVel
 
LibUtilities::Field< double, FieldState::Phys > m_traceAdvVel
 The advection velocity on the local trace, which the trace flux operator reads through a pointer; kept here so that it outlives it.
 
std::shared_ptr< BwdTransOp< double > > m_bwdTransOp
 
std::shared_ptr< FwdTransOp< double > > m_fwdTransOp
 
std::shared_ptr< IProductWRTBaseOp< double > > m_iProductWRTBaseOp
 
std::shared_ptr< MultiplyByElmtInvMassOp< double > > m_multiplyByElmtInvMassOp
 
std::shared_ptr< AdvectionOp< double > > m_advectionCGOp
 
std::shared_ptr< AdvectionWeakDGOp< double > > m_advectionWeakDGOp
 
std::shared_ptr< LinearAdvVolumeFluxOp< double > > m_volumeFluxOp
 
std::shared_ptr< SolverCore::TraceFluxOp< double > > m_traceFluxOp
 
std::shared_ptr< DiffusionIPOp< double > > m_diffusionIPOp
 
std::shared_ptr< LinearSystemOp< double > > m_linearSystemOp
 
std::shared_ptr< LinearSolverOp< double > > m_linearSolverOp
 
std::map< double, std::shared_ptr< PreconOp< double > > > m_preconOp
 
std::vector< ForcingSharedPtr > m_forcing
 
- Protected Attributes inherited from Nektar::SolverUtils::UnsteadySystem
LibUtilities::TimeIntegrationSchemeSharedPtr m_intScheme
 Wrapper to the time integration scheme.
 
LibUtilities::TimeIntegrationSchemeOperators m_ode
 The time integration scheme operators to use.
 
Array< OneD, Array< OneD, NekDouble > > m_previousSolution
 Storage for previous solution for steady-state check.
 
std::vector< int > m_intVariables
 
NekDouble m_cflSafetyFactor
 CFL safety factor (comprise between 0 to 1).
 
NekDouble m_CFLGrowth
 CFL growth rate.
 
NekDouble m_CFLEnd
 Maximun cfl in cfl growth.
 
int m_abortSteps
 Number of steps between checks for abort conditions.
 
bool m_explicitDiffusion
 Indicates if explicit or implicit treatment of diffusion is used.
 
bool m_explicitAdvection
 Indicates if explicit or implicit treatment of advection is used.
 
bool m_explicitReaction
 Indicates if explicit or implicit treatment of reaction is used.
 
int m_steadyStateSteps
 Check for steady state at step interval.
 
NekDouble m_steadyStateTol
 Tolerance to which steady state should be evaluated at.
 
int m_filtersInfosteps
 Number of time steps between outputting filters information.
 
std::vector< std::pair< std::string, FilterSharedPtr > > m_filters
 
bool m_homoInitialFwd
 Flag to determine if simulation should start in homogeneous forward transformed state.
 
std::ofstream m_errFile
 
NekDouble m_epsilon
 Diffusion coefficient.
 
- Protected Attributes inherited from Nektar::SolverUtils::EquationSystem
LibUtilities::CommSharedPtr m_comm
 Communicator.
 
bool m_verbose
 
LibUtilities::SessionReaderSharedPtr m_session
 The session reader.
 
std::map< std::string, SolverUtils::SessionFunctionSharedPtr > m_sessionFunctions
 Map of known SessionFunctions.
 
LibUtilities::FieldIOSharedPtr m_fld
 Field input/output.
 
Array< OneD, MultiRegions::ExpListSharedPtr > m_fields
 Array holding all dependent variables.
 
SpatialDomains::BoundaryConditionsSharedPtr m_boundaryConditions
 Pointer to boundary conditions object.
 
SpatialDomains::MeshGraphSharedPtr m_graph
 Pointer to graph defining mesh.
 
std::string m_sessionName
 Name of the session.
 
NekDouble m_time
 Current time of simulation.
 
int m_initialStep
 Number of the step where the simulation should begin.
 
NekDouble m_fintime
 Finish time of the simulation.
 
NekDouble m_timestep
 Time step size.
 
NekDouble m_lambda
 Lambda constant in real system if one required.
 
NekDouble m_checktime
 Time between checkpoints.
 
NekDouble m_lastCheckTime
 
NekDouble m_TimeIncrementFactor
 
int m_nchk
 Number of checkpoints written so far.
 
int m_steps
 Number of steps to take.
 
int m_checksteps
 Number of steps between checkpoints.
 
int m_infosteps
 Number of time steps between outputting status information.
 
int m_iterPIT = 0
 Number of parallel-in-time time iteration.
 
int m_windowPIT = 0
 Index of windows for parallel-in-time time iteration.
 
int m_spacedim
 Spatial dimension (>= expansion dim).
 
int m_expdim
 Expansion dimension.
 
bool m_singleMode
 Flag to determine if single homogeneous mode is used.
 
bool m_halfMode
 Flag to determine if half homogeneous mode is used.
 
bool m_multipleModes
 Flag to determine if use multiple homogenenous modes are used.
 
bool m_useFFT
 Flag to determine if FFT is used for homogeneous transform.
 
bool m_homogen_dealiasing
 Flag to determine if dealiasing is used for homogeneous simulations.
 
bool m_specHP_dealiasing
 Flag to determine if dealisising is usde for the Spectral/hp element discretisation.
 
enum MultiRegions::ProjectionType m_projectionType
 Type of projection; e.g continuous or discontinuous.
 
Array< OneD, Array< OneD, NekDouble > > m_traceNormals
 Array holding trace normals for DG simulations in the forwards direction.
 
Array< OneD, bool > m_checkIfSystemSingular
 Flag to indicate if the fields should be checked for singularity.
 
LibUtilities::FieldMetaDataMap m_fieldMetaDataMap
 Map to identify relevant solver info to dump in output fields.
 
Array< OneD, NekDouble > m_movingFrameData
 Moving reference frame status in the body frame X, Y, Z, Theta_x, Theta_y, Theta_z, [inertial] U, V, W, Omega_x, Omega_y, Omega_z, [body] A_x, A_y, A_z, DOmega_x, DOmega_y, DOmega_z, [body] pivot_x, pivot_y, pivot_z [body].
 
std::vector< std::string > m_strFrameData
 variable name in m_movingFrameData
 
std::vector< bool > m_movableDoFs
 
int m_NumQuadPointsError
 Number of Quadrature points used to work out the error.
 
enum HomogeneousType m_HomogeneousType
 
NekDouble m_LhomX
 physical length in X direction (if homogeneous)
 
NekDouble m_LhomY
 physical length in Y direction (if homogeneous)
 
NekDouble m_LhomZ
 physical length in Z direction (if homogeneous)
 
int m_npointsX
 number of points in X direction (if homogeneous)
 
int m_npointsY
 number of points in Y direction (if homogeneous)
 
int m_npointsZ
 number of points in Z direction (if homogeneous)
 
int m_HomoDirec
 number of homogenous directions
 
- Protected Attributes inherited from Nektar::SolverUtils::ALEHelper
Array< OneD, MultiRegions::ExpListSharedPtr > m_fieldsALE
 
Array< OneD, Array< OneD, NekDouble > > m_gridVelocity
 
Array< OneD, Array< OneD, NekDouble > > m_gridVelocityTrace
 
std::vector< ALEBaseShPtr > m_ALEs
 
bool m_ALESolver = false
 
bool m_meshDistorted = false
 
bool m_implicitALESolver = false
 
bool m_updateNormals = false
 
NekDouble m_prevStageTime = 0.0
 
int m_spaceDim
 

Friends

class MemoryManager< UnsteadyADR >
 

Additional Inherited Members

- Public Member Functions inherited from Nektar::SolverUtils::UnsteadySystem
SOLVER_UTILS_EXPORT ~UnsteadySystem () override=default
 Destructor.
 
SOLVER_UTILS_EXPORT NekDouble GetTimeStep (const Array< OneD, const Array< OneD, NekDouble > > &inarray)
 Calculate the larger time-step mantaining the problem stable.
 
SOLVER_UTILS_EXPORT NekDouble GetTimeStep ()
 
SOLVER_UTILS_EXPORT void SetTimeStep (const NekDouble timestep)
 
SOLVER_UTILS_EXPORT void SteadyStateResidual (int step, Array< OneD, NekDouble > &L2)
 
SOLVER_UTILS_EXPORT LibUtilities::TimeIntegrationSchemeSharedPtr & GetTimeIntegrationScheme ()
 Returns the time integration scheme.
 
SOLVER_UTILS_EXPORT LibUtilities::TimeIntegrationSchemeOperators & GetTimeIntegrationSchemeOperators ()
 Returns the time integration scheme operators.
 
- Public Member Functions inherited from Nektar::SolverUtils::EquationSystem
virtual SOLVER_UTILS_EXPORT ~EquationSystem ()
 Destructor.
 
SOLVER_UTILS_EXPORT void InitObject (bool DeclareField=true)
 Initialises the members of this object.
 
SOLVER_UTILS_EXPORT void DoInitialise (bool dumpInitialConditions=true)
 Perform any initialisation necessary before solving the problem.
 
SOLVER_UTILS_EXPORT void DoSolve ()
 Solve the problem.
 
SOLVER_UTILS_EXPORT void TransCoeffToPhys ()
 Transform from coefficient to physical space.
 
SOLVER_UTILS_EXPORT void TransPhysToCoeff ()
 Transform from physical to coefficient space.
 
SOLVER_UTILS_EXPORT void Output ()
 Perform output operations after solve.
 
SOLVER_UTILS_EXPORT std::string GetSessionName ()
 Get Session name.
 
template<class T >
std::shared_ptr< T > as ()
 
SOLVER_UTILS_EXPORT void ResetSessionName (std::string newname)
 Reset Session name.
 
SOLVER_UTILS_EXPORT LibUtilities::SessionReaderSharedPtr GetSession ()
 Get Session name.
 
SOLVER_UTILS_EXPORT MultiRegions::ExpListSharedPtr GetPressure ()
 Get pressure field if available.
 
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.
 
SOLVER_UTILS_EXPORT void SetLambda (NekDouble lambda)
 Set parameter m_lambda.
 
SOLVER_UTILS_EXPORT SessionFunctionSharedPtr GetFunction (std::string name, const MultiRegions::ExpListSharedPtr &field=MultiRegions::NullExpListSharedPtr, bool cache=false)
 Get a SessionFunction by name.
 
SOLVER_UTILS_EXPORT void SetInitialConditions (NekDouble initialtime=0.0, bool dumpInitialConditions=true, const int domain=0)
 Initialise the data in the dependent fields.
 
SOLVER_UTILS_EXPORT void EvaluateExactSolution (int field, Array< OneD, NekDouble > &outfield, const NekDouble time)
 Evaluates an exact solution.
 
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.
 
SOLVER_UTILS_EXPORT NekDouble L2Error (unsigned int field, bool Normalised=false)
 Compute the L2 error of the fields.
 
SOLVER_UTILS_EXPORT NekDouble LinfError (unsigned int field, const Array< OneD, NekDouble > &exactsoln=NullNekDouble1DArray)
 Linf error computation.
 
SOLVER_UTILS_EXPORT NekDouble H1Error (unsigned int field, const Array< OneD, NekDouble > &exactsoln, bool Normalised=false)
 Compute the H1 error between fields and a given exact solution.
 
SOLVER_UTILS_EXPORT Array< OneD, NekDouble > ErrorExtraPoints (unsigned int field)
 Compute error (L2 and L_inf) over an larger set of quadrature points return [L2 Linf].
 
SOLVER_UTILS_EXPORT void Checkpoint_Output (const int n)
 Write checkpoint file of m_fields.
 
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.
 
SOLVER_UTILS_EXPORT void Checkpoint_BaseFlow (const int n)
 Write base flow file of m_fields.
 
SOLVER_UTILS_EXPORT void WriteFld (const std::string &outname)
 Write field data to the given filename.
 
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.
 
SOLVER_UTILS_EXPORT void ImportFld (const std::string &infile, Array< OneD, MultiRegions::ExpListSharedPtr > &pFields)
 Input field data from the given file.
 
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.
 
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.
 
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.
 
SOLVER_UTILS_EXPORT void SessionSummary (SummaryList &vSummary)
 Write out a session summary.
 
SOLVER_UTILS_EXPORT Array< OneD, MultiRegions::ExpListSharedPtr > & UpdateFields ()
 
SOLVER_UTILS_EXPORT LibUtilities::FieldMetaDataMap & UpdateFieldMetaDataMap ()
 Get hold of FieldInfoMap so it can be updated.
 
SOLVER_UTILS_EXPORT NekDouble GetTime ()
 Return final time.
 
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 void SetSteps (const int steps)
 
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, const Array< OneD, const NekDouble > &input)
 
SOLVER_UTILS_EXPORT Array< OneD, NekDouble > & UpdatePhysField (const int i)
 
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 int GetInfoSteps ()
 
SOLVER_UTILS_EXPORT void SetInfoSteps (int num)
 
SOLVER_UTILS_EXPORT void SetIterationNumberPIT (int num)
 
SOLVER_UTILS_EXPORT void SetWindowNumberPIT (int num)
 
SOLVER_UTILS_EXPORT Array< OneD, const Array< OneD, NekDouble > > GetTraceNormals ()
 
SOLVER_UTILS_EXPORT LibUtilities::FieldMetaDataMap & GetFieldMetaDataMap (void)
 
SOLVER_UTILS_EXPORT void SetTime (const NekDouble time)
 
SOLVER_UTILS_EXPORT void SetTimeStep (const NekDouble timestep)
 
SOLVER_UTILS_EXPORT void SetInitialStep (const int step)
 
SOLVER_UTILS_EXPORT void SetBoundaryConditions (NekDouble time)
 Evaluates the boundary conditions at the given time.
 
SOLVER_UTILS_EXPORT bool NegatedOp ()
 Identify if operator is negated in DoSolve.
 
- Public Member Functions inherited from Nektar::SolverUtils::ALEHelper
virtual ~ALEHelper ()=default
 
virtual SOLVER_UTILS_EXPORT void v_ALEInitObject (int spaceDim, Array< OneD, MultiRegions::ExpListSharedPtr > &fields)
 
SOLVER_UTILS_EXPORT void InitObject (int spaceDim, Array< OneD, MultiRegions::ExpListSharedPtr > &fields)
 
virtual SOLVER_UTILS_EXPORT void v_UpdateGridVelocity (const NekDouble &time)
 
virtual SOLVER_UTILS_EXPORT void v_ALEPreMultiplyMass (Array< OneD, Array< OneD, NekDouble > > &fields)
 
SOLVER_UTILS_EXPORT void ALEDoElmtInvMass (Array< OneD, Array< OneD, NekDouble > > &traceNormals, Array< OneD, Array< OneD, NekDouble > > &fields, NekDouble time)
 Update m_fields with u^n by multiplying by inverse mass matrix. That's then used in e.g. checkpoint output and L^2 error calculation.
 
SOLVER_UTILS_EXPORT void ALEDoElmtInvMassBwdTrans (const Array< OneD, const Array< OneD, NekDouble > > &inarray, Array< OneD, Array< OneD, NekDouble > > &outarray)
 
SOLVER_UTILS_EXPORT void MoveMesh (const NekDouble &time, Array< OneD, Array< OneD, NekDouble > > &traceNormals)
 
SOLVER_UTILS_EXPORT void ResetMatricesNormal (Array< OneD, Array< OneD, NekDouble > > &traceNormals)
 
SOLVER_UTILS_EXPORT void UpdateNormalsFlag ()
 
const Array< OneD, const Array< OneD, NekDouble > > & GetGridVelocity ()
 
bool & GetUpdateNormalsFlag ()
 
SOLVER_UTILS_EXPORT const Array< OneD, const Array< OneD, NekDouble > > & GetGridVelocityTrace ()
 
SOLVER_UTILS_EXPORT void ExtraFldOutputGridVelocity (std::vector< Array< OneD, NekDouble > > &fieldcoeffs, std::vector< std::string > &variables)
 
SOLVER_UTILS_EXPORT void ExtraFldOutputGrid (std::vector< Array< OneD, NekDouble > > &fieldcoeffs, std::vector< std::string > &variables)
 
- 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 []
 
static std::string projectionTypeLookupIds []
 

Detailed Description

Definition at line 70 of file UnsteadyADR.h.

Constructor & Destructor Documentation

◆ UnsteadyADR()

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

Definition at line 73 of file UnsteadyADR.cpp.

75 : UnsteadySystem(pSession, pGraph)
76{
77}
SOLVER_UTILS_EXPORT UnsteadySystem(const LibUtilities::SessionReaderSharedPtr &pSession, const SpatialDomains::MeshGraphSharedPtr &pGraph)
Initialises UnsteadySystem class members.

◆ ~UnsteadyADR()

Nektar::UnsteadyADR::~UnsteadyADR ( )
overrideprotecteddefault

Member Function Documentation

◆ create()

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

Creates an instance of this class.

Definition at line 76 of file UnsteadyADR.h.

79 {
82 equ->InitObject();
83 return equ;
84 }
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.

References Nektar::MemoryManager< DataType >::AllocateSharedPtr().

◆ DoExplicitRhs()

void Nektar::UnsteadyADR::DoExplicitRhs ( LibUtilities::Field< double, FieldState::Phys > &  in,
LibUtilities::Field< double, FieldState::Phys > &  out,
const double &  time,
const double &  dt 
)
protected

Definition at line 258 of file UnsteadyADR.cpp.

277{
278 // Switch on the projection type (Discontinuous or Continuous)
279 switch (m_projectionType)
280 {
281 // Discontinuous projection
283 {
284 // Add advection term
286 {
287 // Refresh time-dependent boundary values at the current stage
288 // time, as the continuous branch does through the linear
289 // system operator.
290 m_advectionWeakDGOp->UpdateBndPhys(time);
291 m_advectionWeakDGOp->SetScale(-dt);
292 m_advectionWeakDGOp->Apply(in, out);
293 }
295 {
296 m_diffusionIPOp->UpdateBndPhys(time);
297 m_diffusionIPOp->SetScale(dt);
299 m_diffusionIPOp->Apply(in, out);
300 }
301 break;
302 }
303 // Continuous field
305 {
306 // Add advection term
308 {
309 m_advectionCGOp->SetScale(-dt);
310 m_advectionCGOp->Apply(in, out);
311 }
313 {
314 // To be completed
315 }
316 break;
317 }
318 default:
319 {
320 ASSERTL0(false, "Unsupported projection type.");
321 break;
322 }
323 }
324
#define ASSERTL0(condition, msg)
enum MultiRegions::ProjectionType m_projectionType
Type of projection; e.g continuous or discontinuous.
std::shared_ptr< DiffusionIPOp< double > > m_diffusionIPOp
std::shared_ptr< AdvectionWeakDGOp< double > > m_advectionWeakDGOp
std::shared_ptr< AdvectionOp< double > > m_advectionCGOp

◆ DoImplicit()

void Nektar::UnsteadyADR::DoImplicit ( LibUtilities::Field< double, FieldState::Phys > &  inout,
LibUtilities::Field< double, FieldState::Phys > &  out,
const double &  time,
const double &  lambda 
)
protected

Definition at line 157 of file UnsteadyADR.cpp.

157 :
158 {
159 m_fwdTransOp->UpdateBndCoeffs(time);
160 m_fwdTransOp->Apply(in, m_coeff[0]);
161 m_bwdTransOp->Apply(m_coeff[0], out);
162 break;
163 }
164 default:
165 {
166 ASSERTL0(false, "Unsupported projection type.");
167 break;
168 }
169 }
170}
171
173 LibUtilities::Field<double, FieldState::Phys> &in,
174 [[maybe_unused]] LibUtilities::Field<double, FieldState::Phys> &out,
175 const double &time, const double &dt_inv_gamma)
176{
177 if (m_session->GetSolverInfo("EQTYPE") == "UnsteadyAdvection")
178 {
179 ASSERTL0(false,
180 "Implicit time-stepping not supported for pure advection");
181 return;
182 }
183
185 {
186 m_varDiffCoeffFunction->Evaluate(m_varDiffCoeff, time);
187 m_preconOp.clear();
188 }
189
190 // Switch on the projection type (Discontinuous or Continuous)
191 switch (m_projectionType)
192 {
193 // Discontinuous projection
195 {
196 ASSERTL0(false, "Implicit/IMEX time-stepping not supported for DG");
198 {
199 // To be completed
200 }
202 {
203 // To be completed
204 }
205 break;
206 }
207 // Continuous field
209 {
210 // Update \lambda = \gamma / \Delta t
211 m_lambda = 1.0 / dt_inv_gamma;
212
213 // Update LinearSystem
215 {
216 std::dynamic_pointer_cast<LinearADRSolveOp<double>>(
219 }
220 else if (m_implicitDiffusion)
221 {
222 std::dynamic_pointer_cast<HelmSolveOp<double>>(m_linearSystemOp)
224 }
225
226 if (m_preconOp.find(dt_inv_gamma) == m_preconOp.end())
227 {
228 // Configure and cache preconditioner
229 m_preconOp.insert(
230 {dt_inv_gamma,
231 PreconOp<double>::Create(m_expansionLists[0],
232 m_session->GetVariables())});
233 m_linearSystemOp->SetPrecon(m_preconOp[dt_inv_gamma]);
234 m_linearSystemOp->UpdatePrecon();
235 }
236 else
237 {
238 // Re-use preconditioner
239 m_linearSystemOp->SetPrecon(m_preconOp[dt_inv_gamma]);
240 }
241
242 // Multiply by negative lambda
243 m_math.mul(-m_lambda, in, out);
244
245 // Refresh time-dependent Dirichlet and Neumann coefficients at the
246 // current implicit stage time before applying the linear system.
247 m_linearSystemOp->UpdateBndCoeffs(time);
SOLVER_UTILS_EXPORT void SetLambda(NekDouble lambda)
Set parameter m_lambda.
LibUtilities::SessionReaderSharedPtr m_session
The session reader.
void DoImplicit(LibUtilities::Field< double, FieldState::Phys > &inout, LibUtilities::Field< double, FieldState::Phys > &out, const double &time, const double &lambda)
SessionFunctionSharedPtr m_varDiffCoeffFunction
Definition UnsteadyADR.h:97
std::shared_ptr< LinearSystemOp< double > > m_linearSystemOp
std::map< double, std::shared_ptr< PreconOp< double > > > m_preconOp
std::shared_ptr< FwdTransOp< double > > m_fwdTransOp
bool m_isTimeDependentDiffCoeff
Definition UnsteadyADR.h:99
std::shared_ptr< BwdTransOp< double > > m_bwdTransOp
LibUtilities::Field< double, FieldState::Phys > m_varDiffCoeff
Definition UnsteadyADR.h:96

References m_bwdTransOp, and m_fwdTransOp.

◆ DoProjection()

void Nektar::UnsteadyADR::DoProjection ( LibUtilities::Field< double, FieldState::Phys > &  in,
LibUtilities::Field< double, FieldState::Phys > &  out,
const double &  time 
)
protected

Project onto the solution space: a copy for DG, a forward and backward transform with the Dirichlet values at time for CG.

Definition at line 128 of file UnsteadyADR.cpp.

146{
147 switch (m_projectionType)
148 {
150 {
151 if (&in != &out)
152 {
153 m_math.copy(in, out);
154 }
155 break;

◆ LoadSessionParameters()

void Nektar::UnsteadyADR::LoadSessionParameters ( )
protected

Definition at line 340 of file UnsteadyADR.cpp.

349{
350 std::vector<std::string> vel = {"Vx", "Vy", "Vz"};
351 vel.resize(m_coordim);
352 return {&m_advectionVel, 0, vel};
353}
354
356{
357 // Get variable strings and number of variables.
358 if ((m_session->GetSolverInfo("EQTYPE") == "UnsteadyAdvection") ||
359 (m_session->GetSolverInfo("EQTYPE") == "UnsteadyAdvectionDiffusion"))
360 {
361 m_advection = true;
362 m_session->MatchSolverInfo("ADVECTIONADVANCEMENT", "Explicit",
363 m_explicitAdvection, true);
365 }
366
367 if ((m_session->GetSolverInfo("EQTYPE") == "UnsteadyDiffusion") ||
368 (m_session->GetSolverInfo("EQTYPE") == "UnsteadyAdvectionDiffusion"))
369 {
370 m_diffusion = true;
371 m_session->MatchSolverInfo("DIFFUSIONADVANCEMENT", "Explicit",
372 m_explicitDiffusion, true);
374 }
375
376 // Get diffusion parameters.
377 if (m_diffusion)
378 {
379 // Resize diffCoeff vector.
380 const auto nDiffCoeff = m_coordim * (m_coordim + 1) / 2;
381 m_diffCoeff.resize(nDiffCoeff);
382
383 m_session->LoadParameter("epsilon", m_epsilon, 1.0);
384 if (m_coordim == 1)
385 {
386 m_session->LoadParameter("D00", m_diffCoeff[0], 1.0);
387 }
388 else if (m_coordim == 2)
389 {
std::vector< double > m_diffCoeff
Definition UnsteadyADR.h:94
LibUtilities::Field< double, FieldState::Phys > m_advectionVel

References m_advectionVel.

Referenced by v_InitObject().

◆ SetAdvectionVel()

void Nektar::UnsteadyADR::SetAdvectionVel ( )
protected

Definition at line 394 of file UnsteadyADR.cpp.

395 {
396 m_session->LoadParameter("D00", m_diffCoeff[0], 1.0);
397 m_session->LoadParameter("D01", m_diffCoeff[1], 0.0);
398 m_session->LoadParameter("D11", m_diffCoeff[2], 1.0);
399 m_session->LoadParameter("D02", m_diffCoeff[3], 0.0);
400 m_session->LoadParameter("D12", m_diffCoeff[4], 0.0);
401 m_session->LoadParameter("D22", m_diffCoeff[5], 1.0);
402 }
403 }
404}
405
406/*
407 * @brief Sets the Advection Veclocity
408 */
410{
411 if (m_advection)
412 {
413 // Read advection velocity from session.
414 if (m_session->DefinesFunction("AdvectionVelocity"))
415 {
416 auto bAtr_phys =
418 m_expansionLists[0]);
419 m_advectionVel = LibUtilities::Field<double, FieldState::Phys>(
420 "advVel", bAtr_phys, m_coordim, m_npointsZ);
int m_npointsZ
number of points in Z direction (if homogeneous)
template std::vector< BlockAttributes< FieldState::Phys > > GetBlockAttributes< double, FieldState::Phys >(const MultiRegions::ExpListSharedPtr explist, const std::vector< unsigned int > &interleave_widths)

References m_diffCoeff, and Nektar::SolverUtils::EquationSystem::m_session.

Referenced by v_InitObject().

◆ SetDiffusionCoeff()

void Nektar::UnsteadyADR::SetDiffusionCoeff ( )
protected

Set the diffusion Coeff. the diff. coeff., diffCoeff_{ij} := \epslion * D_{ij} where, \epslion is scalar part D_{ij} is a 2D tensor for enforcing anisotropy Note, it is assumed that, diffCoeff_{ij} = diffCoeff_{ji}.

Let, Vec be a Vector<double> storing a flatten \diffCoeff_{ij}, then Case 1: For 1D Vec[0] = D_{00} Case 2: For 2D Vec[0] = D_{00} Vec[1] = D_{01} Vec[2] = D_{11} Case 3: For 3D Vec[0] = D_{00} Vec[1] = D_{01} Vec[2] = D_{11} Vec[3] = D_{02} Vec[4] = D_{12} Vec[5] = D_{22}

Definition at line 445 of file UnsteadyADR.cpp.

445 {ij}, then
446 * Case 1: For 1D
447 * Vec[0] = D_{00}
448 * Case 2: For 2D
449 * Vec[0] = D_{00}
450 * Vec[1] = D_{01}
451 * Vec[2] = D_{11}
452 * Case 3: For 3D
453 * Vec[0] = D_{00}
454 * Vec[1] = D_{01}
455 * Vec[2] = D_{11}
456 * Vec[3] = D_{02}
457 * Vec[4] = D_{12}
458 * Vec[5] = D_{22}
459 */
461{
462 // Optional physical tensor, in the same D00,D01,D11,D02,D12,D22 order
463 // as the constant parameters. epsilon scales every tensor component.
464 if (m_session->DefinesFunction("DiffusionCoefficient"))
465 {
467 "Variable DiffusionCoefficient requires implicit diffusion");
468
469 std::vector<std::string> names = {"D00", "D01", "D11",
470 "D02", "D12", "D22"};
471 names.resize(m_coordim * (m_coordim + 1) / 2);
472 auto bAtr_phys =
474 m_expansionLists[0]);
475 m_varDiffCoeff = LibUtilities::Field<double, FieldState::Phys>(
476 "DiffusionCoefficient", bAtr_phys, names.size(), m_npointsZ);
477 m_varDiffCoeffFunction = std::make_shared<SessionFunction>(
478 m_session, m_expansionLists[0], names, "DiffusionCoefficient");
482 }
483 else if (m_diffusion)
484 {
485 if (m_coordim == 1)
486 {
487 // Multiply by Scalar Part
489 }
490 else if (m_coordim == 2)
491 {
492 // Multiply by Scalar Part
NekDouble m_time
Current time of simulation.
void SetDiffusionCoeff()
Set the diffusion Coeff. the diff. coeff., diffCoeff_{ij} := \epslion * D_{ij} where,...

References ASSERTL0, Nektar::MultiRegions::GetBlockAttributes< double, FieldState::Phys >(), m_diffCoeff, m_diffusion, m_epsilon, m_implicitDiffusion, m_isTimeDependentDiffCoeff, Nektar::SolverUtils::EquationSystem::m_npointsZ, Nektar::SolverUtils::EquationSystem::m_session, Nektar::SolverUtils::EquationSystem::m_time, m_varDiffCoeff, and m_varDiffCoeffFunction.

Referenced by v_InitObject().

◆ v_GenerateSummary()

void Nektar::UnsteadyADR::v_GenerateSummary ( SummaryList &  l)
overrideprotectedvirtual

Virtual function for generating summary information.

Reimplemented from Nektar::SolverUtils::EquationSystem.

Definition at line 103 of file UnsteadyADR.cpp.

104{
106
107 AddSummaryItem(s, "Equations", "Advection-Diffusion-Reaction");
108 if (m_advection)
109 {
110 AddSummaryItem(s, "Advect. advancement",
111 m_explicitAdvection ? "explicit" : "implicit");
112 }
113 if (m_diffusion)
114 {
115 AddSummaryItem(s, "Diffusion advancement",
116 m_explicitDiffusion ? "explicit" : "implicit");
117 }
118
119 std::stringstream ss;
120 ss << R"(
121 _ _ _ _
122| \ | | | | | | _ _
SOLVER_UTILS_EXPORT void v_GenerateSummary(SummaryList &s) override
Print a summary of time stepping parameters.
void AddSummaryItem(SummaryList &l, const std::string &name, const std::string &value)
Adds a summary item to the summary info list.
Definition Misc.cpp:46

References Nektar::SolverUtils::AddSummaryItem(), m_advection, m_diffusion, m_explicitAdvection, m_explicitDiffusion, and Nektar::SolverUtils::UnsteadySystem::v_GenerateSummary().

◆ v_GetCFLVelocity()

UnsteadySystem::CFLVelocity Nektar::UnsteadyADR::v_GetCFLVelocity ( )
overrideprotected

Offer the advection velocity to the Courant estimate.

Without advection this field is never constructed, and ComputeCFLInvTimeScale() skips the estimate when the returned field is not instantiated.

Definition at line 333 of file UnsteadyADR.cpp.

336 {
337 m_math.zero(out);
338 }

◆ v_GetOutputFieldViews()

CoefficientFieldViews Nektar::UnsteadyADR::v_GetOutputFieldViews ( )
overrideprotected

Project the solution to coefficients and return views of them.

Definition at line 653 of file UnsteadyADR.cpp.

657 :
658 {
659 ASSERTL0(false, "Unsupported projection type.");
660 break;
661 }
662 }
663
664 // Load forcing terms, if defined in the session file.
665 m_forcing = Forcing::Load(m_session, m_expansionLists[0], m_variables[0]);
666}
667
668CoefficientFieldViews UnsteadyADR::v_GetOutputFieldViews()
669{
670 // The solution is advanced in physical space, so project back to
671 // coefficients before exposing it to output filters. CG uses its global
672 // transform with boundary coefficients; DG uses the element-local L2
static SOLVER_UTILS_EXPORT std::vector< ForcingSharedPtr > Load(const LibUtilities::SessionReaderSharedPtr &pSession, const std::weak_ptr< EquationSystem > &pEquation, const Array< OneD, MultiRegions::ExpListSharedPtr > &pFields, const unsigned int &pNumForcingFields=0)
Definition Forcing.cpp:77
std::vector< ForcingSharedPtr > m_forcing
CoefficientFieldViews v_GetOutputFieldViews() override
Project the solution to coefficients and return views of them.

◆ v_InitialiseOperators()

void Nektar::UnsteadyADR::v_InitialiseOperators ( )
overrideprotected

Definition at line 498 of file UnsteadyADR.cpp.

498 {
499 // Multiply by Scalar Part
506 }
507 }
508}
509
510/*
511 * Create and initialise all operators for this solver
512 */
514{
515 // Transforms, and the projection of the solution to coefficients for
516 // output: a global mass matrix solve for CG, element local for DG.
518 BwdTransOp<double>::Create(m_expansionLists[0], m_variables[0]);
520 {
521 m_fwdTransOp = CreateFwdTransOp(m_expansionLists[0], m_variables[0]);
522 }
523 else
524 {
526 m_expansionLists[0], m_variables[0]);
528 m_expansionLists[0], m_variables[0]);
529 }
530
531 // Configure Time-integration
532 m_timeOp = TimeOp<double>::Create(m_expansionLists[0], m_variables[0]);
533 m_timeOp->DefineProjection(&UnsteadyADR::DoProjection, this);
534 m_timeOp->DefineImplicit(&UnsteadyADR::DoImplicit, this);
535 m_timeOp->DefineExplicitRhs(&UnsteadyADR::DoExplicitRhs, this);
536
537 // Switch on the projection type (Discontinuous or Continuous).
538 switch (m_projectionType)
539 {
541 {
542 // Create operators.
543 if (m_advection)
544 {
545 m_advectionWeakDGOp = AdvectionWeakDGOp<double>::Create(
546 m_expansionLists[0], m_variables[0]);
548 m_expansionLists[0], m_variables[0]);
549
550 // Set volume flux and Riemann solver for advection operator
551 m_advectionWeakDGOp->SetVolumeFluxOp(m_volumeFluxOp);
552
554 m_expansionLists[0], m_variables[0]);
555 m_advectionWeakDGOp->SetTraceFlux(m_traceFluxOp);
556
557 // Set up trace advection velocity on trace for upwind
558 // solver
559 m_traceAdvVel = LibUtilities::Field<double, FieldState::Phys>(
560 "traceAdvVel",
563 m_expansionLists[0]),
564 m_coordim, m_npointsZ);
565
566 // extract advection trace
567 auto physTraceExtractOp = PhysTraceExtractOp<double>::Create(
568 m_expansionLists[0], m_advectionVel.GetComponentNames());
569 physTraceExtractOp->Apply(m_advectionVel, m_traceAdvVel);
570 // the trace flux reads it through a pointer from here on
571 m_traceFluxOp->SetTraceAdvVel(m_traceAdvVel);
572
573 // Set advection velocity in volume flux
574 m_volumeFluxOp->SetAdvVel(m_advectionVel);
575 }
576 if (m_diffusion)
577 {
578 m_diffusionIPOp = DiffusionIPOp<double>::Create(
579 m_expansionLists[0], m_variables[0]);
580 auto diffusionScalarVolFluxOp =
582 m_expansionLists[0], m_variables[0]);
583
584 auto diffusionScalarIPTraceFluxOp =
586 m_expansionLists[0], m_variables[0]);
587
588 diffusionScalarVolFluxOp->SetDiffCoeff(m_diffCoeff);
589 diffusionScalarIPTraceFluxOp->SetDiffCoeff(m_diffCoeff);
590
591 m_diffusionIPOp->SetVolumeFluxOp(diffusionScalarVolFluxOp);
592 m_diffusionIPOp->SetTraceFluxOp(diffusionScalarIPTraceFluxOp);
593 }
594 break;
595 }
597 {
598 // Explicit operators.
600 {
602 m_expansionLists[0], m_variables[0]);
604 }
606 {
607 // To be completed
608 }
609
610 // Implicit operators.
612 {
613 m_linearSolverOp = LinearSolverOp<double>::Create(
614 m_expansionLists[0], m_session->GetVariables());
615 auto linearADRSolveOp = LinearADRSolveOp<double>::Create(
616 m_expansionLists[0], m_session->GetVariables());
617 linearADRSolveOp->SetLinearSolver(m_linearSolverOp);
619 {
620 linearADRSolveOp->SetVarDiffCoeff(m_varDiffCoeff);
621 }
622 else
623 {
624 linearADRSolveOp->SetDiffCoeff(m_diffCoeff);
625 }
626 linearADRSolveOp->SetAdvVel(m_advectionVel);
627 m_linearSystemOp = linearADRSolveOp;
628 }
629 else if (m_implicitDiffusion)
630 {
632 {
633 m_linearSolverOp = LinearSolverOp<double>::Create(
634 m_expansionLists[0], m_session->GetVariables(),
635 "ConjGrad");
636 }
637 else
638 {
639 m_linearSolverOp = LinearSolverOp<double>::Create(
640 m_expansionLists[0], m_session->GetVariables());
641 }
642 auto helmSolveOp = HelmSolveOp<double>::Create(
643 m_expansionLists[0], m_session->GetVariables());
644 helmSolveOp->SetLinearSolver(m_linearSolverOp);
646 {
647 helmSolveOp->SetVarDiffCoeff(m_varDiffCoeff);
648 }
649 else
650 {
651 helmSolveOp->SetDiffCoeff(m_diffCoeff);
static std::shared_ptr< DiffusionScalarIPTraceFluxOp< TData > > Create(const MultiRegions::ExpListSharedPtr &expansionList, const std::vector< std::string > &components, const std::string &execStr="")
Create the implementation for the requested execution space.
static std::shared_ptr< DiffusionScalarVolFluxOp< TData > > Create(const MultiRegions::ExpListSharedPtr &expansionList, const std::vector< std::string > &components, const std::string &execStr="")
std::vector< std::string > GetComponentNames() const
Gets a copy of the components names for a vector field.
static std::shared_ptr< LinearAdvVolumeFluxOp< TData > > Create(const MultiRegions::ExpListSharedPtr &expansionList, const std::vector< std::string > &components, const std::string &execStr="")
static std::shared_ptr< AdvectionOp< TData > > Create(const MultiRegions::ExpListSharedPtr &expansionList, const std::vector< std::string > &components, const std::string &execStr="", const std::string &implStr="")
Build a complete advection operator through the operator and block-operator factories.
static std::shared_ptr< BwdTransOp< TData > > Create(const MultiRegions::ExpListSharedPtr &expansionList, const std::vector< std::string > &components, const std::string &execStr="", const std::string &implStr="")
Create a backward-transform operator through the operator and block-operator factories.
static std::shared_ptr< IProductWRTBaseOp< TData > > Create(const MultiRegions::ExpListSharedPtr &expansionList, const std::vector< std::string > &components, const std::string &execStr="", const std::string &implStr="")
Build a complete IProductWRTBase operator through the operator and block-operator factories.
static std::shared_ptr< MultiplyByElmtInvMassOp< TData > > Create(const MultiRegions::ExpListSharedPtr &expansionList, const std::vector< std::string > &components, const std::string &execStr="", const std::string &implStr="")
Build a complete element-wise inverse mass operator through the operator and block-operator factories...
static std::shared_ptr< PhysTraceExtractOp< TData > > Create(const MultiRegions::ExpListSharedPtr &expansionList, const std::vector< std::string > &components, const std::string &execStr="", const std::string &implStr="")
Create a trace extraction operator through the operator and block-operator factories.
static std::shared_ptr< ScalarTraceFluxOp< TData > > Create(const MultiRegions::ExpListSharedPtr &expansionList, const std::vector< std::string > &components, const std::string &solverType="", const std::string &execStr="")
Create the implementation registered for solverType.
void v_InitialiseOperators() override
LibUtilities::Field< double, FieldState::Phys > m_traceAdvVel
The advection velocity on the local trace, which the trace flux operator reads through a pointer; kep...
std::shared_ptr< LinearSolverOp< double > > m_linearSolverOp
std::shared_ptr< SolverCore::TraceFluxOp< double > > m_traceFluxOp
std::shared_ptr< MultiplyByElmtInvMassOp< double > > m_multiplyByElmtInvMassOp
void DoExplicitRhs(LibUtilities::Field< double, FieldState::Phys > &in, LibUtilities::Field< double, FieldState::Phys > &out, const double &time, const double &dt)
void DoProjection(LibUtilities::Field< double, FieldState::Phys > &in, LibUtilities::Field< double, FieldState::Phys > &out, const double &time)
Project onto the solution space: a copy for DG, a forward and backward transform with the Dirichlet v...
std::shared_ptr< LinearAdvVolumeFluxOp< double > > m_volumeFluxOp
std::shared_ptr< IProductWRTBaseOp< double > > m_iProductWRTBaseOp
std::vector< BlockAttributes< TState > > GetLocTraceBlockAttributes(const MultiRegions::ExpListSharedPtr explist, const unsigned interleave_width, const bool useGLLTracePoints)

References m_diffCoeff, and m_epsilon.

Referenced by v_InitObject().

◆ v_InitObject()

void Nektar::UnsteadyADR::v_InitObject ( bool  declareExpansionLists = true)
overrideprotectedvirtual

Initialisation object for the UnsteadyADR problem.

Load parameters from session

Create Fields for solution m_phys, m_coeff and others

Reimplemented from Nektar::SolverUtils::EquationSystem.

Definition at line 82 of file UnsteadyADR.cpp.

83{
84 // Call to the initialisation object of EquationSystem
85 UnsteadySystem::v_InitObject(declareExpansionLists);
86
87 /// Load parameters from session
89
90 /// Create Fields for solution m_phys, m_coeff and others
91 v_InitialiseFields();
92
93 // Set advection velocity
95
96 // Set up diffusion Coeff.
98
99 // Create and initialise all operators
101}
SOLVER_UTILS_EXPORT void v_InitObject(bool DeclareField=true) override
Init object for UnsteadySystem class.

References LoadSessionParameters(), SetAdvectionVel(), SetDiffusionCoeff(), v_InitialiseOperators(), and Nektar::SolverUtils::UnsteadySystem::v_InitObject().

Friends And Related Symbol Documentation

◆ MemoryManager< UnsteadyADR >

friend class MemoryManager< UnsteadyADR >
friend

Definition at line 1 of file UnsteadyADR.h.

Member Data Documentation

◆ className0

std::string Nektar::UnsteadyADR::className0
static
Initial value:
=
tKey RegisterCreatorFunction(tKey idKey, CreatorFunction classCreator, std::string pDesc="")
Register a class with the factory.
static EquationSystemSharedPtr create(const LibUtilities::SessionReaderSharedPtr &pSession, const SpatialDomains::MeshGraphSharedPtr &pGraph)
Creates an instance of this class.
Definition UnsteadyADR.h:76
EquationSystemFactory & GetEquationSystemFactory()

Name of class.

Definition at line 87 of file UnsteadyADR.h.

◆ className1

std::string Nektar::UnsteadyADR::className1
static
Initial value:

Definition at line 88 of file UnsteadyADR.h.

◆ className2

std::string Nektar::UnsteadyADR::className2
static
Initial value:

Definition at line 89 of file UnsteadyADR.h.

◆ m_advection

bool Nektar::UnsteadyADR::m_advection = false
protected

Definition at line 103 of file UnsteadyADR.h.

Referenced by v_GenerateSummary().

◆ m_advectionCGOp

std::shared_ptr<AdvectionOp<double> > Nektar::UnsteadyADR::m_advectionCGOp
protected

Definition at line 123 of file UnsteadyADR.h.

◆ m_advectionVel

LibUtilities::Field<double, FieldState::Phys> Nektar::UnsteadyADR::m_advectionVel
protected

Definition at line 111 of file UnsteadyADR.h.

Referenced by LoadSessionParameters().

◆ m_advectionWeakDGOp

std::shared_ptr<AdvectionWeakDGOp<double> > Nektar::UnsteadyADR::m_advectionWeakDGOp
protected

Definition at line 124 of file UnsteadyADR.h.

◆ m_bwdTransOp

std::shared_ptr<BwdTransOp<double> > Nektar::UnsteadyADR::m_bwdTransOp
protected

Definition at line 117 of file UnsteadyADR.h.

Referenced by DoImplicit().

◆ m_diffCoeff

std::vector<double> Nektar::UnsteadyADR::m_diffCoeff
protected

Definition at line 94 of file UnsteadyADR.h.

Referenced by SetAdvectionVel(), SetDiffusionCoeff(), and v_InitialiseOperators().

◆ m_diffusion

bool Nektar::UnsteadyADR::m_diffusion = false
protected

Definition at line 104 of file UnsteadyADR.h.

Referenced by SetDiffusionCoeff(), and v_GenerateSummary().

◆ m_diffusionIPOp

std::shared_ptr<DiffusionIPOp<double> > Nektar::UnsteadyADR::m_diffusionIPOp
protected

Definition at line 127 of file UnsteadyADR.h.

◆ m_epsilon

double Nektar::UnsteadyADR::m_epsilon
protected

Definition at line 93 of file UnsteadyADR.h.

Referenced by SetDiffusionCoeff(), and v_InitialiseOperators().

◆ m_explicitAdvection

bool Nektar::UnsteadyADR::m_explicitAdvection = false
protected

Definition at line 105 of file UnsteadyADR.h.

Referenced by v_GenerateSummary().

◆ m_explicitDiffusion

bool Nektar::UnsteadyADR::m_explicitDiffusion = false
protected

Definition at line 106 of file UnsteadyADR.h.

Referenced by v_GenerateSummary().

◆ m_forcing

std::vector<ForcingSharedPtr> Nektar::UnsteadyADR::m_forcing
protected

Definition at line 131 of file UnsteadyADR.h.

◆ m_fwdTransOp

std::shared_ptr<FwdTransOp<double> > Nektar::UnsteadyADR::m_fwdTransOp
protected

Definition at line 119 of file UnsteadyADR.h.

Referenced by DoImplicit().

◆ m_implicitAdvection

bool Nektar::UnsteadyADR::m_implicitAdvection = false
protected

Definition at line 107 of file UnsteadyADR.h.

◆ m_implicitDiffusion

bool Nektar::UnsteadyADR::m_implicitDiffusion = false
protected

Definition at line 108 of file UnsteadyADR.h.

Referenced by SetDiffusionCoeff().

◆ m_iProductWRTBaseOp

std::shared_ptr<IProductWRTBaseOp<double> > Nektar::UnsteadyADR::m_iProductWRTBaseOp
protected

Definition at line 121 of file UnsteadyADR.h.

◆ m_isTimeDependentDiffCoeff

bool Nektar::UnsteadyADR::m_isTimeDependentDiffCoeff = false
protected

Definition at line 99 of file UnsteadyADR.h.

Referenced by SetDiffusionCoeff().

◆ m_lambda

double Nektar::UnsteadyADR::m_lambda
protected

Definition at line 102 of file UnsteadyADR.h.

◆ m_linearSolverOp

std::shared_ptr<LinearSolverOp<double> > Nektar::UnsteadyADR::m_linearSolverOp
protected

Definition at line 129 of file UnsteadyADR.h.

◆ m_linearSystemOp

std::shared_ptr<LinearSystemOp<double> > Nektar::UnsteadyADR::m_linearSystemOp
protected

Definition at line 128 of file UnsteadyADR.h.

◆ m_multiplyByElmtInvMassOp

std::shared_ptr<MultiplyByElmtInvMassOp<double> > Nektar::UnsteadyADR::m_multiplyByElmtInvMassOp
protected

Definition at line 122 of file UnsteadyADR.h.

◆ m_preconOp

std::map<double, std::shared_ptr<PreconOp<double> > > Nektar::UnsteadyADR::m_preconOp
protected

Definition at line 130 of file UnsteadyADR.h.

◆ m_traceAdvVel

LibUtilities::Field<double, FieldState::Phys> Nektar::UnsteadyADR::m_traceAdvVel
protected

The advection velocity on the local trace, which the trace flux operator reads through a pointer; kept here so that it outlives it.

Definition at line 114 of file UnsteadyADR.h.

◆ m_traceFluxOp

std::shared_ptr<SolverCore::TraceFluxOp<double> > Nektar::UnsteadyADR::m_traceFluxOp
protected

Definition at line 126 of file UnsteadyADR.h.

◆ m_varDiffCoeff

LibUtilities::Field<double, FieldState::Phys> Nektar::UnsteadyADR::m_varDiffCoeff
protected

Definition at line 96 of file UnsteadyADR.h.

Referenced by SetDiffusionCoeff().

◆ m_varDiffCoeffFunction

SessionFunctionSharedPtr Nektar::UnsteadyADR::m_varDiffCoeffFunction
protected

Definition at line 97 of file UnsteadyADR.h.

Referenced by SetDiffusionCoeff().

◆ m_volumeFluxOp

std::shared_ptr<LinearAdvVolumeFluxOp<double> > Nektar::UnsteadyADR::m_volumeFluxOp
protected

Definition at line 125 of file UnsteadyADR.h.