Documentation 6b54b78464
Loading...
Searching...
No Matches
CTriangle.hpp
Go to the documentation of this file.
1/*!
2 * \file CTriangle.hpp
3 * \brief Headers of the main subroutines for storing the primal grid structure.
4 * The subroutines and functions are in the <i>CTriangle.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/*! \class CTriangleConnectivity
34 * Defines the connectivity of a triangle element.
35 * See CPrimalGridWithConnectivity.
36 */
41 enum { VTK_Type = TRIANGLE };
42 static constexpr unsigned short nNodesFace[3] = {2, 2, 2};
43 static constexpr unsigned short Faces[3][2] = {{0, 1}, {1, 2}, {2, 0}};
44 static constexpr unsigned short nNeighbor_Nodes[3] = {2, 2, 2};
45 static constexpr unsigned short Neighbor_Nodes[3][2] = {{1, 2}, {2, 0}, {0, 1}};
46};
47
48/*!
49 * \class CTriangle
50 * \brief Class for triangle element definition.
51 * \author F. Palacios
52 */
53class CTriangle final : public CPrimalGridWithConnectivity<CTriangleConnectivity> {
54 public:
55 /*!
56 * \brief Constructor using the nodes and index.
57 * \param[in] val_point_0 - Index of the 1st triangle point read from the grid file.
58 * \param[in] val_point_1 - Index of the 2nd triangle point read from the grid file.
59 * \param[in] val_point_2 - Index of the 3th triangle point read from the grid file.
60 */
61 CTriangle(unsigned long val_point_0, unsigned long val_point_1, unsigned long val_point_2);
62
63 /*!
64 * \brief Change the orientation of an element.
65 */
66 inline void Change_Orientation() override { std::swap(Nodes[0], Nodes[2]); }
67};
Headers of the main subroutines for storing the primal grid structure. The subroutines and functions ...
Override the connectivity getters of CPrimalGrid.
Definition CPrimalGrid.hpp:468
std::unique_ptr< unsigned long[]> Nodes
Global node indices of the element.
Definition CPrimalGrid.hpp:51
Class for triangle element definition.
Definition CTriangle.hpp:53
void Change_Orientation() override
Change the orientation of an element.
Definition CTriangle.hpp:66
constexpr unsigned short N_POINTS_LINE
General output & CGNS defines.
Definition option_structure.hpp:143
constexpr unsigned short N_FACES_TRIANGLE
General output & CGNS defines.
Definition option_structure.hpp:153
@ TRIANGLE
VTK nomenclature for defining a triangle element.
Definition option_structure.hpp:134
constexpr unsigned short N_POINTS_TRIANGLE
General output & CGNS defines.
Definition option_structure.hpp:144
Definition CTriangle.hpp:37
static constexpr unsigned short nNeighbor_Nodes[3]
Definition CTriangle.hpp:44
static constexpr unsigned short Faces[3][2]
Definition CTriangle.hpp:43
static constexpr unsigned short nNodesFace[3]
Definition CTriangle.hpp:42
@ nNodes
Definition CTriangle.hpp:38
@ maxNodesFace
Definition CTriangle.hpp:40
@ nFaces
Definition CTriangle.hpp:39
static constexpr unsigned short Neighbor_Nodes[3][2]
Definition CTriangle.hpp:45
@ VTK_Type
Definition CTriangle.hpp:41