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::AdvectionTerm Class Reference

Base class for the development of solvers. More...

#include <AdvectionTerm.h>

Inheritance diagram for Nektar::AdvectionTerm:
Inheritance graph
[legend]
Collaboration diagram for Nektar::AdvectionTerm:
Collaboration graph
[legend]

Public Member Functions

virtual ~AdvectionTerm ()
 Destructor.
void InitObject ()
void DoAdvection (Array< OneD, MultiRegions::ExpListSharedPtr > &pFields, const int nConvectiveFields, const Array< OneD, int > &vel_loc, const Array< OneD, const Array< OneD, NekDouble > > &pInarray, Array< OneD, Array< OneD, NekDouble > > &pOutarray, NekDouble m_time, Array< OneD, NekDouble > &pWk=NullNekDouble1DArray)
 Compute advection term.
void DoAdvection (Array< OneD, MultiRegions::ExpListSharedPtr > &pFields, const Array< OneD, const Array< OneD, NekDouble > > &Velocity, const Array< OneD, const Array< OneD, NekDouble > > &pInarray, Array< OneD, Array< OneD, NekDouble > > &pOutarray, NekDouble m_time, Array< OneD, NekDouble > &pWk=NullNekDouble1DArray)
bool GetSpecHPDealiasing (void)
void SetSpecHPDealiasing (bool value)

Protected Member Functions

 AdvectionTerm (const LibUtilities::SessionReaderSharedPtr &pSession, const SpatialDomains::MeshGraphSharedPtr &pGraph)
 Constructor.
virtual void v_InitObject ()
virtual void v_ComputeAdvectionTerm (Array< OneD, MultiRegions::ExpListSharedPtr > &pFields, const Array< OneD, Array< OneD, NekDouble > > &pV, const Array< OneD, const NekDouble > &pU, Array< OneD, NekDouble > &pOutarray, int pVelocityComponent, NekDouble m_time, Array< OneD, NekDouble > &pWk)

Protected Attributes

LibUtilities::SessionReaderSharedPtr m_session
std::string m_sessionName
 Name of the session.
SpatialDomains::MeshGraphSharedPtr m_graph
 Pointer to mesh graph.
bool m_homogen_dealiasing
 flag to determine if use Fourier dealising or not
bool m_specHP_dealiasing
 flag to determine if use Spectral/hp element dealising or not
bool m_SingleMode
 Flag to determine if use single mode or not.
bool m_HalfMode
 Flag to determine if use half mode or not.
MultiRegions::CoeffState m_CoeffState
enum MultiRegions::ProjectionType m_projectionType
 Type of projection, i.e. Galerkin or DG.
int m_spacedim
 Spatial dimension (> expansion dim)
int m_expdim
 Dimension of the expansion.
int nvariables
 Number of variables.
int m_nConvectiveFields
int m_slices
 Number of fields to be convected;.
NekDouble m_period
Array< OneD, Array< OneD,
NekDouble > > 
m_interp
LibUtilities::NektarFFTSharedPtr m_FFT
Array< OneD, NekDoublem_tmpIN
Array< OneD, NekDoublem_tmpOUT
bool m_useFFTW

Detailed Description

Base class for the development of solvers.

Definition at line 62 of file AdvectionTerm.h.

Constructor & Destructor Documentation

Nektar::AdvectionTerm::~AdvectionTerm ( )
virtual

Destructor.

Definition at line 123 of file AdvectionTerm.cpp.

{
}
Nektar::AdvectionTerm::AdvectionTerm ( const LibUtilities::SessionReaderSharedPtr pSession,
const SpatialDomains::MeshGraphSharedPtr pGraph 
)
protected

Constructor.

Constructor. Creates ...

Parameters
\param

Definition at line 57 of file AdvectionTerm.cpp.

: m_session(pSession),
m_graph(pGraph)
{
}

Member Function Documentation

void Nektar::AdvectionTerm::DoAdvection ( Array< OneD, MultiRegions::ExpListSharedPtr > &  pFields,
const int  nConvectiveFields,
const Array< OneD, int > &  vel_loc,
const Array< OneD, const Array< OneD, NekDouble > > &  pInarray,
Array< OneD, Array< OneD, NekDouble > > &  pOutarray,
NekDouble  m_time,
Array< OneD, NekDouble > &  pWk = NullNekDouble1DArray 
)

Compute advection term.

Definition at line 127 of file AdvectionTerm.cpp.

References ASSERTL1, m_HalfMode, and m_SingleMode.

