TrioCFD 1.9.8
TrioCFD documentation
Loading...
Searching...
No Matches
Segment.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 Segment_included
17#define Segment_included
18
19#include <Elem_geom_base.h>
20
21/*! @brief Classe Segment Cette classe represente l'element geometrique segment.
22 *
23 * Un segment a 1 face et 2 sommets.
24 *
25 * @sa Elem_geom_base Elem_geom
26 */
27template <typename _SIZE_>
28class Segment_32_64 : public Elem_geom_base_32_64<_SIZE_>
29{
30
31 Declare_instanciable_32_64(Segment_32_64);
32
33public :
34
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_>;
40
41
42 inline int face_sommet(int i, int j) const override;
43 inline int face_sommet0(int i) const;
44
45 inline int nb_som() const override { return 2; }
46 inline int nb_faces(int=0) const override;
47 inline int nb_som_face(int=0) const override;
48 inline bool est_structure() const override { return true; }
49 const Nom& nom_lml() const override;
50 int contient(const ArrOfDouble& pos, int_t elem) const override;
51 int contient(const SmallArrOfTID_t& soms, int_t elem) const override;
52 inline Type_Face type_face(int=0) const override;
53 void reordonner() override ;
54 void calculer_volumes(DoubleVect_t& vols) const override;
55 int get_tab_faces_sommets_locaux(IntTab& faces_som_local) const override;
56
57protected:
58 // Members herited from top classes:
60 using Elem_geom_base_32_64<_SIZE_>::mon_dom;
61};
62
63
64/*! @brief Renvoie le numero du j-ieme sommet de la i-ieme face de l'element.
65 *
66 * @param (int i) un numero de face
67 * @param (int j) un numero de sommet
68 * @return (int) le numero du j-ieme sommet de la i-ieme face
69 */
70template <typename _SIZE_>
71inline int Segment_32_64<_SIZE_>::face_sommet(int i, int j) const
72{
73 assert(i<2);
74 switch(i)
75 {
76 case 0:
77 return face_sommet0(j);
78 default :
79 return -1;
80 }
81}
82
83
84/*! @brief Renvoie le numero du i-ieme sommet de la face 0 LE CODE NE FAIT PAS CE QU'ON ATTENDRAIT.
85 *
86 * @param (int i) le numero du sommet a renvoyer
87 * @return (int) renvoie toujours 0 (si i=0)
88 */
89template <typename _SIZE_>
91{
92 // face_sommet0(0)=0;
93 assert(i==0);
94 return 0;
95}
96
97
98/*! @brief Renvoie le nombre de faces du type specifie que possede l'element geometrique.
99 *
100 * @param (int i) le type de face
101 * @return (int) le nombre de faces de type i
102 */
103template <typename _SIZE_>
104inline int Segment_32_64<_SIZE_>::nb_faces(int i) const
105{
106 assert(i==0);
107 return 2;
108}
109
110
111/*! @brief Renvoie le nombre de sommets des faces du type specifie.
112 *
113 * LE CODE NE FAIT PAS CE QU'ON ATTENDRAIT.
114 *
115 * @param (int i) le type de face
116 * @return (int) le nombre de sommets des faces de type i
117 */
118template <typename _SIZE_>
120{
121 assert(i==0);
122 return 1;
123}
124
125/*! @brief Renvoie le i-ieme type de face.
126 *
127 * Un segment n'a qu'un seul type de face.
128 *
129 * @param (int i) le rang du type de face a renvoyer
130 * @return (Type_Face) un type de face
131 */
132template <typename _SIZE_>
133inline Type_Face Segment_32_64<_SIZE_>::type_face(int i) const
134{
135 assert(i==0);
136 return Type_Face::point_1D;
137}
138
139
140using Segment = Segment_32_64<int>;
141using Segment_64 = Segment_32_64<trustIdType>;
142
143#endif
classe Domaine_32_64 un Domaine est un maillage compose d'un ensemble d'elements geometriques de meme...
Definition Domaine.h:62
Classe Elem_geom_base Cette classe est la classe de base pour la definition d'elements.
class Nom Une chaine de caractere pour nommer les objets de TRUST
Definition Nom.h:31
static int dimension
Definition Objet_U.h:99
Classe Segment Cette classe represente l'element geometrique segment.
Definition Segment.h:29
int face_sommet(int i, int j) const override
Renvoie le numero du j-ieme sommet de la i-ieme face de l'element.
Definition Segment.h:71
Type_Face type_face(int=0) const override
Renvoie le i-ieme type de face.
Definition Segment.h:133
int get_tab_faces_sommets_locaux(IntTab &faces_som_local) const override
voir ElemGeomBase::get_tab_faces_sommets_locaux
Definition Segment.cpp:174
int contient(const SmallArrOfTID_t &soms, int_t elem) const override
Renvoie 1 si les sommets specifies par le parametre "pos" sont les sommets de l'element "element" du ...
Definition Segment.cpp:132
_SIZE_ int_t
Definition Segment.h:35
void calculer_volumes(DoubleVect_t &vols) const override
Calcule les volumes des elements du domaine associe.
Definition Segment.cpp:148
const Nom & nom_lml() const override
Renvoie le nom LML d'un triangle = "VOXEL8".
Definition Segment.cpp:76
int nb_som_face(int=0) const override
Renvoie le nombre de sommets des faces du type specifie.
Definition Segment.h:119
bool est_structure() const override
Definition Segment.h:48
SmallArrOfTID_T< _SIZE_ > SmallArrOfTID_t
Definition Segment.h:37
IntTab_T< _SIZE_ > IntTab_t
Definition Segment.h:36
int face_sommet0(int i) const
Renvoie le numero du i-ieme sommet de la face 0 LE CODE NE FAIT PAS CE QU'ON ATTENDRAIT.
Definition Segment.h:90
DoubleVect_T< _SIZE_ > DoubleVect_t
Definition Segment.h:38
int contient(const ArrOfDouble &pos, int_t elem) const override
Renvoie 1 si l'element ielem du domaine associe a l'element geometrique contient le point.
Definition Segment.cpp:95
void reordonner() override
Reordonne les sommets du segment.
Definition Segment.cpp:45
int nb_som() const override
Nb of vertices for the element.
Definition Segment.h:45
int nb_faces(int=0) const override
Renvoie le nombre de faces du type specifie que possede l'element geometrique.
Definition Segment.h:104
Domaine_32_64< _SIZE_ > Domaine_t
Definition Segment.h:39