TrioCFD 1.9.9_beta
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 Class Frontiere.
22 *
23 * A Frontiere describes a part of the boundary of a Domain,
24 * it has a Name, it carries Faces and has an associated Domain.
25 * A Frontiere can be specialized into an Edge, a Joint,
26 * a Connection or an Internal Face.
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 /// Returns the number of faces of the boundary.
59 inline int_t nb_faces() const { return les_faces.nb_faces(); }
60 /// Sizes the boundary, i.e. sets its number of 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
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
Class Frontiere.
Definition Frontiere.h:32
void set_aire(double &aire)
Definition Frontiere.h:73
const IntTab_t & les_sommets_des_faces() const
Returns the vertices of the boundary faces (const version).
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 &)
Adds one or more faces to the boundary; the face(s) are specified by an array.
Definition Frontiere.cpp:86
virtual void trace_face_local(const DoubleVect &, DoubleVect &) const
void nommer(const Nom &) override
Gives a name to the boundary.
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()
Returns the domain associated with the boundary.
const Domaine_t & domaine() const
Returns the domain associated with the boundary (const version).
void typer_faces(const Type_Face &)
Sets the type of the boundary faces.
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)
Sizes the boundary, i.e. sets its number of faces.
Definition Frontiere.h:61
void fixer_num_premiere_face(int_t i)
Definition Frontiere.h:68
const Nom & le_nom() const override
Returns the name of the Objet_U. Virtual method to override: returns "neant" in this 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 &)
Sets the type of the boundary faces.
Definition Frontiere.cpp:96
int_t nb_faces() const
Returns the number of faces of the boundary.
Definition Frontiere.h:59
Faces_t & faces()
Definition Frontiere.h:55
void associer_domaine(const Domaine_t &)
Associates the boundary to the domain it belongs to.
Definition Frontiere.cpp:63
IntTab_t & les_sommets_des_faces()
Returns the vertices of the boundary faces.
void renum(const IntVect_t &)
Renumbers the nodes (vertices) of the 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
Creates an array with one "row" per face of this boundary.
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 &)
Adds the vertices (and faces) of the given boundary to this object (Frontiere_32_64).
A character string (Nom) in uppercase.
Definition Motcle.h:26
class Nom: a character string for naming TRUST objects.
Definition Nom.h:31
Objet_U()
Default constructor: assigns a unique identifier to the object (object_id_) and registers the object ...
Definition Objet_U.cpp:54