TRUST 1.9.8
HPC thermohydraulic platform
Loading...
Searching...
No Matches
Champ_front_uniforme.cpp
1/****************************************************************************
2* Copyright (c) 2022, 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_front_uniforme.h>
17
18Implemente_instanciable(Champ_front_uniforme,"Champ_front_uniforme",Champ_front_base);
19// XD champ_front_uniforme front_field_base champ_front_uniforme NO_BRACE Boundary field which is constant in space and
20// XD_CONT stationary.
21// XD attr val list val REQ Values of field components.
22
23
24/*! @brief Imprime le champ sur flot de sortie.
25 *
26 * Imprime la taille du champ et la valeur (constante) sur
27 * la frontiere.
28 *
29 * @param (Sortie& os) un flot de sortie
30 * @return (Sortie&) le flot de sortie modifie
31 */
33{
34 const DoubleTab& tab=valeurs();
35 os << tab.size() << " ";
36 for(int i=0; i<tab.size(); i++)
37 os << tab(0,i);
38 return os;
39}
40
41
42/*! @brief Lit le champ a partir d'un flot d'entree.
43 *
44 * Format:
45 * Champ_front_uniforme nb_compo vrel_1 ... [vrel_i]
46 *
47 * @param (Entree& is) un flot d'entree
48 * @return (Entree& is) le flot d'entree modifie
49 */
51{
52 int dim;
53 DoubleTab& tab=les_valeurs->valeurs();
55 tab.resize(1,dim);
56 fixer_nb_comp(dim);
57 for(int i=0; i<dim; i++)
58 is >> tab(0,i);
59 return is;
60}
61
62
63
64/*! @brief Renvoie l'objet upcaste en Champ_front_base&
65 *
66 * @param (Champ_front_base& ch)
67 * @return (Champ_front_base&) (*this) upcaste en Champ_front_base&
68 */
73
74/*! @brief Renvoie le vecteur des valeurs du champ pour la face donnee.
75 *
76 * @return le tableau des valeurs du champ
77 */
78void Champ_front_uniforme::valeurs_face(int face,DoubleVect& var) const
79{
80 var.resize(nb_compo_);
81 int i;
82 for (i=0 ; i<nb_compo_ ; i++)
83 var(i) = valeurs()(0,i);
84}
85
86/*! @brief Renvoie les valeurs sans s'occuper du temps puisque le champ est stationnaire.
87 *
88 */
90{
91 return les_valeurs->valeurs();
92}
93
94/*! @brief Renvoie les valeurs sans s'occuper du temps puisque le champ est stationnaire.
95 *
96 */
97const DoubleTab& Champ_front_uniforme::valeurs_au_temps(double temps) const
98{
99 return les_valeurs->valeurs();
100}
101
102/*! @brief Avance en temps : rien a faire pour un champ stationnaire !
103 *
104 */
106{
107 return 1;
108}
109
110/*! @brief Recule en temps : rien a faire pour un champ stationnaire !
111 *
112 */
114{
115 return 1;
116}
117
118/*! @brief rien a faire pour un champ stationnaire !
119 *
120 */
122{
123}
int lire_dimension(Entree &, const Nom &)
Verification de la dimension du champ Renvoie la dimension du champ.
classe Champ_front_base Classe de base pour la hierarchie des champs aux frontieres.
virtual DoubleTab & valeurs() override
Renvoie le tableau des valeurs du champ.
classe Champ_front_uniforme Classe derivee de Champ_front_base qui represente les
Champ_front_base & affecter_(const Champ_front_base &ch) override
Renvoie l'objet upcaste en Champ_front_base&.
void changer_temps_futur(double temps, int i) override
rien a faire pour un champ stationnaire !
int avancer(double temps) override
Avance en temps : rien a faire pour un champ stationnaire !
int reculer(double temps) override
Recule en temps : rien a faire pour un champ stationnaire !
DoubleTab & valeurs_au_temps(double temps) override
Renvoie les valeurs sans s'occuper du temps puisque le champ est stationnaire.
void valeurs_face(int, DoubleVect &) const override
Renvoie le vecteur des valeurs du champ pour la face donnee.
Class defining operators and methods for all reading operation in an input flow (file,...
Definition Entree.h:42
virtual void fixer_nb_comp(int i)
Fixe le nombre de composantes du champ.
int nb_compo_
Definition Field_base.h:95
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 Sortie & printOn(Sortie &) const
Ecriture de l'objet sur un flot de sortie Methode a surcharger.
Definition Objet_U.cpp:282
Classe de base des flux de sortie.
Definition Sortie.h:52
void resize(_SIZE_ n, RESIZE_OPTIONS opt=RESIZE_OPTIONS::COPY_INIT)
Definition TRUSTTab.tpp:469
_SIZE_ size() const
Definition TRUSTVect.tpp:45
void resize(_SIZE_, RESIZE_OPTIONS opt=RESIZE_OPTIONS::COPY_INIT)
Definition TRUSTVect.tpp:91