35#ifndef NEKTAR_SOLVERUTILS_RIEMANNSOLVER
36#define NEKTAR_SOLVERUTILS_RIEMANNSOLVER
48template <
typename Dim,
typename DataType>
class Array;
53typedef std::function<const Array<OneD, const Array<OneD, NekDouble>> &()>
65 template <
typename FuncPo
interT,
typename ObjectPo
interT>
76 template <
typename FuncPo
interT,
typename ObjectPo
interT>
87 template <
typename FuncPo
interT,
typename ObjectPo
interT>
103 template <
typename FuncPo
interT,
typename ObjectPo
interT>
109 template <
typename FuncPo
interT,
typename ObjectPo
interT>
210template <
class T,
typename =
typename std::enable_if<
211 std::is_floating_point<T>::value ||
217 out[0] = in[0] * rotMat[0] + in[1] * rotMat[1] + in[2] * rotMat[2];
219 out[1] = in[0] * rotMat[3] + in[1] * rotMat[4] + in[2] * rotMat[5];
221 out[2] = in[0] * rotMat[6] + in[1] * rotMat[7] + in[2] * rotMat[8];
224template <
class T,
typename =
typename std::enable_if<
225 std::is_floating_point<T>::value ||
231 out[0] = in[0] * rotMat[0] + in[1] * rotMat[3] + in[2] * rotMat[6];
233 out[1] = in[0] * rotMat[1] + in[1] * rotMat[4] + in[2] * rotMat[7];
235 out[2] = in[0] * rotMat[2] + in[1] * rotMat[5] + in[2] * rotMat[8];
#define SOLVER_UTILS_EXPORT
Provides a generic Factory class.
The RiemannSolver class provides an abstract interface under which solvers for various Riemann proble...
SOLVER_UTILS_EXPORT bool CheckAuxVec(std::string name)
Determine whether a vector has been defined in m_auxVec.
void SetScalar(std::string name, FuncPointerT func, ObjectPointerT obj)
virtual SOLVER_UTILS_EXPORT ~RiemannSolver()
SOLVER_UTILS_EXPORT void Solve(const int nDim, const Array< OneD, const Array< OneD, NekDouble > > &Fwd, const Array< OneD, const Array< OneD, NekDouble > > &Bwd, Array< OneD, Array< OneD, NekDouble > > &flux)
Perform the Riemann solve given the forwards and backwards spaces.
std::map< std::string, RSScalarFuncType > & GetScalars()
void SetVector(std::string name, RSVecFuncType fp)
Array< OneD, Array< OneD, Array< OneD, NekDouble > > > m_rotStorage
Rotation storage.
bool m_requiresRotation
Indicates whether the Riemann solver requires a rotation to be applied to the velocity fields.
void SetALEFlag(bool &ALE)
virtual SOLVER_UTILS_EXPORT void v_CalcFluxJacobian(const int nDim, const Array< OneD, const Array< OneD, NekDouble > > &Fwd, const Array< OneD, const Array< OneD, NekDouble > > &Bwd, const Array< OneD, const Array< OneD, NekDouble > > &normals, DNekBlkMatSharedPtr &FJac, DNekBlkMatSharedPtr &BJac)
SOLVER_UTILS_EXPORT bool CheckParams(std::string name)
Determine whether a parameter has been defined in m_params.
std::map< std::string, RSScalarFuncType > m_auxScal
Map of auxiliary scalar function types.
void SetParam(std::string name, RSParamFuncType fp)
void SetParam(std::string name, FuncPointerT func, ObjectPointerT obj)
void SetScalar(std::string name, RSScalarFuncType fp)
SOLVER_UTILS_EXPORT void rotateToNormal(const Array< OneD, const Array< OneD, NekDouble > > &inarray, const Array< OneD, const Array< OneD, NekDouble > > &normals, const Array< OneD, const Array< OneD, NekDouble > > &vecLocs, Array< OneD, Array< OneD, NekDouble > > &outarray)
Rotate a vector field to trace normal.
void SetAuxVec(std::string name, FuncPointerT func, ObjectPointerT obj)
virtual void v_Solve(const int nDim, const Array< OneD, const Array< OneD, NekDouble > > &Fwd, const Array< OneD, const Array< OneD, NekDouble > > &Bwd, Array< OneD, Array< OneD, NekDouble > > &flux)=0
SOLVER_UTILS_EXPORT void rotateFromNormal(const Array< OneD, const Array< OneD, NekDouble > > &inarray, const Array< OneD, const Array< OneD, NekDouble > > &normals, const Array< OneD, const Array< OneD, NekDouble > > &vecLocs, Array< OneD, Array< OneD, NekDouble > > &outarray)
Rotate a vector field from trace normal.
void SetVector(std::string name, FuncPointerT func, ObjectPointerT obj)
std::map< std::string, RSParamFuncType > & GetParams()
Array< OneD, Array< OneD, NekDouble > > m_rotMat
Rotation matrices for each trace quadrature point.
SOLVER_UTILS_EXPORT bool CheckScalars(std::string name)
Determine whether a scalar has been defined in m_scalars.
void SetAuxScal(std::string name, FuncPointerT func, ObjectPointerT obj)
SOLVER_UTILS_EXPORT void CalcFluxJacobian(const int nDim, const Array< OneD, const Array< OneD, NekDouble > > &Fwd, const Array< OneD, const Array< OneD, NekDouble > > &Bwd, DNekBlkMatSharedPtr &FJac, DNekBlkMatSharedPtr &BJac)
Calculate the flux jacobian of Fwd and Bwd.
std::map< std::string, RSVecFuncType > m_vectors
Map of vector function types.
std::map< std::string, RSScalarFuncType > m_scalars
Map of scalar function types.
SOLVER_UTILS_EXPORT bool CheckVectors(std::string name)
Determine whether a vector has been defined in m_vectors.
std::map< std::string, RSVecFuncType > & GetVectors()
void FromToRotation(Array< OneD, const NekDouble > &from, Array< OneD, const NekDouble > &to, NekDouble *mat)
A function for creating a rotation matrix that rotates a vector from into another vector to.
SOLVER_UTILS_EXPORT void GenerateRotationMatrices(const Array< OneD, const Array< OneD, NekDouble > > &normals)
Generate rotation matrices for 3D expansions.
SOLVER_UTILS_EXPORT bool CheckAuxScal(std::string name)
Determine whether a scalar has been defined in m_auxScal.
std::map< std::string, RSParamFuncType > m_params
Map of parameter function types.
SOLVER_UTILS_EXPORT RiemannSolver()
bool m_ALESolver
Flag if using the ALE formulation.
void SetAuxVec(std::string name, RSVecFuncType fp)
std::map< std::string, RSVecFuncType > m_auxVec
Map of auxiliary vector function types.
std::shared_ptr< SessionReader > SessionReaderSharedPtr
std::shared_ptr< RiemannSolver > RiemannSolverSharedPtr
A shared pointer to an EquationSystem object.
void rotateFromNormalKernel(T *in, T *rotMat, T *out)
void rotateToNormalKernel(T *in, T *rotMat, T *out)
LibUtilities::NekFactory< std::string, RiemannSolver, const LibUtilities::SessionReaderSharedPtr & > RiemannSolverFactory
Datatype of the NekFactory used to instantiate classes derived from the RiemannSolver class.
std::function< const Array< OneD, const NekDouble > &()> RSScalarFuncType
std::function< const Array< OneD, const Array< OneD, NekDouble > > &()> RSVecFuncType
std::function< NekDouble()> RSParamFuncType
RiemannSolverFactory & GetRiemannSolverFactory()
std::shared_ptr< DNekBlkMat > DNekBlkMatSharedPtr