TRUST 1.9.8
HPC thermohydraulic platform
Loading...
Searching...
No Matches
Ch_input_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 <Ch_input_uniforme.h>
17#include <Probleme_base.h>
18#include <Schema_Temps_base.h>
19#include <Interprete.h>
20
21Implemente_instanciable(Ch_input_uniforme,"Champ_input_uniforme",Champ_Uniforme);
22
23
25{
26 sous_domaine_ok=false;
27 read(is);
29 if (initial_value_.size_array())
30 for (int i = 0; i < nb_compo_; i++) valeurs()(0, i) = initial_value_[i];
31 mon_pb->addInputField(*this);
32 return is;
33}
34
36{
37 return os;
38}
39
44
46{
47 nommer(name);
48}
49
51{
52 return le_nom();
53}
54
55/*! @brief Provides afield with a dummy geometry, a name, a time interval, components, and no field ownership.
56 *
57 */
58void Ch_input_uniforme::getTemplate(TrioField& afield) const
59{
60
61 afield.dummy_geom();
62 afield.setName(le_nom().getChar());
63
64 afield._time1=mon_pb->presentTime();
65 afield._time2=mon_pb->futureTime();
66
67 afield._nb_field_components=nb_comp();
68}
69
70/*! @brief Uses the first value in afield as uniform value, regardless of geometry.
71 *
72 */
73void Ch_input_uniforme::setValue(const TrioField& afield)
74{
76}
class Ch_input_uniforme
void set_nb_comp(int i) override
void set_name(const Nom &name) override
void getTemplate(TrioField &afield) const override
Provides afield with a dummy geometry, a name, a time interval, components, and no field ownership.
void setValue(const TrioField &afield) override
Uses the first value in afield as uniform value, regardless of geometry.
virtual const Nom & get_name() const
DoubleTab & valeurs() override
Surcharge Champ_base::valeurs() Renvoie le tableau des valeurs.
void setValueOnTab(const TrioField &afield, DoubleTab &tab)
void read(Entree &is)
Lecture d'un champ input dans un flot d'entree Factorisation des readOn des differents Champ_input.
ArrOfDouble initial_value_
classe Champ_Uniforme Represente un champ constant dans l'espace et dans le temps.
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.
const Nom & le_nom() const override
Renvoie le nom du champ.
void nommer(const Nom &) override
Donne un nom au champ.
virtual int nb_comp() const
Definition Field_base.h:56
int nb_compo_
Definition Field_base.h:95
class Nom Une chaine de caractere pour nommer les objets de TRUST
Definition Nom.h:31
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