TrioCFD 1.9.8
TrioCFD documentation
Loading...
Searching...
No Matches
Elem_geom_base.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 Elem_geom_base_included
17#define Elem_geom_base_included
18
19#include <TRUSTTabs_forward.h>
20#include <Faces.h>
21
22template<class _SIZE_> class Domaine_32_64;
23
24/*! @brief Classe Elem_geom_base Cette classe est la classe de base pour la definition d'elements
25 *
26 * geometriques constituant un maillage (i.e. un Domaine geometrique)
27 * Un element geometrique a un Domaine associe auquel il fournit
28 * les routines de base pour la manipulation des ses elements.
29 * (Un domaine n'a qu'un seul type d'element geometrique)
30 *
31 * @sa Hexaedre Prisme Rectangle Segment Tetraedre Triangle, Domaine, Classe abstraite, Methodes abstraites:, int face_sommet(int i, int j) const, int nb_som() const, int nb_faces(int=0) const, int nb_som_face(int=0) const, int est_structure() const, const Nom& nom_lml() const, int contient(const ArrOfDouble&, int ) const, int contient(const ArrOfInt&, int ) const, Type_Face type_face(int=0) const, void calculer_volumes(DoubleVect& ) const, void calculer_normales(const IntTab& , DoubleTab& ) const
32 */
33template <typename _SIZE_>
35{
36
37 Declare_base_32_64(Elem_geom_base_32_64);
38
39public:
40
41 using int_t = _SIZE_;
42 using ArrOfInt_t = ArrOfInt_T<_SIZE_>;
43 using IntVect_t = IntVect_T<_SIZE_>;
44 using IntTab_t = IntTab_T<_SIZE_>;
45 using SmallArrOfTID_t = SmallArrOfTID_T<_SIZE_>;
46 using ArrOfDouble_t= ArrOfDouble_T<_SIZE_>;
47 using DoubleVect_t = DoubleVect_T<_SIZE_>;
48 using DoubleTab_t = DoubleTab_T<_SIZE_>;
51
52
53 virtual void creer_faces_elem(Faces_t& ,int_t ,Type_Face ) const;
54 inline void creer_faces_elem(Faces_t& ,int_t ) const;
55 /// Renvoie le numero du j-ieme sommet de la i-ieme face de l'element
56 virtual int face_sommet(int i, int j) const=0;
57 inline void associer_domaine(const Domaine_32_64<int_t>& dom) { mon_dom = dom; }
58 /// Nb of vertices for the element
59 virtual int nb_som() const=0;
60 /// Nb of faces for the element
61 virtual int nb_faces(int=0) const=0;
62 /// Nb of vertices for one face of the element
63 virtual int nb_som_face(int=0) const=0;
64 virtual bool est_structure() const=0;
65 virtual const Nom& nom_lml() const=0;
66 /// DOes the element 'elem' contains the point 'pos'
67 virtual int contient(const ArrOfDouble& pos, int_t elem) const=0;
68 /// Renvoie 1 si les sommets specifies par le parametre "pos" sont les sommets de l'element "element" du domaine associe
69 virtual int contient(const SmallArrOfTID_t& soms, int_t elem) const=0;
70 /// Nb of face types of the elemnt (for example 2 for a prism)
71 virtual int nb_type_face() const;
72 virtual int num_face(int face, Type_Face& type) const;
73 /// Type of the face of the element - face_typ < nb_type_face()
74 virtual Type_Face type_face(int face_typ=0) const=0;
75 /// Compute all centers of mass of all elements in the domain
76 virtual void calculer_centres_gravite(DoubleTab_t& ) const ;
77 virtual void reordonner() { }
78 /// Compute vols of all elements in the domain
79 virtual void calculer_volumes(DoubleVect_t& vols) const =0;
80 virtual void calculer_normales(const IntTab_t& faces_sommets , DoubleTab_t& face_normales) const;
81 virtual int get_tab_faces_sommets_locaux(IntTab& faces_som_local) const;
82 virtual void get_tab_aretes_sommets_locaux(IntTab& aretes_som_local) const;
83
84protected:
86};
87
88/*! @brief Cree les faces de l'element du domaine specifie.
89 *
90 * @param (Faces_t& faces) les faces de l'elements a creer
91 * @param (int elem) le numero de element du domaine dont veut creer les faces
92 */
93template <typename _SIZE_>
94inline void Elem_geom_base_32_64<_SIZE_>::creer_faces_elem(Faces_t& faces, _SIZE_ elem) const
95{
96 assert(nb_type_face() == 1);
97 creer_faces_elem(faces, elem, type_face());
98}
99
100using Elem_geom_base = Elem_geom_base_32_64<int>;
101using Elem_geom_base_64 = Elem_geom_base_32_64<trustIdType>;
102
103#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.
virtual int face_sommet(int i, int j) const =0
Renvoie le numero du j-ieme sommet de la i-ieme face de l'element.
ArrOfDouble_T< int > ArrOfDouble_t
DoubleVect_T< int > DoubleVect_t
virtual void reordonner()
ArrOfInt_T< int > ArrOfInt_t
void associer_domaine(const Domaine_32_64< int_t > &dom)
virtual void calculer_normales(const IntTab_t &faces_sommets, DoubleTab_t &face_normales) const
Sort en erreur.
Faces_32_64< int > Faces_t
virtual int contient(const ArrOfDouble &pos, int_t elem) const =0
DOes the element 'elem' contains the point 'pos'.
virtual int num_face(int face, Type_Face &type) const
Renvoie le parametre face si le type de face specifie est le meme que celui de l'element geometrique.
Domaine_32_64< int > Domaine_t
void creer_faces_elem(Faces_t &, int_t) const
Cree les faces de l'element du domaine specifie.
SmallArrOfTID_T< int > SmallArrOfTID_t
virtual void calculer_centres_gravite(DoubleTab_t &) const
Compute all centers of mass of all elements in the domain.
DoubleTab_T< int > DoubleTab_t
virtual Type_Face type_face(int face_typ=0) const =0
Type of the face of the element - face_typ < nb_type_face().
virtual int contient(const SmallArrOfTID_t &soms, int_t elem) const =0
Renvoie 1 si les sommets specifies par le parametre "pos" sont les sommets de l'element "element" du ...
virtual void creer_faces_elem(Faces_t &, int_t, Type_Face) const
Cree les faces de l'element geometrique specifie du domaine en precisant le type de face a creer.
virtual void calculer_volumes(DoubleVect_t &vols) const =0
Compute vols of all elements in the domain.
virtual const Nom & nom_lml() const =0
virtual bool est_structure() const =0
virtual int nb_type_face() const
Nb of face types of the elemnt (for example 2 for a prism).
virtual int nb_som_face(int=0) const =0
Nb of vertices for one face of the element.
virtual int nb_faces(int=0) const =0
Nb of faces for the element.
OBS_PTR(Domaine_t) mon_dom
virtual int nb_som() const =0
Nb of vertices for the element.
virtual void get_tab_aretes_sommets_locaux(IntTab &aretes_som_local) const
idem que Elem_geom_base::get_tab_faces_sommets_locaux mais pour les aretes: aretes_som_local.
virtual int get_tab_faces_sommets_locaux(IntTab &faces_som_local) const
remplit le tableau faces_som_local(i,j) qui donne pour 0 <= i < nb_faces() et 0 <= j < nb_som_face(i)...
Classe Faces Faces decrit un ensemble de faces par leur type (point ,segment, triangle ou quadrangle)...
Definition Faces.h:50
class Nom Une chaine de caractere pour nommer les objets de TRUST
Definition Nom.h:31
Objet_U()
Constructeur par defaut : attribue un numero d'identifiant unique a l'objet (object_id_),...
Definition Objet_U.cpp:55