TRUST 1.9.8
HPC thermohydraulic platform
Loading...
Searching...
No Matches
Probleme_Couple.h
1/****************************************************************************
2* Copyright (c) 2025, 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 Probleme_Couple_included
17#define Probleme_Couple_included
18
19#include <TRUSTTabs_forward.h>
20#include <Schema_Temps_base.h>
21#include <Couplage_U.h>
22#include <TRUST_Ref.h>
23
26class Champ_base;
27
28/*! @brief classe Probleme_Couple C'est la classe historique de couplage de TRUST.
29 *
30 * Il s'agit d'un Couplage_U particulier.
31 * Le Probleme_Couple ne couple que des Probleme_base, tous
32 * associes au meme schema en temps.
33 * Il possede son propre mecanisme d'echange de champs par "raccords".
34 * Les problemes sont groupes. Chaque groupe fait un iteration, puis les
35 * nouveaux champs sont disponibles pour les groupes suivants. A l'interieur
36 * d'un groupe, ce sont les anciens champs qui sont echanges.
37 *
38 *
39 * @sa Probleme_base Probleme
40 */
41
42// WEC :
43// Le schema en temps est clone autant de fois qu'il y a de problemes
44// Ce clonage n'est pas tres propre :
45// * ils ont tous le meme nom
46// Pour eviter ca :
47// changer la syntaxe des .data et avoir vraiment un schema par
48// probleme
49
51{
52 Declare_instanciable(Probleme_Couple);
53public :
54
55 ///////////////////////////////////////////////
56 // //
57 // Implementation de l'interface de Problem //
58 // //
59 ///////////////////////////////////////////////
60
61 // interface UnsteadyProblem
62 bool initTimeStep(double dt) override;
63 double computeTimeStep(bool& stop) const override;
64 bool solveTimeStep() override;
65
66 // interface IterativeUnsteadyProblem
67
68 bool iterateTimeStep(bool& converged) override;
69
70 ////////////////////////////////////////////////////////
71 // //
72 // Fin de l'implementation de l'interface de Problem //
73 // //
74 ////////////////////////////////////////////////////////
75
76 bool updateGivenFields() override;
77
79 int associer_(Objet_U&) override;
81 virtual const Schema_Temps_base& schema_temps() const;
83
84 virtual void discretiser(Discretisation_base&);
85 inline virtual void mettre_a_jour_modele_rayo(double temps);
86 void initialize() override;
87 void sauver() const override;
88
89protected:
90
91 // Definitions des groupes de problemes.
92 // Vecteur d'entiers specifiant chacun la taille d'un groupe.
93 // Vecteur vide = un seul groupe.
94 ArrOfInt groupes;
95
96 // Liste des schemas clones
97 VECT(OWN_PTR(Schema_Temps_base)) sch_clones;
98};
99
101{
102
103 Cerr<<"The method Probleme_Couple::mettre_a_jour_modele_rayo does nothing"<<finl;
104 Cerr<<"We should not pass through here"<<finl;
105 exit();
106}
107
109{
110 Declare_instanciable(Probleme_Couple_Point_Fixe);
111public:
112 bool solveTimeStep() override;
113};
114
115#endif
classe Champ_base Cette classe est la base de la hierarchie des champs.
Definition Champ_base.h:43
class Couplage_U
Definition Couplage_U.h:31
classe Discretisation_base Cette classe represente un schema de discretisation en espace,...
Objet_U()
Constructeur par defaut : attribue un numero d'identifiant unique a l'objet (object_id_),...
Definition Objet_U.cpp:55
bool solveTimeStep() override
pour recodage eventuel et appel unifie en python
classe Probleme_Couple C'est la classe historique de couplage de TRUST.
virtual void discretiser(Discretisation_base &)
Associe une discretisation a tous les problemes du probleme couple.
VECT(OWN_PTR(Schema_Temps_base)) sch_clones
void sauver() const override
Sauvegarder l'etat du probleme sur disque.
bool initTimeStep(double dt) override
This method allocates and initializes the unknown and given fields for the future time step.
void initialize() override
This method is called once at the beginning, before any other one of the interface Problem.
double computeTimeStep(bool &stop) const override
Compute the value the Problem would like for the next time step.
virtual void associer_sch_tps_base(Schema_Temps_base &)
Associe une copie du schema en temps a chaque probleme du Probleme couple.
int associer_(Objet_U &) override
Surcharge Objet_U::associer_(Objet_U&) Associe un objet au probleme couple, en verifiant le type.
bool updateGivenFields() override
ATTENTION :
bool solveTimeStep() override
pour recodage eventuel et appel unifie en python
virtual void mettre_a_jour_modele_rayo(double temps)
virtual const Schema_Temps_base & schema_temps() const
Renvoie le schema en temps associe aux problemes couples.
void ajouter(Probleme_base &)
Ajoute un probleme a la liste des problemes couples.
bool iterateTimeStep(bool &converged) override
In the case solveTimeStep uses an iterative process, this method executes a single iteration.
classe Probleme_base C'est un Probleme_U qui n'est pas un couplage.
static void exit(int exit_code=-1)
Routine de sortie de TRUST dans une region Kokkos.
Definition Process.cpp:455
class Schema_Temps_base