TrioCFD 1.9.8
TrioCFD documentation
Loading...
Searching...
No Matches
Parametre_implicite.cpp
1/****************************************************************************
2* Copyright (c) 2025, 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 <Parametre_implicite.h>
17#include <Param.h>
18
19Implemente_instanciable_sans_constructeur(Parametre_implicite,"Parametre_implicite",Parametre_equation_base);
20
21// Par defaut les seuils sont negatifs (donc pas utilisables!!)
22Parametre_implicite::Parametre_implicite()
23{
25 // seuil_convergence_solveur()=-1.;
31 nb_it_max_=1000000;
32 Nom eq_freq_resolue="0";
34 equation_frequence_resolue_.setString(eq_freq_resolue);
36 equation_frequence_resolue_.parseString();
37}
38
40{
41 return os;
42}
43
44// XD parametre_implicite parametre_equation_base parametre_implicite INHERITS_BRACE Keyword to change for this equation
45// XD_CONT only the parameter of the implicit scheme used to solve the problem.
46// XD attr seuil_convergence_implicite floattant seuil_convergence_implicite OPT Keyword to change for this equation
47// XD_CONT only the value of seuil_convergence_implicite used in the implicit scheme.
48// XD attr seuil_convergence_solveur floattant seuil_convergence_solveur OPT Keyword to change for this equation only
49// XD_CONT the value of seuil_convergence_solveur used in the implicit scheme
50// XD attr solveur solveur_sys_base solveur OPT Keyword to change for this equation only the solver used in the implicit
51// XD_CONT scheme
52// XD attr resolution_explicite rien resolution_explicite OPT To solve explicitly the equation whereas the scheme is an
53// XD_CONT implicit scheme.
54// XD attr equation_non_resolue rien equation_non_resolue OPT Keyword to specify that the equation is not solved.
55// XD attr equation_frequence_resolue chaine equation_frequence_resolue OPT Keyword to specify that the equation is
56// XD_CONT solved only every n time steps (n is an integer or given by a time-dependent function f(t)).
58{
59 Nom eq_freq_resolue="0";
60 double seuil_convergence_solveur_prov=-1;
61 Param param(que_suis_je());
62 param.ajouter("solveur",&le_solveur_);
63 param.ajouter( "seuil_convergence_implicite",&seuil_convergence_implicite_);
64 param.ajouter( "seuil_convergence_solveur",&seuil_convergence_solveur_prov);
65
66 param.ajouter("seuil_generation_solveur",&seuil_generation_solveur_);
67 param.ajouter("seuil_test_preliminaire_solveur",&seuil_test_preliminaire_solveur_);
68 param.ajouter("seuil_verification_solveur",&seuil_verification_solveur_);
69
70 param.ajouter( "resolution_explicite_diffusion_implicite",&seuil_diffusion_implicite_);
71 param.ajouter_flag( "resolution_explicite",&calcul_explicite_);
72 param.ajouter( "equation_frequence_resolue",&eq_freq_resolue);
73 param.lire_avec_accolades_depuis(is);
74 if (param.get_list_mots_lus().rang("seuil_test_preliminaire_solveur")>0)
76 if (seuil_convergence_solveur_prov>0)
77 set_seuil_solveur_avec_seuil_convergence_solveur(seuil_convergence_solveur_prov);
80 equation_frequence_resolue_.setString(eq_freq_resolue);
81 equation_frequence_resolue_.parseString();
82 le_solveur_.nommer("solveur_implicite");
83 return is;
84}
85
86/*! @brief permet de mettre les seuils equivalents a ceux de la 161 pour l'instant warning ensuite ereur.
87 *
88 */
90{
91 if (seuil_convergence_solveur<0)
92 return;
93 Cerr<< "Warning: using of seuil_convergence_solveur is obsolete, use seuil_generation_solveur,seuil_test_preliminaire_solveur,seuil_verification_solveur "<<finl;
94 /*
95 #ifndef NDEBUG
96 Cerr << "This warning is an error when using a debug TRUST version." << finl;
97 Process::exit();
98 #endif
99 */
101 seuil_generation_solveur_=seuil_convergence_solveur;
102 else
103 {
104 Cerr<< "You can not use seuil_generation_solveur and seuil_convergence_solveur in the same block" <<finl;
105 exit();
106 }
108 seuil_verification_solveur_=seuil_convergence_solveur;
109 else
110 {
111 Cerr<< "You can not use seuil_verification_solveur and seuil_convergence_solveur in the same block" <<finl;
112 exit();
113 }
115 seuil_test_preliminaire_solveur_=seuil_convergence_solveur;
116 else
117 {
118 Cerr<< "You can not use seuil_test_preliminaire_solveur and seuil_convergence_solveur in the same block" <<finl;
119 exit();
120 }
121}
122
Class defining operators and methods for all reading operation in an input flow (file,...
Definition Entree.h:42
const Nom & que_suis_je() const
renvoie la chaine identifiant la classe.
Definition Objet_U.cpp:104
virtual Entree & readOn(Entree &)
Lecture d'un Objet_U sur un flot d'entree Methode a surcharger.
Definition Objet_U.cpp:293
virtual Sortie & printOn(Sortie &) const
Ecriture de l'objet sur un flot de sortie Methode a surcharger.
Definition Objet_U.cpp:282
classe Parametre_equation_base Un objet Parametre_equation_base est un objet regroupant les different...
classe Parametre_implicite Un objet Parametre_implicite est un objet regroupant les differentes
void set_seuil_solveur_avec_seuil_convergence_solveur(double)
permet de mettre les seuils equivalents a ceux de la 161 pour l'instant warning ensuite ereur.
double & seuil_convergence_implicite()
static void exit(int exit_code=-1)
Routine de sortie de TRUST dans une region Kokkos.
Definition Process.cpp:455
Classe de base des flux de sortie.
Definition Sortie.h:52