Commit 6464c189 authored by Chris Cantwell's avatar Chris Cantwell

Merge branch 'feature/Riemann_split-rotation' of /opt/gitlab/repositories/nektar

parents b6e1a185 f52fae8b
......@@ -107,11 +107,19 @@ namespace Nektar
}
template<typename FuncPointerT, typename ObjectPointerT>
void SetAuxiliary(std::string name,
void SetAuxScal(std::string name,
FuncPointerT func,
ObjectPointerT obj)
{
m_auxiliary[name] = boost::bind(func, obj);
m_auxScal[name] = boost::bind(func, obj);
}
template<typename FuncPointerT, typename ObjectPointerT>
void SetAuxVec(std::string name,
FuncPointerT func,
ObjectPointerT obj)
{
m_auxVec[name] = boost::bind(func, obj);
}
std::map<std::string, RSScalarFuncType> &GetScalars()
......@@ -139,8 +147,10 @@ namespace Nektar
std::map<std::string, RSVecFuncType> m_vectors;
/// Map of parameter function types.
std::map<std::string, RSParamFuncType > m_params;
/// Map of scalar function types.
std::map<std::string, RSScalarFuncType> m_auxiliary;
/// Map of auxiliary scalar function types.
std::map<std::string, RSScalarFuncType> m_auxScal;
/// Map of auxiliary vector function types.
std::map<std::string, RSVecFuncType> m_auxVec;
/// Rotation matrices for each trace quadrature point.
Array<OneD, Array<OneD, NekDouble> > m_rotMat;
/// Rotation storage
......@@ -162,14 +172,18 @@ namespace Nektar
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);
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);
bool CheckScalars(std::string name);
bool CheckVectors(std::string name);
bool CheckParams (std::string name);
bool CheckScalars (std::string name);
bool CheckVectors (std::string name);
bool CheckParams (std::string name);
bool CheckAuxScal (std::string name);
bool CheckAuxVec (std::string name);
};
/// A shared pointer to an EquationSystem object
......
......@@ -68,10 +68,11 @@ namespace Nektar
m_homoInitialFwd = false;
// Set up locations of velocity vector.
m_velLoc = Array<OneD, NekDouble>(m_spacedim);
m_vecLocs = Array<OneD, Array<OneD, NekDouble> >(1);
m_vecLocs[0] = Array<OneD, NekDouble>(m_spacedim);
for (int i = 0; i < m_spacedim; ++i)
{
m_velLoc[i] = i+1;
m_vecLocs[0][i] = 1 + i;
}
// Get gamma parameter from session file.
......@@ -180,19 +181,19 @@ namespace Nektar
// Setting up parameters for advection operator Riemann solver
m_riemannSolver->SetParam (
"gamma", &CompressibleFlowSystem::GetGamma, this);
m_riemannSolver->SetAuxiliary(
"velLoc", &CompressibleFlowSystem::GetVelLoc, this);
"gamma", &CompressibleFlowSystem::GetGamma, this);
m_riemannSolver->SetAuxVec(
"vecLocs", &CompressibleFlowSystem::GetVecLocs, this);
m_riemannSolver->SetVector(
"N", &CompressibleFlowSystem::GetNormals, this);
"N", &CompressibleFlowSystem::GetNormals, this);
// Setting up parameters for diffusion operator Riemann solver
m_riemannSolverLDG->SetParam (
"gamma", &CompressibleFlowSystem::GetGamma, this);
m_riemannSolverLDG->SetAuxiliary(
"velLoc", &CompressibleFlowSystem::GetVelLoc, this);
"gamma", &CompressibleFlowSystem::GetGamma, this);
m_riemannSolverLDG->SetVector(
"N", &CompressibleFlowSystem::GetNormals, this);
"vecLocs", &CompressibleFlowSystem::GetVecLocs, this);
m_riemannSolverLDG->SetVector(
"N", &CompressibleFlowSystem::GetNormals, this);
// Concluding initialisation of advection / diffusion operators
m_advection->SetRiemannSolver (m_riemannSolver);
......
......@@ -91,7 +91,7 @@ namespace Nektar
SolverUtils::RiemannSolverSharedPtr m_riemannSolverLDG;
SolverUtils::AdvectionSharedPtr m_advection;
SolverUtils::DiffusionSharedPtr m_diffusion;
Array<OneD, NekDouble> m_velLoc;
Array<OneD, Array<OneD, NekDouble> >m_vecLocs;
NekDouble m_gamma;
NekDouble m_pInf;
NekDouble m_rhoInf;
......@@ -196,9 +196,9 @@ namespace Nektar
return m_gamma;
}
const Array<OneD, NekDouble> &GetVelLoc()
const Array<OneD, const Array<OneD, NekDouble> > &GetVecLocs()
{
return m_velLoc;
return m_vecLocs;
}
const Array<OneD, const Array<OneD, NekDouble> > &GetNormals()
......
......@@ -115,9 +115,9 @@ namespace Nektar
m_riemannSolver->SetParam (
"gravity",
&LinearSWE::GetGravity, this);
m_riemannSolver->SetAuxiliary(
"velLoc",
&LinearSWE::GetVelLoc, this);
m_riemannSolver->SetAuxVec(
"vecLocs",
&LinearSWE::GetVecLocs, this);
m_riemannSolver->SetVector(
"N",
&LinearSWE::GetNormals, this);
......@@ -139,9 +139,9 @@ namespace Nektar
// m_riemannSolverLDG->AddParam (
// "gravity",
// &NonlinearSWE::GetGravity, this);
// m_riemannSolverLDG->AddAuxiliary(
// "velLoc",
// &NonlinearSWE::GetVelLoc, this);
// m_riemannSolverLDG->SetAuxVec(
// "vecLocs",
// &NonlinearSWE::GetVecLocs, this);
// m_riemannSolverLDG->AddVector(
// "N",
// &NonlinearSWE::GetNormals, this);
......
......@@ -111,9 +111,9 @@ namespace Nektar
m_riemannSolver->SetParam (
"gravity",
&NonlinearSWE::GetGravity, this);
m_riemannSolver->SetAuxiliary(
"velLoc",
&NonlinearSWE::GetVelLoc, this);
m_riemannSolver->SetAuxVec(
"vecLocs",
&NonlinearSWE::GetVecLocs, this);
m_riemannSolver->SetVector(
"N",
&NonlinearSWE::GetNormals, this);
......@@ -125,9 +125,9 @@ namespace Nektar
// m_riemannSolverLDG->AddParam (
// "gravity",
// &NonlinearSWE::GetGravity, this);
// m_riemannSolverLDG->AddAuxiliary(
// "velLoc",
// &NonlinearSWE::GetVelLoc, this);
// m_riemannSolverLDG->SetAuxVec(
// "vecLocs",
// &NonlinearSWE::GetVecLocs, this);
// m_riemannSolverLDG->AddVector(
// "N",
// &NonlinearSWE::GetNormals, this);
......
......@@ -82,11 +82,12 @@ namespace Nektar
}
// Set up locations of velocity vector.
m_velLoc = Array<OneD, NekDouble>(m_spacedim);
for (int i = 0; i < m_spacedim; ++i)
{
m_velLoc[i] = i+1;
}
m_vecLocs = Array<OneD, Array<OneD, NekDouble> >(1);
m_vecLocs[0] = Array<OneD, NekDouble>(m_spacedim);
for (int i = 0; i < m_spacedim; ++i)
{
m_vecLocs[0][i] = 1 + i;
}
// Load generic input parameters
m_session->LoadParameter("IO_InfoSteps", m_infosteps, 0);
......
......@@ -82,7 +82,7 @@ namespace Nektar
/// Coriolis force
Array<OneD, NekDouble> m_coriolis;
// Location of velocity vector.
Array<OneD, NekDouble> m_velLoc;
Array<OneD, Array<OneD, NekDouble> > m_vecLocs;
/// Initialises UnsteadySystem class members.
ShallowWaterSystem(const LibUtilities::SessionReaderSharedPtr& pSession);
......@@ -109,9 +109,9 @@ namespace Nektar
return m_g;
}
const Array<OneD, NekDouble> &GetVelLoc()
const Array<OneD, const Array<OneD, NekDouble> > &GetVecLocs()
{
return m_velLoc;
return m_vecLocs;
}
const Array<OneD, const Array<OneD, NekDouble> > &GetNormals()
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment