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

#include <SkewSymmetricAdvection.h>

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

Static Public Member Functions

static AdvectionTermSharedPtr create (const LibUtilities::SessionReaderSharedPtr &pSession, const SpatialDomains::MeshGraphSharedPtr &pGraph)
 Creates an instance of this class.

Static Public Attributes

static std::string className = GetAdvectionTermFactory().RegisterCreatorFunction("SkewSymmetric", SkewSymmetricAdvection::create)
 Name of class.
static std::string className2

Protected Member Functions

 SkewSymmetricAdvection (const LibUtilities::SessionReaderSharedPtr &pSession, const SpatialDomains::MeshGraphSharedPtr &pGraph)
virtual ~SkewSymmetricAdvection ()
- Protected Member Functions inherited from Nektar::AdvectionTerm
 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)

Private Member Functions

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)

Friends

class MemoryManager< SkewSymmetricAdvection >

Additional Inherited Members

- Public Member Functions inherited from Nektar::AdvectionTerm
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 Attributes inherited from Nektar::AdvectionTerm
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

Definition at line 51 of file SkewSymmetricAdvection.h.

Constructor & Destructor Documentation

Nektar::SkewSymmetricAdvection::SkewSymmetricAdvection ( const LibUtilities::SessionReaderSharedPtr pSession,
const SpatialDomains::MeshGraphSharedPtr pGraph 
)
protected

Constructor. Creates ...

Parameters
\param

Definition at line 50 of file SkewSymmetricAdvection.cpp.

:
AdvectionTerm(pSession, pGraph)
{
}
Nektar::SkewSymmetricAdvection::~SkewSymmetricAdvection ( )
protectedvirtual

Definition at line 59 of file SkewSymmetricAdvection.cpp.

{
}

Member Function Documentation

static AdvectionTermSharedPtr Nektar::SkewSymmetricAdvection::create ( const LibUtilities::SessionReaderSharedPtr pSession,
const SpatialDomains::MeshGraphSharedPtr pGraph 
)
inlinestatic

Creates an instance of this class.

Definition at line 58 of file SkewSymmetricAdvection.h.

{
p->InitObject();
return p;
}
void Nektar::SkewSymmetricAdvection::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 
)
privatevirtual

Definition at line 67 of file SkewSymmetricAdvection.cpp.

References ASSERTL0, Nektar::MultiRegions::DirCartesianMap, Nektar::AdvectionTerm::m_CoeffState, Nektar::AdvectionTerm::m_homogen_dealiasing, Vmath::Smul(), Vmath::Vadd(), Vmath::Vmul(), and Vmath::Vvtvp().

