TRUST 1.9.8
HPC thermohydraulic platform
Loading...
Searching...
No Matches
Probleme_base_interface_proto.h
1/****************************************************************************
2* Copyright (c) 2024, 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_base_interface_proto_included
17#define Probleme_base_interface_proto_included
18
19#include <Schema_Temps_base.h>
20#include <TRUST_List.h>
21#include <TRUST_Ref.h>
22
24class Probleme_base;
25class Field_base;
26
28{
29public:
30 bool initTimeStep_impl(Probleme_base& pb, double dt);
32 bool isStationary_impl(const Probleme_base& pb) const;
33 bool iterateTimeStep_impl(Probleme_base& pb, bool& converged);
35 const bool& is_probleme_initialized_impl() const { return initialized; }
36
41 void getInputFieldsNames_impl(const Probleme_base& pb, Noms& noms) const;
42 void getOutputFieldsNames_impl(const Probleme_base& pb, Noms& noms) const;
44
45 double presentTime_impl(const Probleme_base& pb) const;
46 double computeTimeStep_impl(const Probleme_base& pb,bool& stop) const;
47 double futureTime_impl(const Probleme_base& pb) const;
48
49 // Not the same signature as ICoCo:
50 void resetTimeWithDir_impl(Probleme_base& pb, double time, std::string direname);
51
52 OBS_PTR(Field_base) findInputField_impl(const Probleme_base& pb,const Nom& name) const;
53 OBS_PTR(Champ_Generique_base) findOutputField_impl(const Probleme_base& pb,const Nom& name) const;
54
55protected:
56 LIST(OBS_PTR(Field_base)) input_fields; // List of input fields inside this problem.
57 // Flags used to control the calling order and raise exceptions
58 bool initialized = false; // true if initialize was called
59 bool terminated = false; // true if terminate was called
60 bool dt_defined = false; // true if computation interval is defined
61 // set to true by initTimeStep, to false by validateTimeStep & abortTimeStep
62 bool dt_validated = false; // true if last computation was validated
63 // set to true by validateTimeStep, to false by initTimeStep
64};
65
66#endif /* Probleme_base_interface_proto_included */
class Champ_Generique_base
class Nom Une chaine de caractere pour nommer les objets de TRUST
Definition Nom.h:31
Un tableau de chaine de caracteres (VECT(Nom)).
Definition Noms.h:26
void getInputFieldsNames_impl(const Probleme_base &pb, Noms &noms) const
LIST(OBS_PTR(Field_base)) input_fields
OBS_PTR(Champ_Generique_base) findOutputField_impl(const Probleme_base &pb
void getOutputFieldsNames_impl(const Probleme_base &pb, Noms &noms) const
bool initTimeStep_impl(Probleme_base &pb, double dt)
bool iterateTimeStep_impl(Probleme_base &pb, bool &converged)
double futureTime_impl(const Probleme_base &pb) const
void resetTimeWithDir_impl(Probleme_base &pb, double time, std::string direname)
double presentTime_impl(const Probleme_base &pb) const
bool isStationary_impl(const Probleme_base &pb) const
double computeTimeStep_impl(const Probleme_base &pb, bool &stop) const
OBS_PTR(Field_base) findInputField_impl(const Probleme_base &pb
void addInputField_impl(Probleme_base &pb, Field_base &f)
classe Probleme_base C'est un Probleme_U qui n'est pas un couplage.