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>
40static constexpr double DT_NOT_INIT = std::numeric_limits<double>::max();
41static constexpr int NB_NOT_INIT = std::numeric_limits<int>::max();
82Postraitement::~Postraitement()
86 Postraitement::noms_fichiers_sondes_=
LIST(
Nom)();
145 if (sup_strict(dt,0))
150LIST(
Nom) Postraitement::noms_fichiers_sondes_=LIST(
Nom)();
159 if (loc==Entity::ELEMENT)
161 else if (loc==Entity::NODE)
163 else if (loc==Entity::FACE)
167 Cerr<<
"This location is not valid for the postprocessing"<<finl;
173 snprintf(s,100,
"%.10f", op->
get_time());
177inline void nom_fichier(
const Postraitement& post,
const Nom& nom_post,
const Nom& loc,
const double temps_ch,
const Domaine& dom,
Nom& nom_fichier)
182 snprintf(s,100,
"%.10f",temps_ch);
186inline void nom_fichier(
const Domaine& dom,
Nom& nom_fichier)
189 nom_fichier+=dom.
le_nom();
191inline int composante(
const Nom& le_nom_,
const Champ_base& mon_champ)
194 const Nom& le_nom_ch = mon_champ.
le_nom();
195 if (motlu ==
Motcle(le_nom_ch))
200 int n = noms_comp.size();
202 for (
int i=0; i<n; i++)
203 les_noms_comp[i] = noms_comp[i];
204 int ncomp = les_noms_comp.search(motlu);
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] <<
" ";
225 if (loc==Entity::ELEMENT)
227 else if (loc==Entity::NODE)
229 else if (loc==Entity::FACE)
233 Cerr<<
"This location is not valid for the postprocessing"<<finl;
282 Cerr <<
"Reading guidelines of postprocessing" << finl;
283 assert(mon_probleme);
285 const Nom& le_nom_du_post =
le_nom();
287 if ((le_nom_du_post !=
"neant") && (le_nom_du_post != vide))
296 Probleme_base& le_pb = mon_probleme.valeur();
301 if (Motcle(
format_) ==
"MEDFILE")
303 Cerr <<
"The postprocessing format 'medfile' is not supported since TRUST v1.9.2! Switch to 'med'." << finl;
307 if (Motcle(
format_) ==
"LATA_V1")
309 Cerr <<
"The postprocessing format 'lata_v1' is not supported since TRUST v1.9.1! Switch to 'lata' (version 2)." << finl;
313 bool is_supported =
false, is_single_lata =
false;
314 std::vector<Motcle> supported = {
"CGNS" ,
"LATA",
"SINGLE_LATA",
"LATA_V2",
"MED",
"LML" };
316 for (
auto &itr : supported)
325 Cerr <<
"The post-processing format " << Motcle(
format_) <<
" is not recognized! The recognized formats are : " << finl;
326 for (
auto &itr : supported) Cerr <<
" - " << itr << finl;
333 if (Motcle(
format_) ==
"SINGLE_LATA")
335 is_single_lata =
true;
353 Nom type_format =
"Format_Post_";
355 format_post_.typer(type_format.
getChar());
357 format_post_->set_single_lata_option(is_single_lata);
363 if (le_domaine_->deformable())
364 format_post_->set_deformable_domain();
370 base_name.prefix(
".");
386 if ((le_nom_du_post !=
"neant") && (le_nom_du_post != vide))
393 if (count_nom_cas_fich > 1)
395 assert (nom_cas_fich_ind <= count_nom_cas_fich);
396 if (nom_cas_fich_ind > 1)
399 nom_fich_ += std::to_string(nom_cas_fich_ind);
413static const std::map<std::string, std::string> keyword_dictionnary
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"}
424static Nom translate_keyword(
const Nom& french_keyword)
426 bool has_file_suffix = french_keyword.
finit_par(
"_FICHIER") || french_keyword.
finit_par(
"_FILE");
427 Nom english_keyword = french_keyword;
429 auto i = keyword_dictionnary.
find(english_keyword.
getString());
430 if (i!=keyword_dictionnary.end())
431 english_keyword = i->second;
433 english_keyword +=
"_FILE";
434 return english_keyword;
437static EChaineJDD read_and_broadcast_file(
const Nom& filename)
441 long unsigned int file_char_number;
442 Nom file_content(
"{ ");
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;
452 envoyer_broadcast(file_char_number, 0);
453 file_content.getString().resize(file_char_number+4);
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] =
'}';
461static EChaineJDD get_file_content_for_bloc(
const Nom& associated_word,
Entree& s,
bool with_acco)
475 Param param2(associated_word +
"_files");
477 param2.lire_avec_accolades_depuis(s);
480 Cerr <<
"Reading of "<<associated_word<<
" from file "<<filename<< finl;
481 return read_and_broadcast_file(filename);
520 param.
ajouter_non_std(
"Definition_champs_fichier|Definition_champs_file",(
this));
528 param.
ajouter_non_std(
"Sondes_mobiles_fichier|Mobile_probes_file",(
this));
544 param.
ajouter_non_std(
"Statistiques_en_serie|Serial_statistics",(
this));
546 param.
ajouter_non_std(
"Statistiques_en_serie_fichier|Serial_statistics_file",(
this));
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;
670 if ((disc ==
"VEF") || (disc ==
"VEFPreP1b"))
672 Nom in(
"{ temperature_physique ");
673 in +=
"Tparoi_VEF { source refChamp { Pb_champ ";
675 in +=
" temperature } } }";
676 Cerr <<
" Building of temperature_physique " << in << finl;
684 auto lire_dt = [&]() ->
double
697 keyword = translate_keyword(keyword.
majuscule());
698 bool expect_acco =
false;
700 if (keyword==
"Probes")
702 Cerr <<
"Reading of probes" << finl;
708 else if (keyword==
"Mobile_probes")
710 Cerr <<
"Reading of mobile probes" << finl;
717 else if (keyword==
"Fields|Fields_file")
719 Cerr <<
"Reading of fields to be postprocessed" << finl;
721 Option opt=DESCRIPTION;
722 mon_probleme->get_noms_champs_postraitables(liste_noms,opt);
724 if (motlu ==
"binaire")
730 else if (motlu ==
"formatte")
737 if (motlu ==
"dt_post")
739 double tmp_dt = lire_dt();
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;
749 else if (motlu ==
"nb_pas_dt_post")
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;
763 if (!expect_acco && motlu !=
"{")
764 Process::exit(
"We expected { to start the reading of the fields to postprocess!");
766 if (keyword==
"Fields_file")
768 Nom associated_word(
"Fields");
769 EChaineJDD file_content = get_file_content_for_bloc(associated_word, s, expect_acco);
777 else if (keyword==
"Statistics|Statistics_file")
779 Cerr <<
"Reading of the statistics block" << finl;
782 if (motlu ==
"dt_post")
784 double tmp_dt = lire_dt();
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;
794 if (!expect_acco && motlu !=
"{")
795 Process::exit(
"We expected { to start the reading of the fields to postprocess!");
799 if (keyword==
"Statistics_file")
801 Nom associated_word(
"Statistics");
802 EChaineJDD file_content = get_file_content_for_bloc(associated_word, s, expect_acco);
812 else if (keyword==
"Domaine")
816 Cerr<<
"The domain must be specified before reading Champs, Probes and Statistiques blocks at the beginning of the post-processing block."<<finl;
825 else if (keyword==
"Sous_domaine|Sous_zone")
830 Cerr<<
"The domain must be specified before reading Champs, Probes and Statistiques blocks at the beginning of the post-processing block."<<finl;
835 Nom nom_du_sous_domaine;
836 s >> nom_du_sous_domaine;
837 Sous_Domaine le_sous_domaine;
840 Cerr <<
"Unknown sous_domaine : " << nom_du_sous_domaine << finl;
847 Nom nom_du_nouveau_dom = nom_du_dom +
Nom(
"_") + nom_du_sous_domaine;
850 in += nom_du_nouveau_dom;
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 ";
870 else if (keyword==
"Int_Probes")
872 Cerr <<
"Reading of probes related to integers arrays" << finl;
879 else if (keyword==
"Int_array|Int_array_file")
885 Cerr <<
"Reading of integers arrays to be postprocessed "<< finl;
888 if (motlu ==
"dt_post")
890 double tmp_dt = lire_dt();
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;
900 if (keyword==
"Int_array_file")
902 EChaineJDD file_content = get_file_content_for_bloc(
Nom(
"Int_array"), s,
true);
910 else if (keyword==
"Serial_statistics|Serial_statistics_file")
912 Cerr <<
"Reading of the serial statistics block" << finl;
914 if (motlu !=
"dt_integr")
916 Cerr <<
"Error while reading the statistics block:" << finl;
917 Cerr <<
"We expected the keyword dt_integr " << finl;
923 if (keyword==
"Serial_statistics_file")
925 EChaineJDD file_content = get_file_content_for_bloc(
Nom(
"Serial_statistics"), s,
true);
934 else if (keyword==
"Definition_champs")
944 EChaineJDD file_content = get_file_content_for_bloc(keyword_prefix, s,
true);
948 else if (keyword==
"dt_post")
971 format_post_->resetTime(time, dirname);
983 std::vector<YAML_data> data;
986 std::string cond =
"$temps>" + std::to_string(
tstat_deb_);
989 std::vector<YAML_data> post_data = ch_post->data_a_sauvegarder();
992 for (
auto& post : post_data)
993 post.set_conditions(cond);
994 data.insert(data.end(), post_data.begin(), post_data.end());
996 auto add_stat = [&](
const std::string& n,
const std::string& type)
1007 std::string post_name = (nom_post !=
"neant") && (nom_post != vide) ? nom_post.
getString() +
"_" :
"";
1009 std::string stat_name = pb_name +
"_" + post_name +
"stat_nb_champs";
1010 add_stat(stat_name,
"int");
1012 stat_name = pb_name +
"_" + post_name +
"stat_tdeb";
1013 add_stat(stat_name,
"double");
1015 stat_name = pb_name +
"_" + post_name +
"stat_tend";
1016 add_stat(stat_name,
"double");
1032 int a_faire,special;
1037 Nom mon_ident(
"Operateurs_Statistique_tps");
1040 mon_ident +=
Nom(temps,
"%e");
1041 os << mon_ident << finl;
1043 os <<
"Operateurs_Statistique_tps" << finl;
1054 std::string post_name = (nom_post !=
"neant") && (nom_post != vide) ? nom_post.
getString() +
"_" :
"";
1056 std::string name = pb_name +
"_" + post_name +
"stat_nb_champs";
1058 name = pb_name +
"_" + post_name +
"stat_tdeb";
1060 name = pb_name +
"_" + post_name +
"stat_tend";
1066 if (a_faire) os.
flush();
1079 Cerr <<
"Postraitement::reprendre() " << finl;
1091 double tstat_deb_sauv,temps_derniere_mise_a_jour_stats;
1098 std::string post_name = (nom_post !=
"neant") && (nom_post != vide) ? nom_post.
getString() +
"_" :
"";
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);
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;
1120 is >> tstat_deb_sauv;
1121 is >> temps_derniere_mise_a_jour_stats;
1124 if (inf_strict(tinit,temps_derniere_mise_a_jour_stats,1.e-5))
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;
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;
1140 Cerr <<
"We do not resume the statistics and thus the statistics calculation" << finl;
1141 Cerr <<
"will restart at t_deb=" <<
tstat_deb_ << finl;
1174 Cerr << finl <<
"Problem in the resumption " << finl;
1175 Cerr <<
"PDI format does not require to navigate through file..." << finl;
1182 double tstat_deb_sauv,temps_derniere_mise_a_jour_stats;
1183 is >> tstat_deb_sauv;
1184 is >> temps_derniere_mise_a_jour_stats;
1187 DoubleTab tab_bidon;
1188 for (
int i=0; i<n; i++)
1190 is >> bidon >> bidon;
1226 Motcle accolade_ouverte(
"{");
1227 Motcle accolade_fermee(
"}");
1234 if (motlu != accolade_ouverte)
1235 Process::exit(
"We expected { to start to read the fields of postprocessing with the simplified syntax");
1240 mon_probleme->get_noms_champs_postraitables(liste_noms);
1242 while (motlu != accolade_fermee)
1245 for (
int i=0; i<liste_noms.size()*0; i++)
1247 Motcle toto(liste_noms[i]);
1248 mon_probleme->creer_champ(toto);
1249 Cerr<<
" get "<<toto<<
" ";
1250 Cerr<<mon_probleme->get_champ(toto)<<finl;
1270 Cerr <<
"Error in Postreatment\n"
1271 <<
"with DG the only possible localisation to postprocessed field is \"elem\"" << finl;
1276 if ((motlu2==
"elem") || (motlu2==
"som") || (motlu2==
"faces"))
1279 if (mon_probleme->que_suis_je()!=
"Pb_MED")
1295 Motcles mots_compare(liste_noms.size());
1296 for (
int i=0; i<liste_noms.size(); i++)
1297 mots_compare[i] = liste_noms[i];
1303 if (motlu==
"pas_de_temps")
1306 for (
int i=0; i<nb_eq; i++)
1309 for (
int j=0; j<nb_morceaux; j++)
1317 else if (motlu==
"flux_bords" || motlu==
"flux_surfacique_bords")
1320 for (
int i=0; i<nb_eq; i++)
1328 int nb_compo = ch_inco.
nb_comp();
1331 for (
int j=0; j<nb_morceaux; j++)
1336 for (
int comp=0; comp<nb_compo; comp++)
1355 if (noms_champs_a_post_.contient(nom[0]))
1357 Cerr <<
"Postraitement::lire_champs_a_postraiter : duplicate field " << nom[0] << finl;
1361 noms_champs_a_post_.add(nom[0]);
1374 Motcle accolade_ouverte(
"{");
1375 Motcle accolade_fermee(
"}");
1376 Motcle motlu,motlu2,motlu3,motlu4,indic_corr;
1379 indic_corr=
"non_correlation";
1383 if (motlu != accolade_ouverte)
1385 Cerr <<
"We expected { to start to read the data to create the statistical fields" << finl;
1391 mon_probleme->get_noms_champs_postraitables(liste_noms);
1396 if (motlu ==
Motcle(
"t_deb"))
1400 Cerr <<
"Error while reading the statistics in the postprocessing" << finl;
1401 Cerr <<
"We expected the keyword t_deb instead of " << motlu << finl;
1405 if (motlu ==
Motcle(
"t_fin"))
1409 Cerr <<
"Error while reading the statistics in the postprocessing" << finl;
1410 Cerr <<
"We expected the keyword t_fin instead of " << motlu << finl;
1416 while (motlu != accolade_fermee)
1421 if (motlu!=
"correlation")
1423 if ((motlu3==
"elem") || (motlu3==
"som") || (motlu3==
"faces"))
1437 if ((motlu4==
"elem") || (motlu4==
"som") || (motlu4==
"faces"))
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;
1494 Motcle accolade_ouverte(
"{");
1495 Motcle accolade_fermee(
"}");
1500 if (motlu != accolade_ouverte)
1502 Cerr <<
"We expected { to start to read the postprocessing fields" << finl;
1510 if (is_champ_predefini)
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;
1517 while (motlu != accolade_fermee)
1519 Cerr <<
"Reading definition of field "<<motlu<<finl;
1538 champ.nommer(motlu);
1544 champ_a_completer->completer(*
this);
1549 Motcle accolade_ouverte(
"{");
1550 Motcle accolade_fermee(
"}");
1555 if (motlu != accolade_ouverte)
1557 Cerr <<
"We expected { to start to read the postprocessing data" << finl;
1563 while (motlu != accolade_fermee)
1568 mon_probleme->get_noms_champs_postraitables(liste_noms);
1572 for (
int i=0; i<liste_noms.size(); i++)
1573 if (liste_noms[i]==motlu)
1575 if (mon_probleme->a_pour_IntVect(motlu,ch_tab))
1577 noms_tableaux_.add(nom_tab);
1578 tableaux_a_postraiter_.add(ch_tab);;
1582 Cerr <<
"The problem do not have the array " << motlu << finl;
1587 else if (i==liste_noms.size()-1)
1589 Cerr <<
"The problem does not understand the word " << motlu << finl;
1600static Noms liste_dom_ecrit;
1617 const Domaine& dom=le_domaine_.valeur();
1618 const Nom& nom_du_domaine = dom.
le_nom();
1624 int reprise = mon_probleme->reprise_effectuee();
1635 Nom le_nom_champ_post;
1636 for (
auto& itr : noms_champs_a_post_)
1638 const Nom& nom_post = itr;
1641 int indic_correlation=0;
1646 indic_correlation=1;
1649 if (!indic_correlation)
1651 Entity loc = champ->get_localisation();
1653 const Noms nom = champ->get_property(
"nom");
1654 const Noms composantes = champ->get_property(
"composantes");
1656 const bool can_not_post_at_faces =
Motcle(loc_post) ==
"FACES" &&
1662 if (can_not_post_at_faces)
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;
1669 if (
Motcle(loc_post) ==
"FACES" || champ->get_discretisation().is_poly_family())
1672 if (ref_domaine_dis)
1673 domaine_dis_pour_faces_ = ref_domaine_dis;
1677 le_nom_champ_post = nom[0];
1681 const Noms& noms_comp = composantes;
1682 int n = noms_comp.size();
1683 for (
int i=0; i<n; i++)
1685 le_nom_champ_post = noms_comp[i];
1691 Nom nomposttmp(le_nom_champ_post) ;
1692 Nom& locpostjdd=nomposttmp.
prefix(nom_du_domaine);
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;
1701 const Champ_base& champ_ecriture = champ->get_champ_without_evaluation(espace_stockage);
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);
1710 const bool already_written_domain = liste_dom_ecrit.contient_(token);
1718 liste_dom_ecrit.add(token);
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",
1735 const IntTab& elem_faces = domaine_vf.
elem_faces();
1736 format_post_->ecrire_item_int(
"ELEM_FACES",
1748 format_post_->modify_file_basename(name,
false ,tinit);
1763 format_post_->modify_file_basename(name,mon_probleme->reprise_effectuee(),-1);
1767 liste_dom_ecrit.clear();
1778 double temps_courant = mon_probleme->schema_temps().temps_courant();
1779 const Domaine& dom=le_domaine_.valeur();
1781 if (
temps_ < temps_courant)
1784 format_post_->ecrire_temps(temps_courant);
1791 if (domaine_dis_pour_faces_)
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",
1805 const IntTab& elem_faces = domaine_vf.
elem_faces();
1806 format_post_->ecrire_item_int(
"ELEM_FACES",
1821 if (
temps_ < temps_courant)
1826 format_post_->finir_ecriture(temps_courant);
1832 double temps_courant = mon_probleme->schema_temps().temps_courant();
1833 const Domaine& dom=le_domaine_.valeur();
1835 for (
auto& itr : noms_champs_a_post_)
1843 const Champ_base& champ_ecriture = champ.get_champ(espace_stockage);
1847 const bool isChamp_Face_PolyMAC_CDO = (champ_ecriture.
que_suis_je().debute_par(
"Champ_Face_PolyMAC") ||
1851 const bool isChamp_Face_VDF_CGNS = (
Motcle(
format_) ==
"CGNS") &&
1853 (champ_ecriture.
que_suis_je() == (
"Champ_Face") ||
1854 champ_ecriture.
que_suis_je() == (
"Champ_Fonc_Face"));
1856 if (isChamp_Face_VDF_CGNS || isChamp_Face_PolyMAC_CDO)
1859 const DoubleTab& valeurs_post = (isChamp_Face_VDF_CGNS || isChamp_Face_PolyMAC_CDO) ? val_vec : champ_ecriture.
valeurs();
1862 Entity loc = champ.get_localisation();
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();
1874 Nom nature(
"scalar");
1876 postraiter(dom,unites,noms_compo,ncomp,temps_courant,itr,localisation,nature,valeurs_post,tenseur);
1882 double temps_courant = mon_probleme->schema_temps().temps_courant();
1883 const Domaine& dom=le_domaine_.valeur();
1891 if (
temps_ < temps_courant)
1895 format_post_->ecrire_temps(temps_courant);
1898 auto& list1 = tableaux_a_postraiter_.get_stl_list();
1899 auto& list2 = noms_tableaux_.get_stl_list();
1901 auto itr2 = list2.begin();
1903 for (
auto& itr1 : list1)
1905 const Nom& id_item = *itr2;
1906 const Nom& id_du_domaine = dom.
le_nom();
1908 const Nom localisation=
"";
1909 const Nom reference=
"";
1910 const IntVect& val = itr1.valeur();
1911 const int ref_size =0;
1913 format_post_->ecrire_item_int(id_item,id_du_domaine,id_domaine,localisation,reference,val,ref_size);
1929 int ind_pas_dt_post =
ind_post(nb_pas_dt);
1934 if (!ind_pas_dt_post)
1959 les_sondes_int_.postraiter(mon_probleme->schema_temps().temps_courant());
1969 double temps=mon_probleme->schema_temps().temps_courant();
1970 double tinit=temps-mon_probleme->schema_temps().temps_calcul();
1977 Nom nom_post,
const Nom& localisation,
const Nom& nature,
const DoubleTab& valeurs,
int tenseur)
1981 postraiter_tableau(dom,unites,noms_compo,ncomp,temps,nom_post,localisation,nature,valeurs);
1983 postraiter_tenseur(dom,unites,noms_compo,ncomp,temps,nom_post,localisation,nature,valeurs);
1990 Nom nom_post,
const Nom& localisation,
const Nom& nature,
const DoubleTab& tab_valeurs)
1992 const Nom& id_du_domaine = dom.
le_nom();
1993 const Nom& id_champ_ecrit = nom_post;
1995 const int size = tab_valeurs.
dimension(0);
1997 DoubleTrav val_post_ecrit(size, ncomp == -1 ? N : 1);
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(
2006 for (
int j = 0; j < N; j++)
2007 val_post(i, j) = valeurs(i, j);
2009 val_post(i, 0) = valeurs(i, ncomp);
2011 end_gpu_timer(__KERNEL_NAME__);
2015 for (
int i = 0; i < size; i++)
2017 for (
int j = 0; j < N; j++)
2018 val_post_ecrit(i, j) = tab_valeurs(i, j);
2020 val_post_ecrit(i, 0) = tab_valeurs(i, ncomp);
2023 format_post_->ecrire_champ(dom,unites,noms_compo,ncomp,temps,id_champ_ecrit,id_du_domaine,localisation,nature,val_post_ecrit);
2029 Nom nom_post,
const Nom& localisation,
const Nom& nature,
const DoubleTab& valeurs)
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);
2043 if (motlu2 ==
"natif" || (motlu2 ==
"faces" && motlu3 ==
""))
2047 ajout +=
" refChamp { Pb_champ ";
2056 ajout =
"Interpolation { localisation ";
2057 if (mon_probleme.valeur().domaine_dis().que_suis_je() ==
"Domaine_DG")
2058 ajout +=
" elem_DG ";
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 { ";
2071 ajout +=
" sources_reference { ";
2077 if (motlu3!=
"Correlation")
2078 ajout +=
" source ";
2080 ajout +=
" sources { ";
2081 ajout +=
" refChamp { Pb_champ ";
2087 if (motlu3!=
"Correlation")
2092 ajout +=
" refChamp { Pb_champ ";
2100 if ((motlu3==
"Moyenne") || (motlu3==
"Ecart_type") || (motlu3==
"Correlation"))
2115 if (var ==
"FACE") var =
"FACES";
2117 if (var !=
"FACES" && var !=
"SOM" && var !=
"ELEM")
2119 Cerr <<
"What ??? Error in Postraitement::add_locs_required_if_not" << finl;
2120 Cerr <<
"CGNS understands only ELEM, SOM or FACES !!! Not " << var << finl;;
2158 Nom nom_champ, nom_champ_a_post;
2164 if (motlu2 !=
"NATIF")
2170 if ((trouve) && ((motlu2==
"natif") || (motlu2==
"faces")))
2173 noms_champs_a_post_.add_if_not(motlu1);
2182 if (le_domaine_->le_nom()!=mon_probleme->domaine().le_nom() && motlu2==
"faces")
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;
2198 Noms source_compos,source_syno;
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;
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;
2223 nom_champ =
Motcle(nom_champ_ref)+
"_"+motlu2+
"_"+le_domaine_->
le_nom();
2224 champ->
nommer(nom_champ);
2229 if (motlu2 !=
"FACES")
2235 const Nom& nom_dom = champ->get_ref_domain().
le_nom();
2236 const int nb_comp = source_compos.size();
2237 Noms compo(nb_comp);
2240 if (motlu2 ==
"ELEM")
2242 else if (motlu2 ==
"SOM")
2244 else if (motlu2 ==
"FACES")
2247 for (
int i = 0; i < nb_comp; i++)
2248 compo[i] = source_compos[i] +
"_" + loc +
"_" + nom_dom;
2249 champ->fixer_noms_compo(compo);
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);
2258 champ_a_completer->completer(*
this);
2260 if (motlu2!=
"natif")
2262 if (motlu2!=
"faces")
2263 nom_champ_a_post = motlu1+
"_"+motlu2+
"_"+le_domaine_->
le_nom();
2268 nom_champ_a_post = motlu1+
"_"+motlu2+
"_"+le_domaine_->
le_nom();
2273 nom_champ_a_post = nom_champ_ref+
"_"+motlu2+
"_"+le_domaine_->
le_nom()+nume;
2276 if (noms_champs_a_post_.contient(nom_champ_a_post))
2278 Cerr <<
"Postraitement::lire_champs_a_postraiter : duplicate field " << nom_champ_a_post << finl;
2279 Cerr<<
" existing names "<<noms_champs_a_post_<<finl;
2283 noms_champs_a_post_.add(nom_champ_a_post);
2303 motlu4,
const double t_deb,
const double t_fin,
Entree& s)
2309 if (((motlu3==
"Moyenne") || (motlu3==
"Ecart_type")) || (motlu3==
"Correlation"))
2311 if (motlu2 !=
"NATIF")
2324 if (motlu3!=
"Correlation")
2325 nom_champ = motlu3+
"_"+motlu1+
"_"+motlu2+
"_"+le_domaine_->
le_nom();
2327 nom_champ = motlu3+
"_"+motlu1+
"_"+motlu4+
"_"+motlu2+
"_"+le_domaine_->
le_nom();
2329 champ->
nommer(nom_champ);
2343 int nb_comp = source_compos.size();
2344 Noms compo(nb_comp);
2348 else if (motlu2==
"SOM")
2350 else if (motlu2==
"FACES")
2353 for (
int i=0; i<nb_comp; i++)
2355 if (motlu3==
"Moyenne")
2357 compo[i] =
"Moyenne_";
2358 compo[i] += source_compos[i] +
"_"+loc+
"_"+nom_dom;
2360 else if (motlu3==
"Ecart_Type")
2362 compo[i] =
"Ecart_Type_";
2363 compo[i] += source_compos[i] +
"_"+loc+
"_"+nom_dom;
2371 champ_a_completer->completer(*
this);
2375 if (motlu3==
"Correlation")
2382 int nb_comp_corr = source_compos_corr.size();
2383 Noms compo_corr(nb_comp_corr);
2387 else if (motlu2==
"SOM")
2389 else if (motlu2==
"FACES")
2392 for (
int i=0; i<nb_comp_corr; i++)
2394 compo_corr[i] = source_compos_corr[i] +
"_"+loc_corr+
"_"+nom_dom;
2404 const Noms nom = champ_a_completer->get_property(
"nom");
2405 if (noms_champs_a_post_.contient(nom[0]))
2407 Cerr <<
"Postraitement::lire_champs_a_postraiter : duplicate field " << nom[0] << finl;
2411 noms_champs_a_post_.add(nom[0]);
2417 Cerr<<
"Verify the syntax of the wanted statistical fields for the postprocessing"<<finl;
2444 Nom nom_champ, nom_champ_a_post;
2447 Nom nume(num_morceau);
2449 ajout =
"Morceau_Equation { type ";
2451 ajout +=
" numero ";
2453 ajout +=
" option ";
2461 ajout +=
" source refChamp { Pb_champ ";
2462 ajout += mon_probleme->
le_nom();
2470 const Motcle& nom_eq = mon_probleme->equation(num_eq).
le_nom();
2474 if (type==
"operateur")
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";
2486 Cerr<<
"Only two numbers of operators are available."<<finl;
2487 Cerr<<
"0 for the diffusive operator and 1 for the convective operator."<<finl;
2493 Cerr<<
"Currently the only pieces of equations considered for the postprocessing"<<finl;
2494 Cerr<<
"are of type operator"<<finl;
2502 nom_champ += type_morceau;
2506 else if (
option==
"flux_bords" ||
option==
"flux_surfacique_bords")
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();
2512 nom_champ = mon_probleme->equation(num_eq).operateur(num_morceau).l_op_base().fichier();
2519 champ->
nommer(nom_champ);
2522 champ_a_completer->completer(*
this);
2526 nom_champ_a_post = nom_champ;
2527 if (noms_champs_a_post_.contient(nom_champ_a_post))
2529 Cerr <<
"Postraitement::lire_champs_a_postraiter : duplicate field " << nom_champ_a_post << finl;
2530 Cerr<<
" existing names "<<noms_champs_a_post_<<finl;
2534 noms_champs_a_post_.add(nom_champ_a_post);
2558 Motcle test_loc_bis(test_loc);
2559 test_loc_bis.
prefix(loc2);
2560 if (test_loc_bis!=test_loc)
2562 Cerr<<
"we must change the name "<< motlu1;
2568 Nom Nouveau(test_loc_bis);
2570 Cerr<<
" to " <<Nouveau<<finl;
2572 noms_champs_a_post_(noms_champs_a_post_.size()-1)=Nouveau;
2583 if (itr->comprend_champ_post(identifiant))
2592 if (itr->has_champ_post(nom))
2601 if (itr->has_champ_post(nom))
2604 throw std::runtime_error(std::string(
"Field ") + nom.
getString() + std::string(
" not found !"));
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];
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;
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;
Base class of generic fields having other generic fields as source. The use of the class methods reli...
Entity get_localisation(const int index=-1) const override
Returns the type of geometric entities on which the discrete values are attached (NODE for a P1 field...
virtual void lire_bidon(Entree &is) const
virtual int get_nb_sources() 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
Returns the time of the Champ_Generique_base.
virtual void fixer_serie(const double t1, const double t2)
class Champ_Generique_Correlation
const Integrale_tps_Champ & integrale() const override
A generic field constructed as an interpolation of another generic field (interpolation at vertices o...
const Noms & fixer_noms_compo(const Noms &noms) override
virtual int set_domaine(const Nom &nom_domaine, int exit_on_error=1)
Class initialization: initialization of the interpolation domain. Valid parameters: "" => native doma...
const Domaine & get_ref_domain() const override
Returns a ref to the domain on which the storage space will be evaluated.
Classe Champ_Generique_Statistiques_base Base class for generic field classes dedicated to statistics...
virtual const Integrale_tps_Champ & integrale() const =0
void use_source_name_only(bool b)
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
Returns the requested property.
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
Returns the type of geometric entities on which the discrete values are attached (NODE for a P1 field...
Special field class that encapsulates a reference to a volume field of TRUST of type Champ_base.
const Champ_base & get_champ(OWN_PTR(Champ_base)&espace_stockage) const override
See Champ_Generique_base::get_champ.
virtual DoubleTab & valeurs()=0
class Champ_base This class is the base of the fields hierarchy.
virtual DoubleTab & valeur_aux_faces_post(DoubleTab &result) const
int_t nb_som() const
Returns the number of vertices of the domain.
int face_sommets(int i, int j) const
Returns the index of the i-th vertex of face num_face.
int elem_faces(int i, int j) const
Returns the index of the i-th face of element num_elem; the face numbering convention is.
const Nom & le_nom() const override
Returns the name of the Objet_U. Virtual method to override: returns "neant" in this implementation.
class Domaine_dis_base This class is the base of the hierarchy of discretized domains.
Same as EChaine except here the input string comes from a datafile. Keeps a track of the lines that h...
An input stream whose source is a character string.
static int is_ecriture_special(int &special, int &a_faire)
Indicates whether the special format was requested in active writing by xyz save.
This class behaves like EChaine until the end of the string is reached.
Class defining operators and methods for all reading operation in an input flow (file,...
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
Returns the name of the field.
virtual int nb_comp() const
bool is_vectorial() const
virtual Nature_du_champ nature_du_champ() const
const Noms & noms_compo() const
Returns the array of names of the field components.
const Champ_Fonc_base & le_champ_calcule() const
Entree & interpreter_bloc(Entree &is, Bloc_Type bloc_type, int verifier_sans_interpreter)
Interprets a block of instructions read from input is.
static int objet_global_existant(const Nom &nom)
Returns a flag indicating whether an object with this name exists in interprete_courant() or one of i...
static Interprete_bloc & interprete_courant()
Returns the Interprete_bloc currently being read from the data set.
static Objet_U & objet_global(const Nom &nom)
Searches for the requested object in the current Interprete_bloc (Interprete_bloc::interprete_courant...
static Objet_U & objet(const Nom &)
See Interprete_bloc::objet_global(). BM: the Interprete class is not the best place for this.
This class implements the operators and virtual methods of the EFichier class as follows: The file to...
const Equation_base & equation() const
Returns the reference to the equation pointed to by MorEqn::mon_equation.
A character string (Nom) in uppercase.
int finit_par(const char *const n) const override
int debute_par(const char *const n) const override
An array of Motcle objects.
int contient_(const char *const ch) const
class Nom: a character string for naming TRUST objects.
const char * getChar() const
virtual int finit_par(const char *const n) const
const Nom getPrefix(const char *const) const
virtual int debute_par(const char *const n) const
virtual int find(const char *const n) const
Nom & prefix(const char *const)
Nom & majuscule()
Converts the name to uppercase. Only letters 'a'-'z' are modified.
Nom & suffix(const char *const)
Suffix extraction: Nom x("azerty");.
const std::string & getString() const
const Nom & le_nom() const override
Returns *this.
An array of character strings (VECT(Nom)).
int rang(const char *const ch) const
virtual void nommer(const Nom &)
Assigns a name to the Objet_U. Virtual method to override.
const Nom & que_suis_je() const
Returns the string identifying the class.
virtual Entree & readOn(Entree &)
Reads an Objet_U from an input stream. Virtual method to override.
static const Nom & nom_du_cas()
Returns a constant reference to the case name. This method is static.
virtual Sortie & printOn(Sortie &) const
Writes the object to an output stream. Virtual method to override.
class Operateur_Statistique_tps_base
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.
void ajouter(const char *keyword, const int *value, Param::Nature nat=Param::OPTIONAL)
Register an integer parameter.
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.
Base class for all post-processing objects.
virtual void associer_nom_et_pb_base(const Nom &, const Probleme_base &)
const Nom & le_nom() const override
Returns the name of the Objet_U. Virtual method to override: returns "neant" in this implementation.
class Postraitement. The class holds -a list of generic fields champs_post_complet_ containing
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
Restores an Objet_U from an input stream. Virtual method to override.
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
Saves an Objet_U to an output stream. Virtual method to override.
OWN_PTR(Format_Post_base) format_post_
int lire_motcle_non_standard(const Motcle &, Entree &) override
Reads non-simple-type parameters of an Objet_U from an input stream.
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_
output of data (fields, stats, int_array) every dt_post (a period in number of iterations)
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
int postraiter_tableaux()
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()
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 &)
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
Initializes the post-processing.
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)
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
Liste_Champ_Generique champs_post_complet_
void set_param(Param ¶m) const override
void creer_champ_post(const Motcle &motlu1, const Motcle &motlu2, Entree &s)
static LIST(Nom) &noms_fichiers_sondes()
Postraitement()
Default constructor.
int & est_le_premier_postraitement_pour_nom_fich()
double dt_post_
output of data (fields, stats, int_array) every dt_post (a time interval)
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
Returns the name of the Objet_U. Virtual method to override: returns "neant" in this implementation.
class Probleme_base It is a Probleme_U that is not a coupling.
bool has_domaine_dis() const
void get_noms_champs_postraitables(Noms &nom, Option opt=NONE) const override
const Domaine & domaine() const
Returns the domain associated with the problem.
virtual int comprend_champ_post(const Motcle &nom) const
virtual const Champ_Generique_base & get_champ_post(const Motcle &nom) const
const Schema_Temps_base & schema_temps() const
Returns the time scheme associated with the problem.
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
Returns the discretized domain associated with the problem (const version).
static void exit(int exit_code=-1)
Exit routine for TRUST within a Kokkos region.
static int je_suis_maitre()
Returns 1 if on the master processor of the current group (i.e. me() == 0), 0 otherwise.
double temps_courant() const
Returns the current time.
double pas_de_temps() const
Returns the current time step (delta_t).
int nb_pas_dt() const
Returns the number of time steps performed.
double temps_init() const
Returns the initial time.
Base class for output streams.
bool isDataOnDevice() const
void jump(Entree &) override
std::enable_if_t< is_default_exec_space< EXEC_SPACE >, View< _TYPE_, _SHAPE_ > > view_wo()
std::enable_if_t< is_default_exec_space< EXEC_SPACE >, ConstView< _TYPE_, _SHAPE_ > > view_ro() const
_SIZE_ dimension(int d) const
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_checkpoint()
static int is_PDI_restart()
void TRUST_start_sharing(const std::string &name, const void *data)
YAML_data class: collection of all needed information for data to save/restore in order to write the ...
void set_conditions(const std::string &cond)