16#include <PolyMAC_CDO_discretisation.h>
17#include <Domaine_PolyMAC_CDO.h>
18#include <Champ_Fonc_Tabule.h>
19#include <Champ_Fonc_Elem_PolyMAC_CDO.h>
20#include <Champ_Fonc_Tabule_Elem_PolyMAC_CDO.h>
21#include <Milieu_base.h>
22#include <Equation_base.h>
23#include <Champ_Uniforme.h>
24#include <DescStructure.h>
25#include <Schema_Temps_base.h>
27#include <Domaine_Cl_PolyMAC_family.h>
28#include <grad_U_Champ_Face_PolyMAC_CDO.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 Nom type_champ_vitesse(
"Champ_Face_PolyMAC_CDO");
67 Nom type_elem(
"Champ_Elem_PolyMAC_CDO");
69 int default_nb_comp = 0;
70 int rang = motcles.
search(directive);
75 type = type_champ_vitesse;
91 Cerr <<
"PolyMAC_CDO_discretisation : " << motcles;
110 else if (type.
debute_par(
"Champ_Som_PolyMAC_CDO"))
111 nb_ddl = domaine_PolyMAC_CDO.
nb_som();
116 nb_comp = default_nb_comp;
118 creer_champ(champ, z, type, noms[0], unites[0], nb_comp, nb_ddl, nb_pas_dt, temps, directive,
que_suis_je());
119 if (nature == multi_scalaire)
121 champ->fixer_nature_du_champ(nature);
122 champ->fixer_unites(unites);
123 champ->fixer_noms_compo(noms);
135 discretiser_champ_fonc_don(directive, z, nature, noms, unites, nb_comp, temps, champ);
146 discretiser_champ_fonc_don(directive, z, nature, noms, unites, nb_comp, temps, champ);
156void PolyMAC_CDO_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,
double temps,
166 motcles[0] =
"pression";
167 motcles[1] =
"temperature";
168 motcles[2] =
"divergence_vitesse";
169 motcles[3] =
"champ_elem";
170 motcles[6] =
"champ_sommets";
171 motcles[4] =
"vitesse";
172 motcles[7] =
"champ_face";
173 motcles[5] =
"gradient_pression";
176 Nom type_champ_vitesse(
"Champ_Fonc_Face_PolyMAC_CDO");
177 Nom type_elem(
"Champ_Fonc_Elem_PolyMAC_CDO");
180 int default_nb_comp = 0;
181 int rang = motcles.search(directive);
194 type = type_champ_vitesse;
198 type =
"Champ_Fonc_Som_PolyMAC_CDO";
207 Cerr <<
"PolyMAC_CDO_discretisation : " << motcles;
222 if (type ==
"Champ_Fonc_Elem_PolyMAC_CDO")
224 else if (type == type_champ_vitesse)
225 nb_ddl = domaine_PolyMAC_CDO.
nb_faces();
226 else if (type ==
"Champ_Fonc_Som_PolyMAC_CDO")
227 nb_ddl = domaine_PolyMAC_CDO.
nb_som();
233 nb_comp = default_nb_comp;
238 if ((nature == multi_scalaire) && (champ_fonc))
240 champ_fonc->valeur().fixer_nature_du_champ(nature);
241 champ_fonc->valeur().fixer_unites(unites);
242 champ_fonc->valeur().fixer_noms_compo(noms);
244 else if ((nature == multi_scalaire) && (champ_don))
246 Cerr <<
"There is no field of type OWN_PTR(Champ_Don_base) with a multi_scalaire nature." << finl;
253 Cerr <<
"Discretization of the wall distance" << finl;
255 ch.typer(
"Champ_Fonc_Elem_PolyMAC_CDO");
258 ch_dist_paroi.
nommer(
"distance_paroi");
281 ch.typer(
"grad_U_Champ_Face_PolyMAC_CDO");
286 ch_grad_u.
nommer(
"gradient_vitesse");
331 if (class_operateur ==
"Source")
333 type = type_operateur;
341 else if (class_operateur ==
"Solveur_Masse")
350 type =
"Masse_PolyMAC_CDO";
353 else if (class_operateur ==
"Operateur_Grad")
355 type =
"Op_Grad_PolyMAC_CDO_Face";
357 else if (class_operateur ==
"Operateur_Div")
359 type =
"Op_Div_PolyMAC_CDO";
362 else if (class_operateur ==
"Operateur_Diff")
372 if (type_operateur !=
"")
375 type += type_operateur;
377 type +=
"_PolyMAC_CDO";
380 else if (class_operateur ==
"Operateur_Conv")
383 type += type_operateur;
402 Cerr <<
"Discretization of global wall distance" << finl;
403 Noms noms(1), unites(1);
404 noms[0] =
Nom(
"distance_paroi_globale");
405 unites[0] =
Nom(
"m");
class Champ_Don_base base class of Given Fields (not calculated)
int fixer_nb_valeurs_nodales(int n) override
Sets the number of degrees of freedom per component.
void associer_param(const VECT(OBS_PTR(Champ_base))&, const Table &)
Class Champ_Fonc_Tabule Derived class of Champ_Fonc_base representing.
const Table & table() const
void typer_champ_tabule_discretise(const Nom &typ)
const Champ_Fonc_base & le_champ_tabule_discretise() const
Returns the computed tabulated field.
class Champ_Fonc_base Base class of fields that are functions of a calculated quantity
void associer_domaine_dis_base(const Domaine_dis_base &) override
class Champ_base This class is the base of the fields hierarchy.
virtual double changer_temps(const double t)
Sets the time at which the field is defined.
double temps() const
Returns the time of the field.
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
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
virtual void fixer_nb_comp(int i)
Sets the number of components 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 Nature_du_champ fixer_nature_du_champ(Nature_du_champ nat)
Sets the nature of a field: scalar, multiscalar, vectorial.
virtual int nb_comp() const
virtual const Nom & fixer_nom_compo(int, const Nom &)
Sets the name of the i-th component 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
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.
void distance_paroi_globale(const Schema_Temps_base &, Domaine_dis_base &, OWN_PTR(Champ_Fonc_base)&) const override
void distance_paroi(const Schema_Temps_base &, Domaine_dis_base &, OWN_PTR(Champ_Fonc_base)&) const
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.
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 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_CDO based on a discretization directive.
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.
void associer_champ(const Champ_Face_PolyMAC_CDO &)
void associer_domaine_Cl_dis_base(const Domaine_Cl_dis_base &)