TrioCFD 1.9.8
TrioCFD documentation
Loading...
Searching...
No Matches
MorEqn.h
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#ifndef MorEqn_included
17#define MorEqn_included
18
19#include <TRUST_Ref.h>
20#include <Motcle.h>
21
22class Champ_base;
23class Equation_base;
24
25/*! @brief classe MorEqn Classe qui regroupe les fonctionnalites de liaison avec une
26 *
27 * Equation. Le membre MorEqn::mon_equation contient une reference
28 * vers un objet Equation_base. Les classes qui sont des "Morceaux d'equation"
29 * sont associe par une liaison 1-1 a leur equation en heritant de MorEqn,
30 * par exemple: Operateur_base, Solveur_Masse, Source_base ...
31 *
32 * @sa Equation_base, Ce n'est pas une classe de l'arbre TRUST a elle seule., Cette classe est faite etre une classe mere d'une classe, qui heritera par ailleurs d'Objet_U
33 */
34class MorEqn
35{
36
37public:
38 void associer_eqn(const Equation_base&);
39 virtual void calculer_pour_post(Champ_base& espace_stockage,const Nom& option, int comp) const;
40 virtual Motcle get_localisation_pour_post(const Nom& option) const;
41 inline const Equation_base& equation() const;
42 inline Equation_base& equation();
43
44 inline int mon_equation_non_nul() const;
45
46 /* compatibilite avec les equations multiphase : par defaut, message d'erreur */
47 virtual void check_multiphase_compatibility() const;
48protected :
49 OBS_PTR(Equation_base) mon_equation;
50 inline virtual ~MorEqn();
51};
52
55/*! @brief Renvoie la reference sur l'equation pointe par MorEqn::mon_equation.
56 *
57 * (version const)
58 *
59 * @return (Equation_base&) l'equation associee a l'objet
60 * @throws pas d'equation associee
61 */
62inline const Equation_base& MorEqn::equation() const
63{
64 if (!mon_equation)
65 {
66 Cerr << "\nError in MorEqn::equation() : The equation is unknown !" << finl;
68 }
69 return mon_equation.valeur();
70}
71
72/*! @brief Renvoie la reference sur l'equation pointe par MorEqn::mon_equation.
73 *
74 * @return (Equation_base&) l'equation associee a l'objet
75 */
77{
78 if (!mon_equation)
79 {
80 Cerr << "\nError in MorEqn::equation() : The equation is unknown !" << finl;
82 }
83 return mon_equation.valeur();
84}
86{
87 return bool(mon_equation);
88}
89#endif
90
classe Champ_base Cette classe est la base de la hierarchie des champs.
Definition Champ_base.h:43
classe Equation_base Le role d'une equation est le calcul d'un ou plusieurs champs....
classe MorEqn Classe qui regroupe les fonctionnalites de liaison avec une
Definition MorEqn.h:35
virtual ~MorEqn()
Definition MorEqn.h:53
int mon_equation_non_nul() const
Definition MorEqn.h:85
void associer_eqn(const Equation_base &)
Associe une equation a l'objet.
Definition MorEqn.cpp:28
const Equation_base & equation() const
Renvoie la reference sur l'equation pointe par MorEqn::mon_equation.
Definition MorEqn.h:62
virtual void check_multiphase_compatibility() const
Definition MorEqn.cpp:50
OBS_PTR(Equation_base) mon_equation
virtual Motcle get_localisation_pour_post(const Nom &option) const
Definition MorEqn.cpp:43
virtual void calculer_pour_post(Champ_base &espace_stockage, const Nom &option, int comp) const
Definition MorEqn.cpp:35
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
static void exit(int exit_code=-1)
Routine de sortie de TRUST dans une region Kokkos.
Definition Process.cpp:455