TRUST 1.9.8
HPC thermohydraulic platform
Loading...
Searching...
No Matches
Postraitement.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 <Champ_Generique_Statistiques_base.h>
17#include <Create_domain_from_sub_domain.h>
18#include <Champ_Generique_Interpolation.h>
19#include <Champ_Generique_Correlation.h>
20#include <Champ_Generique_refChamp.h>
21#include <EcritureLectureSpecial.h>
22#include <communications_array.h>
23#include <Discretisation_base.h>
24#include <LecFicDiffuse_JDD.h>
25#include <Entree_complete.h>
26#include <Interprete_bloc.h>
27#include <Operateur_base.h>
28#include <communications.h>
29#include <Postraitement.h>
30#include <Equation_base.h>
31#include <Sous_Domaine.h>
32#include <TRUST_2_PDI.h>
33#include <Domaine_VF.h>
34#include <Operateur.h>
35#include <EFichier.h>
36#include <EChaine.h>
37#include <Param.h>
38#include <limits>
39
40static constexpr double DT_NOT_INIT = std::numeric_limits<double>::max();
41static constexpr int NB_NOT_INIT = std::numeric_limits<int>::max();
42
43Implemente_instanciable_sans_constructeur_ni_destructeur(Postraitement,"Postraitement|Post_processing",Postraitement_base);
44// XD corps_postraitement postraitement nul INHERITS_BRACE not_set
45
46// XD un_postraitement objet_lecture nul NO_BRACE An object of post-processing (with name).
47// XD attr nom chaine nom REQ Name of the post-processing.
48// XD attr post corps_postraitement post REQ Definition of the post-processing.
49
50// XD type_un_post objet_lecture nul NO_BRACE not_set
51// XD attr type chaine(into=["postraitement","post_processing"]) type REQ not_set
52// XD attr post un_postraitement post REQ not_set
53
54// XD nom_postraitement objet_lecture nul NO_BRACE not_set
55// XD attr nom chaine nom REQ Name of the post-processing.
56// XD attr post postraitement_base post REQ the post
57
58/*! @brief Constructeur par defaut.
59 *
60 * Les frequences de postraitement prennent la valeur
61 * par defaut 1e6. Et aucun postraitement n'est demande.
62 *
63 */
66 dt_post_(DT_NOT_INIT),
67 nb_pas_dt_post_(NB_NOT_INIT),
70 lserie_(0),
71 dt_integr_serie_(1.e6),
73 binaire_(-1),
75 format_("lml"),
76 option_para_("SIMPLE"),
77 suffix_for_reset_(""), // See resetTime() documentation in this class
78 temps_(-1.), dernier_temps_(-1.)
79{
80}
81
82Postraitement::~Postraitement()
83{
84 //Cerr<<"remise a zero des noms des sondes" <<finl;
85 // quand on detruit un postraitement on detruit la liste des noms des sondes pour pouvoir refaire initialize
86 Postraitement::noms_fichiers_sondes_=LIST(Nom)();
87}
88
94
95// Si forcer != 0, on postraite quel que soit le temps courant,
96// sinon on postraite si l'intervalle entre les postraitements demandes
97// est ecoule.
99{
100 if (forcer)
101 {
105 }
106 else
107 {
111 }
112 dernier_temps_=mon_probleme->schema_temps().temps_courant();
113
114 // Cas des statistiques en serie, il faut traiter APRES le postraitement
115 if (lserie_)
116 {
118 {
122
123 for (auto &itr : champs_post_complet_)
124 {
125 if (sub_type(Champ_Gen_de_Champs_Gen, itr.valeur()))
126 {
127 Champ_Gen_de_Champs_Gen& champ_post = ref_cast(Champ_Gen_de_Champs_Gen, itr.valeur());
128 champ_post.fixer_serie(tstat_deb_, tstat_fin_);
129 }
130 }
131 }
132 }
133}
134
136{
137 //Mise a jour des operateurs statistiques portes par les Champ_Generique_Statistiques
138 for (auto &itr : champs_post_complet_) itr->mettre_a_jour(temps);
139
140 if ( inf_ou_egal(tstat_deb_,temps) && inf_ou_egal(temps,tstat_fin_) )
141 tstat_dernier_calcul_ = temps;// Il y a eu mise a jour effective des integrales
142 if ( sup_ou_egal(temps, tstat_fin_)) // si reprise du calcul apres la fin des stats
143 {
144 double dt=probleme().schema_temps().pas_de_temps(); // si dt cst !!!
145 if (sup_strict(dt,0)) // pour eviter une division par 0
146 tstat_dernier_calcul_ = floor(tstat_fin_/dt)*dt;
147 }
148}
149
150LIST(Nom) Postraitement::noms_fichiers_sondes_=LIST(Nom)();
151
152inline void nom_fichier(const Postraitement& post, const OWN_PTR(Champ_Generique_Statistiques_base)& op, const Domaine& dom, Nom& nom_fichier)
153{
154 nom_fichier+=".";
155 const Entity& loc = op->get_localisation();
156 Nom loc_post;
157
158 //contenu de la methode get_nom_localisation()
159 if (loc==Entity::ELEMENT)
160 loc_post = "ELEM";
161 else if (loc==Entity::NODE)
162 loc_post = "SOM";
163 else if (loc==Entity::FACE)
164 loc_post = "FACES";
165 else
166 {
167 Cerr<<"This location is not valid for the postprocessing"<<finl;
169 }
170
171 nom_fichier+=op->get_nom_post()+"."+loc_post+"."+dom.le_nom()+"."+post.probleme().le_nom()+".";
172 char s[100];
173 snprintf(s,100,"%.10f", op->get_time());
174 nom_fichier+=Nom(s);
175}
176
177inline void nom_fichier(const Postraitement& post, const Nom& nom_post, const Nom& loc, const double temps_ch, const Domaine& dom, Nom& nom_fichier)
178{
179 nom_fichier+=".";
180 nom_fichier+=nom_post+"."+loc+"."+dom.le_nom()+"."+post.probleme().le_nom()+".";
181 char s[100];
182 snprintf(s,100,"%.10f",temps_ch);
183 nom_fichier+=Nom(s);
184}
185
186inline void nom_fichier(const Domaine& dom, Nom& nom_fichier)
187{
188 nom_fichier+=".";
189 nom_fichier+=dom.le_nom();
190}
191inline int composante(const Nom& le_nom_, const Champ_base& mon_champ)
192{
193 Motcle motlu(le_nom_);
194 const Nom& le_nom_ch = mon_champ.le_nom();
195 if (motlu == Motcle(le_nom_ch))
196 return -1;
197 else
198 {
199 const Noms& noms_comp = mon_champ.noms_compo();
200 int n = noms_comp.size();
201 Motcles les_noms_comp(n);
202 for (int i=0; i<n; i++)
203 les_noms_comp[i] = noms_comp[i];
204 int ncomp = les_noms_comp.search(motlu);
205 if (ncomp == -1)
206 {
207 Cerr << "TRUST error, the Champ_Generique_base name : " << le_nom_ << finl
208 << " is neither the field name nor"
209 << " one of its components\n";
210 Cerr << le_nom_ch << " have for components : " << finl;
211 for (int ii=0; ii<n; ii++)
212 Cerr << noms_comp[ii] << " ";
213 Cerr << finl;
215 }
216 return ncomp;
217 }
218
219}
220
222{
223 Nom loc_post;
224
225 if (loc==Entity::ELEMENT)
226 loc_post = "ELEM";
227 else if (loc==Entity::NODE)
228 loc_post = "SOM";
229 else if (loc==Entity::FACE)
230 loc_post = "FACES";
231 else
232 {
233 Cerr<<"This location is not valid for the postprocessing"<<finl;
234 exit();
235 }
236
237 return loc_post;
238}
239
240int Postraitement::champ_fonc(Motcle& nom_champ, OBS_PTR(Champ_base)& mon_champ, OBS_PTR(Operateur_Statistique_tps_base)& operateur_statistique) const
241{
242 if (comprend_champ_post(nom_champ))
243 {
244 const OBS_PTR(Champ_Generique_base)& champ = get_champ_post(nom_champ);
245 if (sub_type(Champ_Generique_Statistiques_base,champ.valeur()))
246 {
247 const Champ_Generique_Statistiques_base& champ_stat = ref_cast(Champ_Generique_Statistiques_base,champ.valeur());
248 mon_champ = champ_stat.integrale().le_champ_calcule();
249 operateur_statistique = champ_stat.Operateur_Statistique();
250 return 1;
251 }
252 }
253 return 0;
254}
255
257{
258 s << que_suis_je() << finl;
259 return s << finl;
260}
261
262/*! @brief Lit les directives de postraitement sur un flot d'entree.
263 *
264 * Format:
265 * Postraitement
266 * {
267 * Sondes bloc de lecture des sondes |
268 * Champs bloc de lecture des champs a postraiter |
269 * Statistiques bloc de lecture objet statistique |
270 * Fichier
271 * }
272 *
273 * @param (Entree& s) un flot d'entree
274 * @return (Entree&) le flot d'entree modifie
275 * @throws accolade ouverte attendue
276 * @throws lecture des champs: mot clef "dt_post" attendu
277 * @throws lecture du bloc statistique: mot clef "dt_post" attendu
278 * @throws mot clef inconnu
279 */
281{
282 Cerr << "Reading guidelines of postprocessing" << finl;
283 assert(mon_probleme);
284
285 const Nom& le_nom_du_post = le_nom();
286 Nom vide;
287 if ((le_nom_du_post != "neant") && (le_nom_du_post != vide))
288 {
289 nom_fich_ += "_";
290 nom_fich_ += le_nom_du_post;
291 }
292
293 dt_post_ = DT_NOT_INIT;
294 nb_pas_dt_post_ = NB_NOT_INIT;
295
296 Probleme_base& le_pb = mon_probleme.valeur();
297 le_domaine_ = le_pb.domaine();
298
300
301 if (Motcle(format_) == "MEDFILE")
302 {
303 Cerr << "The postprocessing format 'medfile' is not supported since TRUST v1.9.2! Switch to 'med'." << finl;
305 }
306
307 if (Motcle(format_) == "LATA_V1")
308 {
309 Cerr << "The postprocessing format 'lata_v1' is not supported since TRUST v1.9.1! Switch to 'lata' (version 2)." << finl;
311 }
312
313 bool is_supported = false, is_single_lata = false;
314 std::vector<Motcle> supported = { "CGNS" , "LATA", "SINGLE_LATA", "LATA_V2", "MED", "LML" };
315
316 for (auto &itr : supported)
317 if (Motcle(format_) == itr)
318 {
319 is_supported = true;
320 break;
321 }
322
323 if (!is_supported)
324 {
325 Cerr << "The post-processing format " << Motcle(format_) << " is not recognized! The recognized formats are : " << finl;
326 for (auto &itr : supported) Cerr << " - " << itr << finl;
328 }
329
330 if (Motcle(format_) == "MED") format_ = "med";
331 if (Motcle(format_) == "CGNS") format_ = "cgns"; // useless just to have lower case ...
332 if (Motcle(format_) == "LATA_V2") format_ = "lata";
333 if (Motcle(format_) == "SINGLE_LATA")
334 {
335 is_single_lata = true;
336 format_ = "lata";
337 }
338
339 // XXX Elie Saikali : modif "nom_fich_" cas post CGNS si pb_couple ...
340 if (format_ == "cgns" && le_pb.is_coupled())
341 {
342 nom_fich_ += "_";
343 nom_fich_ += le_pb.le_nom();
344 }
345
346 nom_fich_ += ".";
348
349 // Les sondes sont completees (en effet, si les sondes ont des champs statistiques, on n'a besoin d'avoir
350 // lu le bloc statistiques ET le bloc sondes)
351 les_sondes_.completer();
352
353 Nom type_format = "Format_Post_";
354 type_format += format_;
355 format_post_.typer(type_format.getChar());
356
357 format_post_->set_single_lata_option(is_single_lata); // utile pour single_lata ...
358
359 // pour cgns ...
360 if (le_pb.has_domaine_dis())
361 format_post_->set_discr_type(le_pb.domaine_dis().que_suis_je());
362
363 if (le_domaine_->deformable())
364 format_post_->set_deformable_domain();
365
366 format_post_->set_loc_vector(locs_required_);
367
368 Nom base_name(nom_fich_);
369 base_name.prefix(format_);
370 base_name.prefix(".");
371 //format_post->initialize_by_default(base_name);
372 format_post_->initialize(base_name, binaire_, option_para_);
373
374 return s;
375}
376
377void Postraitement::modify_cgns_basenames_and_reinit(const int nom_cas_fich_ind, const int count_nom_cas_fich)
378{
379 if (format_ != "cgns") return;
380
381 nom_fich_.prefix(format_);
382 nom_fich_.prefix(".");
383
384 const Nom& le_nom_du_post = le_nom();
385 Nom vide;
386 if ((le_nom_du_post != "neant") && (le_nom_du_post != vide))
387 {
388 nom_fich_ += "_";
389 nom_fich_ += le_nom_du_post;
390 }
391 else if (nom_fich_ == nom_du_cas())
392 {
393 if (count_nom_cas_fich > 1) // we have several basenames with jdd name
394 {
395 assert (nom_cas_fich_ind <= count_nom_cas_fich);
396 if (nom_cas_fich_ind > 1) // not first one
397 {
398 nom_fich_ += "_bloc_";
399 nom_fich_ += std::to_string(nom_cas_fich_ind);
400 }
401 }
402 }
403
404 nom_fich_ += ".";
406
407 Nom base_name(nom_fich_);
408 base_name.prefix(format_);
409 base_name.prefix(".");
410 format_post_->initialize(base_name, binaire_, option_para_);
411}
412
413static const std::map<std::string, std::string> keyword_dictionnary
414{
415 {"CHAMPS", "FIELDS"},
416 {"STATISTIQUES", "STATISTICS"},
417 {"STATISTIQUES_EN_SERIE", "SERIAL_STATISTICS"},
418 {"SONDES", "PROBES"},
419 {"SONDES_MOBILES", "MOBILE_PROBES"},
420 {"SONDES_INT", "INT_PROBES"},
421 {"TABLEAUX_INT", "INT_ARRAYS"}
422};
423
424static Nom translate_keyword(const Nom& french_keyword)
425{
426 bool has_file_suffix = french_keyword.finit_par("_FICHIER") || french_keyword.finit_par("_FILE");
427 Nom english_keyword = french_keyword;
428 english_keyword.prefix("_FICHIER").prefix("_FILE");
429 auto i = keyword_dictionnary.find(english_keyword.getString());
430 if (i!=keyword_dictionnary.end())
431 english_keyword = i->second;
432 if (has_file_suffix)
433 english_keyword += "_FILE";
434 return english_keyword;
435}
436
437static EChaineJDD read_and_broadcast_file(const Nom& filename)
438{
439 // Proc 0 read file and fills its "file_content"
440 LecFicDiffuse_JDD file_stream(filename, ios::in);
441 long unsigned int file_char_number;
442 Nom file_content("{ ");
444 {
445 std::stringstream buffer;
446 buffer << file_stream.get_entree_master().get_istream().rdbuf();
447 file_content += buffer.str();
448 file_content += " }";
449 file_char_number = file_content.getString().size()-4;
450 }
451 // Proc0 sends its "file_content" to other procs
452 envoyer_broadcast(file_char_number, 0);
453 file_content.getString().resize(file_char_number+4); // +4 for braces and spaces
454 envoyer_broadcast_array(&file_content.getString()[2], (int)file_char_number, 0);
455 file_content.getString()[file_char_number+2] = ' ';
456 file_content.getString()[file_char_number+3] = '}';
457 // We build an EChaine to interpret the file
458 return EChaineJDD(file_content);
459}
460
461static EChaineJDD get_file_content_for_bloc(const Nom& associated_word, Entree& s, bool with_acco)
462{
463 Nom filename;
464 if (!with_acco)
465 {
466 Nom motlu;
467 s >> motlu;
468 if (Motcle(motlu) != "fichier|file") Process::exit("'fichier' or 'file' expected!");
469 s >> filename;
470 s >> motlu;
471 if (motlu != "}") Process::exit("'}' expected!");
472 }
473 else
474 {
475 Param param2(associated_word + "_files");
476 param2.ajouter("fichier|file",&filename,Param::REQUIRED);
477 param2.lire_avec_accolades_depuis(s);
478 }
479
480 Cerr << "Reading of "<<associated_word<<" from file "<<filename<< finl;
481 return read_and_broadcast_file(filename);
482}
483
485{
486// XD postraitement postraitement_base postraitement INHERITS_BRACE An object of post-processing (without name).
487// XD attr t_debut_statistiques floattant t_debut_statistiques OPT not_set (for IJK)
488// XD attr nb_pas_dt_post_stats_plans floattant nb_pas_dt_post_stats_plans OPT not_set (for IJK)
489// XD attr nb_pas_dt_post_stats_bulles floattant nb_pas_dt_post_stats_bulles OPT not_set (for IJK)
490// XD attr expression_vx_ana chaine expression_vx_ana OPT not_set (for IJK)
491// XD attr expression_vy_ana chaine expression_vy_ana OPT not_set (for IJK)
492// XD attr expression_vz_ana chaine expression_vz_ana OPT not_set (for IJK)
493// XD attr expression_p_ana chaine expression_p_ana OPT not_set (for IJK)
494// XD attr postprocessor_stt rien postprocessor_stt OPT not_set (for STT)
495// XD attr format_trustlata format_trustlata Format_IJKLata OPT not_set (for STT)
496// XD attr interfaces interface_posts interfaces OPT Keyword to read all the caracteristics of the interfaces. Different
497// XD_CONT kind of interfaces exist as well as different interface intitialisations.
498 param.ajouter("Fichier",&nom_fich_); // XD_ADD_P chaine
499 // XD_CONT Name of file.
500 param.ajouter("Format",&format_); // XD_ADD_P chaine(into=["lml","lata","single_lata","lata_v2","med","cgns"])
501 // XD_CONT This optional parameter specifies the format of the output file. The basename used for the output file is
502 // XD_CONT the basename of the data file. For the fmt parameter, choices are lml or lata. A short description of each
503 // XD_CONT format can be found below. The default value is lml.
504 param.ajouter_non_std("dt_post",(this)); // XD_ADD_P chaine
505 // XD_CONT Field\'s write frequency (as a time period) - can also be specified after the 'field' keyword.
506 param.ajouter("nb_pas_dt_post",&nb_pas_dt_post_, Param::Nature::OPTIONAL); // XD_ADD_P entier
507 // XD_CONT Field\'s write frequency (as a number of time steps) - can also be specified after the 'field' keyword.
508 param.ajouter_non_std("Domaine",(this)); // XD_ADD_P chaine
509 // XD_CONT This optional parameter specifies the domain on which the data should be interpolated before it is written
510 // XD_CONT in the output file. The default is to write the data on the domain of the current problem (no
511 // XD_CONT interpolation).
512 param.ajouter_non_std("Sous_domaine|Sous_zone",(this)); // XD_ADD_P chaine
513 // XD_CONT This optional parameter specifies the sub_domaine on which the data should be interpolated before it is
514 // XD_CONT written in the output file. It is only available for sequential computation.
515 param.ajouter("Parallele",&option_para_); // XD_ADD_P chaine(into=["simple","multiple","mpi-io"])
516 // XD_CONT Select simple (single file, sequential write), multiple (several files, parallel write), or mpi-io (single
517 // XD_CONT file, parallel write) for LATA format
518 param.ajouter_non_std("Definition_champs",(this));// XD_ADD_P definition_champs
519 // XD_CONT Keyword to create new or more complex field for advanced postprocessing.
520 param.ajouter_non_std("Definition_champs_fichier|Definition_champs_file",(this));// XD_ADD_P definition_champs_fichier
521 // XD_CONT Definition_champs read from file.
522 param.ajouter_non_std("Sondes|Probes",(this)); // XD_ADD_P sondes
523 // XD_CONT Probe.
524 param.ajouter_non_std("Sondes_fichier|Probes_file",(this)); // XD_ADD_P sondes_fichier
525 // XD_CONT Probe read from a file.
526 param.ajouter_non_std("Sondes_mobiles|Mobile_probes",(this)); // XD_ADD_P sondes
527 // XD_CONT Mobile probes useful for ALE, their positions will be updated in the mesh.
528 param.ajouter_non_std("Sondes_mobiles_fichier|Mobile_probes_file",(this)); // XD_ADD_P sondes_fichier
529 // XD_CONT Mobile probes read in a file
530 param.ajouter("DeprecatedKeepDuplicatedProbes",&DeprecatedKeepDuplicatedProbes); // XD_ADD_P entier
531 // XD_CONT Flag to not remove duplicated probes in .son files (1: keep duplicate probes, 0: remove duplicate probes)
532 param.ajouter_non_std("champs|fields",(this)); // XD_ADD_P champs_posts
533 // XD_CONT Field\'s write mode.
534 param.ajouter_non_std("champs_fichier|fields_file",(this));// XD_ADD_P champs_posts_fichier
535 // XD_CONT Fields read from file.
536 param.ajouter_non_std("Statistiques|statistics",(this)); // XD_ADD_P stats_posts
537 // XD_CONT Statistics between two points fixed : start of integration time and end of integration time.
538 param.ajouter_non_std("statistiques_fichier|statistics_file",(this));// XD_ADD_P stats_posts_fichier
539 // XD_CONT Statistics read from file.
540 param.ajouter_non_std("Sondes_Int|Int_Probes",(this));
541 param.ajouter_non_std("Sondes_Int_fichier|Int_probes_file",(this));
542 param.ajouter_non_std("Tableaux_Int|Int_array",(this));
543 param.ajouter_non_std("Tableaux_Int_fichier|Int_array_file",(this));
544 param.ajouter_non_std("Statistiques_en_serie|Serial_statistics",(this));// XD_ADD_P stats_serie_posts
545 // XD_CONT Statistics between two points not fixed : on period of integration.
546 param.ajouter_non_std("Statistiques_en_serie_fichier|Serial_statistics_file",(this));// XD_ADD_P stats_serie_posts_fichier
547 // XD_CONT Serial_statistics read from a file
548 param.ajouter("suffix_for_reset", &suffix_for_reset_); // XD_ADD_P chaine
549 // XD_CONT Suffix used to modify the postprocessing file name if the ICoCo resetTime() method is invoked.
550
552 && dt_post_ == DT_NOT_INIT && nb_pas_dt_post_ == NB_NOT_INIT)
553 {
554 Cerr << "Error while reading the input data for postprocessing :" << finl;
555 Cerr << " -> We expected the keyword 'dt_post' or 'nb_pas_dt_post'" << finl;
556 exit();
557 }
558}
559
560// XD format_trustlata objet_lecture nul BRACE Post-processing for STT
561// XD attr fields_to_write bloc_lecture fields_to_write OPT not_set
562// XD attr write_all_fields rien write_all_fields OPT not_set
563// XD attr use_XYZ_Nodes rien use_XYZ_Nodes OPT not_set
564// XD attr use_XY_Nodes rien use_XY_Nodes OPT not_set
565
566// XD bloc_fichier objet_lecture nul BRACE Block containing the name of the file
567// XD attr fichier chaine file REQ File name
568
569// XD sondes_fichier objet_lecture nul BRACE Keyword to read probes from a file
570// XD attr fichier|file chaine file REQ name of file
571// XD definition_champs_fichier objet_lecture nul BRACE Keyword to read definition_champs from a file
572// XD attr fichier|file chaine file REQ name of file
573
574// XD champ_a_post objet_lecture nul NO_BRACE Field to be post-processed.
575// XD attr champ chaine champ REQ Name of the post-processed field.
576// XD attr localisation chaine(into=["elem","som","faces","elem_dg"]) localisation OPT Localisation of post-processed
577// XD_CONT field values: The two available values are elem, som, or faces (LATA format only) used respectively to select
578// XD_CONT field values at mesh centres (CHAMPMAILLE type field in the lml file) or at mesh nodes (CHAMPPOINT type field
579// XD_CONT in the lml file). If no selection is made, localisation is set to som by default, elem_dg is specific for dg
580// XD_CONT discretisation to interpolate value on one unique cell center value.
581// XD champs_a_post listobj nul INHERITS_BRACE champ_a_post NO_COMMA Fields to be post-processed.
582
583// XD interface_posts objet_lecture nul NO_BRACE not set
584// XD attr nom_interf chaine nom_interf OPT name of the interface to post process
585// XD attr blocs champs_a_post blocs REQ Post-processed fields.
586
587
588// XD champs_posts objet_lecture nul NO_BRACE Field\'s write mode.
589// XD attr format chaine(into=["binaire","formatte"]) format OPT Type of file.
590// XD attr mot chaine(into=["dt_post","nb_pas_dt_post"]) mot OPT Keyword to set the kind of the field\'s write
591// XD_CONT frequency. Either a time period or a time step period. it can be specified either here, or at the begining of
592// XD_CONT the postprocessing bloc.
593// XD attr period chaine period OPT Value of the period which can be like (2.*t).
594// XD attr champs|fields champs_a_post champs REQ Post-processed fields.
595
596// XD champs_posts_fichier objet_lecture nul NO_BRACE Fields read from file.
597// XD attr format chaine(into=["binaire","formatte"]) format OPT Type of file.
598// XD attr mot chaine(into=["dt_post","nb_pas_dt_post"]) mot OPT Keyword to set the kind of the field\'s write
599// XD_CONT frequency. Either a time period or a time step period.
600// XD attr period chaine period OPT Value of the period which can be like (2.*t).
601// XD attr fichier bloc_fichier file REQ name of file
602
603// XD stats_posts objet_lecture nul NO_BRACE Post-processing for statistics. \input{{statistiques}}
604// XD attr mot chaine(into=["dt_post","nb_pas_dt_post"]) mot OPT Keyword to set the kind of the field\'s write
605// XD_CONT frequency. Either a time period or a time step period.
606// XD attr period chaine period OPT Value of the period which can be like (2.*t).
607// XD attr champs|fields list_stat_post champs REQ Post-processed fields.
608
609// XD stats_posts_fichier objet_lecture nul NO_BRACE Statistics read from file.. \input{{statistiques}}
610// XD attr mot chaine(into=["dt_post","nb_pas_dt_post"]) mot OPT Keyword to set the kind of the field\'s write
611// XD_CONT frequency. Either a time period or a time step period.
612// XD attr period chaine period OPT Value of the period which can be like (2.*t).
613// XD attr fichier bloc_fichier file REQ name of file
614
615// XD stats_serie_posts objet_lecture nul NO_BRACE This keyword is used to set the statistics. Average on dt_integr time
616// XD_CONT interval is post-processed every dt_integr seconds. \input{{statistiquesseries}}
617// XD attr mot chaine(into=["dt_integr"]) mot REQ Keyword is used to set the statistics period of integration and write
618// XD_CONT period.
619// XD attr dt_integr floattant dt_integr REQ Average on dt_integr time interval is post-processed every dt_integr
620// XD_CONT seconds.
621// XD attr stat list_stat_post stat REQ not_set
622
623// XD stats_serie_posts_fichier objet_lecture nul NO_BRACE This keyword is used to set the statistics read from a file.
624// XD_CONT Average on dt_integr time interval is post-processed every dt_integr seconds. \input{{statistiquesseries}}
625// XD attr mot chaine(into=["dt_integr"]) mot REQ Keyword is used to set the statistics period of integration and write
626// XD_CONT period.
627// XD attr dt_integr floattant dt_integr REQ Average on dt_integr time interval is post-processed every dt_integr
628// XD_CONT seconds.
629// XD attr fichier bloc_fichier file REQ name of file
630
631// XD stat_post_deriv objet_lecture stat_post_deriv NO_BRACE not_set
632// XD list_stat_post listobj nul INHERITS_BRACE stat_post_deriv NO_COMMA Post-processing for statistics
633
634
635
636// XD stat_post_t_deb stat_post_deriv t_deb NO_BRACE Start of integration time
637// XD attr val floattant val REQ not_set
638// XD stat_post_t_fin stat_post_deriv t_fin NO_BRACE End of integration time
639// XD attr val floattant val REQ not_set
640// XD stat_post_moyenne stat_post_deriv moyenne NO_BRACE to calculate the average of the field over time
641// XD attr field chaine field REQ name of the field on which statistical analysis will be performed. Possible keywords
642// XD_CONT are Vitesse (velocity), Pression (pressure), Temperature, Concentration, ...
643// XD attr localisation chaine(into=["elem","elem_dg","som","faces"]) localisation OPT Localisation of post-processed
644// XD_CONT field value
645// XD stat_post_ecart_type stat_post_deriv ecart_type NO_BRACE to calculate the standard deviation (statistic rms) of
646// XD_CONT the field
647// XD attr field chaine field REQ name of the field on which statistical analysis will be performed. Possible keywords
648// XD_CONT are Vitesse (velocity), Pression (pressure), Temperature, Concentration, ...
649// XD attr localisation chaine(into=["elem","elem_dg","som","faces"]) localisation OPT Localisation of post-processed
650// XD_CONT field value
651// XD stat_post_correlation stat_post_deriv correlation NO_BRACE correlation between the two fields
652// XD attr first_field chaine first_field REQ first field
653// XD attr second_field chaine second_field REQ second field
654// XD attr localisation chaine(into=["elem","elem_dg","som","faces"]) localisation OPT Localisation of post-processed
655// XD_CONT field value
656
658{
659 ////////////////////////////////////////
660 // Creation d'alias pour certains champs
661 ////////////////////////////////////////
662 {
663 Noms liste_noms;
664 const Probleme_base& Pb = probleme();
665 Pb.get_noms_champs_postraitables(liste_noms);
666 // On ajoute temperature_physique aux champs definis
667 if (liste_noms.rang("temperature") != -1 && !comprend_champ_post("temperature_physique"))
668 {
669 Motcle disc(probleme().discretisation().que_suis_je());
670 if ((disc == "VEF") || (disc == "VEFPreP1b"))
671 {
672 Nom in("{ temperature_physique ");
673 in += "Tparoi_VEF { source refChamp { Pb_champ ";
674 in += probleme().le_nom();
675 in += " temperature } } }";
676 Cerr << " Building of temperature_physique " << in << finl;
677 EChaine IN(in);
679 }
680 }
681 }
682
683 // Small function to read the dt_post entry potentially using an expression:
684 auto lire_dt = [&]() -> double
685 {
686 Nom expression;
687 s >> expression;
688 fdt_post_.setNbVar(1);
689 fdt_post_.setString(expression);
690 fdt_post_.addVar("t");
691 fdt_post_.parseString();
692 return fdt_post_.eval();
693 };
694
695 Motcle motlu;
696 Motcle keyword = mot;
697 keyword = translate_keyword(keyword.majuscule());
698 bool expect_acco = false;
699
700 if (keyword=="Probes")
701 {
702 Cerr << "Reading of probes" << finl;
703 les_sondes_.associer_post(*this);
704 s >> les_sondes_;
705 sondes_demande_ = 1;
706 return 1;
707 }
708 else if (keyword=="Mobile_probes")
709 {
710 Cerr << "Reading of mobile probes" << finl;
711 les_sondes_.associer_post(*this);
712 s >> les_sondes_;
713 les_sondes_.set_update_positions(true);
714 sondes_demande_ = 1;
715 return 1;
716 }
717 else if (keyword=="Fields|Fields_file")
718 {
719 Cerr << "Reading of fields to be postprocessed" << finl;
720 Noms liste_noms;
721 Option opt=DESCRIPTION;
722 mon_probleme->get_noms_champs_postraitables(liste_noms,opt);
723 s >> motlu;
724 if (motlu == "binaire")
725 {
726 binaire_=1;
727 s >> motlu;
728 expect_acco = true;
729 }
730 else if (motlu == "formatte")
731 {
732 binaire_=0;
733 s >> motlu;
734 expect_acco = true;
735 }
736
737 if (motlu == "dt_post")
738 {
739 double tmp_dt = lire_dt();
740 if ((dt_post_ != DT_NOT_INIT && tmp_dt != dt_post_)|| nb_pas_dt_post_ != NB_NOT_INIT)
741 {
742 Cerr << "Error: in postprocessing block, 'dt_post' (or 'nb_pas_dt_post') was already set with a different value!" << finl;
743 Cerr << " -> Set it either only after 'field', or directly at the root of the postprocessing block but not both!" << finl;
745 }
746 dt_post_ = tmp_dt;
747 expect_acco = true;
748 }
749 else if (motlu == "nb_pas_dt_post")
750 {
751 if (dt_post_ != DT_NOT_INIT || nb_pas_dt_post_ != NB_NOT_INIT)
752 {
753 Cerr << "Error: in postprocessing block, 'dt_post' (or 'nb_pas_dt_post') was already set!" << finl;
754 Cerr << " -> Set it either after 'field' or directly at the root of the postprocessing block but not both!" << finl;
756 }
757 s >> nb_pas_dt_post_;
758 expect_acco = true;
759 }
760 //La methode lire_champs_a_postraiter() va generer auatomatiquement un Champ_Generique_base
761 //en fonction des indications du jeu de donnees (ancienne formulation)
762
763 if (!expect_acco && motlu != "{")
764 Process::exit("We expected { to start the reading of the fields to postprocess!");
765
766 if (keyword=="Fields_file")
767 {
768 Nom associated_word("Fields");
769 EChaineJDD file_content = get_file_content_for_bloc(associated_word, s, expect_acco);
770 lire_champs_a_postraiter(file_content, true);
771 }
772 else
773 lire_champs_a_postraiter(s, expect_acco);
774 champs_demande_ = 1;
775 return 1;
776 }
777 else if (keyword=="Statistics|Statistics_file")
778 {
779 Cerr << "Reading of the statistics block" << finl;
780 s >> motlu;
781
782 if (motlu == "dt_post")
783 {
784 double tmp_dt = lire_dt();
785 if ((dt_post_ != DT_NOT_INIT && tmp_dt != dt_post_)|| nb_pas_dt_post_ != NB_NOT_INIT)
786 {
787 Cerr << "Error: in postprocessing block, 'dt_post' (or 'nb_pas_dt_post') was already set with a different value!" << finl;
788 Cerr << " -> Set it either only after 'field', or directly at the root of the postprocessing block but not both!" << finl;
790 }
791 dt_post_ = tmp_dt;
792 expect_acco = true;
793 }
794 if (!expect_acco && motlu != "{")
795 Process::exit("We expected { to start the reading of the fields to postprocess!");
796 //La methode lire_champs_stat_a_postraiter() va generer auatomatiquement un Champ_Generique_base
797 //en fonction des indications du jeu de donnees (ancienne formulation)
798
799 if (keyword=="Statistics_file")
800 {
801 Nom associated_word("Statistics");
802 EChaineJDD file_content = get_file_content_for_bloc(associated_word, s, expect_acco);
803 lire_champs_stat_a_postraiter(file_content,true);
804 }
805 else
806 lire_champs_stat_a_postraiter(s,expect_acco);
807
808 //Activer pour lancer la sauvegarde et la reprise des statistiques
809 stat_demande_ = 1;
810 return 1;
811 }
812 else if (keyword=="Domaine")
813 {
815 {
816 Cerr<<"The domain must be specified before reading Champs, Probes and Statistiques blocks at the beginning of the post-processing block."<<finl;
817 exit();
818 }
819
820 Nom nom_du_domaine;
821 s >> nom_du_domaine;
822 le_domaine_=ref_cast(Domaine,Interprete::objet(nom_du_domaine));
823 return 1;
824 }
825 else if (keyword=="Sous_domaine|Sous_zone")
826 {
827 // Sanity check
829 {
830 Cerr<<"The domain must be specified before reading Champs, Probes and Statistiques blocks at the beginning of the post-processing block."<<finl;
831 exit();
832 }
833
834 // Recuperation du sous-domaine
835 Nom nom_du_sous_domaine;
836 s >> nom_du_sous_domaine;
837 Sous_Domaine le_sous_domaine;
838 if (!Interprete_bloc::objet_global_existant(nom_du_sous_domaine))
839 {
840 Cerr << "Unknown sous_domaine : " << nom_du_sous_domaine << finl;
842 }
843 le_sous_domaine=ref_cast(Sous_Domaine,Interprete_bloc::objet_global(nom_du_sous_domaine));
844
845 // Declaration du domaine
846 Nom nom_du_dom(le_sous_domaine.domaine().le_nom());
847 Nom nom_du_nouveau_dom = nom_du_dom + Nom("_") + nom_du_sous_domaine;
848
849 Nom in("domaine ");
850 in += nom_du_nouveau_dom;
851
852 EChaine IN(in);
854
855 // Definition du domaine a partir du sous-domaine
856 in = "Create_domain_from_sub_domain { domaine_final ";
857 in += nom_du_nouveau_dom;
858 in += " par_sous_zone ";
859 in += nom_du_sous_domaine;
860 in += " domaine_init ";
861 in += nom_du_dom;
862 in += " } ";
863
864 EChaine IN2(in);
866 le_domaine_=ref_cast(Domaine,Interprete_bloc::objet_global(nom_du_nouveau_dom));
867
868 return 1;
869 }
870 else if (keyword=="Int_Probes")
871 {
872 Cerr << "Reading of probes related to integers arrays" << finl;
873 les_sondes_int_.associer_post(*this);
874 s >> les_sondes_int_;
875 les_sondes_int_.ouvrir_fichiers();
876 sondes_demande_ = 1;
877 return 1;
878 }
879 else if (keyword=="Int_array|Int_array_file")
880 {
881 //
882 // [ABN] Is someone using this ???
883 //
884
885 Cerr << "Reading of integers arrays to be postprocessed "<< finl;
886 s >> motlu;
887
888 if (motlu == "dt_post")
889 {
890 double tmp_dt = lire_dt();
891 if ((dt_post_ != DT_NOT_INIT && tmp_dt != dt_post_)|| nb_pas_dt_post_ != NB_NOT_INIT)
892 {
893 Cerr << "Error: in postprocessing block, 'dt_post' (or 'nb_pas_dt_post') was already set with a different value!" << finl;
894 Cerr << " -> Set it either only after 'field', or directly at the root of the postprocessing block but not both!" << finl;
896 }
897 dt_post_ = tmp_dt;
898 }
899
900 if (keyword=="Int_array_file")
901 {
902 EChaineJDD file_content = get_file_content_for_bloc(Nom("Int_array"), s, true);
903 lire_tableaux_a_postraiter(file_content);
904 }
905 else
908 return 1;
909 }
910 else if (keyword=="Serial_statistics|Serial_statistics_file")
911 {
912 Cerr << "Reading of the serial statistics block" << finl;
913 s >> motlu;
914 if (motlu != "dt_integr")
915 {
916 Cerr << "Error while reading the statistics block:" << finl;
917 Cerr << "We expected the keyword dt_integr " << finl;
918 exit();
919 }
920
921 s >> dt_integr_serie_;
922
923 if (keyword=="Serial_statistics_file")
924 {
925 EChaineJDD file_content = get_file_content_for_bloc(Nom("Serial_statistics"), s, true);
926 lire_champs_stat_a_postraiter(file_content, true);
927 }
928 else
930 stat_demande_ = 1;
931 lserie_=1;
932 return 1;
933 }
934 else if (keyword=="Definition_champs")
935 {
936 //La methode lire_champs_operateurs() permet la lecture d un champ a postraiter avec
937 //la nouvelle formulation dans le jeu de donnees
939 return 1;
940 }
941 else if (keyword.finit_par("_file"))
942 {
943 Nom keyword_prefix = keyword.getPrefix("_file");
944 EChaineJDD file_content = get_file_content_for_bloc(keyword_prefix, s, true);
945 this->lire_motcle_non_standard(keyword_prefix, file_content);
946 return 1;
947 }
948 else if (keyword=="dt_post")
949 {
950 dt_post_ = lire_dt();
951 return 1;
952 }
953
954 return -1;
955}
956
957/**
958 * When reseting time (see ProblemTrio::resetTime() documentation) we change the name
959 * of the postprocessing files with a new suffix.
960 * TODO: In the current setup suffix is "" meaning that the previous output **are** discarded. This
961 * might change in the future!
962 */
963void Postraitement::resetTime(double time, const std::string dirname)
964{
965 // Modify output file name
966 Nom name=nom_fich().prefix(format_);
967 name.prefix(".");
969
970 // And reset all time related members:
971 format_post_->resetTime(time, dirname);
972 les_sondes_.resetTime(time);
973 temps_ = -1.;
974 dernier_temps_ = -1.;
975}
976
977
978/*! @brief for PDI IO: retrieve name, type and dimensions of the fields to save/restore
979 *
980 */
981std::vector<YAML_data> Postraitement::data_a_sauvegarder() const
982{
983 std::vector<YAML_data> data;
985 {
986 std::string cond = "$temps>" + std::to_string(tstat_deb_);
987 for (const auto& ch_post : champs_post_complet_)
988 {
989 std::vector<YAML_data> post_data = ch_post->data_a_sauvegarder();
990 // adding a condition on every field we just retrieved:
991 // we don't want to save stat fields if we haven't started filling it
992 for (auto& post : post_data)
993 post.set_conditions(cond);
994 data.insert(data.end(), post_data.begin(), post_data.end());
995 }
996 auto add_stat = [&](const std::string& n, const std::string& type)
997 {
998 YAML_data d(n, type);
999 d.set_local(false);
1000 d.set_conditions(cond);
1001 data.push_back(d);
1002 };
1003
1004 const std::string& pb_name = probleme().le_nom().getString();
1005 Nom vide;
1006 const Nom& nom_post = le_nom();
1007 std::string post_name = (nom_post != "neant") && (nom_post != vide) ? nom_post.getString() + "_" : "";
1008
1009 std::string stat_name = pb_name + "_" + post_name + "stat_nb_champs";
1010 add_stat(stat_name, "int");
1011
1012 stat_name = pb_name + "_" + post_name + "stat_tdeb";
1013 add_stat(stat_name, "double");
1014
1015 stat_name = pb_name + "_" + post_name + "stat_tend";
1016 add_stat(stat_name, "double");
1017 }
1018 return data;
1019}
1020
1022{
1023 int bytes = 0;
1025 {
1026 const Schema_Temps_base& sch = mon_probleme->schema_temps();
1027 double temps_courant = sch.temps_courant();
1028 // le test est necessaire pour avoir une ecriture lecture symetrique
1029 if (temps_courant>tstat_deb_)
1030 {
1031 // en mode ecriture special seul le maitre ecrit l'entete
1032 int a_faire,special;
1034 if (a_faire)
1035 {
1036 //On veut retrouver le nom precedent pour relecture des statistiques (format xyz)
1037 Nom mon_ident("Operateurs_Statistique_tps");
1038 mon_ident += probleme().domaine().le_nom();
1039 double temps = probleme().schema_temps().temps_courant();
1040 mon_ident += Nom(temps,"%e");
1041 os << mon_ident << finl;
1042 //On veut retrouver le nom precedent pour relecture des statistiques (format xyz)
1043 os << "Operateurs_Statistique_tps" << finl;
1044 os << nb_champs_stat_ << finl;
1045 os << tstat_deb_ << finl;
1046 os << tstat_dernier_calcul_ << finl ;
1047 }
1049 {
1050 TRUST_2_PDI pdi_interface;
1051 const std::string& pb_name = probleme().le_nom().getString();
1052 Nom vide;
1053 const Nom& nom_post = le_nom();
1054 std::string post_name = (nom_post != "neant") && (nom_post != vide) ? nom_post.getString() + "_" : "";
1055
1056 std::string name = pb_name + "_" + post_name + "stat_nb_champs";
1057 pdi_interface.TRUST_start_sharing(name, &nb_champs_stat_);
1058 name = pb_name + "_" + post_name + "stat_tdeb";
1059 pdi_interface.TRUST_start_sharing(name, &tstat_deb_);
1060 name = pb_name + "_" + post_name + "stat_tend";
1061 pdi_interface.TRUST_start_sharing(name, &tstat_dernier_calcul_);
1062 }
1063
1064 bytes += champs_post_complet_.sauvegarder(os);
1065
1066 if (a_faire) os.flush();
1067 }
1068 }
1069 return bytes;
1070
1071 /////////////////////////////////////////////////////////////////////
1072}
1073
1075{
1076
1077 //Nouvelle formulation
1078 ////////////////////////////////////////////////////////////////////
1079 Cerr << "Postraitement::reprendre() " << finl;
1081 {
1082 Schema_Temps_base& sch = mon_probleme->schema_temps();
1083 double temps_courant = sch.temps_courant();
1084 double tinit = probleme().schema_temps().temps_courant();
1085 if (temps_courant>tstat_deb_)
1086 {
1087
1088 if (nb_champs_stat_!=0)
1089 {
1090 int n;
1091 double tstat_deb_sauv,temps_derniere_mise_a_jour_stats;
1093 {
1094 TRUST_2_PDI pdi_interface;
1095 const std::string& pb_name = probleme().le_nom().getString();
1096 Nom vide;
1097 const Nom& nom_post = le_nom();
1098 std::string post_name = (nom_post != "neant") && (nom_post != vide) ? nom_post.getString() + "_" : "";
1099
1100 pdi_interface.read(pb_name + "_" + post_name + "stat_nb_champs", &n);
1101 pdi_interface.read(pb_name + "_" + post_name + "stat_tdeb", &tstat_deb_sauv);
1102 pdi_interface.read(pb_name + "_" + post_name + "stat_tend", &temps_derniere_mise_a_jour_stats);
1103 }
1104 else
1105 {
1106 Nom bidon;
1107 is >> bidon;
1108 if (bidon=="fin")
1109 {
1110 // Ce test evite un beau segmentation fault a la lecture
1111 // du deuxieme bidon lors d'une sauvegarde/reprise au format binaire
1112 Cerr << "End of the resumption file reached...." << finl;
1113 Cerr << "This file contains no statistics." << finl;
1114 Cerr << "The tinit time of resumption (= " << tinit << " ) must be less" << finl;
1115 Cerr << "than the beginning time, t_deb (= " << tstat_deb_ << " ), of statistics calculation." << finl;
1116 exit();
1117 }
1118 is >> bidon;
1119 is >> n;
1120 is >> tstat_deb_sauv;
1121 is >> temps_derniere_mise_a_jour_stats;
1122 }
1123 // Plusieurs cas possibles:
1124 if (inf_strict(tinit,temps_derniere_mise_a_jour_stats,1.e-5))
1125 {
1126 Cerr << "The initial time " << tinit << " of the resumed calculation is less" << finl;
1127 Cerr << "than the time of the last update of statistics " << temps_derniere_mise_a_jour_stats << finl;
1128 Cerr << "We do not know how to treat this case." << finl;
1129 exit();
1130 }
1131 else if ((!est_egal(tstat_deb_sauv,tstat_deb_)) && (!lserie_))
1132 {
1133 // t_deb est modifie : on refait une statistique sans reprendre dans certains cas
1134 if (inf_strict(tstat_deb_,tinit,1.e-5))
1135 {
1136 Cerr << "You have changed t_deb (old= " << tstat_deb_sauv << " new= " << tstat_deb_ << " ) to make a new statistical computing without resumption" << finl;
1137 Cerr << "but t_deb (= " << tstat_deb_ << " ) is less than tinit (= "<< tinit << " ) : this is not possible." << finl;
1138 exit();
1139 }
1140 Cerr << "We do not resume the statistics and thus the statistics calculation" << finl;
1141 Cerr << "will restart at t_deb=" << tstat_deb_ << finl;
1142
1143 for (auto &itr : champs_post_complet_)
1144 {
1145 if (sub_type(Champ_Gen_de_Champs_Gen, itr.valeur()))
1146 {
1147 const Champ_Gen_de_Champs_Gen& champ_post = ref_cast(Champ_Gen_de_Champs_Gen, itr.valeur());
1148 champ_post.lire_bidon(is);
1149 }
1150 }
1151 }
1152 else // tinit=>temps_derniere_mise_a_jour_stats : on fait la reprise
1153 {
1154 champs_post_complet_.reprendre(is);
1155
1156 // On modifie l'attribut tstat_deb_ et l'attribut t_debut_ des champs
1157 // pour tenir compte de la reprise
1158 tstat_deb_ = tstat_deb_sauv;
1159
1160 for (auto &itr : champs_post_complet_)
1161 {
1162 if (sub_type(Champ_Gen_de_Champs_Gen, itr.valeur()))
1163 {
1164 Champ_Gen_de_Champs_Gen& champ_post = ref_cast(Champ_Gen_de_Champs_Gen, itr.valeur());
1165 champ_post.fixer_tstat_deb(tstat_deb_, temps_derniere_mise_a_jour_stats);
1166 }
1167 }
1168 }
1169 }
1170 else // lecture pour sauter le bloc
1171 {
1173 {
1174 Cerr << finl << "Problem in the resumption " << finl;
1175 Cerr << "PDI format does not require to navigate through file..." << finl;
1176 Process::exit();
1177 }
1178 Motcle tmp;
1179 is >> tmp >> tmp;
1180 int n;
1181 is >> n;
1182 double tstat_deb_sauv,temps_derniere_mise_a_jour_stats;
1183 is >> tstat_deb_sauv;
1184 is >> temps_derniere_mise_a_jour_stats;
1185 Nom bidon;
1186 double dbidon;
1187 DoubleTab tab_bidon;
1188 for (int i=0; i<n; i++)
1189 {
1190 is >> bidon >> bidon;
1191 is >> dbidon;
1192 tab_bidon.jump(is);
1193 }
1194 }
1195 }
1196 }
1197 return 1;
1198
1199
1200 ////////////////////////////////////////////////////////////////////
1201}
1202
1204{
1205 les_sondes_.init_bords();
1206}
1207
1209{
1210 les_sondes_.completer();
1211}
1212
1213/*! @brief Lit le nom des champs a postraiter sur un flot d'entree.
1214 *
1215 * Format:
1216 * {
1217 * ???
1218 * }
1219 *
1220 * @param (Entree& s) un flot d'entree
1221 * @return (int) renvoie toujours 1
1222 * @throws accolade ouvrante attendue
1223 */
1225{
1226 Motcle accolade_ouverte("{");
1227 Motcle accolade_fermee("}");
1228 Motcle motlu;
1229 Motcle motlu2;
1230
1231 if (expect_acco)
1232 {
1233 s >> motlu;
1234 if (motlu != accolade_ouverte)
1235 Process::exit("We expected { to start to read the fields of postprocessing with the simplified syntax");
1236 }
1237 s >> motlu;
1238
1239 Noms liste_noms;
1240 mon_probleme->get_noms_champs_postraitables(liste_noms);
1241 //Cerr<<"liste_noms="<<liste_noms<<finl;
1242 while (motlu != accolade_fermee)
1243 {
1244 // GF pour tester le creer_champ
1245 for (int i=0; i<liste_noms.size()*0; i++)
1246 {
1247 Motcle toto(liste_noms[i]);
1248 mon_probleme->creer_champ(toto);
1249 Cerr<<" get "<<toto<<" ";
1250 Cerr<<mon_probleme->get_champ(toto)<<finl;
1251 }
1252
1253 Nom expression;
1254 int is_champ_predefini = probleme().expression_predefini(motlu,expression);
1255 if ((is_champ_predefini) && (!comprend_champ_post(motlu)))
1256 {
1258 Entree_complete s_complete(expression,s);
1259 s_complete>>champ;
1260 complete_champ(champ,motlu);
1261 }
1262
1263 s>>motlu2;
1264 //TODO DG may be temporary ?
1265 Probleme_base& le_pb = mon_probleme.valeur();
1266 if (le_pb.domaine_dis().que_suis_je() == "Domaine_DG")
1267 {
1268 if (motlu2!="elem")
1269 {
1270 Cerr << "Error in Postreatment\n"
1271 << "with DG the only possible localisation to postprocessed field is \"elem\"" << finl;
1272 exit();
1273 }
1274 }
1275
1276 if ((motlu2=="elem") || (motlu2=="som") || (motlu2=="faces"))
1277 {
1278 //Prise en compte des pb_med
1279 if (mon_probleme->que_suis_je()!="Pb_MED")
1280 creer_champ_post(motlu,motlu2,s);
1281 else
1282 creer_champ_post_med(motlu,motlu2,s);
1283
1284 s>>motlu;
1285 }
1286 else
1287 {
1288
1289 //On teste la distinction entre un Champ_Generique_base a creer par macro (sans som specifie)
1290 //et l ajout d un Champ_Generique_base deja cree (existant dans champs_post_complet_)
1291 //On va tester si le motlu correpond au nom d un champ porte par le probleme
1292 //Si c est le cas on cree un Champ_Generique_base par macro sinon on va recuperer le Champ_Generique_base dans la liste complete
1293 //et on l ajoute dans la liste des champs a postraiter
1294
1295 Motcles mots_compare(liste_noms.size());
1296 for (int i=0; i<liste_noms.size(); i++)
1297 mots_compare[i] = liste_noms[i];
1298
1299 if (mots_compare.contient_(motlu))
1300 creer_champ_post(motlu,"som",s);
1301 else
1302 {
1303 if (motlu=="pas_de_temps")
1304 {
1305 int nb_eq = probleme().nombre_d_equations();
1306 for (int i=0; i<nb_eq; i++)
1307 {
1308 const int nb_morceaux = probleme().equation(i).nombre_d_operateurs();
1309 for (int j=0; j<nb_morceaux; j++)
1310 {
1311 const Motcle& loc = probleme().equation(i).operateur(j).l_op_base().get_localisation_pour_post("stabilite");
1313 creer_champ_post_moreqn("operateur","stabilite",i,j,-1,s);
1314 }
1315 }
1316 }
1317 else if (motlu=="flux_bords" || motlu=="flux_surfacique_bords")
1318 {
1319 int nb_eq = probleme().nombre_d_equations();
1320 for (int i=0; i<nb_eq; i++)
1321 {
1322 // on teste loc par eq juste sur l'op 0
1325
1326 const int nb_morceaux = probleme().equation(i).nombre_d_operateurs_tot();
1327 const Champ_Inc_base& ch_inco = probleme().equation(i).inconnue();
1328 int nb_compo = ch_inco.nb_comp();
1329
1330 int compo;
1331 for (int j=0; j<nb_morceaux; j++)
1332 {
1333 if (j==3)
1334 nb_compo = 1;
1335
1336 for (int comp=0; comp<nb_compo; comp++)
1337 {
1338 if (nb_compo==1)
1339 compo=-1;
1340 else
1341 compo=comp;
1342 creer_champ_post_moreqn("operateur",motlu,i,j,compo,s);
1343 }
1344 }
1345 }
1346 }
1347 else
1348 {
1349 const Champ_Generique_base& champ_op = probleme().get_champ_post(motlu);
1350 const Entity loc_ch_gen = champ_op.get_localisation();
1351 const Nom loc_ch_gen_nom = get_nom_localisation(loc_ch_gen);
1352 add_locs_required_if_not(Motcle(loc_ch_gen_nom));
1353
1354 const Noms nom = champ_op.get_property("nom");
1355 if (noms_champs_a_post_.contient(nom[0]))
1356 {
1357 Cerr << "Postraitement::lire_champs_a_postraiter : duplicate field " << nom[0] << finl;
1358 exit();
1359 }
1360 else
1361 noms_champs_a_post_.add(nom[0]);
1362 }
1363 }
1364
1365 motlu=motlu2;
1366 }
1367 }
1368
1369 return 1;
1370}
1371
1373{
1374 Motcle accolade_ouverte("{");
1375 Motcle accolade_fermee("}");
1376 Motcle motlu,motlu2,motlu3,motlu4,indic_corr;
1377 //Motcle elem("elem");
1378 //Motcle som("som");
1379 indic_corr="non_correlation";
1380 if (expect_acco)
1381 {
1382 s >> motlu;
1383 if (motlu != accolade_ouverte)
1384 {
1385 Cerr << "We expected { to start to read the data to create the statistical fields" << finl;
1386 exit();
1387 }
1388 }
1389
1390 Noms liste_noms;
1391 mon_probleme->get_noms_champs_postraitables(liste_noms);
1392 //Cerr<<"liste_noms="<<liste_noms<<finl;
1393
1394 s >> motlu;
1395
1396 if (motlu == Motcle("t_deb"))
1397 s >> tstat_deb_;
1398 else
1399 {
1400 Cerr << "Error while reading the statistics in the postprocessing" << finl;
1401 Cerr << "We expected the keyword t_deb instead of " << motlu << finl;
1402 exit();
1403 }
1404 s >> motlu;
1405 if (motlu == Motcle("t_fin"))
1406 s >> tstat_fin_;
1407 else
1408 {
1409 Cerr << "Error while reading the statistics in the postprocessing" << finl;
1410 Cerr << "We expected the keyword t_fin instead of " << motlu << finl;
1411 exit();
1412 }
1413
1414 s >> motlu;
1415
1416 while (motlu != accolade_fermee)
1417 {
1418 s>>motlu2;
1419 s>>motlu3;
1420
1421 if (motlu!="correlation")
1422 {
1423 if ((motlu3=="elem") || (motlu3=="som") || (motlu3=="faces"))
1424 {
1425 creer_champ_post_stat(motlu2,motlu3,motlu,indic_corr,tstat_deb_,tstat_fin_,s);
1426 s>>motlu;
1427 }
1428 else
1429 {
1430 creer_champ_post_stat(motlu2,"som",motlu,indic_corr,tstat_deb_,tstat_fin_,s);
1431 motlu=motlu3;
1432 }
1433 }
1434 else
1435 {
1436 s>>motlu4;
1437 if ((motlu4=="elem") || (motlu4=="som") || (motlu4=="faces"))
1438 {
1439 creer_champ_post_stat(motlu2,motlu4,motlu,motlu3,tstat_deb_,tstat_fin_,s);
1440 s>>motlu;
1441 }
1442 else
1443 {
1444 creer_champ_post_stat(motlu2,"som",motlu,motlu3,tstat_deb_,tstat_fin_,s);
1445 motlu=motlu4;
1446 }
1447 }
1448 nb_champs_stat_ += 1;
1449 }
1450
1451 return 1;
1452}
1453
1454
1455/*! @brief On recherche les champs statistiques dans les sources du champ courant
1456 *
1457 */
1459{
1460 if (sub_type(Champ_Generique_Statistiques_base,ch))
1461 {
1462 // Activer pour lancer la sauvegarde et la reprise des statistiques
1465 if (tstat_deb_>-1 && champ_stat.tstat_deb()!=tstat_deb_)
1466 {
1467 Cerr << "Error, the advanced field " << nom << " has a t_deb= " << champ_stat.tstat_deb() << finl;
1468 Cerr << "Whereas another advanced field has t_deb= " << tstat_deb_ << finl;
1469 Cerr << "You can't use different t_deb in a same post-processing block for the moment." << finl;
1470 Cerr << "Tip: add a new post-processing block for your advanced fields with different t_deb value." << finl;
1471 Process::exit();
1472 }
1473 tstat_deb_ = champ_stat.tstat_deb();
1474 tstat_fin_ = champ_stat.tstat_fin();
1475 }
1476 else
1477 for (int i=0; i<ch.get_nb_sources(); i++)
1478 {
1479 const Champ_Generique_base& source = ch.get_source(i);
1480 if (sub_type(Champ_Gen_de_Champs_Gen,source))
1481 {
1482 const Champ_Gen_de_Champs_Gen& champ_post = ref_cast(Champ_Gen_de_Champs_Gen,source);
1483 cherche_stat_dans_les_sources(champ_post,nom);
1484 }
1485 }
1486 return 1;
1487}
1488
1489/*! @brief Lit les champs a postraiter sur un flot d'entree.
1490 *
1491 */
1493{
1494 Motcle accolade_ouverte("{");
1495 Motcle accolade_fermee("}");
1496 Motcle motlu;
1498
1499 s>>motlu;
1500 if (motlu != accolade_ouverte)
1501 {
1502 Cerr << "We expected { to start to read the postprocessing fields" << finl;
1503 exit();
1504 }
1505 s>>motlu;
1506
1507 Nom expression;
1508 int is_champ_predefini = probleme().expression_predefini(motlu,expression);
1509
1510 if (is_champ_predefini)
1511 {
1512 Cerr<<"The name "<<motlu<<" of a post-processing field of the problem "<<probleme().le_nom()<<finl;
1513 Cerr<<"is identical to the name of one of this problem pre-defined post-processing fields."<<finl;
1514 Cerr<<"Please change the name of this post-processing field."<<finl;
1515 exit();
1516 }
1517 while (motlu != accolade_fermee)
1518 {
1519 Cerr <<"Reading definition of field "<<motlu<<finl;
1520 s>>champ;
1521 complete_champ(champ,motlu);
1522 s>>motlu;
1523 }
1524
1525 return 1;
1526}
1527
1529{
1530
1531 if (sub_type(Champ_Gen_de_Champs_Gen,champ))
1532 {
1533 const Champ_Gen_de_Champs_Gen& champ_post = ref_cast(Champ_Gen_de_Champs_Gen,champ);
1534 cherche_stat_dans_les_sources(champ_post,motlu);
1535 if (sub_type(Champ_Generique_Statistiques_base,champ_post))
1536 nb_champs_stat_ += 1;
1537 }
1538 champ.nommer(motlu);
1539 //On teste le nom du champ et de ses sources si elles ont ete specifiees par l utilisateur
1540 //Methode suivante a reviser ou a ne pas utiliser
1542
1543 OWN_PTR(Champ_Generique_base)& champ_a_completer = champs_post_complet_.add_if_not(champ);
1544 champ_a_completer->completer(*this);
1545}
1546
1548{
1549 Motcle accolade_ouverte("{");
1550 Motcle accolade_fermee("}");
1551 Motcle motlu;
1552 Nom nom_tab;
1553
1554 s >> motlu;
1555 if (motlu != accolade_ouverte)
1556 {
1557 Cerr << "We expected { to start to read the postprocessing data" << finl;
1558 exit();
1559 }
1560
1561 s >> nom_tab;
1562 motlu = nom_tab;
1563 while (motlu != accolade_fermee)
1564 {
1565 // Recherche du tableau a postraiter
1566 OBS_PTR(IntVect) ch_tab;
1567 Noms liste_noms;
1568 mon_probleme->get_noms_champs_postraitables(liste_noms);
1569
1570 ////if (mon_probleme->comprend_mot(motlu))
1571 //if (liste_noms.contient(motlu))
1572 for (int i=0; i<liste_noms.size(); i++)
1573 if (liste_noms[i]==motlu)
1574 {
1575 if (mon_probleme->a_pour_IntVect(motlu,ch_tab))
1576 {
1577 noms_tableaux_.add(nom_tab);
1578 tableaux_a_postraiter_.add(ch_tab);;
1579 }
1580 else
1581 {
1582 Cerr << "The problem do not have the array " << motlu << finl;
1583 exit();
1584 }
1585 }
1586
1587 else if (i==liste_noms.size()-1)
1588 {
1589 Cerr << "The problem does not understand the word " << motlu << finl;
1590 exit();
1591 }
1592 s >> nom_tab;
1593 motlu = nom_tab;
1594 }
1595 return 1;
1596}
1597
1598// E Saikali : on ajoute cette liste qui est utile pour un probleme couple
1599// dans le cas ou on ecrit sur le meme domaine
1600static Noms liste_dom_ecrit;
1601
1602/*! @brief Initialise le postraitement.
1603 *
1604 * Cree le fichier associe au postraitement, ecrit
1605 * des infos sur TrioU. Ecrit le probleme sur
1606 * le fichier.
1607 *
1608 */
1610{
1613 Schema_Temps_base& sch = mon_probleme->schema_temps();
1614 double temps_courant = sch.temps_courant();
1615 double tinit = sch.temps_init();
1616
1617 const Domaine& dom=le_domaine_.valeur();
1618 const Nom& nom_du_domaine = dom.le_nom();
1619 Nom name=nom_fich().prefix(format_);
1620 name.prefix(".");
1621
1623 {
1624 int reprise = mon_probleme->reprise_effectuee();
1625 format_post_->modify_file_basename(name, reprise && est_le_premier_postraitement_pour_nom_fich_, tinit);
1626 format_post_->ecrire_entete(temps_courant, reprise, est_le_premier_postraitement_pour_nom_fich_);
1627 format_post_->preparer_post(nom_du_domaine, est_le_premier_postraitement_pour_nom_fich_, reprise, tinit);
1628 }
1629 ////////////////////////////////////////////////////////////////////////
1630
1631 // S'il existe un champ a postraiter aux faces, on stocke ici une ref au domaine dis base du champ
1632 // PQ : 13/06/13 : mis en attribut de la classe pour gerer les champs FACES en maillage deformable
1633
1634 {
1635 Nom le_nom_champ_post;
1636 for (auto& itr : noms_champs_a_post_)
1637 {
1638 const Nom& nom_post = itr;
1639 const OBS_PTR(Champ_Generique_base)& champ = get_champ_post(nom_post);
1640
1641 int indic_correlation=0;
1642 if ((sub_type(Champ_Gen_de_Champs_Gen,champ.valeur())))
1643 {
1644 const Champ_Gen_de_Champs_Gen& champ_post = ref_cast(Champ_Gen_de_Champs_Gen,champ.valeur());
1645 if (sub_type(Champ_Generique_Correlation,champ_post.get_source(0)))
1646 indic_correlation=1;
1647 }
1648
1649 if (!indic_correlation)
1650 {
1651 Entity loc = champ->get_localisation();
1652 const Nom loc_post = get_nom_localisation(loc);
1653 const Noms nom = champ->get_property("nom");
1654 const Noms composantes = champ->get_property("composantes");
1655
1656 const bool can_not_post_at_faces = Motcle(loc_post) == "FACES" &&
1657 Motcle(format_).debute_par("lata") == 0 &&
1658 Motcle(format_).debute_par("med") == 0 &&
1659 Motcle(format_) != "CGNS" &&
1660 Motcle(format_).debute_par("xyz") == 0;
1661
1662 if (can_not_post_at_faces)
1663 {
1664 Cerr<<"The field "<<nom[0]<<" can not be postprocessed to the faces in the format "<<format_<<finl;
1665 Cerr<<"The postprocessing to the faces is allowed only in the format lata or med"<<finl;
1666 exit();
1667 }
1668 // PL: Ajout automatique du postraitement aux faces pour PolyMAC_HFV seul, sinon doit etre specifie par FACES
1669 if (Motcle(loc_post) == "FACES" || champ->get_discretisation().is_poly_family())
1670 {
1671 OBS_PTR(Domaine_dis_base) ref_domaine_dis = champ->get_ref_domaine_dis_base();
1672 if (ref_domaine_dis)
1673 domaine_dis_pour_faces_ = ref_domaine_dis;
1674 }
1675 if (Motcle(nom_post)== Motcle(nom[0]))
1676 {
1677 le_nom_champ_post = nom[0];
1678 }
1679 else
1680 {
1681 const Noms& noms_comp = composantes;
1682 int n = noms_comp.size();
1683 for (int i=0; i<n; i++)
1684 if (Motcle(nom_post)==Motcle(noms_comp[i]))
1685 le_nom_champ_post = noms_comp[i];
1686 }
1687
1688
1689 // il n'existe pas d'interpolation aux faces pour les champs qui ne sont pas naturellement localises aux faces
1690 // test pour gerer la problematique du post-traitement aux faces non pris en compte
1691 Nom nomposttmp(le_nom_champ_post) ;
1692 Nom& locpostjdd=nomposttmp.prefix(nom_du_domaine);
1693 locpostjdd.prefix("_");
1694 if (locpostjdd.finit_par("FACES") && Motcle(loc_post) != "FACES")
1695 {
1696 Cerr<<"The field "<< le_nom_champ_post <<" can not be postprocessed to the faces because this interpolation is not implemented in the code." <<finl;
1697 Cerr<<"The postprocessing to the faces is allowed only for the field naturally localized at the faces."<<finl;
1698 exit();
1699 }
1700 OWN_PTR(Champ_base) espace_stockage;
1701 const Champ_base& champ_ecriture = champ->get_champ_without_evaluation(espace_stockage);
1702 const Nature_du_champ& nature = champ_ecriture.nature_du_champ();
1703 const int nb_compo = champ_ecriture.nb_comp();
1704 format_post_->completer_post(dom,axi,nature,nb_compo,composantes,loc_post,le_nom_champ_post);
1705 }
1706 }
1707 }
1708
1709 const Nom token = nom_du_domaine+"_"+nom_fich_; // format est deja dans nom_fich_ (xxx.lml, lata ou med)
1710 const bool already_written_domain = liste_dom_ecrit.contient_(token);
1711
1712 ////////////////////////////////////////////////////////////////////
1713 // If domain is not time dependant, we write it in the ::init() method
1714 // else we write it at each postraiter_champs() call
1715 // PL: On ecrit le domaine que si le postraitement des champs est demande
1716 if(!dom.deformable() && besoin_postraiter_champs() && !already_written_domain)
1717 {
1718 liste_dom_ecrit.add(token); // on ajoute dans la liste !
1719 format_post_->ecrire_domaine_dis(dom,domaine_dis_pour_faces_,est_le_premier_postraitement_pour_nom_fich_);
1720 // domaine_dis_pour_faces non_nul() si on demande un postraitement d'un champ aux faces:
1721 if (domaine_dis_pour_faces_ && Motcle(format_) != "LML")
1722 {
1723 const Domaine_VF& domaine_vf = ref_cast(Domaine_VF, domaine_dis_pour_faces_.valeur());
1724 const IntTab& faces_sommets = domaine_vf.face_sommets();
1725 const int nb_sommets = dom.nb_som();
1726 const int nb_faces = faces_sommets.dimension(0);
1727 format_post_->ecrire_item_int("FACES", /* Identifiant */
1728 dom.le_nom(),
1729 dom.le_nom(),
1730 "FACES", /* localisation */
1731 "SOMMETS", /* reference */
1732 faces_sommets,
1733 nb_sommets);
1734
1735 const IntTab& elem_faces = domaine_vf.elem_faces();
1736 format_post_->ecrire_item_int("ELEM_FACES", /* Identifiant */
1737 dom.le_nom(),
1738 dom.le_nom(),
1739 "ELEMENTS", /* localisation */
1740 "FACES", /* reference */
1741 elem_faces,
1742 nb_faces);
1743
1744 }
1745 }
1746
1747 dernier_temps_=mon_probleme->schema_temps().temps_init();
1748 format_post_->modify_file_basename(name,/*for_restart=*/false ,tinit);
1749}
1750
1751
1752/*! @brief Finalise le postraitement Ferme le fichier associe.
1753 *
1754 */
1756{
1757 // Fermeture du fichier si le postraitement des champs etait demande
1759 {
1761 Nom name=nom_fich().prefix(format_);
1762 name.prefix(".");
1763 format_post_->modify_file_basename(name,mon_probleme->reprise_effectuee(),-1);
1764 }
1765 les_sondes_.fermer_fichiers();
1766 les_sondes_int_.fermer_fichiers();
1767 liste_dom_ecrit.clear();
1768}
1769
1770/*! @brief Effectue le postraitement des Champs de facon imperative.
1771 *
1772 * Mets a jour les champs crees.
1773 *
1774 * @return (int) renvoie toujours 1
1775 */
1777{
1778 double temps_courant = mon_probleme->schema_temps().temps_courant();
1779 const Domaine& dom=le_domaine_.valeur();
1780
1781 if (temps_ < temps_courant)
1782 {
1784 format_post_->ecrire_temps(temps_courant);
1785 }
1786 // We write the time dependant domain here. PL: we write only if fields list is not empty
1787 if (dom.deformable() && besoin_postraiter_champs())
1788 {
1789 format_post_->ecrire_domaine_dis(dom,domaine_dis_pour_faces_,est_le_premier_postraitement_pour_nom_fich_);
1790
1791 if (domaine_dis_pour_faces_)
1792 {
1793 const Domaine_VF& domaine_vf = ref_cast(Domaine_VF, domaine_dis_pour_faces_.valeur());
1794 const IntTab& faces_sommets = domaine_vf.face_sommets();
1795 const int nb_sommets = dom.nb_som();
1796 const int nb_faces = faces_sommets.dimension(0);
1797 format_post_->ecrire_item_int("FACES", /* Identifiant */
1798 dom.le_nom(),
1799 dom.le_nom(),
1800 "FACES", /* localisation */
1801 "SOMMETS", /* reference */
1802 faces_sommets,
1803 nb_sommets);
1804
1805 const IntTab& elem_faces = domaine_vf.elem_faces();
1806 format_post_->ecrire_item_int("ELEM_FACES", /* Identifiant */
1807 dom.le_nom(),
1808 dom.le_nom(),
1809 "ELEMENTS", /* localisation */
1810 "FACES", /* reference */
1811 elem_faces,
1812 nb_faces);
1813
1814 }
1815 }
1816
1817 write_extra_mesh(); // For FT for example, this will write INTERFACES.
1818
1819 format_post_->init_ecriture(temps_courant,temps_,est_le_premier_postraitement_pour_nom_fich_,dom);
1820
1821 if (temps_ < temps_courant)
1822 temps_=temps_courant;
1823
1825
1826 format_post_->finir_ecriture(temps_courant);
1827 return 1;
1828}
1829
1831{
1832 double temps_courant = mon_probleme->schema_temps().temps_courant();
1833 const Domaine& dom=le_domaine_.valeur();
1834
1835 for (auto& itr : noms_champs_a_post_)
1836 {
1837 const Champ_Generique_base& champ = get_champ_post(itr);
1838
1839 //Etape de calcul
1840 //Le champ cree est rendu dans champ_ecriture
1841
1842 OWN_PTR(Champ_base) espace_stockage;
1843 const Champ_base& champ_ecriture = champ.get_champ(espace_stockage);
1844
1845 DoubleTab val_vec;
1846
1847 const bool isChamp_Face_PolyMAC_CDO = (champ_ecriture.que_suis_je().debute_par("Champ_Face_PolyMAC") ||
1848 champ_ecriture.que_suis_je().debute_par("Champ_Fonc_Face_PolyMAC"));
1849
1850 /* XXX Elie SAIKALI : champ vect aux faces seulement pour post et si CGNS */
1851 const bool isChamp_Face_VDF_CGNS = (Motcle(format_) == "CGNS") &&
1852 champ_ecriture.nature_du_champ() == vectoriel && // sinon flux_bords VDF par exemple !
1853 (champ_ecriture.que_suis_je() == ("Champ_Face") ||
1854 champ_ecriture.que_suis_je() == ("Champ_Fonc_Face"));
1855
1856 if (isChamp_Face_VDF_CGNS || isChamp_Face_PolyMAC_CDO)
1857 champ_ecriture.valeur_aux_faces_post(val_vec); /* valeur_aux_faces pour Polys */
1858
1859 const DoubleTab& valeurs_post = (isChamp_Face_VDF_CGNS || isChamp_Face_PolyMAC_CDO) ? val_vec : champ_ecriture.valeurs();
1860
1861 //Etape de recuperation des informations specifiques au champ a postraiter
1862 Entity loc = champ.get_localisation();
1863 const Nom localisation = get_nom_localisation(loc);
1864 const Noms nom_post = champ.get_property("nom");
1865 const Noms& unites = champ.get_property("unites");
1866 const Noms& noms_compo = champ.get_property("composantes");
1867 int tenseur = champ.get_info_type_post();
1868
1869 //Etape pour savoir si on doit postraiter un champ ou une de ses composantes
1870
1871 int ncomp = Champ_Generique_base::composante(itr,nom_post[0],noms_compo,champ.get_property("synonyms"));
1872
1873 //La distinction du type de postraitement (tableau ou tenseur) est fait dans la methode postraiter par la valeur de tenseur
1874 Nom nature("scalar");
1875 if (champ_ecriture.is_vectorial()) nature="vector";
1876 postraiter(dom,unites,noms_compo,ncomp,temps_courant,itr,localisation,nature,valeurs_post,tenseur);
1877 }
1878}
1879
1881{
1882 double temps_courant = mon_probleme->schema_temps().temps_courant();
1883 const Domaine& dom=le_domaine_.valeur();
1884
1885 //Methode ecrire_item_int codee uniquement pour les formats lml et lata
1886 //Sans doute pas testee par les cas de non regression
1887 //Signature a revoir (supprimer id_domaine)
1888
1889 //Si codage de la methode pour meshtv, ajouter init_ecriture() et finir_ecriture()
1890
1891 if (temps_ < temps_courant)
1892 {
1893 temps_=temps_courant;
1895 format_post_->ecrire_temps(temps_courant);
1896 }
1897
1898 auto& list1 = tableaux_a_postraiter_.get_stl_list();
1899 auto& list2 = noms_tableaux_.get_stl_list();
1900
1901 auto itr2 = list2.begin();
1902
1903 for (auto& itr1 : list1)
1904 {
1905 const Nom& id_item = *itr2;
1906 const Nom& id_du_domaine = dom.le_nom();
1907 const Nom& id_domaine = dom.le_nom();
1908 const Nom localisation="";
1909 const Nom reference="";
1910 const IntVect& val = itr1.valeur();
1911 const int ref_size =0;
1912
1913 format_post_->ecrire_item_int(id_item,id_du_domaine,id_domaine,localisation,reference,val,ref_size);
1914
1915 ++itr2;
1916 }
1917 return 1;
1918}
1919
1920/*! @brief Effectue le postraitement des Champs si cela est necessaire.
1921 *
1922 * @return (int) renvoie toujours 1
1923 */
1925{
1926 Schema_Temps_base& sch = mon_probleme->schema_temps();
1927 double temps_courant = sch.temps_courant();
1928 int nb_pas_dt = sch.nb_pas_dt();
1929 int ind_pas_dt_post = ind_post(nb_pas_dt);
1930
1931 if (lpost(temps_courant, dt_post_)|| ind_pas_dt_post)
1932 {
1934 if (!ind_pas_dt_post)
1935 {
1936 fdt_post_.setVar("t",temps_courant);
1937 dt_post_ = fdt_post_.eval();
1938 }
1939 }
1940 return 1;
1941}
1942
1944{
1946 double temps_courant = sch.temps_courant();
1947 if ( lpost(temps_courant, dt_post_) )
1949 return 1;
1950}
1951
1952/*! @brief Effectue le postraitement lie au sondes de facon imperative.
1953 *
1954 * @return (int) renvoie toujours 1
1955 */
1957{
1958 les_sondes_.postraiter();
1959 les_sondes_int_.postraiter(mon_probleme->schema_temps().temps_courant());
1960 return 1;
1961}
1962
1963/*! @brief Mets a jour (en temps) le sondes.
1964 *
1965 * @return (int) renvoie toujours 1
1966 */
1968{
1969 double temps=mon_probleme->schema_temps().temps_courant();
1970 double tinit=temps-mon_probleme->schema_temps().temps_calcul();
1971 les_sondes_.mettre_a_jour(temps,tinit);
1972 return 1;
1973}
1974
1975int Postraitement::postraiter(const Domaine& dom,const Noms& unites,const Noms& noms_compo,const int ncomp,
1976 const double temps,
1977 Nom nom_post,const Nom& localisation,const Nom& nature,const DoubleTab& valeurs,int tenseur)
1978
1979{
1980 if (!tenseur)
1981 postraiter_tableau(dom,unites,noms_compo,ncomp,temps,nom_post,localisation,nature,valeurs);
1982 else
1983 postraiter_tenseur(dom,unites,noms_compo,ncomp,temps,nom_post,localisation,nature,valeurs);
1984
1985 return 1;
1986}
1987
1988int Postraitement::postraiter_tableau(const Domaine& dom,const Noms& unites,const Noms& noms_compo,const int ncomp,
1989 const double temps,
1990 Nom nom_post,const Nom& localisation,const Nom& nature,const DoubleTab& tab_valeurs)
1991{
1992 const Nom& id_du_domaine = dom.le_nom();
1993 const Nom& id_champ_ecrit = nom_post;
1994
1995 const int size = tab_valeurs.dimension(0);
1996 const int N = tab_valeurs.line_size();
1997 DoubleTrav val_post_ecrit(size, ncomp == -1 ? N : 1);
1998 if (tab_valeurs.isDataOnDevice())
1999 {
2000 CDoubleTabView valeurs = tab_valeurs.view_ro();
2001 DoubleTabView val_post = val_post_ecrit.view_wo();
2002 Kokkos::parallel_for(start_gpu_timer(__KERNEL_NAME__), size, KOKKOS_LAMBDA(
2003 const int i)
2004 {
2005 if (ncomp == -1)
2006 for (int j = 0; j < N; j++)
2007 val_post(i, j) = valeurs(i, j);
2008 else
2009 val_post(i, 0) = valeurs(i, ncomp);
2010 });
2011 end_gpu_timer(__KERNEL_NAME__);
2012 }
2013 else
2014 {
2015 for (int i = 0; i < size; i++)
2016 if (ncomp == -1)
2017 for (int j = 0; j < N; j++)
2018 val_post_ecrit(i, j) = tab_valeurs(i, j);
2019 else
2020 val_post_ecrit(i, 0) = tab_valeurs(i, ncomp);
2021 }
2022
2023 format_post_->ecrire_champ(dom,unites,noms_compo,ncomp,temps,id_champ_ecrit,id_du_domaine,localisation,nature,val_post_ecrit);
2024 return 1;
2025}
2026
2027int Postraitement::postraiter_tenseur(const Domaine& dom,const Noms& unites,const Noms& noms_compo,const int ncomp,
2028 const double temps,
2029 Nom nom_post,const Nom& localisation,const Nom& nature,const DoubleTab& valeurs)
2030{
2031
2032 int nb_comp = noms_compo.size();
2033 for (int comp=0; comp<nb_comp; comp++)
2034 postraiter_tableau(dom,unites,noms_compo,comp,temps,noms_compo[comp],localisation,nature,valeurs);
2035 return 1;
2036}
2037
2039 const Motcle& motlu3,const Motcle& motlu4,
2040 const int trouve)
2041{
2042 Nom ajout("");
2043 if (motlu2 == "natif" || (motlu2 == "faces" && motlu3 == ""))
2044 {
2045 if (!trouve)
2046 {
2047 ajout += " refChamp { Pb_champ ";
2048 ajout += probleme().le_nom();
2049 ajout += " ";
2050 ajout += motlu1;
2051 ajout += " }";
2052 }
2053 }
2054 else
2055 {
2056 ajout = "Interpolation { localisation ";
2057 if (mon_probleme.valeur().domaine_dis().que_suis_je() == "Domaine_DG")
2058 ajout += " elem_DG ";
2059 else
2060 ajout += motlu2;
2061
2062 if (motlu3=="Moyenne")
2063 ajout += " source Moyenne { ";
2064 else if (motlu3=="Ecart_type")
2065 ajout += " source Ecart_Type { ";
2066 else if (motlu3=="Correlation")
2067 ajout += " source correlation { ";
2068
2069 if (trouve==1)
2070 {
2071 ajout += " sources_reference { ";
2072 ajout += motlu1;
2073 ajout += " } }";
2074 }
2075 else
2076 {
2077 if (motlu3!="Correlation")
2078 ajout += " source ";
2079 else
2080 ajout += " sources { ";
2081 ajout += " refChamp { Pb_champ ";
2082 ajout += probleme().le_nom();
2083 ajout += " ";
2084 ajout += motlu1;
2085 ajout += " } ";
2086
2087 if (motlu3!="Correlation")
2088 ajout += " } ";
2089 else
2090 {
2091 ajout += " , ";
2092 ajout += " refChamp { Pb_champ ";
2093 ajout += probleme().le_nom();
2094 ajout += " ";
2095 ajout += motlu4;
2096 ajout += " } ";
2097 ajout += " } } ";
2098 }
2099
2100 if ((motlu3=="Moyenne") || (motlu3=="Ecart_type") || (motlu3=="Correlation"))
2101 ajout += " } ";
2102 }
2103
2104 }
2105 return ajout;
2106}
2107
2109{
2110 Motcle var(format_);
2111 if (var == "CGNS")
2112 {
2113 var = motlu2;
2114
2115 if (var == "FACE") var = "FACES"; /* lol pour flux vef .... */
2116
2117 if (var != "FACES" && var != "SOM" && var != "ELEM")
2118 {
2119 Cerr << "What ??? Error in Postraitement::add_locs_required_if_not" << finl;
2120 Cerr << "CGNS understands only ELEM, SOM or FACES !!! Not " << var << finl;;
2121 Process::exit();
2122 }
2123
2124 if(std::find(locs_required_.begin(), locs_required_.end(), var.getString()) == locs_required_.end())
2125 locs_required_.push_back(var.getString()); // add only if not inside
2126 }
2127}
2128
2129//Creation d un champ generique en fonction des parametres qui sont passes a la methode
2130//Cette methode a pour objectif de pouvoir utiliser l ancienne syntaxe dans le jeu de donnees
2131//pour lancer la requete d un champ a postraiter (ex : vitesse elem) mais aussi generer un
2132//champ generique pour creer une sonde d 'un champ discret du probleme
2133//
2134//Les etapes sont les suivantes :
2135// -creation d une chaine de caracteres pour indiquer le type de champ generique a creer
2136// -lecture du champ generique
2137// -association du domaine au champ et creation d un domaine discretise si le domaine n est pas celui du calcul
2138// -le champ est nomme
2139// -les sources sont nommees (sauf si creation d un Champ_Generique_refChamp)
2140// et les composantes sont fixees (permet de tester la non regression avec format lml)
2141// -le champ est ajoute a la liste champs_post_complet_
2142// -l identifiant du champ est ajoute a la liste noms_champs_a_post_
2143//
2144//-motlu2 = "natif" : creation d un Champ_Generique_refChamp (utilise pour les sondes)
2145// refChamp { Pb_champ "nom_du_pb" "nom_du_champ" }
2146// (nom_du_champ=motlu1)
2147
2148//-sinon creation d un Champ_Generique_Interpolation
2149// Interpolation { localisation "loc"
2150// source refChamp { Pb_champ "nom_du_pb" "nom_du_champ" }
2151// }
2152// (loc=motlu2 nom_du_champ=motlu1)
2153
2154void Postraitement::creer_champ_post(const Motcle& motlu1,const Motcle& motlu2,Entree& s)
2155{
2157 Nom ajout;
2158 Nom nom_champ, nom_champ_a_post;
2159
2160 //Le postraitement aux faces concerne actuellement les champs dont la discretisation "natif" est aux faces
2161 //On construit dans ce cas la un Champ_Generique_refChamp
2162
2163 // XXX Elie SAIKALI : its better to know what we will have as locations ( pas natif declare dans les sondes lol)
2164 if (motlu2 != "NATIF")
2166
2167 // on essaye avant dans les champs_posts...
2168 int trouve=comprend_champ_post(motlu1);
2169
2170 if ((trouve) && ((motlu2=="natif") || (motlu2=="faces")))
2171 {
2172 ajout="";
2173 noms_champs_a_post_.add_if_not(motlu1);
2174 return;
2175 }
2176
2177 ajout = set_expression_champ(motlu1,motlu2,"","",trouve);
2178
2179 Entree_complete s_complete(ajout,s);
2180 s_complete>>champ;
2181
2182 if (le_domaine_->le_nom()!=mon_probleme->domaine().le_nom() && motlu2=="faces")
2183 {
2184 Cerr << "Post-processing a field on faces on a different domain (" << le_domaine_->le_nom() << ") than compute domain (" << mon_probleme->domaine().le_nom() << ") is not supported yet !" << finl;
2185 Cerr << "Switch to som or elem post-processing or post-process on the compute domain." << finl;
2186 Process::exit();
2187 }
2188 //if ((le_domaine->le_nom()!=mon_probleme->domaine().le_nom()) && ((motlu2!="natif"))) {
2189 if (sub_type(Champ_Generique_Interpolation,champ.valeur()))
2190 {
2191 Champ_Generique_Interpolation& champ_interp = ref_cast(Champ_Generique_Interpolation,champ.valeur());
2192 champ_interp.set_domaine(le_domaine_->le_nom());
2193 // champ_interp.discretiser_domaine(*this);
2194 }
2195
2196 Nom nom_champ_ref;
2197 Noms composantes;
2198 Noms source_compos,source_syno;
2199 if (trouve==0)
2200 {
2201 OBS_PTR(Champ_base) champ_ref;
2202 champ_ref = mon_probleme->get_champ(motlu1);
2203 nom_champ_ref = champ_ref->le_nom();
2204 source_compos = champ_ref->noms_compo();
2205 composantes = champ_ref->noms_compo();
2206 source_syno = champ_ref->get_synonyms();
2207 if ((source_compos.size()==1) && (source_compos[0]==motlu1))
2208 nom_champ_ref=motlu1;
2209 for (int i=0; i<source_syno.size(); i++)
2210 if (source_syno[i]==motlu1)
2211 nom_champ_ref=motlu1;
2212 }
2213 else
2214 {
2215 OBS_PTR(Champ_Generique_base) champ_ref;
2216 champ_ref=get_champ_post(motlu1);
2217 nom_champ_ref = champ_ref->get_nom_post();
2218 source_compos = champ_ref->get_property("composantes");
2219 source_syno = champ_ref->get_property("synonyms");
2220 composantes =source_compos;
2221 }
2222
2223 nom_champ = Motcle(nom_champ_ref)+"_"+motlu2+"_"+le_domaine_->le_nom();
2224 champ->nommer(nom_champ);
2225
2226 //On nomme la source d un Champ_Generique_Interpolation cree par macro (/* XXX Elie SAIKALI : aussi si champ aux faces et format CGNS */)
2227 if (sub_type(Champ_Generique_Interpolation,champ.valeur()) || (motlu2 == "FACES" && Motcle(format_) == "CGNS"))
2228 {
2229 if (motlu2 != "FACES")
2230 {
2231 Champ_Generique_Interpolation& champ_post = ref_cast(Champ_Generique_Interpolation, champ.valeur());
2232 champ_post.nommer_sources(*this);
2233 }
2234
2235 const Nom& nom_dom = champ->get_ref_domain().le_nom();
2236 const int nb_comp = source_compos.size();
2237 Noms compo(nb_comp);
2238 Nom loc;
2239
2240 if (motlu2 == "ELEM")
2241 loc = "elem";
2242 else if (motlu2 == "SOM")
2243 loc = "som";
2244 else if (motlu2 == "FACES")
2245 loc = "faces";
2246
2247 for (int i = 0; i < nb_comp; i++)
2248 compo[i] = source_compos[i] + "_" + loc + "_" + nom_dom;
2249 champ->fixer_noms_compo(compo);
2250
2251 Noms les_synonyms(source_syno.size());
2252 for (int i = 0; i < source_syno.size(); i++)
2253 les_synonyms[i] = source_syno[i] + "_" + loc + "_" + nom_dom;
2254 champ->fixer_noms_synonyms(les_synonyms);
2255 }
2256
2257 OWN_PTR(Champ_Generique_base)& champ_a_completer = champs_post_complet_.add_if_not(champ);
2258 champ_a_completer->completer(*this);
2259
2260 if (motlu2!="natif")
2261 {
2262 if (motlu2!="faces")
2263 nom_champ_a_post = motlu1+"_"+motlu2+"_"+le_domaine_->le_nom();
2264 else //Dans le cas d une localisation aux faces on test s il s agit d une composante ou du champ
2265 {
2266 int ncomp = Champ_Generique_base::composante(motlu1,nom_champ_ref,composantes,source_syno);
2267 if (ncomp==-1)
2268 nom_champ_a_post = motlu1+"_"+motlu2+"_"+le_domaine_->le_nom();
2269 else
2270 {
2271 //On determine le numero de composante
2272 Nom nume(ncomp);
2273 nom_champ_a_post = nom_champ_ref+"_"+motlu2+"_"+le_domaine_->le_nom()+nume;
2274 }
2275 }
2276 if (noms_champs_a_post_.contient(nom_champ_a_post))
2277 {
2278 Cerr << "Postraitement::lire_champs_a_postraiter : duplicate field " << nom_champ_a_post << finl;
2279 Cerr<<" existing names "<<noms_champs_a_post_<<finl;
2280 exit();
2281 }
2282 else
2283 noms_champs_a_post_.add(nom_champ_a_post);
2284 }
2285}
2286
2287//Creation d un champ generique en fonction des parametres qui sont passes a la methode
2288//Cette methode a pour objectif de pouvoir utiliser l ancienne syntaxe dans le jeu de donnees
2289//pour lancer la requete de statistiques (ex : Moyenne vitesse elem)
2290
2291//Les etapes sont les suivantes :
2292// -creation d une chaine de caracteres pour indiquer le type de champ generique a creer
2293// -lecture du champ generique
2294// -association du domaine au champ et creation d un domaine discretise si le domaine n est pas celui du calcul
2295// -le champ est nomme
2296// -les composantes sont fixees (permet de tester la non regression avec format lml)
2297// -le champ est complete
2298// -le champ est ajoute a la liste champs_post_complet_
2299// -l identifiant du champ est ajoute a la liste noms_champs_a_post_
2300
2301
2302void Postraitement::creer_champ_post_stat(const Motcle& motlu1,const Motcle& motlu2,const Motcle& motlu3,const Motcle&
2303 motlu4,const double t_deb,const double t_fin,Entree& s)
2304{
2306 Nom ajout;
2307 Nom nom_champ;
2308
2309 if (((motlu3=="Moyenne") || (motlu3=="Ecart_type")) || (motlu3=="Correlation"))
2310 {
2311 if (motlu2 != "NATIF")
2313
2314 ajout = set_expression_champ(motlu1,motlu2,motlu3,motlu4,0);
2315 Entree_complete s_complete(ajout,s);
2316 s_complete>>champ;
2317
2318 //if (le_domaine->le_nom()!=mon_probleme->domaine().le_nom()) {
2319 Champ_Generique_Interpolation& champ_interp = ref_cast(Champ_Generique_Interpolation,champ.valeur());
2320 champ_interp.set_domaine(le_domaine_->le_nom());
2321 // champ_interp.discretiser_domaine(*this);
2322 //}
2323
2324 if (motlu3!="Correlation")
2325 nom_champ = motlu3+"_"+motlu1+"_"+motlu2+"_"+le_domaine_->le_nom();
2326 else
2327 nom_champ = motlu3+"_"+motlu1+"_"+motlu4+"_"+motlu2+"_"+le_domaine_->le_nom();
2328
2329 champ->nommer(nom_champ);
2330
2331 //On nomme les sources du Champ_Generique_Interpolation cree par macro
2332 Champ_Generique_Interpolation& champ_post = ref_cast(Champ_Generique_Interpolation,champ.valeur());
2333 champ_post.nommer_sources(*this);
2334
2335 //On fixe l attribut compo_ pour le Champ_Generique_Interpolation cree par cette macro
2337 const Champ_Generique_refChamp& champ_ref = ref_cast(Champ_Generique_refChamp,champ_stat.get_source(0));
2338
2339 OWN_PTR(Champ_base) espace_stockage;
2340 const Champ_base& champ_discret = champ_ref.get_champ(espace_stockage);
2341 const Noms& source_compos = champ_discret.noms_compo();
2342 const Nom& nom_dom = champ_post.get_ref_domain().le_nom();
2343 int nb_comp = source_compos.size();
2344 Noms compo(nb_comp);
2345 Nom loc;
2346 if (motlu2=="ELEM")
2347 loc = "elem";
2348 else if (motlu2=="SOM")
2349 loc = "som";
2350 else if (motlu2=="FACES")
2351 loc = "faces";
2352
2353 for (int i=0; i<nb_comp; i++)
2354 {
2355 if (motlu3=="Moyenne")
2356 {
2357 compo[i] = "Moyenne_";
2358 compo[i] += source_compos[i] +"_"+loc+"_"+nom_dom;
2359 }
2360 else if (motlu3=="Ecart_Type")
2361 {
2362 compo[i] = "Ecart_Type_";
2363 compo[i] += source_compos[i] +"_"+loc+"_"+nom_dom;
2364 }
2365 }
2366
2367 champ_post.fixer_noms_compo(compo);
2368 champ_stat.fixer_tdeb_tfin(t_deb,t_fin);
2369 champ_stat.use_source_name_only(true);
2370 OWN_PTR(Champ_Generique_base)& champ_a_completer = champs_post_complet_.add_if_not(champ);
2371 champ_a_completer->completer(*this);
2372
2373 //On fixe l attribut compo_ pour le Champ_Generique_Interpolation d une correlation cree par cette macro
2374 /////////////////////////////////////////////////////////////
2375 if (motlu3=="Correlation")
2376 {
2377 Champ_Generique_Interpolation& champ_post_corr = ref_cast(Champ_Generique_Interpolation,champ_a_completer.valeur());
2378 const Champ_Generique_Correlation& champ_corr = ref_cast(Champ_Generique_Correlation,champ_post_corr.get_source(0));
2379
2380 const Noms& source_compos_corr = champ_corr.integrale().le_champ_calcule().noms_compo();
2381 // const Nom& nom_dom = champ_post.get_ref_domain().le_nom();
2382 int nb_comp_corr = source_compos_corr.size();
2383 Noms compo_corr(nb_comp_corr);
2384 Nom loc_corr;
2385 if (motlu2=="ELEM")
2386 loc_corr = "elem";
2387 else if (motlu2=="SOM")
2388 loc_corr = "som";
2389 else if (motlu2=="FACES")
2390 loc_corr = "faces";
2391
2392 for (int i=0; i<nb_comp_corr; i++)
2393 {
2394 compo_corr[i] = source_compos_corr[i] +"_"+loc_corr+"_"+nom_dom;
2395
2396 }
2397 champ_post_corr.fixer_noms_compo(compo_corr);
2398
2399 }
2400
2401 //////////////////////////////////////////////////////////////
2402
2403
2404 const Noms nom = champ_a_completer->get_property("nom");
2405 if (noms_champs_a_post_.contient(nom[0]))
2406 {
2407 Cerr << "Postraitement::lire_champs_a_postraiter : duplicate field " << nom[0] << finl;
2408 exit();
2409 }
2410 else
2411 noms_champs_a_post_.add(nom[0]);
2412
2413 }
2414
2415 else
2416 {
2417 Cerr<<"Verify the syntax of the wanted statistical fields for the postprocessing"<<finl;
2418 exit();
2419 }
2420
2421}
2422
2423//Creation d un champ generique en fonction des parametres qui sont passes a la methode
2424//Cette methode a pour objectif de creer un Champ_Generique_base de type Champ_Generique_Morceau_Equation
2425//Les etapes sont les suivantes :
2426// -creation d une chaine de caracteres pour indiquer le type de champ generique a creer
2427// -lecture du champ generique
2428// -le champ est nomme
2429// -le champ est ajoute a la liste champs_post_complet_ et completer
2430// -les sources son nommees
2431// -l identifiant du champ est ajoute a la liste noms_champs_a_post_
2432// -type de champ cree :
2433// Morceau_Equation { type "type_moreqn" numero "numero_moreqn" option "type_option" [ compo "num_compo" ]
2434// source Champ_Post_refChamp { Pb_champ "nom_du_pb" "nom_du_champ" } }
2435//
2436// type disponible : operateur
2437// numero : 0 (diffusion) 1 (convection) [ 2 (gradient) 3 (divergence) pour le cas des "flux_bords" ]
2438// option disponible : stabilite flux_bords
2439//
2440void Postraitement::creer_champ_post_moreqn(const Motcle& type,const Motcle& option,const int num_eq,const int num_morceau,const int compo,Entree& s)
2441{
2443 Nom ajout("");
2444 Nom nom_champ, nom_champ_a_post;
2445 const Champ_Inc_base& ch_inco = mon_probleme->equation(num_eq).inconnue();
2446 const Motcle& nom_inco = ch_inco.le_nom();
2447 Nom nume(num_morceau);
2448
2449 ajout = "Morceau_Equation { type ";
2450 ajout += type;
2451 ajout += " numero ";
2452 ajout += nume;
2453 ajout += " option ";
2454 ajout += option;
2455 if (compo!=-1)
2456 {
2457 Nom numc(compo);
2458 ajout +=" compo ";
2459 ajout += numc;
2460 }
2461 ajout += " source refChamp { Pb_champ ";
2462 ajout += mon_probleme->le_nom();
2463 ajout += " ";
2464 ajout += nom_inco;
2465 ajout += " } }";
2466
2467 Entree_complete s_complete(ajout,s);
2468 s_complete>>champ;
2469
2470 const Motcle& nom_eq = mon_probleme->equation(num_eq).le_nom();
2471
2472 Motcle type_morceau;
2473 //Motcle type_option;
2474 if (type=="operateur")
2475 {
2476 if (num_morceau==0)
2477 type_morceau = "diffusion";
2478 else if (num_morceau==1)
2479 type_morceau = "convection";
2480 else if (num_morceau==2)
2481 type_morceau = "gradient";
2482 else if (num_morceau==3)
2483 type_morceau = "divergence";
2484 else
2485 {
2486 Cerr<<"Only two numbers of operators are available."<<finl;
2487 Cerr<<"0 for the diffusive operator and 1 for the convective operator."<<finl;
2488 exit();
2489 }
2490 }
2491 else
2492 {
2493 Cerr<<"Currently the only pieces of equations considered for the postprocessing"<<finl;
2494 Cerr<<"are of type operator"<<finl;
2495 exit();
2496 }
2497
2498 if (option=="stabilite")
2499 {
2500 nom_champ = nom_eq;
2501 nom_champ += "_";
2502 nom_champ += type_morceau;
2503 nom_champ += "_";
2504 nom_champ += "dt";
2505 }
2506 else if (option=="flux_bords" || option=="flux_surfacique_bords")
2507 {
2508 int nb_op = mon_probleme->equation(num_eq).nombre_d_operateurs();
2509 if (num_morceau >= nb_op)
2510 nom_champ = mon_probleme->equation(num_eq).operateur_fonctionnel(num_morceau-nb_op).l_op_base().fichier();
2511 else
2512 nom_champ = mon_probleme->equation(num_eq).operateur(num_morceau).l_op_base().fichier();
2513 if (compo!=-1)
2514 {
2515 Nom nume2(compo);
2516 nom_champ += nume2;
2517 }
2518 }
2519 champ->nommer(nom_champ);
2520
2521 OWN_PTR(Champ_Generique_base)& champ_a_completer = champs_post_complet_.add_if_not(champ);
2522 champ_a_completer->completer(*this);
2523 Champ_Gen_de_Champs_Gen& champ_post = ref_cast(Champ_Gen_de_Champs_Gen,champ.valeur());
2524 champ_post.nommer_sources(*this);
2525
2526 nom_champ_a_post = nom_champ;
2527 if (noms_champs_a_post_.contient(nom_champ_a_post))
2528 {
2529 Cerr << "Postraitement::lire_champs_a_postraiter : duplicate field " << nom_champ_a_post << finl;
2530 Cerr<<" existing names "<<noms_champs_a_post_<<finl;
2531 exit();
2532 }
2533 else
2534 noms_champs_a_post_.add(nom_champ_a_post);
2535}
2536
2537//Creation d un champ generique en fonction des parametres qui sont passes a la methode
2538//Cette methode a pour objectif de pouvoir utiliser l ancienne syntaxe dans le jeu de donnees
2539//pour les champs d un Pb_MED
2540//
2541//Les etapes sont les suivantes :
2542// -typage du champ generique en Champ_Generique_refChamp
2543// -association de la reference au postraitement (specifique au cas d un Pb_MED)
2544// -creation du Champ_Fonc_Med
2545// -initialisation de la reference au Champ_Fonc_MED et initialisation de la localisation
2546// -le champ est nomme (identifiant+nom_domaine)
2547// -les composantes sont fixees (permet de tester la non regression avec format lml)
2548// -le champ generique est complete
2549// -le champ est ajoute a la liste champs_post_complet_
2550// -l identifiant du champ est ajoute a la liste noms_champs_a_post_
2551
2552void Postraitement::creer_champ_post_med(const Motcle& motlu1,const Motcle& motlu2,Entree& s)
2553{
2554 creer_champ_post(motlu1,motlu2,s);
2555 Motcle test_loc(motlu1);
2556 Motcle loc2("_");
2557 loc2+=motlu2;
2558 Motcle test_loc_bis(test_loc);
2559 test_loc_bis.prefix(loc2);
2560 if (test_loc_bis!=test_loc)
2561 {
2562 Cerr<< "we must change the name "<< motlu1;
2563 //Cerr<<test_loc_bis<< " "<<test_loc<<finl;
2564 int ss=champs_post_complet_.size();
2565 Nom ancien=champs_post_complet_(ss-1)->get_nom_post();
2566 ancien.suffix(test_loc);
2567 //Cerr<<ancien<<" ";
2568 Nom Nouveau(test_loc_bis);
2569 Nouveau+=ancien;
2570 Cerr<<" to " <<Nouveau<<finl;
2571 champs_post_complet_(ss-1)->nommer(Nouveau);
2572 noms_champs_a_post_(noms_champs_a_post_.size()-1)=Nouveau;
2573 }
2574 //int ss=champs_post_complet_.size();
2575 //Cerr<<champs_post_complet_(ss-1)->get_nom_post()<<finl;
2576 //ss=noms_champs_a_post_.size();
2577 //Cerr<<noms_champs_a_post_(ss-1)<<finl; //exit();
2578}
2579
2580int Postraitement::comprend_champ_post(const Motcle& identifiant) const
2581{
2582 for (const auto &itr : champs_post_complet_)
2583 if (itr->comprend_champ_post(identifiant))
2584 return 1;
2585
2586 return 0;
2587}
2588
2590{
2591 for (const auto& itr : champs_post_complet_)
2592 if (itr->has_champ_post(nom))
2593 return true;
2594
2595 return false; /* rien trouve */
2596}
2597
2599{
2600 for (const auto &itr : champs_post_complet_)
2601 if (itr->has_champ_post(nom))
2602 return itr->get_champ_post(nom);
2603
2604 throw std::runtime_error(std::string("Field ") + nom.getString() + std::string(" not found !"));
2605}
2606
2607//Decider de ce que doit faire exactement cette methode ou la supprimer
2609{
2610 Noms liste_noms;
2611 const Probleme_base& Pb = probleme();
2612 Pb.get_noms_champs_postraitables(liste_noms);
2613
2614 Motcles mots_compare(liste_noms.size());
2615 for (int i=0; i<liste_noms.size(); i++)
2616 mots_compare[i] = liste_noms[i];
2617 const Noms nom = champ.get_property("nom");
2618 const Motcle& nom_champ = nom[0];
2619
2620 if (mots_compare.contient_(nom_champ))
2621 {
2622 Cerr<<"The name "<<nom_champ<<" of a post-processing field of the problem "<<Pb.le_nom()<<finl;
2623 Cerr<<"is identical to the name of one of this problem discrete fields."<<finl;
2624 Cerr<<"Please change the name of this post-processing field."<<finl;
2625 exit();
2626 }
2627
2628 if (Pb.comprend_champ_post(nom_champ))
2629 {
2630 Cerr<<"The name "<<nom_champ<<" of a post-processing field of the problem "<<Pb.le_nom()<<finl;
2631 Cerr<<"is identical to the name of another post-processing field, to one of his components or one of his sources."<<finl;
2632 Cerr<<"Please change the name of this post-processing field."<<finl;
2633 exit();
2634 }
2635}
Classe de base des champs generiques ayant comme source d'autres champs generiques L'utilisation des ...
Entity get_localisation(const int index=-1) const override
Renvoie le type des entites geometriques sur auxquelles les valeurs discretes sont attachees (NODE po...
virtual void lire_bidon(Entree &is) const
void nommer_sources(const Postraitement_base &post)
virtual void fixer_tstat_deb(const double t1, const double t2)
virtual const Champ_Generique_base & get_source(int i) const
virtual Champ_Generique_base & set_source(int i)
double get_time() const override
Renvoie le temps du Champ_Generique_base.
virtual void fixer_serie(const double t1, const double t2)
class Champ_Generique_Correlation
const Integrale_tps_Champ & integrale() const override
Un champ generique qui est construit comme une interpolation d'un autre champ generique (interpolatio...
const Noms & fixer_noms_compo(const Noms &noms) override
virtual int set_domaine(const Nom &nom_domaine, int exit_on_error=1)
Initialisation de la classe: initialisation du domaine d'interpolation Parametres valides : "" => dom...
const Domaine & get_ref_domain() const override
Renvoie une ref au domaine sur lequel sera evalue l espace de stockage.
Classe Champ_Generique_Statistiques_base Classe de base des classes de champs generiques dedies aux s...
virtual const Integrale_tps_Champ & integrale() const =0
virtual const Operateur_Statistique_tps_base & Operateur_Statistique() const =0
void fixer_tdeb_tfin(const double t_deb, const double t_fin)
class Champ_Generique_base
virtual const Noms get_property(const Motcle &query) const
Renvoie la propriete demandee.
static int composante(const Nom &nom_test, const Nom &nom, const Noms &composantes, const Noms &synonyms)
virtual const Champ_Generique_base & get_champ_post(const Motcle &nom) const
virtual const Nom & get_nom_post() const
virtual Entity get_localisation(const int index=-1) const
Renvoie le type des entites geometriques sur auxquelles les valeurs discretes sont attachees (NODE po...
Classe de champ particuliere qui encapsule une reference a un champ volumique de TRUST de type Champ_...
const Champ_base & get_champ(OWN_PTR(Champ_base)&espace_stockage) const override
Voir Champ_Generique_base::get_champ.
Classe Champ_Inc_base.
virtual DoubleTab & valeurs()=0
classe Champ_base Cette classe est la base de la hierarchie des champs.
Definition Champ_base.h:43
virtual DoubleTab & valeur_aux_faces_post(DoubleTab &result) const
Definition Champ_base.h:108
int_t nb_som() const
Renvoie le nombre de sommets du domaine.
Definition Domaine.h:121
class Domaine_VF
Definition Domaine_VF.h:44
int face_sommets(int i, int j) const
renvoie le numero du ieme sommet de la face num_face.
Definition Domaine_VF.h:583
int elem_faces(int i, int j) const
renvoie le numero de le ieme face de la maille num_elem la facon dont ces faces sont numerotees est
Definition Domaine_VF.h:543
bool deformable() const
const Nom & le_nom() const override
Donne le nom de l'Objet_U Methode a surcharger : renvoie "neant" dans cette implementation.
classe Domaine_dis_base Cette classe est la base de la hierarchie des domaines discretisees.
Same as EChaine except here the input string comes from a datafile. Keeps a track of the lines that h...
Definition EChaineJDD.h:29
Une entree dont la source est une chaine de caracteres.
Definition EChaine.h:31
static int is_ecriture_special(int &special, int &a_faire)
indique si le format special a ete demande en lecture active par sauvegarde xyz .
Cette classe se comporte comme EChaine tant que l'on n'est pas a la fin de la chaine.
Class defining operators and methods for all reading operation in an input flow (file,...
Definition Entree.h:42
virtual const Champ_Inc_base & inconnue() const =0
virtual int nombre_d_operateurs() const =0
virtual int nombre_d_operateurs_tot() const
virtual const Operateur & operateur(int) const =0
const Nom & le_nom() const override
Renvoie le nom du champ.
virtual int nb_comp() const
Definition Field_base.h:56
bool is_vectorial() const
Definition Field_base.h:82
virtual Nature_du_champ nature_du_champ() const
Definition Field_base.h:77
const Noms & noms_compo() const
Renvoie le tableau des noms des composantes du champ.
const Champ_Fonc_base & le_champ_calcule() const
Entree & interpreter_bloc(Entree &is, Bloc_Type bloc_type, int verifier_sans_interpreter)
Interpretation d'un bloc d'instructions prises dans l'entree is.
static int objet_global_existant(const Nom &nom)
renvoie un drapeau indiquant si un objet de ce nom existe dans inteprete_courant() ou l'un de ses par...
static Interprete_bloc & interprete_courant()
renvoie l'interprete_bloc en train d'etre lu dans le jeu de donnees.
static Objet_U & objet_global(const Nom &nom)
cherche l'objet demande dans l'Interprete_bloc courant (Interprete_bloc::interprete_courant()) et dan...
static Objet_U & objet(const Nom &)
Voir Interprete_bloc::objet_global() BM: la classe Interprete n'est pas le meilleur endroit pour cett...
Cette classe implemente les operateurs et les methodes virtuelles de la classe EFichier de la facon s...
const Equation_base & equation() const
Renvoie la reference sur l'equation pointe par MorEqn::mon_equation.
Definition MorEqn.h:62
Une chaine de caractere (Nom) en majuscules.
Definition Motcle.h:26
int finit_par(const char *const n) const override
Definition Motcle.cpp:302
int debute_par(const char *const n) const override
Definition Motcle.cpp:309
Un tableau d'objets de la classe Motcle.
Definition Motcle.h:63
int contient_(const char *const ch) const
Definition Motcle.cpp:333
class Nom Une chaine de caractere pour nommer les objets de TRUST
Definition Nom.h:31
const char * getChar() const
Definition Nom.h:91
virtual int finit_par(const char *const n) const
Definition Nom.cpp:324
const Nom getPrefix(const char *const) const
Definition Nom.cpp:340
virtual int debute_par(const char *const n) const
Definition Nom.cpp:319
virtual int find(const char *const n) const
Definition Nom.cpp:314
Nom & prefix(const char *const)
Definition Nom.cpp:329
Nom & majuscule()
Transforme le nom en majuscules Seules les lettres 'a'-'z' sont modifiees.
Definition Nom.cpp:180
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
Un tableau de chaine de caracteres (VECT(Nom)).
Definition Noms.h:26
int rang(const char *const ch) const
Definition Noms.cpp:65
friend class Entree
Definition Objet_U.h:76
friend class Sortie
Definition Objet_U.h:75
virtual void nommer(const Nom &)
Donne un nom a l'Objet_U Methode virtuelle a surcharger.
Definition Objet_U.cpp:329
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
static const Nom & nom_du_cas()
Renvoie une reference constante vers le nom du cas.
Definition Objet_U.cpp:146
static int axi
Definition Objet_U.h:101
virtual Sortie & printOn(Sortie &) const
Ecriture de l'objet sur un flot de sortie Methode a surcharger.
Definition Objet_U.cpp:282
classe Operateur_Statistique_tps_base Represente des operations statistiques sur les champs.
Motcle get_localisation_pour_post(const Nom &option) const override
virtual Operateur_base & l_op_base()=0
Helper class to factorize the readOn method of Objet_U classes.
Definition Param.h:112
void ajouter(const char *keyword, const int *value, Param::Nature nat=Param::OPTIONAL)
Register an integer parameter.
Definition Param.cpp:364
@ OPTIONAL
Definition Param.h:115
@ REQUIRED
Definition Param.h:115
void ajouter_non_std(const char *keyword, const Objet_U *value, Param::Nature nat=Param::OPTIONAL)
Register a keyword handled by Objet_U::lire_motcle_non_standard.
Definition Param.cpp:489
Classe de base pour l'ensemble des postraitements.
virtual void associer_nom_et_pb_base(const Nom &, const Probleme_base &)
const Nom & le_nom() const override
Donne le nom de l'Objet_U Methode a surcharger : renvoie "neant" dans cette implementation.
classe Postraitement La classe est dotee -d une liste de champs generiques champs_post_complet_ qui c...
double tstat_dernier_calcul_
void associer_nom_et_pb_base(const Nom &, const Probleme_base &) override
static Nom get_nom_localisation(const Entity &loc)
int lpost(double, double) const
int postraiter_tableau(const Domaine &dom, const Noms &unites, const Noms &noms_compo, const int ncomp, const double temps, Nom nom_post, const Nom &localisation, const Nom &nature, const DoubleTab &valeurs)
int est_le_premier_postraitement_pour_nom_fich_
void mettre_a_jour(double temps) override
const OBS_PTR(Domaine) &domaine()
Probleme_base & probleme()
virtual int write_extra_mesh()
int comprend_champ_post(const Motcle &identifiant) const
int reprendre(Entree &is) override
Reprise d'un Objet_U sur un flot d'entree Methode a surcharger.
int lire_champs_stat_a_postraiter(Entree &, bool expect_acco)
int lire_tableaux_a_postraiter(Entree &)
void completer_sondes() override
int est_le_dernier_postraitement_pour_nom_fich_
int sauvegarder(Sortie &os) const override
Sauvegarde d'un Objet_U sur un flot de sortie Methode a surcharger.
OWN_PTR(Format_Post_base) format_post_
int lire_motcle_non_standard(const Motcle &, Entree &) override
Lecture des parametres de type non simple d'un objet_U a partir d'un flot d'entree.
void modify_cgns_basenames_and_reinit(const int, const int)
virtual int lire_champs_a_postraiter(Entree &is, bool expect_acco)
Lit le nom des champs a postraiter sur un flot d'entree.
Sondes_Int les_sondes_int_
int traiter_champs()
Effectue le postraitement des Champs si cela est necessaire.
int nb_pas_dt_post_
ecriture des donnees (champs, stats, int_array) tous les dt_post (une periode en nb d'iteration)
bool stat_demande_definition_champs_
int cherche_stat_dans_les_sources(const Champ_Gen_de_Champs_Gen &ch, Motcle nom)
On recherche les champs statistiques dans les sources du champ courant.
void postraiter(int forcer) override
void verifie_nom_et_sources(const Champ_Generique_base &champ)
void creer_champ_post_med(const Motcle &motlu1, const Motcle &motlu2, Entree &s)
virtual void postprocess_field_values()
Nom nom_fich() const
virtual const Champ_Generique_base & get_champ_post(const Motcle &nom) const
std::vector< std::string > locs_required_
int DeprecatedKeepDuplicatedProbes
void add_locs_required_if_not(const Motcle &)
double dernier_temps_
void completer() override
virtual int postraiter_champs()
Effectue le postraitement des Champs de facon imperative.
int postraiter_sondes()
Effectue le postraitement lie au sondes de facon imperative.
int & est_le_dernier_postraitement_pour_nom_fich()
int lire_champs_operateurs(Entree &is)
Lit les champs a postraiter sur un flot d'entree.
int traiter_sondes()
Mets a jour (en temps) le sondes.
void init() override
Initialise le postraitement.
void creer_champ_post_moreqn(const Motcle &type, const Motcle &option, const int num_eq, const int num_morceau, const int compo, Entree &s)
void creer_champ_post_stat(const Motcle &motlu1, const Motcle &motlu2, const Motcle &motlu3, const Motcle &motlu4, const double t_deb, const double t_fin, Entree &s)
Parser_U fdt_post_
int postraiter_tenseur(const Domaine &dom, const Noms &unites, const Noms &noms_compo, const int ncomp, const double temps, Nom nom_post, const Nom &localisation, const Nom &nature, const DoubleTab &valeurs)
int champ_fonc(Motcle &nom_champ, OBS_PTR(Champ_base)&mon_champ, OBS_PTR(Operateur_Statistique_tps_base)&operateur_statistique) const
virtual bool has_champ_post(const Motcle &nom) const
void complete_champ(Champ_Generique_base &champ, const Motcle &motlu)
void finir() override
Finalise le postraitement Ferme le fichier associe.
int ind_post(int nb_pas_dt) const
std::vector< YAML_data > data_a_sauvegarder() const override
for PDI IO: retrieve name, type and dimensions of the fields to save/restore
double dt_integr_serie_
Liste_Champ_Generique champs_post_complet_
void set_param(Param &param) const override
void creer_champ_post(const Motcle &motlu1, const Motcle &motlu2, Entree &s)
static LIST(Nom) &noms_fichiers_sondes()
Postraitement()
Constructeur par defaut.
int & est_le_premier_postraitement_pour_nom_fich()
double dt_post_
ecriture des donnees (champs, stats, int_array) tous les dt_post (un temps)
Nom set_expression_champ(const Motcle &motlu1, const Motcle &motlu2, const Motcle &motlu3, const Motcle &motlu4, const int trouve)
void resetTime(double t, const std::string dirname) override
bool besoin_postraiter_champs()
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.
bool has_domaine_dis() const
void get_noms_champs_postraitables(Noms &nom, Option opt=NONE) const override
const Domaine & domaine() const
Renvoie le domaine associe au probleme.
virtual int comprend_champ_post(const Motcle &nom) const
bool is_coupled() const
virtual const Champ_Generique_base & get_champ_post(const Motcle &nom) const
const Schema_Temps_base & schema_temps() const
Renvoie le schema en temps associe au probleme.
virtual int nombre_d_equations() const =0
virtual const Equation_base & equation(int) const =0
virtual int expression_predefini(const Motcle &motlu, Nom &expression)
const Domaine_dis_base & domaine_dis() const
Renvoie le domaine discretise associe au probleme.
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
class Schema_Temps_base
double temps_courant() const
Renvoie le temps courant.
double pas_de_temps() const
Renvoie le pas de temps (delta_t) courant.
int nb_pas_dt() const
Renvoie le nombre de pas de temps effectues.
double temps_init() const
Renvoie le temps initial.
Classe de base des flux de sortie.
Definition Sortie.h:52
virtual Sortie & flush()
Definition Sortie.cpp:138
Domaine_t & domaine()
bool isDataOnDevice() const
void jump(Entree &) override
Definition TRUSTTab.tpp:701
std::enable_if_t< is_default_exec_space< EXEC_SPACE >, View< _TYPE_, _SHAPE_ > > view_wo()
Definition TRUSTTab.h:276
std::enable_if_t< is_default_exec_space< EXEC_SPACE >, ConstView< _TYPE_, _SHAPE_ > > view_ro() const
Definition TRUSTTab.h:261
_SIZE_ dimension(int d) const
Definition TRUSTTab.tpp:133
int line_size() const
Definition TRUSTVect.tpp:67
classe TRUST_2_PDI Encapsulation of PDI methods (library used for IO operations). See the website pdi...
Definition TRUST_2_PDI.h:59
void read(const std::string &name, void *data)
static int is_PDI_checkpoint()
static int is_PDI_restart()
void TRUST_start_sharing(const std::string &name, const void *data)
classe YAML_data : collection of all needed information for data to save/restore in order to write th...
Definition YAML_data.h:26
void set_conditions(const std::string &cond)
Definition YAML_data.h:36
void set_local(bool l)
Definition YAML_data.h:35