16#include <Champ_Gen_de_Champs_Gen.h>
17#include <Champ_Generique_refChamp.h>
18#include <Discretisation_base.h>
19#include <Champ_Fonc_base.h>
20#include <Champs_compris.h>
50 param.
ajouter(
"sources_reference",&noms_sources_ref_);
60 Journal() <<
"Reading a source type " << typ << finl;
62 is >> new_src.valeur();
65 else if (mot==
"source_reference")
67 Nom& new_s = noms_sources_ref_.add(
Nom());
69 Cerr<<
"WARNING : obsolete option. Use now sources_reference { " << new_s<<
" } instead of source_reference "<<new_s<<finl;
72 else if (mot==
"sources")
83 Cerr<<
"We should not use the keyword \"sources\" to specify a generic field"<<finl;
84 Cerr<<
"of type Champ_Gen_de_Champs_Gen without specifying sources"<<finl;
90 Journal() <<
"Reading a source type " << typ << finl;
92 is >> new_src.valeur();
98 Cerr << typ <<
" : We expected a ',' or '}'" << finl;
105 else if (mot==
"nom_source")
123 const int n = sources_.size();
124 for (
int i = 0; i < n; i++)
128OWN_PTR(
Champ_Fonc_base)& Champ_Gen_de_Champs_Gen::creer_espace_stockage(
const Nature_du_champ& nature,
134 ToDo_Kokkos(
"critical, call to creer_espace_stockage() is expensive on GPU (fields copy on host). Refactor like Champ_Generique_Moyenne and other advanced fields...");
149 if (directive==
"pression")
160 if ((sources_reference_.size()==0) && (sources_.size()==0))
163 Cerr <<
"Error : The field \"" << noms_sources_ref_ <<
"\" is not recognized in the sources_reference option of the " <<
que_suis_je() <<
" keyword." << finl;
164 Cerr <<
"\"" << noms_sources_ref_ <<
"\" should be defined before." << finl;
167 int n_sources_ref=sources_reference_.size();
170 if ( !sources_reference_[i])
173 Cerr <<
"Error : The field \"" << noms_sources_ref_[0] <<
"\" is not recognized in the sources_reference option of the " <<
que_suis_je() <<
" keyword." << finl;
174 Cerr <<
"\"" << noms_sources_ref_[0] <<
"\" should be defined before." << finl;
177 return sources_reference_[i].valeur();
180 return sources_[i-n_sources_ref].valeur();
186 return ref_cast_non_const(Champ_Generique_base,
get_source(i));
192 return sources_reference_.size()+sources_.size();
200 std::vector<YAML_data> data;
201 const int n = sources_.size();
202 for (
int i = 0; i < n; i++)
204 std::vector<YAML_data> source_data = sources_[i]->data_a_sauvegarder();
205 data.insert(data.end(), source_data.begin(), source_data.end());
215 const int n = sources_.size();
217 for (
int i = 0; i < n; i++)
227 const int n = sources_.size();
228 for (
int i = 0; i < n; i++)
235 int n_sources_ref=noms_sources_ref_.size();
236 if ( n_sources_ref!=sources_reference_.size())
238 sources_reference_.vide();
239 for (
int i=0; i<n_sources_ref; i++)
247 for (
int i = n_sources_ref ; i < n; i++)
253 const Nom& my_parent = champ.get_parent_name();
255 champ.set_parent_name(
me);
283 int rang = motcles.
search(query);
381 for (
int i=0; i<nb_sources; i++)
386 champ.nommer_sources(post);
387 champ.nommer_source();
392 champ.nommer_source(post);
396 Cerr<<
"There is no method nommer_source() for this type of field "<<finl;
397 Cerr<<
"sources_[i]->que_suis_je()"<<finl;
419 for (
int i = 0; i < n; i++)
432 for (
int i = 0; i < n; i++)
446 for (
int i = 0; i < n; i++)
475 throw std::runtime_error(std::string(
"Field ") + nom.
getString() + std::string(
" not found !"));
class Champ_Fonc_base Base class of fields that are functions of a calculated quantity
Base class of generic fields having other generic fields as source. The use of the class methods reli...
void get_copy_values(DoubleTab &) const override
Fills the values array with the discrete values of the field (creates a copy).
void mettre_a_jour(double temps) override
int sauvegarder(Sortie &os) const override
save the different sources
const IntTab & get_ref_connectivity(Entity index1, Entity index2) const override
Returns the connectivity array between the geometric entity index1 and entity index2.
Entity get_localisation(const int index=-1) const override
Returns the type of geometric entities on which the discrete values are attached (NODE for a P1 field...
const DoubleTab & get_ref_coordinates() const override
Returns a reference to the array of coordinates of the vertices of the mesh supporting the field,...
virtual void lire_bidon(Entree &is) const
int comprend_champ_post(const Motcle &identifiant) const override
virtual int get_nb_sources() const
void nommer_sources(const Postraitement_base &post)
int get_info_type_post() const override
virtual void fixer_tstat_deb(const double t1, const double t2)
const Noms get_property(const Motcle &query) const override
Returns the requested property.
const Champ_Generique_base & get_champ_post(const Motcle &nom) const override
virtual OWN_PTR(Champ_Fonc_base) &creer_espace_stockage(const Nature_du_champ &nature
void completer(const Postraitement_base &post) override
int reprendre(Entree &is) override
resume the different sources
const Probleme_base & get_ref_pb_base() const override
Returns the problem that carries the target field.
void get_property_names(Motcles &list) const override
Returns the list of possible "queries" for the field.
void get_copy_coordinates(DoubleTab &) const override
std::vector< YAML_data > data_a_sauvegarder() const override
for PDI IO: retrieve name, type and dimensions of the field to save/restore
void get_copy_connectivity(Entity index1, Entity index2, IntTab &) const override
void get_xyz_values(const DoubleTab &coords, DoubleTab &values, ArrOfBit &validity_flag) const override
Computes the point value of the field at the coordinates given in coords and puts them in values.
int get_dimension() const override
Returns the dimension of the space in which the field is defined.
const Domaine & get_ref_domain() const override
Returns a ref to the domain on which the storage space will be evaluated.
void get_copy_domain(Domaine &) const override
Creates a copy of the domain on which the storage space will be evaluated.
bool has_champ_post(const Motcle &nom) const override
const Domaine_Cl_dis_base & get_ref_zcl_dis_base() const override
Returns a ref to the discretized boundary conditions domain of the equation carrying the target field...
virtual const Champ_Generique_base & get_source(int i) const
virtual void nommer_source()
void set_param(Param ¶m) const override
virtual Champ_Generique_base & set_source(int i)
const Motcle get_directive_pour_discr() const override
Returns the directive (champ_elem, champ_sommets, champ_face or pression) to launch the discretizatio...
const Discretisation_base & get_discretisation() const override
Returns the discretization associated with the problem.
const Domaine_dis_base & get_ref_domaine_dis_base() const override
Returns a ref to the discretized domain on which the storage space will be evaluated.
double get_time() const override
Returns the time of the Champ_Generique_base.
int lire_motcle_non_standard(const Motcle &, Entree &) override
Reads non-simple-type parameters of an Objet_U from an input stream.
virtual void fixer_serie(const double t1, const double t2)
const DoubleTab & get_ref_values() const override
Returns a reference to the array of discrete values if it exists in memory.
virtual const int nb_comp
class Champ_Generique_base
virtual const Noms get_property(const Motcle &query) const
Returns the requested property.
virtual const Domaine_dis_base & get_ref_domaine_dis_base() const
Returns a ref to the discretized domain on which the storage space will be evaluated.
virtual bool has_champ_post(const Motcle &nom) const
virtual void get_property_names(Motcles &list) const
Returns the list of possible "queries" for the field.
virtual const IntTab & get_ref_connectivity(Entity index1, Entity index2) const
Returns the connectivity array between the geometric entity index1 and entity index2.
virtual int comprend_champ_post(const Motcle &identifiant) const
virtual void get_copy_connectivity(Entity index1, Entity index2, IntTab &) const
virtual const Champ_Generique_base & get_champ_post(const Motcle &nom) const
virtual const Domaine_Cl_dis_base & get_ref_zcl_dis_base() const
Returns a ref to the discretized boundary conditions domain of the equation carrying the target field...
virtual double get_time() const
Returns the time of the Champ_Generique_base.
virtual int get_dimension() const
Returns the dimension of the space in which the field is defined.
virtual int get_info_type_post() const =0
int lire_motcle_non_standard(const Motcle &, Entree &) override
Reads non-simple-type parameters of an Objet_U from an input stream.
virtual void get_copy_domain(Domaine &) const
Creates a copy of the domain on which the storage space will be evaluated.
virtual const DoubleTab & get_ref_coordinates() const
Returns a reference to the array of coordinates of the vertices of the mesh supporting the field,...
virtual const DoubleTab & get_ref_values() const
Returns a reference to the array of discrete values if it exists in memory.
virtual const Probleme_base & get_ref_pb_base() const
Returns the problem that carries the target field.
virtual Entity get_localisation(const int index=-1) const
Returns the type of geometric entities on which the discrete values are attached (NODE for a P1 field...
virtual void get_copy_coordinates(DoubleTab &) const
void nommer(const Nom &nom) override
Assigns a name to the Objet_U. Virtual method to override.
virtual const Domaine & get_ref_domain() const
Returns a ref to the domain on which the storage space will be evaluated.
virtual const Motcle get_directive_pour_discr() const
Returns the directive (champ_elem, champ_sommets, champ_face or pression) to launch the discretizatio...
virtual const Discretisation_base & get_discretisation() const
Returns the discretization associated with the problem.
OBS_PTR(Probleme_base) ref_pb_
virtual void completer(const Postraitement_base &post)=0
Special field class that encapsulates a reference to a volume field of TRUST of type Champ_base.
virtual void completer(const Domaine_Cl_dis_base &zcl)
class Discretisation_base This class represents a spatial discretization scheme, which
void discretiser_champ(const Motcle &directive, const Domaine_dis_base &z, const Nom &nom, const Nom &unite, int nb_comp, int nb_pas_dt, double temps, OWN_PTR(Champ_Inc_base)&champ, const Nom &sous_type=NOM_VIDE) const
class Domaine_Cl_dis_base Domaine_Cl_dis_base objects represent discretized boundary conditions
class Domaine_dis_base This class is the base of the hierarchy of discretized domains.
Class defining operators and methods for all reading operation in an input flow (file,...
A character string (Nom) in uppercase.
An array of Motcle objects.
int search(const Motcle &t) const
class Nom: a character string for naming TRUST objects.
const std::string & getString() const
An array of character strings (VECT(Nom)).
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.
void ajouter_non_std(const char *keyword, const Objet_U *value, Param::Nature nat=Param::OPTIONAL)
Register a keyword handled by Objet_U::lire_motcle_non_standard.
Base class for all post-processing objects.
class Postraitement. The class holds -a list of generic fields champs_post_complet_ containing
virtual const Champ_Generique_base & get_champ_post(const Motcle &nom) const
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.
static Sortie & Journal(int message_level=0)
Returns a static Sortie object used as an event journal.
static int me()
Returns the rank of the local processor in the current communication group. See Comm_Group::rank() an...
static void exit(int exit_code=-1)
Exit routine for TRUST within a Kokkos region.
Base class for output streams.