TRUST 1.9.8
HPC thermohydraulic platform
Loading...
Searching...
No Matches
Format_Post_CGNS.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
16#ifndef Format_Post_CGNS_included
17#define Format_Post_CGNS_included
18
19#include <Format_Post_base.h>
20#include <Ecrire_CGNS.h>
21
22/*! @brief classe Format_Post_CGNS
23 *
24 * The CFD General Notation System (CGNS) provides a general, portable, and extensible standard for the storage and
25 * retrieval of computational fluid dynamics (CFD) analysis data. It consists of a collection of conventions,
26 * and free and open software implementing those conventions. It is self-descriptive, machine-independent, well-documented,
27 * and administered by an international steering committee.
28 *
29 * It is also an American Institute of Aeronautics and Astronautics (AIAA) Recommended Practice.
30 * The system consists of two parts: (1) a standard data model and mapping format for recording the data,
31 * and (2) software that reads, writes, and modifies data in that format. The format is a conceptual entity established by
32 * the documentation; the software is a physical product supplied to enable developers to access and produce data recorded
33 * in that format.
34 *
35 * The CGNS system is designed to facilitate the exchange of data between sites and applications, and to help stabilize
36 * the archiving of aerodynamic data. The data are stored in a compact, binary format and are accessible through a complete and
37 * extensible library of functions.
38 * The API (Application Program Interface) is platform independent and can be easily implemented in C, C++, Fortran and
39 * Fortran90 applications.
40 *
41 * CGNS is self-describing, allowing an application to interpret the structure and contents of a file without any outside information.
42 * CGNS can make use of either two different low-level data formats:
43 *
44 * - an internally developed and supported method called Advanced Data Format (ADF),
45 * based on a common file format system previously in use at McDonnell Douglas,
46 *
47 *
48 * - HDF5, a widely used hierarchical data format
49 *
50 * see : https://cgns.github.io/cgns-modern.github.io/index.html
51 * https://en.wikipedia.org/wiki/CGNS
52 *
53 */
54
56{
57 Declare_instanciable_sans_constructeur(Format_Post_CGNS);
58public:
60
61 void reset() override;
62 void set_param(Param& param) const override;
63 void set_postraiter_domain() override;
64 void set_deformable_domain() override;
65 void set_lagrangian_domain() override;
66 void set_discr_type(const Nom&) override;
67 void set_loc_vector(const std::vector<std::string>&) override;
68 void resetTime(double t, const std::string dirname) override;
69 int initialize_by_default(const Nom&) override;
70 int initialize(const Nom&, const int, const Nom&) override;
71
72 int completer_post(const Domaine&, const int, const Nature_du_champ&, const int, const Noms&, const Motcle&, const Nom&) override { return 1; }
73 int preparer_post(const Nom&, const int, const int, const double) override { return 1; }
74
75 int ecrire_entete(const double, const int, const int) override;
76 int ecrire_temps(const double) override;
77 int finir(const int) override;
78 int finir_ecriture(double) override;
79
80 void ecrire_domaine_dual(const Domaine& , const int ) override;
81 int ecrire_domaine_dis(const Domaine& ,const OBS_PTR(Domaine_dis_base)& ,const int ) override;
82 int ecrire_domaine(const Domaine&, const int) override;
83 int ecrire_domaine_low_level(const Domaine * ,const Nom& , const DoubleTab& , const IntTab& , const Motcle& );
84 int ecrire_item_int(const Nom&, const Nom&, const Nom&, const Nom&, const Nom&, const IntVect&, const int) override { return 1; }
85 int ecrire_champ(const Domaine&, const Noms&, const Noms&, int, double, const Nom&, const Nom&, const Nom&, const Nom&, const DoubleTab&) override;
86
87#ifdef HAS_CGNS
88 // pour simplifier la vie
89 inline Ecrire_CGNS& get_cgns_writer() { return cgns_writer_; }
90 inline const Ecrire_CGNS& get_cgns_writer() const { return cgns_writer_; }
91#endif
92
93private:
94 Nom cgns_basename_;
95#ifdef HAS_CGNS
96 Ecrire_CGNS cgns_writer_;
97#endif
98};
99
100#endif /* Format_Post_CGNS_included */
classe Domaine_dis_base Cette classe est la base de la hierarchie des domaines discretisees.
Writer TRUST -> CGNS for post-processing outputs.
Definition Ecrire_CGNS.h:59
void set_lagrangian_domain() override
void ecrire_domaine_dual(const Domaine &, const int) override
int ecrire_domaine(const Domaine &, const int) override
Ecriture d'un maillage.
void set_loc_vector(const std::vector< std::string > &) override
int ecrire_item_int(const Nom &, const Nom &, const Nom &, const Nom &, const Nom &, const IntVect &, const int) override
Ecriture d'un tableau d'entiers dans le fichier de postraitement.
void set_discr_type(const Nom &) override
int ecrire_champ(const Domaine &, const Noms &, const Noms &, int, double, const Nom &, const Nom &, const Nom &, const Nom &, const DoubleTab &) override
Ecriture d'un champ dans le fichier de postraitement.
int initialize_by_default(const Nom &) override
Initialise le fichier avec des parametres appropries pour son format (exemple: format ascii,...
int initialize(const Nom &, const int, const Nom &) override
void set_param(Param &param) const override
int completer_post(const Domaine &, const int, const Nature_du_champ &, const int, const Noms &, const Motcle &, const Nom &) override
int ecrire_domaine_low_level(const Domaine *, const Nom &, const DoubleTab &, const IntTab &, const Motcle &)
Format_Post_CGNS()
int finir(const int) override
void reset() override
void set_deformable_domain() override
int ecrire_entete(const double, const int, const int) override
int preparer_post(const Nom &, const int, const int, const double) override
void set_postraiter_domain() override
void resetTime(double t, const std::string dirname) override
int finir_ecriture(double) override
int ecrire_temps(const double) override
Commence l'ecriture d'un pas de temps.
int ecrire_domaine_dis(const Domaine &, const OBS_PTR(Domaine_dis_base)&, const int) override
Classe de base des formats de postraitements pour les champs (lata, med, cgns, lml,...
OBS_PTR(Domaine_dis_base) domaine_dis_
Reference to the discretized domain - used for face fields.
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
Helper class to factorize the readOn method of Objet_U classes.
Definition Param.h:112