16#include <Discretisation_base.h>
17#include <Domaine_dis_cache.h>
18#include <Schema_Temps_base.h>
19#include <Champ_Fonc_Tabule.h>
20#include <Champ_Uniforme.h>
21#include <Probleme_base.h>
22#include <Equation_base.h>
23#include <Milieu_base.h>
24#include <Interprete.h>
25#include <Domaine_VF.h>
60 const Nom& sous_type)
const
67 discretiser_champ(directive, z, scalaire, noms, unites, nb_comp, nb_pas_dt, temps, champ, sous_type);
95void Discretisation_base::test_demande_description(
const Motcle& directive,
const Nom& type_objet)
const
99 Cerr <<
"Discr_base : none directive understood" << finl;
104 Cerr <<
"\nError in Discr_base::discretiser_(..., ";
105 Cerr << type_objet <<
")\n";
107 Cerr <<
" does not understood the following directive :\n " << directive;
108 Cerr <<
"\n The understood directives are :\n";
123 test_demande_description(directive, champ.
que_suis_je());
140 test_demande_description(directive, champ.
que_suis_je());
157 test_demande_description(directive, champ.
que_suis_je());
169 Process::exit(
"Discretisation_base::discretiser_variables() does nothing and must be overloaded !");
175void Discretisation_base::champ_fixer_membres_communs(
Champ_base& ch,
const Domaine_dis_base& z,
const Nom& type,
const Nom& nom,
const Nom& unite,
int nb_comp,
int nb_ddl,
double temps)
180 if ((nb_comp > 1) && (nb_comp ==
dimension))
193 noms[1] = nom +
"teta";
211 const Nom& directive,
const Nom& nom_discretisation)
217 champ_fixer_membres_communs(chb, z, type, nom, unite, nb_comp, nb_ddl, temps);
227 const Nom& nom_discretisation)
232 champ_fixer_membres_communs(chb, z, type, nom, unite, nb_comp, nb_ddl, temps);
242 const Nom& nom_discretisation)
247 champ_fixer_membres_communs(chb, z, type, nom, unite, nb_comp, nb_ddl, temps);
253 if (dis ==
"VEFPreP1B") dis =
"VEF";
255 const Domaine& dom = le_domaine_.valeur();
261 Cerr <<
"Discretization of the field 'volume of meshes'" << finl;
271 Cerr <<
"Discretization of the field mesh numbering" << finl;
282 ch->
nommer(
"mesh_numbering");
283 DoubleTab& tab = ch->
valeurs();
286 const IntTab& elem_faces = domaine_VF.
elem_faces();
288 int nb_soms_elem = les_elems.
dimension(1);
289 int nb_faces_elem = elem_faces.
dimension(1);
290 for (
int elem=0; elem<nb_elem; elem++)
292 for (
int som = 0; som < nb_soms_elem; som++)
293 tab(elem, 0) += les_elems(elem, som);
294 tab(elem, 0) /= nb_soms_elem;
296 for (
int face = 0; face < nb_faces_elem; face++)
297 tab(elem, 2) += elem_faces(elem, face);
298 tab(elem, 2) /= nb_faces_elem;
304 Cerr <<
"Discret_Thyd::residu() does nothing ! " <<
que_suis_je() <<
" needs to overload it !" << finl;
310 Cerr <<
que_suis_je() <<
" must overload Discretisation_base::modifier_champ_tabule !" << finl;
317 le_champ.
nommer(nom_champ);
324 for (
int i = 0; i < noms_variables.size(); i++)
329 les_ch_eq.add(champ);
331 modifier_champ_tabule(domaine_dis, ref_cast(
Champ_Fonc_Tabule, le_champ), les_ch_eq);
344 if (class_operateur ==
"Source")
346 type = type_operateur;
351 if (isQC && ((eqn.
que_suis_je() !=
"Transport_K_Epsilon") && (eqn.
que_suis_je() !=
"Transport_K_Epsilon_Bas_Reynolds") && (eqn.
que_suis_je() !=
"Transport_K_Epsilon_Realisable") && (eqn.
que_suis_je() !=
"Transport_K_Epsilon_V2")))
355 if (disc ==
"VEFPreP1B")
357 if ((
Motcle(type_operateur) ==
"boussinesq_temperature") || (
Motcle(type_operateur) ==
"boussinesq_concentration") || (
Motcle(type_operateur) ==
"boussinesq"))
364 if (type_ch ==
"Champ_Q1NC") type_ch =
"Champ_P1NC";
373 else if (class_operateur ==
"Solveur_Masse")
378 if (discr ==
"VEFPreP1B") discr =
"VEF";
384 if (type_ch ==
"Champ_Q1NC") type_ch =
"Champ_P1NC";
385 if (type_ch.
debute_par(
"Champ_P0_VDF")) type_ch =
"Champ_P0_VDF";
386 if (type_ch.
debute_par(
"Champ_Face")) type_ch =
"Champ_Face";
392 else if (class_operateur ==
"Operateur_Grad")
397 if (type_pb ==
"Probleme_SG")
399 type += (type_pb.
suffix(
"Probleme_"));
409 if (type_inco ==
"Champ_Q1NC") type_inco =
"Champ_P1NC";
411 type += (type_inco.
suffix(
"Champ_"));
421 else if (class_operateur ==
"Operateur_Div")
430 if (type_inco ==
"Champ_Q1NC") type_inco =
"Champ_P1NC";
432 type += (type_inco.
suffix(
"Champ_"));
435 else if (class_operateur ==
"Operateur_Diff")
437 Nom typ(type_operateur);
438 if (typ ==
"standard") typ =
"";
440 Cerr <<
"We treat the diffusive operator of : " << eqn.
que_suis_je() << finl;
444 Cerr <<
"The discretization used is : " << nom_discr << finl;
447 const Champ_base& diffusivite = champ_sup.valeur();
449 if (nom_discr ==
"VEFPreP1B") nom_discr =
"VEF";
455 if ((nom_discr ==
"VDF") || (nom_discr ==
"VEF"))
460 else if (diffusivite.
nb_comp() > 1 && diffusivite.
le_nom() ==
"conductivite") nb_inc =
"ANISOTROPE_";
462 nb_inc =
"_Multi_inco_Multi_scalar_";
465 if (nom_discr ==
"VEF") nb_inc =
"_";
466 else nb_inc =
"_Multi_inco_";
476 type += (type_inco.
suffix(
"Champ_"));
477 if (
axi == 1) type +=
"_Axi";
481 else if (class_operateur ==
"Operateur_Conv")
484 type += type_operateur;
490 if (discr ==
"VEFPreP1B") discr =
"VEF";
493 if (
Motcle(type_operateur) ==
Motcle(
"ALE"))
return type;
494 if (type_operateur !=
"KEps_Comp")
498 if (type_inco ==
"Champ_Q1NC") type_inco =
"Champ_P1NC";
499 if (type_inco.
debute_par(
"Champ_P0_VDF")) type_inco =
"Champ_P0_VDF";
500 if (type_inco.
debute_par(
"Champ_Face")) type_inco =
"Champ_Face";
502 type += (type_inco.
suffix(
"Champ_"));
505 if (type_operateur ==
"quick") type +=
"_Axi";
509 else if (class_operateur ==
"Operateur_Evanescence")
512 if (type_inco ==
"Champ_Q1NC") type_inco =
"Champ_P1NC";
513 if (type_inco.
debute_par(
"Champ_P0_VDF")) type_inco =
"Champ_P0_VDF";
514 if (type_inco.
debute_par(
"Champ_Face")) type_inco =
"Champ_Face";
516 type_inco.
suffix(
"Champ");
517 type =
Nom(
"Op_Evanescence") + (type_operateur !=
"" ?
"_" :
"") + type_operateur +
"_" +
que_suis_je() + type_inco;
521 Cerr << class_operateur <<
" not understood in get_name_of_type_for of " <<
que_suis_je() << finl;
540 if (sous_type.
debute_par(
"Champ_Face_dep_expr") && type ==
"Champ_Face_VDF")
546 Cerr <<
"Error in " <<
que_suis_je() <<
" ::discretiser_champ" << finl;
547 Cerr << sous_type <<
" is not a sub type of " << type <<
" for " <<
que_suis_je() <<
" discretization";
548 Cerr <<
"( directive : \"" << directive <<
"\")" << finl;
553 Cerr <<
"Error in " <<
que_suis_je() <<
"::discretiser_champ" << finl;
554 Cerr <<
"Unknown class type " << sous_type << finl;
class Champ_Don_base base class of Given Fields (not calculated)
DoubleTab & valeurs() override
Overrides Champ_base::valeurs() Returns the array of values.
Class Champ_Fonc_Tabule Derived class of Champ_Fonc_base representing.
class Champ_Fonc_base Base class of fields that are functions of a calculated quantity
virtual int fixer_nb_valeurs_temporelles(int)
Sets the number of temporal values to keep.
class Champ_base This class is the base of the fields hierarchy.
virtual int fixer_nb_valeurs_nodales(int n)
virtual double changer_temps(const double t)
Sets the time at which the field is defined.
virtual void associer_domaine_dis_base(const Domaine_dis_base &)
class Discretisation_base This class represents a spatial discretization scheme, which
virtual void discretiser_variables() const
void nommer_completer_champ_physique(const Domaine_dis_base &domaine_vdf, const Nom &nom_champ, const Nom &unite, Champ_base &champ, const Probleme_base &pbi) const
void mesh_numbering(const Schema_Temps_base &sch, const Domaine_dis_base &z, OWN_PTR(Champ_Fonc_base)&ch) const
virtual Domaine_dis_base & discretiser() const
OBS_PTR(Domaine) le_domaine_
static void creer_champ(OWN_PTR(Champ_Inc_base)&ch, const Domaine_dis_base &z, const Nom &type, const Nom &nom, const Nom &unite, int nb_comp, int nb_ddl, int nb_pas_dt, double temps, const Nom &directive=NOM_VIDE, const Nom &nom_discretisation=NOM_VIDE)
Static method that creates an OWN_PTR(Champ_Inc_base) of the specified type.
void volume_maille(const Schema_Temps_base &sch, const Domaine_dis_base &z, OWN_PTR(Champ_Fonc_base)&ch) const
virtual Nom get_name_of_type_for(const Nom &class_operateur, const Nom &type_operteur, const Equation_base &eqn, const OBS_PTR(Champ_base)&champ_supp=OBS_PTR(Champ_base)()) const
Fills the Nom type depending on the class of operator, the type of operator and the equation.
void associer_domaine(const Domaine &dom)
static const Nom NOM_VIDE
static const Motcle DEMANDE_DESCRIPTION
virtual void residu(const Domaine_dis_base &, const Champ_Inc_base &, OWN_PTR(Champ_Fonc_base)&) const
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
int verifie_sous_type(Nom &type, const Nom &sous_type, const Motcle &directive) const
double volumes(int i) const
int elem_faces(int i, int j) const
Returns the index of the i-th face of element num_elem; the face numbering convention is.
class Domaine_dis_base This class is the base of the hierarchy of discretized domains.
const Domaine & domaine() const
static Domaine_dis_base & Build_or_get(const Nom &type, const Domaine &dom, const Discretisation_base *disc=nullptr)
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....
const bool & diffusion_multi_scalaire() const
const Discretisation_base & discretisation() const
Returns the discretization associated with the equation.
virtual const Champ_Inc_base & inconnue() const =0
Probleme_base & probleme()
Returns the problem associated with the equation.
virtual void fixer_nb_comp(int i)
Sets the number of components of the field.
const Nom & le_nom() const override
Returns the name of the field.
void nommer(const Nom &) override
Gives a name to the field.
virtual const Nom & fixer_unite(const Nom &)
Specifies the unit of a scalar field or whose all components have the same unit.
virtual int nb_comp() const
virtual const Noms & fixer_noms_compo(const Noms &)
Sets the names of the field components.
static Objet_U & objet(const Nom &)
See Interprete_bloc::objet_global(). BM: the Interprete class is not the best place for this.
A character string (Nom) in uppercase.
class Nom: a character string for naming TRUST objects.
virtual int debute_par(const char *const n) const
Nom & suffix(const char *const)
Suffix extraction: Nom x("azerty");.
An array of character strings (VECT(Nom)).
Base class for TRUST objects (Objet_U).
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.
class Probleme_base It is a Probleme_U that is not a coupling.
bool is_dilatable() const
const Champ_base & get_champ(const Motcle &nom) const override
static void exit(int exit_code=-1)
Exit routine for TRUST within a Kokkos region.
double temps_courant() const
Returns the current time.
Base class for output streams.
virtual void ref(const TRUSTTab &)
void promote_scalar_to_dim2()
_SIZE_ dimension(int d) const
Models type information for Objet_U objects.
int has_base(const Type_info *p, int direct=0) const
Tests whether a type belongs to the base types of the considered type. If direct == 0,...
static const Type_info * type_info_from_name(const char *type_name)
Static method that returns a pointer to the Type_info whose name is "type_name".