{
// use dimension of Velocity vector to dictate dimension of operation
int ndim = pV.num_elements();
// ToDo: here we should add a check that V has right dimension
int nPointsTot = pFields[0]->GetNpoints();
Array<OneD, NekDouble> gradV0,gradV1,gradV2, tmp, Up;
gradV0 = Array<OneD, NekDouble> (nPointsTot);
tmp = Array<OneD, NekDouble> (nPointsTot);
// Evaluate V\cdot Grad(u)
switch(ndim)
{
case 1:
pFields[0]->PhysDeriv(pU,gradV0);
Vmath::Vmul(nPointsTot,gradV0,1,pV[0],1,pOutarray,1);
Vmath::Vmul(nPointsTot,pU,1,pV[0],1,gradV0,1);
pFields[0]->PhysDeriv(gradV0,tmp);
Vmath::Vadd(nPointsTot,tmp,1,pOutarray,1,pOutarray,1);
Vmath::Smul(nPointsTot,0.5,pOutarray,1,pOutarray,1);
break;
case 2:
gradV1 = Array<OneD, NekDouble> (nPointsTot);
pFields[0]->PhysDeriv(pU,gradV0,gradV1);
Vmath::Vmul (nPointsTot,gradV0,1,pV[0],1,pOutarray,1);
Vmath::Vvtvp(nPointsTot,gradV1,1,pV[1],1,pOutarray,1,pOutarray,1);
Vmath::Vmul(nPointsTot,pU,1,pV[0],1,gradV0,1);
Vmath::Vmul(nPointsTot,pU,1,pV[1],1,gradV1,1);
pFields[0]->PhysDeriv(MultiRegions::DirCartesianMap[0],gradV0,tmp);
Vmath::Vadd(nPointsTot,tmp,1,pOutarray,1,pOutarray,1);
pFields[0]->PhysDeriv(MultiRegions::DirCartesianMap[1],gradV1,tmp);
Vmath::Vadd(nPointsTot,tmp,1,pOutarray,1,pOutarray,1);
Vmath::Smul(nPointsTot,0.5,pOutarray,1,pOutarray,1);
break;
case 3:
gradV1 = Array<OneD, NekDouble> (nPointsTot);
gradV2 = Array<OneD, NekDouble> (nPointsTot);
pFields[0]->PhysDeriv(pU,gradV0,gradV1,gradV2);
//pOutarray = 1/2(u*du/dx + v*du/dy + w*du/dz + duu/dx + duv/dy + duw/dz)
if(m_homogen_dealiasing == true && pFields[0]->GetWaveSpace() == false)
{
pFields[0]->DealiasedProd(pV[0],gradV0,gradV0,m_CoeffState);
pFields[0]->DealiasedProd(pV[1],gradV1,gradV1,m_CoeffState);
pFields[0]->DealiasedProd(pV[2],gradV2,gradV2,m_CoeffState);
Vmath::Vadd(nPointsTot,gradV0,1,gradV1,1,pOutarray,1);
Vmath::Vadd(nPointsTot,gradV2,1,pOutarray,1,pOutarray,1);
pFields[0]->DealiasedProd(pU,pV[0],gradV0,m_CoeffState);
pFields[0]->DealiasedProd(pU,pV[1],gradV1,m_CoeffState);
pFields[0]->DealiasedProd(pU,pV[2],gradV2,m_CoeffState);
pFields[0]->PhysDeriv(MultiRegions::DirCartesianMap[0],gradV0,tmp);
Vmath::Vadd(nPointsTot,tmp,1,pOutarray,1,pOutarray,1);
pFields[0]->PhysDeriv(MultiRegions::DirCartesianMap[1],gradV1,tmp);
Vmath::Vadd(nPointsTot,tmp,1,pOutarray,1,pOutarray,1);
pFields[0]->PhysDeriv(MultiRegions::DirCartesianMap[2],gradV2,tmp);
Vmath::Vadd(nPointsTot,tmp,1,pOutarray,1,pOutarray,1);
Vmath::Smul(nPointsTot,0.5,pOutarray,1,pOutarray,1);
}
else if(pFields[0]->GetWaveSpace() == true && m_homogen_dealiasing == false)
{
Up = Array<OneD, NekDouble> (nPointsTot);
//vector reused to avoid even more memory requirements
//names may be misleading
pFields[0]->HomogeneousBwdTrans(gradV0,tmp);
Vmath::Vmul(nPointsTot,tmp,1,pV[0],1,pOutarray,1); // + u*du/dx
pFields[0]->HomogeneousBwdTrans(gradV1,tmp);
Vmath::Vvtvp(nPointsTot,tmp,1,pV[1],1,pOutarray,1,pOutarray,1);// + v*du/dy
pFields[0]->HomogeneousBwdTrans(gradV2,tmp);
Vmath::Vvtvp(nPointsTot,tmp,1,pV[2],1,pOutarray,1,pOutarray,1);// + w*du/dz
pFields[0]->HomogeneousBwdTrans(pU,Up);
Vmath::Vmul(nPointsTot,Up,1,pV[0],1,gradV0,1);
Vmath::Vmul(nPointsTot,Up,1,pV[1],1,gradV1,1);
Vmath::Vmul(nPointsTot,Up,1,pV[2],1,gradV2,1);
pFields[0]->SetWaveSpace(false);
pFields[0]->PhysDeriv(MultiRegions::DirCartesianMap[0],gradV0,tmp);//duu/dx
Vmath::Vadd(nPointsTot,tmp,1,pOutarray,1,pOutarray,1);
pFields[0]->PhysDeriv(MultiRegions::DirCartesianMap[1],gradV1,tmp);//duv/dy
Vmath::Vadd(nPointsTot,tmp,1,pOutarray,1,pOutarray,1);
pFields[0]->PhysDeriv(MultiRegions::DirCartesianMap[2],gradV2,tmp);//duw/dz
Vmath::Vadd(nPointsTot,tmp,1,pOutarray,1,pOutarray,1);
pFields[0]->SetWaveSpace(true);
Vmath::Smul(nPointsTot,0.5,pOutarray,1,tmp,1);
pFields[0]->HomogeneousFwdTrans(tmp,pOutarray);
}
else if(pFields[0]->GetWaveSpace() == false && m_homogen_dealiasing == false)
{
Vmath::Vmul(nPointsTot,gradV0,1,pV[0],1,pOutarray,1);
Vmath::Vvtvp(nPointsTot,gradV1,1,pV[1],1,pOutarray,1,pOutarray,1);
Vmath::Vvtvp(nPointsTot,gradV2,1,pV[2],1,pOutarray,1,pOutarray,1);
Vmath::Vmul(nPointsTot,pU,1,pV[0],1,gradV0,1);
Vmath::Vmul(nPointsTot,pU,1,pV[1],1,gradV1,1);
Vmath::Vmul(nPointsTot,pU,1,pV[2],1,gradV2,1);
pFields[0]->PhysDeriv(MultiRegions::DirCartesianMap[0],gradV0,tmp);
Vmath::Vadd(nPointsTot,tmp,1,pOutarray,1,pOutarray,1);
pFields[0]->PhysDeriv(MultiRegions::DirCartesianMap[1],gradV1,tmp);
Vmath::Vadd(nPointsTot,tmp,1,pOutarray,1,pOutarray,1);
pFields[0]->PhysDeriv(MultiRegions::DirCartesianMap[2],gradV2,tmp);
Vmath::Vadd(nPointsTot,tmp,1,pOutarray,1,pOutarray,1);
Vmath::Smul(nPointsTot,0.5,pOutarray,1,pOutarray,1);
}
else
{
ASSERTL0(false, "Dealiasing is not allowed in combination "
"with the Skew-Symmetric advection form for "
"efficiency reasons.");
}
break;
default:
ASSERTL0(false,"dimension unknown");
}
}

Friends And Related Function Documentation

friend class MemoryManager< SkewSymmetricAdvection >
friend

Definition at line 55 of file SkewSymmetricAdvection.h.

Member Data Documentation

string Nektar::SkewSymmetricAdvection::className = GetAdvectionTermFactory().RegisterCreatorFunction("SkewSymmetric", SkewSymmetricAdvection::create)
static

Name of class.

Definition at line 66 of file SkewSymmetricAdvection.h.

std::string Nektar::SkewSymmetricAdvection::className2
static

Definition at line 67 of file SkewSymmetricAdvection.h.