TrioCFD 1.9.9_beta
TrioCFD documentation
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
Overrides Champ_base::valeurs() Returns the array of values.
void setValueOnTab(const TrioField &afield, DoubleTab &tab)
void read(Entree &is)
Reading an input field from an input stream Factorization of the readOn methods of the different Cham...
ArrOfDouble initial_value_
Champ_Uniforme Represents a field that is constant in space and time.
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)
Sets the number of components of the field.
const Nom & le_nom() const override
Returns the name of the field.
void nommer(const Nom &) override
Gives a name to the field.
virtual int nb_comp() const
Definition Field_base.h:56
int nb_compo_
Definition Field_base.h:95
class Nom: a character string for naming TRUST objects.
Definition Nom.h:31
virtual Entree & readOn(Entree &)
Reads an Objet_U from an input stream. Virtual method to override.
Definition Objet_U.cpp:289
virtual Sortie & printOn(Sortie &) const
Writes the object to an output stream. Virtual method to override.
Definition Objet_U.cpp:278
Base class for output streams.
Definition Sortie.h:52
void resize(_SIZE_ n, RESIZE_OPTIONS opt=RESIZE_OPTIONS::COPY_INIT)
Definition TRUSTTab.tpp:469