46#include <SolverCore/Advection/AdvectionWeakDG/AdvectionWeakDGOp.hpp>
47#include <SolverCore/Core/SessionFunction.h>
48#include <SolverCore/Diffusion/DiffusionIP/DiffusionIPOp.hpp>
49#include <SolverCore/GlobalLinSysOps/LinearSolvers/LinearSolverOp.hpp>
50#include <SolverCore/GlobalLinSysOps/LinearSystems/FwdTrans/FwdTransOp.hpp>
51#include <SolverCore/GlobalLinSysOps/LinearSystems/HelmSolve/HelmSolveOp.hpp>
52#include <SolverCore/GlobalLinSysOps/LinearSystems/LinearADRSolve/LinearADRSolveOp.hpp>
53#include <SolverCore/GlobalLinSysOps/LinearSystems/LinearSystemOp.hpp>
54#include <SolverCore/GlobalLinSysOps/LinearSystems/PoissonSolve/PoissonSolveOp.hpp>
55#include <SolverCore/PreconOps/PreconOp.hpp>
56#include <SolverCore/TimeOps/TimeOp.hpp>
57#include <SolverCore/TraceFlux/TraceFluxOp.hpp>
61using namespace MultiRegions;
119 std::stringstream ss;
123| \| | ___| | _| |_ __ _ _ __ _| |_ _| |_
124| . ` |/ _ \ |/ / __/ _` | '__|_ _|_ _|
125| |\ | __/ <| || (_| | | |_| |_|
126\_| \_/\___|_|\_\\__\__,_|_|
129 _ __ ___ __| | ___ ___ _ __ _ _ __ ___ __| |
130| '__/ _ \/ _` |/ _ \/ __| |/ _` | '_ \ / _ \/ _` |
131| | | __/ (_| | __/\__ \ | (_| | | | | __/ (_| |
132|_| \___|\__,_|\___||___/_|\__, |_| |_|\___|\__,_|
153 m_math.copy(in, out);
166 ASSERTL0(
false,
"Unsupported projection type.");
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)
177 if (
m_session->GetSolverInfo(
"EQTYPE") ==
"UnsteadyAdvection")
180 "Implicit time-stepping not supported for pure advection");
196 ASSERTL0(
false,
"Implicit/IMEX time-stepping not supported for DG");
216 std::dynamic_pointer_cast<LinearADRSolveOp<double>>(
231 PreconOp<double>::Create(m_expansionLists[0],
274 LibUtilities::Field<double, FieldState::Phys> &in,
275 LibUtilities::Field<double, FieldState::Phys> &out,
const double &time,
320 ASSERTL0(
false,
"Unsupported projection type.");
328 for (
unsigned int i = 0; i <
m_forcing.size(); ++i)
330 m_forcing[i]->SetAppend(hasExplicitTerm || i > 0);
335 if (!hasExplicitTerm &&
m_forcing.empty())
350 std::vector<std::string> vel = {
"Vx",
"Vy",
"Vz"};
351 vel.resize(m_coordim);
358 if ((
m_session->GetSolverInfo(
"EQTYPE") ==
"UnsteadyAdvection") ||
359 (
m_session->GetSolverInfo(
"EQTYPE") ==
"UnsteadyAdvectionDiffusion"))
362 m_session->MatchSolverInfo(
"ADVECTIONADVANCEMENT",
"Explicit",
367 if ((
m_session->GetSolverInfo(
"EQTYPE") ==
"UnsteadyDiffusion") ||
368 (
m_session->GetSolverInfo(
"EQTYPE") ==
"UnsteadyAdvectionDiffusion"))
371 m_session->MatchSolverInfo(
"DIFFUSIONADVANCEMENT",
"Explicit",
380 const auto nDiffCoeff = m_coordim * (m_coordim + 1) / 2;
388 else if (m_coordim == 2)
394 else if (m_coordim == 3)
414 if (
m_session->DefinesFunction(
"AdvectionVelocity"))
418 m_expansionLists[0]);
423 std::vector<std::string> vel = {
"Vx",
"Vy",
"Vz"};
424 vel.resize(m_coordim);
425 SessionFunction advectionVelocity(
m_session, m_expansionLists[0],
426 vel,
"AdvectionVelocity");
432 "not defined in session file.")
464 if (
m_session->DefinesFunction(
"DiffusionCoefficient"))
467 "Variable DiffusionCoefficient requires implicit diffusion");
469 std::vector<std::string> names = {
"D00",
"D01",
"D11",
470 "D02",
"D12",
"D22"};
471 names.resize(m_coordim * (m_coordim + 1) / 2);
474 m_expansionLists[0]);
476 "DiffusionCoefficient", bAtr_phys, names.size(),
m_npointsZ);
478 m_session, m_expansionLists[0], names,
"DiffusionCoefficient");
490 else if (m_coordim == 2)
497 else if (m_coordim == 3)
521 m_fwdTransOp = CreateFwdTransOp(m_expansionLists[0], m_variables[0]);
526 m_expansionLists[0], m_variables[0]);
528 m_expansionLists[0], m_variables[0]);
532 m_timeOp = TimeOp<double>::Create(m_expansionLists[0], m_variables[0]);
546 m_expansionLists[0], m_variables[0]);
548 m_expansionLists[0], m_variables[0]);
554 m_expansionLists[0], m_variables[0]);
559 m_traceAdvVel = LibUtilities::Field<double, FieldState::Phys>(
563 m_expansionLists[0]),
579 m_expansionLists[0], m_variables[0]);
580 auto diffusionScalarVolFluxOp =
582 m_expansionLists[0], m_variables[0]);
584 auto diffusionScalarIPTraceFluxOp =
586 m_expansionLists[0], m_variables[0]);
588 diffusionScalarVolFluxOp->SetDiffCoeff(
m_diffCoeff);
589 diffusionScalarIPTraceFluxOp->SetDiffCoeff(
m_diffCoeff);
602 m_expansionLists[0], m_variables[0]);
614 m_expansionLists[0],
m_session->GetVariables());
615 auto linearADRSolveOp = LinearADRSolveOp<double>::Create(
616 m_expansionLists[0],
m_session->GetVariables());
634 m_expansionLists[0],
m_session->GetVariables(),
640 m_expansionLists[0],
m_session->GetVariables());
642 auto helmSolveOp = HelmSolveOp<double>::Create(
643 m_expansionLists[0],
m_session->GetVariables());
659 ASSERTL0(
false,
"Unsupported projection type.");
677 m_math.zero(m_coeff[0]);
686 return UnsteadySystem::v_GetOutputFieldViews();
Whole-field interface of the advection element operator, which evaluates the convective term V ....
Public interface of the backward-transform (BwdTrans) element operator, which maps a field from coeff...
#define ASSERTL0(condition, msg)
#define NEKERROR(type, msg)
Assert Level 0 – Fundamental assert which is used whether in FULLDEBUG, DEBUG or OPT compilation mode...
Whole-field interface of the IProductWRTBase element operator, which takes a physical-space field to ...
Whole-field interface of the MultiplyByElmtInvMass element operator, which multiplies a coefficient-s...
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="")
A Field represents expansion data to be operated on.
std::vector< std::string > GetComponentNames() const
Gets a copy of the components names for a vector field.
tKey RegisterCreatorFunction(tKey idKey, CreatorFunction classCreator, std::string pDesc="")
Register a class with the factory.
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< 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.
NekDouble m_time
Current time of simulation.
SOLVER_UTILS_EXPORT void SetLambda(NekDouble lambda)
Set parameter m_lambda.
int m_npointsZ
number of points in Z direction (if homogeneous)
LibUtilities::SessionReaderSharedPtr m_session
The session reader.
enum MultiRegions::ProjectionType m_projectionType
Type of projection; e.g continuous or discontinuous.
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)
Base class for unsteady solvers.
SOLVER_UTILS_EXPORT void v_GenerateSummary(SummaryList &s) override
Print a summary of time stepping parameters.
SOLVER_UTILS_EXPORT void v_InitObject(bool DeclareField=true) override
Init object for UnsteadySystem class.
void v_InitialiseOperators() override
void DoImplicit(LibUtilities::Field< double, FieldState::Phys > &inout, LibUtilities::Field< double, FieldState::Phys > &out, const double &time, const double &lambda)
std::vector< double > m_diffCoeff
LibUtilities::Field< double, FieldState::Phys > m_traceAdvVel
The advection velocity on the local trace, which the trace flux operator reads through a pointer; kep...
LibUtilities::Field< double, FieldState::Phys > m_advectionVel
std::shared_ptr< LinearSolverOp< double > > m_linearSolverOp
SessionFunctionSharedPtr m_varDiffCoeffFunction
std::shared_ptr< SolverCore::TraceFluxOp< double > > m_traceFluxOp
UnsteadyADR(const LibUtilities::SessionReaderSharedPtr &pSession, const SpatialDomains::MeshGraphSharedPtr &pGraph)
std::shared_ptr< DiffusionIPOp< double > > m_diffusionIPOp
std::shared_ptr< LinearSystemOp< double > > m_linearSystemOp
std::map< double, std::shared_ptr< PreconOp< double > > > m_preconOp
std::shared_ptr< AdvectionWeakDGOp< double > > m_advectionWeakDGOp
static EquationSystemSharedPtr create(const LibUtilities::SessionReaderSharedPtr &pSession, const SpatialDomains::MeshGraphSharedPtr &pGraph)
Creates an instance of this class.
std::vector< ForcingSharedPtr > m_forcing
std::shared_ptr< AdvectionOp< double > > m_advectionCGOp
CFLVelocity v_GetCFLVelocity() override
Offer the advection velocity to the Courant estimate.
std::shared_ptr< MultiplyByElmtInvMassOp< double > > m_multiplyByElmtInvMassOp
static std::string className0
Name of class.
void SetDiffusionCoeff()
Set the diffusion Coeff. the diff. coeff., diffCoeff_{ij} := \epslion * D_{ij} where,...
void v_InitObject(bool declareExpansionLists=true) override
Initialisation object for the UnsteadyADR problem.
void v_GenerateSummary(SummaryList &s) override
Virtual function for generating summary information.
void LoadSessionParameters()
void DoExplicitRhs(LibUtilities::Field< double, FieldState::Phys > &in, LibUtilities::Field< double, FieldState::Phys > &out, const double &time, const double &dt)
std::shared_ptr< FwdTransOp< double > > m_fwdTransOp
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...
static std::string className2
CoefficientFieldViews v_GetOutputFieldViews() override
Project the solution to coefficients and return views of them.
bool m_isTimeDependentDiffCoeff
static std::string className1
std::shared_ptr< LinearAdvVolumeFluxOp< double > > m_volumeFluxOp
std::shared_ptr< IProductWRTBaseOp< double > > m_iProductWRTBaseOp
std::shared_ptr< BwdTransOp< double > > m_bwdTransOp
LibUtilities::Field< double, FieldState::Phys > m_varDiffCoeff
std::shared_ptr< SessionReader > SessionReaderSharedPtr
std::vector< BlockAttributes< TState > > GetLocTraceBlockAttributes(const MultiRegions::ExpListSharedPtr explist, const unsigned interleave_width, const bool useGLLTracePoints)
template std::vector< BlockAttributes< FieldState::Phys > > GetBlockAttributes< double, FieldState::Phys >(const MultiRegions::ExpListSharedPtr explist, const std::vector< unsigned int > &interleave_widths)
std::vector< std::pair< std::string, std::string > > SummaryList
EquationSystemFactory & GetEquationSystemFactory()
void AddSummaryItem(SummaryList &l, const std::string &name, const std::string &value)
Adds a summary item to the summary info list.
std::shared_ptr< MeshGraph > MeshGraphSharedPtr