TRUST 1.9.8
HPC thermohydraulic platform
Loading...
Searching...
No Matches
Champ_Generique_refChamp_special.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_refChamp_special.h>
17#include <Param.h>
18#include <Champ_Inc_base.h>
19
20Implemente_instanciable( Champ_Generique_refChamp_special, "Champ_Generique_refChamp_special|refChamp_special", Champ_Generique_refChamp ) ;
21
23{
25 return os;
26}
27
29{
31 return is;
32}
38
40{
41 // Appel a get_localisation pour verifier que le champ est bien un champ discret
42 // (multi-support ou non)
44 // Renvoie les valeurs du champ
45 const DoubleTab& val = ref_cast(Champ_Inc_base,ref_champ_.valeur()).futur(case_);
46 return val;
47}
49{
51 const Probleme_base& pb = ref_cast(Probleme_base,ob);
52 const Nom& nom_cible = ref_champ_->le_nom();
53 pb.get_champ(nom_cible);
54
55 espace_stockage= get_ref_champ_base();
56 if (case_>0)
57 ref_cast(Champ_Inc_base,espace_stockage.valeur()).avancer(case_);
58 if (case_<0)
59 {
60 Cerr<<"KO si case_<0; pourquoi ????????,"<<finl;
61 ref_cast(Champ_Inc_base,espace_stockage.valeur()).reculer(-case_);
62 exit();
63 }
64 return espace_stockage;
65}
: class Champ_Generique_refChamp_special
const DoubleTab & get_ref_values() const override
Verifie que le champ est bien un champ discret et renvoie le tableau de valeurs.
const Champ_base & get_champ(OWN_PTR(Champ_base)&espace_stockage) const override
void set_param(Param &param) const override
pb_champ : declenche la lecture du nom du probleme (nom_pb_) auquel appartient le champ discret et le...
Classe de champ particuliere qui encapsule une reference a un champ volumique de TRUST de type Champ_...
virtual const Champ_base & get_ref_champ_base() const
Renvoie le champ_base sous-jacent.
OWN_PTR(Champ_base) ptr_champ_
void set_param(Param &param) const override
pb_champ : declenche la lecture du nom du probleme (nom_pb_) auquel appartient le champ discret et le...
Entity get_localisation(const int index=-1) const override
Si le champ n'est pas un champ discret : exception Champ_Generique_erreur("INVALID") Sinon,...
Classe Champ_Inc_base.
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
static Objet_U & objet(const Nom &)
Voir Interprete_bloc::objet_global() BM: la classe Interprete n'est pas le meilleur endroit pour cett...
class Nom Une chaine de caractere pour nommer les objets de TRUST
Definition Nom.h:31
const Nom & le_nom() const override
Renvoie *this;.
Definition Nom.cpp:563
virtual Entree & readOn(Entree &)
Lecture d'un Objet_U sur un flot d'entree Methode a surcharger.
Definition Objet_U.cpp:293
Objet_U()
Constructeur par defaut : attribue un numero d'identifiant unique a l'objet (object_id_),...
Definition Objet_U.cpp:55
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
classe Probleme_base C'est un Probleme_U qui n'est pas un couplage.
const Champ_base & get_champ(const Motcle &nom) const override
static void exit(int exit_code=-1)
Routine de sortie de TRUST dans une region Kokkos.
Definition Process.cpp:455
Classe de base des flux de sortie.
Definition Sortie.h:52