16#include <Postraitement_FTD_base.h>
17#include <Transport_Marqueur_FT.h>
18#include <Probleme_FT_Disc_gen.h>
19#include <Format_Post_Lata.h>
20#include <Format_Post_CGNS.h>
30 const Nom& type_pb = mon_probleme->que_suis_je();
32 if ((type_pb !=
"Probleme_FT_Disc_gen") && (!type_pb.
debute_par(
"Pb_Thermohydraulique_Especes")))
34 Cerr <<
"Error in Postraitement_FTD_base::readOn !! " <<
que_suis_je() <<
" is not accepted for a problem of type " << type_pb << finl;
35 Cerr <<
"The recognized problems are :" << finl;
36 Cerr <<
" - Probleme_FT_Disc_gen " << finl;
37 Cerr <<
" - Pb_Thermohydraulique_Especes_QC " << finl;
38 Cerr <<
" - Pb_Thermohydraulique_Especes_Turbulent_QC " << finl;
44 if (!sub_type(Format_Post_Lata, format_post_.valeur()) && !sub_type(Format_Post_CGNS, format_post_.valeur()))
46 Cerr <<
"****************************************************************************" << finl;
47 Cerr <<
"*** WARNING WARNING ***" << finl;
48 Cerr <<
" You are processing a FT problem, but you are using the format " << format_post_->que_suis_je() <<
" !! " << finl;
49 Cerr <<
" The interfaces will **not** be post-processed and will be ignored." << finl << finl;
50 Cerr <<
" You should use the 'LATA' or 'CGNS' format (directive 'format lata /or/ cgns') if you like to visualize the interfaces." << finl;
51 Cerr <<
"****************************************************************************" << finl;
64 if (mot==
"interfaces")
72 Cerr <<
"**** Output format is not LATA /or/ CGNS, interfaces will be silently ignored." << finl;
74 refequation_interfaces.reset();
88 if (refequation_interfaces)
90 Cerr <<
"Only one transport interface equation name can be specified for a Postraitement_FTD_base post-process." << finl;
91 Cerr <<
"The " <<
Motcle(refequation_interfaces->le_nom()) <<
" has already been read for the post-process " << (*this).
le_nom() << finl;
92 Cerr <<
"Please, create a new Postraitement_ftd post-process for the " << motlu <<
" transport interface equation." << finl;
96 Cerr <<
"Post-processing for the interface of transport equation : " << motlu << finl;
104 for (
int i = 0; i < mon_probleme->nombre_d_equations(); i++)
106 const Nom& nom_eq = mon_probleme->equation(i).
le_nom();
113 if (!refequation_interfaces)
115 Cerr <<
"No interface equation name " << motlu <<
" has been found. " << finl;
120 if (motlu ==
"no_virtuals")
128 Cerr <<
"ERROR: Postraitement_ft_lata::lire_entete_bloc_interface : '{' was expected after the keyword interfaces\n";
129 Cerr <<
" We found '" << motlu <<
"'" << finl;
143 if (nom_champ ==
"}")
break;
155 else if (loc_lu ==
"elem")
159 Cerr <<
"Error for Postraitement_FTD_base::register_interface_field !! '" << loc_lu <<
"' has been read. " << finl;
160 Cerr <<
" Keyword 'som' or 'elem' was expected after the field name '" << nom_champ <<
"'" << finl;
170 Cerr <<
"Error for Postraitement_FTD_base::register_interface_field :\n";
171 Cerr <<
" The field '" << nom_champ <<
"' is not understood for the " << (eq_interfaces.
que_suis_je() ==
"Transport_Marqueur_FT" ?
"particules" :
"interfaces")
172 <<
" or not authorized at localisation '";
173 Nom tmp = ((loc ==
SOMMETS) ?
"sommets" :
"elements");
174 Cerr << tmp <<
"'" << finl;
183 liste.add(nom_champ);
191 if (refequation_interfaces)
204 const Maillage_FT_Disc& mesh = refequation_interfaces->maillage_interface_pour_post();
205 const IntTab& fa7 = mesh.
facettes();
214 for (
int i = 0; i < nl; i++)
220 for (
int j = 0; j < nc; j++)
221 new_fa7(sz - 1, j) = fa7(i, j);
229 const int nl =
static_cast<int>(
renum_.size()), nc = dtab.
dimension(1);
232 for (
int i = 0; i < nl; i++)
233 for (
int j = 0; j < nc; j++)
234 new_dtab(i, j) = dtab(
renum_[i], j);
249 Cerr <<
"Type " << refequation_interfaces->que_suis_je() <<
" not recognized" << finl;
252 const Maillage_FT_Disc& mesh = refequation_interfaces->maillage_interface_pour_post();
253 const DoubleTab& sommets = mesh.
sommets();
254 const IntTab& fa7 = mesh.
facettes();
256 Motcle type_elem = dim == 2 ?
"Segment" :
"Triangle";
284 throw std::runtime_error(
"Postraitement_FTD_base::ecrire_maillage_ft_disc => Unsupported post format");
292 if (!refequation_interfaces)
return;
296 const double temps_courant = mon_probleme->schema_temps().temps_courant();
301 for (
int num_loc = 0; num_loc < 2; num_loc++)
309 const int nb_champs = liste.size();
313 const char *som_elem = loc ==
SOMMETS ?
"SOM" :
"ELEM";
318 for (
int i = 0; i < nb_champs; i++)
320 const Motcle& nom_du_champ = liste[i];
332 for (
int j = 0; j < n; j++)
333 dtab(j, 0) = (double) itab(j);
335 for (
int j = 0; j < n; j++)
336 for (
int k = 0; k < m; k++)
337 dtab(j, k) = (double) itab(j, k);
342 Cerr <<
"Error for Postraitement_FTD_base::postprocess_field_values" << finl;
343 Cerr <<
"Unknown field : " << nom_du_champ << finl;
348 const int nb_items_attendus = loc ==
SOMMETS ? nb_sommets_local : nb_facettes_local;
349 const char *msg = loc ==
SOMMETS ?
" nb_noeuds " :
" nb_facettes ";
351 if (nb_items != nb_items_attendus)
353 Cerr <<
"Error for Postraitement_FTD_base::postprocess_field_values" << finl;
354 Cerr << msg <<
"= " << nb_items << finl;
355 Cerr << msg <<
"expected = " << nb_items_attendus << finl;
359 Noms unites(nb_compo), noms_compo;
360 std::string cp[3] = {
"X",
"Y",
"Z" };
361 for (
int nc = 0; nc < nb_compo; nc++)
364 noms_compo.add(nc < 3 ? cp[nc] :
Nom(nc));
368 Nom nature = nb_compo == 1 ?
"scalar" :
"vectorial";
369 const int component_to_process = -1;
375 postraiter_tableau(dummy_dom, unites, noms_compo, component_to_process, temps_courant, nom_du_champ, som_elem, nature, new_dtab);
378 postraiter_tableau(dummy_dom, unites, noms_compo, component_to_process, temps_courant, nom_du_champ, som_elem, nature, dtab);
void nommer(const Nom &nom) override
Donne un nom a l'Objet_U Methode virtuelle a surcharger.
Class defining operators and methods for all reading operation in an input flow (file,...
int ecrire_domaine_low_level(const Domaine *, const Nom &, const DoubleTab &, const IntTab &, const Motcle &)
: Classe de postraitement des champs euleriens au format lata
void ecrire_domaine_low_level(const Nom &id_dom, const DoubleTab &sommets, const IntTab &elements, const Motcle &type_elem)
Low level routine to write a mesh into a LATA file.
: class Maillage_FT_Disc Cette classe decrit un maillage:
const DoubleTab & sommets() const
renvoie le tableau des sommets (reels et virtuels) dimension(0) = nombre de sommets,
int facette_virtuelle(int i) const
Renvoie 0 si la facette m'appartient, 1 sinon.
const IntTab & facettes() const
renvoie le tableau des facettes (reelles et virtuelles) dimension(0) = nombre de facettes,
Une chaine de caractere (Nom) en majuscules.
Un tableau d'objets de la classe Motcle.
int contient_(const char *const ch) const
class Nom Une chaine de caractere pour nommer les objets de TRUST
virtual int debute_par(const char *const n) const
const Nom & le_nom() const override
Renvoie *this;.
Un tableau de chaine de caracteres (VECT(Nom)).
const Nom & que_suis_je() const
renvoie la chaine identifiant la classe.
virtual Entree & readOn(Entree &)
Lecture d'un Objet_U sur un flot d'entree Methode a surcharger.
virtual Sortie & printOn(Sortie &) const
Ecriture de l'objet sur un flot de sortie Methode a surcharger.
std::vector< int > renum_
virtual void register_interface_field(const Motcle &nom_champ, const Motcle &loc_lu)
void filter_out_array(const DoubleTab &dtab, DoubleTab &new_dtab) const
int filter_out_virtual_fa7(IntTab &new_fa7)
Build a reduced version of the facettes array, excluding virtual ones Also update the internal renumb...
void lire_champs_interface(Entree &)
lecture de la liste de champs aux interfaces a postraiter
int ecrire_maillage_ft_disc()
Write the Maillage_FT_Disc object into a LATA file in V2 format.
Motcles liste_champs_i_aux_elements
Motcles liste_champs_i_aux_sommets
void postprocess_field_values() override
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.
int write_extra_mesh() override
Override. Add the interfaces to the file output.
virtual void lire_entete_bloc_interface(Entree &is)
static const char *const demande_description
classe Postraitement La classe est dotee -d une liste de champs generiques champs_post_complet_ qui c...
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 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 add_locs_required_if_not(const Motcle &)
virtual const Transport_Interfaces_FT_Disc & equation_interfaces(const Motcle &nom) const
static int nproc()
renvoie le nombre de processeurs dans le groupe courant Voir Comm_Group::nproc() et PE_Groups::curren...
static void exit(int exit_code=-1)
Routine de sortie de TRUST dans une region Kokkos.
Classe de base des flux de sortie.
void resize(_SIZE_ n, RESIZE_OPTIONS opt=RESIZE_OPTIONS::COPY_INIT)
_SIZE_ dimension(int d) const
virtual int get_champ_post_FT(const Motcle &champ, Postraitement_base::Localisation loc, DoubleTab *dtab=0) const
Cherche le champ discret aux interfaces dont le nom est "champ", et verifie qu'il peut etre postraite...
virtual const Maillage_FT_Disc & maillage_interface_pour_post() const
Renvoie le maillage stocke specialement pour le postraitement (si on veut postraiter un etat intermed...