TRUST 1.9.8
HPC thermohydraulic platform
Loading...
Searching...
No Matches
Traitement_particulier_NS_THI_new.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 <Traitement_particulier_NS_THI_new.h>
17#include <MD_Vector_base.h>
18#include <Domaine.h>
19
20Implemente_base(Traitement_particulier_NS_THI_new,"Traitement_particulier_NS_THI_new",Traitement_particulier_NS_base);
21
23{
24 return is;
25}
26
28{
29 return is;
30}
31
33{
34 Motcle accouverte = "{" , accfermee = "}" ;
35 Motcle valec="val_Ec";
36 Motcle facon="facon_init";
37 Motcle motbidon, motlu;
38 is >> motbidon ;
39 if (motbidon == accouverte)
40 {
41 Motcles les_mots(2);
42 {
43 les_mots[0] = "init_Ec";
44 les_mots[1] = "calc_spectre";
45 }
46 {
47 is >> motlu;
48 while(motlu != accfermee)
49 {
50 int rang=les_mots.search(motlu);
51 switch(rang)
52 {
53 case 0 :
54 {
55 is >> init; // init_Ec = 1
56 if (init!=0)
57 {
58 is >> motlu;
59 if (motlu==valec)
60 {
61 is >> Ec_init; // on lit la valeur de Ec_init
62 Cerr << "Avec Initialisation de l Energie Cinetique Ec_init= " << Ec_init << finl;
63 is >> motlu;
64 if (motlu==facon)
65 {
66 is >> fac_init; // Sur quelle valeur se base l initialisation??
67 Cerr << "Avec Initialisation de l Energie Cinetique sur Ecspat (init_fac==0) ou Ecspec (init_fac==1) : fac_init=" << fac_init << finl;
68 }
69 }
70 else
71 {
72 Cerr << "Erreur dans la lecture de Traitement_particulier_NS_THI_new_VDF" << finl;
73 Cerr << "Le seul mot cle possible ici est : val_Ec" << finl;
74 Cerr << "Vous avez lu :" << motlu << finl;
75 exit();
76 }
77 }
78 break;
79 }
80 case 1 :
81 {
82 is >> oui_calc_spectre;
83 if (oui_calc_spectre!=0) Cerr << "Calcul des spectres." << finl;
84 break;
85 }
86
87 default :
88 {
89 Cerr << "Erreur dans la lecture de Traitement_particulier_NS_THI_new";
90 Cerr << "Les mots cles possibles sont : init_Ec, calc_spectre, { et }" << finl;
91 Cerr << "Vous avez lu :" << motlu << finl;
92 exit();
93 break;
94 }
95 }
96 is >> motlu;
97 }
98 is >> motlu;
99 if (motlu != accfermee)
100 {
101 Cerr << "Erreur dans la lecture de Traitement_particulier_NS_THI_new";
102 Cerr << "On attendait une }" << finl;
103 exit();
104 }
105 }
106 }
107 else
108 {
109 Cerr << "Erreur dans la lecture de Traitement_particulier_NS_THI_new";
110 Cerr << "On attendait une {" << finl;
111 exit();
112 }
113 return is;
114}
115
116
125
132
133void Traitement_particulier_NS_THI_new::en_cours_de_resolution(int nb_op, DoubleTab& u, DoubleTab& u_av, double dt)
134{
135 // il n'est en fait jamais appele cf. ci-dessous (Caroline)
136 if (oui_transf == 1)
137 {
138 // calcul_spectre_operateur( nb_op, u, u_av,dt);
139
140 // Patrick
141
142 Cerr << " finalement Traitement_particulier_NS_THI_new::en_cours_de_resolution est bien appele (?) " << finl;
143 exit();
144 }
145 return;
146}
147
149{
150 const char* methode_actuelle="Traitement_particulier_NS_THI_new::calcul_nb_som_dir";
151
152 // Sert a calculer le nombre de sommet commun en parallele
153 double nb_som = static_cast<double>(domaine.md_vector_sommets()->nb_items_seq_tot());
154 // Somme sur tous les processeurs
155
156 double nb=pow(nb_som*1.,1./3.);
157 nb_som_dir = (int)(nb);
158 if (nb_som_dir*nb_som_dir*nb_som_dir != nb_som)
159 {
161 if (nb_som_dir*nb_som_dir*nb_som_dir != nb_som)
162 msg_erreur_maillage(methode_actuelle);
163 }
165 return nb_som_dir;
166}
167
169{
170 if (je_suis_maitre())
171 {
172 Cerr << finl;
173 Cerr << "Probleme dans " << methode_actuelle << " :" << finl;
174 Cerr << "Votre maillage ne semble pas comporter le meme nombre de noeuds" << finl;
175 Cerr << "suivant toutes les directions. Verifiez votre jeu de donnee... " << finl << finl;
176 // Abort pour les cas paralleles !
177 abort();
178 }
179}
Class defining operators and methods for all reading operation in an input flow (file,...
Definition Entree.h:42
Une chaine de caractere (Nom) en majuscules.
Definition Motcle.h:26
Un tableau d'objets de la classe Motcle.
Definition Motcle.h:63
int search(const Motcle &t) const
Definition Motcle.cpp:321
friend class Entree
Definition Objet_U.h:76
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 abort()
Routine de sortie de Trio-U sur une erreur abort().
Definition Process.cpp:570
static void exit(int exit_code=-1)
Routine de sortie de TRUST dans une region Kokkos.
Definition Process.cpp:455
static int je_suis_maitre()
renvoie 1 si on est sur le processeur maitre du groupe courant (c'est a dire me() == 0),...
Definition Process.cpp:86
Classe de base des flux de sortie.
Definition Sortie.h:52
classe Traitement_particulier_THI_new Cette classe permet de faire les traitements particuliers
void en_cours_de_resolution(int, DoubleTab &, DoubleTab &, double) override
classe Traitement_particulier_NS_base Derive de Support_Champ_Masse_Volumique: utilisation de rho