16#include <Postraitements.h>
17#include <Postraitement.h>
18#include <unordered_set>
47 for (
const auto& itr : *
this)
49 const Postraitement_base& post = itr.valeur();
109 motcles[0] =
"Postraitement|Post_processing";
110 motcles[1] =
"Postraitements|Post_processings";
111 motcles[2] =
"liste_postraitements";
112 motcles[3] =
"liste_de_postraitements";
113 motcles[4] =
"Postraitement_FT_Lata";
115 const int lerang = motcles.
search(motlu);
119 LIST(
Nom) list_nom_post;
127 post.typer(
"Postraitement_STT");
129 post.typer(
"Postprocessing_IJK");
131 post.typer(
"Postraitement");
132 post->associer_nom_et_pb_base(
"neant", mon_pb);
138 if (z_post && z_post->
format() ==
"cgns")
141 else if (lerang == 1 || lerang == 2 || lerang == 3 )
150 Cerr <<
"Error while reading the list of Postraitements," << finl;
151 Cerr <<
" we expected a {" << finl;
155 while (motlu2 !=
"}")
162 type =
"Postraitement";
163 nom_du_post = motlu2;
168 Cerr<<
" Warning liste_postraitements obsolete option" <<finl;
176 nom_du_post = motlu2;
182 Cerr<<
"Error in Postraitements"<<finl;
186 list_nom_post.add_if_not(nom_du_post);
190 post->associer_nom_et_pb_base(nom_du_post, mon_pb);
196 if (z_post && z_post->
format() ==
"cgns")
223 if (list_nom_post.size()!=compteur)
225 Cerr <<
"You can use the same name for the storing data file in two different blocks of post-processing" << finl;
226 Cerr <<
"Check your datafile." << finl;
230 else if (lerang == 4)
233 post.typer(
"Postraitement_FT_Lata");
234 post->associer_nom_et_pb_base(
"neant", mon_pb);
246 for (
auto& itr : *
this)
252 for (
auto& itr : *
this)
258 for (
auto& itr : *
this)
259 itr->mettre_a_jour(temps);
264 for (
auto& itr : *
this)
265 itr->resetTime(t, dirname);
270 for (
auto& itr : *
this)
276 for (
auto& itr : *
this)
283 for (
const auto& itr : *
this)
284 bytes += itr->sauvegarder(os);
290 for (
auto& itr : *
this)
301 std::unordered_map<std::string, int> file_name_counts;
303 file_name_counts[name]++;
306 bool has_duplicates =
false;
307 for (
const auto& name_to_count: file_name_counts)
310 const auto& count = name_to_count.second;
313 has_duplicates =
true;
320 std::unordered_map<std::string, int> current_occurrence;
322 for (
auto &itr : *
this)
325 if (!z_post || z_post->
format() !=
"cgns")
331 if (file_name_counts[file_name] > 1)
333 current_occurrence[file_name]++;
336 if (current_occurrence[file_name] > 1)
344 for (
auto& itr : *
this)
350 for (
auto& itr : *
this)
351 itr->completer_sondes();
Class defining operators and methods for all reading operation in an input flow (file,...
A character string (Nom) in uppercase.
An array of Motcle objects.
int search(const Motcle &t) const
class Nom: a character string for naming TRUST objects.
bool contient(const Nom &nom) const
const std::string & getString() const
const Nom & que_suis_je() const
Returns the string identifying the class.
Base class for all post-processing objects.
class Postraitement. The class holds -a list of generic fields champs_post_complet_ containing
void modify_cgns_basenames_and_reinit(const int, const int)
const Nom & format() const
int reprendre(Entree &is) override
int sauvegarder(Sortie &os) const override
std::vector< std::string > cgns_post_file_names_
void resetTime(double t, const std::string dirname)
void traiter_postraitement()
int lire_postraitements(Entree &is, const Motcle &motlu, const Probleme_base &mon_pb)
void mettre_a_jour(double temps)
class Probleme_base It is a Probleme_U that is not a coupling.
static void exit(int exit_code=-1)
Exit routine for TRUST within a Kokkos region.
Base class for output streams.