TRUST 1.9.8
HPC thermohydraulic platform
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//Nomme le champ en tant que source par defaut
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
classe Champ_Fonc_base Classe de base des champs qui sont fonction d'une grandeur calculee
Classe de base des champs generiques ayant comme source d'autres champs generiques L'utilisation des ...
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
Renvoie la propriete demandee.
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
Donne un nom a l'Objet_U Methode virtuelle a surcharger.
class Champ_Generique_modifier_pour_QC OWN_PTR(Champ_base) destine a post-traiter un champ d un probl...
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
classe Champ_base Cette classe est la base de la hierarchie des champs.
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
classe Fluide_Quasi_Compressible Cette classe represente un d'un fluide quasi compressible
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
const Nom & que_suis_je() const
renvoie la chaine identifiant la classe.
Definition Objet_U.cpp:104
virtual Entree & readOn(Entree &)
Lecture d'un Objet_U sur un flot d'entree Methode a surcharger.
Definition Objet_U.cpp:293
virtual const Nom & le_nom() const
Donne le nom de l'Objet_U Methode a surcharger : renvoie "neant" dans cette implementation.
Definition Objet_U.cpp:319
virtual Sortie & printOn(Sortie &) const
Ecriture de l'objet sur un flot de sortie Methode a surcharger.
Definition Objet_U.cpp:282
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
Classe de base pour l'ensemble des postraitements.
classe Postraitement La classe est dotee -d une liste de champs generiques champs_post_complet_ qui c...
Probleme_base & probleme()
virtual const Equation_base & equation(int) const =0
Classe de base des flux de sortie.
Definition Sortie.h:52
virtual void echange_espace_virtuel(IsExchangeBlocking exchange_type=IsExchangeBlocking::DefaultBlocking, const std::string kernel_name="noname")