TRUST 1.9.8
HPC thermohydraulic platform
Loading...
Searching...
No Matches
TRUSTProblem_sup_eqns.h
1/****************************************************************************
2* Copyright (c) 2022, 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 TRUSTProblem_sup_eqns_included
17#define TRUSTProblem_sup_eqns_included
18
19#include <List_Equations_Scalaires_Passifs_Especes.h>
20
21template <typename _DERIVED_TYPE_>
22class TRUSTProblem_sup_eqns : public _DERIVED_TYPE_
23{
24protected:
25 unsigned taille_memoire() const override { return sizeof(TRUSTProblem_sup_eqns<_DERIVED_TYPE_>); }
26
27 int duplique() const override
28 {
30 if(!xxx)
31 {
32 Cerr << "Not enough memory " << finl;
34 }
35 return xxx->numero();
36 }
37
38 Sortie& printOn(Sortie& os) const override { return _DERIVED_TYPE_::printOn(os); }
39
40 Entree& readOn(Entree& is) override
41 {
42 is_lecture = 1;
43 _DERIVED_TYPE_::readOn(is);
44 is_lecture = 0;
45 return is;
46 }
47
48public:
49
52
53 int nombre_d_equations() const override
54 {
55 if (list_eq_supp.complete())
56 return _DERIVED_TYPE_::nombre_d_equations() + list_eq_supp.nb_equation();
57 else
58 return _DERIVED_TYPE_::nombre_d_equations() + 1;
59 }
60
61 const Equation_base& equation(int i) const override
62 {
63 if (i < _DERIVED_TYPE_::nombre_d_equations()) return _DERIVED_TYPE_::equation(i);
64 else
65 {
66 assert(is_lecture == 0);
67 return list_eq_supp.equation(i - _DERIVED_TYPE_::nombre_d_equations());
68 }
69 }
70
71 Equation_base& equation(int i) override
72 {
73 if (i < _DERIVED_TYPE_::nombre_d_equations()) return _DERIVED_TYPE_::equation(i);
74 else if (list_eq_supp.complete() == 0)
75 {
76 is_lecture = 0;
77 return list_eq_supp;
78 }
79 else if (is_lecture == -1) return list_eq_supp;
80 else return list_eq_supp.equation(i - _DERIVED_TYPE_::nombre_d_equations());
81 }
82
83 void associer_milieu_base(const Milieu_base& mil) override
84 {
85 _DERIVED_TYPE_::associer_milieu_base(mil);
86 list_eq_supp.associer_milieu_base(mil);
87 }
88
89protected:
92};
93
94#endif /* TRUSTProblem_sup_eqns_included */
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....
classe List_Equations_Scalaires_Passifs_Especes Represente une liste d'equations de scalaires passifs...
classe Milieu_base Cette classe est la base de la hierarchie des milieux (physiques)
Definition Milieu_base.h:50
static void exit(int exit_code=-1)
Routine de sortie de TRUST dans une region Kokkos.
Definition Process.cpp:455
Classe de base des flux de sortie.
Definition Sortie.h:52
void associer_milieu_base(const Milieu_base &mil) override
List_Equations_Scalaires_Passifs_Especes list_eq_supp
Equation_base & equation(int i) override
int duplique() const override
Entree & readOn(Entree &is) override
int nombre_d_equations() const override
unsigned taille_memoire() const override
Sortie & printOn(Sortie &os) const override
const Equation_base & equation(int i) const override