Arcane  4.1.12.0
Developer documentation
Loading...
Searching...
No Matches
ITimeLoopMng.h
1// -*- tab-width: 2; indent-tabs-mode: nil; coding: utf-8-with-signature -*-
2//-----------------------------------------------------------------------------
3// Copyright 2000-2026 CEA (www.cea.fr) IFPEN (www.ifpenergiesnouvelles.com)
4// See the top-level COPYRIGHT file for details.
5// SPDX-License-Identifier: Apache-2.0
6//-----------------------------------------------------------------------------
7/*---------------------------------------------------------------------------*/
8/* ITimeLoopMng.h (C) 2000-2025 */
9/* */
10/* Time loop manager interface. */
11/*---------------------------------------------------------------------------*/
12#ifndef ARCANE_CORE_ITIMELOOPMNG_H
13#define ARCANE_CORE_ITIMELOOPMNG_H
14/*---------------------------------------------------------------------------*/
15/*---------------------------------------------------------------------------*/
16
18
19/*---------------------------------------------------------------------------*/
20/*---------------------------------------------------------------------------*/
21
22namespace Arcane
23{
24class IBackwardMng;
25
26/*---------------------------------------------------------------------------*/
27/*---------------------------------------------------------------------------*/
28
29enum class eTimeLoopEventType
30{
31 BeginEntryPoint,
32 EndEntryPoint,
33 BeginIteration,
34 EndIteration
35};
36
37/*---------------------------------------------------------------------------*/
38/*---------------------------------------------------------------------------*/
39
56
57/*---------------------------------------------------------------------------*/
58/*---------------------------------------------------------------------------*/
59
73{
74 public:
75
76 virtual ~ITimeLoopMng() {}
77
78 public:
79
80 virtual void build() = 0;
81
82 //virtual void initialize() =0;
83
84 public:
85
87 virtual ISubDomain* subDomain() const = 0;
88
90 virtual void execExitEntryPoints() = 0;
91
93 virtual void execBuildEntryPoints() = 0;
94
97 virtual void execInitEntryPoints(bool is_continue) = 0;
98
100 //virtual void execLoadBalanceEntryPoints() =0;
101
104
107
115 virtual void stopComputeLoop(bool is_final_time, bool has_error = false) = 0;
116
118 virtual bool finalTimeReached() const = 0;
119
121 virtual Real cpuTimeUsed() const = 0;
122
125
128
135 virtual void doExecNextEntryPoint(bool& is_last) = 0;
136
139
142
150 virtual int doOneIteration() = 0;
151
161 virtual int doComputeLoop(Integer max_loop = 0) = 0;
162
164
172 virtual void registerTimeLoop(ITimeLoop* time_loop) = 0;
173
203 virtual void setUsedTimeLoop(const String& name) = 0;
205
207 virtual ITimeLoop* usedTimeLoop() const = 0;
208
209 virtual void setBackwardMng(IBackwardMng* backward_mng) = 0;
210
211 virtual IBackwardMng* getBackwardMng() const = 0;
212
224 virtual void goBackward() = 0;
225
231 virtual bool isDoingBackward() = 0;
232
245 virtual void registerActionMeshPartition(IMeshPartitionerBase* mesh_partitioner) = 0;
246
251 virtual void setBackwardSavePeriod(Integer n) = 0;
252
256 virtual void setVerificationActive(bool is_active) = 0;
257
267 virtual void doVerification(const String& name) = 0;
268
272 virtual void timeLoopsName(StringCollection& names) const = 0;
273
275 virtual void timeLoops(TimeLoopCollection& time_loops) const = 0;
276
278 virtual ITimeLoop* createTimeLoop(const String& name) = 0;
279
281 virtual Integer nbLoop() const = 0;
282
288 virtual IObservable* observable(eTimeLoopEventType type) = 0;
289
291 virtual void setStopReason(eTimeLoopStopReason reason) = 0;
292
299 virtual eTimeLoopStopReason stopReason() const = 0;
300};
301
302/*---------------------------------------------------------------------------*/
303/*---------------------------------------------------------------------------*/
304
305} // namespace Arcane
306
307/*---------------------------------------------------------------------------*/
308/*---------------------------------------------------------------------------*/
309
310#endif
Declarations of Arcane's general types.
Interface managing backward strategies.
Interface of a module entry point.
Definition IEntryPoint.h:35
Interface of a mesh partitioner.
Interface of the subdomain manager.
Definition ISubDomain.h:75
Interface for the time loop manager.
virtual EntryPointCollection loopEntryPoints()=0
Returns the list of 'ComputeLoop' type entry points in the time loop.
virtual Integer nbLoop() const =0
Number of compute loops performed.
virtual void timeLoopsName(StringCollection &names) const =0
Returns in names the list of time loop names.
virtual void timeLoops(TimeLoopCollection &time_loops) const =0
Returns in time_loops the list of time loops.
virtual ITimeLoop * createTimeLoop(const String &name)=0
Creates a time loop named name.
virtual int doComputeLoop(Integer max_loop=0)=0
Executes the compute loop.
virtual void execBuildEntryPoints()=0
Executes the build entry points.
virtual IEntryPoint * currentEntryPoint()=0
Returns the entry point currently being executed or 0 if there is none.
virtual EntryPointCollection usedTimeLoopEntryPoints()=0
List of all entry points for the current time loop.
virtual void goBackward()=0
Performs a backward step.
virtual eTimeLoopStopReason stopReason() const =0
Reason for stopping the code.
virtual void setVerificationActive(bool is_active)=0
Positions the state of the verification mode.
virtual void doVerification(const String &name)=0
Performs a verification.
virtual ITimeLoop * usedTimeLoop() const =0
Returns the time loop used.
virtual IEntryPoint * nextEntryPoint()=0
Returns the next entry point to execute or 0 if there is none.
virtual void execOnMeshRefinementEntryPoints()=0
Executes the entry points after refinement.
virtual bool isDoingBackward()=0
True if currently in a backward step.
virtual void execInitEntryPoints(bool is_continue)=0
Executes the initialization entry points.
virtual void stopComputeLoop(bool is_final_time, bool has_error=false)=0
Indicates that the compute loop must stop.
virtual void setStopReason(eTimeLoopStopReason reason)=0
Positions the reason for stopping the code.
virtual void registerTimeLoop(ITimeLoop *time_loop)=0
Registration and selection of the time loop.
virtual void setBackwardSavePeriod(Integer n)=0
Positions the period between two saves for backward step. If this value is null, backward step is dis...
virtual Real cpuTimeUsed() const =0
Returns the CPU time used in seconds.
virtual IObservable * observable(eTimeLoopEventType type)=0
Observable on the instance.
virtual void setUsedTimeLoop(const String &name)=0
Positions the time loop to be executed. Selects the time loop named name as the one to be executed....
virtual ~ITimeLoopMng()
Frees resources.
virtual void registerActionMeshPartition(IMeshPartitionerBase *mesh_partitioner)=0
Schedules a mesh partitioning using the partition tool mesh_partitioner.
virtual int doOneIteration()=0
Starts the execution of a compute loop iteration.
virtual void doExecNextEntryPoint(bool &is_last)=0
virtual void execOnMeshChangedEntryPoints()=0
Executes the entry points after load balancing.
virtual bool finalTimeReached() const =0
Returns true if the final time has been reached.
virtual void execExitEntryPoints()=0
Executes the exit entry points.
virtual ISubDomain * subDomain() const =0
< Returns the sub-domain manager
Interface of a time loop.
Definition ITimeLoop.h:33
-- tab-width: 2; indent-tabs-mode: nil; coding: utf-8-with-signature --
eTimeLoopStopReason
Reason for stopping the code.
@ MaxIterationReached
Stop because maximum number of iterations specified was reached.
@ NoStop
Indicates that the code is not yet in stop mode.
@ FinalTimeReached
Stop because final time was reached.
@ NoReason
No specific reason.
@ Error
Stop due to an error.
Int32 Integer
Type representing an integer.
Collection< String > StringCollection
Collection of strings.
Definition UtilsTypes.h:506
Collection< ITimeLoop * > TimeLoopCollection
Collection of time loops.
double Real
Type representing a real number.
Collection< IEntryPoint * > EntryPointCollection
Collection of entry points.