37#include <boost/core/ignore_unused.hpp>
69 m_session->MatchSolverInfo(
"SpectralVanishingViscosity",
"True",
71 m_session->MatchSolverInfo(
"SpectralVanishingViscosity",
"VarDiff",
90 ASSERTL0(
false,
"Need to implement for DG");
97 m_session->LoadSolverInfo(
"AdvectionType", advName,
"WeakDG");
102 m_session->LoadSolverInfo(
"UpwindType", riemName,
"Upwind");
110 std::string diffName;
111 m_session->LoadSolverInfo(
"DiffusionType", diffName,
"LDG");
125 m_session->LoadSolverInfo(
"AdvectionType", advName,
135 for (
int i = 0; i <
m_fields.size(); ++i)
145 ASSERTL0(
false,
"Explicit Galerkin diffusion not set up.");
152 ASSERTL0(
false,
"Unsupported projection type.");
196 for (i = 0; i < inarray.size(); ++i)
198 m_fields[0]->ExtractTracePhys(inarray[i], tmp);
220 int nVariables = inarray.size();
227 for (
int i = 0; i < nVariables; ++i)
236 for (
int i = 0; i < nVariables; ++i)
246 for (
int i = 0; i < nVariables; ++i)
248 Vmath::Vadd(nSolutionPts, &outarray[i][0], 1, &outarrayDiff[i][0],
249 1, &outarray[i][0], 1);
257 x->Apply(
m_fields, inarray, outarray, time);
274 int nvariables = inarray.size();
281 if (inarray != outarray)
285 for (i = 0; i < nvariables; ++i)
299 ASSERTL0(
false,
"Unknown projection scheme");
317 int nvariables = inarray.size();
332 for (
int n = 1; n < nvariables; ++n)
334 F[n] = F[n - 1] + nq;
341 for (
int i = 0; i < nvariables; ++i)
358 for (
int i = 0; i <
m_fields.size(); ++i)
360 m_fields[i]->ClearGlobalLinSysManager();
367 for (
int i = 0; i < nvariables; ++i)
388 const int nq =
m_fields[0]->GetNpoints();
390 for (
int i = 0; i < flux.size(); ++i)
392 for (
int j = 0; j < flux[0].size(); ++j)
394 Vmath::Vmul(nq, physfield[i], 1, physfield[j], 1, flux[i][j], 1);
413 boost::ignore_unused(inarray);
415 unsigned int nDim = qfield.size();
416 unsigned int nConvectiveFields = qfield[0].size();
417 unsigned int nPts = qfield[0][0].size();
419 for (
unsigned int j = 0; j < nDim; ++j)
421 for (
unsigned int i = 0; i < nConvectiveFields; ++i)
#define ASSERTL0(condition, msg)
tKey RegisterCreatorFunction(tKey idKey, CreatorFunction classCreator, std::string pDesc="")
Register a class with the factory.
tBaseSharedPtr CreateInstance(tKey idKey, tParam... args)
Create an instance of the class referred to by idKey.
void DefineProjection(FuncPointerT func, ObjectPointerT obj)
void DefineOdeRhs(FuncPointerT func, ObjectPointerT obj)
void DefineImplicitSolve(FuncPointerT func, ObjectPointerT obj)
A base class for PDEs which include an advection component.
SolverUtils::AdvectionSharedPtr m_advObject
Advection term.
virtual SOLVER_UTILS_EXPORT void v_InitObject(bool DeclareField=true) override
Init object for UnsteadySystem class.
SOLVER_UTILS_EXPORT int GetTraceNpoints()
Array< OneD, MultiRegions::ExpListSharedPtr > m_fields
Array holding all dependent variables.
LibUtilities::SessionReaderSharedPtr m_session
The session reader.
Array< OneD, Array< OneD, NekDouble > > m_traceNormals
Array holding trace normals for DG simulations in the forwards direction.
SOLVER_UTILS_EXPORT int GetNpoints()
enum MultiRegions::ProjectionType m_projectionType
Type of projection; e.g continuous or discontinuous.
SOLVER_UTILS_EXPORT void SetBoundaryConditions(NekDouble time)
Evaluates the boundary conditions at the given time.
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.
LibUtilities::TimeIntegrationSchemeOperators m_ode
The time integration scheme operators to use.
bool m_explicitDiffusion
Indicates if explicit or implicit treatment of diffusion is used.
virtual SOLVER_UTILS_EXPORT void v_GenerateSummary(SummaryList &s) override
Print a summary of time stepping parameters.
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 t...
bool m_homoInitialFwd
Flag to determine if simulation should start in homogeneous forward transformed state.
Array< OneD, NekDouble > m_traceVn
bool m_useSpecVanViscVarDiff
static std::string className
Name of class.
void GetFluxVectorAdv(const Array< OneD, Array< OneD, NekDouble > > &physfield, Array< OneD, Array< OneD, Array< OneD, NekDouble > > > &flux)
Evaluate the flux at each solution point for the advection part.
virtual ~UnsteadyViscousBurgers()
Destructor.
static SolverUtils::EquationSystemSharedPtr create(const LibUtilities::SessionReaderSharedPtr &pSession, const SpatialDomains::MeshGraphSharedPtr &pGraph)
Creates an instance of this class.
virtual void v_GenerateSummary(SolverUtils::SummaryList &s) override
Print Summary.
void GetFluxVectorDiff(const Array< OneD, Array< OneD, NekDouble > > &inarray, const Array< OneD, Array< OneD, Array< OneD, NekDouble > > > &qfield, Array< OneD, Array< OneD, Array< OneD, NekDouble > > > &viscousTensor)
Evaluate the flux at each solution point for the diffusion part.
Array< OneD, NekDouble > & GetNormalVelocity(Array< OneD, Array< OneD, NekDouble > > &inarray)
Get the normal velocity.
void DoImplicitSolve(const Array< OneD, const Array< OneD, NekDouble > > &inarray, Array< OneD, Array< OneD, NekDouble > > &outarray, NekDouble time, NekDouble lambda)
Solve implicitly the diffusion term.
SolverUtils::DiffusionSharedPtr m_diffusion
std::vector< SolverUtils::ForcingSharedPtr > m_forcing
Forcing terms.
UnsteadyViscousBurgers(const LibUtilities::SessionReaderSharedPtr &pSession, const SpatialDomains::MeshGraphSharedPtr &pGraph)
Session reader.
NekDouble m_sVVCutoffRatio
void DoOdeProjection(const Array< OneD, const Array< OneD, NekDouble > > &inarray, Array< OneD, Array< OneD, NekDouble > > &outarray, const NekDouble time)
Perform the projection.
virtual void v_InitObject(bool DeclareFields=true) override
Initialise the object.
SolverUtils::RiemannSolverSharedPtr m_riemannSolver
void DoOdeRhs(const Array< OneD, const Array< OneD, NekDouble > > &inarray, Array< OneD, Array< OneD, NekDouble > > &outarray, const NekDouble time)
Compute the RHS.
StdRegions::VarCoeffMap m_varCoeffLap
Variable Coefficient map for the Laplacian which can be activated as part of SVV or otherwise.
std::shared_ptr< SessionReader > SessionReaderSharedPtr
@ eMixed_CG_Discontinuous
AdvectionFactory & GetAdvectionFactory()
Gets the factory for initialising advection objects.
std::vector< std::pair< std::string, std::string > > SummaryList
DiffusionFactory & GetDiffusionFactory()
EquationSystemFactory & GetEquationSystemFactory()
void AddSummaryItem(SummaryList &l, const std::string &name, const std::string &value)
Adds a summary item to the summary info list.
RiemannSolverFactory & GetRiemannSolverFactory()
std::shared_ptr< MeshGraph > MeshGraphSharedPtr
std::map< ConstFactorType, NekDouble > ConstFactorMap
static VarCoeffMap NullVarCoeffMap
StdRegions::ConstFactorMap factors
The above copyright notice and this permission notice shall be included.
void Vmul(int n, const T *x, const int incx, const T *y, const int incy, T *z, const int incz)
Multiply vector z = x*y.
void Neg(int n, T *x, const int incx)
Negate x = -x.
void Vvtvp(int n, const T *w, const int incw, const T *x, const int incx, const T *y, const int incy, T *z, const int incz)
vvtvp (vector times vector plus vector): z = w*x + y
void Vadd(int n, const T *x, const int incx, const T *y, const int incy, T *z, const int incz)
Add vector z = x+y.
void Smul(int n, const T alpha, const T *x, const int incx, T *y, const int incy)
Scalar multiply y = alpha*x.
void Zero(int n, T *x, const int incx)
Zero vector.
void Vcopy(int n, const T *x, const int incx, T *y, const int incy)