TrioCFD 1.9.8
TrioCFD documentation
Loading...
Searching...
No Matches
Frontiere.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 Frontiere_included
17#define Frontiere_included
18
19#include <Faces.h>
20
21/*! @brief Classe Frontiere.
22 *
23 * Une Frontiere decrit une partie de la frontiere d'un Domaine,
24 * elle possede un Nom, elle porte des Faces et a un Domaine associe.
25 * Une Frontiere peut etre specialisee en un Bord, un Joint un
26 * Raccord ou une Face Interne.
27 *
28 * @sa Domaine Bord Joint Raccord Faces_Interne
29 */
30template <typename _SIZE_>
32{
33 Declare_base_32_64(Frontiere_32_64);
34
35public:
36 using int_t = _SIZE_;
37 using ArrOfInt_t = ArrOfInt_T<_SIZE_>;
38 using IntVect_t = IntVect_T<_SIZE_>;
39 using IntTab_t = IntTab_T<_SIZE_>;
40 using DoubleVect_t = DoubleVect_T<_SIZE_>;
41 using DoubleTab_t = DoubleTab_T<_SIZE_>;
44
45
47 const Domaine_t& domaine() const;
49 inline const Nom& le_nom() const override { return nom; }
50 void nommer(const Nom&) override;
51 void ajouter_faces(const IntTab_t&);
52 void typer_faces(const Motcle&);
53 void typer_faces(const Type_Face&);
54 inline const Faces_t& faces() const { return les_faces; }
55 inline Faces_t& faces() { return les_faces; }
58 /// Renvoie le nombre de faces de la frontiere.
59 inline int_t nb_faces() const { return les_faces.nb_faces(); }
60 /// Dimensionne la frontiere, i.e. fixe son nombre de faces.
61 inline void dimensionner(int_t i) { les_faces.dimensionner(i); }
62 void renum(const IntVect_t&);
63 void add(const Frontiere_32_64& );
64 inline int_t nb_faces_virt() const { return faces_virt.size_array(); }
65 inline int_t face_virt(int_t i) const { return faces_virt[i]; }
66
67 inline int_t num_premiere_face() const { return num_premiere_face_ ; }
68 inline void fixer_num_premiere_face(int_t i) { num_premiere_face_ = i; }
69 inline const ArrOfInt_t& get_faces_virt() const { return faces_virt; }
70 inline ArrOfInt_t& get_faces_virt() { return faces_virt; }
71
72 inline const double& get_aire() const { return aire_; }
73 inline void set_aire(double& aire) { aire_ = aire; }
74
75 virtual void creer_tableau_faces(Array_base&, RESIZE_OPTIONS opt = RESIZE_OPTIONS::COPY_INIT) const;
76
77 // Various trace methods - only used by the Champ_xx classes - no need for a 64b version, so stick with DoubleTab, not DoubleTab_t:
78 virtual void trace_elem_local(const DoubleTab&, DoubleTab&) const;
79 virtual void trace_face_local(const DoubleTab&, DoubleTab&) const;
80 virtual void trace_face_local(const DoubleVect&, DoubleVect&) const;
81 virtual void trace_elem_distant(const DoubleTab&, DoubleTab&) const;
82 virtual void trace_som_distant(const DoubleTab&, DoubleTab&) const;
83 virtual void trace_face_distant(const DoubleTab&, DoubleTab&) const;
84 virtual void trace_face_distant(const DoubleVect&, DoubleVect&) const;
85 virtual void trace_som_local(const DoubleTab& y, DoubleTab& x) const;
86
87private :
88
89 Nom nom;
90 Faces_t les_faces;
91 OBS_PTR(Domaine_t) le_dom;
92 ArrOfInt_t faces_virt;
93 int_t num_premiere_face_ = -100;
94 double aire_ = -100.;
95};
96
97
98using Frontiere = Frontiere_32_64<int>;
99using Frontiere_64 = Frontiere_32_64<trustIdType>;
100
101#endif
Empty class used as a base for all the arrays.
Definition Array_base.h:41
classe Domaine_32_64 un Domaine est un maillage compose d'un ensemble d'elements geometriques de meme...
Definition Domaine.h:62
Classe Faces Faces decrit un ensemble de faces par leur type (point ,segment, triangle ou quadrangle)...
Definition Faces.h:50
Classe Frontiere.
Definition Frontiere.h:32
void set_aire(double &aire)
Definition Frontiere.h:73
const IntTab_t & les_sommets_des_faces() const
Renvoie les sommets des faces de la frontiere.
virtual void trace_elem_distant(const DoubleTab &, DoubleTab &) const
const ArrOfInt_t & get_faces_virt() const
Definition Frontiere.h:69
virtual void trace_face_distant(const DoubleTab &, DoubleTab &) const
IntVect_T< int > IntVect_t
Definition Frontiere.h:38
void ajouter_faces(const IntTab_t &)
Ajoute une (ou plusieurs) face(s) a la frontiere, la (les) face(s) est (sont) specifiee(s) par un tab...
Definition Frontiere.cpp:86
virtual void trace_face_local(const DoubleVect &, DoubleVect &) const
void nommer(const Nom &) override
Donne un nom a la frontiere.
Definition Frontiere.cpp:74
DoubleTab_T< int > DoubleTab_t
Definition Frontiere.h:41
ArrOfInt_T< int > ArrOfInt_t
Definition Frontiere.h:37
virtual void trace_face_local(const DoubleTab &, DoubleTab &) const
Domaine_32_64< int > Domaine_t
Definition Frontiere.h:42
Domaine_t & domaine()
Renvoie le domaine associe a la frontiere.
const Domaine_t & domaine() const
Renvoie le domaine associe a la frontiere.
void typer_faces(const Type_Face &)
Type les faces de la frontiere.
ArrOfInt_t & get_faces_virt()
Definition Frontiere.h:70
int_t face_virt(int_t i) const
Definition Frontiere.h:65
int_t num_premiere_face() const
Definition Frontiere.h:67
void dimensionner(int_t i)
Dimensionne la frontiere, i.e. fixe son nombre de faces.
Definition Frontiere.h:61
void fixer_num_premiere_face(int_t i)
Definition Frontiere.h:68
const Nom & le_nom() const override
Donne le nom de l'Objet_U Methode a surcharger : renvoie "neant" dans cette implementation.
Definition Frontiere.h:49
DoubleVect_T< int > DoubleVect_t
Definition Frontiere.h:40
int_t nb_faces_virt() const
Definition Frontiere.h:64
virtual void trace_elem_local(const DoubleTab &, DoubleTab &) const
void typer_faces(const Motcle &)
Type les faces de la frontiere.
Definition Frontiere.cpp:96
int_t nb_faces() const
Renvoie le nombre de faces de la frontiere.
Definition Frontiere.h:59
Faces_t & faces()
Definition Frontiere.h:55
void associer_domaine(const Domaine_t &)
Associe la frontiere au domaine dont elle depend.
Definition Frontiere.cpp:63
IntTab_t & les_sommets_des_faces()
Renvoie les sommets des faces de la frontiere.
void renum(const IntVect_t &)
Renumerote les noeuds (sommets) des faces.
IntTab_T< int > IntTab_t
Definition Frontiere.h:39
virtual void trace_face_distant(const DoubleVect &, DoubleVect &) const
virtual void creer_tableau_faces(Array_base &, RESIZE_OPTIONS opt=RESIZE_OPTIONS::COPY_INIT) const
Cree un tableau ayant une "ligne" par face de cette frontiere Voir MD_Vector_tools::creer_tableau_dis...
Faces_32_64< int > Faces_t
Definition Frontiere.h:43
virtual void trace_som_distant(const DoubleTab &, DoubleTab &) const
const Faces_t & faces() const
Definition Frontiere.h:54
virtual void trace_som_local(const DoubleTab &y, DoubleTab &x) const
const double & get_aire() const
Definition Frontiere.h:72
void add(const Frontiere_32_64 &)
Ajoute les sommets (et faces) de la frontiere passee en parametre a l'objet (Frontiere_32_64).
Une chaine de caractere (Nom) en majuscules.
Definition Motcle.h:26
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