TrioCFD 1.9.9_beta
TrioCFD documentation
Loading...
Searching...
No Matches
Champ_Generique_refChamp.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_Generique_refChamp_included
17#define Champ_Generique_refChamp_included
18
19#include <Postraitement.h>
20
21/*! @brief Special field class that encapsulates a reference to a volume field of TRUST of type Champ_base.
22 *
23 * The class does not manage the memory of Champ_base.
24 *
25 */
26
27// Syntax to follow in the data file
28//
29// "field_name" refChamp { Pb_champ "pb_name" "discrete_field_name" }
30// "field_name" set by the user will be the name of the generic field
31// "pb_name" name of the problem to which the discrete field belongs
32// "discrete_field_name" name of the target field or one of its components
33
35{
36 Declare_instanciable(Champ_Generique_refChamp);
37public:
38
39 void initialize(const Champ_base& champ);
40 void set_param(Param& param) const override;
41 int lire_motcle_non_standard(const Motcle&, Entree&) override;
42 int get_dimension() const override;
43 void get_property_names(Motcles& list) const override;
44 const Noms get_property(const Motcle& query) const override;
45 Entity get_localisation(const int index = -1) const override;
46
47 const DoubleTab& get_ref_values() const override;
48 void get_copy_values(DoubleTab&) const override;
49 void get_xyz_values(const DoubleTab& coords, DoubleTab& values, ArrOfBit& validity_flag) const override;
50
51 const Domaine_Cl_dis_base& get_ref_zcl_dis_base() const override;
52
53 const DoubleTab& get_ref_coordinates() const override;
54 void get_copy_coordinates(DoubleTab&) const override;
55 const IntTab& get_ref_connectivity(Entity index1, Entity index2) const override;
56 void get_copy_connectivity(Entity index1, Entity index2, IntTab&) const override;
57
58 const Probleme_base& get_ref_pb_base() const override;
59 void reset() override;
60 void completer(const Postraitement_base& post) override;
61 void mettre_a_jour(double temps) override;
62
63 //Particular get_champ() that does not use a storage space
64 //Updates the discrete field if it is a computed field of the problem
65 //and returns the reference
66 const Champ_base& get_champ(OWN_PTR(Champ_base)& espace_stockage) const override;
67 const Champ_base& get_champ_without_evaluation(OWN_PTR(Champ_base)& espace_stockage) const override;
68 virtual const Champ_base& get_ref_champ_base() const; //returns the reference to the encapsulated field
69
70 virtual void set_ref_champ(const Champ_base&);
71
72 double get_time() const override;
73 const Motcle get_directive_pour_discr() const override;
74 void set_nom_champ(const Motcle&);
75 void nommer_source(const Postraitement_base& post);
76 int get_info_type_post() const override;
77
78 //The compo_ attribute of Champ_Generique_refChamp is only filled for CGNS
79 //instances created by macro, in order to reproduce component names for face fields
80 const Noms& fixer_noms_compo(const Noms& noms) override;
81 const Noms& fixer_noms_synonyms(const Noms& noms) override;
82
83protected:
85
86 OBS_PTR(Champ_base) ref_champ_;
87 mutable OWN_PTR(Champ_base) ptr_champ_; /* XXX Elie Saikali : not sure what to do here */
88
89 //temporary - check usefulness
91
93
94};
95#endif
class Champ_Generique_base
Special field class that encapsulates a reference to a volume field of TRUST of type Champ_base.
void initialize(const Champ_base &champ)
Initialize the class with the given field.
void get_xyz_values(const DoubleTab &coords, DoubleTab &values, ArrOfBit &validity_flag) const override
call to Champ_base::valeur_aux()
int get_dimension() const override
Returns the number of coordinates of each vertex of the domain.
void mettre_a_jour(double temps) override
See Champ_Generique_base::mettre_a_jour If the field is a champ_inc in the equation,...
virtual void set_ref_champ(const Champ_base &)
Associates the field and determines its localisation.
void get_copy_values(DoubleTab &) const override
Creates a copy of the value array. See GenericField_base::get_copy_values().
void nommer_source(const Postraitement_base &post)
void get_property_names(Motcles &list) const override
Returns the list of possible "queries" for the field.
virtual const Champ_base & get_ref_champ_base() const
Returns the underlying champ_base.
int lire_motcle_non_standard(const Motcle &, Entree &) override
Reads non-simple-type parameters of an Objet_U from an input stream.
double get_time() const override
Returns the time of the Champ_Generique_base.
const DoubleTab & get_ref_values() const override
Verifies that the field is indeed a discrete field and returns the value array.
OWN_PTR(Champ_base) ptr_champ_
const Champ_base & get_champ(OWN_PTR(Champ_base)&espace_stockage) const override
See Champ_Generique_base::get_champ.
const DoubleTab & get_ref_coordinates() const override
Returns a reference to the array of coordinates of the vertices of the mesh supporting the field,...
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...
void get_copy_coordinates(DoubleTab &) const override
const Motcle get_directive_pour_discr() const override
Returns the directive (champ_elem, champ_sommets, champ_face or pression) to launch the discretizatio...
void set_param(Param &param) const override
pb_champ : triggers the reading of the problem name (nom_pb_) to which the discrete field belongs and...
const Champ_base & get_champ_without_evaluation(OWN_PTR(Champ_base)&espace_stockage) const override
OBS_PTR(Champ_base) ref_champ_
const Probleme_base & get_ref_pb_base() const override
Returns the problem that carries the target field.
Entity get_localisation(const int index=-1) const override
If the field is not a discrete field: exception Champ_Generique_erreur("INVALID") Otherwise,...
const Noms & fixer_noms_synonyms(const Noms &noms) override
void get_copy_connectivity(Entity index1, Entity index2, IntTab &) const override
const Noms & fixer_noms_compo(const Noms &noms) override
const IntTab & get_ref_connectivity(Entity index1, Entity index2) const override
Returns the connectivity array between the geometric entity index1 and entity index2.
const Noms get_property(const Motcle &query) const override
Returns the requested property.
void completer(const Postraitement_base &post) override
class Champ_base This class is the base of the fields hierarchy.
Definition Champ_base.h:43
class Domaine_Cl_dis_base Domaine_Cl_dis_base objects represent discretized boundary conditions
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
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.