16#include <EF_discretisation.h>
17#include <Domaine_EF.h>
18#include <Champ_P1_EF.h>
19#include <Champ_Q1_EF.h>
20#include <Champ_Fonc_P0_EF.h>
21#include <Y_plus_Champ_Q1.h>
22#include <Rotationnel_Champ_P1_EF.h>
23#include <Rotationnel_Champ_Q1_EF.h>
24#include <Champ_Fonc_Tabule.h>
25#include <Champ_Fonc_Tabule_P0_EF.h>
26#include <Milieu_base.h>
27#include <Equation_base.h>
30#include <Segment_EF.h>
34#include <Champ_Uniforme.h>
35#include <Schema_Temps_base.h>
37#include <Domaine_Cl_EF.h>
38#include <Domaine_Cl_dis_base.h>
76 motcles[0] =
"vitesse";
77 motcles[1] =
"pression";
78 motcles[2] =
"temperature";
79 motcles[3] =
"divergence_vitesse";
80 motcles[4] =
"gradient_pression";
81 motcles[5] =
"champ_elem";
82 motcles[6] =
"champ_sommets";
85 Nom type_champ_vitesse;
87 type_champ_vitesse =
"Champ_P1_EF";
89 type_champ_vitesse =
"Champ_Q1_EF";
92 Cerr <<
"EF_discretisation::discretiser_champ :\n The geometric element ";
94 Cerr <<
" is not supported." << finl;
99 int default_nb_comp = 0;
100 int rang = motcles.
search(directive);
104 type = type_champ_vitesse;
108 type =
"Champ_P0_EF";
112 type = type_champ_vitesse;
116 type =
"Champ_P0_EF";
120 type = type_champ_vitesse;
124 type =
"Champ_P0_EF";
128 type =
"Champ_P1_EF";
137 Cerr <<
"EF_discretisation : " << motcles;
149 if (type ==
"Champ_P0_EF")
151 else if (type == type_champ_vitesse)
152 nb_ddl = domaine_EF.
nb_som();
153 else if (type ==
"Champ_P1_EF")
154 nb_ddl = domaine_EF.
nb_som();
165 nb_comp = default_nb_comp;
167 creer_champ(champ, z, type, noms[0], unites[0], nb_comp, nb_ddl, nb_pas_dt, temps, directive,
que_suis_je());
168 if (nature == multi_scalaire)
170 champ->fixer_nature_du_champ(nature);
171 champ->fixer_unites(unites);
172 champ->fixer_noms_compo(noms);
190 discretiser_champ_fonc_don(directive, z, nature, noms, unites, nb_comp, temps, champ);
207 discretiser_champ_fonc_don(directive, z, nature, noms, unites, nb_comp, temps, champ);
223void EF_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,
233 motcles[0] =
"pression";
234 motcles[1] =
"temperature";
235 motcles[2] =
"divergence_vitesse";
236 motcles[3] =
"champ_elem";
237 motcles[6] =
"champ_sommets";
238 motcles[4] =
"vitesse";
239 motcles[5] =
"gradient_pression";
242 Nom type_champ_vitesse;
246 type_champ_vitesse =
"Champ_Fonc_P1_EF";
248 type_champ_vitesse =
"Champ_Fonc_Q1_EF";
251 Cerr <<
"EF_discretisation::discretiser_champ :\n The geometric element ";
253 Cerr <<
" is not supported." << finl;
258 int default_nb_comp = 0;
259 int rang = motcles.search(directive);
263 type =
"Champ_Fonc_P0_EF";
267 type = type_champ_vitesse;
271 type =
"Champ_Fonc_P0_EF";
275 type =
"Champ_Fonc_P0_EF";
279 type = type_champ_vitesse;
283 type = type_champ_vitesse;
287 type = type_champ_vitesse;
296 Cerr <<
"EF_discretisation : " << motcles;
311 if (type ==
"Champ_Fonc_P0_EF")
313 else if (type == type_champ_vitesse)
314 nb_ddl = domaine_EF.
nb_som();
329 nb_comp = default_nb_comp;
337 if ((nature == multi_scalaire) && (champ_fonc))
339 champ_fonc->valeur().fixer_nature_du_champ(nature);
340 champ_fonc->valeur().fixer_unites(unites);
341 champ_fonc->valeur().fixer_noms_compo(noms);
343 else if ((nature == multi_scalaire) && (champ_don))
345 Cerr <<
"There is no field of type OWN_PTR(Champ_Don_base) with a multi_scalaire nature." << finl;
353 Cerr <<
"Discretisation de la distance paroi" << finl;
355 ch.typer(
"Champ_Fonc_P0_EF");
358 ch_dist_paroi.
nommer(
"distance_paroi");
367 Cerr <<
"Discretisation de la vorticite " << finl;
372 ch.typer(
"Rotationnel_Champ_P1_EF");
393 ch.typer(
"Rotationnel_Champ_Q1_EF");
414 Cerr <<
"Pb dans le typage des elements dans EF_discretisation::vorticite" << finl;
423 ch.typer(
"Rotationnel_Champ_P1_EF");
445 ch.typer(
"Rotationnel_Champ_Q1_EF");
467 Cerr <<
"Pb dans le typage des elements dans EF_discretisation::creer_champ_vorticite" << finl;
483 Cerr <<
"Discretisation EF du fluide_Ostwald" << finl;
490 Champ_Ostwald_EF& ch_mu = ref_cast(Champ_Ostwald_EF,mu);
491 Cerr<<
"associe domainedisbase EF"<<finl;
492 ch_mu.associer_domaine_dis_base(domaine_EF);
493 ch_mu.associer_fluide(le_fluide);
494 ch_mu.associer_champ(vit);
495 ch_mu.associer_eqn(eqn_hydr);
496 Cerr<<
"associations finies domaine dis base, fluide, champ EF"<<finl;
497 ch_mu.fixer_nb_comp(1);
499 Cerr<<
"fait fixer_nb_valeurs_nodales"<<finl;
500 Cerr<<
"nb_valeurs_nodales EF = "<<domaine_EF.
nb_elem()<<finl;
501 ch_mu.fixer_nb_valeurs_nodales(domaine_EF.
nb_elem());
503 Cerr<<
"fait changer_temps"<<finl;
504 ch_mu.changer_temps(vit->
temps());
505 Cerr<<
"mu EF est discretise "<<finl;
514 Cerr <<
"Discretisation du critere Q " << finl;
517 ch.typer(
"Critere_Q_Champ_P1_EF");
518 Critere_Q_Champ_P1_EF& ch_cQ=ref_cast(Critere_Q_Champ_P1_EF,ch.valeur());
519 ch_cQ.associer_domaine_dis_base(domaine_EF);
520 ch_cQ.associer_champ(vit);
521 ch_cQ.nommer(
"Critere_Q");
522 ch_cQ.fixer_nb_comp(1);
523 ch_cQ.fixer_nb_valeurs_nodales(domaine_EF.
nb_elem());
524 ch_cQ.fixer_unite(
"s-2");
525 ch_cQ.changer_temps(ch_vitesse.
temps());
531 Cerr <<
"Discretisation de y_plus" << finl;
535 ch.typer(
"Y_plus_Champ_Q1");
550 Cerr <<
"Discretisation de gradient_temperature" << finl;
554 ch.typer(
"gradient_temperature_Champ_P1_EF");
555 grad_T_Champ_P1_EF& ch_gt=ref_cast(grad_T_Champ_P1_EF,ch.valeur());
556 ch_gt.associer_domaine_dis_base(domaine_EF);
557 ch_gt.associer_domaine_Cl_dis_base(domaine_cl_EF);
558 ch_gt.associer_champ(temp);
559 ch_gt.nommer(
"gradient_temperature");
561 ch_gt.fixer_nb_valeurs_nodales(domaine_EF.
nb_elem());
562 ch_gt.fixer_unite(
"K/m");
563 ch_gt.changer_temps(ch_temperature->
temps());
570 Cerr <<
"Discretisation de h_conv" << finl;
574 ch.typer(
"h_conv_Champ_P1_EF");
575 h_conv_Champ_P1_EF& ch_gt=ref_cast(h_conv_Champ_P1_EF,ch.valeur());
576 ch_gt.associer_domaine_dis_base(domaine_EF);
577 ch_gt.associer_domaine_Cl_dis_base(domaine_cl_EF);
578 ch_gt.associer_champ(temp);
579 ch_gt.temp_ref()=temp_ref;
582 ch_gt.fixer_nb_comp(1);
583 ch_gt.fixer_nb_valeurs_nodales(domaine_EF.
nb_elem());
584 ch_gt.fixer_unite(
"W/m2.K");
585 ch_gt.changer_temps(ch_temperature->
temps());
605 if (class_operateur ==
"Source")
607 type = type_operateur;
611 else if (class_operateur ==
"Solveur_Masse")
613 else if (class_operateur ==
"Operateur_Grad")
615 else if (class_operateur ==
"Operateur_Div")
617 else if (class_operateur ==
"Operateur_Diff")
620 if (type_operateur !=
"")
623 type += type_operateur;
627 else if (class_operateur ==
"Operateur_Conv")
630 type += type_operateur;
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
const Domaine_dis_base & domaine_dis_base() const 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 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
class Domaine_Cl_dis_base Domaine_Cl_dis_base objects represent discretized boundary conditions
const Elem_EF_base & type_elem() const
class Domaine_dis_base This class is the base of the hierarchy of discretized domains.
void proprietes_physiques_fluide_Ostwald(const Domaine_dis_base &, Fluide_Ostwald &, const Navier_Stokes_std &, const Champ_Inc_base &) const override
Discretises the incompressible Ostwald fluid in EF, i.e. K, 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
Discretises a field for EF based on a discretisation directive.
void distance_paroi(const Schema_Temps_base &, Domaine_dis_base &, OWN_PTR(Champ_Fonc_base)&) const
void grad_T(const Domaine_dis_base &z, const Domaine_Cl_dis_base &, const Champ_Inc_base &temperature, OWN_PTR(Champ_Fonc_base) &ch) const override
void critere_Q(const Domaine_dis_base &z, const Domaine_Cl_dis_base &, const Champ_Inc_base &vitesse, OWN_PTR(Champ_Fonc_base) &ch) const override
void creer_champ_vorticite(const Schema_Temps_base &, const Champ_Inc_base &, OWN_PTR(Champ_Fonc_base)&) const override
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 vorticite(Domaine_dis_base &, const Champ_Inc_base &, OWN_PTR(Champ_Fonc_base)&) const
void h_conv(const Domaine_dis_base &z, const Domaine_Cl_dis_base &, const Champ_Inc_base &temperature, OWN_PTR(Champ_Fonc_base) &ch, Motcle &nom, int temp_ref) 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
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 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 int nb_comp() const
virtual const Nom & fixer_nom_compo(int, const Nom &)
Sets the name of the i-th component of the field.
const Champ_Don_base & viscosite_dynamique() const
A character string (Nom) in uppercase.
An array of Motcle objects.
int search(const Motcle &t) const
Navier_Stokes_std This class carries the terms of the momentum equation.
const Champ_Inc_base & inconnue() const override
Returns the velocity (unknown field of the equation) (const version).
class Nom: a character string for naming TRUST objects.
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.
void associer_champ(const Champ_P1_EF &)
void associer_champ(const Champ_Q1_EF &)
double temps_courant() const
Returns the current time.
Base class for output streams.
void associer_champ(const Champ_Q1_EF &)
void associer_domaine_Cl_dis_base(const Domaine_Cl_dis_base &le_dom_Cl_dis_base)