Documentation 6b54b78464
Loading...
Searching...
No Matches
CPrimalGrid.hpp
Go to the documentation of this file.
1/*!
2 * \file CPrimalGrid.hpp
3 * \brief Headers of the main subroutines for storing the primal grid structure.
4 * The subroutines and functions are in the <i>primal_grid_structure.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 <cstdint>
32#include <iostream>
33#include <vector>
34#include <limits>
35#include <cstdlib>
36#include <memory>
37
38#include "../../option_structure.hpp"
39
40/*!
41 * \class CPrimalGrid
42 * \brief Class to define the numerical primal grid.
43 * \author F. Palacios, T. Economon, M. Aehle.
44 */
46 protected:
47 /* If this is a domain element, stores the global index.
48 * If this is a boundary element, stores the index of the adjacent domain element. */
50
51 std::unique_ptr<unsigned long[]> Nodes; /*!< \brief Global node indices of the element. */
52 std::unique_ptr<long[]> Neighbor_Elements; /*!< \brief Vector to store the elements surronding this element. */
53
54 su2double Coord_CG[3] = {0.0}; /*!< \brief Coordinates of the center-of-gravity of the element. */
55 su2double Volume; /*!< \brief Volume of the element. */
56 su2double LenScale; /*!< \brief Length scale of the element. */
57
58 unsigned short TimeLevel; /*!< \brief Time level of the element for time accurate local time stepping. */
59 /*!< \brief Vector to store the periodic index of a neighbor, -1 indicates no periodic transformation to the neighbor.
60 */
62
63 /*! \brief Whether or not the Jacobian of the faces can be considered
64 * constant in the transformation to the standard element. */
66 bool ElementOwnsFace[N_FACES_MAXIMUM]; /*!< \brief Whether or not the element owns each face. */
67 const bool FEM; /*!< \brief Whether this is a FEM element. */
68
69 public:
70 CPrimalGrid() = delete;
71
72 /*!
73 * \brief Constructor of the class.
74 * \param[in] FEM - Whether this is a FEM element.
75 * \param[in] nNodes - Number of nodes.
76 * \param[in] nNeighbor_Elements - Number of neighbor elements.
77 */
78 CPrimalGrid(bool FEM, unsigned short nNodes, unsigned short nNeighbor_Elements);
79
80 /*!
81 * \brief Destructor of the class.
82 */
83 virtual ~CPrimalGrid() = default;
84
85 /*!
86 * \brief Get the nodes shared by the primal grid element.
87 * \param[in] val_node - Local (to the element) index of the node (lines have 2 nodes, triangles 3 nodes etc).
88 * \return Global index of the node.
89 */
90 inline unsigned long GetNode(unsigned short val_node) const { return Nodes[val_node]; }
91
92 /*!
93 * \brief Set the nodes shared by the primal grid element.
94 * \param[in] val_node - Local (to the element) index of the node (lines have 2 nodes, triangles 3 nodes etc).
95 * \param[in] val_point - Global index of the node.
96 */
97 inline void SetNode(unsigned short val_node, unsigned long val_point) {
98 assert(val_node < GetnNodes());
99 Nodes[val_node] = val_point;
100 }
101
102 /*!
103 * \brief Get the elements that surround an element.
104 * \param[in] val_face - Local index of the face.
105 * \return Global index of the element.
106 */
107 inline long GetNeighbor_Elements(unsigned short val_face) const { return Neighbor_Elements[val_face]; }
108
109 /*!
110 * \brief Set the elements that surround an element.
111 * \param[in] val_elem - Global index of the element.
112 * \param[in] val_face - Local index of the face.
113 */
114 inline void SetNeighbor_Elements(unsigned long val_elem, unsigned short val_face) {
115 Neighbor_Elements[val_face] = val_elem;
116 }
117
118 /*!
119 * \brief Make available the length scale of the element.
120 * \return The length scale of the element.
121 */
122 inline su2double GetLengthScale() const { return LenScale; }
123
124 /*!
125 * \brief Set the length scale of the element.
126 * \param[in] val_lenScale - Length scale of the element.
127 */
128 inline void SetLengthScale(su2double val_lenScale) { LenScale = val_lenScale; }
129
130 /*!
131 * \brief Make available the time level of the element.
132 * \return The time level of the element.
133 */
134 inline unsigned short GetTimeLevel() const { return TimeLevel; }
135
136 /*!
137 * \brief Set the time level of the element.
138 * \param[in] val_timeLevel - Time level of the element.
139 */
140 inline void SetTimeLevel(unsigned short val_timeLevel) { TimeLevel = val_timeLevel; }
141
142 /*!
143 * \brief Get the boolean to indicate whether or not this element owns the face
144 * between the current and the adjacent element with index val_face.
145 * \param[in] val_face - Local index of the face.
146 * \return Boolean to indicate whether or not the face is owned by this element.
147 */
148 inline bool GetOwnerFace(unsigned short val_face) const { return ElementOwnsFace[val_face]; }
149
150 /*!
151 * \brief Set the boolean to indicate whether or not this element owns the face
152 * between the current and the adjacent element with index val_face.
153 * \param[in] val_owner - Whether or not this element owns the face.
154 * \param[in] val_face - Local index of the face.
155 */
156 inline void SetOwnerFace(bool val_owner, unsigned short val_face) { ElementOwnsFace[val_face] = val_owner; }
157
158 /*!
159 * \brief Get the index of the periodic transformation to the neighboring element.
160 * \param[in] val_face - Local index of the face.
161 * \return Index of the periodic transformation to the neighboring element.
162 */
163 inline short GetPeriodicIndex(unsigned short val_face) const { return PeriodIndexNeighbors[val_face]; }
164
165 /*!
166 * \brief Set the index of the periodic transformation to the neighboring element.
167 * \param[in] val_periodic - Index of the periodic marker to which the face belongs.
168 * \param[in] val_face - Local index of the face.
169 */
170 inline void SetPeriodicIndex(unsigned short val_periodic, unsigned short val_face) {
171 assert(val_periodic < std::numeric_limits<int8_t>::max());
172 PeriodIndexNeighbors[val_face] = val_periodic;
173 }
174
175 /*!
176 * \brief Get whether or not the Jacobian of the given face is considered constant.
177 * \param[in] val_face - Local index of the face.
178 * \return Whether or not the Jacobian of the face is considered constant.
179 */
180 inline bool GetJacobianConstantFace(unsigned short val_face) const { return JacobianFaceIsConstant[val_face]; }
181
182 /*!
183 * \brief Set whether or not the Jacobian of the given face is considered constant.
184 * \param[in] val_JacFaceIsConstant - Boolean to indicate whether or not the Jacobian is constant.
185 * \param[in] val_face - Local index of the face.
186 */
187 inline void SetJacobianConstantFace(bool val_JacFaceIsConstant, unsigned short val_face) {
188 JacobianFaceIsConstant[val_face] = val_JacFaceIsConstant;
189 }
190
191 /*!
192 * \brief Set the center of gravity of an element (including edges).
193 * \param[in] nDim - Number of dimensions (2 or 3).
194 * \param[in] val_coord - Coordinates of the element.
195 */
196 template <class T>
197 inline su2double* SetCoord_CG(unsigned short nDim, const T& val_coord) {
198 for (unsigned short iDim = 0; iDim < nDim; iDim++) {
199 Coord_CG[iDim] = 0.0;
200 for (unsigned short iNode = 0; iNode < GetnNodes(); iNode++)
201 Coord_CG[iDim] += val_coord[iNode][iDim] / su2double(GetnNodes());
202 }
203 return Coord_CG;
204 }
205
206 /*!
207 * \brief Get the center of gravity of an element (including edges).
208 * \param[in] val_dim - Coordinate of the center of gravity.
209 * \return Coordinates of the center of gravity.
210 */
211 inline su2double GetCG(unsigned short val_dim) const { return Coord_CG[val_dim]; }
212 inline const su2double* GetCG() const { return Coord_CG; }
213
214 /*!
215 * \brief Set the center of gravity of an element (including edges).
216 * \param[in] val_coord - Coordinates of the element.
217 */
218 inline void SetVolume(su2double val_volume) { Volume = val_volume; }
219
220 /*!
221 * \brief Get the center of gravity of an element (including edges).
222 * \param[in] val_dim - Coordinate of the center of gravity.
223 * \return Coordinates of the center of gravity.
224 */
225 inline su2double GetVolume() const { return Volume; }
226
227 /*!
228 * \brief Reset the array, which stores whether or not the faces have a constant Jacobian, to false.
229 */
231 for (auto i = 0; i < N_FACES_MAXIMUM; ++i) JacobianFaceIsConstant[i] = false;
232 }
233
234 /*!
235 * \brief Initialize the information about the neighboring elements.
236 * \param[in] val_nFaces - Number of faces for which neighboring information must be initialized.
237 */
238 void InitializeNeighbors(unsigned short val_nFaces);
239
240 /*!
241 * \brief A virtual member.
242 * \param[in] val_color - New color of the element.
243 */
244 inline virtual void SetColor(unsigned long val_color) {}
245
246 /*!
247 * \brief A virtual member.
248 * \return The color of the element in the partitioning.
249 */
250 inline virtual unsigned long GetColor() const { return std::numeric_limits<unsigned long>::max(); }
251
252 /*!
253 * \brief Get the element global index in a parallel computation.
254 * \return Global index of the element in a parallel computation.
255 */
256 inline unsigned long GetGlobalIndex() const { return GlobalIndex_DomainElement; }
257
258 /*!
259 * \brief Set the global index for an element in a parallel computation.
260 * \return Global index of an element in a parallel computation.
261 */
262 inline void SetGlobalIndex(unsigned long val_globalindex) { GlobalIndex_DomainElement = val_globalindex; }
263
264 /*!
265 * \brief Set the index of the domain element of which this boundary element is a face.
266 * \param[in] val_domainelement - Value to set.
267 */
268 inline void SetDomainElement(unsigned long val_domainelement) { GlobalIndex_DomainElement = val_domainelement; }
269
270 /*!
271 * \brief Get the index of the domain element of which this boundary element is a face.
272 */
273 inline unsigned long GetDomainElement() const { return GlobalIndex_DomainElement; }
274
275 /*!
276 * \brief A pure virtual member.
277 */
278 virtual void Change_Orientation() = 0;
279
280 /*!
281 * \brief A pure virtual member.
282 * \return Type of the element using VTK nomenclature.
283 */
284 inline virtual unsigned short GetRotation_Type() const { return 0; }
285
286 /*!
287 * \brief A pure virtual member.
288 * \param[in] val_rotation_type - Kind of rotation/traslation that must be applied.
289 */
290 inline virtual void SetRotation_Type(unsigned short val_rotation_type) {}
291
292 /*-- The following pure virtual functions are overridden in
293 * CPrimalGridWithConnectivity, except for the FEM classes. --*/
294
295 /*!
296 * \brief Get number of nodes of the element.
297 * \return Number of nodes.
298 */
299 virtual unsigned short GetnNodes() const = 0;
300
301 /*!
302 * \brief Get number of faces of the element.
303 * \return Number of faces.
304 */
305 virtual unsigned short GetnFaces() const = 0;
306
307 /*!
308 * \brief Get number of nodes of a face of the element.
309 * \param[in] val_face - Index of the face among all faces of the element.
310 * \return Number of nodes contained in the face.
311 */
312 inline virtual unsigned short GetnNodesFace(unsigned short val_face) const { return 0; }
313
314 /*!
315 * \brief Get the maximum number of nodes contained in a face of the element.
316 * \return Maximum number of nodes contained in a face.
317 */
318 virtual unsigned short GetMaxNodesFace() const = 0;
319
320 /*!
321 * \brief Get nodes contained in a face.
322 * \param[in] val_face - Index of the face among all faces of the element.
323 * \param[in] val_index - Index of the node among all nodes of the face.
324 * \return - Index of the node among all nodes of the element.
325 */
326 virtual unsigned short GetFaces(unsigned short val_face, unsigned short val_index) const = 0;
327
328 /*!
329 * \brief Get number of neighbor nodes of a node.
330 * \param[in] val_node - Index of node among all nodes of the element.
331 * \return Number of neighbor nodes.
332 */
333 virtual unsigned short GetnNeighbor_Nodes(unsigned short val_node) const = 0;
334
335 /*!
336 * \brief Get neighbor nodes of a node.
337 * \param[in] val_node - Index of node N among all nodes of the element.
338 * \param[in] val_index - Index of the neighbor node among all neighbor nodes of the node N.
339 * \return Index of neighbor node among all nodes of the element.
340 */
341 virtual unsigned short GetNeighbor_Nodes(unsigned short val_node, unsigned short val_index) const = 0;
342
343 /*!
344 * \brief Get VTK type.
345 * \return Type of element using the VTK nomenclature.
346 */
347 virtual unsigned short GetVTK_Type() const = 0;
348
349 /*-- Until here --*/
350
351 /*!
352 * \brief Virtual function, that must be overwritten by the derived class, if needed.
353 * \param[out] nFaces - Number of faces of this element.
354 * \param[out] nPointsPerFace - Number of corner points for each of the faces.
355 * \param[out] faceConn - Global IDs of the corner points of the faces.
356 */
357 inline virtual void GetCornerPointsAllFaces(unsigned short& nFaces, unsigned short nPointsPerFace[],
358 unsigned long faceConn[6][4]) const {}
359
360 /*!
361 * \brief Virtual function to make available the global ID of this element.
362 * \return The global ID of this element.
363 */
364 inline virtual unsigned long GetGlobalElemID() const { return 0; }
365
366 /*!
367 * \brief Virtual function to make available the global offset of the solution DOFs.
368 * \return The global offset of the solution DOFs.
369 */
370 inline virtual unsigned long GetGlobalOffsetDOFsSol() const { return 0; }
371
372 /*!
373 * \brief Virtual function to make available the polynomial degree of the grid.
374 * \return The polynomial degree of the grid.
375 */
376 inline virtual unsigned short GetNPolyGrid() const { return 0; }
377
378 /*!
379 * \brief Virtual function to make available the polynomial degree of the solution.
380 * \return The polynomial degree of the solution.
381 */
382 inline virtual unsigned short GetNPolySol() const { return 0; }
383
384 /*!
385 * \brief Virtual function to make available the number of DOFs of the grid in the element.
386 * \return The number of DOFs of the Grid in the element.
387 */
388 inline virtual unsigned short GetNDOFsGrid() const { return 0; }
389
390 /*!
391 * \brief Virtual function to make available the number of DOFs of the solution in the element.
392 * \return The number of DOFs of the solution in the element.
393 */
394 inline virtual unsigned short GetNDOFsSol() const { return 0; }
395
396 /*!
397 * \brief Virtual function to get whether or not the Jacobian is considered constant.
398 * \return True if the Jacobian is (almost) constant and false otherwise.
399 */
400 inline virtual bool GetJacobianConsideredConstant() const { return false; }
401
402 /*!
403 * \brief Virtual function to set the value of JacobianConsideredConstant.
404 * \param[in] val_JacobianConsideredConstant - The value to be set for JacobianConsideredConstant.
405 */
406 inline virtual void SetJacobianConsideredConstant(bool val_JacobianConsideredConstant) {}
407
408 /*!
409 * \brief Virtual function to correct the offset of the global DOFs.
410 * \param[in] val_offsetRank - The offset that must be added for this rank.
411 */
412 inline virtual void AddOffsetGlobalDOFs(const unsigned long val_offsetRank) {}
413
414 /*!
415 * \brief Virtual function to add the given donor ID to the donor elements for the wall function treatment.
416 * \param[in] donorElement - Element to be added to donor elements.
417 */
418 inline virtual void AddDonorWallFunctions(const unsigned long donorElement) {}
419
420 /*!
421 * \brief Virtual function to make available the number of donor elements for the wall function treatment.
422 * \return The number of donor elements.
423 */
424 inline virtual unsigned short GetNDonorsWallFunctions() const { return 0; }
425
426 /*!
427 * \brief Virtual function to make available the pointer to the vector for the donor elements
428 for the wall function treatment.
429 * \return The pointer to the data of donorElementsWallFunctions.
430 */
431 inline virtual unsigned long* GetDonorsWallFunctions() { return nullptr; }
432 inline virtual const unsigned long* GetDonorsWallFunctions() const { return nullptr; }
433
434 /*!
435 * \brief Virtual function to set the global ID's of the donor elements for the wall function treatment.
436 * \param[in] donorElements - Vector, which contain the donor elements.
437 */
438 inline virtual void SetDonorsWallFunctions(const std::vector<unsigned long>& donorElements) {}
439
440 /*!
441 * \brief Virtual function to remove the multiple donors for the wall function treatment.
442 */
443 inline virtual void RemoveMultipleDonorsWallFunctions() {}
444};
445
446/*! \class CPrimalGridWithConnectivity
447 * \brief Override the connectivity getters of CPrimalGrid.
448 *
449 * \details Non-FEM primal grid classes like CLine, CTriangle etc
450 * are derived from CPrimalGridWithConnectivity<CLineConnectivity> etc.
451 * The Connectivity class must have the following static members of
452 * type unsigned short / unsigned short array, typically constexpr:
453 * - nNodes: Number of nodes of the element.
454 * - nFaces: Number of faces of the element.
455 * - nNodesFace[]: Number of nodes of each face of the element.
456 * - maxNodesFace: Maximum number of nodes for a face.
457 * - Faces[][]: Matrix to store the local nodes of all the faces.
458 * - nNeighbor_Nodes[]: Number of neighbor nodes of each node of the element.
459 * - Neighbor_Nodes[][]: Matrix to store the neighbors of all the nodes.
460 * - VTK_Type: Type of element using VTK nomenclature.
461 *
462 * The getter functions for connectivity in CPrimalGrid have final overrides
463 * in this class, accessing the static members of Connectivity.
464 *
465 * \tparam Connectivity - class defining the connectivity structure
466 */
467template <typename Connectivity>
469 public:
470 CPrimalGridWithConnectivity(bool FEM) : CPrimalGrid(FEM, Connectivity::nNodes, Connectivity::nFaces) {}
471
472 inline unsigned short GetnNodes() const final { return Connectivity::nNodes; }
473
474 inline unsigned short GetnFaces() const final { return Connectivity::nFaces; }
475
476 inline unsigned short GetnNodesFace(unsigned short val_face) const final {
477 assert(val_face < Connectivity::nFaces);
478 return Connectivity::nNodesFace[val_face];
479 }
480
481 inline unsigned short GetMaxNodesFace() const final { return Connectivity::maxNodesFace; }
482
483 inline unsigned short GetFaces(unsigned short val_face, unsigned short val_index) const final {
484 assert(val_face < GetnFaces() && val_index < GetnNodesFace(val_face));
485 return Connectivity::Faces[val_face][val_index];
486 }
487
488 inline unsigned short GetnNeighbor_Nodes(unsigned short val_node) const final {
489 assert(val_node < Connectivity::nNodes);
490 return Connectivity::nNeighbor_Nodes[val_node];
491 }
492
493 inline unsigned short GetNeighbor_Nodes(unsigned short val_node, unsigned short val_index) const final {
494 assert(val_node < Connectivity::nNodes && val_index < GetnNeighbor_Nodes(val_node));
495 return Connectivity::Neighbor_Nodes[val_node][val_index];
496 }
497
498 inline unsigned short GetVTK_Type() const final { return Connectivity::VTK_Type; }
499};
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
CPrimalGrid()=delete
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