TrioCFD 1.9.9_beta
TrioCFD documentation
Loading...
Searching...
No Matches
Champ_Gen_de_Champs_Gen.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 Champ_Gen_de_Champs_Gen_included
17#define Champ_Gen_de_Champs_Gen_included
18
19#include <Liste_Champ_Generique.h>
20#include <TRUST_List.h>
21#include <TRUST_Ref.h>
22#include <Champ_Fonc_base.h>
23
24/*! @brief Base class of generic fields having other generic fields as source. The use of the class methods relies on a recursion principle
25 *
26 * An instruction will generally be applied (or delegated) to a generic source
27 * field which itself will apply (or delegate) the action
28 *
29 */
30
31// Typical syntax for instantiable derived classes
32// "field_name" "generic_field_type" { source "generic_field_type" { source ... } }
33// or
34// "field_name" "generic_field_type" { source_reference "source_ref_name" }
35// "field_name" set by the user will be the name of the generic field
36// "generic_field_type" designates the type of the selected generic field
37// source_ref_name designates the name of an already defined generic field
38
40{
41 Declare_base(Champ_Gen_de_Champs_Gen);
42public:
43
44 void set_param(Param& param) const override;
45 int lire_motcle_non_standard(const Motcle&, Entree&) override;
46 void reset() override;
47 std::vector<YAML_data> data_a_sauvegarder() const override;
48 int sauvegarder(Sortie& os) const override;
49 int reprendre(Entree& is) override;
50 void completer(const Postraitement_base& post) override;
51 void mettre_a_jour(double temps) override;
52
53 virtual OWN_PTR(Champ_Fonc_base)& creer_espace_stockage(const Nature_du_champ& nature,
54 const int nb_comp,
55 OWN_PTR(Champ_Fonc_base)& es_tmp) const;
56
57 virtual const Champ_Generique_base& get_source(int i) const;
59 virtual int get_nb_sources() const;
60 int get_dimension() const override;
61 void get_property_names(Motcles& list) const override;
62 double get_time() const override;
63
64 const Probleme_base& get_ref_pb_base() const override;
65 const Discretisation_base& get_discretisation() const override;
66 const Motcle get_directive_pour_discr() const override;
67
68 const Noms get_property(const Motcle& query) const override;
69 Entity get_localisation(const int index = -1) const override;
70
71 const DoubleTab& get_ref_values() const override;
72 void get_copy_values(DoubleTab&) const override;
73 void get_xyz_values(const DoubleTab& coords, DoubleTab& values, ArrOfBit& validity_flag) const override;
74
75 const Domaine& get_ref_domain() const override;
76 void get_copy_domain(Domaine&) const override;
77
78 const Domaine_dis_base& get_ref_domaine_dis_base() const override;
79 const Domaine_Cl_dis_base& get_ref_zcl_dis_base() const override;
80
81 const DoubleTab& get_ref_coordinates() const override;
82 void get_copy_coordinates(DoubleTab&) const override;
83 const IntTab& get_ref_connectivity(Entity index1, Entity index2) const override;
84 void get_copy_connectivity(Entity index1, Entity index2, IntTab&) const override;
85
86 void nommer_sources(const Postraitement_base& post);
87 virtual void nommer_source();
88 void set_parent_name(const Nom& nom) { parent_name_ = nom; }
89 const Nom& get_parent_name() const { return parent_name_; }
90
91 int get_info_type_post() const override;
92
93 const Champ_Generique_base& get_champ_post(const Motcle& nom) const override;
94 bool has_champ_post(const Motcle& nom) const override;
95 int comprend_champ_post(const Motcle& identifiant) const override;
96
97 //Method to change t_deb and t_fin for statistics restarts
98 //or for series statistics
99 virtual void fixer_serie(const double t1,const double t2);
100 virtual void fixer_tstat_deb(const double t1,const double t2);
101 virtual void lire_bidon(Entree& is) const;
102
103protected:
104 Nom parent_name_; //Name of the field for which I am the source
105 LIST(OWN_PTR(Champ_Generique_base)) sources_; //Attribute designating "first-level" sources
106 LIST(Nom) noms_sources_ref_;
107 LIST(OBS_PTR(Champ_Generique_base)) sources_reference_; //allows creating a source by referencing a
108};
109
110#endif
class Champ_Fonc_base Base class of fields that are functions of a calculated quantity
Base class of generic fields having other generic fields as source. The use of the class methods reli...
void get_copy_values(DoubleTab &) const override
Fills the values array with the discrete values of the field (creates a copy).
void mettre_a_jour(double temps) override
int sauvegarder(Sortie &os) const override
save the different sources
void set_parent_name(const Nom &nom)
const IntTab & get_ref_connectivity(Entity index1, Entity index2) const override
Returns the connectivity array between the geometric entity index1 and entity index2.
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...
const Nom & get_parent_name() const
LIST(OWN_PTR(Champ_Generique_base)) sources_
const DoubleTab & get_ref_coordinates() const override
Returns a reference to the array of coordinates of the vertices of the mesh supporting the field,...
virtual void lire_bidon(Entree &is) const
int comprend_champ_post(const Motcle &identifiant) const override
void nommer_sources(const Postraitement_base &post)
int get_info_type_post() const override
virtual void fixer_tstat_deb(const double t1, const double t2)
const Noms get_property(const Motcle &query) const override
Returns the requested property.
const Champ_Generique_base & get_champ_post(const Motcle &nom) const override
virtual OWN_PTR(Champ_Fonc_base) &creer_espace_stockage(const Nature_du_champ &nature
void completer(const Postraitement_base &post) override
int reprendre(Entree &is) override
resume the different sources
const Probleme_base & get_ref_pb_base() const override
Returns the problem that carries the target field.
void get_property_names(Motcles &list) const override
Returns the list of possible "queries" for the field.
void get_copy_coordinates(DoubleTab &) const override
std::vector< YAML_data > data_a_sauvegarder() const override
for PDI IO: retrieve name, type and dimensions of the field to save/restore
virtual const int OWN_PTR(Champ_Fonc_base) &es_tmp) const
void get_copy_connectivity(Entity index1, Entity index2, IntTab &) const override
void get_xyz_values(const DoubleTab &coords, DoubleTab &values, ArrOfBit &validity_flag) const override
Computes the point value of the field at the coordinates given in coords and puts them in values.
int get_dimension() const override
Returns the dimension of the space in which the field is defined.
const Domaine & get_ref_domain() const override
Returns a ref to the domain on which the storage space will be evaluated.
void get_copy_domain(Domaine &) const override
Creates a copy of the domain on which the storage space will be evaluated.
bool has_champ_post(const Motcle &nom) const override
const Domaine_Cl_dis_base & get_ref_zcl_dis_base() const override
Returns a ref to the discretized boundary conditions domain of the equation carrying the target field...
virtual const Champ_Generique_base & get_source(int i) const
void set_param(Param &param) const override
virtual Champ_Generique_base & set_source(int i)
const Motcle get_directive_pour_discr() const override
Returns the directive (champ_elem, champ_sommets, champ_face or pression) to launch the discretizatio...
const Discretisation_base & get_discretisation() const override
Returns the discretization associated with the problem.
const Domaine_dis_base & get_ref_domaine_dis_base() const override
Returns a ref to the discretized domain on which the storage space will be evaluated.
double get_time() const override
Returns the time of the Champ_Generique_base.
LIST(Nom) noms_sources_ref_
int lire_motcle_non_standard(const Motcle &, Entree &) override
Reads non-simple-type parameters of an Objet_U from an input stream.
virtual void fixer_serie(const double t1, const double t2)
LIST(OBS_PTR(Champ_Generique_base)) sources_reference_
const DoubleTab & get_ref_values() const override
Returns a reference to the array of discrete values if it exists in memory.
class Champ_Generique_base
OBS_PTR(Probleme_base) ref_pb_
class Discretisation_base This class represents a spatial discretization scheme, which
class Domaine_Cl_dis_base Domaine_Cl_dis_base objects represent discretized boundary conditions
class Domaine_dis_base This class is the base of the hierarchy of discretized domains.
Class defining operators and methods for all reading operation in an input flow (file,...
Definition Entree.h:42
A character string (Nom) in uppercase.
Definition Motcle.h:26
An array of Motcle objects.
Definition Motcle.h:63
class Nom: a character string for naming TRUST objects.
Definition Nom.h:31
An array of character strings (VECT(Nom)).
Definition Noms.h:26
friend class Entree
Definition Objet_U.h:71
friend class Sortie
Definition Objet_U.h:70
Helper class to factorize the readOn method of Objet_U classes.
Definition Param.h:112
Base class for all post-processing objects.
class Probleme_base It is a Probleme_U that is not a coupling.