TrioCFD 1.9.9_beta
TrioCFD documentation
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// By default the thresholds are negative (therefore unusable!!)
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
A character string (Nom) in uppercase.
Definition Motcle.h:26
friend class Entree
Definition Objet_U.h:71
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
class Parametre_diffusion_implicite A Parametre_diffusion_implicite object groups together the variou...
int lire_motcle_non_standard(const Motcle &, Entree &) override
Reads non-simple-type parameters of an Objet_U from an input stream.
Parametre_equation_base A Parametre_equation_base object groups the various.
Base class for output streams.
Definition Sortie.h:52