38#include "../../option_structure.hpp"
51 std::unique_ptr<unsigned long[]>
Nodes;
78 CPrimalGrid(
bool FEM,
unsigned short nNodes,
unsigned short nNeighbor_Elements);
90 inline unsigned long GetNode(
unsigned short val_node)
const {
return Nodes[val_node]; }
97 inline void SetNode(
unsigned short val_node,
unsigned long val_point) {
99 Nodes[val_node] = val_point;
171 assert(val_periodic < std::numeric_limits<int8_t>::max());
198 for (
unsigned short iDim = 0; iDim < nDim; iDim++) {
200 for (
unsigned short iNode = 0; iNode <
GetnNodes(); iNode++)
244 inline virtual void SetColor(
unsigned long val_color) {}
250 inline virtual unsigned long GetColor()
const {
return std::numeric_limits<unsigned long>::max(); }
312 inline virtual unsigned short GetnNodesFace(
unsigned short val_face)
const {
return 0; }
326 virtual unsigned short GetFaces(
unsigned short val_face,
unsigned short val_index)
const = 0;
341 virtual unsigned short GetNeighbor_Nodes(
unsigned short val_node,
unsigned short val_index)
const = 0;
358 unsigned long faceConn[6][4])
const {}
467template <
typename Connectivity>
472 inline unsigned short GetnNodes() const final {
return Connectivity::nNodes; }
474 inline unsigned short GetnFaces() const final {
return Connectivity::nFaces; }
477 assert(val_face < Connectivity::nFaces);
478 return Connectivity::nNodesFace[val_face];
481 inline unsigned short GetMaxNodesFace() const final {
return Connectivity::maxNodesFace; }
483 inline unsigned short GetFaces(
unsigned short val_face,
unsigned short val_index)
const final {
485 return Connectivity::Faces[val_face][val_index];
489 assert(val_node < Connectivity::nNodes);
490 return Connectivity::nNeighbor_Nodes[val_node];
493 inline unsigned short GetNeighbor_Nodes(
unsigned short val_node,
unsigned short val_index)
const final {
495 return Connectivity::Neighbor_Nodes[val_node][val_index];
498 inline unsigned short GetVTK_Type() const final {
return Connectivity::VTK_Type; }
Override the connectivity getters of CPrimalGrid.
Definition CPrimalGrid.hpp:468
unsigned short GetMaxNodesFace() const final
Get the maximum number of nodes contained in a face of the element.
Definition CPrimalGrid.hpp:481
CPrimalGridWithConnectivity(bool FEM)
Definition CPrimalGrid.hpp:470
unsigned short GetFaces(unsigned short val_face, unsigned short val_index) const final
Get nodes contained in a face.
Definition CPrimalGrid.hpp:483
unsigned short GetnNodes() const final
Get number of nodes of the element.
Definition CPrimalGrid.hpp:472
unsigned short GetnNodesFace(unsigned short val_face) const final
Get number of nodes of a face of the element.
Definition CPrimalGrid.hpp:476
unsigned short GetVTK_Type() const final
Get VTK type.
Definition CPrimalGrid.hpp:498
unsigned short GetnFaces() const final
Get number of faces of the element.
Definition CPrimalGrid.hpp:474
unsigned short GetnNeighbor_Nodes(unsigned short val_node) const final
Get number of neighbor nodes of a node.
Definition CPrimalGrid.hpp:488
unsigned short GetNeighbor_Nodes(unsigned short val_node, unsigned short val_index) const final
Get neighbor nodes of a node.
Definition CPrimalGrid.hpp:493
Class to define the numerical primal grid.
Definition CPrimalGrid.hpp:45
void InitializeNeighbors(unsigned short val_nFaces)
Initialize the information about the neighboring elements.
Definition CPrimalGrid.cpp:36
void SetJacobianConstantFace(bool val_JacFaceIsConstant, unsigned short val_face)
Set whether or not the Jacobian of the given face is considered constant.
Definition CPrimalGrid.hpp:187
void SetVolume(su2double val_volume)
Set the center of gravity of an element (including edges).
Definition CPrimalGrid.hpp:218
void SetLengthScale(su2double val_lenScale)
Set the length scale of the element.
Definition CPrimalGrid.hpp:128
su2double GetVolume() const
Get the center of gravity of an element (including edges).
Definition CPrimalGrid.hpp:225
su2double LenScale
Length scale of the element.
Definition CPrimalGrid.hpp:56
std::unique_ptr< long[]> Neighbor_Elements
Vector to store the elements surronding this element.
Definition CPrimalGrid.hpp:52
virtual unsigned short GetnNeighbor_Nodes(unsigned short val_node) const =0
Get number of neighbor nodes of a node.
unsigned long GlobalIndex_DomainElement
Definition CPrimalGrid.hpp:49
su2double GetCG(unsigned short val_dim) const
Get the center of gravity of an element (including edges).
Definition CPrimalGrid.hpp:211
virtual unsigned short GetNDOFsGrid() const
Virtual function to make available the number of DOFs of the grid in the element.
Definition CPrimalGrid.hpp:388
virtual void Change_Orientation()=0
A pure virtual member.
su2double Coord_CG[3]
Coordinates of the center-of-gravity of the element.
Definition CPrimalGrid.hpp:54
virtual unsigned short GetMaxNodesFace() const =0
Get the maximum number of nodes contained in a face of the element.
virtual unsigned short GetNPolySol() const
Virtual function to make available the polynomial degree of the solution.
Definition CPrimalGrid.hpp:382
su2double GetLengthScale() const
Make available the length scale of the element.
Definition CPrimalGrid.hpp:122
const su2double * GetCG() const
Definition CPrimalGrid.hpp:212
unsigned long GetNode(unsigned short val_node) const
Get the nodes shared by the primal grid element.
Definition CPrimalGrid.hpp:90
virtual const unsigned long * GetDonorsWallFunctions() const
Definition CPrimalGrid.hpp:432
virtual unsigned long GetGlobalElemID() const
Virtual function to make available the global ID of this element.
Definition CPrimalGrid.hpp:364
unsigned short GetTimeLevel() const
Make available the time level of the element.
Definition CPrimalGrid.hpp:134
bool JacobianFaceIsConstant[N_FACES_MAXIMUM]
Whether or not the Jacobian of the faces can be considered constant in the transformation to the stan...
Definition CPrimalGrid.hpp:65
virtual void AddDonorWallFunctions(const unsigned long donorElement)
Virtual function to add the given donor ID to the donor elements for the wall function treatment.
Definition CPrimalGrid.hpp:418
su2double * SetCoord_CG(unsigned short nDim, const T &val_coord)
Set the center of gravity of an element (including edges).
Definition CPrimalGrid.hpp:197
virtual unsigned long GetColor() const
A virtual member.
Definition CPrimalGrid.hpp:250
virtual unsigned short GetNeighbor_Nodes(unsigned short val_node, unsigned short val_index) const =0
Get neighbor nodes of a node.
int8_t PeriodIndexNeighbors[N_FACES_MAXIMUM]
Definition CPrimalGrid.hpp:61
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 adj...
Definition CPrimalGrid.hpp:156
virtual unsigned long * GetDonorsWallFunctions()
Virtual function to make available the pointer to the vector for the donor elements for the wall func...
Definition CPrimalGrid.hpp:431
virtual unsigned short GetFaces(unsigned short val_face, unsigned short val_index) const =0
Get nodes contained in a face.
virtual unsigned short GetnFaces() const =0
Get number of faces of the element.
void SetPeriodicIndex(unsigned short val_periodic, unsigned short val_face)
Set the index of the periodic transformation to the neighboring element.
Definition CPrimalGrid.hpp:170
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.
Definition CPrimalGrid.hpp:438
virtual void RemoveMultipleDonorsWallFunctions()
Virtual function to remove the multiple donors for the wall function treatment.
Definition CPrimalGrid.hpp:443
void SetTimeLevel(unsigned short val_timeLevel)
Set the time level of the element.
Definition CPrimalGrid.hpp:140
void SetNeighbor_Elements(unsigned long val_elem, unsigned short val_face)
Set the elements that surround an element.
Definition CPrimalGrid.hpp:114
su2double Volume
Volume of the element.
Definition CPrimalGrid.hpp:55
short GetPeriodicIndex(unsigned short val_face) const
Get the index of the periodic transformation to the neighboring element.
Definition CPrimalGrid.hpp:163
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 adj...
Definition CPrimalGrid.hpp:148
virtual void AddOffsetGlobalDOFs(const unsigned long val_offsetRank)
Virtual function to correct the offset of the global DOFs.
Definition CPrimalGrid.hpp:412
unsigned long GetGlobalIndex() const
Get the element global index in a parallel computation.
Definition CPrimalGrid.hpp:256
unsigned long GetDomainElement() const
Get the index of the domain element of which this boundary element is a face.
Definition CPrimalGrid.hpp:273
void SetDomainElement(unsigned long val_domainelement)
Set the index of the domain element of which this boundary element is a face.
Definition CPrimalGrid.hpp:268
bool ElementOwnsFace[N_FACES_MAXIMUM]
Whether or not the element owns each face.
Definition CPrimalGrid.hpp:66
virtual unsigned short GetNDonorsWallFunctions() const
Virtual function to make available the number of donor elements for the wall function treatment.
Definition CPrimalGrid.hpp:424
virtual unsigned short GetNPolyGrid() const
Virtual function to make available the polynomial degree of the grid.
Definition CPrimalGrid.hpp:376
virtual void SetColor(unsigned long val_color)
A virtual member.
Definition CPrimalGrid.hpp:244
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.
Definition CPrimalGrid.hpp:357
virtual unsigned short GetNDOFsSol() const
Virtual function to make available the number of DOFs of the solution in the element.
Definition CPrimalGrid.hpp:394
virtual void SetJacobianConsideredConstant(bool val_JacobianConsideredConstant)
Virtual function to set the value of JacobianConsideredConstant.
Definition CPrimalGrid.hpp:406
virtual unsigned short GetnNodes() const =0
Get number of nodes of the element.
unsigned short TimeLevel
Time level of the element for time accurate local time stepping.
Definition CPrimalGrid.hpp:58
virtual unsigned short GetVTK_Type() const =0
Get VTK type.
virtual ~CPrimalGrid()=default
Destructor of the class.
std::unique_ptr< unsigned long[]> Nodes
Global node indices of the element.
Definition CPrimalGrid.hpp:51
void ResetJacobianConstantFaces()
Reset the array, which stores whether or not the faces have a constant Jacobian, to false.
Definition CPrimalGrid.hpp:230
const bool FEM
Whether this is a FEM element.
Definition CPrimalGrid.hpp:67
virtual void SetRotation_Type(unsigned short val_rotation_type)
A pure virtual member.
Definition CPrimalGrid.hpp:290
long GetNeighbor_Elements(unsigned short val_face) const
Get the elements that surround an element.
Definition CPrimalGrid.hpp:107
virtual unsigned short GetRotation_Type() const
A pure virtual member.
Definition CPrimalGrid.hpp:284
void SetGlobalIndex(unsigned long val_globalindex)
Set the global index for an element in a parallel computation.
Definition CPrimalGrid.hpp:262
virtual unsigned long GetGlobalOffsetDOFsSol() const
Virtual function to make available the global offset of the solution DOFs.
Definition CPrimalGrid.hpp:370
bool GetJacobianConstantFace(unsigned short val_face) const
Get whether or not the Jacobian of the given face is considered constant.
Definition CPrimalGrid.hpp:180
virtual bool GetJacobianConsideredConstant() const
Virtual function to get whether or not the Jacobian is considered constant.
Definition CPrimalGrid.hpp:400
void SetNode(unsigned short val_node, unsigned long val_point)
Set the nodes shared by the primal grid element.
Definition CPrimalGrid.hpp:97
virtual unsigned short GetnNodesFace(unsigned short val_face) const
Get number of nodes of a face of the element.
Definition CPrimalGrid.hpp:312
passivedouble su2double
Definition code_config.hpp:181
constexpr unsigned short N_FACES_MAXIMUM
Max. out of the above, used for static arrays, keep it up to date.
Definition option_structure.hpp:159