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

#include <SteadyADR.h>

Inheritance diagram for Nektar::SteadyADR:
[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 className1
 Name of class.
 
static std::string className2
 
static std::string className3
 

Protected Member Functions

 SteadyADR (const LibUtilities::SessionReaderSharedPtr &pSession, const SpatialDomains::MeshGraphSharedPtr &pGraph)
 
 ~SteadyADR () override=default
 
void v_InitObject (bool declareExpansionLists=true) override
 Initialisation object for the SteadyADR problem.
 
void v_DoSolve () override
 Solves SteadyADR problem.
 
void v_GenerateSummary (SummaryList &s) override
 Virtual function for generating summary information.
 
void LoadSessionParameters ()
 
void v_InitialiseFields () override
 
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
 
- 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 void v_DoInitialise (bool dumpInitialConditions=true)
 Virtual function for initialisation implementation.
 
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
 
double m_lambda
 
std::vector< double > m_diffCoeff
 
LibUtilities::Field< double, FieldState::Phys > m_varDiffCoeff
 
SessionFunctionSharedPtr m_varDiffCoeffFunction
 
LibUtilities::Field< double, FieldState::Phys > m_fce
 
LibUtilities::Field< double, FieldState::Phys > m_advectionVel
 
std::shared_ptr< BwdTransOp< double > > m_bwdTransOp
 
std::shared_ptr< LinearSystemOp< double > > m_linearSystemOp
 
std::shared_ptr< LinearSolverOp< double > > m_linearSolverOp
 
std::shared_ptr< PreconOp< double > > m_preconOp
 
std::vector< ForcingSharedPtr > m_forcing
 
- 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
 

Friends

class MemoryManager< SteadyADR >
 

Additional Inherited Members

- 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.
 
- 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 59 of file SteadyADR.h.

Constructor & Destructor Documentation

◆ SteadyADR()

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

Definition at line 60 of file SteadyADR.cpp.

62 : EquationSystem(pSession, pGraph), m_epsilon(1.0), m_lambda(0.0)
63{
65 "The SteadyADR is only implemented for "
66 "projectionType Galerkin");
67}
#define ASSERTL0(condition, msg)
enum MultiRegions::ProjectionType m_projectionType
Type of projection; e.g continuous or discontinuous.
SOLVER_UTILS_EXPORT EquationSystem(const LibUtilities::SessionReaderSharedPtr &pSession, const SpatialDomains::MeshGraphSharedPtr &pGraph)
Initialises EquationSystem class members.

References ASSERTL0, Nektar::MultiRegions::eGalerkin, and Nektar::SolverUtils::EquationSystem::m_projectionType.

◆ ~SteadyADR()

Nektar::SteadyADR::~SteadyADR ( )
overrideprotecteddefault

Member Function Documentation

◆ create()

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

Creates an instance of this class.

Definition at line 65 of file SteadyADR.h.

68 {
71 equ->InitObject();
72 return equ;
73 }
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().

◆ LoadSessionParameters()

void Nektar::SteadyADR::LoadSessionParameters ( )
protected

Definition at line 127 of file SteadyADR.cpp.

