TrioCFD 1.9.9_beta
TrioCFD documentation
Loading...
Searching...
No Matches
Discretisation_base.cpp
1/****************************************************************************
2* Copyright (c) 2026, CEA
3* All rights reserved.
4*
5* Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
6* 1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
7* 2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
8* 3. Neither the name of the copyright holder nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission.
9*
10* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
11* IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
12* OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
13*
14*****************************************************************************/
15
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>
26
27Implemente_base(Discretisation_base, "Discretisation_base", Objet_U);
28
29const Motcle Discretisation_base::DEMANDE_DESCRIPTION = Motcle("demande_description");
31
32Sortie& Discretisation_base::printOn(Sortie& os) const { return os; }
33
34Entree& Discretisation_base::readOn(Entree& is) { return is; }
35
37{
38 le_domaine_ = dom;
39}
40
41// Construction of objects depending on the discretization:
42// Fields,
43// Pressure matrices,
44// ...
45
46// A directive is passed that must be recognized by the type
47// of discretization. Directives are keywords:
48// case is ignored and there should be no spaces.
49// Examples of directives:
50// "CHAMP_P0",
51// "CHAMP_FACES",
52// "VITESSE",
53// "PRESSION",
54// "TEMPERATURE",
55// Sometimes, the number of components depends on the discretization
56// (for example for velocity: 1 component in VDF, 3 in VEF)
57// If we set nb_comp = -1, the discretization chooses the number
58// appropriate, otherwise it uses the provided value.
59void Discretisation_base::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,
60 const Nom& sous_type) const
61{
62 Noms noms;
63 Noms unites;
64 noms.add(nom);
65 unites.add(unite);
66
67 discretiser_champ(directive, z, scalaire, noms, unites, nb_comp, nb_pas_dt, temps, champ, sous_type);
68}
69
70void Discretisation_base::discretiser_champ(const Motcle& directive, const Domaine_dis_base& z, const Nom& nom, const Nom& unite, int nb_comp, double temps, OWN_PTR(Champ_Fonc_base)& champ) const
71{
72 Noms noms;
73 Noms unites;
74 noms.add(nom);
75 unites.add(unite);
76
77 discretiser_champ(directive, z, scalaire, noms, unites, nb_comp, temps, champ);
78}
79
80void Discretisation_base::discretiser_champ(const Motcle& directive, const Domaine_dis_base& z, const Nom& nom, const Nom& unite, int nb_comp, double temps, OWN_PTR(Champ_Don_base)& champ) const
81{
82 Noms noms;
83 Noms unites;
84 noms.add(nom);
85 unites.add(unite);
86
87 discretiser_champ(directive, z, scalaire, noms, unites, nb_comp, temps, champ);
88}
89
90/*! @brief This function is a tool for the three following methods.
91 *
92 * ..
93 *
94 */
95void Discretisation_base::test_demande_description(const Motcle& directive, const Nom& type_objet) const
96{
98 {
99 Cerr << "Discr_base : none directive understood" << finl;
100 // We have gone through all descendants, they have written all the directives understood, we stop.
102 }
103 // If we get here, it is because no descendant of the method understood the directive, we cause the display of the directives understood:
104 Cerr << "\nError in Discr_base::discretiser_(..., ";
105 Cerr << type_objet << ")\n";
106 Cerr << " The discretization " << que_suis_je();
107 Cerr << " does not understood the following directive :\n " << directive;
108 Cerr << "\n The understood directives are :\n";
109}
110
111/*! @brief Discretization of a field depending on the directive and other parameters.
112 *
113 * See derived classes. This method
114 * does not handle any directive, it displays the list of directives understood
115 * by the derived classes.
116 * See for example VDF_discretisation.cpp and VEF...
117 *
118 */
119void Discretisation_base::discretiser_champ(const Motcle& directive, const Domaine_dis_base& z, Nature_du_champ nature, const Noms& noms, const Noms& unites, int nb_comp, int nb_pas_dt, double temps,
120 OWN_PTR(Champ_Inc_base)& champ, const Nom& sous_type) const
121
122{
123 test_demande_description(directive, champ.que_suis_je());
124 // Recursive call to produce the display of directives: XXX: Elie Saikali -> CODE DOES NOT COMPILE WITHOUT THROW
125 if (directive == DEMANDE_DESCRIPTION)
126 {
128 throw;
129 }
130 discretiser_champ(DEMANDE_DESCRIPTION, z, nature, noms, unites, nb_comp, nb_pas_dt, temps, champ, sous_type);
131}
132
133/*! @brief idem
134 *
135 */
136void Discretisation_base::discretiser_champ(const Motcle& directive, const Domaine_dis_base& z, Nature_du_champ nature, const Noms& noms, const Noms& unites, int nb_comp, double temps,
137 OWN_PTR(Champ_Fonc_base)& champ) const
138
139{
140 test_demande_description(directive, champ.que_suis_je());
141 // Recursive call to produce the display of directives: XXX: Elie Saikali -> CODE DOES NOT COMPILE WITHOUT THROW
142 if (directive == DEMANDE_DESCRIPTION)
143 {
145 throw;
146 }
147 discretiser_champ(DEMANDE_DESCRIPTION, z, nature, noms, unites, nb_comp, temps, champ);
148}
149
150/*! @brief idem
151 *
152 */
153void Discretisation_base::discretiser_champ(const Motcle& directive, const Domaine_dis_base& z, Nature_du_champ nature, const Noms& noms, const Noms& unites, int nb_comp, double temps,
154 OWN_PTR(Champ_Don_base)& champ) const
155
156{
157 test_demande_description(directive, champ.que_suis_je());
158 // Recursive call to produce the display of directives: XXX: Elie Saikali -> CODE DOES NOT COMPILE WITHOUT THROW
159 if (directive == DEMANDE_DESCRIPTION)
160 {
162 throw;
163 }
164 discretiser_champ(DEMANDE_DESCRIPTION, z, nature, noms, unites, nb_comp, temps, champ);
165}
166
168{
169 Process::exit("Discretisation_base::discretiser_variables() does nothing and must be overloaded !");
170}
171
172/*! @brief Tool function to set the common members for all types of fields (used in creer_champ)
173 *
174 */
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)
176{
177 ch.nommer(nom);
179 ch.fixer_nb_comp(nb_comp);
180 if ((nb_comp > 1) && (nb_comp == dimension))
181 {
182 Noms noms(nb_comp);
183 if (!axi)
184 {
185 noms[0] = nom + "X";
186 noms[1] = nom + "Y";
187 if (nb_comp > 2)
188 noms[2] = nom + "Z";
189 }
190 else
191 {
192 noms[0] = nom + "R";
193 noms[1] = nom + "teta";
194 if (nb_comp > 2)
195 noms[2] = nom + "Z";
196 }
197 ch.fixer_noms_compo(noms);
198 }
199 ch.fixer_unite(unite);
200 ch.fixer_nb_valeurs_nodales(nb_ddl);
201 ch.changer_temps(temps);
202}
203
204/*! @brief Static method that creates an OWN_PTR(Champ_Inc_base) of the specified type.
205 *
206 * The parameters "directive" and "nom_discretisation" are
207 * used for display only and are optional
208 *
209 */
210void Discretisation_base::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,
211 const Nom& directive, const Nom& nom_discretisation)
212{
213 //Nom nomd = nom_discretisation; // To work around the problem of "static" in type_info::nom()
214 ch.typer(type);
215 Champ_Inc_base& chb = ch.valeur();
216 chb.fixer_nb_valeurs_temporelles(nb_pas_dt);
217 champ_fixer_membres_communs(chb, z, type, nom, unite, nb_comp, nb_ddl, temps);
218}
219
220/*! @brief Static method that creates an OWN_PTR(Champ_Fonc_base) of the specified type.
221 *
222 * The parameters "directive" and "nom_discretisation" are
223 * used for display only and are optional
224 *
225 */
226void Discretisation_base::creer_champ(OWN_PTR(Champ_Fonc_base)& ch, const Domaine_dis_base& z, const Nom& type, const Nom& nom, const Nom& unite, int nb_comp, int nb_ddl, double temps, const Nom& directive,
227 const Nom& nom_discretisation)
228{
229 //Nom nomd = nom_discretisation; // To work around the problem of "static" in type_info::nom()
230 ch.typer(type);
231 Champ_Fonc_base& chb = ch.valeur();
232 champ_fixer_membres_communs(chb, z, type, nom, unite, nb_comp, nb_ddl, temps);
233}
234
235/*! @brief Static method that creates an OWN_PTR(Champ_Don_base) of the specified type.
236 *
237 * The parameters "directive" and "nom_discretisation" are
238 * used for display only and are optional
239 *
240 */
241void Discretisation_base::creer_champ(OWN_PTR(Champ_Don_base)& ch, const Domaine_dis_base& z, const Nom& type, const Nom& nom, const Nom& unite, int nb_comp, int nb_ddl, double temps, const Nom& directive,
242 const Nom& nom_discretisation)
243{
244 //Nom nomd = nom_discretisation; // To work around the problem of "static" in type_info::nom()
245 ch.typer(type);
246 Champ_Don_base& chb = ch.valeur();
247 champ_fixer_membres_communs(chb, z, type, nom, unite, nb_comp, nb_ddl, temps);
248}
249
251{
252 Nom type = "Domaine_", dis = que_suis_je();
253 if (dis == "VEFPreP1B") dis = "VEF";
254 type += dis;
255 const Domaine& dom = le_domaine_.valeur();
256 return Domaine_dis_cache::Build_or_get(type, dom, this);
257}
258
260{
261 Cerr << "Discretization of the field 'volume of meshes'" << finl;
262 const Domaine_VF& domaine_VF = ref_cast(Domaine_VF, z);
263 discretiser_champ("champ_elem", domaine_VF, "volume_maille", "m3", 1, sch.temps_courant(), ch);
264 Champ_Fonc_base& ch_fonc = ref_cast(Champ_Fonc_base, ch.valeur());
265 ch_fonc.valeurs().ref(domaine_VF.volumes());
266 ch_fonc.valeurs().promote_scalar_to_dim2(); // keep a (nb_elem,1) view even when referencing a DoubleVect
267}
268
270{
271 Cerr << "Discretization of the field mesh numbering" << finl;
272 const Domaine_VF& domaine_VF = ref_cast(Domaine_VF, z);
273 Noms noms(3);
274 Noms unit(3);
275 noms[0]="nodes"; // Component 0: node numbering
276 noms[1]="cells"; // Component 1: element numbering
277 noms[2]="faces"; // Component 2: face numbering
278 // ToDo: make VisIt recognize component names:
279 // Managing fields with components via TRUST + lata plugin is a pain...
280 // Looking forward to VTK to avoid this bridge between TRUST and VisIt/Paraview/Tecplot
281 discretiser_champ("champ_elem", domaine_VF, multi_scalaire, noms, unit, 3, sch.temps_courant(), ch);
282 ch->nommer("mesh_numbering");
283 DoubleTab& tab = ch->valeurs();
284 tab=0;
285 const IntTab& les_elems = z.domaine().les_elems();
286 const IntTab& elem_faces = domaine_VF.elem_faces();
287 int nb_elem = les_elems.dimension(0);
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++)
291 {
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;
295 tab(elem, 1) = 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;
299 }
300}
301
303{
304 Cerr << "Discret_Thyd::residu() does nothing ! " << que_suis_je() << " needs to overload it !" << finl;
306}
307
308void Discretisation_base::modifier_champ_tabule(const Domaine_dis_base& domaine_dis, Champ_Fonc_Tabule& ch_tab, const VECT(OBS_PTR(Champ_base)) &ch_inc) const
309{
310 Cerr << que_suis_je() << " must overload Discretisation_base::modifier_champ_tabule !" << finl;
312}
313
314void Discretisation_base::nommer_completer_champ_physique(const Domaine_dis_base& domaine_dis, const Nom& nom_champ, const Nom& unite, Champ_base& le_champ, const Probleme_base& pb) const
315{
316 // we name the field and the unit
317 le_champ.nommer(nom_champ);
318 le_champ.fixer_unite(unite);
319 if (sub_type(Champ_Fonc_Tabule, le_champ))
320 {
321 Noms& noms_variables = ref_cast(Champ_Fonc_Tabule, le_champ).noms_champs_parametre();
322 Noms& noms_pbs = ref_cast(Champ_Fonc_Tabule, le_champ).noms_problemes();
323 VECT(OBS_PTR(Champ_base)) les_ch_eq;
324 for (int i = 0; i < noms_variables.size(); i++)
325 {
326 OBS_PTR(Champ_base) champ;
327 const Probleme_base& pb_ch = noms_pbs.size() == 0 ? pb : ref_cast(Probleme_base, Interprete::objet(noms_pbs[i]));
328 champ = pb_ch.get_champ(Motcle(noms_variables[i]));
329 les_ch_eq.add(champ);
330 }
331 modifier_champ_tabule(domaine_dis, ref_cast(Champ_Fonc_Tabule, le_champ), les_ch_eq);
332 }
333}
334
335/*! @brief Fills the Nom type depending on the class of operator, the type of operator and the equation.
336 *
337 * @param (class_operateur) This name corresponds to the type of the base class of the object to be constructed. Examples: "source","Op_conv","Op_diff","Op_div","Op_grad","solveur_masse" Example: get_name_of_type_for("Op_conv","amont",eqn,type); get_name_of_type_for("Op_diff"," ",eqn,type,champ_diffusisivite);
338 */
339
340// this allows to specify the behavior for each discretization
341Nom Discretisation_base::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
342{
343 Nom type;
344 if (class_operateur == "Source")
345 {
346 type = type_operateur;
347 Nom disc = eqn.discretisation().que_suis_je();
348
349 int isQC = eqn.probleme().is_dilatable();
350
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")))
352 type += "_QC";
353
354 // except for the boussinesq term
355 if (disc == "VEFPreP1B")
356 {
357 if ((Motcle(type_operateur) == "boussinesq_temperature") || (Motcle(type_operateur) == "boussinesq_concentration") || (Motcle(type_operateur) == "boussinesq"))
358 disc = "VEFPreP1B";
359 else
360 disc = "VEF";
361 }
362
363 Nom type_ch = eqn.inconnue().que_suis_je();
364 if (type_ch == "Champ_Q1NC") type_ch = "Champ_P1NC";
365
366 type_ch.suffix("Champ_");
367 type += "_";
368 type += disc;
369 type += "_";
370 type += type_ch;
371 return type;
372 }
373 else if (class_operateur == "Solveur_Masse")
374 {
375 type = "Masse_";
376
377 Nom discr = eqn.discretisation().que_suis_je();
378 if (discr == "VEFPreP1B") discr = "VEF";
379
380 type += discr;
381
382 Nom type_ch = eqn.inconnue().que_suis_je();
383
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";
387
388 type_ch.suffix("Champ");
389 type += type_ch;
390 return type;
391 }
392 else if (class_operateur == "Operateur_Grad")
393 {
394 type = "Op_Grad_";
395 Nom type_pb = eqn.probleme().que_suis_je();
396
397 if (type_pb == "Probleme_SG")
398 {
399 type += (type_pb.suffix("Probleme_"));
400 type += "_";
401 }
402
403 Nom discr = eqn.discretisation().que_suis_je();
404
405 type += discr;
406 type += "_";
407 Nom type_inco = eqn.inconnue().que_suis_je();
408
409 if (type_inco == "Champ_Q1NC") type_inco = "Champ_P1NC";
410
411 type += (type_inco.suffix("Champ_"));
412
413 //Test to apply a gradient to a Champ_P1NC with one component in VEF: Typing to review (revision of operators)
414 if ((eqn.inconnue().le_nom() != "vitesse") && (eqn.inconnue().que_suis_je() == "Champ_P1NC")) type = "Op_Grad_P1NC_to_P0";
415
416 //Test to apply a gradient to a Champ_P0 with one component in VDF: Typing to review (revision of operators)
417 if ((eqn.inconnue().le_nom() != "vitesse") && (eqn.inconnue().que_suis_je() == "Champ_P0_VDF")) type = "Op_Grad_P0_to_Face";
418
419 return type;
420 }
421 else if (class_operateur == "Operateur_Div")
422 {
423 type = "Op_Div_";
424
425 Nom discr = eqn.discretisation().que_suis_je();
426 Nom type_inco = eqn.inconnue().que_suis_je();
427 type += discr;
428
429 type += "_";
430 if (type_inco == "Champ_Q1NC") type_inco = "Champ_P1NC";
431
432 type += (type_inco.suffix("Champ_"));
433 return type;
434 }
435 else if (class_operateur == "Operateur_Diff")
436 {
437 Nom typ(type_operateur);
438 if (typ == "standard") typ = "";
439
440 Cerr << "We treat the diffusive operator of : " << eqn.que_suis_je() << finl;
441 type = "Op_Diff_";
442
443 Nom nom_discr = que_suis_je();
444 Cerr << "The discretization used is : " << nom_discr << finl;
445 assert(champ_sup);
446
447 const Champ_base& diffusivite = champ_sup.valeur();
448
449 if (nom_discr == "VEFPreP1B") nom_discr = "VEF";
450 type += nom_discr;
451 type += typ;
452
453 // MODIF ELI LAUCOIN (10/12/2007) :
454 // I keep the normal behavior for VEF and VDF
455 if ((nom_discr == "VDF") || (nom_discr == "VEF"))
456 {
457 Nom nb_inc;
458 // Modif Elie Saikali (Nov 2020)
459 if (eqn.probleme().que_suis_je().debute_par("Pb_Multiphase") || (diffusivite.nb_comp() == 1 && nom_discr == "VDF")) nb_inc = "_";
460 else if (diffusivite.nb_comp() > 1 && diffusivite.le_nom() == "conductivite") nb_inc = "ANISOTROPE_";
461 else if (nom_discr == "VDF" && eqn.diffusion_multi_scalaire())
462 nb_inc = "_Multi_inco_Multi_scalar_";
463 else
464 {
465 if (nom_discr == "VEF") nb_inc = "_";
466 else nb_inc = "_Multi_inco_";
467 }
468
469 type += nb_inc;
470 }
471 else // however, we modify the general case to avoid adding special cases
472 type += "_";
473
474 Nom type_inco = eqn.inconnue().que_suis_je();
475
476 type += (type_inco.suffix("Champ_"));
477 if (axi == 1) type += "_Axi";
478
479 return type;
480 }
481 else if (class_operateur == "Operateur_Conv")
482 {
483 type = "Op_Conv_";
484 type += type_operateur;
485 Nom tiret = "_";
486 type += tiret;
487 Nom discr = que_suis_je();
488
489 // the diffusion operators are common to the VEF and VEFP1B discretizations
490 if (discr == "VEFPreP1B") discr = "VEF";
491
492 type += discr;
493 if (Motcle(type_operateur) == Motcle("ALE")) return type;
494 if (type_operateur != "KEps_Comp")
495 {
496 type += tiret;
497 Nom type_inco = eqn.inconnue().que_suis_je();
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";
501
502 type += (type_inco.suffix("Champ_"));
503
504 if (axi == 1)
505 if (type_operateur == "quick") type += "_Axi";
506 }
507 return type;
508 }
509 else if (class_operateur == "Operateur_Evanescence")
510 {
511 Nom type_inco = eqn.inconnue().que_suis_je();
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";
515
516 type_inco.suffix("Champ");
517 type = Nom("Op_Evanescence") + (type_operateur != "" ? "_" : "") + type_operateur + "_" + que_suis_je() + type_inco;
518 }
519 else
520 {
521 Cerr << class_operateur << " not understood in get_name_of_type_for of " << que_suis_je() << finl;
523 }
524 return type;
525}
526
527int Discretisation_base::verifie_sous_type(Nom& type, const Nom& sous_type, const Motcle& directive) const
528{
529 const Type_info *base_info = Type_info::type_info_from_name(sous_type);
530
531 if (base_info)
532 {
533 if (base_info->has_base(type))
534 {
535 type = sous_type;
536 return 0;
537 }
538
539 // Elie Saikali: I'll do better the day we write real C++ not like this... MUST TEST IF THE CAST WORKS AND NOT THE NAME !!!!!!!!!!!!!!!!!!
540 if (sous_type.debute_par("Champ_Face_dep_expr") && type == "Champ_Face_VDF")
541 {
542 type = sous_type;
543 return 0;
544 }
545
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;
550 }
551 else
552 {
553 Cerr << "Error in " << que_suis_je() << "::discretiser_champ" << finl;
554 Cerr << "Unknown class type " << sous_type << finl;
556 }
557 return -1;
558}
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
Class Champ_Inc_base.
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.
Definition Champ_base.h:43
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
IntTab_t & les_elems()
Definition Domaine.h:129
class Domaine_VF
Definition Domaine_VF.h:44
double volumes(int i) const
Definition Domaine_VF.h:113
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.
Definition Domaine_VF.h:542
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,...
Definition Entree.h:42
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
Definition Field_base.h:56
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.
Definition Motcle.h:26
class Nom: a character string for naming TRUST objects.
Definition Nom.h:31
virtual int debute_par(const char *const n) const
Definition Nom.cpp:314
Nom & suffix(const char *const)
Suffix extraction: Nom x("azerty");.
Definition Nom.cpp:266
An array of character strings (VECT(Nom)).
Definition Noms.h:26
Base class for TRUST objects (Objet_U).
Definition Objet_U.h:68
static int dimension
Definition Objet_U.h:94
const Nom & que_suis_je() const
Returns the string identifying the class.
Definition Objet_U.cpp:104
virtual Entree & readOn(Entree &)
Reads an Objet_U from an input stream. Virtual method to override.
Definition Objet_U.cpp:289
static int axi
Definition Objet_U.h:96
virtual Sortie & printOn(Sortie &) const
Writes the object to an output stream. Virtual method to override.
Definition Objet_U.cpp:278
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.
Definition Process.cpp:466
class Schema_Temps_base
double temps_courant() const
Returns the current time.
Base class for output streams.
Definition Sortie.h:52
virtual void ref(const TRUSTTab &)
Definition TRUSTTab.tpp:308
void promote_scalar_to_dim2()
Definition TRUSTTab.tpp:441
_SIZE_ dimension(int d) const
Definition TRUSTTab.tpp:133
Models type information for Objet_U objects.
Definition Type_info.h:30
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".