TrioCFD 1.9.9_beta
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 class MorEqn Class that groups the functionalities of linking with an
26 *
27 * Equation. The member MorEqn::mon_equation contains a reference
28 * to an Equation_base object. The classes that are "Equation pieces"
29 * are associated by a 1-1 link to their equation by inheriting from MorEqn,
30 * for example: Operateur_base, Solveur_Masse, Source_base ...
31 *
32 * @sa Equation_base, This is not a class of the TRUST tree by itself., This class is intended to be a base class of a class, which will also inherit from 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 /* compatibility with multiphase equations : by default, error message */
47 virtual void check_multiphase_compatibility() const;
48protected :
49 OBS_PTR(Equation_base) mon_equation;
50 inline virtual ~MorEqn();
51};
52
55/*! @brief Returns the reference to the equation pointed to by MorEqn::mon_equation.
56 *
57 * (const version)
58 *
59 * @return (Equation_base&) the equation associated with the object
60 * @throws no associated equation
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 Returns the reference to the equation pointed to by MorEqn::mon_equation.
73 *
74 * @return (Equation_base&) the equation associated with the object
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
class Champ_base This class is the base of the fields hierarchy.
Definition Champ_base.h:43
class Equation_base The role of an equation is the calculation of one or more fields....
class MorEqn Class that groups the functionalities of linking with an
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 &)
Associates an equation with the object.
Definition MorEqn.cpp:28
const Equation_base & equation() const
Returns the reference to the equation pointed to by 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
A character string (Nom) in uppercase.
Definition Motcle.h:26
class Nom: a character string for naming TRUST objects.
Definition Nom.h:31
static void exit(int exit_code=-1)
Exit routine for TRUST within a Kokkos region.
Definition Process.cpp:466