Documentation 6b54b78464
Loading...
Searching...
No Matches
CPrimalGrid Class Referenceabstract

Class to define the numerical primal grid. More...

#include <CPrimalGrid.hpp>

Inheritance diagram for CPrimalGrid:
[legend]

Public Member Functions

 CPrimalGrid ()=delete
 
 CPrimalGrid (bool FEM, unsigned short nNodes, unsigned short nNeighbor_Elements)
 Constructor of the class.
 
virtual ~CPrimalGrid ()=default
 Destructor of the class.
 
unsigned long GetNode (unsigned short val_node) const
 Get the nodes shared by the primal grid element.
 
void SetNode (unsigned short val_node, unsigned long val_point)
 Set the nodes shared by the primal grid element.
 
long GetNeighbor_Elements (unsigned short val_face) const
 Get the elements that surround an element.
 
void SetNeighbor_Elements (unsigned long val_elem, unsigned short val_face)
 Set the elements that surround an element.
 
su2double GetLengthScale () const
 Make available the length scale of the element.
 
void SetLengthScale (su2double val_lenScale)
 Set the length scale of the element.
 
unsigned short GetTimeLevel () const
 Make available the time level of the element.
 
void SetTimeLevel (unsigned short val_timeLevel)
 Set the time level of the element.
 
bool GetOwnerFace (unsigned short val_face) const
 Get the boolean to indicate whether or not this element owns the face between the current and the adjacent element with index val_face.
 
void SetOwnerFace (bool val_owner, unsigned short val_face)
 Set the boolean to indicate whether or not this element owns the face between the current and the adjacent element with index val_face.
 
short GetPeriodicIndex (unsigned short val_face) const
 Get the index of the periodic transformation to the neighboring element.
 
void SetPeriodicIndex (unsigned short val_periodic, unsigned short val_face)
 Set the index of the periodic transformation to the neighboring element.
 
bool GetJacobianConstantFace (unsigned short val_face) const
 Get whether or not the Jacobian of the given face is considered constant.
 
void SetJacobianConstantFace (bool val_JacFaceIsConstant, unsigned short val_face)
 Set whether or not the Jacobian of the given face is considered constant.
 
template<class T >
su2double * SetCoord_CG (unsigned short nDim, const T &val_coord)
 Set the center of gravity of an element (including edges).
 
su2double GetCG (unsigned short val_dim) const
 Get the center of gravity of an element (including edges).
 
const su2double * GetCG () const
 
void SetVolume (su2double val_volume)
 Set the center of gravity of an element (including edges).
 
su2double GetVolume () const
 Get the center of gravity of an element (including edges).
 
void ResetJacobianConstantFaces ()
 Reset the array, which stores whether or not the faces have a constant Jacobian, to false.
 
void InitializeNeighbors (unsigned short val_nFaces)
 Initialize the information about the neighboring elements.
 
virtual void SetColor (unsigned long val_color)
 A virtual member.
 
virtual unsigned long GetColor () const
 A virtual member.
 
unsigned long GetGlobalIndex () const
 Get the element global index in a parallel computation.
 
void SetGlobalIndex (unsigned long val_globalindex)
 Set the global index for an element in a parallel computation.
 
void SetDomainElement (unsigned long val_domainelement)
 Set the index of the domain element of which this boundary element is a face.
 
unsigned long GetDomainElement () const
 Get the index of the domain element of which this boundary element is a face.
 
virtual void Change_Orientation ()=0
 A pure virtual member.
 
virtual unsigned short GetRotation_Type () const
 A pure virtual member.
 
virtual void SetRotation_Type (unsigned short val_rotation_type)
 A pure virtual member.
 
virtual unsigned short GetnNodes () const =0
 Get number of nodes of the element.
 
virtual unsigned short GetnFaces () const =0
 Get number of faces of the element.
 
virtual unsigned short GetnNodesFace (unsigned short val_face) const
 Get number of nodes of a face of the element.
 
