TrioCFD 1.9.9_beta
TrioCFD documentation
Loading...
Searching...
No Matches
Operateur_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 <Operateur_base.h>
17#include <Probleme_base.h>
18#include <Schema_Temps_base.h>
19#include <EcrFicPartage.h>
20#include <Periodique.h>
21#include <sys/stat.h>
22
23#include <Front_VF.h>
24#include <Domaine_VF.h>
25#include <Matrice_Morse.h>
26#include <TRUSTTrav.h>
27#include <Discretisation_base.h>
28#include <Domaine_Cl_dis_base.h>
29
30Implemente_base_sans_constructeur(Operateur_base,"Operateur_base",Objet_U);
31
32Operateur_base::Operateur_base()
33{
36 col_width_ = -1;
37}
38
39/*! @brief DOES NOTHING - to override in derived classes.
40 *
41 * Prints the operator to an output stream.
42 *
43 * @param (Sortie& os) an output stream
44 * @return (Sortie&) the modified output stream
45 */
47{
48 return os ;
49}
50
51
52/*! @brief DOES NOTHING - to override in derived classes.
53 *
54 * Reads an operator from an input stream.
55 *
56 * @param (Entree& is) an input stream
57 * @return (Entree&) the modified input stream
58 */
60{
61 return is ;
62}
63
64
65/*! @brief DOES NOTHING - to override in derived classes.
66 *
67 * Update of the operator
68 *
69 * @param (double) a time step
70 */
72{
73}
74
75
79
81{
82 // hmmm ... hopefully nothing to do here??
83}
84
85/*! @brief Associates the operator with the domaine_dis, the domaine_Cl_dis, and the unknown of its equation.
86 *
87 * @throws no associated equation
88 */
90{
91 assert(mon_equation);
92 const Equation_base& eqn = equation();
93 const Domaine_dis_base& zdis= eqn.domaine_dis();
94
95 const Domaine_Cl_dis_base& zcl = le_champ_inco ? le_champ_inco->domaine_Cl_dis() : eqn.domaine_Cl_dis();
96 const Champ_Inc_base& inco = le_champ_inco ? le_champ_inco.valeur() : eqn.inconnue();
97 associer(zdis, zcl, inco);
98 const Conds_lim& les_cl = zcl.les_conditions_limites();
99 for (auto& itr : les_cl)
100 {
101 const Frontiere_dis_base& la_fr = itr->frontiere_dis();
102 col_width_ = std::max(col_width_, la_fr.le_nom().longueur());
103 }
104 int w_suffix = 3; // for adding _Mx (moment)
105
106 // for fields with multiple components, the column header of .out files takes the form
107 // Time cl1_compo1 cl1_compo2 ...
108 // we take into account the length of compo1, compo2, etc...
109 Noms noms_compo_courts(inco.noms_compo());
110 if (noms_compo_courts.size() > 1)
111 for (int i = 0; i < noms_compo_courts.size(); ++i)
112 {
113 noms_compo_courts[i] = Motcle(noms_compo_courts[i]).getSuffix(eqn.inconnue().le_nom());
114 w_suffix = std::max(w_suffix, noms_compo_courts[i].longueur());
115 }
116 col_width_ += w_suffix + 1;
117}
118
119void Operateur_base::associer_champ(const Champ_Inc_base& ch, const std::string& nom_ch)
120{
121 le_champ_inco = ch;
122 nom_inco_ = nom_ch;
123}
124
125/*! @brief Computes dt_stab
126 *
127 * @return (double) always returns 1.e30
128 */
130{
131 return 1.e30;
132}
133
134void Operateur_base::calculer_dt_local(DoubleTab& dt) const
135{
136 Cerr << "You must overload the method " << que_suis_je()
137 << "::calculer_dt_local(DoubleVect&)" << finl;
138 exit();
139}
140/*! @brief DOES NOTHING - to override in derived classes.
141 *
142 * Prints the operator to an output stream.
143 *
144 * @param (Sortie& os)
145 * @return (int) always returns 1
146 */
148{
149 return 1;
150}
151
152
153/*! @brief DOES NOTHING - to override in derived classes.
154 *
155 * @param (Matrice_Morse&) a matrix in Morse format
156 * @throws method to override
157 */
159{
160 /* try dimensionner_blocs() */
162 dimensionner_blocs( { { equation().inconnue().le_nom().getString(), &mat } });
163 else
164 Process::exit(que_suis_je() + " : dimensionner() not coded!");
165}
166
168{
169 /* try dimensionner_blocs() */
171 dimensionner_blocs( { { "vitesse", &mat } });
172}
173
174void Operateur_base::dimensionner_termes_croises(Matrice_Morse& mat, const Probleme_base& autre_pb, int nl, int nc) const
175{
176 if (!has_interface_blocs()) return;
177 std::string nom_inco = equation().inconnue().le_nom().getString(),
178 nom = equation().probleme().le_nom() == autre_pb.le_nom() ? nom_inco :
179 nom_inco + "/" + autre_pb.le_nom().getString(); //cross-block name for the interface_blocs
180 dimensionner_blocs({{ nom, &mat }}, {});
181}
182
183void Operateur_base::ajouter_termes_croises(const DoubleTab& inco, const Probleme_base& autre_pb, const DoubleTab& autre_inco, DoubleTab& resu) const
184{
185 //if we have Interface_blocs, then ajouter_blocs() is sufficient
186 return;
187}
188
189void Operateur_base::contribuer_termes_croises(const DoubleTab& inco, const Probleme_base& autre_pb, const DoubleTab& autre_inco, Matrice_Morse& matrice) const
190{
191 if (!has_interface_blocs())
192 return;
193 DoubleTrav secmem(inco); //will be discarded
194 secmem = inco;
195 std::string nom_inco = equation().inconnue().le_nom().getString(),
196 nom = equation().probleme().le_nom() == autre_pb.le_nom() ? nom_inco :
197 nom_inco + "/" + autre_pb.le_nom().getString(); //cross-block name for the interface_blocs
198 ajouter_blocs( { { nom, &matrice } }, secmem, { });
199}
200
201void Operateur_base::dimensionner_blocs(matrices_t mats, const tabs_t& semi_impl) const
202{
203 Process::exit(que_suis_je() + " : dimensionner_blocs() not coded!");
204}
205
206void Operateur_base::ajouter_blocs(matrices_t mats, DoubleTab& secmem, const tabs_t& semi_impl) const
207{
208 Process::exit(que_suis_je() + " : ajouter_blocs() not coded!");
209}
210
211/*! @brief DOES NOTHING - to override in derived classes.
212 *
213 * @param (Matrice_Morse&) a matrix in Morse format
214 * @param (DoubleTab&) a double-valued array
215 * @throws method to override
216 */
218{
219 Cerr << "***********************************************************************************" << finl;
220 Cerr << "Sorry, implicit scheme is not available yet for the " << que_suis_je() << " scheme." << finl;
221 Cerr << "Please, change this scheme or use another time scheme than " << equation().probleme().schema_temps().que_suis_je() << finl;
222 Cerr << "***********************************************************************************" << finl;
223 // Cerr << "You must overload the method " << que_suis_je()
224 // << "::modifier_pour_Cl(Matrice_Morse&, DoubleTab& )" << finl;
225 exit();
226}
227
228DoubleTab& Operateur_base::ajouter(const DoubleTab& inco, DoubleTab& secmem) const
229{
230 /* try ajouter_blocs */
232 {
233 if (equation().discretisation().is_poly_family())
234 ajouter_blocs({}, secmem);
235 else
236 ajouter_blocs({}, secmem, {{ equation().inconnue().le_nom().getString(),inco }} ); //to account for the inco parameter (which is not necessarily the equation's unknown)
237 }
238 else Process::exit(que_suis_je() + " : ajouter() not coded!");
239 return secmem;
240}
241
242DoubleTab& Operateur_base::calculer(const DoubleTab& inco, DoubleTab& secmem) const
243{
244 secmem = 0;
245 return ajouter(inco, secmem);
246}
247
248/*! @brief DOES NOTHING - to override in derived classes.
249 *
250 * @param (DoubleTab&) a double-valued array
251 * @param (Matrice_Morse&) a matrix in Morse format
252 * @throws method to override
253 */
254void Operateur_base::contribuer_a_avec(const DoubleTab& inco, Matrice_Morse& matrice) const
255{
256 DoubleTrav secmem(inco); //will be discarded
257 secmem = inco;
259 ajouter_blocs( { { equation().inconnue().le_nom().getString(), &matrice } }, secmem);
260 else
261 Process::exit(que_suis_je() + " : contribuer_a_avec() not coded!");
262}
263
264void Operateur_base::contribuer_bloc_vitesse(const DoubleTab& inco, Matrice_Morse& matrice) const
265{
267 {
268 DoubleTrav secmem(inco); //will be discarded
269 secmem = inco;
270 ajouter_blocs({{ "vitesse", &matrice }}, secmem);
271 }
272}
273
274/*! @brief DOES NOTHING - to override in derived classes.
275 *
276 * @param (DoubleTab&) a double-valued array
277 * @throws method to override
278 */
280{
281 Cerr << "You must overload the method " << que_suis_je()
282 << "::contribuer_au_second_membre(DoubleTab&)" << finl;
283 exit();
284}
285
287{
288 return 1;
289}
291{
292 Cerr<<"Operateur_base::associer_domaine_cl_dis must be overloaded "<<finl;
293 exit();
294}
295
297{
298 if (nom == "")
299 {
300 Cerr << "You provided an empty string to name the .out file of operator " << que_suis_je() << " in equation " << equation().que_suis_je() << "." << finl;
301 Cerr << "If you don't want to write a .out file for this operator, don't call set_fichier()" << finl;
303 }
305 out_+="_";
306 out_+=equation().probleme().le_nom()+"_"+nom;
307}
308
309/*! @brief Opening/creation of a file for printing an operator. To override in derived classes.
310 *
311 * @throws method to override
312 */
313void Operateur_base::ouvrir_fichier(SFichier& os,const Nom& type, const int flag) const
314{
315
316 // null flag means we don't open the file
317 if (flag==0 || os.is_open())
318 return ;
319
320 if (!je_suis_maitre())
321 {
322 Cerr<<"Only master process can open "<<type<<" file. See Operateur_base::ouvrir_fichier()" << finl;
324 }
325 const Equation_base& eqn = equation();
326 const Probleme_base& pb=eqn.probleme();
327 const Schema_Temps_base& sch=pb.schema_temps();
328 const int precision = sch.precision_impr(), wcol = std::max(col_width_, sch.wcol()), gnuplot_header = sch.gnuplot_header();
329 os.set_col_width(wcol);
330 Nom nomfichier(out_);
331 if (type!="") nomfichier+=(Nom)"_"+type;
332 nomfichier+=".out";
333 struct stat f;
334 // Create the file on the first printing with the header, or if the file does not exist
335 if (stat(nomfichier,&f) || (sch.nb_impr()==1 && !pb.reprise_effectuee()))
336 {
337 os.ouvrir(nomfichier);
338
339 std::vector<std::string> comp_m = {"_Mx", "_My", "_Mz"};
340 os << (Nom)"# Printing on the boundaries of the equation "+eqn.que_suis_je()+" of the problem "+eqn.probleme().le_nom() << finl;
341 os << "# " << (type=="moment" ? "Moment of " : "") << description() << finl;
342
343 if (!gnuplot_header) os << "#";
344 os.set_col_width(wcol - !gnuplot_header);
345 os.add_col("Time");
346 os.set_col_width(wcol);
348
349 if (flux_bords_.nb_dim()!=2)
350 {
351 Cerr << "flux_bords_ not dimensioned for the operator " << que_suis_je() << finl;
353 }
354
355 // if there are multiple components per BC, we use the component names of the unknown
356 int nb_compo = flux_bords_.line_size();
357 if (type=="moment" && dimension == 2) nb_compo=1;
358 Noms noms_compo_courts(eqn.inconnue().noms_compo());
359 if (nb_compo > 1)
360 for (int i = 0; i < noms_compo_courts.size(); ++i)
361 noms_compo_courts[i] = Motcle(noms_compo_courts[i]).getSuffix(eqn.inconnue().le_nom());
362
363 // writing the column header in the form
364 // Time cl1 cl2 cl3 ...
365 // or if there are multiple components:
366 // Time cl1_compo1 cl1_compo2 cl2 compo1 cl2_compo2 ...
367 for (int num_cl=0; num_cl<les_cls.size(); num_cl++)
368 {
369 const Frontiere_dis_base& la_fr = les_cls[num_cl]->frontiere_dis();
370 if (type!="sum" || eqn.domaine_dis().domaine().bords_a_imprimer_sum().contient(la_fr.le_nom()))
371 {
372 Nom ch = la_fr.le_nom();
373 if (type=="moment")
374 {
375 if (dimension==2)
376 os.add_col((ch + comp_m[2]).getChar());
377 else
378 for (int d = 0; d < dimension; ++d)
379 os.add_col((ch + comp_m[d]).getChar());
380 }
381 else
382 {
383 if (nb_compo > 1)
384 for (int d = 0; d < nb_compo; ++d)
385 {
386 os.add_col((ch + "_" + noms_compo_courts[d]).getChar());
387 }
388 else os.add_col(ch.getChar());
389 // if periodic BC, we write the boundary name twice on the header of .out files
390 if ((sub_type(Periodique,les_cls[num_cl].valeur())) && (Objet_U::nom_du_cas()+"_"+eqn.probleme().le_nom()+"_Force_pression"!=out_))
391 {
392 if (nb_compo > 1)
393 for (int d = 0; d < nb_compo; ++d)
394 {
395 os.add_col((ch + "_" + noms_compo_courts[d]).getChar());
396 }
397 else os.add_col(ch.getChar());
398 }
399 }
400 }
401 }
402 if (type!="sum" && type!="moment")
403 if (Objet_U::nom_du_cas()+"_"+eqn.probleme().le_nom()+"_Force_pression"!=out_)
404 {
405 if (nb_compo > 1)
406 for (int d = 0; d < nb_compo; ++d)
407 os.add_col((Nom("Total_") + noms_compo_courts[d]).getChar());
408 else os.add_col("Total");
409 }
410
411 os << finl;
412 }
413 // Otherwise open it
414 else
415 {
416 os.ouvrir(nomfichier,ios::app);
417 }
418 os.precision(precision);
419 os.setf(ios::scientific);
420 // Add os to the list of files to be closed when Probleme_base::finir() is called
421 pb.get_set_out_files().add(os);
422}
423
424/*! @brief Opening/creation of a shared file for printing an operator. To override in derived classes.
425 *
426 * @throws method to override
427 */
428void Operateur_base::ouvrir_fichier_partage(EcrFicPartage& os,const Nom& type, const int flag) const
429{
430
431 // null flag means we don't open the file
432 if (flag==0)
433 return ;
434
435 const Probleme_base& pb=equation().probleme();
436 const Schema_Temps_base& sch=pb.schema_temps();
437 const int precision=sch.precision_impr();
438 Nom nomfichier(out_);
439 if (type!="") nomfichier+=(Nom)"_"+type;
440 nomfichier+=".face";
441 // Create the file on the first printing with the header
442 if (sch.nb_impr()==1 && !pb.reprise_effectuee())
443 {
444 os.ouvrir(nomfichier);
445 }
446 // Otherwise open it
447 else
448 {
449 os.ouvrir(nomfichier,ios::app);
450 }
451 os.precision(precision);
452 os.setf(ios::scientific);
453}
454
456{
457 // Default method for TRUST operators:
458 ajouter(inconnue.valeurs(), derivee);
459}
460
462{
463 return champs_compris_.get_champ(nom);
464}
465
466bool Operateur_base::has_champ(const Motcle& nom, OBS_PTR(Champ_base)& ref_champ) const
467{
468 return champs_compris_.has_champ(nom, ref_champ);
469}
470
471bool Operateur_base::has_champ(const Motcle& nom) const
472{
473 return champs_compris_.has_champ(nom);
474}
475
477{
478 if (opt == DESCRIPTION)
479 Cerr << que_suis_je() << " : " << champs_compris_.liste_noms_compris() << finl;
480 else
481 nom.add(champs_compris_.liste_noms_compris());
482}
483
484//Computes the array of values of a quantity related to an operator for post-processing
485//Recognized options: "stabilite" for dt_stab
486// "flux_bords" or "flux_surfacique_bords" for flux_bords_
487//
488void Operateur_base::calculer_pour_post(Champ_base& espace_stockage,const Nom& option, int comp) const
489{
490 if (Motcle(option)=="flux_bords" || Motcle(option)=="flux_surfacique_bords")
491 {
492 bool surfacique = (Motcle(option)=="flux_surfacique_bords");
493 DoubleTab& es_valeurs = espace_stockage.valeurs();
494 es_valeurs = 0.;
495 const Domaine_Cl_dis_base& zcl_dis = equation().domaine_Cl_dis();
496 const Domaine_dis_base& zdis = equation().domaine_dis();
497 int nb_front = zdis.nb_front_Cl();
498
499 if (flux_bords_.nb_dim()==2)
500 {
501 DoubleVect aire;
502 for (int n_bord=0; n_bord<nb_front; n_bord++)
503 {
504 const Cond_lim& la_cl = zcl_dis.les_conditions_limites(n_bord);
505 const Front_VF& le_bord = ref_cast(Front_VF,la_cl->frontiere_dis());
506 if (surfacique) la_cl->frontiere_dis().frontiere().faces().calculer_surfaces(aire);
507 int ndeb = le_bord.num_premiere_face();
508 int nfin = ndeb + le_bord.nb_faces();
509
510 for (int face=ndeb; face<nfin; face++)
511 es_valeurs(face) = flux_bords_(face,comp) / (surfacique ? aire(face-ndeb) : 1.);
512 }
513 }
514 }
515 else
516 {
517 Cerr<<"The method calculer_pour_post is not recognized for the option "<<option<<finl;
518 exit();
519 }
520}
521
523{
524 Motcle loc;
525 if (Motcle(option)=="flux_bords" || Motcle(option)=="flux_surfacique_bords")
526 {
527 if (!equation().discretisation().is_vdf())
528 loc = "face";
529 else
530 loc = "elem";
531 }
532 else
533 {
534 Cerr<<"The method get_localisation_pour_post is not actually coded "<<finl;
535 Cerr<<"for the operator "<<que_suis_je()<<" and for the option "<<option<<finl;
536 exit();
537 }
538 return loc;
539}
540
541// MODIF ELI LAUCOIN : 6/08/2008
542// Adding two methods for flux computation
543void Operateur_base::ajouter_flux(const DoubleTab& inconnue, DoubleTab& contribution) const
544{
545 Cerr << "Warning : 'Operateur_base::ajouter_flux()' must be overloaded" << finl;
547}
548
549void Operateur_base::calculer_flux(const DoubleTab& inconnue, DoubleTab& flux) const
550{
551 flux = 0.;
552 ajouter_flux(inconnue,flux);
553}
554// FIN MODIF ELI LAUCOIN : 6/08/2008
555
556
557// Adding a preparer_calcul() method
558// This makes it easier to implement diffusion operators depending on
559// whether diffusivity varies or not.
560//
561// Default implementation: does nothing
563
564// Method to test the contribuer_a_avec method
565// Test activated by an environment variable
566void Operateur_base::tester_contribuer_a_avec(const DoubleTab& inco, const Matrice_Morse& matrice)
567{
568 int test_op=0;
569 {
570 char* theValue = getenv("TRUST_TEST_OPERATEUR_IMPLICITE");
571 if (theValue != nullptr) test_op=2;
572 }
573 {
574 char* theValue = getenv("TRUST_TEST_OPERATEUR_IMPLICITE_BLOQUANT");
575 if (theValue != nullptr) test_op=1;
576 }
577 if (test_op==0) return;
578
579 Matrice_Morse mat_contribuer(matrice), mat_DF(matrice);
580 DoubleTrav resu(inco);
581 auto& coeff_contribuer = mat_contribuer.get_set_coeff();
582 // A*Inc(n)=Op(Inc(n))+
583 coeff_contribuer = 0;
584 calculer(inco, resu); // Computes the operator Op(Inc(n)) with the ajouter method into resu
585 contribuer_a_avec(inco, mat_contribuer); // Builds the operator matrix (mat=-A)
586
587 // computation of the matrix by finite differences
588 if (inco.dimension(1) == 1)
589 {
590 const double eps = 1e-6;
591 auto& coeff_DF = mat_DF.get_set_coeff();
592 const auto& tab1 = mat_DF.get_set_tab1();
593 const auto& tab2 = mat_DF.get_set_tab2();
594 coeff_DF = 0;
595 for (int i = 0; i < inco.dimension(0); i++)
596 for (auto j = tab1[i] - 1; j < tab1[i + 1] - 1; j++)
597 {
598 const int i2 = tab2[j] - 1;
599
600 DoubleTrav resu_DF(inco);
601 DoubleTab inco_pert(inco);
602 inco_pert[i2] += eps;
603 calculer(inco_pert, resu_DF);
604 mat_DF(i, i2) = -(resu_DF[i] - resu[i]) / eps;
605
606 }
607
608 // mat_DF.imprimer_formatte(Cerr);
609 // mat_contribuer.imprimer_formatte(Cerr);
610 mat_DF += -mat_contribuer;
611 // mat_DF.imprimer_formatte(Cerr); // the difference of the two
612 Cerr << "Max difference between contribuer_a_avec and finite difference jacobian : " << coeff_DF.mp_max_abs_vect() << finl;
613 }
614 else Cerr << "nbcomp > 1 : the finite difference jacobian matrix is not compared to the contribuer_a_avec one.";
615
616 mat_contribuer.ajouter_multvect(inco, resu); // Computes the flux with the matrix and adds it to resu (resu=Op(Inc(n))-A*Inc(n))
617 resu*=-1;
618 contribuer_au_second_membre(resu); // Adds imposed flux
619 mon_equation->solv_masse().appliquer(resu); // M-1*(Op(Inc(n))-A*Inc(n))
620 // We multiply by the volume because the coefficients are divided by the volume and we don't want
621 // a computation on small meshes to seem broken;
622 DoubleTab un(inco);
623 un=1;
624 mon_equation->solv_masse().appliquer(un);
625 resu/=mp_max_vect(un);
626 double err=mp_max_abs_vect(resu);
627 Cerr<<"Test contribuer_a_avec on " << que_suis_je() <<" error: "<<err<<finl;
628 if (err>1e-6)
629 {
630 {
631 DoubleVect& resu_=resu;
632 Cerr<<" size "<< resu_.size()<<finl;
633 for (int i=0; i<resu_.size(); i++)
634 if (std::fabs(resu_(i))>1e-10)
635 {
636 Cerr<<i << " "<< resu_(i)<< " "<<finl;
637 }
638 }
639 if (test_op==1)
640 exit();
641 }
642}
Class Champ_Inc_base.
const Domaine_Cl_dis_base & domaine_Cl_dis() const
DoubleTab & valeurs() override
Returns the array of field values at the current time.
virtual DoubleTab & valeurs()=0
class Champ_base This class is the base of the fields hierarchy.
Definition Champ_base.h:43
bool has_champ(const Motcle &nom, OBS_PTR(FIELD_TYPE)&ref_champ) const
class Cond_lim Generic class used to represent any class
Definition Cond_lim.h:31
class Conds_lim This class represents a vector of boundary conditions.
Definition Conds_lim.h:32
class Domaine_Cl_dis_base Domaine_Cl_dis_base objects represent discretized boundary conditions
const Cond_lim & les_conditions_limites(int) const
Returns the i-th boundary condition.
class Domaine_dis_base This class is the base of the hierarchy of discretized domains.
int nb_front_Cl() const
const Domaine & domaine() const
int ouvrir(const char *name, IOS_OPEN_MODE mode=ios::out) override
Opens the file with the given mode and prot parameters. These parameters are the parameters of the st...
void precision(int) override
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....
virtual const Champ_Inc_base & inconnue() const =0
virtual Domaine_Cl_dis_base & domaine_Cl_dis()
Returns the discretized boundary condition domain associated with the equation.
Probleme_base & probleme()
Returns the problem associated with the equation.
Domaine_dis_base & domaine_dis()
Returns the discretized domain associated with the equation.
const Nom & le_nom() const override
Returns the name of the field.
const Noms & noms_compo() const
Returns the array of names of the field components.
class Front_VF
Definition Front_VF.h:36
int nb_faces() const
Definition Front_VF.h:53
int num_premiere_face() const
Definition Front_VF.h:63
class Frontiere_dis_base Class representing a discretized boundary.
const Nom & le_nom() const override
Returns the name of the geometric boundary.
Matrice_Morse class - Represents a (sparse) matrix M, not necessarily square,.
auto & get_set_tab2()
auto & get_set_coeff()
auto & get_set_tab1()
const Equation_base & equation() const
Returns the reference to the equation pointed to by MorEqn::mon_equation.
Definition MorEqn.h:62
A character string (Nom) in uppercase.
Definition Motcle.h:26
class Nom: a character string for naming TRUST objects.
Definition Nom.h:31
const char * getChar() const
Definition Nom.h:91
const Nom getSuffix(const char *const) const
Definition Nom.cpp:276
int longueur() const
Returns the number of characters in the Nom string, including the null terminator.
Definition Nom.cpp:187
const std::string & getString() const
Definition Nom.h:92
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
friend class Sortie
Definition Objet_U.h:70
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 const Nom & nom_du_cas()
Returns a constant reference to the case name. This method is static.
Definition Objet_U.cpp:145
virtual Sortie & printOn(Sortie &) const
Writes the object to an output stream. Virtual method to override.
Definition Objet_U.cpp:278
class Operateur_base This class is the base of the hierarchy of objects representing an
virtual void ajouter_termes_croises(const DoubleTab &inco, const Probleme_base &autre_pb, const DoubleTab &autre_inco, DoubleTab &resu) const
void set_fichier(const Nom &)
virtual void modifier_pour_Cl(Matrice_Morse &, DoubleTab &) const
DOES NOTHING - to override in derived classes.
Champs_compris champs_compris_
virtual void calculer_dt_local(DoubleTab &) const
virtual void associer_champ(const Champ_Inc_base &, const std::string &nom_ch)
virtual DoubleTab & calculer(const DoubleTab &, DoubleTab &) const
virtual void contribuer_a_avec(const DoubleTab &, Matrice_Morse &) const
DOES NOTHING - to override in derived classes.
virtual void associer_domaine_cl_dis(const Domaine_Cl_dis_base &)
virtual int has_interface_blocs() const
void tester_contribuer_a_avec(const DoubleTab &, const Matrice_Morse &)
virtual void associer(const Domaine_dis_base &, const Domaine_Cl_dis_base &, const Champ_Inc_base &inco)=0
DoubleTab flux_bords_
virtual void mettre_a_jour(double temps)
DOES NOTHING - to override in derived classes.
virtual void ajouter_flux(const DoubleTab &inconnue, DoubleTab &contribution) const
void ouvrir_fichier_partage(EcrFicPartage &, const Nom &, const int flag=1) const
Opening/creation of a shared file for printing an operator. To override in derived classes.
void calculer_pour_post(Champ_base &espace_stockage, const Nom &option, int comp) const override
bool has_champ(const Motcle &nom, OBS_PTR(Champ_base) &ref_champ) const override
virtual void preparer_calcul()
virtual void dimensionner_bloc_vitesse(Matrice_Morse &matrice) const
virtual double calculer_dt_stab() const
Computes dt_stab.
virtual void dimensionner_termes_croises(Matrice_Morse &, const Probleme_base &autre_pb, int nl, int nc) const
virtual void dimensionner(Matrice_Morse &) const
DOES NOTHING - to override in derived classes.
virtual void completer()
Associates the operator with the domaine_dis, the domaine_Cl_dis, and the unknown of its equation.
void get_noms_champs_postraitables(Noms &nom, Option opt=NONE) const override
virtual int impr(Sortie &os) const
DOES NOTHING - to override in derived classes.
virtual void contribuer_bloc_vitesse(const DoubleTab &, Matrice_Morse &) const
Motcle get_localisation_pour_post(const Nom &option) const override
virtual void dimensionner_blocs(matrices_t matrices, const tabs_t &semi_impl={ }) const
const Champ_base & get_champ(const Motcle &nom) const override
virtual void contribuer_au_second_membre(DoubleTab &) const
DOES NOTHING - to override in derived classes.
virtual void resetTime(double time)
virtual void ajouter_contribution_explicite_au_second_membre(const Champ_Inc_base &inconnue, DoubleTab &derivee) const
std::string nom_inco_
virtual void abortTimeStep()
const Nom description() const
virtual DoubleTab & ajouter(const DoubleTab &, DoubleTab &) const
virtual int systeme_invariant() const
virtual void ajouter_blocs(matrices_t matrices, DoubleTab &secmem, const tabs_t &semi_impl={ }) const
virtual void contribuer_termes_croises(const DoubleTab &inco, const Probleme_base &autre_pb, const DoubleTab &autre_inco, Matrice_Morse &matrice) const
virtual void calculer_flux(const DoubleTab &inconnue, DoubleTab &flux) const
void ouvrir_fichier(SFichier &os, const Nom &, const int flag=1) const
Opening/creation of a file for printing an operator. To override in derived classes.
class Periodique This class represents a periodic boundary condition.
Definition Periodique.h:31
const Nom & le_nom() const override
Returns the name of the Objet_U. Virtual method to override: returns "neant" in this implementation.
Definition Probleme_U.h:109
class Probleme_base It is a Probleme_U that is not a coupling.
bool & reprise_effectuee()
const Schema_Temps_base & schema_temps() const
Returns the time scheme associated with the problem.
static void abort()
Abort routine for TRUST on a fatal error.
Definition Process.cpp:573
static void exit(int exit_code=-1)
Exit routine for TRUST within a Kokkos region.
Definition Process.cpp:466
static int je_suis_maitre()
Returns 1 if on the master processor of the current group (i.e. me() == 0), 0 otherwise.
Definition Process.cpp:82
SFichier is to the C++ ofstream class what Sortie is to the C++ ostream class.
Definition SFichier.h:29
class Schema_Temps_base
int nb_impr() const
Returns the number of outputs performed.
virtual int ouvrir(const char *name, IOS_OPEN_MODE mode=ios::out)
void precision(int pre) override
void setf(IOS_FORMAT code) override
Base class for output streams.
Definition Sortie.h:52
void set_col_width(int w)
Definition Sortie.h:66
virtual int add_col(const double ob)
Definition Sortie.cpp:83
_SIZE_ dimension(int d) const
Definition TRUSTTab.tpp:133
_SIZE_ size() const
Definition TRUSTVect.tpp:45