TrioCFD 1.9.8
TrioCFD documentation
Loading...
Searching...
No Matches
Solveur_Lineaire_Std.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 <Schema_Implicite_base.h>
17#include <Solveur_Lineaire_Std.h>
18#include <SolveurSys_base.h>
19#include <Equation_base.h>
20#include <Matrice_Morse.h>
21#include <Motcle.h>
22#include <Nom.h>
23#include <Param.h>
24
25Implemente_instanciable(Solveur_Lineaire_Std,"Solveur_lineaire_std",Solveur_lineaire);
26// XD solveur_lineaire_std solveur_implicite_base solveur_lineaire_std BRACE not_set
27// XD attr solveur solveur_sys_base solveur OPT not_set
28
29
31{
32 Cerr << " The implicit solver used is of type Solveur_Lineaire_Std " << finl;
34}
35
37{
38 Cerr << " The implicit solver used is of type Solveur_Lineaire_Std " << finl;
39 Param param(que_suis_je());
40 set_param(param);
41 param.lire_avec_accolades_depuis(is);
42 return is;
43}
44
46{
47 param.ajouter_non_std("solveur",(this),Param::REQUIRED);
48}
49
51{
52 int retval = 1;
53 if (mot=="solveur")
54 {
55 Nom nom_solveur("Solv_");
56 Nom type_solv_sys;
57 is >> type_solv_sys;
58 nom_solveur+=type_solv_sys;
59 Cerr << "nom_solveur " << nom_solveur << finl;
60 solveur.typer(nom_solveur);
61 is >> solveur.valeur();
62 solveur.nommer("solveur_implicite");
63 }
64 else retval = -1;
65
66 return retval;
67}
68
69bool Solveur_Lineaire_Std::iterer_eqn(Equation_base& equation, const DoubleTab& inconnue, DoubleTab& result, double dt, int numero_iteration, int& ok)
70{
71 assert( numero_iteration == 1 );
72 Matrice_Morse matrix;
73 DoubleTrav rhs(result);
74 equation.dimensionner_matrice(matrix);
75 equation.assembler_avec_inertie(matrix, inconnue, rhs);
76 solveur->reinit();
77 solveur.resoudre_systeme(matrix, rhs, result);
78 return true;
79}
Class defining operators and methods for all reading operation in an input flow (file,...
Definition Entree.h:42
classe Equation_base Le role d'une equation est le calcul d'un ou plusieurs champs....
virtual void assembler_avec_inertie(Matrice_Morse &mat_morse, const DoubleTab &present, DoubleTab &secmem)
virtual void dimensionner_matrice(Matrice_Morse &mat_morse)
Classe Matrice_Morse Represente une matrice M (creuse), non necessairement carree.
Une chaine de caractere (Nom) en majuscules.
Definition Motcle.h:26
class Nom Une chaine de caractere pour nommer les objets de TRUST
Definition Nom.h:31
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
Helper class to factorize the readOn method of Objet_U classes.
Definition Param.h:112
@ REQUIRED
Definition Param.h:115
void ajouter_non_std(const char *keyword, const Objet_U *value, Param::Nature nat=Param::OPTIONAL)
Register a keyword handled by Objet_U::lire_motcle_non_standard.
Definition Param.cpp:489
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.
bool iterer_eqn(Equation_base &equation, const DoubleTab &inconnue, DoubleTab &result, double dt, int numero_iteration, int &ok) override
void set_param(Param &param) const override
class Solveur_lineaire
Classe de base des flux de sortie.
Definition Sortie.h:52