143{
144 // Load lambda parameter for SteadyADR and Helmholtz problems.
145 m_session->LoadParameter("lambda", m_lambda, 0.0);
146
147 // Get diffusion parameters.
148 const auto nDiffCoeff = m_coordim * (m_coordim + 1) / 2;
149 m_diffCoeff.resize(nDiffCoeff);
150
151 m_session->LoadParameter("epsilon", m_epsilon, 1.0);
152 if (m_coordim == 1)
153 {
154 m_session->LoadParameter("D00", m_diffCoeff[0], 1.0);
155 }
156 else if (m_coordim == 2)
LibUtilities::SessionReaderSharedPtr m_session
The session reader.
std::vector< double > m_diffCoeff
Definition SteadyADR.h:84

Referenced by v_InitObject().

◆ SetAdvectionVel()

void Nektar::SteadyADR::SetAdvectionVel ( )
protected

Definition at line 177 of file SteadyADR.cpp.

179{
180 // Initialise solution "m_phys" via EquationSystem routine
181 EquationSystem::v_InitialiseFields();
182
184 m_expansionLists[0]);
185 m_fce = LibUtilities::Field<double, FieldState::Phys>(
186 "m_fce", bAtr_phys, m_variables[0], m_npointsZ);
187}
188
189/*
190 * @brief Sets the Advection Veclocity
191 */
193{
194 if (m_session->GetSolverInfo("EQTYPE") == "SteadyADR")
195 {
196 // Read advection velocity from session.
197 if (m_session->DefinesFunction("AdvectionVelocity"))
198 {
199 auto bAtr_phys =
201 m_expansionLists[0]);
202 m_advectionVel = LibUtilities::Field<double, FieldState::Phys>(
203 "advVel", bAtr_phys, m_coordim, m_npointsZ);
int m_npointsZ
number of points in Z direction (if homogeneous)
LibUtilities::Field< double, FieldState::Phys > m_advectionVel
Definition SteadyADR.h:91
LibUtilities::Field< double, FieldState::Phys > m_fce
Definition SteadyADR.h:90
template std::vector< BlockAttributes< FieldState::Phys > > GetBlockAttributes< double, FieldState::Phys >(const MultiRegions::ExpListSharedPtr explist, const std::vector< unsigned int > &interleave_widths)

References Nektar::MultiRegions::GetBlockAttributes< double, FieldState::Phys >(), m_fce, and Nektar::SolverUtils::EquationSystem::m_npointsZ.

Referenced by v_InitObject().

◆ SetDiffusionCoeff()

void Nektar::SteadyADR::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 228 of file SteadyADR.cpp.

228 {ij}, then
229 * Case 1: For 1D
230 * Vec[0] = D_{00}
231 * Case 2: For 2D
232 * Vec[0] = D_{00}
233 * Vec[1] = D_{01}
234 * Vec[2] = D_{11}
235 * Case 3: For 3D
236 * Vec[0] = D_{00}
237 * Vec[1] = D_{01}
238 * Vec[2] = D_{11}
239 * Vec[3] = D_{02}
240 * Vec[4] = D_{12}
241 * Vec[5] = D_{22}
242 */
244{
245 // Optional physical tensor, in the same D00,D01,D11,D02,D12,D22 order
246 // as the constant parameters. epsilon scales every tensor component.
247 if (m_session->DefinesFunction("DiffusionCoefficient"))
248 {
249 std::vector<std::string> names = {"D00", "D01", "D11",
250 "D02", "D12", "D22"};
251 names.resize(m_coordim * (m_coordim + 1) / 2);
252 auto bAtr_phys =
254 m_expansionLists[0]);
255 m_varDiffCoeff = LibUtilities::Field<double, FieldState::Phys>(
256 "DiffusionCoefficient", bAtr_phys, names.size(), m_npointsZ);
257 m_varDiffCoeffFunction = std::make_shared<SessionFunction>(
258 m_session, m_expansionLists[0], names, "DiffusionCoefficient");
261 }
262 else
263 {
264 if (m_coordim == 1)
265 {
266 // Multiply by Scalar Part
268 }
269 else if (m_coordim == 2)
270 {
271 // Multiply by Scalar Part
NekDouble m_time
Current time of simulation.
LibUtilities::Field< double, FieldState::Phys > m_varDiffCoeff
Definition SteadyADR.h:86
void SetDiffusionCoeff()
Set the diffusion Coeff. the diff. coeff., diffCoeff_{ij} := \epslion * D_{ij} where,...
SessionFunctionSharedPtr m_varDiffCoeffFunction
Definition SteadyADR.h:87

References Nektar::MultiRegions::GetBlockAttributes< double, FieldState::Phys >(), m_diffCoeff, m_epsilon, 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_DoSolve()

void Nektar::SteadyADR::v_DoSolve ( void  )
overrideprotectedvirtual

Solves SteadyADR problem.

Reimplemented from Nektar::SolverUtils::EquationSystem.

Definition at line 96 of file SteadyADR.cpp.

97{
98 // Evaluate forcing terms. The first forcing assigns into the workspace;
99 // subsequent forcings append.
100 for (unsigned int i = 0; i < m_forcing.size(); ++i)
101 {
102 m_forcing[i]->SetAppend(i > 0);
103 m_forcing[i]->Apply(m_fce, m_fce, m_time);
104 }
105
106 // Zero the forcing if there is none.
107 if (m_forcing.empty())
108 {
109 m_math.zero(m_fce);
110 }
111
112 // Apply method for solving the SteadyADR problem
113 m_linearSystemOp->Apply(m_fce, m_coeff[0]);
114 m_bwdTransOp->Apply(m_coeff[0], m_phys[0]);
115}
std::vector< ForcingSharedPtr > m_forcing
Definition SteadyADR.h:98
std::shared_ptr< BwdTransOp< double > > m_bwdTransOp
Definition SteadyADR.h:94
std::shared_ptr< LinearSystemOp< double > > m_linearSystemOp
Definition SteadyADR.h:95

References m_bwdTransOp, m_fce, m_forcing, m_linearSystemOp, and Nektar::SolverUtils::EquationSystem::m_time.

◆ v_GenerateSummary()

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

Virtual function for generating summary information.

Reimplemented from Nektar::SolverUtils::EquationSystem.

Definition at line 117 of file SteadyADR.cpp.

118{
120 AddSummaryItem(s, "Equations", "Advection-Diffusion-Reaction");
121
122 std::stringstream ss;
123 ss << R"(
124 _ _ _ _
125| \ | | | | | | _ _
virtual SOLVER_UTILS_EXPORT void v_GenerateSummary(SummaryList &l)
Virtual function for generating summary information.
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(), and Nektar::SolverUtils::EquationSystem::v_GenerateSummary().

◆ v_InitialiseFields()

void Nektar::SteadyADR::v_InitialiseFields ( )
overrideprotected

Definition at line 163 of file SteadyADR.cpp.

163 {
164 m_session->LoadParameter("D00", m_diffCoeff[0], 1.0);
165 m_session->LoadParameter("D01", m_diffCoeff[1], 0.0);
166 m_session->LoadParameter("D11", m_diffCoeff[2], 1.0);
167 m_session->LoadParameter("D02", m_diffCoeff[3], 0.0);
168 m_session->LoadParameter("D12", m_diffCoeff[4], 0.0);
169 m_session->LoadParameter("D22", m_diffCoeff[5], 1.0);
170 }
171}
172

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

Referenced by v_InitObject().

◆ v_InitialiseOperators()

void Nektar::SteadyADR::v_InitialiseOperators ( )
overrideprotected

Definition at line 277 of file SteadyADR.cpp.

277 {
278 // Multiply by Scalar Part
285 }
286 }
287}
288
289/*
290 * Create and initialise all operators for this solver
291 */
293{
295 BwdTransOp<double>::Create(m_expansionLists[0], m_variables[0]);
296
297 // Create LinearADRSolve, preconditioner, and linear system operators
298 m_preconOp = PreconOp<double>::Create(m_expansionLists[0],
299 m_session->GetVariables());
300 m_linearSolverOp = LinearSolverOp<double>::Create(
301 m_expansionLists[0], m_session->GetVariables());
302
303 if (m_session->GetSolverInfo("EQTYPE") == "SteadyADR")
304 {
305 auto linearADRSolveOp = LinearADRSolveOp<double>::Create(
306 m_expansionLists[0], m_session->GetVariables());
307 linearADRSolveOp->SetLinearSolver(m_linearSolverOp);
308 linearADRSolveOp->SetLambda(m_lambda);
310 {
311 linearADRSolveOp->SetVarDiffCoeff(m_varDiffCoeff);
312 }
313 else
314 {
315 linearADRSolveOp->SetDiffCoeff(m_diffCoeff);
316 }
317 linearADRSolveOp->SetAdvVel(m_advectionVel);
318 linearADRSolveOp->SetPrecon(m_preconOp);
319 linearADRSolveOp->UpdatePrecon();
320 m_linearSystemOp = linearADRSolveOp;
321 }
322 else if (m_session->GetSolverInfo("EQTYPE") == "Helmholtz")
323 {
324 auto helmSolveOp = HelmSolveOp<double>::Create(
325 m_expansionLists[0], m_session->GetVariables());
326 helmSolveOp->SetLambda(m_lambda);
327 helmSolveOp->SetLinearSolver(m_linearSolverOp);
329 {
330 helmSolveOp->SetVarDiffCoeff(m_varDiffCoeff);
331 }
332 else
333 {
334 helmSolveOp->SetDiffCoeff(m_diffCoeff);
335 }
336 helmSolveOp->SetPrecon(m_preconOp);
337 helmSolveOp->UpdatePrecon();
338 m_linearSystemOp = helmSolveOp;
339 }
340 else if (m_session->GetSolverInfo("EQTYPE") == "Poisson")
341 {
342 auto poissonSolveOp = PoissonSolveOp<double>::Create(
343 m_expansionLists[0], m_session->GetVariables());
344 poissonSolveOp->SetLinearSolver(m_linearSolverOp);
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.
std::shared_ptr< LinearSolverOp< double > > m_linearSolverOp
Definition SteadyADR.h:96
void v_InitialiseOperators() override
std::shared_ptr< PreconOp< double > > m_preconOp
Definition SteadyADR.h:97

References m_diffCoeff, and m_epsilon.

Referenced by v_InitObject().

◆ v_InitObject()

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

Initialisation object for the SteadyADR problem.

Load parameters from session

Create Fields for solution m_phys, m_coeff and others

Reimplemented from Nektar::SolverUtils::EquationSystem.

Definition at line 72 of file SteadyADR.cpp.

73{
74 // Call to the initialisation object of EquationSystem
75 EquationSystem::v_InitObject(declareExpansionLists);
76
77 /// Load parameters from session
79
80 /// Create Fields for solution m_phys, m_coeff and others
82
83 // Set advection velocity
85
86 // Set up diffusion Coeff.
88
89 // Create and initialise all operators
91}
virtual SOLVER_UTILS_EXPORT void v_InitObject(bool DeclareFeld=true)
Initialisation object for EquationSystem.
void LoadSessionParameters()
void v_InitialiseFields() override

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

Friends And Related Symbol Documentation

◆ MemoryManager< SteadyADR >

friend class MemoryManager< SteadyADR >
friend

Definition at line 1 of file SteadyADR.h.

Member Data Documentation

◆ className1

std::string Nektar::SteadyADR::className1
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 SteadyADR.h:65
EquationSystemFactory & GetEquationSystemFactory()

Name of class.

Definition at line 76 of file SteadyADR.h.

◆ className2

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

Definition at line 77 of file SteadyADR.h.

◆ className3

std::string Nektar::SteadyADR::className3
static
Initial value:

Definition at line 78 of file SteadyADR.h.

◆ m_advectionVel

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

Definition at line 91 of file SteadyADR.h.

◆ m_bwdTransOp

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

Definition at line 94 of file SteadyADR.h.

Referenced by v_DoSolve().

◆ m_diffCoeff

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

Definition at line 84 of file SteadyADR.h.

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

◆ m_epsilon

double Nektar::SteadyADR::m_epsilon
protected

Definition at line 82 of file SteadyADR.h.

Referenced by SetDiffusionCoeff(), and v_InitialiseOperators().

◆ m_fce

LibUtilities::Field<double, FieldState::Phys> Nektar::SteadyADR::m_fce
protected

Definition at line 90 of file SteadyADR.h.

Referenced by SetAdvectionVel(), and v_DoSolve().

◆ m_forcing

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

Definition at line 98 of file SteadyADR.h.

Referenced by v_DoSolve().

◆ m_lambda

double Nektar::SteadyADR::m_lambda
protected

Definition at line 83 of file SteadyADR.h.

◆ m_linearSolverOp

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

Definition at line 96 of file SteadyADR.h.

◆ m_linearSystemOp

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

Definition at line 95 of file SteadyADR.h.

Referenced by v_DoSolve().

◆ m_preconOp

std::shared_ptr<PreconOp<double> > Nektar::SteadyADR::m_preconOp
protected

Definition at line 97 of file SteadyADR.h.

◆ m_varDiffCoeff

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

Definition at line 86 of file SteadyADR.h.

Referenced by SetDiffusionCoeff().

◆ m_varDiffCoeffFunction

SessionFunctionSharedPtr Nektar::SteadyADR::m_varDiffCoeffFunction
protected

Definition at line 87 of file SteadyADR.h.

Referenced by SetDiffusionCoeff().