TrioCFD 1.9.8
TrioCFD documentation
Loading...
Searching...
No Matches
Interprete_geometrique_base.cpp
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#include <Interprete_geometrique_base.h>
17#include <Sous_Domaine.h>
18#include <Domaine.h>
19#include <EChaine.h>
20
21Implemente_base_32_64(Interprete_geometrique_base_32_64, "Interprete_geometrique_base", Interprete);
22// XD interprete_geometrique_base interprete interprete_geometrique_base INHERITS_BRACE Class for interpreting a data
23// XD_CONT file
24
25template <typename _SIZE_>
27
28template <typename _SIZE_>
30
31template <typename _SIZE_>
37
38template <typename _SIZE_>
40{
41 Cerr << "Association of the domain on which the interpreter applies " << que_suis_je() << finl;
42 Nom nom_dom;
43 is >> nom_dom;
44 if(!sub_type(Domaine_t, objet(nom_dom)))
45 {
46 Cerr << nom_dom << " is of type " << objet(nom_dom).que_suis_je() << finl;
47 Cerr << "we know to treat only one domain with the interpreter " << que_suis_je() << finl;
48 exit();
49 }
50 domains_.add(ref_cast(Domaine_t, objet(nom_dom)));
51}
52
53template <typename _SIZE_>
55{
56 Cerr << "Association of the domain object on which the interpreter applies " << que_suis_je() << finl;
57 domains_.add(dom);
58}
59
60template <typename _SIZE_>
62{
63 Cerr << "Execution of the interpreter " << que_suis_je() << finl;
65 // Appel a l'interprete fils
66 interpreter_(is);
67
68 // On met a jour un certain nombre de choses
69 // suite a la modification des domaines
70 for (int j=0; j<domains_.size(); j++)
71 {
72 Domaine_t& dom = domaine(j);
73 dom.invalide_octree();
77 dom.bords_int().associer_domaine(dom);
79 dom.type_elem()->associer_domaine(dom);
81 // MEDCouplingUMesh object in domaine is now invalid:
82 dom.set_mc_mesh_ready(false);
83 }
84 return is;
85}
86
87/*! Ajoute dans les sous-domaines les nouveaux elements
88 *
89 */
90template <typename _SIZE_>
92{
93 Domaine_t& dom=domaine;
94 for (int ssz=0; ssz<dom.nb_ss_domaines(); ssz++)
95 {
96 Sous_Domaine_32_64<_SIZE_>& sous_domaine=dom.ss_domaine(ssz);
97 if ((que_suis_je()=="Raffiner_anisotrope")
98 || (que_suis_je()=="Raffiner_isotrope")
99 || (que_suis_je()=="Remove_elem")
100 || (que_suis_je()=="Tetraedriser_homogene")
101 || (que_suis_je()=="Tetraedriser_homogene_compact")
102 || (que_suis_je()=="Tetraedriser_homogene_fin")
103 || (que_suis_je()=="Tetraedriser_par_prisme")
104 || (que_suis_je()=="Tetraedriser")
105 || (que_suis_je()=="Trianguler")
106 || (que_suis_je()=="Trianguler_fin")
107 || (que_suis_je()=="Trianguler_H")
108 || (que_suis_je()=="VerifierCoin"))
109 {
110 const int_t nb_poly=sous_domaine.nb_elem_tot();
111 for (int_t nb_p=0; nb_p<nb_poly; nb_p++)
112 {
113 if (elem==sous_domaine[nb_p])
114 {
115 Cerr << " The element " << elem << " which will be modified, is included to the subarea \"" << sous_domaine.le_nom() << "\". So the element";
116 if (nb_elem>1) Cerr << "s";
117 Cerr << " generated [";
118 for(int_t num_elem=num_premier_elem; num_elem<num_premier_elem+nb_elem; num_elem++)
119 {
120 sous_domaine.add_elem(num_elem);
121 if (num_elem!=num_premier_elem) Cerr << " ";
122 Cerr << num_elem;
123 }
124 Cerr << "] will be added to this subarea." << finl;
125 }
126 }
127 }
128 else
129 {
130 Cerr << finl;
131 Cerr << "You have defined the subarea \"" << sous_domaine.le_nom() << "\" before using the interpreter \"" << que_suis_je() << "\"." << finl;
132 Cerr << "To correctly mark the good elements, set the subarea after to have used the interpreter." << finl;
133 exit();
134 }
135 }
136}
137
138
139
141#if INT_is_64_ == 2
143#endif
144
void associer_domaine(const Domaine_t &)
Associe un domaine a tous les bords de la liste.
Definition Bords.cpp:32
void associer_domaine(const Domaine_t &)
Associe un domaine a tous les objets Bord_Interne de la liste.
const Sous_Domaine_t & ss_domaine(int i) const
Definition Domaine.h:290
void set_mc_mesh_ready(bool flag) const
Definition Domaine.h:357
Bords_t & faces_bord()
Definition Domaine.h:198
int nb_ss_domaines() const
Definition Domaine.h:289
Raccords_t & faces_raccord()
Definition Domaine.h:253
void fixer_premieres_faces_frontiere()
Definition Domaine.cpp:1102
void invalide_octree()
Definition Domaine.cpp:810
Bords_Internes_t & bords_int()
Definition Domaine.h:213
Joints_t & faces_joint()
Definition Domaine.h:265
Groupes_Faces_t & groupes_faces()
Definition Domaine.h:224
Une entree dont la source est une chaine de caracteres.
Definition EChaine.h:31
Class defining operators and methods for all reading operation in an input flow (file,...
Definition Entree.h:42
void associer_domaine(const Domaine_t &)
Associe un domaine a tous les objets Groupe_Faces de la liste.
classe Interprete_geometrique_base .
void mettre_a_jour_sous_domaine(Domaine_t &domaine, int_t &elem, int_t num_premier_elem, int_t nb_elem) const
virtual Entree & interpreter_(Entree &is)=0
Classe de base des objets "interprete".
Definition Interprete.h:38
static Objet_U & objet(const Nom &)
Voir Interprete_bloc::objet_global() BM: la classe Interprete n'est pas le meilleur endroit pour cett...
void associer_domaine(const Domaine_t &)
Associe un domaine a tous les joints de la liste.
Definition Joints.cpp:33
class Nom Une chaine de caractere pour nommer les objets de TRUST
Definition Nom.h:31
friend class Entree
Definition Objet_U.h:76
const Nom & que_suis_je() const
renvoie la chaine identifiant la classe.
Definition Objet_U.cpp:104
virtual Entree & readOn(Entree &)
Lecture d'un Objet_U sur un flot d'entree Methode a surcharger.
Definition Objet_U.cpp:293
virtual Sortie & printOn(Sortie &) const
Ecriture de l'objet sur un flot de sortie Methode a surcharger.
Definition Objet_U.cpp:282
static void imprimer_ram_totale(int all_process=0)
Definition Process.cpp:651
static void exit(int exit_code=-1)
Routine de sortie de TRUST dans une region Kokkos.
Definition Process.cpp:455
void associer_domaine(const Domaine_t &)
Associe un domaine a tous les raccords de la liste.
Definition Raccords.cpp:31
Classe de base des flux de sortie.
Definition Sortie.h:52
Sous_Domaine represents a volumic sub-domain i.e. a sub set of elements of a Domaine.
void add_elem(const int_t poly)
Ajoute un polyedre au sous-domaine.
const Nom & le_nom() const override
Donne le nom de l'Objet_U Methode a surcharger : renvoie "neant" dans cette implementation.
int_t nb_elem_tot() const