Documentation 6b54b78464
Loading...
Searching...
No Matches
CPrimalGridBoundFEM.hpp
Go to the documentation of this file.
1/*!
2 * \file CPrimalGridBoundFEM.hpp
3 * \brief Headers of the main subroutines for storing the primal grid structure.
4 * The subroutines and functions are in the <i>CPrimalGridBoundFEM.cpp</i> file.
5 * \author F. Palacios
6 * \version 8.5.0 "Harrier"
7 *
8 * SU2 Project Website: https://su2code.github.io
9 *
10 * The SU2 Project is maintained by the SU2 Foundation
11 * (http://su2foundation.org)
12 *
13 * Copyright 2012-2026, SU2 Contributors (cf. AUTHORS.md)
14 *
15 * SU2 is free software; you can redistribute it and/or
16 * modify it under the terms of the GNU Lesser General Public
17 * License as published by the Free Software Foundation; either
18 * version 2.1 of the License, or (at your option) any later version.
19 *
20 * SU2 is distributed in the hope that it will be useful,
21 * but WITHOUT ANY WARRANTY; without even the implied warranty of
22 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
23 * Lesser General Public License for more details.
24 *
25 * You should have received a copy of the GNU Lesser General Public
26 * License along with SU2. If not, see <http://www.gnu.org/licenses/>.
27 */
28
29#pragma once
30
31#include "CPrimalGrid.hpp"
32
33/*!
34 * \class CPrimalGridBoundFEM
35 * \brief Class to define primal grid boundary element for the FEM solver.
36 * \version 8.5.0 "Harrier"
37 */
38class CPrimalGridBoundFEM final : public CPrimalGrid {
39 private:
40 unsigned long boundElemIDGlobal; /*!< \brief Global boundary element ID of this element. */
41
42 std::vector<unsigned long> donorElementsWallFunctions; /*!< \brief The global ID's of the donor elements
43 for the wall function treatment. */
44
45 unsigned short VTK_Type; /*!< \brief Element type using the VTK convention. */
46 unsigned short nPolyGrid; /*!< \brief Polynomial degree for the geometry of the element. */
47 unsigned short nDOFsGrid; /*!< \brief Number of DOFs for the geometry of the element. */
48
49 bool JacobianConsideredConstant; /*!< \brief Whether or not the Jacobian of the transformation to
50 is (almost) constant. */
51 public:
52 /*!
53 * \brief Constructor using data to initialize the boundary element.
54 * \param[in] dataElem - Meta and connectivity data for this element.
55 */
56 CPrimalGridBoundFEM(const unsigned long* dataElem);
57
58 /*!
59 * \brief Get the number of nodes that composes a face of an element.
60 * \param[in] val_face - Local index of the face.
61 * \return Number of nodes that composes a face of an element.
62 */
63 inline unsigned short GetnNodesFace(unsigned short val_face) const override {
64 return std::numeric_limits<unsigned short>::max();
65 }
66
67 /*!
68 * \brief Get the face index of an element.
69 * \param[in] val_face - Local index of the face.
70 * \param[in] val_index - Local (to the face) index of the nodes that compose the face.
71 * \return Local (to the element) index of the nodes that compose the face.
72 */
73 inline unsigned short GetFaces(unsigned short val_face, unsigned short val_index) const override {
74 return std::numeric_limits<unsigned short>::max();
75 }
76
77 /*!
78 * \brief Get the local index of the neighbors to a node (given the local index).
79 * \param[in] val_node - Local (to the element) index of a node.
80 * \param[in] val_index - Local (to the neighbor nodes of val_node) index of the nodes that are neighbor to val_node.
81 * \return Local (to the element) index of the nodes that are neighbor to val_node.
82 */
83 inline unsigned short GetNeighbor_Nodes(unsigned short val_node, unsigned short val_index) const override {
84 return std::numeric_limits<unsigned short>::max();
85 }
86
87 /*!
88 * \brief Get the number of nodes of an element.
89 * \return Number of nodes that composes an element.
90 */
91 inline unsigned short GetnNodes(void) const override { return nDOFsGrid; }
92
93 /*!
94 * \brief Get the number of faces of an element.
95 * \return Number of faces of an element.
96 */
97 inline unsigned short GetnFaces(void) const override { return std::numeric_limits<unsigned short>::max(); }
98
99 /*!
100 * \brief Get the number of neighbors nodes of a node.
101 * \param[in] val_node - Local (to the element) index of a node.
102 * \return Number if neighbors of a node val_node.
103 */
104 inline unsigned short GetnNeighbor_Nodes(unsigned short val_node) const override {
105 return std::numeric_limits<unsigned short>::max();
106 }
107
108 /*!
109 * \brief Change the orientation of an element.
110 */
111 inline void Change_Orientation(void) override {}
112
113 /*!
114 * \brief Get the Maximum number of nodes of a face of an element.
115 * \return Maximum number of nodes of a face of an element.
116 */
117 inline unsigned short GetMaxNodesFace(void) const override { return std::numeric_limits<unsigned short>::max(); }
118
119 /*!
120 * \brief Get the type of the element using VTK nomenclature.
121 * \return Type of the element using VTK nomenclature.
122 */
123 inline unsigned short GetVTK_Type(void) const override { return VTK_Type; }
124
125 /*!
126 * \brief Get the polynomial degree of the grid for this element.
127 * \return The polynomial degree of the grid.
128 */
129 inline unsigned short GetNPolyGrid(void) const override { return nPolyGrid; }
130
131 /*!
132 * \brief Function to make available the number of DOFs of the grid in the element.
133 * \return The number of DOFs of the grid in the element.
134 */
135 inline unsigned short GetNDOFsGrid(void) const override { return nDOFsGrid; }
136
137 /*!
138 * \brief Get the corner points of this boundary element.
139 * \param[out] nFaces - Number of faces of this element, i.e. 1.
140 * \param[out] nPointsPerFace - Number of corner points for each of the faces.
141 * \param[out] faceConn - Global IDs of the corner points of the faces.
142 */
143 void GetCornerPointsAllFaces(unsigned short& nFaces, unsigned short nPointsPerFace[],
144 unsigned long faceConn[6][4]) const override;
145
146 /*!
147 * \brief Static member function to get the local the corner points of all the face
148 of this element.
149 * \param[in] elementType - Type of the element using the VTK convention.
150 * \param[in] nPoly - Polynomial degree of the element.
151 * \param[in] nDOFs - Number of DOFs of the element.
152 * \param[out] nPointsPerFace - Number of corner points of the face.
153 * \param[out] faceConn - Global IDs of the corner points of the face.
154 */
155 static void GetLocalCornerPointsFace(unsigned short elementType, unsigned short nPoly, unsigned short nDOFs,
156 unsigned short& nPointsPerFace, unsigned long faceConn[]);
157
158 /*!
159 * \brief Make available the global ID of this element.
160 * \return The global ID of this element.
161 */
162 inline unsigned long GetGlobalElemID(void) const override { return boundElemIDGlobal; }
163
164 /*!
165 * \brief Function to get whether or not the Jacobian is considered constant.
166 * \return True if the Jacobian is (almost) constant and false otherwise.
167 */
168 inline bool GetJacobianConsideredConstant(void) const override { return JacobianConsideredConstant; }
169
170 /*!
171 * \brief Function to set the value of JacobianConsideredConstant.
172 * \param[in] val_JacobianConsideredConstant - The value to be set for JacobianConsideredConstant.
173 */
174 inline void SetJacobianConsideredConstant(bool val_JacobianConsideredConstant) override {
175 JacobianConsideredConstant = val_JacobianConsideredConstant;
176 }
177
178 /*!
179 * \brief Add the given donor ID to the donor elements for the wall function treatment.
180 * \param[in] donorElement - Element to be added to donor elements.
181 */
182 inline void AddDonorWallFunctions(const unsigned long donorElement) override {
183 donorElementsWallFunctions.push_back(donorElement);
184 }
185
186 /*!
187 * \brief Make available the number of donor elements for the wall function treatment.
188 * \return The number of donor elements.
189 */
190 inline unsigned short GetNDonorsWallFunctions(void) const override { return donorElementsWallFunctions.size(); }
191
192 /*!
193 * \brief Make available the pointer to the vector for the donor elements
194 for the wall function treatment.
195 * \return The pointer to the data of donorElementsWallFunctions.
196 */
197 inline unsigned long* GetDonorsWallFunctions(void) override { return donorElementsWallFunctions.data(); }
198 inline const unsigned long* GetDonorsWallFunctions(void) const override { return donorElementsWallFunctions.data(); }
199
200 /*!
201 * \brief Set the global ID's of the donor elements for the wall function treatment.
202 * \param[in] donorElements - Vector, which contain the donor elements.
203 */
204 inline void SetDonorsWallFunctions(const std::vector<unsigned long>& donorElements) override {
205 donorElementsWallFunctions = donorElements;
206 }
207
208 /*!
209 * \brief Function to remove the multiple donors for the wall function treatment.
210 */
211 void RemoveMultipleDonorsWallFunctions(void) override;
212};
Headers of the main subroutines for storing the primal grid structure. The subroutines and functions ...
Class to define primal grid boundary element for the FEM solver.
Definition CPrimalGridBoundFEM.hpp:38
unsigned short GetFaces(unsigned short val_face, unsigned short val_index) const override
Get the face index of an element.
Definition CPrimalGridBoundFEM.hpp:73
unsigned short GetNDOFsGrid(void) const override
Function to make available the number of DOFs of the grid in the element.
Definition CPrimalGridBoundFEM.hpp:135
unsigned long GetGlobalElemID(void) const override
Make available the global ID of this element.
Definition CPrimalGridBoundFEM.hpp:162
unsigned short GetNDonorsWallFunctions(void) const override
Make available the number of donor elements for the wall function treatment.
Definition CPrimalGridBoundFEM.hpp:190
unsigned short GetnFaces(void) const override
Get the number of faces of an element.
Definition CPrimalGridBoundFEM.hpp:97
void SetJacobianConsideredConstant(bool val_JacobianConsideredConstant) override
Function to set the value of JacobianConsideredConstant.
Definition CPrimalGridBoundFEM.hpp:174
void GetCornerPointsAllFaces(unsigned short &nFaces, unsigned short nPointsPerFace[], unsigned long faceConn[6][4]) const override
Get the corner points of this boundary element.
Definition CPrimalGridBoundFEM.cpp:74
void RemoveMultipleDonorsWallFunctions(void) override
Function to remove the multiple donors for the wall function treatment.
Definition CPrimalGridBoundFEM.cpp:91
static void GetLocalCornerPointsFace(unsigned short elementType, unsigned short nPoly, unsigned short nDOFs, unsigned short &nPointsPerFace, unsigned long faceConn[])
Static member function to get the local the corner points of all the face of this element.
Definition CPrimalGridBoundFEM.cpp:43
unsigned short GetnNeighbor_Nodes(unsigned short val_node) const override
Get the number of neighbors nodes of a node.
Definition CPrimalGridBoundFEM.hpp:104
unsigned short GetnNodes(void) const override
Get the number of nodes of an element.
Definition CPrimalGridBoundFEM.hpp:91
void Change_Orientation(void) override
Change the orientation of an element.
Definition CPrimalGridBoundFEM.hpp:111
unsigned long * GetDonorsWallFunctions(void) override
Make available the pointer to the vector for the donor elements for the wall function treatment.
Definition CPrimalGridBoundFEM.hpp:197
void SetDonorsWallFunctions(const std::vector< unsigned long > &donorElements) override
Set the global ID's of the donor elements for the wall function treatment.
Definition CPrimalGridBoundFEM.hpp:204
unsigned short GetNeighbor_Nodes(unsigned short val_node, unsigned short val_index) const override
Get the local index of the neighbors to a node (given the local index).
Definition CPrimalGridBoundFEM.hpp:83
void AddDonorWallFunctions(const unsigned long donorElement) override
Add the given donor ID to the donor elements for the wall function treatment.
Definition CPrimalGridBoundFEM.hpp:182
unsigned short GetMaxNodesFace(void) const override
Get the Maximum number of nodes of a face of an element.
Definition CPrimalGridBoundFEM.hpp:117
unsigned short GetnNodesFace(unsigned short val_face) const override
Get the number of nodes that composes a face of an element.
Definition CPrimalGridBoundFEM.hpp:63
const unsigned long * GetDonorsWallFunctions(void) const override
Definition CPrimalGridBoundFEM.hpp:198
bool GetJacobianConsideredConstant(void) const override
Function to get whether or not the Jacobian is considered constant.
Definition CPrimalGridBoundFEM.hpp:168
unsigned short GetVTK_Type(void) const override
Get the type of the element using VTK nomenclature.
Definition CPrimalGridBoundFEM.hpp:123
unsigned short GetNPolyGrid(void) const override
Get the polynomial degree of the grid for this element.
Definition CPrimalGridBoundFEM.hpp:129
Class to define the numerical primal grid.
Definition CPrimalGrid.hpp:45