virtual unsigned short GetMaxNodesFace () const =0
 Get the maximum number of nodes contained in a face of the element.
 
virtual unsigned short GetFaces (unsigned short val_face, unsigned short val_index) const =0
 Get nodes contained in a face.
 
virtual unsigned short GetnNeighbor_Nodes (unsigned short val_node) const =0
 Get number of neighbor nodes of a node.
 
virtual unsigned short GetNeighbor_Nodes (unsigned short val_node, unsigned short val_index) const =0
 Get neighbor nodes of a node.
 
virtual unsigned short GetVTK_Type () const =0
 Get VTK type.
 
virtual void GetCornerPointsAllFaces (unsigned short &nFaces, unsigned short nPointsPerFace[], unsigned long faceConn[6][4]) const
 Virtual function, that must be overwritten by the derived class, if needed.
 
virtual unsigned long GetGlobalElemID () const
 Virtual function to make available the global ID of this element.
 
virtual unsigned long GetGlobalOffsetDOFsSol () const
 Virtual function to make available the global offset of the solution DOFs.
 
virtual unsigned short GetNPolyGrid () const
 Virtual function to make available the polynomial degree of the grid.
 
virtual unsigned short GetNPolySol () const
 Virtual function to make available the polynomial degree of the solution.
 
virtual unsigned short GetNDOFsGrid () const
 Virtual function to make available the number of DOFs of the grid in the element.
 
virtual unsigned short GetNDOFsSol () const
 Virtual function to make available the number of DOFs of the solution in the element.
 
virtual bool GetJacobianConsideredConstant () const
 Virtual function to get whether or not the Jacobian is considered constant.
 
virtual void SetJacobianConsideredConstant (bool val_JacobianConsideredConstant)
 Virtual function to set the value of JacobianConsideredConstant.
 
virtual void AddOffsetGlobalDOFs (const unsigned long val_offsetRank)
 Virtual function to correct the offset of the global DOFs.
 
virtual void AddDonorWallFunctions (const unsigned long donorElement)
 Virtual function to add the given donor ID to the donor elements for the wall function treatment.
 
virtual unsigned short GetNDonorsWallFunctions () const
 Virtual function to make available the number of donor elements for the wall function treatment.
 
virtual unsigned long * GetDonorsWallFunctions ()
 Virtual function to make available the pointer to the vector for the donor elements for the wall function treatment.
 
virtual const unsigned long * GetDonorsWallFunctions () const
 
virtual void SetDonorsWallFunctions (const std::vector< unsigned long > &donorElements)
 Virtual function to set the global ID's of the donor elements for the wall function treatment.
 
virtual void RemoveMultipleDonorsWallFunctions ()
 Virtual function to remove the multiple donors for the wall function treatment.
 

Protected Attributes

unsigned long GlobalIndex_DomainElement
 
std::unique_ptr< unsigned long[]> Nodes
 Global node indices of the element.
 
std::unique_ptr< long[]> Neighbor_Elements
 Vector to store the elements surronding this element.
 
su2double Coord_CG [3] = {0.0}
 Coordinates of the center-of-gravity of the element.
 
su2double Volume
 Volume of the element.
 
su2double LenScale
 Length scale of the element.
 
unsigned short TimeLevel
 Time level of the element for time accurate local time stepping.
 
int8_t PeriodIndexNeighbors [N_FACES_MAXIMUM]
 
bool JacobianFaceIsConstant [N_FACES_MAXIMUM]
 Whether or not the Jacobian of the faces can be considered constant in the transformation to the standard element.
 
bool ElementOwnsFace [N_FACES_MAXIMUM]
 Whether or not the element owns each face.
 
const bool FEM
 Whether this is a FEM element.
 

Detailed Description

Class to define the numerical primal grid.

Author
F. Palacios, T. Economon, M. Aehle.

Constructor & Destructor Documentation

◆ CPrimalGrid() [1/2]

CPrimalGrid::CPrimalGrid ( )
delete