{
int i,j;
int VelDim = vel_loc.num_elements();
int nqtot = pFields[0]->GetTotPoints();
Array<OneD, Array<OneD, NekDouble> > velocity(VelDim);
ASSERTL1(nConvectiveFields == pInarray.num_elements(),"Number of convective fields and Inarray are not compatible");
for(i = 0; i < VelDim; ++i)
{
if(pFields[i]->GetWaveSpace() && !m_SingleMode && !m_HalfMode)
{
j = vel_loc[i];
velocity[i] = Array<OneD, NekDouble>(nqtot,0.0);
pFields[i]->HomogeneousBwdTrans(pInarray[j],velocity[i]);
}
else
{
velocity[i] = pInarray[vel_loc[i]];
}
}
DoAdvection(pFields,velocity,pInarray,pOutarray,time,pWk);
}
void Nektar::AdvectionTerm::DoAdvection ( Array< OneD, MultiRegions::ExpListSharedPtr > &  pFields,
const Array< OneD, const Array< OneD, NekDouble > > &  Velocity,
const Array< OneD, const Array< OneD, NekDouble > > &  pInarray,
Array< OneD, Array< OneD, NekDouble > > &  pOutarray,
NekDouble  m_time,
Array< OneD, NekDouble > &  pWk = NullNekDouble1DArray 
)

Definition at line 160 of file AdvectionTerm.cpp.

References ASSERTL0, m_nConvectiveFields, Vmath::Neg(), and v_ComputeAdvectionTerm().

{
int i;
int nqtot = pFields[0]->GetTotPoints();
int VelDim = velocity.num_elements();
Array<OneD, NekDouble > Deriv;
m_nConvectiveFields = pInarray.num_elements();
// Set up Derivative work space;
if(pWk.num_elements())
{
ASSERTL0(pWk.num_elements() >= nqtot*VelDim,"Workspace is not sufficient");
Deriv = pWk;
}
else
{
Deriv = Array<OneD, NekDouble> (nqtot*VelDim);
}
for(i=0; i< m_nConvectiveFields; ++i)
{
v_ComputeAdvectionTerm(pFields,velocity,pInarray[i],pOutarray[i],i,time,Deriv);
Vmath::Neg(nqtot,pOutarray[i],1);
}
}
bool Nektar::AdvectionTerm::GetSpecHPDealiasing ( void  )
inline

Definition at line 86 of file AdvectionTerm.h.

References m_specHP_dealiasing.

{
}
void Nektar::AdvectionTerm::InitObject ( )
inline

Definition at line 149 of file AdvectionTerm.h.

References v_InitObject().

{
}
void Nektar::AdvectionTerm::SetSpecHPDealiasing ( bool  value)
inline

Definition at line 91 of file AdvectionTerm.h.

References m_specHP_dealiasing.

{
}
virtual void Nektar::AdvectionTerm::v_ComputeAdvectionTerm ( Array< OneD, MultiRegions::ExpListSharedPtr > &  pFields,
const Array< OneD, Array< OneD, NekDouble > > &  pV,
const Array< OneD, const NekDouble > &  pU,
Array< OneD, NekDouble > &  pOutarray,
int  pVelocityComponent,
NekDouble  m_time,
Array< OneD, NekDouble > &  pWk 
)
inlineprotectedvirtual

Definition at line 137 of file AdvectionTerm.h.

References ASSERTL0.

Referenced by DoAdvection().

{
ASSERTL0(false,"This function is not defined in parent class");
};
void Nektar::AdvectionTerm::v_InitObject ( )
protectedvirtual

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

Definition at line 65 of file AdvectionTerm.cpp.

References ASSERTL0, Nektar::MultiRegions::eDiscontinuous, Nektar::MultiRegions::eGalerkin, Nektar::MultiRegions::eLocal, Nektar::MultiRegions::eMixed_CG_Discontinuous, m_CoeffState, m_expdim, m_graph, m_HalfMode, m_homogen_dealiasing, m_projectionType, m_session, m_sessionName, m_SingleMode, m_spacedim, and m_specHP_dealiasing.

Referenced by InitObject().

