TrioCFD 1.9.8
TrioCFD documentation
Loading...
Searching...
No Matches
Poly_geom_base.h
1/****************************************************************************
2* Copyright (c) 2025, 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 Poly_geom_base_included
17#define Poly_geom_base_included
18
19#include <Elem_geom_base.h>
20#include <Elem_geom.h>
21
22// Useful macros
23#ifdef linux
24#define BLOQUE Cerr<<__PRETTY_FUNCTION__<< " "<<__FILE__<<":"<<(int)__LINE__<<" not coded" <<finl;Process::exit()
25#define WARN Cerr<<"Warning: "<<__PRETTY_FUNCTION__<< " "<<__FILE__<<":"<<(int)__LINE__<<" bad coded" <<finl
26#else
27#define BLOQUE Cerr<<__FILE__<<":"<<(int)__LINE__<<" not coded" <<finl;Process::exit()
28#define WARN Cerr<<"Warning: "<<__FILE__<<":"<<(int)__LINE__<<" bad coded" <<finl
29#endif
30
31
32/*! @brief Base class for polyedrons and polygons.
33 * Connectivity is stored in descending mode:
34 * - a Poly_geom is made of faces (see members Polygone::PolygonIndex_ and Polyedre::PolyedreIndex_ -> TODO should merge them)
35 * - each face is made of nodes (see member FaceIndex_ below)
36 */
37template <typename _SIZE_>
39{
40 Declare_base_sans_destructeur_32_64( Poly_geom_base_32_64 ) ;
41
42public :
43 using int_t = _SIZE_;
44 using ArrOfInt_t = ArrOfInt_T<_SIZE_>;
45
47
48 int get_tab_faces_sommets_locaux(IntTab& faces_som_local) const override =0;
49 const ArrOfInt_t& getFacesIndex() const { return FacesIndex_; }
51
52 inline int get_nb_face_elem_max() const { return nb_face_elem_max_ ; }
54 inline bool est_structure() const override { return false; }
55
56 int nb_type_face() const override { return 1; }
57
58 virtual int get_tab_faces_sommets_locaux(IntTab& faces_som_local,int_t elem) const=0;
59 virtual const ArrOfInt_t& getElemIndex() const =0;
60 virtual int_t get_somme_nb_faces_elem() const =0;
61 virtual void calculer_un_centre_gravite(const int_t elem, DoubleVect& xp) const =0;
62
63 /* Build a reduced version of the polytope connectivity when splitting domains in DomainCutter - this always produce
64 * a 32b object:
65 */
66 virtual void build_reduced(OWN_PTR(Elem_geom_base_32_64<int>)& type_elem, const ArrOfInt_t& elems_sous_part) const = 0;
67 virtual void compute_virtual_index()=0;
68
69protected:
70 /*! Description of the faces (resp. edges) of the polyhedron (resp. polygon)
71 * FacesIndex_[i:i+s] contains the list of nodes forming a face (resp. edge)
72 * Boundaries are given by Polyedre::PolyhedronIndex_ (resp. Polygon::PolygonIndex_)
73 */
75
77};
78
79using Poly_geom_base = Poly_geom_base_32_64<int>;
80using Poly_geom_base_64 = Poly_geom_base_32_64<trustIdType>;
81
82
83#endif /* Poly_geom_base_included */
Classe Elem_geom_base Cette classe est la classe de base pour la definition d'elements.
Base class for polyedrons and polygons. Connectivity is stored in descending mode:
ArrOfInt_t & getsetFacesIndex()
virtual int_t get_somme_nb_faces_elem() const =0
virtual int get_tab_faces_sommets_locaux(IntTab &faces_som_local, int_t elem) const =0
bool est_structure() const override
virtual void compute_virtual_index()=0
const ArrOfInt_t & getFacesIndex() const
int nb_type_face() const override
Nb of face types of the elemnt (for example 2 for a prism).
int get_tab_faces_sommets_locaux(IntTab &faces_som_local) const override=0
remplit le tableau faces_som_local(i,j) qui donne pour 0 <= i < nb_faces() et 0 <= j < nb_som_face(i)...
int get_nb_som_elem_max() const
int get_nb_face_elem_max() const
virtual ~Poly_geom_base_32_64()
ArrOfInt_T< _SIZE_ > ArrOfInt_t
virtual const ArrOfInt_t & getElemIndex() const =0
virtual void calculer_un_centre_gravite(const int_t elem, DoubleVect &xp) const =0
virtual void build_reduced(OWN_PTR(Elem_geom_base_32_64< int >)&type_elem, const ArrOfInt_t &elems_sous_part) const =0