◆ CPrimalGrid() [2/2]

CPrimalGrid::CPrimalGrid ( bool  FEM,
unsigned short  nNodes,
unsigned short  nNeighbor_Elements 
)

Constructor of the class.

Parameters
[in]FEM- Whether this is a FEM element.
[in]nNodes- Number of nodes.
[in]nNeighbor_Elements- Number of neighbor elements.

◆ ~CPrimalGrid()

virtual CPrimalGrid::~CPrimalGrid ( )
virtualdefault

Destructor of the class.

Member Function Documentation

◆ AddDonorWallFunctions()

virtual void CPrimalGrid::AddDonorWallFunctions ( const unsigned long  donorElement)
inlinevirtual

Virtual function to add the given donor ID to the donor elements for the wall function treatment.

Parameters
[in]donorElement- Element to be added to donor elements.

Reimplemented in CPrimalGridBoundFEM.

◆ AddOffsetGlobalDOFs()

virtual void CPrimalGrid::AddOffsetGlobalDOFs ( const unsigned long  val_offsetRank)
inlinevirtual

Virtual function to correct the offset of the global DOFs.

Parameters
[in]val_offsetRank- The offset that must be added for this rank.

Reimplemented in CPrimalGridFEM.

◆ Change_Orientation()

virtual void CPrimalGrid::Change_Orientation ( )
pure virtual

◆ GetCG() [1/2]

const su2double * CPrimalGrid::GetCG ( ) const
inline

◆ GetCG() [2/2]

su2double CPrimalGrid::GetCG ( unsigned short  val_dim) const
inline

Get the center of gravity of an element (including edges).

Parameters
[in]val_dim- Coordinate of the center of gravity.
Returns
Coordinates of the center of gravity.

◆ GetColor()

virtual unsigned long CPrimalGrid::GetColor ( void  ) const
inlinevirtual

A virtual member.

Returns
The color of the element in the partitioning.

Reimplemented in CPrimalGridFEM.

◆ GetCornerPointsAllFaces()

virtual void CPrimalGrid::GetCornerPointsAllFaces ( unsigned short &  nFaces,
unsigned short  nPointsPerFace[],
unsigned long  faceConn[6][4] 
) const
inlinevirtual

Virtual function, that must be overwritten by the derived class, if needed.

Parameters
[out]nFaces- Number of faces of this element.
[out]nPointsPerFace- Number of corner points for each of the faces.
[out]faceConn- Global IDs of the corner points of the faces.

Reimplemented in CPrimalGridBoundFEM, and CPrimalGridFEM.

◆ GetDomainElement()

unsigned long CPrimalGrid::GetDomainElement ( ) const
inline

Get the index of the domain element of which this boundary element is a face.

◆ GetDonorsWallFunctions() [1/2]

virtual unsigned long * CPrimalGrid::GetDonorsWallFunctions ( void  )
inlinevirtual

Virtual function to make available the pointer to the vector for the donor elements for the wall function treatment.

Returns
The pointer to the data of donorElementsWallFunctions.

Reimplemented in CPrimalGridBoundFEM.

◆ GetDonorsWallFunctions() [2/2]

virtual const unsigned long * CPrimalGrid::GetDonorsWallFunctions ( void  ) const
inlinevirtual

Reimplemented in CPrimalGridBoundFEM, and CPrimalGridBoundFEM.

◆ GetFaces()

virtual unsigned short CPrimalGrid::GetFaces ( unsigned short  val_face,
unsigned short  val_index 
) const
pure virtual

◆ GetGlobalElemID()

virtual unsigned long CPrimalGrid::GetGlobalElemID ( void  ) const
inlinevirtual

Virtual function to make available the global ID of this element.

Returns
The global ID of this element.

Reimplemented in CPrimalGridBoundFEM, and CPrimalGridFEM.

◆ GetGlobalIndex()

unsigned long CPrimalGrid::GetGlobalIndex ( ) const
inline

Get the element global index in a parallel computation.

