TRUST 1.9.8
HPC thermohydraulic platform
Loading...
Searching...
No Matches
Format_Post_Lml.h
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#ifndef Format_Post_Lml_included
16#define Format_Post_Lml_included
17
18#include <TRUSTTabs_forward.h>
19#include <Format_Post_base.h>
20#include <EcrFicPartage.h>
21
22/*! @brief : Classe de postraitement des champs euleriens au format lml.
23 *
24 * Only works for small enough domains (domain exceeding the 32b limit can not be written in LML).
25 *
26 * Pour creer un fichier valide, il faut faire:
27 * (initialisation) initialize("base_nom_fichier",...);
28 * // base_nom_fichier indique le nom du fichier sans extension ".lml"
29 * // met eventuellement en jeux les informations d autres postraitements
30 * ecrire_entete(temps_courant,reprise,est_le_premier_post)
31 * ecrire_domaine(domaine,est_le_premier_post)
32 *
33 * (pour chaque dt) ecrire_temps(temps_courant)
34 * ecrire_champ(const Domaine& domaine, const Noms& unite_, const Noms& noms_compo,
35 * int ncomp,double temps_,double temps_courant
36 * const Nom & id_du_champ,
37 * const Nom & id_du_domaine,
38 * const Nom & localisation,
39 * const DoubleTab & data)
40 * [ecrire_champ(..., data)]
41 *
42 * (finir) finir(est_le_dernier_post)
43*/
45{
46 Declare_instanciable_sans_constructeur(Format_Post_Lml);
47public:
48 // Methodes declarees dans la classe de base (interface commune a tous
49 // les formats de postraitment de champs):
50 void reset() override;
51 void set_param(Param& param) const override;
52 int initialize_by_default(const Nom& file_basename) override;
53 int initialize(const Nom& file_basename, const int format, const Nom& option_para) override;
54 int ecrire_entete(const double temps_courant, const int reprise, const int est_le_premier_post) override;
55 int completer_post(const Domaine& dom, const int axi, const Nature_du_champ& nature, const int nb_compo, const Noms& noms_compo, const Motcle& loc_post, const Nom& le_nom_champ_post) override;
56
57 int preparer_post(const Nom& id_du_domaine, const int est_le_premier_post, const int reprise, const double t_init) override;
58 int finir(const int est_le_dernier_post) override;
59 int ecrire_domaine(const Domaine& domaine, const int est_le_premie_post) override;
60 int ecrire_temps(const double temps) override;
61
62 int ecrire_champ(const Domaine& domaine, const Noms& unite_, const Noms& noms_compo, int ncomp, double temps_, const Nom& id_du_champ, const Nom& id_du_domaine,
63 const Nom& localisation, const Nom& nature, const DoubleTab& data) override;
64
65 int ecrire_item_int(const Nom& id_item, const Nom& id_du_domaine, const Nom& id_domaine, const Nom& localisation, const Nom& reference, const IntVect& data, const int reference_size) override;
66
67 // Methodes statiques specifiques a ce format:
68
69 static int ecrire_domaine_lml(const Domaine& domaine, Nom& nom_fic);
70 static int ecrire_temps_lml(const double temps, Nom& nom_fic);
71
72 static int ecrire_champ_lml(const Domaine& domaine, const Noms& unite_, const Noms& noms_compo, int ncomp, double temps_, const Nom& id_du_champ, const Nom& id_du_domaine, const Nom& localisation,
73 const DoubleTab& data, Nom& nom_fic);
74
75 static int ecrire_item_int_lml(const Nom& id_item, const Nom& id_domaine, const IntVect& data, const Nom& nom_fic);
76
77 static int ecrire_entete_lml(Nom& nom_fic, const int est_le_premier_post);
78 static int finir_lml(Nom& nom_fic, const int est_le_dernier_post);
79 static int completer_post_lml();
80 static int preparer_post_lml();
81
83
84protected:
86};
87
88#endif
Nom lml_basename_
static int ecrire_champ_lml(const Domaine &domaine, const Noms &unite_, const Noms &noms_compo, int ncomp, double temps_, const Nom &id_du_champ, const Nom &id_du_domaine, const Nom &localisation, const DoubleTab &data, Nom &nom_fic)
void reset() override
Remet l'objet dans l'etat obtenu par le constructeur par defaut.
int ecrire_champ(const Domaine &domaine, const Noms &unite_, const Noms &noms_compo, int ncomp, double temps_, const Nom &id_du_champ, const Nom &id_du_domaine, const Nom &localisation, const Nom &nature, const DoubleTab &data) override
voir Format_Post_base::ecrire_champ
static int ecrire_domaine_lml(const Domaine &domaine, Nom &nom_fic)
static int finir_lml(Nom &nom_fic, const int est_le_dernier_post)
int preparer_post(const Nom &id_du_domaine, const int est_le_premier_post, const int reprise, const double t_init) override
int finir(const int est_le_dernier_post) override
int initialize(const Nom &file_basename, const int format, const Nom &option_para) override
void set_param(Param &param) const override
int initialize_by_default(const Nom &file_basename) override
Initialisation de la classe avec des parametres par defaut.
static int ecrire_entete_lml(Nom &nom_fic, const int est_le_premier_post)
int ecrire_entete(const double temps_courant, const int reprise, const int est_le_premier_post) override
static int ecrire_item_int_lml(const Nom &id_item, const Nom &id_domaine, const IntVect &data, const Nom &nom_fic)
int ecrire_domaine(const Domaine &domaine, const int est_le_premie_post) override
voir Format_Post_base::ecrire_domaine
Format_Post_Lml()
Constructeur par defaut: Specifier dans commentaire ce qui est fixe par defaut.
int ecrire_item_int(const Nom &id_item, const Nom &id_du_domaine, const Nom &id_domaine, const Nom &localisation, const Nom &reference, const IntVect &data, const int reference_size) override
Ecriture d'un tableau d'entiers dans le fichier de postraitement.
int ecrire_temps(const double temps) override
commence l'ecriture d'un nouveau pas de temps En l'occurence pour le format Lml:
static int completer_post_lml()
static int ecrire_temps_lml(const double temps, Nom &nom_fic)
static int preparer_post_lml()
int completer_post(const Domaine &dom, const int axi, const Nature_du_champ &nature, const int nb_compo, const Noms &noms_compo, const Motcle &loc_post, const Nom &le_nom_champ_post) override
Classe de base des formats de postraitements pour les champs (lata, med, cgns, lml,...
Une chaine de caractere (Nom) en majuscules.
Definition Motcle.h:26
class Nom Une chaine de caractere pour nommer les objets de TRUST
Definition Nom.h:31
Un tableau de chaine de caracteres (VECT(Nom)).
Definition Noms.h:26
static int axi
Definition Objet_U.h:101
Helper class to factorize the readOn method of Objet_U classes.
Definition Param.h:112