16#include <Coloc_discretisation.h>
17#include <Domaine_Coloc.h>
18#include <Equation_base.h>
19#include <Probleme_base.h>
33 motcles[0] =
"vitesse";
34 motcles[1] =
"pression";
35 motcles[2] =
"temperature";
36 motcles[3] =
"divergence_vitesse";
37 motcles[4] =
"gradient_pression";
38 motcles[5] =
"champ_elem";
40 Nom type_champ_vec(
"Champ_Vect_Elem_Coloc");
41 Nom type_champ_elem(
"Champ_Elem_Coloc");
43 int default_nb_comp = 0;
44 int rang = motcles.
search(directive);
50 type = type_champ_vec;
57 type = type_champ_elem;
66 Cerr <<
"Coloc_discretisation : " << motcles;
86 nb_comp = default_nb_comp;
88 creer_champ(champ, z, type, noms[0], unites[0], nb_comp, nb_ddl, nb_pas_dt, temps, directive,
que_suis_je());
90 if (nature == multi_scalaire)
92 champ->fixer_nature_du_champ(nature);
93 champ->fixer_unites(unites);
94 champ->fixer_noms_compo(noms);
101 discretiser_champ_fonc_don(directive, z, nature, noms, unites, nb_comp, temps, champ);
107 discretiser_champ_fonc_don(directive, z, nature, noms, unites, nb_comp, temps, champ);
113 Process::exit(
"\nError with the chosen discretization !!!! \nThe colocalised discretization currently works only for the Euler problem !! Please select another one ... \n");
117 if (type_ch.
debute_par(
"Champ_Elem")) type_ch =
"_Elem";
118 else if (type_ch.
debute_par(
"Champ_Vect")) type_ch =
"_Vect";
120 if (class_operateur ==
"Source")
121 type = type_operateur + type_ch +
"_" +
que_suis_je();
122 else if (class_operateur ==
"Solveur_Masse")
124 else if (class_operateur ==
"Operateur_Grad")
125 type =
Nom(
"Op_Grad_") + type_operateur +
"_" +
que_suis_je() + type_ch;
126 else if (class_operateur ==
"Operateur_Diff")
127 type =
Nom(
"Op_Diff") + (type_operateur !=
"" ?
"_" :
"") + type_operateur +
"_" +
que_suis_je() + type_ch;
128 else if (class_operateur ==
"Operateur_Conv")
129 type =
Nom(
"Op_Conv_") + type_operateur +
"_" +
que_suis_je() + type_ch;
130 else if (class_operateur ==
"Operateur_NConserv")
131 type =
Nom(
"Op_NConserv_") + type_operateur +
"_" +
que_suis_je() + type_ch;
138void Coloc_discretisation::discretiser_champ_fonc_don(
const Motcle& directive,
const Domaine_dis_base& z, Nature_du_champ nature,
const Noms& noms,
const Noms& unites,
int nb_comp,
139 double temps,
Objet_U& champ)
const
146 motcles[0] =
"pression";
147 motcles[1] =
"temperature";
148 motcles[2] =
"divergence_vitesse";
149 motcles[3] =
"champ_elem";
150 motcles[4] =
"vitesse";
151 motcles[5] =
"gradient_pression";
154 int default_nb_comp = 0,
155 rang = motcles.search(directive);
157 Nom type_champ_elem(
"Champ_Fonc_Elem_Coloc"),
158 type_champ_vect(
"Champ_Fonc_Vect_Coloc"),
167 type = type_champ_elem;
172 type = type_champ_vect;
181 Cerr <<
"Coloc_discretisation : " << motcles;
196 if ((type ==
"Champ_Fonc_Elem_Coloc") || (type ==
"Champ_Fonc_Vect_Coloc"))
203 nb_comp = default_nb_comp;
208 if ((nature == multi_scalaire) && (champ_fonc))
210 champ_fonc->valeur().fixer_nature_du_champ(nature);
211 champ_fonc->valeur().fixer_unites(unites);
212 champ_fonc->valeur().fixer_noms_compo(noms);
214 else if ((nature == multi_scalaire) && (champ_don))
216 Cerr <<
"There is no field of type OWN_PTR(Champ_Don_base) with a multi_scalaire nature." << finl;
class Champ_Don_base base class of Given Fields (not calculated)
class Champ_Fonc_base Base class of fields that are functions of a calculated quantity
class Champ_base This class is the base of the fields hierarchy.
void discretiser_champ(const Motcle &directive, const Domaine_dis_base &z, Nature_du_champ nature, const Noms &nom, const Noms &unite, int nb_comp, int nb_pas_dt, double temps, OWN_PTR(Champ_Inc_base)&champ, const Nom &sous_type=NOM_VIDE) const override
Discretization of a field depending on the directive and other parameters.
Nom get_name_of_type_for(const Nom &class_operateur, const Nom &type_operateur, const Equation_base &eqn, const OBS_PTR(Champ_base) &champ_sup) const override
class Discret_Thyd This class is the base class representing a discretization
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.
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.
static const Nom NOM_VIDE
static const Motcle DEMANDE_DESCRIPTION
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
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,...
class Equation_base The role of an equation is the calculation of one or more fields....
virtual const Champ_Inc_base & inconnue() const =0
Probleme_base & probleme()
Returns the problem associated with the equation.
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.
virtual int debute_par(const char *const n) const
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.
static void exit(int exit_code=-1)
Exit routine for TRUST within a Kokkos region.
Base class for output streams.