44 "Inviscid Burger equation");
74 m_session->LoadSolverInfo(
"AdvectionType", advName,
88 m_session->LoadSolverInfo(
"AdvectionType", advName,
"WeakDG");
94 m_session->LoadSolverInfo(
"UpwindType", riemName,
"Upwind");
107 ASSERTL0(
false,
"Unsupported projection type.");
125 ASSERTL0(
false,
"Implicit unsteady Advection not set up.");
165 for (i = 0; i < nVariables; ++i)
172 m_fields[0]->GetFwdBwdTracePhys(physfield[0], Fwd, Bwd,
true);
202 int nVariables = inarray.size();
209 for (
int i = 0; i < nVariables; ++i)
211 advVel[i] = inarray[i];
218 for (i = 0; i < nVariables; ++i)
227 x->Apply(
m_fields, inarray, outarray, time);
246 int nVariables = inarray.size();
261 if (inarray != outarray)
263 for (i = 0; i < nVariables; ++i)
265 Vmath::Vcopy(nQuadraturePts, inarray[i], 1, outarray[i], 1);
277 for (i = 0; i < nVariables; ++i)
279 m_fields[i]->FwdTrans(inarray[i], coeffs);
280 m_fields[i]->BwdTrans(coeffs, outarray[i]);
285 ASSERTL0(
false,
"Unknown projection scheme");
303 for (
int i = 0; i < flux.size(); ++i)
305 for (
int j = 0; j < flux[0].size(); ++j)
307 Vmath::Vmul(nq, physfield[i], 1, physfield[i], 1, flux[i][j], 1);
308 Vmath::Smul(nq, 0.5, flux[i][j], 1, flux[i][j], 1);
#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)
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.
int m_spacedim
Spatial dimension (>= expansion dim).
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()
SOLVER_UTILS_EXPORT int GetNcoeffs()
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_explicitAdvection
Indicates if explicit or implicit treatment of advection is used.
static std::string className
Name of class.
void DoOdeProjection(const Array< OneD, const Array< OneD, NekDouble > > &inarray, Array< OneD, Array< OneD, NekDouble > > &outarray, const NekDouble time)
Compute the projection.
Array< OneD, NekDouble > m_traceVn
SolverUtils::RiemannSolverSharedPtr m_riemannSolver
static SolverUtils::EquationSystemSharedPtr create(const LibUtilities::SessionReaderSharedPtr &pSession, const SpatialDomains::MeshGraphSharedPtr &pGraph)
Creates an instance of this class.
void GetFluxVector(const Array< OneD, Array< OneD, NekDouble > > &physfield, Array< OneD, Array< OneD, Array< OneD, NekDouble > > > &flux)
Evaluate the flux at each solution point.
virtual void v_InitObject(bool DeclareFields=true) override
Initialise the object.
Array< OneD, NekDouble > & GetNormalVelocity()
Get the normal velocity.
virtual ~UnsteadyInviscidBurger()
Destructor.
void DoOdeRhs(const Array< OneD, const Array< OneD, NekDouble > > &inarray, Array< OneD, Array< OneD, NekDouble > > &outarray, const NekDouble time)
Compute the RHS.
std::vector< SolverUtils::ForcingSharedPtr > m_forcing
Forcing terms.
UnsteadyInviscidBurger(const LibUtilities::SessionReaderSharedPtr &pSession, const SpatialDomains::MeshGraphSharedPtr &pGraph)
Session reader.
std::shared_ptr< SessionReader > SessionReaderSharedPtr
@ eMixed_CG_Discontinuous
AdvectionFactory & GetAdvectionFactory()
Gets the factory for initialising advection objects.
EquationSystemFactory & GetEquationSystemFactory()
RiemannSolverFactory & GetRiemannSolverFactory()
std::shared_ptr< MeshGraph > MeshGraphSharedPtr
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)