Arcane  4.1.12.0
User documentation
Loading...
Searching...
No Matches
ISubDomain.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/* ISubDomain.h (C) 2000-2025 */
9/* */
10/* Interface of a subdomain. */
11/*---------------------------------------------------------------------------*/
12#ifndef ARCANE_CORE_ISUBDOMAIN_H
13#define ARCANE_CORE_ISUBDOMAIN_H
14/*---------------------------------------------------------------------------*/
15/*---------------------------------------------------------------------------*/
16
18
19#include "arcane/core/IBase.h"
20
21/*---------------------------------------------------------------------------*/
22/*---------------------------------------------------------------------------*/
23
24namespace Arcane
25{
26
27/*---------------------------------------------------------------------------*/
28/*---------------------------------------------------------------------------*/
29
30class IVariableMng;
31class IModuleMng;
32class IServiceMng;
33class IEntryPointMng;
34class IModule;
35class IMeshIOService;
36class IMesh;
37class IMeshMng;
38class ApplicationInfo;
39class IIOMng;
40class ITimeLoopMng;
41class CaseOptionsMain;
42class IParallelMng;
43class IThreadMng;
44class IDirectory;
45class ITimeHistoryMng;
46class ICaseMng;
47class IInterfaceMng;
48class ITimerMng;
49class ITimeStats;
50class IRessourceMng;
51class CommonVariables;
52class IMainFactory;
53class ICaseDocument;
54class XmlNode;
55class IMemoryInfo;
56class IObservable;
60class ILoadBalanceMng;
61class IModuleMaster;
62class ICheckpointMng;
63class IPropertyMng;
64class IConfiguration;
65class MeshHandle;
66
67/*---------------------------------------------------------------------------*/
68/*---------------------------------------------------------------------------*/
69
70/*!
71 * \brief Interface of the subdomain manager.
72 */
73class ARCANE_CORE_EXPORT ISubDomain
74: public IBase
75{
76 protected:
77
78 virtual ~ISubDomain() {} //!< Frees resources.
79
80 public:
81
82 virtual void destroy() = 0;
83
84 public:
85
86 //! Main factory.
87 virtual IMainFactory* mainFactory() = 0;
88
89 //! Session
90 virtual ISession* session() const = 0;
91
92 //! Application
93 virtual IApplication* application() = 0;
94
95 //! Returns the variable manager
96 virtual IVariableMng* variableMng() = 0;
97
98 //! Returns the module manager
99 virtual IModuleMng* moduleMng() = 0;
100
101 //! Returns the entry point manager
103
104 //! Returns the parallelism manager
105 virtual IParallelMng* parallelMng() = 0;
106
107 /*!
108 * \brief Returns the parallelism manager for all replicas.
109 *
110 * Generally, parallelMng() must be used. This manager
111 * is essentially used to perform operations on all
112 * subdomains and their replicas. If there is no replication,
113 * this manager is the same as parallelMng().
114 */
116
117 //! Returns the thread manager
118 virtual IThreadMng* threadMng() = 0;
119
120 //! Returns the history manager
122
123 //! Returns the time loop manager
124 virtual ITimeLoopMng* timeLoopMng() = 0;
125
126 //! Returns the I/O manager.
127 virtual IIOMng* ioMng() = 0;
128
129 //! Returns the dataset manager.
130 virtual ICaseMng* caseMng() = 0;
131
132 //! Returns the timer manager
133 virtual ITimerMng* timerMng() const = 0;
134
135 //! Protection manager
136 virtual ICheckpointMng* checkpointMng() const = 0;
137
138 //! Property manager
139 virtual IPropertyMng* propertyMng() const = 0;
140
141 //! Execution time statistics
142 virtual ITimeStats* timeStats() const = 0;
143
144 //! Memory information manager
145 virtual IMemoryInfo* memoryInfo() const = 0;
146
147 //! Subdomain unit system.
149
150 //! Returns the load balancing manager.
152
153 //! Returns the mesh manager.
154 virtual IMeshMng* meshMng() const = 0;
155
156 //! Module master interface.
157 virtual IModuleMaster* moduleMaster() const = 0;
158
159 //! Associated configuration.
160 virtual const IConfiguration* configuration() const = 0;
161
162 //! Associated configuration.
164
165 //! Associated accelerator manager
167
168 public:
169
170 //! Subdomain ID associated with this manager.
171 virtual Int32 subDomainId() const = 0;
172
173 //! Total number of subdomains
174 virtual Int32 nbSubDomain() const = 0;
175
176 //! Reads the mesh information from the dataset
177 virtual void readCaseMeshes() = 0;
178
179 /*!
180 * \internal
181 * \brief Sets a flag indicating that a
182 * restart is being performed.
183 *
184 * This method must be called before allocating the mesh (allocateMeshes()).
185 */
186 virtual void setIsContinue() = 0;
187
188 //! True if a restart is being performed, false otherwise.
189 virtual bool isContinue() const = 0;
190
191 /*!
192 * \internal
193 * \brief Allocates the instances.
194 *
195 * Mesh instances are simply allocated but do not contain entities.
196 * This method must be called before any other operation involving the mesh,
197 * especially before reading dataset options or reading protections.
198 */
199 virtual void allocateMeshes() = 0;
200
201 /*!
202 * \internal
203 * \brief Reads or re-reads the meshes.
204 *
205 * At startup, the meshes are re-read from the dataset information.
206 * During restart, the meshes are loaded from a protection.
207 * This method must be called after calling allocateMeshes().
208 */
209 virtual void readOrReloadMeshes() = 0;
210
211 /*!
212 * \internal
213 * \brief Initializes variables whose values are specified in
214 * the dataset.
215 */
216 virtual void initializeMeshVariablesFromCaseFile() = 0;
217
218 /*!
219 * \internal
220 * \brief Applies the initialization mesh partitioning.
221 */
222 virtual void doInitMeshPartition() = 0;
223
224 //! Adds a mesh to the subdomain
225 ARCCORE_DEPRECATED_2020("Use meshMng()->meshFactoryMng() to create and add mesh")
226 virtual void addMesh(IMesh* mesh) = 0;
227
228 //! List of meshes in the subdomain
229 virtual ConstArrayView<IMesh*> meshes() const = 0;
230
231 /*!
232 * \internal
233 * \brief Executes initialization modules
234 * \deprecated This method does nothing anymore.
235 */
236 virtual ARCANE_DEPRECATED_2018 void doInitModules() = 0;
237
238 //! Executes exit modules
239 virtual void doExitModules() = 0;
240
241 //! Displays information about the instance
242 virtual void dumpInfo(std::ostream&) = 0;
243
244 /*!
245 * \brief Default mesh.
246 *
247 * The default mesh does not exist until the dataset
248 * has been read. It is generally preferable
249 * to use defautMeshHandle() instead.
250 */
251 virtual IMesh* defaultMesh() = 0;
252
253 /*!
254 * \brief Handle for the default mesh.
255 *
256 * This handle always exists even if the associated mesh has not
257 * yet been created.
258 */
259 virtual const MeshHandle& defaultMeshHandle() = 0;
260
261 virtual ARCANE_DEPRECATED IMesh* mesh() = 0;
262
263 /*! \brief Searches for the mesh named \a name.
264 *
265 If the mesh is not found, the method throws an exception
266 if \a throw_exception is \a true or returns 0 if \a throw_exception
267 is \a false.
268 */
269 ARCCORE_DEPRECATED_2019("Use meshMng()->findMeshHandle() instead")
270 virtual IMesh* findMesh(const String& name, bool throw_exception = true) = 0;
271
272 //! Indicates if the session has been initialized.
273 virtual bool isInitialized() const = 0;
274
275 /*!
276 * \internal
277 * \brief Indicates that the subdomain is initialized.
278 */
279 virtual void setIsInitialized() = 0;
280
281 //! Executable information
282 virtual const ApplicationInfo& applicationInfo() const = 0;
283
284 //! Case XML document.
286
287 /*!
288 * \brief Checks if an identifier is valid
289 *
290 \exception ExceptionBadName if \a id is not a valid identifier.
291 */
292 virtual void checkId(const String& where, const String& id) = 0;
293
294 //! Full file path of the dataset
295 virtual const String& caseFullFileName() const = 0;
296
297 //! Case name
298 virtual const String& caseName() const = 0;
299
300 //! Fills \a bytes with the dataset content.
301 virtual void fillCaseBytes(ByteArray& bytes) const = 0;
302
303 /*! \brief Sets the case name.
304 *
305 This method must be called before initialization.
306 */
307 virtual void setCaseName(const String& name) = 0;
308
309 /*!
310 * \brief Sets the initial partitioner.
311 *
312 If this method is not called, the default partitioner
313 is used.
314 *
315 This method must be called before module initialization,
316 for example in construction entry points.
317 *
318 The instance takes ownership of \a partitioner and will destroy it by delete
319 at the end of the calculation.
320 */
321 virtual void setInitialPartitioner(IInitialPartitioner* partitioner) = 0;
322
323 //! General dataset options.
324 virtual const CaseOptionsMain* caseOptionsMain() const = 0;
325
326 //! Base directory for exports.
327 virtual const IDirectory& exportDirectory() const = 0;
328
329 /*! \brief Sets the output path for exports (protections and restarts)
330
331 The directory corresponding to \a dir must exist.
332
333 This method must be called before initialization.
334 */
335 virtual void setExportDirectory(const IDirectory& dir) = 0;
336
337 //! Base directory for exports requiring archiving.
338 virtual const IDirectory& storageDirectory() const = 0;
339
340 /*! \brief Sets the output path for exports requiring archiving.
341
342 This directory allows specifying a directory that can be automatically archived.
343 If it is null, exportDirectory() is used.
344
345 This method must be called before initialization.
346 */
347 virtual void setStorageDirectory(const IDirectory& dir) = 0;
348
349 //! Base directory for listings (logs, execution info).
350 virtual const IDirectory& listingDirectory() const = 0;
351
352 /*! \brief Sets the output path for listing info
353 *
354 The directory corresponding to \a dirname must exist.
355
356 This method must be called before initialization.
357 */
358 virtual void setListingDirectory(const IDirectory& dir) = 0;
359
360 //! Information on standard variables
361 virtual const CommonVariables& commonVariables() const = 0;
362
363 /*!
364 * \brief Dumps internal architecture information.
365 * The information is stored in an XML tree with \a root as the root element.
366 * This information is for internal use by Arcane.
367 */
368 virtual void dumpInternalInfos(XmlNode& elem) = 0;
369
370 /*! \brief Mesh dimension (1D, 2D, or 3D).
371 *
372 * \deprecated Use mesh()->dimension() instead.
373 */
374 virtual Integer ARCANE_DEPRECATED meshDimension() const = 0;
375
376 /*!
377 * \brief Notification before subdomain destruction
378 */
380
381 //! Direct execution service (or null)
382 virtual IDirectExecution* directExecution() const = 0;
383
384 /*!
385 * \brief Sets the direct execution service.
386 *
387 This service must be set during service creation when
388 reading the dataset.
389 */
391};
392
393/*---------------------------------------------------------------------------*/
394/*---------------------------------------------------------------------------*/
395
396} // End namespace Arcane
397
398/*---------------------------------------------------------------------------*/
399/*---------------------------------------------------------------------------*/
400
401#endif
Declarations of Arcane's general types.
Application information.
Common variables of a case.
Constant view of an array of type T.
Application interface.
Interface of the base class for main arcane objects.
Definition IBase.h:32
Case manager interface.
Definition ICaseMng.h:57
Interface of the checkpoint information manager.
Interface for a configuration.
Interface of a direct execution service.
Interface of a class managing a directory.
Definition IDirectory.h:32
Interface of the input/output manager.
Definition IIOMng.h:37
Interface of an initial partitioner.
Interface for registering variables for load balancing.
Mesh manager interface.
Definition IMeshMng.h:41
Module manager interface.
Definition IModuleMng.h:39
Interface of a module.
Definition IModule.h:40
Interface of the parallelism manager for a subdomain.
Interface of the property manager.
Interface of a resource manager.
Service manager interface.
Definition IServiceMng.h:32
Interface for a case execution session.
Definition ISession.h:38
Interface of the subdomain manager.
Definition ISubDomain.h:75
virtual IModuleMng * moduleMng()=0
Returns the module manager.
virtual void checkId(const String &where, const String &id)=0
Checks if an identifier is valid.
virtual IThreadMng * threadMng()=0
Returns the thread manager.
virtual Int32 subDomainId() const =0
Subdomain ID associated with this manager.
virtual const String & caseName() const =0
Case name.
virtual void doExitModules()=0
Executes exit modules.
virtual IIOMng * ioMng()=0
Returns the I/O manager.
virtual const IDirectory & storageDirectory() const =0
Base directory for exports requiring archiving.
virtual const CommonVariables & commonVariables() const =0
Information on standard variables.
virtual IMesh * defaultMesh()=0
Default mesh.
virtual const ApplicationInfo & applicationInfo() const =0
Executable information.
virtual void dumpInfo(std::ostream &)=0
Displays information about the instance.
virtual void setStorageDirectory(const IDirectory &dir)=0
Sets the output path for exports requiring archiving.
virtual IMemoryInfo * memoryInfo() const =0
Memory information manager.
virtual ConstArrayView< IMesh * > meshes() const =0
List of meshes in the subdomain.
virtual Integer ARCANE_DEPRECATED meshDimension() const =0
Mesh dimension (1D, 2D, or 3D).
virtual void dumpInternalInfos(XmlNode &elem)=0
Dumps internal architecture information. The information is stored in an XML tree with root as the ro...
virtual ICheckpointMng * checkpointMng() const =0
Protection manager.
virtual ICaseDocument * caseDocument()=0
Case XML document.
virtual ITimeStats * timeStats() const =0
Execution time statistics.
virtual void setListingDirectory(const IDirectory &dir)=0
Sets the output path for listing info.
virtual ~ISubDomain()
Frees resources.
Definition ISubDomain.h:78
virtual IApplication * application()=0
Application.
virtual IConfiguration * configuration()=0
Associated configuration.
virtual void fillCaseBytes(ByteArray &bytes) const =0
Fills bytes with the dataset content.
virtual IPropertyMng * propertyMng() const =0
Property manager.
virtual IParallelMng * parallelMng()=0
Returns the parallelism manager.
virtual const IConfiguration * configuration() const =0
Associated configuration.
virtual IMeshMng * meshMng() const =0
Returns the mesh manager.
virtual ISession * session() const =0
Session.
virtual const IDirectory & listingDirectory() const =0
Base directory for listings (logs, execution info).
virtual bool isContinue() const =0
True if a restart is being performed, false otherwise.
virtual const String & caseFullFileName() const =0
Full file path of the dataset.
virtual IDirectExecution * directExecution() const =0
Direct execution service (or null).
virtual void setDirectExecution(IDirectExecution *v)=0
Sets the direct execution service.
virtual ITimeLoopMng * timeLoopMng()=0
Returns the time loop manager.
virtual void setExportDirectory(const IDirectory &dir)=0
Sets the output path for exports (protections and restarts).
virtual ITimeHistoryMng * timeHistoryMng()=0
Returns the history manager.
virtual Int32 nbSubDomain() const =0
Total number of subdomains.
virtual IMesh * findMesh(const String &name, bool throw_exception=true)=0
Searches for the mesh named name.
virtual const CaseOptionsMain * caseOptionsMain() const =0
General dataset options.
virtual const IDirectory & exportDirectory() const =0
Base directory for exports.
virtual IModuleMaster * moduleMaster() const =0
Module master interface.
virtual IVariableMng * variableMng()=0
Returns the variable manager.
virtual ITimerMng * timerMng() const =0
Returns the timer manager.
virtual void setCaseName(const String &name)=0
Sets the case name.
virtual IObservable * onDestroyObservable()=0
Notification before subdomain destruction.
virtual void readCaseMeshes()=0
Reads the mesh information from the dataset.
virtual IMainFactory * mainFactory()=0
Main factory.
virtual bool isInitialized() const =0
Indicates if the session has been initialized.
virtual void setInitialPartitioner(IInitialPartitioner *partitioner)=0
Sets the initial partitioner.
virtual IEntryPointMng * entryPointMng()=0
Returns the entry point manager.
virtual IPhysicalUnitSystem * physicalUnitSystem()=0
Subdomain unit system.
virtual const MeshHandle & defaultMeshHandle()=0
Handle for the default mesh.
virtual void addMesh(IMesh *mesh)=0
Adds a mesh to the subdomain.
virtual ICaseMng * caseMng()=0
Returns the dataset manager.
virtual IParallelMng * allReplicaParallelMng() const =0
Returns the parallelism manager for all replicas.
virtual ILoadBalanceMng * loadBalanceMng()=0
Returns the load balancing manager.
virtual IAcceleratorMng * acceleratorMng()=0
Associated accelerator manager.
Interface of a thread manager.
Definition IThreadMng.h:32
Class managing a history of values.
Interface for the time loop manager.
Interface of a timer manager.
Definition ITimerMng.h:50
Variable manager interface.
Handle on a mesh.
Definition MeshHandle.h:48
Node of a DOM tree.
Definition XmlNode.h:51
-- tab-width: 2; indent-tabs-mode: nil; coding: utf-8-with-signature --
Int32 Integer
Type representing an integer.
Array< Byte > ByteArray
Dynamic one-dimensional array of characters.
Definition UtilsTypes.h:121
std::int32_t Int32
Signed integer type of 32 bits.