TrioCFD 1.9.9_beta
TrioCFD documentation
Loading...
Searching...
No Matches
Champ_front_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
17#ifndef Champ_front_Parametrique_included
18#define Champ_front_Parametrique_included
19
20#include <Champ_front_base.h>
21#include <TRUST_Deriv.h>
22#include <TRUST_List.h>
23
24/*! @brief : class Champ_front_Parametrique
25 *
26 * <Description of class Champ_front_Parametrique>
27 */
29{
30 Declare_instanciable(Champ_front_Parametrique);
31
32public:
33 // Overridden methods:
35 inline virtual DoubleTab& valeurs() override { return champ().valeurs(); }
36 inline virtual const DoubleTab& valeurs() const override { return champ().valeurs(); }
37 DoubleTab& valeurs_au_temps(double temps) override { return champ().valeurs_au_temps(temps); }
38 const DoubleTab& valeurs_au_temps(double temps) const override { return champ().valeurs_au_temps(temps); }
39 const Frontiere_dis_base& frontiere_dis() const override { return champ().frontiere_dis(); }
41 const Domaine_dis_base& domaine_dis() const override { return champ().domaine_dis(); }
42 Champ_front_base& affecter_(const Champ_front_base& ch) override { return champ().affecter_(ch); }
43 void mettre_a_jour(double temps) override { champ().mettre_a_jour(temps); }
44 void calculer_coeffs_echange(double temps) override { champ().calculer_coeffs_echange(temps); };
45 void valeurs_face(int i, DoubleVect& val) const override { champ().valeurs_face(i,val); }
46 inline void verifier(const Cond_lim_base& la_cl) const override { champ().verifier(la_cl); };
47 double get_temps_defaut() const override { return champ().get_temps_defaut(); }
48 void set_temps_defaut(double temps) override { champ().set_temps_defaut(temps); }
49 void changer_temps_futur(double temps, int i) override { champ().changer_temps_futur(temps, i); }
50 int avancer(double temps) override { return champ().avancer(temps); }
51 int reculer(double temps) override { return champ().reculer(temps); }
52 void fixer_nb_comp(int i) override { champ().fixer_nb_comp(i); }
53 int nb_comp() const override { return champ().nb_comp(); }
54 Nature_du_champ nature_du_champ() const override { return champ().nature_du_champ(); }
55 Nature_du_champ fixer_nature_du_champ(Nature_du_champ nat) override { return champ().fixer_nature_du_champ(nat); }
56
57 // Overridden methods with loops over fields
58 void associer_fr_dis_base(const Frontiere_dis_base& fr) override { for (auto& ch : champs_) ch->associer_fr_dis_base(fr); }
59 int initialiser(double temps, const Champ_Inc_base& inco) override { for (auto& ch : champs_) ch->initialiser(temps, inco); return 1; }
60 virtual void completer() override { for (auto& ch : champs_) ch->completer(); }
61 void fixer_nb_valeurs_temporelles(int nb_cases) override { for (auto& ch : champs_) ch->fixer_nb_valeurs_temporelles(nb_cases); }
62
63 // Overridden methods with specific computation of the time derivative of the parametric boundary field (Gpoint_):
64 void calculer_derivee_en_temps(double t1, double t2) override;
65 const DoubleTab& derivee_en_temps() const override;
66 bool instationnaire() const override { return index_==1 ? champ().instationnaire() : true; } // The first field can be stationary but subsequent ones are necessarily unsteady
67
68 // Specific methods:
69 std::string newCompute() const;
70 Champ_front_base& champ() { return champs_[index_-1]; }
71 const Champ_front_base& champ() const { return champs_[index_-1]; }
72
73private:
74 LIST(OWN_PTR(Champ_front_base)) champs_;
75 mutable int index_=0;
76 mutable double last_t2_ = DMAXFLOAT; // To manage field changes in calculer_derivee_en_temps
77};
78
79#endif
Class Champ_Inc_base.
virtual DoubleTab & valeurs()=0
: class Champ_front_Parametrique
const Champ_front_base & champ() const
void changer_temps_futur(double temps, int i) override
Changes the time value for the i-th temporal value after the present.
int initialiser(double temps, const Champ_Inc_base &inco) override
Initialization at the beginning of calculation.
void associer_fr_dis_base(const Frontiere_dis_base &fr) override
Associates a discretized boundary with the field.
void calculer_derivee_en_temps(double t1, double t2) override
Computes the rate of change of the field between t1 and t2 and stores it in Gpoint_.
void set_temps_defaut(double temps) override
virtual const DoubleTab & valeurs() const override
Returns the array of field values at the default time.
const Domaine_dis_base & domaine_dis() const override
int reculer(double temps) override
To implement in derived classes.
bool instationnaire() const override
void valeurs_face(int i, DoubleVect &val) const override
Returns the vector of field values for the given face.
void mettre_a_jour(double temps) override
DOES NOTHING, to override.
Frontiere_dis_base & frontiere_dis() override
Returns the discretized boundary associated with the field.
virtual DoubleTab & valeurs() override
Returns the array of field values.
const DoubleTab & derivee_en_temps() const override
const DoubleTab & valeurs_au_temps(double temps) const override
void fixer_nb_comp(int i) override
Sets the number of components of the field.
double get_temps_defaut() const override
virtual void completer() override
DoubleTab & valeurs_au_temps(double temps) override
Champ_front_base & affecter_(const Champ_front_base &ch) override
void fixer_nb_valeurs_temporelles(int nb_cases) override
Called by Conds_lim::completer. By default does nothing.
void calculer_coeffs_echange(double temps) override
DOES NOTHING, to override. This method can calculate and store useful data for the.
const Frontiere_dis_base & frontiere_dis() const override
Returns the discretized boundary associated with the field.
Nature_du_champ nature_du_champ() const override
Nature_du_champ fixer_nature_du_champ(Nature_du_champ nat) override
Sets the nature of a field: scalar, multiscalar, vectorial.
int avancer(double temps) override
To implement in derived classes.
void verifier(const Cond_lim_base &la_cl) const override
class Champ_front_base Base class for the hierarchy of boundary fields.
virtual void changer_temps_futur(double temps, int i)
Changes the time value for the i-th temporal value after the present.
virtual const Frontiere_dis_base & frontiere_dis() const
Returns the discretized boundary associated with the field.
virtual Champ_front_base & affecter_(const Champ_front_base &ch)=0
virtual void set_temps_defaut(double temps)
virtual bool instationnaire() const
virtual double get_temps_defaut() const
virtual const Domaine_dis_base & domaine_dis() const
virtual void calculer_coeffs_echange(double temps)
DOES NOTHING, to override. This method can calculate and store useful data for the.
virtual DoubleTab & valeurs() override
Returns the array of field values.
virtual void verifier(const Cond_lim_base &la_cl) const
virtual DoubleTab & valeurs_au_temps(double temps)=0
virtual int reculer(double temps)
To implement in derived classes.
virtual int avancer(double temps)
To implement in derived classes.
virtual void mettre_a_jour(double temps)
DOES NOTHING, to override.
virtual void valeurs_face(int, DoubleVect &) const
Returns the vector of field values for the given face.
class Cond_lim_base Base class for the hierarchy of classes that represent the different boundary con...
class Domaine_dis_base This class is the base of the hierarchy of discretized domains.
virtual void fixer_nb_comp(int i)
Sets the number of components of the field.
virtual Nature_du_champ fixer_nature_du_champ(Nature_du_champ nat)
Sets the nature of a field: scalar, multiscalar, vectorial.
virtual int nb_comp() const
Definition Field_base.h:56
virtual Nature_du_champ nature_du_champ() const
Definition Field_base.h:77
class Frontiere_dis_base Class representing a discretized boundary.