TRUST 1.9.8
HPC thermohydraulic platform
Loading...
Searching...
No Matches
Champ_Generique_Champ.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_Champ.h>
17#include <Param.h>
18
19Implemente_instanciable( Champ_Generique_Champ, "Champ_Generique_Champ", Champ_Generique_refChamp ) ;
20
22{
24 return os;
25}
26
28{
30 return is;
31}
32
33
34/*! @brief pb_champ : declenche la lecture du nom du probleme (nom_pb_) auquel appartient le champ discret et le nom de ce champ discret (nom_champ_)
35 *
36 * nom_source : option pour nommer le champ en tant que source (sinon nommer par defaut)
37 *
38 */
39void Champ_Generique_Champ::set_param(Param& param) const
40{
41 param.ajouter_non_std("nom_source",(this));
42 param.ajouter_non_std("champ",(this),Param::REQUIRED);
43 param.ajouter("nom_pb",&nom_pb_,Param::REQUIRED);
44}
45
46int Champ_Generique_Champ::lire_motcle_non_standard(const Motcle& mot, Entree& is)
47{
48 if (mot=="champ")
49 {
50 // Lecture du champ
51 is >> champ_;
52 set_ref_champ(champ_.valeur());
53 ref_champ_.reset();
54 return 1;
55 }
56 else
58}
59void Champ_Generique_Champ::mettre_a_jour(double temps)
60{
61 champ_->mettre_a_jour(temps);
62}
63/*! @brief Voir Champ_Generique_base::get_champ.
64 *
65 * Ici, l'espace_stockage n'est pas utilise, le champ existe deja
66 *
67 */
68const Champ_base& Champ_Generique_Champ::get_champ(OWN_PTR(Champ_base)& espace_stockage) const
69{
70 return champ_;
71}
72
74{
75 return champ_.valeur();
76}
77
79{
80 champ_.detach();
82}
: class Champ_Generique_Champ
Classe de champ particuliere qui encapsule une reference a un champ volumique de TRUST de type Champ_...
virtual void set_ref_champ(const Champ_base &)
Associe le champ et determine sa localisation.
virtual const Champ_base & get_ref_champ_base() const
Renvoie le champ_base sous-jacent.
int lire_motcle_non_standard(const Motcle &, Entree &) override
Lecture des parametres de type non simple d'un objet_U a partir d'un flot d'entree.
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
Une chaine de caractere (Nom) en majuscules.
Definition Motcle.h:26
virtual Entree & readOn(Entree &)
Lecture d'un Objet_U sur un flot d'entree Methode a surcharger.
Definition Objet_U.cpp:293
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(const char *keyword, const int *value, Param::Nature nat=Param::OPTIONAL)
Register an integer parameter.
Definition Param.cpp:364
@ REQUIRED
Definition Param.h:115
void ajouter_non_std(const char *keyword, const Objet_U *value, Param::Nature nat=Param::OPTIONAL)
Register a keyword handled by Objet_U::lire_motcle_non_standard.
Definition Param.cpp:489
Classe de base des flux de sortie.
Definition Sortie.h:52