Returns
Global index of the element in a parallel computation.

◆ GetGlobalOffsetDOFsSol()

virtual unsigned long CPrimalGrid::GetGlobalOffsetDOFsSol ( void  ) const
inlinevirtual

Virtual function to make available the global offset of the solution DOFs.

Returns
The global offset of the solution DOFs.

Reimplemented in CPrimalGridFEM.

◆ GetJacobianConsideredConstant()

virtual bool CPrimalGrid::GetJacobianConsideredConstant ( void  ) const
inlinevirtual

Virtual function to get whether or not the Jacobian is considered constant.

Returns
True if the Jacobian is (almost) constant and false otherwise.

Reimplemented in CPrimalGridBoundFEM, and CPrimalGridFEM.

◆ GetJacobianConstantFace()

bool CPrimalGrid::GetJacobianConstantFace ( unsigned short  val_face) const
inline

Get whether or not the Jacobian of the given face is considered constant.

Parameters
[in]val_face- Local index of the face.
Returns
Whether or not the Jacobian of the face is considered constant.

◆ GetLengthScale()

su2double CPrimalGrid::GetLengthScale ( ) const
inline

Make available the length scale of the element.

Returns
The length scale of the element.

◆ GetMaxNodesFace()

◆ GetNDOFsGrid()

virtual unsigned short CPrimalGrid::GetNDOFsGrid ( void  ) const
inlinevirtual

Virtual function to make available the number of DOFs of the grid in the element.

Returns
The number of DOFs of the Grid in the element.

Reimplemented in CPrimalGridBoundFEM, and CPrimalGridFEM.

◆ GetNDOFsSol()

virtual unsigned short CPrimalGrid::GetNDOFsSol ( void  ) const
inlinevirtual

Virtual function to make available the number of DOFs of the solution in the element.

Returns
The number of DOFs of the solution in the element.

Reimplemented in CPrimalGridFEM.

◆ GetNDonorsWallFunctions()

virtual unsigned short CPrimalGrid::GetNDonorsWallFunctions ( void  ) const
inlinevirtual

Virtual function to make available the number of donor elements for the wall function treatment.

Returns
The number of donor elements.

Reimplemented in CPrimalGridBoundFEM.

◆ GetNeighbor_Elements()

long CPrimalGrid::GetNeighbor_Elements ( unsigned short  val_face) const
inline

Get the elements that surround an element.

Parameters
[in]val_face- Local index of the face.
Returns
Global index of the element.

◆ GetNeighbor_Nodes()

virtual unsigned short CPrimalGrid::GetNeighbor_Nodes ( unsigned short  val_node,
unsigned short  val_index 
) const
pure virtual

◆ GetnFaces()

◆ GetnNeighbor_Nodes()

◆ GetnNodes()

◆ GetnNodesFace()

◆ GetNode()

unsigned long CPrimalGrid::GetNode ( unsigned short  val_node) const
inline

Get the nodes shared by the primal grid element.

Parameters
[in]val_node- Local (to the element) index of the node (lines have 2 nodes, triangles 3 nodes etc).
Returns
Global index of the node.

◆ GetNPolyGrid()

virtual unsigned short CPrimalGrid::GetNPolyGrid ( void  ) const
inlinevirtual

Virtual function to make available the polynomial degree of the grid.

Returns
The polynomial degree of the grid.

Reimplemented in CPrimalGridBoundFEM, and CPrimalGridFEM.

◆ GetNPolySol()

virtual unsigned short CPrimalGrid::GetNPolySol ( void  ) const
inlinevirtual

Virtual function to make available the polynomial degree of the solution.

Returns
The polynomial degree of the solution.

Reimplemented in CPrimalGridFEM.

◆ GetOwnerFace()

bool CPrimalGrid::GetOwnerFace ( unsigned short  val_face) const
inline

Get the boolean to indicate whether or not this element owns the face between the current and the adjacent element with index val_face.

