16#include <Champ_Generique_Statistiques_base.h>
17#include <Operateurs_Statistique_tps.h>
18#include <EcritureLectureSpecial.h>
19#include <Postraitement.h>
20#include <TRUST_2_PDI.h>
24Sortie& Operateurs_Statistique_tps::printOn(
Sortie& s )
const {
return s << que_suis_je() <<
" " << le_nom(); }
25Entree& Operateurs_Statistique_tps::readOn(
Entree& s) {
return s; }
31 if (itr->le_nom() == champ)
34 Cerr <<
"The post_processing request " << motlu <<
" of a variable" << finl;
35 Cerr <<
"must be preceded by the post-processing request of the average of the same variable." << finl;
49 Nom mon_ident(que_suis_je());
50 mon_ident += mon_post_->probleme().domaine().le_nom();
51 double temps = mon_post_->probleme().schema_temps().temps_courant();
52 mon_ident += Nom(temps,
"%e");
53 os << mon_ident << finl;
54 os << que_suis_je() << finl;
56 os << Nom(this->dernier()->tstat_deb(),
"%e") << finl;
57 os << Nom(this->dernier()->tstat_dernier_calcul(),
"%e") << finl;
61 for (
const auto &itr : *
this)
62 bytes += itr->sauvegarder(os);
64 if (a_faire) os.
flush();
74 double tstat_deb_sauv,temps_derniere_mise_a_jour_stats;
78 const std::string& pb_name = mon_post_->probleme().le_nom().getString();
80 const Nom& nom_post = mon_post_->
le_nom();
81 std::string post_name = (nom_post !=
"neant") && (nom_post != vide) ? nom_post.
getString() +
"_" :
"";
82 std::string name = pb_name +
"_" + post_name +
"stat_tdeb";
83 pdi_interface.
read(name, &tstat_deb_sauv);
84 name = pb_name +
"_" + post_name +
"stat_tend";
85 pdi_interface.
read(name, &temps_derniere_mise_a_jour_stats);
95 Cerr <<
"The end of the restarting file is reached." << finl;
96 Cerr <<
"This file does not contain statistics." << finl;
97 Cerr <<
"The restarting time tinit must therefore be lower" << finl;
98 Cerr <<
"than the statistics begining time t_deb." << finl;
104 is >> tstat_deb_sauv;
105 is >> temps_derniere_mise_a_jour_stats;
108 double tinit = mon_post_->probleme().schema_temps().temps_courant();
111 if (inf_strict(tinit,temps_derniere_mise_a_jour_stats,1.e-5))
113 Cerr <<
"The initial time " << tinit <<
" of the restarting calculation is lower" << finl;
114 Cerr <<
"than the last statistics update time " << temps_derniere_mise_a_jour_stats << finl;
115 Cerr <<
"One is not able to treat this case." << finl;
118 else if (!est_egal(tstat_deb_sauv,this->dernier()->tstat_deb()))
121 if (inf_strict(this->dernier()->tstat_deb(),tinit,1.e-5))
123 Cerr <<
"t_deb has been modified to carry out a new statistics calculation without restarting" << finl;
124 Cerr <<
"but t_deb is lower than tinit : it is not possible." << finl;
127 Cerr <<
"Statistics are not restarted and therefore the statistics calculation" << finl;
128 Cerr <<
"will restart a t_deb =" << this->dernier()->tstat_deb() << finl;
134 BigDoubleTab tab_bidon;
135 auto& list = get_stl_list();
136 for (
auto&& itr = list.begin(); itr != list.end(); )
138 is >> bidon2 >> bidon2;
149 for (
auto &itr : *
this)
152 is >> bidon2 >> bidon2;
156 for (
auto &itr : *
this)
157 itr->fixer_tstat_deb(tstat_deb_sauv,temps_derniere_mise_a_jour_stats);
164 Cerr <<
"Problem in the resumption of Operateurs_Statistique_tps" << finl;
165 Cerr <<
"PDI format does not require to navigate through file..." << finl;
170 double tstat_deb_sauv,temps_derniere_mise_a_jour_stats;
171 is >> tstat_deb_sauv;
172 is >> temps_derniere_mise_a_jour_stats;
175 BigDoubleTab tab_bidon;
176 for (
int i=0; i<n; i++)
178 is >> bidon >> bidon;
static int is_ecriture_special(int &special, int &a_faire)
Indicates whether the special format was requested in active writing by xyz save.
Class defining operators and methods for all reading operation in an input flow (file,...
A character string (Nom) in uppercase.
class Nom: a character string for naming TRUST objects.
const std::string & getString() const
const Nom & le_nom() const override
Returns *this.
virtual int reprendre(Entree &)
Restores an Objet_U from an input stream. Virtual method to override.
class Operateur_Statistique_tps_base
class Operateurs_Statistique_tps
int reprendre(Entree &is) override
int sauvegarder(Sortie &os) const override
static void exit(int exit_code=-1)
Exit routine for TRUST within a Kokkos region.
Base class for output streams.
void jump(Entree &) override
TRUST_2_PDI Encapsulation of PDI methods (library used for IO operations). See the website pdi....
void read(const std::string &name, void *data)
static int is_PDI_restart()