{
// Set space dimension for use in class
m_spacedim = m_graph->GetSpaceDimension();
m_expdim = m_graph->GetMeshDimension();
// Save the basename of input file name for output details.
m_sessionName = m_session->GetFilename();
m_sessionName = m_sessionName.substr(0, m_sessionName.find_last_of("."));
if(m_session->DefinesSolverInfo("PROJECTION"))
{
std::string ProjectStr
= m_session->GetSolverInfo("PROJECTION");
if((ProjectStr == "Continuous")||(ProjectStr == "Galerkin")||
(ProjectStr == "CONTINUOUS")||(ProjectStr == "GALERKIN"))
{
}
else if((ProjectStr == "MixedCGDG")||(ProjectStr == "Mixed_CG_Discontinuous"))
{
}
else if(ProjectStr == "DisContinuous")
{
}
else
{
ASSERTL0(false,"PROJECTION value not recognised");
}
}
else
{
cerr << "Projection type not specified in SOLVERINFO,"
"defaulting to continuous Galerkin" << endl;
}
if(m_session->DefinesSolverInfo("DEALIASING"))
{
}
m_session->MatchSolverInfo("SPECTRALHPDEALIASING","True",m_specHP_dealiasing,false);
if(m_specHP_dealiasing == false)
{
m_session->MatchSolverInfo("SPECTRALHPDEALIASING","On",m_specHP_dealiasing,false);
}
m_session->MatchSolverInfo("ModeType","SingleMode",m_SingleMode,false);
m_session->MatchSolverInfo("ModeType","HalfMode",m_HalfMode,false);
}

Member Data Documentation

MultiRegions::CoeffState Nektar::AdvectionTerm::m_CoeffState
protected
int Nektar::AdvectionTerm::m_expdim
protected

Dimension of the expansion.

Definition at line 113 of file AdvectionTerm.h.

Referenced by Nektar::AdjointAdvection::SetUpBaseFields(), Nektar::LinearisedAdvection::SetUpBaseFields(), and v_InitObject().

LibUtilities::NektarFFTSharedPtr Nektar::AdvectionTerm::m_FFT
protected

Definition at line 125 of file AdvectionTerm.h.

SpatialDomains::MeshGraphSharedPtr Nektar::AdvectionTerm::m_graph
protected
bool Nektar::AdvectionTerm::m_HalfMode
protected

Flag to determine if use half mode or not.

Definition at line 105 of file AdvectionTerm.h.

Referenced by DoAdvection(), and v_InitObject().

bool Nektar::AdvectionTerm::m_homogen_dealiasing
protected
Array<OneD, Array<OneD, NekDouble> > Nektar::AdvectionTerm::m_interp
protected

Definition at line 123 of file AdvectionTerm.h.

int Nektar::AdvectionTerm::m_nConvectiveFields
protected
NekDouble Nektar::AdvectionTerm::m_period
protected

Definition at line 121 of file AdvectionTerm.h.

enum MultiRegions::ProjectionType Nektar::AdvectionTerm::m_projectionType
protected
LibUtilities::SessionReaderSharedPtr Nektar::AdvectionTerm::m_session
protected
std::string Nektar::AdvectionTerm::m_sessionName
protected

Name of the session.

Definition at line 98 of file AdvectionTerm.h.

Referenced by v_InitObject().

bool Nektar::AdvectionTerm::m_SingleMode
protected

Flag to determine if use single mode or not.

Definition at line 104 of file AdvectionTerm.h.

Referenced by DoAdvection(), and v_InitObject().

int Nektar::AdvectionTerm::m_slices
protected

Number of fields to be convected;.

Definition at line 119 of file AdvectionTerm.h.

int Nektar::AdvectionTerm::m_spacedim
protected

Spatial dimension (> expansion dim)

Definition at line 112 of file AdvectionTerm.h.

Referenced by Nektar::AdjointAdvection::v_InitObject(), Nektar::LinearisedAdvection::v_InitObject(), and v_InitObject().

bool Nektar::AdvectionTerm::m_specHP_dealiasing
protected

flag to determine if use Spectral/hp element dealising or not

Definition at line 103 of file AdvectionTerm.h.

Referenced by GetSpecHPDealiasing(), SetSpecHPDealiasing(), Nektar::NavierStokesAdvection::v_ComputeAdvectionTerm(), and v_InitObject().

Array<OneD,NekDouble> Nektar::AdvectionTerm::m_tmpIN
protected

Definition at line 126 of file AdvectionTerm.h.

Array<OneD,NekDouble> Nektar::AdvectionTerm::m_tmpOUT
protected

Definition at line 127 of file AdvectionTerm.h.

bool Nektar::AdvectionTerm::m_useFFTW
protected

Definition at line 129 of file AdvectionTerm.h.

int Nektar::AdvectionTerm::nvariables
protected

Number of variables.

Definition at line 114 of file AdvectionTerm.h.

Referenced by Nektar::AdjointAdvection::SetUpBaseFields(), and Nektar::LinearisedAdvection::SetUpBaseFields().