TrioCFD 1.9.9_beta
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// By default the thresholds are negative (therefore unusable!!)
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 Allows setting thresholds equivalent to those of version 161: warning for now, error later.
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
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
virtual Sortie & printOn(Sortie &) const
Writes the object to an output stream. Virtual method to override.
Definition Objet_U.cpp:278
Parametre_equation_base A Parametre_equation_base object groups the various.
class Parametre_implicite A Parametre_implicite object groups together the various
void set_seuil_solveur_avec_seuil_convergence_solveur(double)
Allows setting thresholds equivalent to those of version 161: warning for now, error later.
double & seuil_convergence_implicite()
static void exit(int exit_code=-1)
Exit routine for TRUST within a Kokkos region.
Definition Process.cpp:466
Base class for output streams.
Definition Sortie.h:52