16#include <Probleme_base_interface_proto.h>
17#include <Domaine_Cl_dis_base.h>
18#include <ICoCoExceptions.h>
19#include <Probleme_base.h>
20#include <Postraitement.h>
21#include <Equation_base.h>
24using ICoCo::WrongArgument;
25using ICoCo::WrongContext;
30 throw WrongContext(pb.
le_nom().
getChar(),
"initialize",
"initialize should not have been called");
46 throw WrongContext(pb.
le_nom().
getChar(),
"presentTime",
"initialize should have been called");
48 throw WrongContext(pb.
le_nom().
getChar(),
"presentTime",
"terminate should not have been called");
57 throw WrongContext(pb.
le_nom().
getChar(),
"initTimeStep",
"initialize should have been called");
59 throw WrongContext(pb.
le_nom().
getChar(),
"initTimeStep",
"terminate should not have been called");
61 throw WrongContext(pb.
le_nom().
getChar(),
"initTimeStep",
"initTimeStep should not have been called");
63 throw WrongArgument(pb.
le_nom().
getChar(),
"initTimeStep",
"dt",
"dt should be a positive real number");
86 throw WrongContext(pb.
le_nom().
getChar(),
"solveTimeStep",
"initTimeStep should have been called");
103 throw WrongContext(pb.
le_nom().
getChar(),
"iterateTimeStep",
"initTimeStep should have been called");
126 throw WrongContext(pb.
le_nom().
getChar(),
"validateTimeStep",
"initTimeStep should have been called");
140 throw WrongContext(pb.
le_nom().
getChar(),
"terminate",
"initialize should have been called");
142 throw WrongContext(pb.
le_nom().
getChar(),
"terminate",
"terminate should not have been called");
144 throw WrongContext(pb.
le_nom().
getChar(),
"terminate",
"time step should be validated or aborted first");
156 throw WrongContext(pb.
le_nom().
getChar(),
"computeTimeStep",
"initialize should have been called");
158 throw WrongContext(pb.
le_nom().
getChar(),
"computeTimeStep",
"terminate should not have been called");
168 throw WrongContext(pb.
le_nom().
getChar(),
"isStationary",
"validateTimeStep should have been called");
170 throw WrongContext(pb.
le_nom().
getChar(),
"isStationary",
"terminate should not have been called");
178 throw WrongContext(pb.
le_nom().
getChar(),
"abortTimeStep",
"initTimeStep should have been called");
188 throw WrongContext(pb.
le_nom().
getChar(),
"resetTime",
"resetTime can not be called inside a time step computation");
190 throw WrongContext(pb.
le_nom().
getChar(),
"resetTime",
"resetTime can not be called before initialize or after terminate");
192 bool managePostTreatments=
true;
196 if (val == 1) managePostTreatments=
false;
200 if (!managePostTreatments) Cerr << pb.
que_suis_je() <<
": skip post-treatments in resetTime" << finl ;
201 if (managePostTreatments) pb.
postraiter(
true);
204 if (!dirname.empty())
222 if (managePostTreatments)
245 int n = input_fields.size();
246 Noms nouveaux_noms(n);
247 for (
int i = 0; i < n; i++)
248 nouveaux_noms[i] = input_fields[i]->le_nom();
251 noms.add(nouveaux_noms);
262 for (
int ii = 0; ii < liste_champ.size(); ii++)
263 noms.add(liste_champ(ii)->get_nom_post());
271 for (
int i = 0; i < input_fields.size(); i++)
272 if (input_fields[i]->le_nom() == name)
return input_fields[i];
280 OBS_PTR(Champ_Generique_base) ch;
287 const Nom& name = f.
le_nom();
288 for (
int i = 0; i < input_fields.size(); i++)
290 if (input_fields[i]->le_nom() == name)
291 throw WrongContext(name.
getChar(),
"addInputField",
"Field with this name is already in list");
299 throw WrongContext(pb.
le_nom().
getChar(),
"futureTime",
"initTimeStep should have been called");
class Champ_Generique_base
static void set_nom_pb_actuel(const Nom &nom)
virtual int calculer_coeffs_echange(double temps)
Computes the exchange coefficients for thermally coupled problems.
virtual void mettre_a_jour(double temps, Domaine_dis_base &, Probleme_base &)
virtual void initialiser(double temps, Domaine_dis_base &, Probleme_base &)
virtual void setUpdateTheGrid(bool)
virtual void validateTimeStep()
virtual bool getUpdateTheGrid()
virtual void set_dt(double &dt_)
virtual bool updateGivenFields()
virtual Domaine_Cl_dis_base & domaine_Cl_dis()
Returns the discretized boundary condition domain associated with the equation.
virtual bool initTimeStep(double dt)
Allocation and initialization of the unknown and boundary conditions until present+dt.
virtual void resetTime(double time)
Reset current time of the equation. Used from ICoCo. See documentation of Problem_base::resetTime().
const Nom & le_nom() const override
Returns the name of the field.
List_Champ_Generique Represents a list of Champ_Generique_base objects.
virtual void resetTime(double time)
virtual void abortTimeStep()
virtual bool initTimeStep(double dt)
class Nom: a character string for naming TRUST objects.
const char * getChar() const
An array of character strings (VECT(Nom)).
const Nom & que_suis_je() const
Returns the string identifying the class.
class Postraitement. The class holds -a list of generic fields champs_post_complet_ containing
void resetTime(double t, const std::string dirname)
const Nom & le_nom() const override
Returns the name of the Objet_U. Virtual method to override: returns "neant" in this implementation.
virtual bool checkOutputIntEntry(const Nom &name) const
virtual int getOutputIntValue(const Nom &name) const
void getInputFieldsNames_impl(const Probleme_base &pb, Noms &noms) const
bool updateGivenFields_impl(Probleme_base &pb)
void getOutputFieldsNames_impl(const Probleme_base &pb, Noms &noms) const
void initialize_impl(Probleme_base &pb)
void validateTimeStep_impl(Probleme_base &pb)
void abortTimeStep_impl(Probleme_base &pb)
void terminate_impl(Probleme_base &pb)
bool solveTimeStep_impl(Probleme_base &pb)
bool initTimeStep_impl(Probleme_base &pb, double dt)
bool iterateTimeStep_impl(Probleme_base &pb, bool &converged)
double futureTime_impl(const Probleme_base &pb) const
void resetTimeWithDir_impl(Probleme_base &pb, double time, std::string direname)
double presentTime_impl(const Probleme_base &pb) const
bool isStationary_impl(const Probleme_base &pb) const
double computeTimeStep_impl(const Probleme_base &pb, bool &stop) const
OBS_PTR(Field_base) findInputField_impl(const Probleme_base &pb
void addInputField_impl(Probleme_base &pb, Field_base &f)
class Probleme_base It is a Probleme_U that is not a coupling.
int postraiter(int force=1) override
If force=1, performs post-processing regardless of the post-processing frequencies.
const Domaine & domaine() const
Returns the domain associated with the problem.
virtual void preparer_calcul()
Prepares the computation: initializes the medium parameters and prepares the computation of each equa...
void init_postraitements()
Flags the first and last post-processing for each file And initializes the post-processing.
Postraitements & postraitements()
virtual int comprend_champ_post(const Motcle &nom) const
virtual void allocation() const final
Verifies that the necessary disk space exists.
virtual void finir()
Finalizes post-processing and saves the problem to a file.
virtual const Champ_Generique_base & get_champ_post(const Motcle &nom) const
virtual const Milieu_base & milieu() const
Returns the physical medium associated with the problem (const version).
const Schema_Temps_base & schema_temps() const
Returns the time scheme associated with the problem.
void terminate() override
This method is called once at the end, after any other one.
virtual int nombre_d_equations() const =0
virtual const Equation_base & equation(int) const =0
const Domaine_dis_base & domaine_dis() const
Returns the discretized domain associated with the problem (const version).
virtual double computeTimeStep(bool &stop) const
virtual bool isStationary() const
Returns 1 if during the last time step, the problem has not evolved.
double temps_courant() const
Returns the current time.
virtual void resetTime(double time)
virtual double temps_futur(int i) const =0
virtual void abortTimeStep()
virtual void validateTimeStep()
virtual void initialize()
virtual bool initTimeStep(double dt)
virtual int nb_valeurs_futures() const =0
virtual bool iterateTimeStep(bool &converged)
Calculate the U(n+1) unknown for each equation (if solved) of the problem with the selected time sche...
virtual double temps_defaut() const =0
static void set_root(const std::string dirname)