Arcane  4.1.12.0
Developer documentation
Loading...
Searching...
No Matches
ModuleMaster.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/* ModuleMaster.h (C) 2000-2025 */
9/* */
10/* Master Module. */
11/*---------------------------------------------------------------------------*/
12#ifndef ARCANE_CORE_MODULEMASTER_H
13#define ARCANE_CORE_MODULEMASTER_H
14/*---------------------------------------------------------------------------*/
15/*---------------------------------------------------------------------------*/
16
17#include "arcane/utils/VersionInfo.h"
18
19#include "arcane/core/IModuleMaster.h"
20#include "arcane/core/AbstractModule.h"
22#include "arcane/core/CommonVariables.h"
23
24/*---------------------------------------------------------------------------*/
25/*---------------------------------------------------------------------------*/
26
27namespace Arcane
28{
29
30/*---------------------------------------------------------------------------*/
31/*---------------------------------------------------------------------------*/
32
42class ARCANE_CORE_EXPORT ModuleMaster
43: public AbstractModule
44, public CommonVariables
45, public IModuleMaster
46{
47 public:
48
50 explicit ModuleMaster(const ModuleBuildInfo&);
51
53 ~ModuleMaster() override;
54
55 public:
56
58 VersionInfo versionInfo() const override { return VersionInfo(1, 0, 0); }
59
62
64 IModule* toModule() override { return this; }
65
67 CommonVariables* commonVariables() override { return this; }
68
69 void addTimeLoopService(ITimeLoopService* tls) override;
70
72 void dumpStandardCurves() override;
73
74 public:
75
77
83 void timeLoopBegin();
84
86
91 void timeLoopEnd();
92
94 void masterInit();
95
97
98 void masterStartInit();
99
101 void masterContinueInit();
102
103 protected:
104
106 // note: IFPEN has a notion of event. We can know the next
107 // time and time step. If we apply the default incrementation,
108 // we get rounding errors...
109 virtual void timeIncrementation();
110
112 // note: IFPEN desires displays configurable per application
113 virtual void timeStepInformation();
114
115 void _masterBeginLoop();
116 void _masterEndLoop();
117 void _masterStartInit();
118 void _masterContinueInit();
119 void _masterLoopExit();
120 void _masterMeshChanged();
121 void _masterRestore();
122
123 protected:
124
127
130
133
136
139
141 bool m_is_first_loop = true;
142
143 Real m_thm_mem_used = 0.0;
144 Real m_thm_diff_cpu = 0.0;
145 Real m_thm_global_cpu_time = 0.0;
146 Real m_thm_diff_elapsed = 0.0;
147 Real m_thm_global_elapsed_time = 0.0;
148 Real m_thm_global_time = 0.0;
149
150 bool m_has_thm_dump_at_iteration = false;
151
152 private:
153
154 void _dumpTimeInfo();
155};
156
157/*---------------------------------------------------------------------------*/
158/*---------------------------------------------------------------------------*/
159
160} // namespace Arcane
161
162/*---------------------------------------------------------------------------*/
163/*---------------------------------------------------------------------------*/
164
165#endif
AbstractModule(const ModuleBuildInfo &)
Constructor from a ModuleBuildInfo.
CommonVariables(IModule *c)
Constructs the references of the common variables for the module c.
Interface of the main module.
Interface of a module.
Definition IModule.h:40
Interface of a service operating during the time loop.
Information for building a module.
CaseOptionsMain * m_case_options_main
Instance of module options.
bool m_is_first_loop
Indicates if we are in the first execution loop.
Real m_old_cpu_time
CPU time value at the last iteration.
ModuleMaster(const ModuleBuildInfo &)
Constructor.
IModule * toModule() override
Conversion to IModule.
Real m_old_elapsed_time
Clock time value at the last iteration.
CommonVariables * commonVariables() override
Access to 'common' variables shared between all services and modules.
VersionInfo versionInfo() const override
Module version.
CaseOptionsMain * caseoptions() override
Access to module options.
UniqueArray< ITimeLoopService * > m_timeloop_services
List of time loop services.
Integer m_nb_loop
Number of calculation loops performed.
1D data vector with value semantics (STL style).
Information about a version.
Definition VersionInfo.h:47
-- tab-width: 2; indent-tabs-mode: nil; coding: utf-8-with-signature --
Int32 Integer
Type representing an integer.
double Real
Type representing a real number.