16#include <Champ_Fonc_Tabule_Elem_PolyMAC_CDO.h>
17#include <PolyMAC_HFV_discretisation.h>
18#include <Op_Diff_PolyMAC_HFV_base.h>
19#include <Champ_Fonc_Elem_PolyMAC_CDO.h>
20#include <Domaine_PolyMAC_HFV.h>
21#include <Domaine_Cl_PolyMAC_family.h>
22#include <Schema_Temps_base.h>
23#include <Champ_Fonc_Tabule.h>
24#include <Champ_Uniforme.h>
25#include <Equation_base.h>
26#include <DescStructure.h>
27#include <Milieu_base.h>
57 motcles[0] =
"vitesse";
58 motcles[1] =
"pression";
59 motcles[2] =
"temperature";
60 motcles[3] =
"divergence_vitesse";
61 motcles[4] =
"gradient_pression";
62 motcles[5] =
"champ_elem";
63 motcles[6] =
"champ_sommets";
66 int zp1 =
false, default_nb_comp = 0, rang = motcles.
search(directive);
67 Nom type_elem =
Nom(
"Champ_Elem_") +
que_suis_je(), type_som =
"Champ_Som_PolyMAC_HFV", type_champ_scal = zp1 ? type_som : type_elem, type_champ_vitesse =
68 zp1 ?
"Champ_Arete_PolyMAC_HFV" :
Nom(
"Champ_Face_") +
que_suis_je(), type;
73 type = type_champ_vitesse;
79 type = type_champ_scal;
96 Cerr <<
"PolyMAC_HFV_discretisation : " << motcles;
111 if (type.debute_par(type_elem))
113 else if (type.debute_par(type_som))
114 nb_ddl = domaine_PolyMAC_HFV.
nb_som();
115 else if (type.debute_par(type_champ_vitesse))
121 nb_comp = default_nb_comp;
123 creer_champ(champ, z, type, noms[0], unites[0], nb_comp, nb_ddl, nb_pas_dt, temps, directive,
que_suis_je());
124 if (nature == multi_scalaire)
126 champ->fixer_nature_du_champ(nature);
127 champ->fixer_unites(unites);
128 champ->fixer_noms_compo(noms);
139void PolyMAC_HFV_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,
140 double temps,
Objet_U& champ)
const
149 motcles[0] =
"pression";
150 motcles[1] =
"temperature";
151 motcles[2] =
"divergence_vitesse";
152 motcles[3] =
"champ_elem";
153 motcles[4] =
"vitesse";
154 motcles[5] =
"gradient_pression";
155 motcles[6] =
"champ_sommets";
156 motcles[7] =
"champ_face";
159 int zp1 =
false, default_nb_comp = 0, rang = motcles.search(directive);
160 Nom type_elem(
"Champ_Fonc_Elem_PolyMAC_CDO"), type_som(
"Champ_Fonc_Som_PolyMAC_CDO"), type_scal = zp1 ? type_som : type_elem, type_champ_vitesse(
161 zp1 ?
"Champ_Fonc_Arete_PolyMAC_HFV" :
"Champ_Fonc_Face_PolyMAC_CDO"), type;
172 type = type_champ_vitesse;
184 type =
"Champ_Fonc_Face_PolyMAC_CDO";
193 Cerr <<
"PolyMAC_HFV_discretisation : " << motcles;
208 if (type ==
"Champ_Fonc_Elem_PolyMAC_CDO")
210 else if (type ==
"Champ_Fonc_Face_PolyMAC_CDO")
211 nb_ddl = domaine_PolyMAC_HFV.
nb_faces();
212 else if (type ==
"Champ_Fonc_Som_PolyMAC_CDO")
213 nb_ddl = domaine_PolyMAC_HFV.
nb_som();
214 else if (type ==
"Champ_Fonc_Arete_PolyMAC_HFV")
221 nb_comp = default_nb_comp;
226 if ((nature == multi_scalaire) && (champ_fonc))
228 champ_fonc->valeur().fixer_nature_du_champ(nature);
229 champ_fonc->valeur().fixer_unites(unites);
230 champ_fonc->valeur().fixer_noms_compo(noms);
232 else if ((nature == multi_scalaire) && (champ_don))
234 Cerr <<
"There is no field of type OWN_PTR(Champ_Don_base) with a multi_scalaire nature." << finl;
241 Cerr <<
"Discretization of y plus" << finl;
242 Noms noms(1), unites(1);
243 noms[0] =
Nom(
"y_plus");
244 unites[0] =
Nom(
"adimensionnel");
246 DoubleTab& tab_y_p = ch->
valeurs();
270 if (class_operateur ==
"Source")
271 type = type_operateur + type_ch +
"_" +
que_suis_je();
272 else if (class_operateur ==
"Solveur_Masse")
274 else if (class_operateur ==
"Operateur_Grad")
276 else if (class_operateur ==
"Operateur_Div")
278 else if (class_operateur ==
"Operateur_Diff")
279 type =
Nom(
"Op_Diff") + (type_operateur !=
"" ?
"_" :
"") + type_operateur +
"_" +
que_suis_je() + type_ch;
280 else if (class_operateur ==
"Operateur_Conv")
281 type =
Nom(
"Op_Conv_") + type_operateur +
"_" +
que_suis_je() + type_ch;
282 else if (class_operateur ==
"Operateur_Evanescence")
283 type =
Nom(
"Op_Evanescence") + (type_operateur !=
"" ?
"_" :
"") + type_operateur +
"_" +
que_suis_je() + type_ch;
293 ch_name +=
"_residu";
294 Cerr <<
"Discretization of " << ch_name << finl;
299 Motcle loc =
"champ_face";
300 Noms nom(1), unites(1);
302 unites[0] =
"units_not_defined";
308 Motcle loc =
"champ_elem";
309 Noms nom(1), unites(1);
311 unites[0] =
"units_not_defined";
317 DoubleTab& tab = ch_fonc.
valeurs();
319 Cerr <<
"[Information] Discretisation_base::residu : the residue is set to -10000.0 at initial time" << 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_base Base class of fields that are functions of a calculated quantity
DoubleTab & valeurs() override
Returns the array of field values at the current time.
class Champ_base This class is the base of the fields hierarchy.
double temps() const
Returns the time of the field.
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
int_t nb_aretes() const
Returns the number of real edges.
class Domaine_Cl_dis_base Domaine_Cl_dis_base objects represent discretized boundary conditions
int nb_faces() const
Returns the total number of faces.
class Domaine_dis_base This class is the base of the hierarchy of discretized domains.
const Domaine & domaine() const
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
const Nom & le_nom() const override
Returns the name of the field.
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.
void residu(const Domaine_dis_base &z, const Champ_Inc_base &ch_inco, OWN_PTR(Champ_Fonc_base)&champ) const override
void grad_u(const Domaine_dis_base &z, const Domaine_Cl_dis_base &zcl, const Champ_Inc_base &ch_vitesse, OWN_PTR(Champ_Fonc_base)&ch) const override
Discretizes the incompressible fluid in PolyMAC_CDO, i.e., K and N.
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
Discretizes a field for PolyMAC_HFV based on a discretization directive.
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
void y_plus(const Domaine_dis_base &z, const Domaine_Cl_dis_base &, const Champ_Inc_base &vitesse, OWN_PTR(Champ_Fonc_base)&ch) const override
static void abort()
Abort routine for TRUST on a fatal error.
static void exit(int exit_code=-1)
Exit routine for TRUST within a Kokkos region.
Base class for output streams.
_SIZE_ dimension_tot(int) const override