TRUST 1.9.8
HPC thermohydraulic platform
Loading...
Searching...
No Matches
Ensemble_faces_rayo_transp.cpp
1/****************************************************************************
2* Copyright (c) 2026, 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 <Ensemble_faces_rayo_transp.h>
17#include <Frontiere_dis_base.h>
18#include <TRUSTList.h>
19#include <EFichier.h>
20#include <Domaine.h>
21
22Implemente_instanciable(Ensemble_faces_rayo_transp, "Ensemble_faces_rayo_transp", Objet_U);
23
25
26Sortie& Ensemble_faces_rayo_transp::printOn(Sortie& os) const { return os; }
27
28void Ensemble_faces_rayo_transp::lire(const Nom& nom_bord_lu, const Nom& nom_bord, const Domaine& dom)
29{
30 {
31 Nom fic2(dom.le_nom() + "." + nom_bord);
32 fic2 += "_xv";
33 EFichier fichier(fic2);
34 Nom motlu;
35 while (motlu != nom_bord_lu)
36 {
37 fichier >> motlu;
38 }
39 fichier >> positions_;
40 fichier.close();
41 }
42}
43
45{
46 // Dans notre cas une face rayonnantes est exactement une face de bord
47 if (num_face_Ensemble_.size() == 0)
48 return 1;
49 else
50 {
51 int nb_faces_rayo = num_face_Ensemble_.size();
52
53 for (int i = 0; i < nb_faces_rayo; i++)
54 if (num_face == num_face_Ensemble_[i])
55 return 1;
56
57 return 0;
58 }
59}
60
62{
63 if (les_cl_base_)
64 return 1;
65 else
66 return 0;
67}
68
70{
72 les_cl_base_ = la_cl;
73 Frontiere& le_bord = la_cl.frontiere_dis().frontiere();
74 nb_faces_bord_ = le_bord.nb_faces();
75 // On construit num_face_Ensemble. On a les positions_ on cherche la liste des faces de ce bord
76 IntList numface;
77 DoubleTab pos;
78
79 int n1 = positions_.dimension(0);
80 if (n1 != 0)
81 {
82 Faces& faces = le_bord.faces();
83 // pos contient les centres de gravite des faces du bord
86 for (int fac = 0; fac < n1; fac++)
87 {
88 int marq = 0;
89 for (int f2 = 0; f2 < nb_faces_bord_; f2++)
90 {
91 int ok = 1;
92 for (int dir = 0; dir < dimension; dir++)
93 {
94 if (!(est_egal(positions_(fac, dir), pos(f2, dir))))
95 ok = 0;
96 }
97 if (ok == 1)
98 {
99 numface.add(f2);
100 marq++;
101 if (marq != 1)
102 {
103 Cerr << "Error in Ensemble_faces_rayo_transp::associer_les_cl" << finl;
104 Cerr << "Contact TRUST support." << finl;
105 Cerr << fac << " face en double " << finl;
107 }
108 }
109 }
110 marq = (int) mp_sum((double) marq);
111 if (marq == 0)
112 {
113 Cerr << "Face " << fac << " du fichier " << la_cl.frontiere_dis().frontiere().le_nom() << "_xv non trouvee !!! positions ";
114 for (int dir = 0; dir < dimension; dir++)
115 Cerr << positions_(fac, dir) << " ";
116 Cerr << finl;
117 for (int f2 = 0; f2 < nb_faces_bord_; f2++)
118 {
119 Cerr << " face " << f2 << " du bord ";
120 for (int dir = 0; dir < dimension; dir++)
121 Cerr << pos(f2, dir) << " ";
122 Cerr << finl;
123 }
125 }
126
127 }
128 int nf = numface.size();
129 if (nf == 0)
130 nb_faces_bord_ = 0;
131 num_face_Ensemble_.resize(nf);
132 for (int f3 = 0; f3 < nf; f3++)
133 num_face_Ensemble_[f3] = numface[f3];
134 positions_.resize(0);
135 }
136}
classe Cond_lim_base Classe de base pour la hierarchie des classes qui representent les differentes c...
virtual bool is_bc_rayo_milieu_transp(Cond_lim_rayo_milieu_transp *&la_cl_rayo)
virtual Frontiere_dis_base & frontiere_dis()
Renvoie la frontiere discretisee a laquelle les conditions aux limites s'appliquent.
const DoubleTab_t & coord_sommets() const
Definition Domaine.h:112
const Nom & le_nom() const override
Donne le nom de l'Objet_U Methode a surcharger : renvoie "neant" dans cette implementation.
Fichier en lecture Cette classe est a la classe C++ ifstream ce que la classe Entree est a la.
Definition EFichier.h:29
void lire(const Nom &, const Nom &, const Domaine &)
Cond_lim_rayo_milieu_transp * la_cond_lim_rayo_
Class defining operators and methods for all reading operation in an input flow (file,...
Definition Entree.h:42
const IntTab_t & les_sommets() const
Renvoie le tableau des sommets de toutes les faces.
Definition Faces.h:74
Type_Face type_face() const
Definition Faces.h:65
static void Calculer_centres_gravite(DoubleTab_t &xv, Type_Face type_face_, const DoubleTab_t &coord, const IntTab_t &sommet)
const Domaine_t & domaine() const
Renvoie le domaine associe a la frontiere.
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
int_t nb_faces() const
Renvoie le nombre de faces de la frontiere.
Definition Frontiere.h:59
const Faces_t & faces() const
Definition Frontiere.h:54
const Frontiere & frontiere() const
Renvoie la frontiere geometrique associee.
class Nom Une chaine de caractere pour nommer les objets de TRUST
Definition Nom.h:31
classe Objet_U Cette classe est la classe de base des Objets de TRUST
Definition Objet_U.h:73
static int dimension
Definition Objet_U.h:99
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 double mp_sum(double)
Calcule la somme de x sur tous les processeurs du groupe courant.
Definition Process.cpp:146
static void exit(int exit_code=-1)
Routine de sortie de TRUST dans une region Kokkos.
Definition Process.cpp:455
Classe de base des flux de sortie.
Definition Sortie.h:52
TRUSTList & add(_TYPE_)
insertion en queue
Definition TRUSTList.tpp:85
int size() const
Definition TRUSTList.h:68