TrioCFD 1.9.9_beta
TrioCFD documentation
Loading...
Searching...
No Matches
Domaine_dis_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 Domaine_dis_base_included
17#define Domaine_dis_base_included
18
19#include <Champs_compris_interface.h>
20#include <Sous_domaine_dis_base.h>
21#include <Champ_Fonc_base.h>
22#include <Champs_compris.h>
23#include <Domaine.h>
24
27class Probleme_base;
28class Conds_lim;
29class Reorder_Mesh;
31
32/*! @brief class Domaine_dis_base This class is the base of the hierarchy of discretized domains.
33 *
34 * A Domaine object is associated with the discretized domain.
35 * Each spatial discretization (VDF, VEF, PolyMAC_HFV, ...) in TRUST corresponds to a class deriving
36 * from Domaine_dis_base that implements the tools required by the method.
37 */
39{
40 Declare_base(Domaine_dis_base);
41
42public :
43 ///
44 /// Accessors and shortcuts
45 ///
46 inline const Domaine& domaine() const { return le_dom_.valeur(); }
47 inline Domaine& domaine() { return le_dom_.valeur(); }
48
49 inline int nb_elem() const { return domaine().nb_elem(); }
50 inline int nb_elem_tot() const { return domaine().nb_elem_tot(); }
51 inline int nb_som() const { return domaine().nb_som(); }
52 inline int nb_som_tot() const { return domaine().nb_som_tot(); }
53 inline int nb_front_Cl() const { return domaine().nb_front_Cl(); }
54
55 ///
56 /// Sous_domaines_dis
57 ///
59 const Sous_domaine_dis_base& sous_domaine_dis(int i) const;
61
62 ///
63 /// Bord and Frontiere
64 ///
65 void ecrire_noms_bords(Sortie&) const;
66 int rang_frontiere(const Nom& );
67 int rang_frontiere(const Nom& ) const;
68 const Frontiere_dis_base& frontiere_dis(const Nom& ) const;
71 virtual const Frontiere_dis_base& frontiere_dis(int ) const =0;
72
73 ///
74 /// Mappings
75 ///
76 virtual IntTab& face_sommets();
77 virtual const IntTab& face_sommets() const;
78 virtual IntTab& face_aretes();
79 virtual const IntTab& face_aretes() const;
80 virtual IntTab& face_voisins();
81 virtual const IntTab& face_voisins() const;
82
83 ///
84 /// Various
85 ///
86 void associer_domaine(const Domaine&);
87 void discretiser_root(const Nom& typ);
88 void completer(const Discretisation_base& disc) ;
89 virtual void discretiser() { }
90 virtual void build_map_mc_Cmesh(const bool with_faces) { /* Do nothing */ }
91 virtual void discretiser_no_face() = 0;
92 virtual void typer_discretiser_ss_domaine(int i) = 0;
93 virtual void modifier_pour_Cl(const Conds_lim&) =0;
95
96 // Methods for computing and calling the distance to the nearest solid wall
97 // the input is the array of BCs of the momentum equation
98 virtual const DoubleTab& y_elem() const {return y_elem_;}
99 virtual const DoubleTab& y_faces() const {return y_faces_;}
100 virtual inline void init_dist_paroi_globale(const Conds_lim& conds_lim)
101 {
102 Cerr << "Domaine_dis_base::init_dist_paroi_globale() does nothing ! " << que_suis_je() << "Needs to overload it !" << finl;
104 }
105
106 // Post-processing of fields:
107 const Champ_Fonc_base& volume_maille() const { return volume_maille_; }
108 const Champ_Fonc_base& mesh_numbering() const { return mesh_numbering_; }
109 void get_noms_champs_postraitables(Noms& nom,Option opt=NONE) const override;
110 void creer_champ(const Motcle& motlu) override { Process::exit("No, call creer_champ(const Motcle&, const Probleme_base&)"); };
111 void creer_champ(const Motcle&, const Probleme_base&);
112 const Champ_base& get_champ(const Motcle&) const override;
113 bool has_champ(const Motcle& nom, OBS_PTR(Champ_base) &ref_champ) const override;
114 bool has_champ(const Motcle& nom) const override;
115
116 // Mesh reordering (Morton/Hilbert)
117 void set_reorder(const Reorder_Mesh& r) { reorder_ = r; }
118
119protected :
120 OBS_PTR(Domaine) le_dom_;
121 OBS_PTR(Reorder_Mesh) reorder_; ///< An observer to the Reorder_Mesh option filled in the discretisation itself.
122
125 DoubleTab y_elem_, y_faces_;
126 Champs_compris champs_compris_;
127 OWN_PTR(Champ_Fonc_base) volume_maille_;
128 OWN_PTR(Champ_Fonc_base) mesh_numbering_;
129};
130
131#endif /* Domaine_dis_base_included */
class Champ_Fonc_base Base class of fields that are functions of a calculated quantity
class Champ_base This class is the base of the fields hierarchy.
Definition Champ_base.h:43
class Champs_compris_interface This class contains an interface of methods intended to manage
class Conds_lim This class represents a vector of boundary conditions.
Definition Conds_lim.h:32
class Discretisation_base This class represents a spatial discretization scheme, which
int nb_front_Cl() const
Definition Domaine.h:236
int_t nb_elem_tot() const
Definition Domaine.h:132
int_t nb_elem() const
Definition Domaine.h:131
int_t nb_som_tot() const
Returns the total number of vertices of the domain i.e. the number of real and virtual vertices on th...
Definition Domaine.h:123
int_t nb_som() const
Returns the number of vertices of the domain.
Definition Domaine.h:121
class Domaine_Cl_dis_base Domaine_Cl_dis_base objects represent discretized boundary conditions
class Domaine_dis_base This class is the base of the hierarchy of discretized domains.
const Frontiere_dis_base & frontiere_dis(const Nom &) const
Returns the boundary of Name nom.
virtual void build_map_mc_Cmesh(const bool with_faces)
bool has_champ(const Motcle &nom, OBS_PTR(Champ_base) &ref_champ) const override
Champs_compris champs_compris_
virtual IntTab & face_voisins()
int nombre_de_sous_domaines_dis() const
int nb_elem_tot() const
OWN_PTR(Champ_Fonc_base) volume_maille_
int nb_front_Cl() const
void get_noms_champs_postraitables(Noms &nom, Option opt=NONE) const override
virtual void discretiser_no_face()=0
int rang_frontiere(const Nom &)
const Champ_Fonc_base & mesh_numbering() const
virtual IntTab & face_sommets()
void completer(const Discretisation_base &disc)
const Sous_domaine_dis_base & sous_domaine_dis(int i) const
void creer_champ(const Motcle &motlu) override
virtual void discretiser()
const Domaine & domaine() const
int nb_som_tot() const
virtual void init_dist_paroi_globale(const Conds_lim &conds_lim)
const Champ_base & get_champ(const Motcle &) const override
OWN_PTR(Champ_Fonc_base) mesh_numbering_
virtual const DoubleTab & y_elem() const
virtual Frontiere_dis_base & frontiere_dis(int)=0
virtual const Frontiere_dis_base & frontiere_dis(int) const =0
void associer_domaine(const Domaine &)
Associates a Domain with the object.
TRUST_Vector< OWN_PTR(Sous_domaine_dis_base)> les_sous_domaines_dis_
virtual IntTab & face_aretes()
void discretiser_root(const Nom &typ)
const Champ_Fonc_base & volume_maille() const
virtual const DoubleTab & y_faces() const
void set_reorder(const Reorder_Mesh &r)
virtual void modifier_pour_Cl(const Conds_lim &)=0
void ecrire_noms_bords(Sortie &) const
Writes the boundary names to an output stream.
virtual void typer_discretiser_ss_domaine(int i)=0
virtual void creer_elements_fictifs(const Domaine_Cl_dis_base &)
OBS_PTR(Reorder_Mesh) reorder_
An observer to the Reorder_Mesh option filled in the discretisation itself.
OBS_PTR(Domaine) le_dom_
class Frontiere_dis_base Class representing a discretized boundary.
A character string (Nom) in uppercase.
Definition Motcle.h:26
class Nom: a character string for naming TRUST objects.
Definition Nom.h:31
An array of character strings (VECT(Nom)).
Definition Noms.h:26
const Nom & que_suis_je() const
Returns the string identifying the class.
Definition Objet_U.cpp:104
Objet_U()
Default constructor: assigns a unique identifier to the object (object_id_) and registers the object ...
Definition Objet_U.cpp:54
class Probleme_base It is a Probleme_U that is not a coupling.
static void exit(int exit_code=-1)
Exit routine for TRUST within a Kokkos region.
Definition Process.cpp:466
Reorder_Mesh allows the user to trigger the renumbering of the mesh entities.
Base class for output streams.
Definition Sortie.h:52
This class is at the base of the discretized sub-domain hierarchy. At the time of domain discretizati...
TRUST_Vector class.