16#include <Navier_Stokes_std.h>
17#include <Sch_CN_iteratif.h>
18#include <communications.h>
19#include <Probleme_base.h>
20#include <Equation_base.h>
172 fic.
ouvrir(
"dt_CN",ios::app);
176 fic <<
"Sch_CN_iteratif : pb= " << pb.
le_nom()
185 for(
int i=0; i<nb_eqn && !diverged; i++)
189 converged = converged && cv;
197 assert(!(converged&&diverged));
211 <<
" result= CONVERGENCE" << finl;
224 <<
" result= DIVERGENCE" << finl;
236 <<
" result= NON_CONVERGENCE" << finl;
245 <<
" result= CONTINUE" << finl;
267 Cout<<
"====================================================" << finl;
268 Cout<< eqn.
que_suis_je()<<
" equation is not solved."<<finl;
269 Cout<<
"====================================================" << finl;
285 DoubleTab& intermediaire = eqn.
inconnue().
valeurs(temps_intermediaire);
288 DoubleTab dudt(present);
290 DoubleTab delta(intermediaire);
313 intermediaire = dudt;
314 intermediaire*= dt_intermediaire;
315 intermediaire+= present;
322 final.echange_espace_virtuel();
324 delta+=intermediaire;
355 Cerr <<
"Sch_CN_iteratif::faire_un_pas_de_temps_eqn_base non code!" << finl;
378 double a = mp_max_abs_vect(delta);
379 double b = mp_max_abs_vect(up1);
380 int resu = (2. * a) < (
seuil * b);
381 envoyer_broadcast(resu, 0);
DoubleTab & valeurs() override
Returns the array of field values at the current time.
Champ_Inc_base & avancer(int i=1)
Advances the current pointer by i time steps, in the list of kept temporal values.
Champ_Inc_base & reculer(int i=1)
Rewinds the current pointer by i time steps, in the list of kept temporal values.
virtual void imposer_cond_lim(Champ_Inc_base &, double)=0
Class defining operators and methods for all reading operation in an input flow (file,...
class Equation_base The role of an equation is the calculation of one or more fields....
virtual int equation_non_resolue() const
virtual const Champ_Inc_base & inconnue() const =0
virtual DoubleTab & derivee_en_temps_inco(DoubleTab &)
Returns the time derivative of the unknown I of the equation: dI/dt = M-1*(sum(operators(I) + sources...
virtual Domaine_Cl_dis_base & domaine_Cl_dis()
Returns the discretized boundary condition domain associated with the equation.
Schema_Temps_base & schema_temps()
Returns the time scheme associated with the equation.
const Nom & que_suis_je() const
Returns the string identifying the class.
virtual Entree & readOn(Entree &)
Reads an Objet_U from an input stream. Virtual method to override.
virtual Sortie & printOn(Sortie &) const
Writes the object to an output stream. Virtual method to override.
Helper class to factorize the readOn method of Objet_U classes.
void ajouter(const char *keyword, const int *value, Param::Nature nat=Param::OPTIONAL)
Register an integer parameter.
const Nom & le_nom() const override
Returns the name of the Objet_U. Virtual method to override: returns "neant" in this implementation.
class Probleme_base It is a Probleme_U that is not a coupling.
virtual int nombre_d_equations() const =0
virtual const Equation_base & equation(int) const =0
static void exit(int exit_code=-1)
Exit routine for TRUST within a Kokkos region.
static int je_suis_maitre()
Returns 1 if on the master processor of the current group (i.e. me() == 0), 0 otherwise.
SFichier is to the C++ ofstream class what Sortie is to the C++ ostream class.
Time scheme alternating a half implicit Euler step and a half LeapFrog step.
virtual bool iterateTimeStepOnEquation(int i, bool &converged)
Computes one iteration of the resolution on equation i.
bool initTimeStep(double dt) override
int faire_un_pas_de_temps_eqn_base(Equation_base &) override
virtual bool divergence(const DoubleTab &u0, const DoubleTab &up1, const DoubleTab &delta, int p) const
Indicates whether the iterative computation has diverged.
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 bool convergence(const DoubleTab &u0, const DoubleTab &up1, const DoubleTab &delta, int p) const
Indicates whether the iterative computation has converged.
int nb_valeurs_futures() const override
Returns the number of future time values.
void set_param(Param &titi) const override
int nb_valeurs_temporelles() const override
Returns the number of time values to keep.
double temps_futur(int i) const override
Returns the time at the i-th future value.
double temps_defaut() const override
Returns the time that fields should use when calling valeurs().
virtual void ajuster_facsec(type_convergence cv)
int & set_stationnaire_atteint()
double temps_courant() const
Returns the current time.
virtual void set_param(Param &titi) const override
double dt_
Computation time step.
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 void mettre_a_jour_dt_stab()
void update_critere_statio(const DoubleTab &tab_critere, Equation_base &equation)
Updates stationnaire_atteint_ and residu_ (criterion: residu_ < seuil_statio_).
virtual int ouvrir(const char *name, IOS_OPEN_MODE mode=ios::out)
Base class for output streams.
virtual void echange_espace_virtuel(IsExchangeBlocking exchange_type=IsExchangeBlocking::DefaultBlocking, const std::string kernel_name="noname")