TrioCFD 1.9.9_beta
TrioCFD documentation
Loading...
Searching...
No Matches
Integrale_tps_Champ.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 Integrale_tps_Champ_included
17#define Integrale_tps_Champ_included
18
19#include <Champ_Generique_base.h>
20#include <TRUSTTabs_forward.h>
21#include <Champ_Fonc_base.h>
22#include <TRUST_Deriv.h>
23#include <TRUST_Ref.h>
24
26class Champ_base;
27
29{
30 Declare_instanciable(Integrale_tps_Champ);
31public:
32 inline const Champ_Fonc_base& le_champ_calcule() const { return le_champ_.valeur(); }
33 inline Champ_Fonc_base& le_champ_calcule() { return le_champ_.valeur(); }
34 inline const OBS_PTR(Champ_Generique_base)& le_champ() const { return le_champ_ref_; }
35
36 inline double temps_integrale() const { return tps_integrale_; } // current time of the integral
37 inline double t_debut() const { return t_debut_; } // integration start time
38 inline double t_fin() const { return t_fin_; } // integration end time
39 inline double dt_integration() const { return dt_integr_calcul_; } // integration duration already performed
40 inline void fixer_t_debut(double t) { t_debut_ = t; } // Sets the integration start time
41 inline void fixer_t_fin(double t) { t_fin_ = t; } // Sets the integration end time
42 inline void fixer_dt_integr(double t) { dt_integr_calcul_ = t; }
43 inline void fixer_tps_integrale(double t) { tps_integrale_ = t; } // Sets the current time of the integral (last date at which the integral was updated)
44 inline void associer(const Champ_base&, int, double, double) { }
45 inline void associer(const Champ_Generique_base&, int, double, double);
46 virtual void mettre_a_jour_integrale();
47
48 virtual inline void mettre_a_jour(double)
49 {
51 double le_temps = le_champ_ref_->get_time();
52 le_champ_->changer_temps(le_temps);
53 }
54
55 void typer_champ(const Nom&);
56
57protected:
60 int puissance_ = -10;
61 double t_debut_ = -100., t_fin_ = -100.;
62 double tps_integrale_ = -100., dt_integr_calcul_ = -100.;
63};
64
65inline void Integrale_tps_Champ::associer(const Champ_Generique_base& le_ch, int n, double t0, double t1)
66{
67 le_champ_ref_ = le_ch;
68 puissance_ = n;
69 t_debut_ = t0;
70 t_fin_ = t1;
73}
74
75#endif /* Integrale_tps_Champ_included */
class Champ_Fonc_base Base class of fields that are functions of a calculated quantity
class Champ_Generique_base
class Champ_base This class is the base of the fields hierarchy.
Definition Champ_base.h:43
class Domaine_dis_base This class is the base of the hierarchy of discretized domains.
void typer_champ(const Nom &)
OBS_PTR(Champ_Generique_base) le_champ_ref_
const OBS_PTR(Champ_Generique_base) &le_champ() const
void fixer_tps_integrale(double t)
Champ_Fonc_base & le_champ_calcule()
void fixer_dt_integr(double t)
void associer(const Champ_base &, int, double, double)
OWN_PTR(Champ_Fonc_base) le_champ_
virtual void mettre_a_jour(double)
const Champ_Fonc_base & le_champ_calcule() const
void fixer_t_debut(double t)
double dt_integration() const
double temps_integrale() const
virtual void mettre_a_jour_integrale()
Updates the integral.
class Nom: a character string for naming TRUST objects.
Definition Nom.h:31
Objet_U()
Default constructor: assigns a unique identifier to the object (object_id_) and registers the object ...
Definition Objet_U.cpp:54