TrioCFD 1.9.9_beta
TrioCFD documentation
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 Probleme_Couple This is the historical coupling class of TRUST.
29 *
30 * It is a particular Couplage_U.
31 * Probleme_Couple only couples Probleme_base objects, all
32 * associated with the same time scheme.
33 * It has its own field exchange mechanism via "raccords".
34 * Problems are grouped. Each group performs one iteration, then the
35 * new fields become available for subsequent groups. Within a
36 * group, the old fields are exchanged.
37 *
38 *
39 * @sa Probleme_base Probleme
40 */
41
42// WEC :
43// The time scheme is cloned as many times as there are problems.
44// This cloning is not very clean:
45// * they all have the same name
46// To avoid this:
47// change the syntax of the .data files to have truly one scheme per
48// problem
49
51{
52 Declare_instanciable(Probleme_Couple);
53public :
54
55 ///////////////////////////////////////////////
56 // //
57 // Implementation of the Problem interface //
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 // End of Problem interface implementation //
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 of problem groups.
92 // Integer vector where each entry specifies the size of a group.
93 // Empty vector = single group.
94 ArrOfInt groupes;
95
96 // List of cloned time schemes
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
class Champ_base This class is the base of the fields hierarchy.
Definition Champ_base.h:43
class Couplage_U
Definition Couplage_U.h:31
class Discretisation_base This class represents a spatial discretization scheme, which
Objet_U()
Default constructor: assigns a unique identifier to the object (object_id_) and registers the object ...
Definition Objet_U.cpp:54
bool solveTimeStep() override
For possible re-implementation and unified call from python.
Probleme_Couple This is the historical coupling class of TRUST.
virtual void discretiser(Discretisation_base &)
Associates a discretization with all problems of the coupled problem.
VECT(OWN_PTR(Schema_Temps_base)) sch_clones
void sauver() const override
Save the problem state to disk.
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 &)
Associates a copy of the time scheme with each problem of the coupled problem.
int associer_(Objet_U &) override
Overrides Objet_U::associer_(Objet_U&): associates an object with the coupled problem,...
bool updateGivenFields() override
WARNING:
bool solveTimeStep() override
For possible re-implementation and unified call from python.
virtual void mettre_a_jour_modele_rayo(double temps)
virtual const Schema_Temps_base & schema_temps() const
Returns the time scheme associated with the coupled problems (const version).
void ajouter(Probleme_base &)
Adds a problem to the list of coupled problems.
bool iterateTimeStep(bool &converged) override
In the case solveTimeStep uses an iterative process, this method executes a single iteration.
class Probleme_base It is a Probleme_U that is not a coupling.
static void exit(int exit_code=-1)
Exit routine for TRUST within a Kokkos region.
Definition Process.cpp:466
class Schema_Temps_base