TrioCFD 1.9.8
TrioCFD documentation
Loading...
Searching...
No Matches
Point.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 Point_included
17#define Point_included
18
19#include <Elem_geom_base.h>
20
21/*! @brief Classe Point Cette classe represente l'element geometrique segment.
22 *
23 * Un Point a 1 face et 1 sommets.
24 *
25 * @sa Elem_geom_base Elem_geom, .CONTRAINTES, .INVARIANTS, .HTML, .EPS
26 */
27template <typename _SIZE_>
28class Point_32_64 : public Elem_geom_base_32_64<_SIZE_>
29{
30
31 Declare_instanciable_32_64(Point_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 inline int face_sommet(int i, int j) const override;
42 inline int face_sommet0(int i) const;
43
44 inline int nb_som() const override { return 1; }
45 inline int nb_faces(int=0) const override;
46 inline int nb_som_face(int=0) const override;
47 inline bool est_structure() const override { return true; }
48 const Nom& nom_lml() const override;
49 int contient(const ArrOfDouble& pos, int_t elem) const override;
50 int contient(const SmallArrOfTID_t& soms, int_t elem) const override;
51 inline Type_Face type_face(int=0) const override;
52 void reordonner() override { }
53 void calculer_volumes(DoubleVect_t& vols) const override { vols = 1.; }
54 int get_tab_faces_sommets_locaux(IntTab& faces_som_local) const override;
55};
56
57
58/*! @brief Renvoie le numero du j-ieme sommet de la i-ieme face de l'element.
59 *
60 * @param (int i) un numero de face
61 * @param (int j) un numero de sommet
62 * @return (int) le numero du j-ieme sommet de la i-ieme face
63 */
64template <typename _SIZE_>
65inline int Point_32_64<_SIZE_>::face_sommet(int i, int j) const
66{
67 assert(i<1);
68 switch(i)
69 {
70 case 0:
71 return face_sommet0(j);
72 default :
73 return -1;
74 }
75}
76
77
78/*! @brief Renvoie le numero du i-ieme sommet de la face 0 LE CODE NE FAIT PAS CE QU'ON ATTENDRAIT.
79 *
80 * @param (int i) le numero du sommet a renvoyer
81 * @return (int) renvoie toujours 0 (si i=0)
82 */
83template <typename _SIZE_>
84inline int Point_32_64<_SIZE_>::face_sommet0(int i) const
85{
86 assert(i==0);
87 return 0;
88}
89
90
91/*! @brief Renvoie le nombre de faces du type specifie que possede l'element geometrique.
92 *
93 * @param (int i) le type de face
94 * @return (int) le nombre de faces de type i
95 */
96template <typename _SIZE_>
97inline int Point_32_64<_SIZE_>::nb_faces(int i) const
98{
99 assert(i==0);
100 return 1;
101}
102
103
104/*! @brief Renvoie le nombre de sommets des faces du type specifie.
105 *
106 * LE CODE NE FAIT PAS CE QU'ON ATTENDRAIT.
107 *
108 * @param (int i) le type de face
109 * @return (int) le nombre de sommets des faces de type i
110 */
111template <typename _SIZE_>
112inline int Point_32_64<_SIZE_>::nb_som_face(int i) const
113{
114 assert(i==0);
115 return 1;
116}
117
118
119/*! @brief Renvoie le i-ieme type de face.
120 *
121 * Un segment n'a qu'un seul type de face.
122 *
123 * @param (int i) le rang du type de face a renvoyer
124 * @return (Type_Face) un type de face
125 */
126template <typename _SIZE_>
127inline Type_Face Point_32_64<_SIZE_>::type_face(int i) const
128{
129 assert(i==0);
130 return Type_Face::point_1D;
131}
132
133using Point = Point_32_64<int>;
134using Point_64 = Point_32_64<trustIdType>;
135
136
137#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
Classe Point Cette classe represente l'element geometrique segment.
Definition Point.h:29
int get_tab_faces_sommets_locaux(IntTab &faces_som_local) const override
voir ElemGeomBase::get_tab_faces_sommets_locaux
Definition Point.cpp:109
SmallArrOfTID_T< _SIZE_ > SmallArrOfTID_t
Definition Point.h:37
int contient(const ArrOfDouble &pos, int_t elem) const override
Renvoie 1 si l'element ielem du dom associe a l'element geometrique contient le point.
Definition Point.cpp:67
void reordonner() override
Definition Point.h:52
const Nom & nom_lml() const override
Renvoie le nom LML d'un triangle = "VOXEL8".
Definition Point.cpp:50
int nb_som_face(int=0) const override
Renvoie le nombre de sommets des faces du type specifie.
Definition Point.h:112
bool est_structure() const override
Definition Point.h:47
void calculer_volumes(DoubleVect_t &vols) const override
Compute vols of all elements in the domain.
Definition Point.h:53
Type_Face type_face(int=0) const override
Renvoie le i-ieme type de face.
Definition Point.h:127
DoubleVect_T< _SIZE_ > DoubleVect_t
Definition Point.h:38
int nb_faces(int=0) const override
Renvoie le nombre de faces du type specifie que possede l'element geometrique.
Definition Point.h:97
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 Point.h:84
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 Point.cpp:92
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 Point.h:65
Domaine_32_64< _SIZE_ > Domaine_t
Definition Point.h:39
IntTab_T< _SIZE_ > IntTab_t
Definition Point.h:36
int nb_som() const override
Nb of vertices for the element.
Definition Point.h:44
_SIZE_ int_t
Definition Point.h:35