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)
 Interface function to initialise the advection object.
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, const NekDouble &time)
 Interface function to advect the vector field.
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.
void SetBaseFlow (const Array< OneD, Array< OneD, NekDouble > > &inarray)
 Set the base flow used for linearised advection objects.

Protected Member Functions

virtual SOLVER_UTILS_EXPORT void v_InitObject (LibUtilities::SessionReaderSharedPtr pSession, Array< OneD, MultiRegions::ExpListSharedPtr > pFields)
 Initialises the advection object.
virtual SOLVER_UTILS_EXPORT 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, const NekDouble &time)=0
 Advects a vector field.
virtual SOLVER_UTILS_EXPORT void v_SetBaseFlow (const Array< OneD, Array< OneD, NekDouble > > &inarray)
 Overrides the base flow used during linearised advection.

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 69 of file Advection.h.

Member Function Documentation

void Nektar::SolverUtils::Advection::Advect ( const int  nConvectiveFields,
const Array< OneD, MultiRegions::ExpListSharedPtr > &  pFields,
const Array< OneD, Array< OneD, NekDouble > > &  pAdvVel,
const Array< OneD, Array< OneD, NekDouble > > &  pInarray,
Array< OneD, Array< OneD, NekDouble > > &  pOutarray,
const NekDouble pTime 
)

Interface function to advect the vector field.

Parameters
nConvectiveFieldsNumber of velocity components.
pFieldsExpansion lists for scalar fields.
pAdvVelAdvection velocity.
pInarrayScalar data to advect.
pOutarrayAdvected scalar data.
pTimeSimulation time.

Definition at line 75 of file Advection.cpp.

References v_Advect().

{
v_Advect(nConvectiveFields, pFields, pAdvVel, pInarray, pOutarray, pTime);
}
void Nektar::SolverUtils::Advection::InitObject ( LibUtilities::SessionReaderSharedPtr  pSession,
Array< OneD, MultiRegions::ExpListSharedPtr pFields 
)

Interface function to initialise the advection object.

Parameters
pSessionSession configuration data.
pFieldsArray of ExpList objects.

Definition at line 59 of file Advection.cpp.

References v_InitObject().

{
v_InitObject(pSession, pFields);
}
void Nektar::SolverUtils::Advection::SetBaseFlow ( const Array< OneD, Array< OneD, NekDouble > > &  inarray)
inline

Set the base flow used for linearised advection objects.

Parameters
inarrayVector to use as baseflow

Definition at line 124 of file Advection.h.

References v_SetBaseFlow().

{
v_SetBaseFlow(inarray);
}
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 94 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 114 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 104 of file Advection.h.

References m_riemann.

{
m_riemann = riemann;
}
virtual SOLVER_UTILS_EXPORT 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,
const NekDouble time 
)
protectedpure virtual
void Nektar::SolverUtils::Advection::v_InitObject ( LibUtilities::SessionReaderSharedPtr  pSession,
Array< OneD, MultiRegions::ExpListSharedPtr pFields 
)
protectedvirtual

Initialises the advection object.

This function should be overridden in derived classes to initialise the specific advection data members. However, this base class function should be called as the first statement of the overridden function to ensure the base class is correctly initialised in order.

Parameters
pSessionSession information.
pFieldsExpansion lists for scalar fields.

Reimplemented in Nektar::AdjointAdvection, Nektar::LinearisedAdvection, Nektar::SolverUtils::AdvectionFR, Nektar::SolverUtils::Advection3DHomogeneous1D, Nektar::NavierStokesAdvection, Nektar::SkewSymmetricAdvection, Nektar::NoAdvection, Nektar::SolverUtils::AdvectionNonConservative, and Nektar::SolverUtils::AdvectionWeakDG.

Definition at line 96 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.");
}
}
}
void Nektar::SolverUtils::Advection::v_SetBaseFlow ( const Array< OneD, Array< OneD, NekDouble > > &  inarray)
protectedvirtual

Overrides the base flow used during linearised advection.

Reimplemented in Nektar::AdjointAdvection, and Nektar::LinearisedAdvection.

Definition at line 121 of file Advection.cpp.

References ASSERTL0.

Referenced by SetBaseFlow().

{
ASSERTL0(false,
"A baseflow is not appropriate for this advection type.");
}

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 132 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 136 of file Advection.h.

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