Parameters
[in]val_face- Local index of the face.
Returns
Boolean to indicate whether or not the face is owned by this element.

◆ GetPeriodicIndex()

short CPrimalGrid::GetPeriodicIndex ( unsigned short  val_face) const
inline

Get the index of the periodic transformation to the neighboring element.

Parameters
[in]val_face- Local index of the face.
Returns
Index of the periodic transformation to the neighboring element.

◆ GetRotation_Type()

virtual unsigned short CPrimalGrid::GetRotation_Type ( void  ) const
inlinevirtual

A pure virtual member.

Returns
Type of the element using VTK nomenclature.

Reimplemented in CVertexMPI.

◆ GetTimeLevel()

unsigned short CPrimalGrid::GetTimeLevel ( ) const
inline

Make available the time level of the element.

Returns
The time level of the element.

◆ GetVolume()

su2double CPrimalGrid::GetVolume ( ) const
inline

Get the center of gravity of an element (including edges).

Parameters
[in]val_dim- Coordinate of the center of gravity.
Returns
Coordinates of the center of gravity.

◆ GetVTK_Type()

◆ InitializeNeighbors()

void CPrimalGrid::InitializeNeighbors ( unsigned short  val_nFaces)

Initialize the information about the neighboring elements.

Parameters
[in]val_nFaces- Number of faces for which neighboring information must be initialized.

◆ RemoveMultipleDonorsWallFunctions()

virtual void CPrimalGrid::RemoveMultipleDonorsWallFunctions ( void  )
inlinevirtual

Virtual function to remove the multiple donors for the wall function treatment.

Reimplemented in CPrimalGridBoundFEM.

◆ ResetJacobianConstantFaces()

void CPrimalGrid::ResetJacobianConstantFaces ( )
inline

Reset the array, which stores whether or not the faces have a constant Jacobian, to false.

◆ SetColor()

virtual void CPrimalGrid::SetColor ( unsigned long  val_color)
inlinevirtual

A virtual member.

Parameters
[in]val_color- New color of the element.

Reimplemented in CPrimalGridFEM.

◆ SetCoord_CG()

template<class T >
su2double * CPrimalGrid::SetCoord_CG ( unsigned short  nDim,
const T &  val_coord 
)
inline

Set the center of gravity of an element (including edges).

Parameters
[in]nDim- Number of dimensions (2 or 3).
[in]val_coord- Coordinates of the element.

◆ SetDomainElement()

void CPrimalGrid::SetDomainElement ( unsigned long  val_domainelement)
inline

Set the index of the domain element of which this boundary element is a face.

Parameters
[in]val_domainelement- Value to set.

◆ SetDonorsWallFunctions()

virtual void CPrimalGrid::SetDonorsWallFunctions ( const std::vector< unsigned long > &  donorElements)
inlinevirtual

Virtual function to set the global ID's of the donor elements for the wall function treatment.

Parameters
[in]donorElements- Vector, which contain the donor elements.

Reimplemented in CPrimalGridBoundFEM.

◆ SetGlobalIndex()

void CPrimalGrid::SetGlobalIndex ( unsigned long  val_globalindex)
inline

Set the global index for an element in a parallel computation.

Returns
Global index of an element in a parallel computation.

◆ SetJacobianConsideredConstant()

virtual void CPrimalGrid::SetJacobianConsideredConstant ( bool  val_JacobianConsideredConstant)
inlinevirtual

Virtual function to set the value of JacobianConsideredConstant.

Parameters
[in]val_JacobianConsideredConstant- The value to be set for JacobianConsideredConstant.

Reimplemented in CPrimalGridBoundFEM, and CPrimalGridFEM.

◆ SetJacobianConstantFace()

void CPrimalGrid::SetJacobianConstantFace ( bool  val_JacFaceIsConstant,
unsigned short  val_face 
)
inline

Set whether or not the Jacobian of the given face is considered constant.

Parameters
[in]val_JacFaceIsConstant- Boolean to indicate whether or not the Jacobian is constant.
[in]val_face- Local index of the face.

