46 "Linear shallow water equation in primitive variables.");
76 m_session->LoadSolverInfo(
"AdvectionType", advName,
"WeakDG");
82 m_session->LoadSolverInfo(
"UpwindType", riemName,
"NoSolver");
85 ASSERTL0(
false,
"LinearHLL only valid for constant depth");
97 int nTracePointsTot =
m_fields[0]->GetTrace()->GetTotPoints();
114 ASSERTL0(
false,
"Unsupported projection type.");
129 int nvariables = inarray.size();
141 inarray, outarray, time);
146 for (
int i = 0; i < nvariables; ++i)
171 for (
int i = 0; i < nvariables; ++i)
174 for (
int j = 0; j < ndim; ++j)
189 for (
int i = 0; i < nvariables; ++i)
192 fluxvector[i][0], tmp0);
194 fluxvector[i][1], tmp1);
212 ASSERTL0(
false,
"Unknown projection scheme for the LinearSWE");
220 if (
m_session->DefinesSolverInfo(
"UpwindType"))
243 int nq =
m_fields[0]->GetTotPoints();
263 Vmath::Smul(nq, g, physfield[0], 1, flux[i + 1][i], 1);
278 const int npts = physfield[0].size();
282 Vmath::Vcopy(npts, physfield[1 + i], 1, velocity[i], 1);
292 for (
int bcRegion = 0; bcRegion <
m_fields[0]->GetBndConditions().size();
296 ->GetBndConditions()[bcRegion]
310 ->GetBndCondExpansions()[bcRegion]
313 id2 =
m_fields[0]->GetTrace()->GetPhys_Offset(
314 m_fields[0]->GetTraceMap()->GetBndCondIDToGlobalTraceID(cnt +
320 cnt +=
m_fields[0]->GetBndCondExpansions()[bcRegion]->GetExpSize();
#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)
static std::string className
Name of class.
void v_GenerateSummary(SolverUtils::SummaryList &s) override
Print a summary of time stepping parameters.
LinearSWE(const LibUtilities::SessionReaderSharedPtr &pSession, const SpatialDomains::MeshGraphSharedPtr &pGraph)
static SolverUtils::EquationSystemSharedPtr create(const LibUtilities::SessionReaderSharedPtr &pSession, const SpatialDomains::MeshGraphSharedPtr &pGraph)
Creates an instance of this class.
const Array< OneD, NekDouble > & GetDepthBwd()
const Array< OneD, NekDouble > & GetDepthFwd()
void v_DoOdeRhs(const Array< OneD, const Array< OneD, NekDouble > > &inarray, Array< OneD, Array< OneD, NekDouble > > &outarray, const NekDouble time) override
void v_InitObject(bool DeclareFields=true) override
Init object for UnsteadySystem class.
void GetVelocityVector(const Array< OneD, const Array< OneD, NekDouble > > &physfield, Array< OneD, Array< OneD, NekDouble > > &velocity)
Compute the velocity field given the momentum .
void GetFluxVector(const Array< OneD, const Array< OneD, NekDouble > > &physfield, Array< OneD, Array< OneD, Array< OneD, NekDouble > > > &flux)
Array< OneD, NekDouble > m_dFwd
Still water depth traces.
Array< OneD, NekDouble > m_dBwd
void CopyBoundaryTrace(const Array< OneD, const NekDouble > &Fwd, Array< OneD, NekDouble > &Bwd)
Base class for unsteady solvers.
NekDouble m_g
Acceleration of gravity.
SolverUtils::RiemannSolverSharedPtr m_riemannSolver
void AddCoriolis(const Array< OneD, const Array< OneD, NekDouble > > &physarray, Array< OneD, Array< OneD, NekDouble > > &outarray)
void DoOdeProjection(const Array< OneD, const Array< OneD, NekDouble > > &inarray, Array< OneD, Array< OneD, NekDouble > > &outarray, const NekDouble time)
SolverUtils::AdvectionSharedPtr m_advection
bool m_constantDepth
Indicates if constant depth case.
void v_GenerateSummary(SolverUtils::SummaryList &s) override
Print a summary of time stepping parameters.
Array< OneD, NekDouble > m_coriolis
Coriolis force.
void DoImplicitSolve(const Array< OneD, const Array< OneD, NekDouble > > &inpnts, Array< OneD, Array< OneD, NekDouble > > &outpnt, const NekDouble time, const NekDouble lambda)
Array< OneD, NekDouble > m_depth
Still water depth.
void v_InitObject(bool DeclareFields=true) override
Init object for UnsteadySystem class.
const Array< OneD, const Array< OneD, NekDouble > > & GetNormals()
const Array< OneD, const Array< OneD, NekDouble > > & GetVecLocs()
int m_spacedim
Spatial dimension (>= expansion dim).
Array< OneD, MultiRegions::ExpListSharedPtr > m_fields
Array holding all dependent variables.
SOLVER_UTILS_EXPORT int GetExpSize()
LibUtilities::SessionReaderSharedPtr m_session
The session reader.
enum MultiRegions::ProjectionType m_projectionType
Type of projection; e.g continuous or discontinuous.
SOLVER_UTILS_EXPORT int GetTotPoints()
LibUtilities::TimeIntegrationSchemeOperators m_ode
The time integration scheme operators to use.
std::shared_ptr< SessionReader > SessionReaderSharedPtr
MultiRegions::Direction const DirCartesianMap[]
AdvectionFactory & GetAdvectionFactory()
Gets the factory for initialising advection objects.
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.
RiemannSolverFactory & GetRiemannSolverFactory()
std::shared_ptr< MeshGraph > MeshGraphSharedPtr
static Array< OneD, Array< OneD, NekDouble > > NullNekDoubleArrayOfArray
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 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)