TRUST 1.9.8
HPC thermohydraulic platform
Loading...
Searching...
No Matches
Parametre_diffusion_implicite.cpp
1/****************************************************************************
2* Copyright (c) 2023, 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_diffusion_implicite.h>
17#include <Param.h>
18
19Implemente_instanciable_sans_constructeur(Parametre_diffusion_implicite,"Parametre_diffusion_implicite",Parametre_equation_base);
20
21// Par defaut les seuils sont negatifs (donc pas utilisables!!)
22Parametre_diffusion_implicite::Parametre_diffusion_implicite()
23{
25 crank_=0;
26 nb_it_max_=-1;
28
29}
30
32{
33 return os;
34}
35// XD parametre_diffusion_implicite parametre_equation_base parametre_diffusion_implicite INHERITS_BRACE To specify
36// XD_CONT additional parameters for the equation when using impliciting diffusion
37// XD attr crank entier(into=[0,1]) crank OPT Use (1) or not (0, default) a Crank Nicholson method for the diffusion
38// XD_CONT implicitation algorithm. Setting crank to 1 increases the order of the algorithm from 1 to 2.
39// XD attr preconditionnement_diag entier(into=[0,1]) preconditionnement_diag OPT The CG used to solve the implicitation
40// XD_CONT of the equation diffusion operator is not preconditioned by default. If this option is set to 1, a diagonal
41// XD_CONT preconditionning is used. Warning: this option is not necessarily more efficient, depending on the treated
42// XD_CONT case.
43// XD attr niter_max_diffusion_implicite entier niter_max_diffusion_implicite OPT Change the maximum number of
44// XD_CONT iterations for the CG (Conjugate Gradient) algorithm when solving the diffusion implicitation of the
45// XD_CONT equation.
46// XD attr seuil_diffusion_implicite floattant seuil_diffusion_implicite OPT Change the threshold convergence value used
47// XD_CONT by default for the CG resolution for the diffusion implicitation of this equation.
48// XD attr solveur solveur_sys_base solveur OPT Method (different from the default one, Conjugate Gradient) to solve the
49// XD_CONT linear system.
51{
52 Param param(que_suis_je());
53 param.ajouter("crank",&crank_);
54 param.ajouter("niter_max_diffusion_implicite",&nb_it_max_);
55 param.ajouter("preconditionnement_diag",&preconditionnement_diag_);
56 param.ajouter("seuil_diffusion_implicite",&seuil_diffusion_implicite_);
57 param.ajouter_non_std("solveur",(this));
58 param.lire_avec_accolades_depuis(is);
59 return is;
60}
61
63{
64 if (mot=="solveur")
65 {
66 is >> solveur_;
67 solveur_.nommer("solveur_diffusion_implicite");
68 return 1;
69 }
70 return -1;
71}
Class defining operators and methods for all reading operation in an input flow (file,...
Definition Entree.h:42
Une chaine de caractere (Nom) en majuscules.
Definition Motcle.h:26
friend class Entree
Definition Objet_U.h:76
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_diffusion_implicite Un objet Parametre_diffusion_implicite est un objet regroupant l...
int lire_motcle_non_standard(const Motcle &, Entree &) override
Lecture des parametres de type non simple d'un objet_U a partir d'un flot d'entree.
classe Parametre_equation_base Un objet Parametre_equation_base est un objet regroupant les different...
Classe de base des flux de sortie.
Definition Sortie.h:52