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