TrioCFD 1.9.8
TrioCFD documentation
Loading...
Searching...
No Matches
Ch_front_input_uniforme.cpp
1/****************************************************************************
2* Copyright (c) 2024, 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_front_input_uniforme.h>
17#include <Probleme_base.h>
18#include <Schema_Temps_base.h>
19#include <Interprete.h>
20
21Implemente_instanciable(Ch_front_input_uniforme,"Ch_front_input_uniforme",Champ_front_instationnaire_base);
22// XD ch_front_input_uniforme ch_front_input ch_front_input_uniforme INHERITS_BRACE for coupling, you can use
23// XD_CONT ch_front_input_uniforme which is a champ_front_uniforme, which use an external value. It must be used with
24// XD_CONT Problem.setInputField.
25
27{
28 sous_domaine_ok=false;
29 read(is);
30 mon_pb->addInputField(*this);
31 return is;
32}
33
35{
36 return os;
37}
38
43
45{
46 nommer(name);
47}
48
50{
51 return le_nom();
52}
53
54/*! @brief By default initializes to zero.
55 *
56 */
58{
60 return 0;
61 for(int i=0; i<les_valeurs->nb_cases(); i++)
62 {
63 DoubleTab& val=les_valeurs[i].valeurs();
64 int nbcomp=val.dimension(1);
65 if (initial_value_.size_array()==0)
66 val=0;
67 else
68 for (int c=0; c<nbcomp; c++)
69 val(0,c)=initial_value_[c];
70 }
71 return 1;
72}
73
74/*! @brief Provides afield with a dummy geometry, a name, a time interval, components, and no field ownership.
75 *
76 */
77void Ch_front_input_uniforme::getTemplate(TrioField& afield) const
78{
79
80 afield.dummy_geom();
81 afield.setName(le_nom().getChar());
82
83 afield._time1=mon_pb->presentTime();
84 afield._time2=mon_pb->futureTime();
85
86 afield._nb_field_components=nb_comp();
87}
88
89/*! @brief Uses the first value in afield as uniform value, regardless of geometry.
90 *
91 */
92void Ch_front_input_uniforme::setValue(const TrioField& afield)
93{
94 for (int i=1; i<les_valeurs->nb_cases(); i++)
96 calculer_derivee_en_temps(afield._time1,afield._time2);
97}
class Ch_front_input_uniforme
void set_name(const Nom &name) override
void setValue(const TrioField &afield) override
Uses the first value in afield as uniform value, regardless of geometry.
int initialiser(double temps, const Champ_Inc_base &inco) override
By default initializes to zero.
virtual const Nom & get_name() const
void getTemplate(TrioField &afield) const override
Provides afield with a dummy geometry, a name, a time interval, components, and no field ownership.
Classe Champ_Inc_base.
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_
virtual DoubleTab & valeurs() override
Renvoie le tableau des valeurs du champ.
virtual void calculer_derivee_en_temps(double t1, double t2)
Calcule le taux d'accroissement du champ entre t1 et t2 et le stocke dans Gpoint_.
classe Champ_front_base Classe de base pour les Champs aux frontieres instationnaires,
int initialiser(double temps, const Champ_Inc_base &inco) override
Initialisation en debut de calcul.
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
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
_SIZE_ dimension(int d) const
Definition TRUSTTab.tpp:133