TrioCFD 1.9.9_beta
TrioCFD documentation
Loading...
Searching...
No Matches
Faces_builder.h
1/****************************************************************************
2* Copyright (c) 2026, 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 Faces_builder_included
17#define Faces_builder_included
18
19#include <Bords.h>
20#include <Bords_Internes.h>
21#include <Poly_geom_base.h>
22#include <Joint.h>
23#include <NettoieNoeuds.h>
24#include <Polyedriser.h>
25#include <Raccord_base.h>
26#include <Raccords.h>
27#include <TRUST_Ref.h>
28#include <TRUSTTab.h>
29#include <Domaine_forward.h>
30#include <Static_Int_Lists.h>
31#include <NettoieNoeuds.h>
32/*! @brief Helper class for building the faces of a domain.
33 * (used only to create the arrays of real faces)
34 *
35 */
36
37template <typename _SIZE_>
39{
40public:
41 using int_t = _SIZE_;
44 using IntTab_t = IntTab_T<_SIZE_>;
45 using ArrOfInt_t = ArrOfInt_T<_SIZE_>;
46 using DoubleTab_t = DoubleTab_T<_SIZE_>;
47 using SmallArrOfTID_t = SmallArrOfTID_T<_SIZE_>;
60
62 void reset();
63 void creer_faces_reeles(Domaine_t& domaine, const Static_Int_Lists_t& connect_som_elem, Faces_t& les_faces, IntTab_t& elem_faces);
64
65 // This static method is also used by 64b objects like Raffiner_Simplexes:
66 static int chercher_face_element(const IntTab_t& elem_som, const IntTab& faces_element_ref,
67 const SmallArrOfTID_t& une_face, const int_t elem);
68
69private:
70 static int_t ajouter_une_face(const SmallArrOfTID_t& une_face, const int_t elem0, const int_t elem1, IntTab_t& faces_sommets, IntTab_t& faces_voisins);
71
72 int chercher_face_element(const SmallArrOfTID_t& une_face, const int_t elem) const;
73
74 void check_erreur_faces(const char *message, const ArrOfInt_t& liste_faces) const;
75 void creer_faces_frontiere(const int_t nb_voisins_attendus, Frontiere_t& frontiere, IntTab_t& faces_sommets, IntTab_t& faces_voisins, IntTab_t& elem_faces) const;
76 void creer_faces_internes(IntTab_t& faces_sommets, IntTab_t& elem_faces, IntTab_t& faces_voisins) const;
77 void identification_groupe_faces(Groupe_Faces_t& groupe_int, const IntTab_t& elem_faces) const;
78
79 const IntTab_t& les_elements() const { return *les_elements_ptr_; }
80 const Static_Int_Lists_t& connectivite_som_elem() const { return *connectivite_som_elem_ptr_; }
81 const IntTab& faces_element_reference(int_t elem_t) const; // returns the faces for an element; for polyhedra this depends on the element index.
82
83
84 // All the following members are initialized in creer_faces_reeles:
85
86 // Shortcut to the domain elements
87 const IntTab_t * les_elements_ptr_;
88 // The element-vertex connectivity (for each vertex, list of
89 // adjacent elements, including virtual vertices and elements)
90 const Static_Int_Lists_t * connectivite_som_elem_ptr_;
91 /*! @brief Faces of the reference element (see elem_geom_base::get_tab_faces_sommets_locaux)
92 *
93 */
94 IntTab faces_element_reference_old_;
95 int_t is_polyedre_;
96 // for check_erreur_faces:
97 OBS_PTR(Domaine_t) ref_domaine_;
98 OBS_PTR(IntTab_t) faces_sommets_;
99 OBS_PTR(IntTab_t) face_elem_;
100};
101
102
103using Faces_builder = Faces_builder_32_64<int>;
104using Faces_builder_64 = Faces_builder_32_64<trustIdType>;
105
106#endif
Class Bords This class represents a list of objects of type Bord.
Definition Bords.h:28
Class Bords_Internes This class represents a list of objects of type Bords_Interne.
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 Faces Faces describes a set of faces by their type (point, segment, triangle or quadrangle),...
Definition Faces.h:50
Helper class for building the faces of a domain. (used only to create the arrays of real faces).
Joints_32_64< _SIZE_ > Joints_t
IntTab_T< _SIZE_ > IntTab_t
Bords_32_64< _SIZE_ > Bords_t
Frontiere_32_64< _SIZE_ > Frontiere_t
NettoieNoeuds_32_64< _SIZE_ > NettoieNoeuds_t
SmallArrOfTID_T< _SIZE_ > SmallArrOfTID_t
Faces_builder_32_64< _SIZE_ > Faces_builder_t
Groupes_Faces_32_64< _SIZE_ > Groupes_Faces_t
static int chercher_face_element(const IntTab_t &elem_som, const IntTab &faces_element_ref, const SmallArrOfTID_t &une_face, const int_t elem)
Static_Int_Lists_32_64< _SIZE_ > Static_Int_Lists_t
DoubleTab_T< _SIZE_ > DoubleTab_t
Faces_32_64< _SIZE_ > Faces_t
Bords_Internes_32_64< _SIZE_ > Bords_Internes_t
ArrOfInt_T< _SIZE_ > ArrOfInt_t
Raccords_32_64< _SIZE_ > Raccords_t
Poly_geom_base_32_64< _SIZE_ > Poly_geom_base_t
Joint_32_64< _SIZE_ > Joint_t
Groupe_Faces_32_64< _SIZE_ > Groupe_Faces_t
void creer_faces_reeles(Domaine_t &domaine, const Static_Int_Lists_t &connect_som_elem, Faces_t &les_faces, IntTab_t &elem_faces)
From the description of the domain elements and boundaries (borders, connections, face groups,...
Domaine_32_64< _SIZE_ > Domaine_t
Class Frontiere.
Definition Frontiere.h:32
Groupe_Face class — represents a selection of faces read from a med file.
Groupes_Faces class — represents a list of Groupe_Faces objects.
The Joint class is a Frontiere that contains the joint faces and vertices with the neighboring domain...
Definition Joint.h:34
Joints class — represents a list of Joint objects.
Definition Joints.h:28
Class NettoieNoeuds x->alpha x.
Base class for polyedrons and polygons. Connectivity is stored in descending mode:
Class Raccords This represents a list of Raccord type objects.
Definition Raccords.h:29
This class allows storing lists of integers accessible in constant time.