TrioCFD 1.9.9_beta
TrioCFD documentation
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 // Overridden methods:
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 // Overridden methods with loops over fields
49 int initialiser(const double temps) override { for (auto& ch : champs_) ch->initialiser(temps); return 1; }
50
51 // Specific methods:
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
class Champ_Don_base base class of Given Fields (not calculated)
void mettre_a_jour(double temps) override
Time update.
Champ_base & affecter_compo(const Champ_base &, int) override
Causes an error! To be overridden by derived classes! Not a pure virtual for development convenience!
int reprendre(Entree &) override
DOES NOTHING.
int fixer_nb_valeurs_nodales(int nb_noeuds) override
Sets the number of degrees of freedom per component.
DoubleTab & valeurs() override
Overrides Champ_base::valeurs() Returns the array of values.
int imprime(Sortie &, int) const override
DOES NOTHING.
void resetTime(double time) override
virtual bool instationnaire() const
int sauvegarder(Sortie &) const override
DOES NOTHING.
: class Champ_Parametrique
static std::string dirnameDefault
std::string newCompute() const
Champ_base & affecter_(const Champ_base &ch) override
Causes an error! To be overridden by derived classes! Not a pure virtual for development convenience!
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
Causes an error! Must be overridden by derived classes.
int initialiser(const double temps) override
DOES NOTHING.
static std::string dirnameCompute(int compute)
DoubleTab & valeurs() override
Overrides Champ_base::valeurs() Returns the array of values.
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
Causes an error! To be overridden by derived classes! Not a pure virtual for development convenience!
int sauvegarder(Sortie &os) const override
DOES NOTHING.
void mettre_a_jour(double temps) override
Time update.
int fixer_nb_valeurs_nodales(int nb_noeuds) override
Sets the number of degrees of freedom per component.
const DoubleTab & valeurs() const override
DoubleTab & valeur_aux_elems(const DoubleTab &positions, const IntVect &les_polys, DoubleTab &valeurs) const override
Causes an error! Must be overridden by derived classes.
int reprendre(Entree &is) override
DOES NOTHING.
int imprime(Sortie &os, int j) const override
DOES NOTHING.
LIST(OWN_PTR(Champ_Don_base)) champs_
int nb_valeurs_nodales() const override
Returns the number of degrees of freedom per component: the number of nodes.
Champ_base()
Default constructor of a Champ_base.
Champ_base & affecter(const Champ_base &)
Assign a field to another.
double temps() const
Returns the time of the field.
virtual DoubleTab & valeur_aux(const DoubleTab &positions, DoubleTab &valeurs) const
Causes an error! Must be overridden by derived classes.
virtual DoubleTab & valeur_aux_elems(const DoubleTab &positions, const IntVect &les_polys, DoubleTab &valeurs) const
Causes an error! Must be overridden by derived classes.
Class defining operators and methods for all reading operation in an input flow (file,...
Definition Entree.h:42
Base class for output streams.
Definition Sortie.h:52
_SIZE_ dimension(int d) const
Definition TRUSTTab.tpp:133