TrioCFD 1.9.9_beta
TrioCFD documentation
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 : Post-processing class for Eulerian fields in LML format.
23 *
24 * Only works for small enough domains (domain exceeding the 32b limit can not be written in LML).
25 *
26 * To create a valid file, the following steps are needed:
27 * (initialization) initialize("base_file_name",...);
28 * // base_file_name specifies the file name without the ".lml" extension
29 * // optionally involves information from other post-processings
30 * ecrire_entete(temps_courant,reprise,est_le_premier_post)
31 * ecrire_domaine(domaine,est_le_premier_post)
32 *
33 * (for each 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 * (finalize) finir(est_le_dernier_post)
43*/
45{
46 Declare_instanciable_sans_constructeur(Format_Post_Lml);
47public:
48 // Methods declared in the base class (common interface for all
49 // field post-processing formats):
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 // Static methods specific to this 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
Resets the object to the state obtained by the default constructor.
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
see 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
Initializes the class with default parameters.
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
see Format_Post_base::ecrire_domaine
Format_Post_Lml()
Default constructor: specify in comments what is set by default.
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
Writing an integer array to the post-processing file.
int ecrire_temps(const double temps) override
Starts writing a new time step. For the LML format specifically:
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
Base class for post-processing output formats for fields (lata, med, cgns, lml, single_lata).
A character string (Nom) in uppercase.
Definition Motcle.h:26
class Nom: a character string for naming TRUST objects.
Definition Nom.h:31
An array of character strings (VECT(Nom)).
Definition Noms.h:26
static int axi
Definition Objet_U.h:96
Helper class to factorize the readOn method of Objet_U classes.
Definition Param.h:112