TrioCFD 1.9.9_beta
TrioCFD documentation
Loading...
Searching...
No Matches
Champ_Generique_modifier_pour_QC.cpp
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#include <Champ_Generique_modifier_pour_QC.h>
17#include <Postraitement.h>
18#include <Modifier_pour_fluide_dilatable.h>
19#include <Equation_base.h>
20#include <Fluide_Quasi_Compressible.h>
21#include <Param.h>
22
23Implemente_instanciable_sans_constructeur(Champ_Generique_modifier_pour_QC,"modifier_pour_QC",Champ_Gen_de_Champs_Gen);
24
28
30{
31 return s << que_suis_je() << " " << le_nom();
32}
33
35{
37 return s ;
38}
39
45
47{
49 const Postraitement& mon_post = ref_cast(Postraitement,post);
50 mon_milieu_ = mon_post.probleme().equation(0).milieu();
51}
52
54{
55 OWN_PTR(Champ_base) source_espace_stockage;
56 const Champ_base& source = get_source(0).get_champ_without_evaluation(source_espace_stockage);
57 Nature_du_champ nature_source = source.nature_du_champ();
58 int nb_comp = source.nb_comp();
60 espace_stockage = creer_espace_stockage(nature_source,nb_comp,es_tmp);
61 return espace_stockage;
62}
64{
65 OWN_PTR(Champ_base) source_espace_stockage;
66 const Champ_base& source = get_source(0).get_champ(source_espace_stockage);
67 Nature_du_champ nature_source = source.nature_du_champ();
68 int nb_comp = source.nb_comp();
70 espace_stockage = creer_espace_stockage(nature_source,nb_comp,es_tmp);
71
72 DoubleTab& val = espace_stockage->valeurs();
73 val = source.valeurs();
74 const Fluide_Quasi_Compressible& fluide = ref_cast(Fluide_Quasi_Compressible,mon_milieu_.valeur());
75 multiplier_diviser_rho(val,fluide,diviser_);
77 return espace_stockage;
78}
79
80// Names the field as a default source:
81// "Modifier_pour_QC_"+nom_champ_source
83{
84 if (nom_post_=="??")
85 {
86 Nom nom_post_source, nom_champ_source;
87 const Noms nom = get_source(0).get_property("nom");
88 nom_champ_source = nom[0];
89 nom_post_source = "Modifier_pour_QC_";
90 nom_post_source += nom_champ_source;
91 nommer(nom_post_source);
92 }
93}
94
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...
virtual OWN_PTR(Champ_Fonc_base) &creer_espace_stockage(const Nature_du_champ &nature
void completer(const Postraitement_base &post) override
virtual const Champ_Generique_base & get_source(int i) const
void set_param(Param &param) const override
virtual const Noms get_property(const Motcle &query) const
Returns the requested property.
virtual const Champ_base & get_champ(OWN_PTR(Champ_base) &espace_stockage) const =0
virtual const Champ_base & get_champ_without_evaluation(OWN_PTR(Champ_base)&espace_stockage) const =0
void nommer(const Nom &nom) override
Assigns a name to the Objet_U. Virtual method to override.
class Champ_Generique_modifier_pour_QC OWN_PTR(Champ_base) intended to post-process a field of a quas...
const Champ_base & get_champ_without_evaluation(OWN_PTR(Champ_base)&espace_stockage) const override
void completer(const Postraitement_base &post) override
const Champ_base & get_champ(OWN_PTR(Champ_base)&espace_stockage) const override
virtual DoubleTab & valeurs()=0
class Champ_base This class is the base of the fields hierarchy.
Definition Champ_base.h:43
Class defining operators and methods for all reading operation in an input flow (file,...
Definition Entree.h:42
virtual const Milieu_base & milieu() const =0
virtual int nb_comp() const
Definition Field_base.h:56
virtual Nature_du_champ nature_du_champ() const
Definition Field_base.h:77
Fluide_Quasi_Compressible class This class represents a quasi-compressible fluid,.
class Nom: a character string for naming TRUST objects.
Definition Nom.h:31
An array of character strings (VECT(Nom)).
Definition Noms.h:26
const Nom & que_suis_je() const
Returns the string identifying the class.
Definition Objet_U.cpp:104
virtual Entree & readOn(Entree &)
Reads an Objet_U from an input stream. Virtual method to override.
Definition Objet_U.cpp:289
virtual const Nom & le_nom() const
Returns the name of the Objet_U. Virtual method to override: returns "neant" in this implementation.
Definition Objet_U.cpp:317
virtual Sortie & printOn(Sortie &) const
Writes the object to an output stream. Virtual method to override.
Definition Objet_U.cpp:278
Helper class to factorize the readOn method of Objet_U classes.
Definition Param.h:112
void ajouter_flag(const char *keyword, const bool *value)
Register a boolean flag whose mere presence switches it to true.
Definition Param.cpp:474
Base class for all post-processing objects.
class Postraitement. The class holds -a list of generic fields champs_post_complet_ containing
Probleme_base & probleme()
virtual const Equation_base & equation(int) const =0
Base class for output streams.
Definition Sortie.h:52
virtual void echange_espace_virtuel(IsExchangeBlocking exchange_type=IsExchangeBlocking::DefaultBlocking, const std::string kernel_name="noname")