TrioCFD 1.9.8
TrioCFD documentation
Loading...
Searching...
No Matches
Champ_Fonc_reprise.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 <EcritureLectureSpecial.h>
17#include <Champ_Generique_base.h>
18#include <Champ_Fonc_reprise.h>
19#include <LecFicDiffuseBin.h>
20#include <Entree_complete.h>
21#include <Probleme_base.h>
22#include <Ecrire_YAML.h>
23#include <TRUST_2_PDI.h>
24#include <Op_Moyenne.h>
25#include <Parser_U.h>
26#include <Avanc.h>
27#include <Perf_counters.h>
28
29extern void convert_to(const char *s, double& ob);
30Implemente_instanciable(Champ_Fonc_reprise,"Champ_Fonc_reprise",Champ_Fonc_base);
31// XD champ_fonc_reprise champ_don_base champ_fonc_reprise NO_BRACE This field is used to read a data field in a save
32// XD_CONT file (.xyz or .sauv) at a specified time. It is very useful, for example, to run a thermohydraulic
33// XD_CONT calculation with velocity initial condition read into a save file from a previous hydraulic calculation.
34// XD attr format chaine(into=["binaire","formatte","xyz","single_hdf","pdi"]) format OPT Type of file (the file
35// XD_CONT format). If xyz format is activated, the .xyz file from the previous calculation will be given for filename,
36// XD_CONT and if formatte or binaire is choosen, the .sauv file of the previous calculation will be specified for
37// XD_CONT filename. In the case of a parallel calculation, if the mesh partition does not changed between the previous
38// XD_CONT calculation and the next one, the binaire format should be preferred, because is faster than the xyz format.
39// XD_CONT If pdi is used, the same constraints/advantages as binaire apply, but it produces one (HDF5) file per node on
40// XD_CONT the filesystem instead of having one file per processor. The single_hdf format is still supported but is
41// XD_CONT obsolete, the PDI format is recommended.
42// XD attr filename chaine filename REQ Name of the save file.
43// XD attr pb_name ref_Pb_base pb_name REQ Name of the problem.
44// XD attr champ chaine champ REQ Name of the problem unknown. It may also be the temporal average of a problem unknown
45// XD_CONT (like moyenne_vitesse, moyenne_temperature,...)
46// XD attr fonction fonction_champ_reprise fonction OPT Optional keyword to apply a function on the field being read in
47// XD_CONT the save file (e.g. to read a temperature field in Celsius units and convert it for the calculation on Kelvin
48// XD_CONT units, you will use: fonction 1 273.+val )
49// XD attr temps chaine time REQ Time of the saved field in the save file or last_time. If you give the keyword
50// XD_CONT last_time instead, the last time saved in the save file will be used.
51
52// XD fonction_champ_reprise objet_lecture nul NO_BRACE not_set
53// XD attr mot chaine(into=["fonction"]) mot REQ not_set
54// XD attr fonction listchaine fonction REQ n f1(val) f2(val) ... fn(val)] time
55
57{
58 return s << que_suis_je() << " " << le_nom();
59}
60
61
63{
64 Cerr<<"Usage : Champ_Fonc_reprise [xyz|formatte|binaire|single_hdf|pdi] fichier.xyz nom_pb nom_inco [fonction n f1(val) f2(val) ... fn(val)] [temps|last_time]"<<finl;
65 Nom nom_fic,nom_pb,nom_champ;
66 Motcle format_rep("xyz");
67 // Lecture
68 s>>nom_fic;
69 if ((nom_fic==Motcle("xyz"))||(nom_fic==Motcle("binaire"))||(nom_fic==Motcle("single_hdf"))||(nom_fic==Motcle("pdi"))||(nom_fic==Motcle("formatte")))
70 {
71 format_rep=nom_fic;
72 s>>nom_fic;
73 }
74 s>>nom_pb>>nom_champ;
75
76 if (format_rep == "single_hdf" && Process::nproc() == 1)
77 {
78 Cerr << "Resuming with a single_hdf option is only available for a parallel calculation !" << finl;
80 }
81
82 int last_time=0;
83 double un_temps=-1;
84 Motcle ch, time;
85 s>>ch;
86 VECT(Parser_U) fxyz;
87 if (ch=="FONCTION")
88 {
89 int nb_compo;
90 s >> nb_compo;
91 fxyz.dimensionner(nb_compo);
92 Nom fonction;
93 for (int i = 0; i<nb_compo; i++)
94 {
95 s >> fonction;
96 fxyz[i].setNbVar(1);
97 fxyz[i].setString(fonction);
98 fxyz[i].addVar("val");
99 fxyz[i].parseString();
100 }
101 s >> time;
102 if (time=="LAST_TIME")
103 last_time=1;
104 else
105 convert_to(time,un_temps);
106 }
107 else
108 {
109 if (ch=="LAST_TIME")
110 last_time=1;
111 else
112 convert_to(ch,un_temps);
113 }
114
115
116 // On recupere le pb, puis ensuite on cherche le champ; on recupere le domaine_dis
117 const Probleme_base& pb =ref_cast(Probleme_base,Interprete::objet(nom_pb));
118 int reprend_champ_moyen=0;
119 int reprend_modele_k_eps=0;
120 int k_eps_realisable = 0;
121 Nom nom_champ_inc;
122
123 // Cas des champs moyens
124 if (((Motcle)nom_champ).debute_par("MOYENNE_"))
125 {
126 nom_champ_inc=((Motcle)nom_champ).suffix("MOYENNE_");
127 nom_champ+="_natif_";
128 nom_champ+=pb.domaine().le_nom();
129 reprend_champ_moyen=1;
130 }
131 // Cas du K-Epsilon
132 if (((Motcle)nom_champ).debute_par("K_EPS"))
133 {
134 reprend_modele_k_eps=1;
135 // cas du k-epsilon realisable
136 if (Motcle(nom_champ).finit_par("_REALISABLE"))
137 {
138 k_eps_realisable = 1;
139 nom_champ_inc=((Motcle)nom_champ).prefix("_REALISABLE");
140 }
141 }
142 if (nom_champ_inc=="??")
143 nom_champ_inc=nom_champ;
144 OBS_PTR(Champ_base) ref_ch;
145 ref_ch = pb.get_champ(Motcle(nom_champ_inc));
146 if (sub_type(Champ_Inc_base,ref_ch.valeur()))
147 Cerr << nom_champ_inc << " is an unknown of problem " << nom_pb << finl;
148 else
149 {
150 Cerr << nom_champ_inc << " is not an unknown of problem " << nom_pb << finl;
152 }
153
155 // on cree un champ comme le ch_ref;
156 const Champ_Inc_base& ch_inc=ref_cast(Champ_Inc_base,ref_ch.valeur());
157 vrai_champ_.typer(ch_inc.que_suis_je());
158 vrai_champ_->associer_domaine_dis_base(pb.domaine_dis());
159 //vrai_champ_->fixer_nb_valeurs_temporelles(2);
160 vrai_champ_->nommer(ch_inc.le_nom());
161 vrai_champ_->fixer_nb_comp(ch_inc.nb_comp());
162 //vrai_champ_->fixer_nb_valeurs_nodales(ch_inc.nb_valeurs_nodales());
163 vrai_champ_->valeurs() = ch_inc.valeurs();
164 vrai_champ_->set_via_ch_fonc_reprise(); // useful for PolyMAC_CDO for the moment !
165 nb_compo_ = ch_inc.nb_comp();
166
167 // creation des identifiants pdi (necessaire pour l'initialisation de PDI)
168 Nom nom_champ_pdi = Motcle(pb.le_nom()) + "_" + Motcle(nom_champ);
169
170 statistics().begin_count(STD_COUNTERS::restart,statistics().get_last_opened_counter_level()+1);
171
172 // Opening file + get file format
173 int mode_lec_sa= EcritureLectureSpecial::mode_lec;
174 OWN_PTR(Entree_Fichier_base) fic_rep;
175 Entree_Brute input_data;
176 int format_sauvegarde = 0;
177 if(format_rep == "single_hdf")
178 {
179 // !! DEPRECATED HDF5 FILE !!
180 Cerr << "WARNING::you are using a deprecated backup file format. Please switch to PDI." << finl;
181 LecFicDiffuse test;
182 if (!test.ouvrir(nom_fic))
183 {
184 Cerr << "Error! " << nom_fic << " file not found ! " << finl;
186 }
187 FichierHDFPar fic_hdf;
188 fic_hdf.open(nom_fic, true);
189 fic_hdf.read_dataset("/sauv", Process::me(),input_data);
190
191 if(last_time)
192 {
193 un_temps = get_last_time(input_data);
194 fic_hdf.read_dataset("/sauv", Process::me(), input_data);
195 Cerr << "In the " << nom_fic << " file, we find the last time: " << un_temps << " and read the fields." << finl;
196 }
197
198 Nom ident_lu;
199 input_data >> ident_lu;
200 format_sauvegarde=0;
201 if (ident_lu=="format_sauvegarde:")
202 input_data >> format_sauvegarde;
203 else
204 {
205 Cerr<<"This .sauv file is too old and the format is not supported anymore."<<finl;
207 }
208 fic_hdf.close();
209 }
210 else if (format_rep == "pdi")
211 {
212 init_pdi(pb, nom_fic, nom_champ_pdi, last_time, un_temps, reprend_champ_moyen);
213 }
214 else
215 {
216 if (format_rep == "xyz")
217 {
219 fic_rep.typer(EcritureLectureSpecial::Input);
220 Cerr << "Opening xyz file " << nom_fic << " (" << EcritureLectureSpecial::Input << ")" << finl;
221 }
222 else
223 {
225 if (format_rep == "binaire")
226 fic_rep.typer("LecFicDistribueBin");
227 else
228 fic_rep.typer("LecFicDistribue");
229 Cerr << "Opening file " << nom_fic << " (LecFicDistribueBin)" << finl;
230 }
231
232 fic_rep->ouvrir(nom_fic);
233
234 if(fic_rep->fail())
235 {
236 Cerr<<"Error while opening the file of resumption : " <<nom_fic<<finl;
238 }
239
240 if (fic_rep->eof())
241 {
242 Cerr << "Error in Champ_Fonc_reprise::reprendre" << finl;
243 Cerr << "The resumption file does not exist" << finl;
244 Cerr << "or could not be opened correctly." << finl;
246 }
247
248 if(last_time)
249 {
250 un_temps = get_last_time(fic_rep.valeur());
251 fic_rep->close();
252 fic_rep->ouvrir(nom_fic);
253 Cerr << "In the " << nom_fic << " file, we find the last time: " << un_temps << " and read the fields." << finl;
254 }
255
256 Nom ident_lu;
257 fic_rep.valeur() >> ident_lu;
258 format_sauvegarde=0;
259 if (ident_lu=="format_sauvegarde:")
260 fic_rep.valeur() >> format_sauvegarde;
261 else
262 {
263 // Version anterieure, on referme et on reouvre
264 if (format_rep=="xyz")
265 {
266 fic_rep->close();
267 fic_rep->ouvrir(nom_fic);
268 }
269 else
270 {
271 Cerr<<"This .sauv file is too old and the format is not supported anymore."<<finl;
273 }
274 }
275 }
276
277 // Creation des identifiants
278 Nom nom_temps=Nom(un_temps,time_format_from(format_sauvegarde));
279 Nom type=ref_ch->que_suis_je();
280 Nom nom_ident;
281 Nom nom_ident_champ_stat;
282 Nom nom_ident_champ_keps;
283 if (reprend_champ_moyen)
284 {
285 nom_ident="Operateurs_Statistique_tps";
286 nom_ident+=pb.domaine().le_nom();
287 nom_ident+=nom_temps;
288
289 nom_ident_champ_stat=nom_champ;
290 nom_ident_champ_stat+="Champ_Fonc";
291 type.suffix("Champ");
292 nom_ident_champ_stat+=type;
293 nom_ident_champ_stat+=pb.domaine().le_nom();
294 nom_ident_champ_stat+=nom_temps;
295 }
296 else if (reprend_modele_k_eps)
297 {
298 nom_ident="Modele_turbulence_hyd_K_Epsilon";
299 if(k_eps_realisable)
300 nom_ident+="_Realisable";
301 nom_ident+=pb.domaine().le_nom();
302 nom_ident+=nom_temps;
303 nom_ident_champ_keps=nom_champ_inc;
304 nom_ident_champ_keps+=type;
305 nom_ident_champ_keps+=pb.domaine().le_nom();
306 nom_ident_champ_keps+=nom_temps;
307 }
308 else
309 {
310 nom_ident=nom_champ_inc;
311 nom_ident+=type;
312 nom_ident+=pb.domaine().le_nom();
313 nom_ident+=nom_temps;
314 }
315
316 if (ch=="FONCTION")
317 if (fxyz.size()!=ch_inc.nb_comp())
318 {
319 Cerr<<"The number of components read " <<fxyz.size()<<" for the resume function"<<finl;
320 Cerr<<"does not corresponds to the number of components "<<ch_inc.nb_comp()<<" of field target"<<finl;
322 }
323
324 if(format_rep == "single_hdf")
325 read_field_from_file(s, input_data, pb, nom_ident, nom_ident_champ_stat, reprend_champ_moyen, nom_ident_champ_keps, reprend_modele_k_eps);
326 else if(format_rep == "pdi")
327 {
328 Entree bidon;
329 read_field_from_file(s, bidon, pb, nom_champ_pdi, "", reprend_champ_moyen, "", reprend_modele_k_eps, 1 /*pdi_format*/);
330 }
331 else
332 read_field_from_file(s, fic_rep.valeur(), pb, nom_ident, nom_ident_champ_stat, reprend_champ_moyen, nom_ident_champ_keps, reprend_modele_k_eps);
333
335 Cerr << "End of resuming the file " << nom_fic << " after " << statistics().get_time_since_last_open(STD_COUNTERS::restart) << " s" << finl;
336 statistics().end_count(STD_COUNTERS::restart);
337
338 ////////////////////////////////////////
339 // Transformation eventuelle du champ lu
340 ////////////////////////////////////////
341 if (fxyz.size())
342 {
343 DoubleTab& tab_valeurs=le_champ().valeurs();
344 // Boucle sur les noeuds du champs
345 int sz=tab_valeurs.dimension_tot(0);
346 int nb_compo=fxyz.size();
347 if (tab_valeurs.nb_dim()==1)
348 {
349 if (nb_compo!=1)
350 {
351 Cerr << "Error in the function read because the field " << le_champ().le_nom() << " has a single dimension." << finl;
353 }
354 }
355 else if (nb_compo!=tab_valeurs.dimension_tot(1))
356 {
357 Cerr << "Error in the number of components of the function read:" << nb_compo << finl;
358 Cerr << "The number of components of field " << le_champ().le_nom() << " is:" << tab_valeurs.dimension_tot(1) << finl;
360 }
361 for (int i=0; i<sz; i++)
362 {
363 for (int j=0; j<nb_compo; j++)
364 {
365 fxyz[j].setVar("val",tab_valeurs(i,j));
366 // On fait la transformation des valeurs du champs
367 tab_valeurs(i,j)=fxyz[j].eval();
368 }
369 }
370 }
371
372 if(format_rep == "pdi")
374
375 return s ;
376}
377
378void Champ_Fonc_reprise::init_pdi(const Probleme_base& pb, const Nom& nom_fic, const Nom& ch_ident, int last_time, double un_temps, int reprend_champ_moyen)
379{
381
382 Ecrire_YAML yaml_file;
383 yaml_file.add_pb_base(pb, nom_fic);
384 int nb_dim = le_champ().valeurs().nb_dim();
385 const Nom& pbname = pb.le_nom();
386 yaml_file.add_field(pbname, ch_ident, nb_dim);
387 if(reprend_champ_moyen)
388 {
389 yaml_file.add_scalar(pbname, pbname + "_stat_nb_champs", "int", false /* same data for every proc */ );
390 yaml_file.add_scalar(pbname, pbname + "_stat_tdeb", "double", false /* same data for every proc */);
391 yaml_file.add_scalar(pbname, pbname + "_stat_tend", "double", false /* same data for every proc */);
392 }
393 std::string yaml_fname = "restart_" + pbname.getString() + "_" + le_champ().le_nom().getString() + ".yml";
394 yaml_file.write_champ_fonc_restart_file(yaml_fname);
395 TRUST_2_PDI::init(yaml_fname);
396
397 TRUST_2_PDI pdi_interface;
398 int last_iteration = -1;
399 double tinit = last_time ? -1. : un_temps;
400 pdi_interface.prepareRestart(restartComm_, last_iteration, tinit, last_time);
401
402}
403
404void Champ_Fonc_reprise::read_field_from_file(Entree& jdd, Entree& file, const Probleme_base& pb, const Nom& nom_ident,
405 const Nom& nom_ident_champ_stat, int reprend_champ_moyen, const Nom& nom_ident_champ_keps, int reprend_modele_k_eps,
406 int pdi_format)
407{
408 // Lecture du fichier
409 if(!pdi_format)
410 {
411 Nom field_tag_syno=nom_ident;
412
413 auto create_syno= [nom_ident](std::string pattern, std::string replace)
414 {
415 std::string s = nom_ident.getString();
416 std::size_t pos = s.find(pattern);
417 while (pos != std::string::npos)
418 {
419 s.replace(pos, pattern.length(), replace);
420 pos = s.find(pattern, pos + replace.length());
421 }
422 return Nom(s);
423 };
425 {
427 field_tag_syno=create_syno("PolyMAC_CDO","PolyMAC");
428 else if (pb.discretisation().is_PolyMAC_MPFA())
429 field_tag_syno=create_syno("PolyMAC_MPFA","PolyMAC_P0");
430 else if (pb.discretisation().is_PolyMAC_HFV())
431 field_tag_syno=create_syno("PolyMAC_HFV","PolyMAC_P0P1NC");
432
433 avancer_fichier_with_syno(file,nom_ident,field_tag_syno);
434 }
435 // end of the backward compatibility
436 else
437 avancer_fichier(file,nom_ident);
438 }
439 else
440 le_champ().set_PDI_dname(nom_ident);
441
442 if (reprend_champ_moyen)
443 {
444 double tdeb = -1,tfin=-1;
445 int n; // Nombre d'operateurs statistiques
446 if(pdi_format)
447 {
448 TRUST_2_PDI pdi_interface;
449 std::string pbname = pb.le_nom().getString();
450 pdi_interface.read(pbname + "_stat_nb_champs", &n);
451 pdi_interface.read(pbname + "_stat_tdeb", &tdeb);
452 pdi_interface.read(pbname + "_stat_tend", &tfin);
453 }
454 else
455 {
456 file >> n;
457 file >> tdeb;
458 file >> tfin;
459 avancer_fichier(file,nom_ident_champ_stat);
460 }
461 // On cree un operateur_statistique qui va nous permettre de relire le champ moyen
462 Op_Moyenne champ_moyen;
463 //On construit un Champ_Generique_refChamp pour pouvoir associer un Champ_Generique_base
464 //a l operateur
465 OWN_PTR(Champ_Generique_base) champ;
466 Nom ajout("");
467 ajout += " refChamp { Pb_champ ";
468 Nom pb_name = pb.le_nom();
469 ajout += pb_name;
470 ajout += " ";
471 ajout += le_champ().le_nom();
472 ajout += " }";
473 Entree_complete s_complete(ajout,jdd);
474 s_complete>>champ;
475 champ_moyen.associer(pb.domaine_dis(),champ.valeur(),tdeb,tfin);
476 champ_moyen.completer(pb, "");
477 champ_moyen.set_pdi_name(nom_ident);
478 champ_moyen.fixer_tstat_deb(tdeb,tfin);
479 champ_moyen.reprendre(file);
480
481 // On remplit le champ
482 le_champ().valeurs() = champ_moyen.calculer_valeurs();
483 }
484 else if (reprend_modele_k_eps)
485 {
486 if(!pdi_format)
487 avancer_fichier(file, nom_ident_champ_keps);
488 le_champ().reprendre(file);
489 }
490 else
491 le_champ().reprendre(file);
492}
493
classe Champ_Fonc_base Classe de base des champs qui sont fonction d'une grandeur calculee
void associer_domaine_dis_base(const Domaine_dis_base &) override
OBS_PTR(Domaine_VF) le_dom_VF
void mettre_a_jour(double temps) override
Mise a jour en temps du champ.
classe Champ_Fonc_reprise Cette classe permet de relire un champ sauvegarde dans un fichier xyz
void mettre_a_jour(double) override
Mise a jour en temps du champ.
DoubleTab & valeurs() override
Renvoie le tableau des valeurs du champ au temps courant.
Champ_base()
Constructeur par defaut d'un Champ_base.
virtual bool is_poly_family() const
virtual bool is_PolyMAC_MPFA() const
virtual bool is_PolyMAC_CDO() const
virtual bool is_PolyMAC_HFV() const
const Nom & le_nom() const override
Donne le nom de l'Objet_U Methode a surcharger : renvoie "neant" dans cette implementation.
void add_field(Nom pb, Nom nom, int nb_dim)
Adds a field (name+dimension) to the block of the problem pb_name in the YAML file.
void write_champ_fonc_restart_file(const std::string &filename)
Generate the YAML file that will be read with champ_fonc_reprise.
void add_pb_base(const Probleme_base &pb_base, const Nom &full_file_name)
Definition Ecrire_YAML.h:76
void add_scalar(Nom pb, Nom nom, Nom type, bool is_local)
Adds a scalar (name+type) to the block of the problem pb_name in the YAML file.
Class defining operators and methods for all reading operation in an input flow (file,...
Definition Entree.h:42
virtual void read_dataset(Nom dataset_basename, int proc_rank, Entree_Brute &entree)
virtual void open(Nom filename, bool readOnly)
virtual void close()
const Nom & le_nom() const override
Renvoie le nom du champ.
virtual int nb_comp() const
Definition Field_base.h:56
int nb_compo_
Definition Field_base.h:95
static Objet_U & objet(const Nom &)
Voir Interprete_bloc::objet_global() BM: la classe Interprete n'est pas le meilleur endroit pour cett...
class Nom Une chaine de caractere pour nommer les objets de TRUST
Definition Nom.h:31
Nom & suffix(const char *const)
Extraction de suffixe : Nom x("azerty");.
Definition Nom.cpp:271
const std::string & getString() const
Definition Nom.h:92
const Nom & le_nom() const override
Renvoie *this;.
Definition Nom.cpp:563
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
void fixer_tstat_deb(double, double) override
Definition Op_Moyenne.h:118
void completer(const Probleme_base &, const Nom &) override
int reprendre(Entree &is) override
Reprise d'un Objet_U sur un flot d'entree Methode a surcharger.
Definition Op_Moyenne.h:113
void set_pdi_name(const Nom &nom)
Definition Op_Moyenne.h:29
void associer(const Domaine_dis_base &une_zdis, const Champ_Generique_base &le_champ, double t1, double t2) override
Definition Op_Moyenne.h:70
DoubleTab calculer_valeurs() const override
void begin_count(const STD_COUNTERS &std_cnt, int counter_lvl=-100000)
double get_time_since_last_open(const STD_COUNTERS &name)
Give as a double the time (in second) elapsed in the operation tracked by the standard counter call n...
void end_count(const std::string &custom_count_name, int count_increment=1, long int quantity_increment=0)
End the count of a counter and update the counter values.
const Nom & le_nom() const override
Donne le nom de l'Objet_U Methode a surcharger : renvoie "neant" dans cette implementation.
Definition Probleme_U.h:109
classe Probleme_base C'est un Probleme_U qui n'est pas un couplage.
const Domaine & domaine() const
Renvoie le domaine associe au probleme.
const Champ_base & get_champ(const Motcle &nom) const override
const Discretisation_base & discretisation() const
Renvoie la discretisation associee au probleme.
const Domaine_dis_base & domaine_dis() const
Renvoie le domaine discretise associe au probleme.
static int nproc()
renvoie le nombre de processeurs dans le groupe courant Voir Comm_Group::nproc() et PE_Groups::curren...
Definition Process.cpp:104
static int me()
renvoie mon rang dans le groupe de communication courant.
Definition Process.cpp:125
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
int nb_dim() const
Definition TRUSTTab.h:199
_SIZE_ dimension_tot(int) const override
Definition TRUSTTab.tpp:160
void read(const std::string &name, void *data)
static void set_PDI_restart(int r)
void prepareRestart(OWN_PTR(Comm_Group)&nodeGroup, int &last_iteration, double &tinit, int resume_last_time)
Generic method to prepare the restart of a computation.
static void init(std::string IO_config)
Definition TRUST_2_PDI.h:63
static void finalize()
Definition TRUST_2_PDI.h:83