TrioCFD 1.9.9_beta
TrioCFD documentation
Loading...
Searching...
No Matches
Schema_Implicite_Multi_TimeStep_base.cpp
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#include <Schema_Implicite_Multi_TimeStep_base.h>
17#include <Domaine_Cl_dis_base.h>
18#include <Probleme_Couple.h>
19#include <communications.h>
20#include <Matrice_Morse.h>
21#include <Equation_base.h>
22#include <Probleme_base.h>
23#include <LecFicDiffuse.h>
24#include <Milieu_base.h>
25#include <Param.h>
26
27Implemente_base(Schema_Implicite_Multi_TimeStep_base,"Schema_Implicite_Multi_TimeStep_base",Schema_Implicite_base);
28
30{
32}
33
35{
37
38 if(!le_solveur)
39 {
40 Cerr << "A solver must be selected." << finl;
41 Cerr << "Syntax : " << finl
42 << "Solveur solver_name [ solver parameters ] " << finl;
43 exit();
44 }
46 {
47 Cerr << "diffusion_implicite option cannot be used with an implicit time scheme." << finl;
48 exit();
49 }
50
51 return s;
52}
53
54static void Implicite_Multi_TimeStep_calcul_fac_sec(double& residu_,double& residu_old,double& facsec_,const double facsec_max_,int& nb_ite_sans_accel_)
55{
56 double rap = 1.2;
57 int nb_ite_sans_accel_max = 20000;
58
59 if (residu_old==0)
60 {
61 residu_old=residu_;
62 nb_ite_sans_accel_=0;
63 }
64 else if ((residu_old>rap*residu_)||(nb_ite_sans_accel_>nb_ite_sans_accel_max))
65 {
66 facsec_*=sqrt(rap);
67 residu_old=residu_;
68 facsec_=std::min(facsec_,facsec_max_);
69 nb_ite_sans_accel_=0;
70 }
71
72 nb_ite_sans_accel_++;
73}
74
76
77{
78 param.ajouter("max_iter_implicite",&nb_ite_max);
79 param.ajouter("facsec_max", &facsec_max_);
81}
82
89////////////////////////////////
90// //
91// Schema characteristics //
92// //
93////////////////////////////////
94
95/*! @brief Returns the number of future temporal values.
96 *
97 * Here: n+1, so 1.
98 *
99 */
104
105/*! @brief Returns the time at the i-th future value.
106 *
107 * Here: t(n+1)
108 *
109 */
111{
112 assert(i==1);
113 return temps_courant()+pas_de_temps();
114}
115
116/*! @brief Returns the time that fields must return when valeurs() is called.
117 *
118 * Here: t(n+1)
119 *
120 */
125
126/////////////////////////////////////////
127// //
128// End of schema characteristics //
129// //
130/////////////////////////////////////////
131
133{
134 int i = 0;
135 int j = 0;
136
137 for(i=0; i<pb.nombre_d_equations(); i++)
138 {
139 if ( (pb.equation(i).que_suis_je()!="Euler") || temps_courant_==0.)
140 {
141 for (j=nb_valeurs_passees(); j>-1; j--)
142 {
143 pb.equation(i).inconnue().passe(j+1) = pb.equation(i).inconnue().passe(j);
144 }
145 }
146 }
147}
148
149
150
156
158{
159 int i = 0, ok = 1;
160 int ii = 0;
161 bool convergence_pb = true;
162 bool convergence_eqn = false;
163 int drap = pb.is_dilatable();
164
165 for(i=0; i<pb.nombre_d_equations(); i++)
166 {
167 //reverse equation order if quasi-compressible medium
168 if ((drap)&&(i<2))
169 ii = 1-i;
170 else
171 ii = i;
172
173 Equation_base& eqn = pb.equation(ii);
174 DoubleTab& present = eqn.inconnue().valeurs();
175 DoubleTab& futur = eqn.inconnue().futur();
176 double temps = temps_courant_+dt_;
177
178 DoubleTab stored_parameters;
179
181
182 // imposer_cond_lim is used for the pressure and for inter-problem exchanges
184 Cout<<"Solving equation "<<eqn.que_suis_je()<<finl;
185 const DoubleTab& inut=futur;
186
187 store_equation_parameters(eqn,stored_parameters);
188 convergence_eqn = le_solveur->iterer_eqn(eqn,inut, present, dt_,ite, ok);
189 modify_equation_parameters(eqn,stored_parameters);
190
191 convergence_pb = convergence_pb&&convergence_eqn;
192 futur = present;
194 present = futur;
195
196 // The following line performs:
197 // Update NS (hence update unknowns)
198 // Update turbulence model (k-eps)
199 // eqn.inconnue().mettre_a_jour(temps);
200 // eqn.inconnue().reculer();
201 changer_temps(eqn,temps);
202 }
203 return (convergence_pb==true);
204}
205
207{
208 int i = 0;
209 int j = 0;
210
211 for(i=0; i<pb.nombre_d_equations(); i++)
212 {
213 // treatement of time convergency
214 DoubleTab& passe = pb.equation(i).inconnue().passe();
215 DoubleTab& present = pb.equation(i).inconnue().valeurs();
216 DoubleTab& futur = pb.equation(i).inconnue().futur();
217
218 futur = present;
220 present -= passe;
221 present /= dt_;
222 update_critere_statio(present, pb.equation(i));
223 update_time_derivative(pb.equation(i),present);
224 for (j=0; j<nb_valeurs_passees(); j++)
225 {
226 pb.equation(i).inconnue().passe(j) = pb.equation(i).inconnue().passe(j+1);
227 }
228 }
229}
230
231static void Implicite_Multi_TimeStep_recommencer_pb(int nb_valeurs_passees, Probleme_base& pb)
232{
233 int i = 0;
234 int j = 0;
235 for(i=0; i<pb.nombre_d_equations(); i++)
236 {
237 for (j=0; j<nb_valeurs_passees; j++)
238 {
239 pb.equation(i).inconnue().passe(j) = pb.equation(i).inconnue().passe(j+1);
240 }
241 }
242}
243
244
246{
247 Probleme_base& prob=pb_base();
248
249 int convergence_pb = 0;
250 Initialiser_Champs(prob);
251
252 int ok=0;
253 int compteur;
254 while (!ok)
255 {
256 compteur=0;
257 Cout<<" "<<finl;
258 Cout<<que_suis_je()<<" : solving of problem "<<prob.que_suis_je()<<finl;
259
260 while ((!convergence_pb)&&(compteur<nb_ite_max))
261 {
262 compteur++;
263 prob.updateGivenFields();
264 convergence_pb = Iterer_Pb(prob,compteur);
265 Cout<<" "<<finl;;
266 }
267
268 if ((!convergence_pb)&&(compteur==nb_ite_max))
269 {
270 Cerr<<que_suis_je()<<" has not converged at t="<< temps_courant_ << " with dt =" << dt_<< finl;
271
272 double rap = sqrt(2.);
273 facsec_ /= rap;
274 dt_ /= rap;
275 ok =0;
276
277 Cerr<<"We restart with dt_ =" << dt_ <<finl;
278
279 prob.abortTimeStep();
280 prob.initTimeStep(dt_);
281
282 // PL fix for crash in U_in_var_impl
283 const int nb_eqn=prob.nombre_d_equations();
284 for(int ii=0; ii<nb_eqn; ii++)
285 {
286 Equation_base& eqn=prob.equation(ii);
288 }
289 // Fin
290
291 Implicite_Multi_TimeStep_recommencer_pb(nb_valeurs_passees(),prob);
292 }
293 else
294 {
295 Cout<<"The problem "<<prob.que_suis_je()<<" has converged after "<<compteur<<" iterations."<<finl;
296 ok=1;
297 }
298
299 }
300 // modification: account for the possibility of modifying dt in Itere_Pb
301 // for the compressible solver: divide the time step by 2
302 // if convergence is not reached within a given number of time steps
303 // double temps = dt_ + temps_courant_;
304 test_stationnaire(prob);
305
306 converged=true;
307
308 return true;
309}
310
312{
313 // Modif B.M.: If the save is done between derivee_en_temps_inco and mettre_a_jour,
314 // a restarted calculation is not equivalent to an uninterrupted one
315 // (especially for front-tracking). So the save is placed at the beginning of the time step.
316 //if (lsauv())
317 // for (int i=0;i<pbc.nb_problemes();i++)
318 // ref_cast(Probleme_base,pbc.probleme(i)).sauver();
319
320 int convergence_pbc = 0;
321 int convergence_pb;
322 int i;
323
324 for(i=0; i<pbc.nb_problemes(); i++)
325 Initialiser_Champs(ref_cast(Probleme_base,pbc.probleme(i)));
326
327
328 int compteur;
329
330 while (!ok)
331 {
332 compteur=0;
333
334 while ((!convergence_pbc )&&(compteur<nb_ite_max))
335 {
336 compteur++;
337 convergence_pbc=1;
338
339
340 for(i=0; i<pbc.nb_problemes()*1; i++)
341 {
342 Probleme_base& pb = ref_cast(Probleme_base,pbc.probleme(i));
343 const int nb_eqn=pb.nombre_d_equations();
344 for(int ii=0; ii<nb_eqn; ii++)
345 {
347 }
348
349 }
350
351 for(i=0; i<pbc.nb_problemes(); i++)
352 {
354 convergence_pb = Iterer_Pb(ref_cast(Probleme_base,pbc.probleme(i)),compteur);
355 convergence_pbc = convergence_pbc * convergence_pb ;
356 }
357
358 }
359 if ((!convergence_pbc)&&(compteur==nb_ite_max))
360 {
361 Cerr<<"The process is restarted. " <<finl;
362 facsec_/=2;
363 dt_/=2;
364 ok=0;
365 for(int i2=0; i2<pbc.nb_problemes(); i2++)
366 {
367 ref_cast(Probleme_base,pbc.probleme(i2)).abortTimeStep();
368 ref_cast(Probleme_base,pbc.probleme(i2)).initTimeStep(dt_);
369 Implicite_Multi_TimeStep_recommencer_pb(nb_valeurs_passees(),ref_cast(Probleme_base,pbc.probleme(i2)));
370 }
371 }
372 else ok=1;
373 }
374
375 double residu_1=0;
376 for(i=0; i<pbc.nb_problemes(); i++)
377 {
378 residu_1=residu_;
379 test_stationnaire(ref_cast(Probleme_base,pbc.probleme(i)));
380 residu_=std::max(residu_,residu_1);
381 }
382
383 return 1;
384}
385
387{
389 {
390 const Equation_base& eqn_bis = ref_cast(Equation_base,eqn);
391 int i = 0;
392 int offset = 0;
393 double time_step = pas_de_temps();
394
395 //Building of a time-in-ascending-order table
396 DoubleTab times(nb_valeurs_temporelles_effectives());
398
399 for (i=0; i<nb_valeurs_passees(); ++i)
400 {
401 offset = nb_valeurs_passees()-i;
402 times[i] = eqn_bis.inconnue().recuperer_temps_passe(offset); //past time
403 }
404 times[nb_valeurs_passees()] = eqn_bis.inconnue().recuperer_temps_futur(0); //present time
405 times[nb_valeurs_passees()+1] = eqn_bis.inconnue().recuperer_temps_futur(1); //future time
406
407 compute_coefficients(time_step,times);
408 add_multi_timestep_data(eqn, mat_morse, secmem);
409 }
410 else
411 {
412 //Backward Euler time scheme
413 Schema_Temps_base::ajouter_inertie(mat_morse,secmem,eqn);
414 }
415}
416
418{
419 //Necessary because of equations like Transport_K_Eps which must be time incremented but
420 //are not equations of the solved problem and therefore are not seen by Schema_Implicite_Multi_TimeStep_base::iterateTimeStep
421
422 DoubleTab& passe = eqn.inconnue().passe();
423 DoubleTab& present = eqn.inconnue().valeurs();
424 DoubleTab& futur = eqn.inconnue().futur();
425 int compteur = 0, ok = 1;
426 int i = 0;
427 bool convergence_eqn = false;
428
429 DoubleTab stored_parameters;
430
432
433 //Initialize time data
434 if ( (eqn.que_suis_je() != "Euler") || temps_courant_ ==0.)
435 {
436 for (i=nb_valeurs_passees(); i>-1; i--)
437 {
438 eqn.inconnue().passe(i+1) = eqn.inconnue().passe(i);
439 }
440 }
441
442 // used for the pressure and inter-problem couplings
444
445 Cout << finl;
446 while ((!convergence_eqn)&&(compteur<nb_ite_max))
447 {
448 compteur++;
449
450 Cout<<"==================================================================================" << finl;
451 Cout<<que_suis_je()<<": Implicit iteration " << compteur << " on the "<<eqn.que_suis_je() << " equation of the problem "<< eqn.probleme().le_nom()<< " :" <<finl;
452 Cout<<"==================================================================================" << finl;
453
454 const DoubleTab& inut=futur;
455 store_equation_parameters(eqn,stored_parameters);
456 convergence_eqn=le_solveur->iterer_eqn(eqn, inut, present, dt_, compteur, ok);
457 modify_equation_parameters(eqn,stored_parameters);
458 futur=present;
460 present=futur;
461 }
462
463 //Calculation of time derivative at time n+1
464 present -= passe; //"present" contains unknown at time n+1 and "passe" contains unknown at time n
465 present/=dt_;
466
467 update_critere_statio(present, eqn);
468 update_time_derivative(eqn,present);
469
470 //Update time data
471 for (i=0; i<nb_valeurs_passees(); i++)
472 {
473 eqn.inconnue().passe(i) = eqn.inconnue().passe(i+1);
474 }
475
476 return 1;
477}
478
480{
481 Nom nom_fichier(nom_du_cas());
482 nom_fichier+=".dt_ev";
483 LecFicDiffuse test;
484 if (!test.ouvrir(nom_fichier))
485 {
486 Cerr << "*****************************************" << finl;
487 Cerr << "***************** WARNING ***************" << finl;
488 Cerr << "File " << nom_fichier << " does not exist." << finl;
489 Cerr << "In order to restart a calculation carried out with an implicit time scheme" << finl;
490 Cerr << "it is preferable to re-read the .dt_ev file to pick up some informations" << finl;
491 Cerr << "and in particular the facsec of the previous calculation." << finl;
492 Cerr << "TRUST will use facsec= " << facsec_ << "." << finl;
493 Cerr << "Else specify the facsec wanted value in your data file." << finl;
494 Cerr << "*****************************************" << finl;
495 return 1;
496 }
497
498 // Reading facsec and residual from the .dt_ev file if it exists
499 double facsec_lu=1.;
500 double residu_lu=0;
501 double facsec_lu_old;
502
503 // Test file opening
504 if (je_suis_maitre())
505 {
506 EFichier fichier;
507 fichier.ouvrir(nom_fichier);
508 Nom chaine;
509 double temps=0;
510 double dt;
511 std::string ligne;
512 // Read the header if present
513 fichier >> chaine;
514 if (chaine=="#")
515 {
516 // Read the full line
517 std::getline(fichier.get_ifstream(), ligne);
518 } // Otherwise reopen
519 else
520 {
521 fichier.ouvrir(nom_fichier);
522 }
523 // Search for the time step preceding tinit_
524 fichier >> temps;
525 while (!fichier.eof() && temps<tinit_)
526 {
527 facsec_lu_old = facsec_lu;
528 fichier >> dt;
529 fichier >> facsec_lu;
530 fichier >> residu_lu;
531 // Read the rest of the line
532 std::getline(fichier.get_ifstream(), ligne);
533 fichier >> temps;
534 if (facsec_lu_old != facsec_lu)
535 {
536 residu_old_ = residu_lu;
538 }
540 }
541 }
542 envoyer_broadcast(facsec_lu, 0 /* pe source */);
543 envoyer_broadcast(residu_lu, 0 /* pe source */);
544 envoyer_broadcast(nb_ite_sans_accel_, 0 /* pe source */);
545 envoyer_broadcast(residu_old_, 0 /* pe source */);
546
547 // The read facsec is used only if it is within the bounds
548 // specified in the data set.
549 // Indeed, one may run an explicit calculation and then restart with an implicit scheme.
550 residu_ = residu_lu;
551 if (facsec_lu>=facsec_)
552 {
553 if (facsec_lu<=facsec_max_)
554 facsec_ = facsec_lu;
555 else
557 Cerr << "Facsec after reading in " << nom_fichier << " : " << facsec_ << finl;
558 Cerr << "Residu after reading in " << nom_fichier << " : " << residu_ << finl;
559 }
560 else
561 {
562 Cerr << "The readen facsec in " << nom_fichier << " : " << facsec_lu << finl;
563 Cerr << "is not used since it is lower than the facsec from the data set : " << facsec_ << finl;
564 }
565 return 1;
566}
567
568//To get du/dt table without pressure gradient and influences of past and present times
570{
571 Cerr<<"Error in "<<que_suis_je()<<"::modifier_second_membre_full_impl()"<<finl;
572 Cerr<<que_suis_je()<<" is an implicit time scheme"<<finl;
573 Cerr<<que_suis_je()<<"::modifier_second_membre_full_impl() should not be used"<<finl;
575}
576
578{
579 Cerr<<"Error in "<<que_suis_je()<<"::modifier_second_membre()"<<finl;
580 Cerr<<que_suis_je()<<" is an implicit time scheme"<<finl;
581 Cerr<<que_suis_je()<<"::modifier_second_membre() should not be used"<<finl;
583}
584
586{
587 Nom equation_name(eqn.que_suis_je());
588 bool authorized = true;
589
590 authorized &= (bool) equation_name.find("FT");
591 authorized &= (bool) equation_name.find("Front_Tracking");
592 authorized &= (bool) equation_name.find("QC");
593 authorized &= (bool) equation_name.find("Quasi_Compressible");
594
595 if (!authorized)
596 {
597 Cerr<<"Error in "<<que_suis_je()<<"::authorized_equation()"<<finl;
598 Cerr<<"Equation "<<equation_name<<" is not allowed with "<<que_suis_je()<<" time scheme"<<finl;
600 }
601}
602
604{
605 Nom equation_name(eqn.que_suis_je());
606 bool authorized = true;
607
608 authorized &= (bool) equation_name.find("FT");
609 authorized &= (bool) equation_name.find("Front_Tracking");
610 authorized &= (bool) equation_name.find("QC");
611 authorized &= (bool) equation_name.find("Quasi_Compressible");
612
613 if (!authorized)
614 {
615 Cerr<<"Error in "<<que_suis_je()<<"::authorized_equation()"<<finl;
616 Cerr<<"Equation "<<equation_name<<" is not allowed with "<<que_suis_je()<<" time scheme"<<finl;
618 }
619}
DoubleTab & futur(int i=1) override
Returns field values at instant t+i.
DoubleTab & passe(int i=1) override
Returns field values at instant t-i.
DoubleTab & valeurs() override
Returns the array of field values at the current time.
double recuperer_temps_passe(int i=1) const
Returns the time of the i-th past field.
double recuperer_temps_futur(int i=1) const
Returns the time of the i-th future field.
const Probleme_U & probleme(int i) const
Definition Couplage_U.h:127
int nb_problemes() const
Definition Couplage_U.h:117
virtual int calculer_coeffs_echange(double temps)
Computes the exchange coefficients for thermally coupled problems.
virtual void imposer_cond_lim(Champ_Inc_base &, double)=0
File for reading. This class is to the C++ ifstream class what the Entree class is to the.
Definition EFichier.h:29
virtual int ouvrir(const char *name, IOS_OPEN_MODE mode=ios::in)
Class defining operators and methods for all reading operation in an input flow (file,...
Definition Entree.h:42
class Equation_base The role of an equation is the calculation of one or more fields....
virtual const Champ_Inc_base & inconnue() const =0
virtual Domaine_Cl_dis_base & domaine_Cl_dis()
Returns the discretized boundary condition domain associated with the equation.
Probleme_base & probleme()
Returns the problem associated with the equation.
This class implements the operators and virtual methods of the EFichier class as follows: The file to...
Matrice_Base class - Base class of the matrix hierarchy.
class Nom: a character string for naming TRUST objects.
Definition Nom.h:31
virtual int find(const char *const n) const
Definition Nom.cpp:309
friend class Entree
Definition Objet_U.h:71
const Nom & que_suis_je() const
Returns the string identifying the class.
Definition Objet_U.cpp:104
virtual Entree & readOn(Entree &)
Reads an Objet_U from an input stream. Virtual method to override.
Definition Objet_U.cpp:289
static const Nom & nom_du_cas()
Returns a constant reference to the case name. This method is static.
Definition Objet_U.cpp:145
virtual Sortie & printOn(Sortie &) const
Writes the object to an output stream. Virtual method to override.
Definition Objet_U.cpp:278
Helper class to factorize the readOn method of Objet_U classes.
Definition Param.h:112
void ajouter(const char *keyword, const int *value, Param::Nature nat=Param::OPTIONAL)
Register an integer parameter.
Definition Param.cpp:364
Probleme_Couple This is the historical coupling class of TRUST.
const Nom & le_nom() const override
Returns the name of the Objet_U. Virtual method to override: returns "neant" in this implementation.
Definition Probleme_U.h:109
virtual bool updateGivenFields()
WARNING:
class Probleme_base It is a Probleme_U that is not a coupling.
bool is_dilatable() const
bool updateGivenFields() override
WARNING:
void abortTimeStep() override
Aborts the resolution of the current time step.
virtual int nombre_d_equations() const =0
virtual const Equation_base & equation(int) const =0
bool initTimeStep(double dt) override
This method allocates and initializes the unknown and given fields for the future time step.
static void exit(int exit_code=-1)
Exit routine for TRUST within a Kokkos region.
Definition Process.cpp:466
static int je_suis_maitre()
Returns 1 if on the master processor of the current group (i.e. me() == 0), 0 otherwise.
Definition Process.cpp:82
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...
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
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.
void set_param(Param &param) const override
int diffusion_implicite() const
Returns 1 if the time scheme has been read with diffusion_implicite.
double temps_courant() const
Returns the current time.
double dt_
Computation time step.
virtual void ajouter_inertie(Matrice_Base &mat_morse, DoubleTab &secmem, const Equation_base &eqn) const
Probleme_base & pb_base()
double pas_de_temps() const
Returns the current time step (delta_t).
virtual bool initTimeStep(double dt)
int nb_pas_dt() const
Returns the number of time steps performed.
virtual int mettre_a_jour()
Updates the current time (t+=dt) and the number of time steps performed (nb_pas_dt_++).
void update_critere_statio(const DoubleTab &tab_critere, Equation_base &equation)
Updates stationnaire_atteint_ and residu_ (criterion: residu_ < seuil_statio_).
Base class for output streams.
Definition Sortie.h:52