TRUST 1.9.8
HPC thermohydraulic platform
Loading...
Searching...
No Matches
Champ_Parametrique.h
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#ifndef Champ_Parametrique_included
17#define Champ_Parametrique_included
18
19#include <TRUST_List.h>
20#include <Champ_Don_base.h>
21
22/*! @brief : class Champ_Parametrique
23 *
24 * <Description of class Champ_Parametrique>
25 */
27{
28 Declare_instanciable( Champ_Parametrique ) ;
29public:
30 // Methodes surchargees:
31 void mettre_a_jour(double temps) override { champ().mettre_a_jour(temps); }
32 int imprime(Sortie& os, int j) const override { return champ().imprime(os,j); }
33 int fixer_nb_valeurs_nodales(int nb_noeuds) override { return champ().fixer_nb_valeurs_nodales(nb_noeuds); }
34 int reprendre(Entree& is) override { return champ().reprendre(is); }
35 int sauvegarder(Sortie& os) const override { return champ().sauvegarder(os); }
36 void resetTime(double time) override { champ().resetTime(time); }
37 inline DoubleTab& valeurs() override { return champ().valeurs(); }
38 inline const DoubleTab& valeurs() const override { return champ().valeurs(); }
39 inline DoubleTab& valeurs(double temps) override { return champ().valeurs(temps); }
40 inline const DoubleTab& valeurs(double temps) const override { return champ().valeurs(temps); }
41 Champ_base& affecter_(const Champ_base& ch) override { return champ().affecter(ch); }
42 Champ_base& affecter_compo(const Champ_base& ch, int i) override { return champ().affecter_compo(ch, i); }
43 inline int nb_valeurs_nodales() const override { return champ().valeurs().dimension(0); }
44 DoubleTab& valeur_aux(const DoubleTab& positions, DoubleTab& valeurs) const override { return champ().valeur_aux(positions, valeurs); }
45 DoubleTab& valeur_aux_elems(const DoubleTab& positions, const IntVect& les_polys, DoubleTab& valeurs) const override { return champ().valeur_aux_elems(positions, les_polys, valeurs); };
46 bool instationnaire() const override { return champ().instationnaire(); }
47
48 // Methodes surchargees avec boucles sur les champs
49 int initialiser(const double temps) override { for (auto& ch : champs_) ch->initialiser(temps); return 1; }
50
51 // Methodes specifiques:
52 std::string newCompute() const;
53 static bool enabled;
54 static std::string dirnameDefault;
55 static std::string dirnameCompute(int compute);
56protected :
57 LIST(OWN_PTR(Champ_Don_base)) champs_;
58 Champ_Don_base& champ() { return champs_[index_-1]; }
59 const Champ_Don_base& champ() const { return champs_[index_-1]; }
60 mutable int index_=0;
61};
62
63#endif
classe Champ_Don_base classe de base des Champs donnes (non calcules)
void mettre_a_jour(double temps) override
Mise a jour en temps.
Champ_base & affecter_compo(const Champ_base &, int) override
Provoque une erreur ! A surcharger par les classes derivees ! non virtuelle pure par commoditees de d...
int reprendre(Entree &) override
NE FAIT RIEN.
int fixer_nb_valeurs_nodales(int nb_noeuds) override
Fixe le nombre de degres de liberte par composante.
DoubleTab & valeurs() override
Surcharge Champ_base::valeurs() Renvoie le tableau des valeurs.
int imprime(Sortie &, int) const override
NE FAIT RIEN.
void resetTime(double time) override
virtual bool instationnaire() const
int sauvegarder(Sortie &) const override
NE FAIT RIEN.
: class Champ_Parametrique
static std::string dirnameDefault
std::string newCompute() const
Champ_base & affecter_(const Champ_base &ch) override
Provoque une erreur ! A surcharger par les classes derivees ! non virtuelle pure par commoditees de d...
Champ_Don_base & champ()
const DoubleTab & valeurs(double temps) const override
const Champ_Don_base & champ() const
DoubleTab & valeur_aux(const DoubleTab &positions, DoubleTab &valeurs) const override
Provoque une erreur ! Doit etre surchargee par les classes derivees.
int initialiser(const double temps) override
NE FAIT RIEN.
static std::string dirnameCompute(int compute)
DoubleTab & valeurs() override
Surcharge Champ_base::valeurs() Renvoie le tableau des valeurs.
DoubleTab & valeurs(double temps) override
void resetTime(double time) override
bool instationnaire() const override
Champ_base & affecter_compo(const Champ_base &ch, int i) override
Provoque une erreur ! A surcharger par les classes derivees ! non virtuelle pure par commoditees de d...
int sauvegarder(Sortie &os) const override
NE FAIT RIEN.
void mettre_a_jour(double temps) override
Mise a jour en temps.
int fixer_nb_valeurs_nodales(int nb_noeuds) override
Fixe le nombre de degres de liberte par composante.
const DoubleTab & valeurs() const override
DoubleTab & valeur_aux_elems(const DoubleTab &positions, const IntVect &les_polys, DoubleTab &valeurs) const override
provoque une erreur ! doit etre surchargee par les classes derivees
int reprendre(Entree &is) override
NE FAIT RIEN.
int imprime(Sortie &os, int j) const override
NE FAIT RIEN.
LIST(OWN_PTR(Champ_Don_base)) champs_
int nb_valeurs_nodales() const override
Renvoie le nombre de degre de liberte par composante: le nombre de noeuds.
Champ_base()
Constructeur par defaut d'un Champ_base.
Champ_base & affecter(const Champ_base &)
Affecter un champ dans un autre.
double temps() const
Renvoie le temps du champ.
virtual DoubleTab & valeur_aux(const DoubleTab &positions, DoubleTab &valeurs) const
Provoque une erreur ! Doit etre surchargee par les classes derivees.
virtual DoubleTab & valeur_aux_elems(const DoubleTab &positions, const IntVect &les_polys, DoubleTab &valeurs) const
provoque une erreur ! doit etre surchargee par les classes derivees
Class defining operators and methods for all reading operation in an input flow (file,...
Definition Entree.h:42
Classe de base des flux de sortie.
Definition Sortie.h:52
_SIZE_ dimension(int d) const
Definition TRUSTTab.tpp:133