16#include <EcritureLectureSpecial.h>
17#include <Scalaire_impose_paroi.h>
18#include <Domaine_Cl_dis_base.h>
19#include <Schema_Temps_base.h>
20#include <Champ_Inc_P0_base.h>
21#include <Champ_Inc_P1_base.h>
22#include <Neumann_val_ext.h>
23#include <MD_Vector_tools.h>
24#include <Champ_Inc_base.h>
25#include <Equation_base.h>
26#include <Probleme_base.h>
27#include <TRUST_2_PDI.h>
28#include <Domaine_VF.h>
78 Cerr <<
" the file does not contain the correct number of values to fill the field" << finl;
82 for (
int i = 0; i < n; i++)
89 Cerr <<
"Internal error in Champ_Inc_base::fixer_nb_valeurs_nodales: method has not been implemented for class " <<
que_suis_je() << finl;
97 for (
int i = 0; i < n; i++)
99 DoubleTab& tab =
futur(i);
112 Cerr <<
"Internal error in Champ_Inc_base::creer_tableau_distribue:\n" <<
" array has alreary a (wrong) parallel descriptor" << finl;
126 const DoubleTab& v =
valeurs();
159 else if (
temps() > tps)
170 Cerr <<
"ERROR : in Champ_Inc_base::valeurs(double), time " << tps <<
" not found, returns the present?" << finl;
171 Cerr <<
"Contact TRUST support." << finl;
201 else if (
temps() > tps)
213 Cerr <<
"ERROR : in Champ_Inc_base::valeurs(double), time " << tps <<
" not found, returns the present?" << finl;
214 Cerr <<
"Contact TRUST support." << finl;
275 Cerr <<
"In Champ_Inc_base::mettre_a_jour(double), " << finl;
276 Cerr <<
"time " << un_temps <<
" not found in field " <<
le_nom() << finl;
277 Cerr <<
"The times available are :" << finl;
351 Cerr <<
"Champ_Inc_base::get_PDI_dname equation has not been associated yet. Please set the dataset name with Champ_Inc_base::set_PDI_dname()." << finl;
366 std::vector<YAML_data> data;
381 int a_faire, special;
390 fich << mon_ident << finl;
410 if(
valeurs().dimension_tot(0) )
415 ArrOfDouble garbage(
valeurs().nb_dim() );
430 Cerr <<
"Backup of the field " <<
nom_ <<
" performed on time : " <<
Nom(
temps_,
"%e") << finl;
431 if (!est_egal(
temps_,
equation().probleme().schema_temps().temps_courant()))
452 Cerr <<
"Resume of the field " <<
nom_ << finl;
458 if(
valeurs().dimension_tot(0) )
462 ArrOfDouble garbage(
valeurs().nb_dim() );
477 Cerr << finl <<
"Problem in the resumption " << finl;
478 Cerr <<
"The field wich is read, does not have same number of nodal values" << finl;
479 Cerr <<
"that the field created by the discretization " << finl;
483 Cerr <<
" performed." << finl;
489 Cerr << finl <<
"Problem in the resumption " << finl;
490 Cerr <<
"PDI format does not require to navigate through file..." << finl;
510 domaine.chercher_elements(positions, les_polys);
526 domaine.chercher_elements(positions, les_polys);
540 domaine.chercher_elements(position, le_poly);
554 if (
valeurs().size_reelle_ok())
569 Cerr <<
"Champ_Inc_base::affecter_ not coded if size_reelle_ok()==0" << finl;
610 Cerr <<
que_suis_je() <<
"did not overloaded Champ_Inc_base::trace" << finl;
655 Cerr <<
que_suis_je() <<
"::imprime not coded." << finl;
662 Cerr <<
que_suis_je() <<
"::integrale_espace not coded." << finl;
700 mon_dom_cl_dis = zcl;
713 return mon_dom_cl_dis.valeur();
721 return mon_dom_cl_dis.valeur();
745 const IntTab& f_e =
domaine.face_voisins(), &f_s =
domaine.face_sommets();
746 DoubleTrav result(
domaine.xv_bord().dimension_tot(0),
valeurs().line_size());
750 for (
const auto& itr : cls)
757 result(fb, n) = is_p ? ref_cast(
Neumann, itr.valeur()).flux_impose(j, n) : ref_cast(
Dirichlet, itr.valeur()).val_imp(j, n);
765 result(fb, n) =
valeurs()(f_e(f, f_e(f, 0) == -1), n);
770 for (n_som = 0; n_som < f_s.dimension(1) && f_s(f, n_som) >= 0;)
772 for (n = 0; n < N; n++)
774 for (k = 0; k < n_som; k++)
775 for (s = f_s(f, k), n = 0; n < N; n++)
776 result(fb, n) +=
valeurs()(s, n) / n_som;
781 result(fb, n) =
valeurs()(f, n);
783 Process::exit(
"Champ_Inc_base::valeur_aux_bords() : must code something!");
: class Champ_Inc_P0_base
const Domaine & domaine() const
void associer_domaine_dis_base(const Domaine_dis_base &) override
virtual int remplir_coord_noeuds_et_polys(DoubleTab &, IntVect &) const
DOES NOTHING. Method to override.
virtual void creer_tableau_distribue(const MD_Vector &, RESIZE_OPTIONS=RESIZE_OPTIONS::COPY_INIT)
DoubleTab & futur(int i=1) override
Returns field values at instant t+i.
int fixer_nb_valeurs_nodales(int) override
int lire_donnees(Entree &)
Reads the field values from an input stream.
virtual void associer_domaine_cl_dis(const Domaine_Cl_dis_base &)
virtual int fixer_nb_valeurs_temporelles(int)
Sets the number of temporal values to keep.
void init_champ_calcule(const Objet_U &obj, fonc_calc_t fonc)
virtual int nb_valeurs_temporelles() const
Returns the number of temporal values currently kept.
bool bord_fluide_multiphase_
DoubleVect & valeur_aux_compo(const DoubleTab &positions, DoubleVect &valeurs, int ncomp) const override
Computes the values of the unknown field at the specified positions, for a given component of the fie...
const Domaine_Cl_dis_base & domaine_Cl_dis() const
void mettre_a_jour(double temps) override
Performs a time update of the unknown field.
virtual DoubleTab & remplir_coord_noeuds_compo(DoubleTab &, int) const
Simple call to Champ_Inc_base::remplir_coord_noeuds(DoubleTab&).
void resetTime(double time) override
const Domaine_dis_base & domaine_dis_base() const override
double changer_temps(const double temps) override
Sets the time of the field.
virtual std::vector< YAML_data > data_a_sauvegarder() const
for PDI IO: retrieve name, type and dimensions of the field to save/restore.
DoubleTab & valeurs() override
Returns the array of field values at the current time.
virtual void associer_eqn(const Equation_base &)
Associates the field with the equation of which it represents an unknown.
virtual int remplir_coord_noeuds_et_polys_compo(DoubleTab &, IntVect &, int) const
Simple call to: Champ_Inc_base::remplir_coord_noeuds_et_polys(DoubleTab&,IntVect& poly).
virtual void verifie_valeurs_cl()
int sauvegarder(Sortie &) const override
Saves the unknown field to an output stream.
Champ_Inc_base & avancer(int i=1)
Advances the current pointer by i time steps, in the list of kept temporal values.
double changer_temps_passe(double, int i=1)
Sets the time of the i-th past field.
virtual double integrale_espace(int ncomp) const
int nb_valeurs_nodales() const override
Returns the number of "real" geometric positions of the degrees of freedom, or -1 if not applicable (...
DoubleVect & valeur_a(const DoubleVect &position, DoubleVect &valeurs) const override
Computes the value of the unknown field at the specified position.
double recuperer_temps_passe(int i=1) const
Returns the time of the i-th past field.
virtual DoubleTab & remplir_coord_noeuds(DoubleTab &) const =0
Champ_Inc_base & reculer(int i=1)
Rewinds the current pointer by i time steps, in the list of kept temporal values.
int reprendre(Entree &) override
Reads an unknown field from an input stream for a restart.
DoubleTab & trace(const Frontiere_dis_base &, DoubleTab &, double, int distant) const override
See Champ_base. Special case (unfortunately) of Champ_P0_VDF:
DoubleTab & valeur_aux(const DoubleTab &positions, DoubleTab &valeurs) const override
Computes the values of the unknown field at the specified positions.
Champ_base & affecter_compo(const Champ_base &, int compo) override
Assignment of a component of a generic OWN_PTR(Champ_base) (Champ_base) to a component of an unknown ...
Champ_base & affecter_(const Champ_base &) override
Assignment of a generic OWN_PTR(Champ_base) (Champ_base) to an unknown field.
Nom get_PDI_dname() const
for PDI IO: retrieve the name of the HDF5 dataset in which the field will be saved or be restored fro...
int imprime(Sortie &, int) const override
DoubleTab valeur_aux_bords() const override
Returns the field value at the boundary faces.
double recuperer_temps_futur(int i=1) const
Returns the time of the i-th future field.
double changer_temps_futur(double, int i=1)
Sets the time of the i-th future field.
class Champ_base This class is the base of the fields hierarchy.
Champ_base()
Default constructor of a Champ_base.
virtual DoubleVect & valeur_aux_elems_compo(const DoubleTab &positions, const IntVect &les_polys, DoubleVect &valeurs, int ncomp) const
Causes an error! Must be overridden by derived classes.
double temps() const
Returns the time of the field.
virtual DoubleTab & valeur_aux(const DoubleTab &positions, DoubleTab &valeurs) const
Causes an error! Must be overridden by derived classes.
virtual DoubleTab & valeur_aux_elems(const DoubleTab &positions, const IntVect &les_polys, DoubleTab &valeurs) const
Causes an error! Must be overridden by derived classes.
virtual DoubleVect & valeur_a_elem(const DoubleVect &position, DoubleVect &valeurs, int le_poly) const
Causes an error! Must be overridden by derived classes.
virtual DoubleVect & valeur_aux_compo(const DoubleTab &positions, DoubleVect &valeurs, int ncomp) const
Same as valeur_aux(const DoubleTab &, DoubleTab &), but computes only the component compo of the fiel...
class Conds_lim This class represents a vector of boundary conditions.
Dirichlet This class is the base class of the hierarchy of Dirichlet-type boundary conditions.
class Domaine_Cl_dis_base Domaine_Cl_dis_base objects represent discretized boundary conditions
const Cond_lim & les_conditions_limites(int) const
Returns the i-th boundary condition.
const Nom & le_nom() const override
Returns the name of the Objet_U. Virtual method to override: returns "neant" in this implementation.
class Domaine_dis_base This class is the base of the hierarchy of discretized domains.
const Domaine & domaine() const
static int is_ecriture_special(int &special, int &a_faire)
Indicates whether the special format was requested in active writing by xyz save.
static int is_lecture_special()
Indicates whether the special format was requested in active reading by xyz restart.
static int ecriture_special(const Champ_base &ch, Sortie &fich)
Simple call to EcritureLectureSpecial::ecriture_special (const Domaine_VF& zvf,Sortie& fich,...
static void lecture_special(Champ_base &ch, Entree &fich)
Simple call to EcritureLectureSpecial::lecture_special (const Domaine_VF& zvf,Entree& fich,...
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 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.
const Nom & le_nom() const override
Returns the name of the field.
int num_face(const int) const
class Frontiere_dis_base Class representing a discretized boundary.
: This class is an OWN_PTR but the pointed object is shared among multiple
int mon_equation_non_nul() const
void associer_eqn(const Equation_base &)
Associates an equation with the object.
const Equation_base & equation() const
Returns the reference to the equation pointed to by MorEqn::mon_equation.
A character string (Nom) in uppercase.
Classe Neumann_val_ext This class is the base class of the hierarchy of.
Classe Neumann This class is the base class of the hierarchy of Neumann-type boundary conditions.
class Nom: a character string for naming TRUST objects.
const char * getChar() const
virtual int debute_par(const char *const n) const
const std::string & getString() const
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.
Objet_U()
Default constructor: assigns a unique identifier to the object (object_id_) and registers the object ...
virtual Sortie & printOn(Sortie &) const
Writes the object to an output stream. Virtual method to override.
const Nom & le_nom() const override
Returns the name of the Objet_U. Virtual method to override: returns "neant" in this implementation.
const Domaine & domaine() const
Returns the domain associated with the problem.
const Schema_Temps_base & schema_temps() const
Returns the time scheme associated with the problem.
static void exit(int exit_code=-1)
Exit routine for TRUST within a Kokkos region.
Roue class used in Champ_Inc_Base.
double temps() const
Returns the time value of the Roue.
double changer_temps(const double t)
Changes the time of the Roue.
const DoubleTab & valeurs() const
Returns the value array of the Roue.
const Roue & futur(int i=1) const
Returns the Roue corresponding to the i-th future slot.
const Roue & passe(int i=1) const
Returns the Roue corresponding to the i-th past slot.
Scalaire_impose_paroi Imposes a scalar at the wall in a Convection-Diffusion equation for a scalar.
double temps_courant() const
Returns the current time.
Base class for output streams.
_SIZE_ size_array() const
void jump(Entree &) override
virtual void ref(const TRUSTTab &)
void lit(Entree &, bool resize_and_read=true) override
virtual void ref_tab(TRUSTTab &, _SIZE_ start_line=0, _SIZE_ nb_lines=-1)
void resize(_SIZE_ n, RESIZE_OPTIONS opt=RESIZE_OPTIONS::COPY_INIT)
void ecrit(Sortie &) const override
_SIZE_ dimension(int d) const
_SIZE_ size_reelle_ok() const
virtual const MD_Vector & get_md_vector() const
virtual void echange_espace_virtuel(IsExchangeBlocking exchange_type=IsExchangeBlocking::DefaultBlocking, const std::string kernel_name="noname")
TRUST_2_PDI Encapsulation of PDI methods (library used for IO operations). See the website pdi....
void share_type(const Nom &name, const Nom &type)
Generic method to share the type of a TRUST object.
void read(const std::string &name, void *data)
static int is_PDI_checkpoint()
static int is_PDI_restart()
void share_TRUSTTab_dimensions(const DoubleTab &tab, const Nom &name, int write)
Generic method to share the dimensions of a TRUST DoubleTab with PDI.
void TRUST_start_sharing(const std::string &name, const void *data)
YAML_data class: collection of all needed information for data to save/restore in order to write the ...
void set_save_field_type(bool b)