TrioCFD 1.9.9_beta
TrioCFD documentation
Loading...
Searching...
No Matches
Schema_Implicite_Multi_TimeStep_base.h
1/****************************************************************************
2* Copyright (c) 2026, 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 Schema_Implicite_Multi_TimeStep_base_included
17#define Schema_Implicite_Multi_TimeStep_base_included
18
19/*! @brief class Schema_Implicite_Multi_TimeStep_base It inherits from the implicit base scheme and carries a solver, for example
20 *
21 * the Simpler solver, to perform the time-stepping operations.
22 *
23 */
24
25#include <Schema_Implicite_base.h>
26class Probleme_Couple;
27
29{
30
32
33public :
34
35 bool initTimeStep(double dt) override;
36 void set_param(Param& ) const override;
37
38 ////////////////////////////////
39 // //
40 // Schema characteristics //
41 // //
42 ////////////////////////////////
43
44 int nb_valeurs_futures() const override;
45 double temps_futur(int i) const override;
46 double temps_defaut() const override;
47 inline int nb_valeurs_temporelles_effectives() const;
48
49 /////////////////////////////////////////
50 // //
51 // End of schema characteristics //
52 // //
53 /////////////////////////////////////////
54
55 virtual double changer_temps(Equation_base& eqn, const double temps) = 0;
56 virtual void update_time_derivative(Equation_base& eqn, const DoubleTab& data) = 0;
57 virtual void mettre_a_jour_equation(Equation_base& eqn, const double temps) = 0;
58 virtual void modify_equation_parameters(Equation_base& eqn, DoubleTab& stored_parameters) = 0;
59 virtual void store_equation_parameters(Equation_base& eqn, DoubleTab& stored_parameters) = 0;
60 virtual DoubleTab& coefficients() = 0;
61 virtual void compute_coefficients(double time_step, const DoubleTab& times) const = 0;
62 virtual void add_multi_timestep_data(const Equation_base& eqn, Matrice_Base& mat_morse, DoubleTab& secmem) const = 0;
63 virtual int nb_pas_dt_seuil() const = 0;
64 virtual int nb_valeurs_passees() const = 0;
65 virtual const DoubleTab& coefficients() const = 0;
66
67
69
70 bool iterateTimeStep(bool& converged) override;
72 int mettre_a_jour() override;
73 int reprendre(Entree& ) override;
74 inline void completer() override { }
75
78 int Iterer_Pb(Probleme_base&,int ite);
79 inline const double& residu_old() const
80 {
81 return residu_old_ ;
82 };
83
84 void ajouter_inertie(Matrice_Base& mat_morse,DoubleTab& secmem,const Equation_base& eqn) const override;
85
86 // for multi-timestep schemes
87 virtual void modifier_second_membre_full_impl(const Equation_base& eqn, DoubleTab& secmem);
88 void modifier_second_membre(const Equation_base& eqn, DoubleTab& secmem) override;
89
90protected:
91 void authorized_equation(const Equation_base& eqn);
92 void authorized_equation(const Equation_base& eqn) const;
93
94 int nb_ite_max=100000;
95 double residu_old_=0,facsec_max_=DMAXFLOAT;
97};
98
103#endif
104
class Equation_base The role of an equation is the calculation of one or more fields....
Matrice_Base class - Base class of the matrix hierarchy.
friend class Entree
Definition Objet_U.h:71
Helper class to factorize the readOn method of Objet_U classes.
Definition Param.h:112
Probleme_Couple This is the historical coupling class of TRUST.
class Probleme_base It is a Probleme_U that is not a coupling.
virtual int faire_un_pas_de_temps_pb_couple(Probleme_Couple &, int &ok)
int reprendre(Entree &) override
Restores an Objet_U from an input stream. Virtual method to override.
virtual void compute_coefficients(double time_step, const DoubleTab &times) const =0
int nb_valeurs_futures() const override
Returns the number of future temporal values.
double temps_defaut() const override
Returns the time that fields must return when valeurs() is called.
bool iterateTimeStep(bool &converged) override
Calculate the U(n+1) unknown for each equation (if solved) of the problem with the selected time sche...
virtual const DoubleTab & coefficients() const =0
void modifier_second_membre(const Equation_base &eqn, DoubleTab &secmem) override
void ajouter_inertie(Matrice_Base &mat_morse, DoubleTab &secmem, const Equation_base &eqn) const override
int mettre_a_jour() override
Updates the current time (t+=dt) and the number of time steps performed (nb_pas_dt_++).
virtual void update_time_derivative(Equation_base &eqn, const DoubleTab &data)=0
virtual DoubleTab & coefficients()=0
double temps_futur(int i) const override
Returns the time at the i-th future value.
virtual void modifier_second_membre_full_impl(const Equation_base &eqn, DoubleTab &secmem)
virtual int nb_pas_dt_seuil() const =0
virtual void add_multi_timestep_data(const Equation_base &eqn, Matrice_Base &mat_morse, DoubleTab &secmem) const =0
virtual void mettre_a_jour_equation(Equation_base &eqn, const double temps)=0
virtual int nb_valeurs_passees() const =0
virtual void store_equation_parameters(Equation_base &eqn, DoubleTab &stored_parameters)=0
virtual void modify_equation_parameters(Equation_base &eqn, DoubleTab &stored_parameters)=0
virtual double changer_temps(Equation_base &eqn, const double temps)=0
class Schema_Implicite_base Base class for all implicit time schemes.
virtual int nb_valeurs_temporelles() const =0