◆ SetLengthScale()

void CPrimalGrid::SetLengthScale ( su2double  val_lenScale)
inline

Set the length scale of the element.

Parameters
[in]val_lenScale- Length scale of the element.

◆ SetNeighbor_Elements()

void CPrimalGrid::SetNeighbor_Elements ( unsigned long  val_elem,
unsigned short  val_face 
)
inline

Set the elements that surround an element.

Parameters
[in]val_elem- Global index of the element.
[in]val_face- Local index of the face.

◆ SetNode()

void CPrimalGrid::SetNode ( unsigned short  val_node,
unsigned long  val_point 
)
inline

Set the nodes shared by the primal grid element.

Parameters
[in]val_node- Local (to the element) index of the node (lines have 2 nodes, triangles 3 nodes etc).
[in]val_point- Global index of the node.

◆ SetOwnerFace()

void CPrimalGrid::SetOwnerFace ( bool  val_owner,
unsigned short  val_face 
)
inline

Set the boolean to indicate whether or not this element owns the face between the current and the adjacent element with index val_face.

Parameters
[in]val_owner- Whether or not this element owns the face.
[in]val_face- Local index of the face.

◆ SetPeriodicIndex()

void CPrimalGrid::SetPeriodicIndex ( unsigned short  val_periodic,
unsigned short  val_face 
)
inline

Set the index of the periodic transformation to the neighboring element.

Parameters
[in]val_periodic- Index of the periodic marker to which the face belongs.
[in]val_face- Local index of the face.

◆ SetRotation_Type()

virtual void CPrimalGrid::SetRotation_Type ( unsigned short  val_rotation_type)
inlinevirtual

A pure virtual member.

Parameters
[in]val_rotation_type- Kind of rotation/traslation that must be applied.

Reimplemented in CVertexMPI.

◆ SetTimeLevel()

void CPrimalGrid::SetTimeLevel ( unsigned short  val_timeLevel)
inline

Set the time level of the element.

Parameters
[in]val_timeLevel- Time level of the element.

◆ SetVolume()

void CPrimalGrid::SetVolume ( su2double  val_volume)
inline

Set the center of gravity of an element (including edges).

Parameters
[in]val_coord- Coordinates of the element.

Member Data Documentation

◆ Coord_CG

su2double CPrimalGrid::Coord_CG[3] = {0.0}
protected

Coordinates of the center-of-gravity of the element.

◆ ElementOwnsFace

bool CPrimalGrid::ElementOwnsFace[N_FACES_MAXIMUM]
protected

Whether or not the element owns each face.

◆ FEM

const bool CPrimalGrid::FEM
protected

Whether this is a FEM element.

◆ GlobalIndex_DomainElement

unsigned long CPrimalGrid::GlobalIndex_DomainElement
protected

◆ JacobianFaceIsConstant

bool CPrimalGrid::JacobianFaceIsConstant[N_FACES_MAXIMUM]
protected

Whether or not the Jacobian of the faces can be considered constant in the transformation to the standard element.

◆ LenScale

su2double CPrimalGrid::LenScale
protected

Length scale of the element.

◆ Neighbor_Elements

std::unique_ptr<long[]> CPrimalGrid::Neighbor_Elements
protected

Vector to store the elements surronding this element.

◆ Nodes

std::unique_ptr<unsigned long[]> CPrimalGrid::Nodes
protected

Global node indices of the element.

◆ PeriodIndexNeighbors

int8_t CPrimalGrid::PeriodIndexNeighbors[N_FACES_MAXIMUM]
protected

◆ TimeLevel

unsigned short CPrimalGrid::TimeLevel
protected

Time level of the element for time accurate local time stepping.

Vector to store the periodic index of a neighbor, -1 indicates no periodic transformation to the neighbor.

◆ Volume

su2double CPrimalGrid::Volume
protected

Volume of the element.


The documentation for this class was generated from the following files: