TrioCFD 1.9.9_beta
TrioCFD documentation
Loading...
Searching...
No Matches
Quadrangle_VEF.h
1/****************************************************************************
2* Copyright (c) 2024, CEA
3* All rights reserved.
4*
5* Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
6* 1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
7* 2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
8* 3. Neither the name of the copyright holder nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission.
9*
10* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
11* IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
12* OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
13*
14*****************************************************************************/
15
16#ifndef Quadrangle_VEF_included
17#define Quadrangle_VEF_included
18
19#include <Elem_geom_base.h>
20
21/*! @brief Quadrangle_VEF class — represents the Quadrangle_VEF geometric element.
22 *
23 * A Quadrangle_VEF has 4 faces, 4 vertices and a single face type with
24 * 2 vertices per face.
25 *
26 * @sa Elem_geom_base Elem_geom
27 */
28template <typename _SIZE_>
30{
31
32 Declare_instanciable_32_64(Quadrangle_VEF_32_64);
33
34public :
35 using int_t = _SIZE_;
36 using IntTab_t = IntTab_T<_SIZE_>;
37 using SmallArrOfTID_t = SmallArrOfTID_T<_SIZE_>;
38 using DoubleVect_t = DoubleVect_T<_SIZE_>;
39 using DoubleTab_t = DoubleTab_T<_SIZE_>;
41
42
43 inline int face_sommet(int i, int j) const override;
44 inline int face_sommet0(int i) const;
45 inline int face_sommet1(int i) const;
46 inline int face_sommet2(int i) const;
47 inline int face_sommet3(int i) const;
48
49 inline int nb_som() const override { return 4; }
50 inline int nb_faces(int=0) const override;
51 inline int nb_som_face(int=0) const override;
52 inline bool est_structure() const override { return false; }
53 const Nom& nom_lml() const override;
54
55 int contient(const ArrOfDouble& pos, int_t elem) const override;
56 int contient(const SmallArrOfTID_t& soms, int_t elem) const override;
57 inline Type_Face type_face(int=0) const override;
58 void calculer_volumes(DoubleVect_t& vols) const override;
59
60 void reordonner() override ;
61 int get_tab_faces_sommets_locaux(IntTab& faces_som_local) const override;
62
63protected:
64 // Members herited from top classes:
66 using Elem_geom_base_32_64<_SIZE_>::mon_dom;
67};
68
69
70/*! @brief Returns the number of faces of the specified type that the geometric element has.
71 *
72 * @param (int i) the face type
73 * @return (int) the number of faces of type i
74 */
75template <typename _SIZE_>
77{
78 assert(i==0);
79 return 4;
80}
81
82
83/*! @brief Returns the number of vertices of faces of the specified type.
84 *
85 * @param (int i) the face type
86 * @return (int) the number of vertices of faces of type i
87 */
88template <typename _SIZE_>
90{
91 assert(i==0);
92 return 2;
93}
94/*! @brief Returns the index of the j-th vertex of the i-th face of the element.
95 *
96 * @param (int i) a face index
97 * @param (int j) a vertex index
98 * @return (int) the index of the j-th vertex of the i-th face
99 */
100template <typename _SIZE_>
101inline int Quadrangle_VEF_32_64<_SIZE_>::face_sommet(int i, int j) const
102{
103 assert(i<4);
104 switch(i)
105 {
106 case 0:
107 return face_sommet0(j);
108 case 1:
109 return face_sommet1(j);
110 case 2:
111 return face_sommet2(j);
112 case 3:
113 return face_sommet3(j);
114 default :
115 return -1;
116 }
117}
118
119
120/*! @brief Returns the index of the i-th vertex of face 0.
121 *
122 * @param (int i) the vertex index to return
123 * @return (int) the index of the i-th vertex of face 0
124 */
125template <typename _SIZE_>
127{
128 // face_sommet0(0)=0
129 // face_sommet0(1)=2
130 assert(i>=0);
131 assert(i<2);
132 return 2*i;
133}
134
135
136/*! @brief Returns the index of the i-th vertex of face 1.
137 *
138 * @param (int i) the vertex index to return
139 * @return (int) the index of the i-th vertex of face 1
140 */
141template <typename _SIZE_>
143{
144 // face_sommet1(0)=0
145 // face_sommet1(1)=1
146 assert(i>=0);
147 assert(i<2);
148 return i;
149}
150
151
152/*! @brief Returns the index of the i-th vertex of face 2.
153 *
154 * @param (int i) the vertex index to return
155 * @return (int) the index of the i-th vertex of face 2
156 */
157template <typename _SIZE_>
159{
160 // face_sommet2(0)=1
161 // face_sommet2(1)=3
162 assert(i>=0);
163 assert(i<2);
164 return 2*i+1;
165}
166
167/*! @brief Returns the index of the i-th vertex of face 3.
168 *
169 * @param (int i) the vertex index to return
170 * @return (int) the index of the i-th vertex of face 3
171 */
172template <typename _SIZE_>
174{
175 // face_sommet3(0)=2;
176 // face_sommet3(1)=3;
177 assert(i>=0);
178 assert(i<2);
179 return i+2;
180}
181
182
183/*! @brief Returns the i-th face type.
184 *
185 * A Quadrangle_VEF has only one face type.
186 *
187 * @param (int i) the rank of the face type to return
188 * @return (Type_Face) a face type
189 */
190template <typename _SIZE_>
191inline Type_Face Quadrangle_VEF_32_64<_SIZE_>::type_face(int i) const
192{
193 assert(i==0);
194 return Type_Face::segment_2D;
195}
196
197using Quadrangle_VEF = Quadrangle_VEF_32_64<int>;
198using Quadrangle_VEF_64 = Quadrangle_VEF_32_64<trustIdType>;
199
200
201#endif
class Domaine_32_64 A Domain is a mesh composed of a set of geometric elements of the same type.
Definition Domaine.h:62
Class Elem_geom_base This class is the base class for the definition of elements.
class Nom: a character string for naming TRUST objects.
Definition Nom.h:31
static int dimension
Definition Objet_U.h:94
Quadrangle_VEF class — represents the Quadrangle_VEF geometric element.
DoubleVect_T< _SIZE_ > DoubleVect_t
bool est_structure() const override
int nb_som() const override
Nb of vertices for the element.
void reordonner() override
Reorders the vertices of the quadrangle elements.
void calculer_volumes(DoubleVect_t &vols) const override
Computes the volumes of the elements of the associated domain.
int face_sommet3(int i) const
Returns the index of the i-th vertex of face 3.
DoubleTab_T< _SIZE_ > DoubleTab_t
int face_sommet1(int i) const
Returns the index of the i-th vertex of face 1.
IntTab_T< _SIZE_ > IntTab_t
SmallArrOfTID_T< _SIZE_ > SmallArrOfTID_t
int face_sommet2(int i) const
Returns the index of the i-th vertex of face 2.
int face_sommet(int i, int j) const override
Returns the index of the j-th vertex of the i-th face of the element.
int nb_som_face(int=0) const override
Returns the number of vertices of faces of the specified type.
int contient(const SmallArrOfTID_t &soms, int_t elem) const override
Returns 1 if the vertices specified by parameter "som" are the vertices of element "element".
int nb_faces(int=0) const override
Returns the number of faces of the specified type that the geometric element has.
const Nom & nom_lml() const override
Returns the LML name of a Quadrangle_VEF = "GOLGOTH24".
Type_Face type_face(int=0) const override
Returns the i-th face type.
int face_sommet0(int i) const
Returns the index of the i-th vertex of face 0.
int get_tab_faces_sommets_locaux(IntTab &faces_som_local) const override
See ElemGeomBase::get_tab_faces_sommets_locaux.
Domaine_32_64< _SIZE_ > Domaine_t
int contient(const ArrOfDouble &pos, int_t elem) const override
Returns 1 if element "element" of the domain associated with this geometric element contains the poin...