Nektar++
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
Nektar::SolverUtils::Advection Class Reference

Defines a callback function which evaluates the flux vector. More...

#include <Advection.h>

Inheritance diagram for Nektar::SolverUtils::Advection:
Inheritance graph
[legend]

Public Member Functions

SOLVER_UTILS_EXPORT void InitObject (LibUtilities::SessionReaderSharedPtr pSession, Array< OneD, MultiRegions::ExpListSharedPtr > pFields)
SOLVER_UTILS_EXPORT void Advect (const int nConvectiveFields, const Array< OneD, MultiRegions::ExpListSharedPtr > &fields, const Array< OneD, Array< OneD, NekDouble > > &advVel, const Array< OneD, Array< OneD, NekDouble > > &inarray, Array< OneD, Array< OneD, NekDouble > > &outarray)
template<typename FuncPointerT , typename ObjectPointerT >
void SetFluxVector (FuncPointerT func, ObjectPointerT obj)
 Set the flux vector callback function.
void SetRiemannSolver (RiemannSolverSharedPtr riemann)
 Set a Riemann solver object for this advection object.
void SetFluxVector (AdvectionFluxVecCB fluxVector)
 Set the flux vector callback function.

Protected Member Functions

virtual void v_InitObject (LibUtilities::SessionReaderSharedPtr pSession, Array< OneD, MultiRegions::ExpListSharedPtr > pFields)
virtual void v_Advect (const int nConvectiveFields, const Array< OneD, MultiRegions::ExpListSharedPtr > &fields, const Array< OneD, Array< OneD, NekDouble > > &advVel, const Array< OneD, Array< OneD, NekDouble > > &inarray, Array< OneD, Array< OneD, NekDouble > > &outarray)=0

Protected Attributes

AdvectionFluxVecCB m_fluxVector
 Callback function to the flux vector (set when advection is in conservative form).
RiemannSolverSharedPtr m_riemann
 Riemann solver for DG-type schemes.
int m_spaceDim
 Storage for space dimension. Used for homogeneous extension.

Detailed Description

Defines a callback function which evaluates the flux vector.

An abstract base class encapsulating the concept of advection of a vector field.

Subclasses override the Advection::v_InitObject function to initialise the object and the Advection::v_Advect function to evaluate the advection of the vector field.

Definition at line 68 of file Advection.h.

Member Function Documentation

void Nektar::SolverUtils::Advection::Advect ( const int  nConvectiveFields,
const Array< OneD, MultiRegions::ExpListSharedPtr > &  fields,
const Array< OneD, Array< OneD, NekDouble > > &  advVel,
const Array< OneD, Array< OneD, NekDouble > > &  inarray,
Array< OneD, Array< OneD, NekDouble > > &  outarray 
)

Definition at line 57 of file Advection.cpp.

References v_Advect().

{
v_Advect(nConvectiveFields, fields, advVel, inarray, outarray);
}
void Nektar::SolverUtils::Advection::InitObject ( LibUtilities::SessionReaderSharedPtr  pSession,
Array< OneD, MultiRegions::ExpListSharedPtr pFields 
)

Definition at line 50 of file Advection.cpp.

References v_InitObject().

{
v_InitObject(pSession, pFields);
}
template<typename FuncPointerT , typename ObjectPointerT >
void Nektar::SolverUtils::Advection::SetFluxVector ( FuncPointerT  func,
ObjectPointerT  obj 
)
inline

Set the flux vector callback function.

This routine is a utility function to avoid the explicit use of boost::bind. A function and object can be passed to this function instead.

Definition at line 90 of file Advection.h.

References m_fluxVector.

{
m_fluxVector = boost::bind(func, obj, _1, _2);
}
void Nektar::SolverUtils::Advection::SetFluxVector ( AdvectionFluxVecCB  fluxVector)
inline

Set the flux vector callback function.

Parameters
fluxVectorThe callback function to override.

Definition at line 110 of file Advection.h.

References m_fluxVector.

{
m_fluxVector = fluxVector;
}
void Nektar::SolverUtils::Advection::SetRiemannSolver ( RiemannSolverSharedPtr  riemann)
inline

Set a Riemann solver object for this advection object.

Parameters
riemannThe RiemannSolver object.

Definition at line 100 of file Advection.h.

References m_riemann.

{
m_riemann = riemann;
}
virtual void Nektar::SolverUtils::Advection::v_Advect ( const int  nConvectiveFields,
const Array< OneD, MultiRegions::ExpListSharedPtr > &  fields,
const Array< OneD, Array< OneD, NekDouble > > &  advVel,
const Array< OneD, Array< OneD, NekDouble > > &  inarray,
Array< OneD, Array< OneD, NekDouble > > &  outarray 
)
protectedpure virtual
void Nektar::SolverUtils::Advection::v_InitObject ( LibUtilities::SessionReaderSharedPtr  pSession,
Array< OneD, MultiRegions::ExpListSharedPtr pFields 
)
protectedvirtual

Reimplemented in Nektar::SolverUtils::AdvectionFR, Nektar::SolverUtils::Advection3DHomogeneous1D, Nektar::SolverUtils::AdvectionNonConservative, and Nektar::SolverUtils::AdvectionWeakDG.

Definition at line 67 of file Advection.cpp.

References ASSERTL0, and m_spaceDim.

Referenced by InitObject().

{
m_spaceDim = pFields[0]->GetCoordim(0);
if (pSession->DefinesSolverInfo("HOMOGENEOUS"))
{
std::string HomoStr = pSession->GetSolverInfo("HOMOGENEOUS");
if (HomoStr == "HOMOGENEOUS1D" || HomoStr == "Homogeneous1D" ||
HomoStr == "1D" || HomoStr == "Homo1D")
{
}
else
{
ASSERTL0(false, "Only 1D homogeneous dimension supported.");
}
}
}

Member Data Documentation

AdvectionFluxVecCB Nektar::SolverUtils::Advection::m_fluxVector
protected

Callback function to the flux vector (set when advection is in conservative form).

Definition at line 129 of file Advection.h.

Referenced by SetFluxVector(), Nektar::SolverUtils::AdvectionWeakDG::v_Advect(), Nektar::SolverUtils::Advection3DHomogeneous1D::v_Advect(), and Nektar::SolverUtils::AdvectionFR::v_Advect().

RiemannSolverSharedPtr Nektar::SolverUtils::Advection::m_riemann
protected
int Nektar::SolverUtils::Advection::m_spaceDim
protected

Storage for space dimension. Used for homogeneous extension.

Definition at line 133 of file Advection.h.

Referenced by Nektar::SolverUtils::AdvectionWeakDG::v_Advect(), Nektar::SolverUtils::AdvectionFR::v_Advect(), and v_InitObject().