Arcane  4.1.12.0
User documentation
Loading...
Searching...
No Matches
IMainFactory.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/* IMainFactory.h (C) 2000-2025 */
9/* */
10/* Interface of Arcane's AbstractFactory. */
11/*---------------------------------------------------------------------------*/
12#ifndef ARCANE_CORE_IMAINFACTORY_H
13#define ARCANE_CORE_IMAINFACTORY_H
14/*---------------------------------------------------------------------------*/
15/*---------------------------------------------------------------------------*/
16
18
19/*---------------------------------------------------------------------------*/
20/*---------------------------------------------------------------------------*/
21
22namespace Arcane
23{
24
25/*---------------------------------------------------------------------------*/
26/*---------------------------------------------------------------------------*/
27
28class IBase;
29class ISubDomain;
30class ApplicationInfo;
31class IArcaneMain;
33class IApplication;
34class IRegistry;
35class IVariableMng;
36class IModuleMng;
37class IEntryPointMng;
38class ITimeHistoryMng;
39class ICaseMng;
40class ICaseDocument;
41class ITimerMng;
42class ITimeLoopMng;
43class ITimeLoop;
44class IIOMng;
45class IServiceMng;
46class IServiceLoader;
48class IMesh;
49class IDataFactory;
50class ITimeStats;
51class IParallelMng;
52class ItemGroup;
53class IPrimaryMesh;
54class ITraceMngPolicy;
55class IModuleMaster;
56class ILoadBalanceMng;
57class ICheckpointMng;
58class IPropertyMng;
59class IDataFactoryMng;
60
61/*---------------------------------------------------------------------------*/
62/*---------------------------------------------------------------------------*/
63
64/*!
65 * \internal
66 * \brief Factory for Arcane classes.
67 *
68 It is a virtual class containing methods to manufacture
69 the different instances of the architecture managers
70 (Design Pattern: AbstractFactory).
71
72 Arcane provides default factories for most managers
73 (IApplication, IParallelSuperMng, ...). However, the class managing the code must
74 be specified by implementing the createArcaneMain() method in a
75 derived class.
76
77 The general entry point of the code is achieved by calling the function
78 arcaneMain().
79
80 For example, if we define a class <tt>ConcreteMainFactory</tt> that
81 derives from IMainFactory, we run the code as follows:
82
83 * \code
84 * int
85 * main(int argc,char** argv)
86 * {
87 * ApplicationInfo exe_info = ... // Creation of executable info.
88 * ConcreteMainFactory cmf; // Creation of the factory
89 * return IMainFactory::arcaneMain(exe_info,&cmf);
90 * }
91 * \endcode
92 */
94{
95 public:
96
97 virtual ~IMainFactory() {} //!< Releases resources.
98
99 public:
100 public:
101
102 //! Creates an instance of IArcaneMain
103 virtual IArcaneMain* createArcaneMain(const ApplicationInfo& app_info) = 0;
104
105 public:
106
107 //! Creates an instance of a supervisor
109
110 //! Creates an instance of the variable manager
112
113 //! Creates an instance of the module manager
115
116 //! Creates an instance of the entry point manager
118
119 //! Creates an instance of the time history manager
121
122 //! Creates an instance of the case manager
124
125 //! Creates an instance of a case document
127
128 //! Creates an instance of a case document for a given language \a lang
130
131 //! Creates an instance of a case document
133
134 /*!
135 * \brief Creates an instance of execution time statistics.
136 *
137 * Use the overloaded createTimeStats(ITimerMng*,ITraceMng*,const String& name).
138 */
139 virtual ARCANE_DEPRECATED_116 ITimeStats* createTimeStats(ISubDomain*) = 0;
140
141 //! Creates an instance of execution time statistics
142 virtual ITimeStats* createTimeStats(ITimerMng* tim, ITraceMng* trm, const String& name) = 0;
143
144 //! Creates an instance of the time loop manager
146
147 //! Creates a time loop named \a name
148 virtual ITimeLoop* createTimeLoop(IApplication* sm, const String& name) = 0;
149
150 //! Creates an instance of the I/O manager
152
153 //! Creates an instance of the I/O manager for the parallelism manager \a pm
154 virtual IIOMng* createIOMng(IParallelMng* pm) = 0;
155
156 //! Creates an instance of the service loader
158
159 //! Creates an instance of the service manager
161
162 //! Creates an instance of the checkpoint manager
164
165 //! Creates an instance of the property manager
166 ARCCORE_DEPRECATED_2020("Use createPropertyMngReference() instead")
168
169 //! Creates an instance of the property manager
171
172 /*!
173 * \brief Creates or retrieves a mesh.
174 *
175 * Creates or retrieves a mesh named \a name for the sub-domain \a sub_domain.
176 *
177 * If the sub-domain already has a mesh with the name \a name,
178 * the latter is returned.
179 */
180 virtual IPrimaryMesh* createMesh(ISubDomain* sub_domain, const String& name) = 0;
181
182 /*!
183 * \brief Creates or retrieves a mesh.
184 *
185 * Creates or retrieves a mesh named \a name for the sub-domain \a sub_domain.
186 *
187 * If the sub-domain already has a mesh with the name \a name,
188 * the latter is returned.
189 */
190 ARCANE_DEPRECATED_REASON("Y2023: Use createMesh(..., eMeshAMRKind amr_type) instead")
191 virtual IPrimaryMesh* createMesh(ISubDomain* sub_domain, const String& name, bool is_amr) = 0;
192
193 /*!
194 * \brief Creates or retrieves a mesh.
195 *
196 * Creates or retrieves a mesh named \a name for the sub-domain \a sub_domain.
197 *
198 * If the sub-domain already has a mesh with the name \a name,
199 * the latter is returned.
200 */
201 virtual IPrimaryMesh* createMesh(ISubDomain* sub_domain, const String& name, eMeshAMRKind amr_type) = 0;
202
203 /*!
204 * \brief Creates or retrieves a mesh.
205 *
206 * Creates or retrieves a mesh named \a name for the sub-domain \a sub_domain
207 * associated with the parallelism manager \a pm. If the sub-domain already has
208 * a mesh with the name \a name, the latter is returned.
209 *
210 * The parallelism manager must be the same as that of the sub-domain
211 * or derived from it.
212 */
214 const String& name) = 0;
215
216 /*!
217 * \brief Creates or retrieves a mesh.
218 *
219 * Creates or retrieves a mesh named \a name for the sub-domain \a sub_domain
220 * associated with the parallelism manager \a pm. If the sub-domain already has
221 * a mesh with the name \a name, the latter is returned.
222 *
223 * The parallelism manager must be the same as that of the sub-domain
224 * or derived from it.
225 */
226 ARCANE_DEPRECATED_REASON("Y2023: Use createMesh(..., eMeshAMRKind amr_type) instead")
228 const String& name, bool is_amr) = 0;
229
230 /*!
231 * \brief Creates or retrieves a mesh.
232 *
233 * Creates or retrieves a mesh named \a name for the sub-domain \a sub_domain
234 * associated with the parallelism manager \a pm. If the sub-domain already has
235 * a mesh with the name \a name, the latter is returned.
236 *
237 * The parallelism manager must be the same as that of the sub-domain
238 * or derived from it.
239 */
241 const String& name, eMeshAMRKind amr_type) = 0;
242
243 /*!
244 * \brief Creates a sub-mesh for the mesh \a mesh, named \a name.
245 *
246 * The sub-mesh is initialized with the items of the group \a group.
247 * Currently, this group cannot be a complete group (isAllItems())
248 * nor a calculated group (if not incremental).
249 */
250 virtual IMesh* createSubMesh(IMesh* mesh, const ItemGroup& group, const String& name) = 0;
251
252 //! Creates a factory for data
253 ARCCORE_DEPRECATED_2020("Use createDataFactoryMngRef() instead")
255
256 //! Creates a factory manager for data
258
259 //! Creates a manager for accelerators
261
262 /*!
263 * \brief Creates a trace manager.
264 *
265 * The returned instance must be initialized via an ITraceMngPolicy.
266 */
267 virtual ITraceMng* createTraceMng() = 0;
268
269 /*!
270 * \brief Creates a configuration manager for a trace manager.
271 */
273
274 /*!
275 * \brief Creates the master module for the sub-domain \a sd.
276 */
278
279 /*!
280 * \brief Creates a description manager for load balancing.
281 */
283
284 private:
285};
286
287/*---------------------------------------------------------------------------*/
288/*---------------------------------------------------------------------------*/
289
290} // End namespace Arcane
291
292/*---------------------------------------------------------------------------*/
293/*---------------------------------------------------------------------------*/
294
295#endif
Declarations of Arcane's general types.
Application information.
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 of the input/output manager.
Definition IIOMng.h:37
Interface for registering variables for load balancing.
virtual ITraceMng * createTraceMng()=0
Creates a trace manager.
virtual Ref< IPropertyMng > createPropertyMngReference(ISubDomain *)=0
Creates an instance of the property manager.
virtual IServiceMng * createServiceMng(IBase *)=0
Creates an instance of the service manager.
virtual ITraceMngPolicy * createTraceMngPolicy(IApplication *app)=0
Creates a configuration manager for a trace manager.
virtual Ref< IDataFactoryMng > createDataFactoryMngRef(IApplication *)=0
Creates a factory manager for data.
virtual IEntryPointMng * createEntryPointMng(ISubDomain *)=0
Creates an instance of the entry point manager.
virtual ICheckpointMng * createCheckpointMng(ISubDomain *)=0
Creates an instance of the checkpoint manager.
virtual ITimeLoopMng * createTimeLoopMng(ISubDomain *)=0
Creates an instance of the time loop manager.
virtual IApplication * createApplication(IArcaneMain *)=0
Creates an instance of a supervisor.
virtual ITimeHistoryMng * createTimeHistoryMng(ISubDomain *)=0
Creates an instance of the time history manager.
virtual IPrimaryMesh * createMesh(ISubDomain *sub_domain, const String &name)=0
Creates or retrieves a mesh.
virtual IPropertyMng * createPropertyMng(ISubDomain *)=0
Creates an instance of the property manager.
virtual ~IMainFactory()
Releases resources.
virtual ARCANE_DEPRECATED_116 ITimeStats * createTimeStats(ISubDomain *)=0
Creates an instance of execution time statistics.
virtual IIOMng * createIOMng(IParallelMng *pm)=0
Creates an instance of the I/O manager for the parallelism manager pm.
virtual IMesh * createSubMesh(IMesh *mesh, const ItemGroup &group, const String &name)=0
Creates a sub-mesh for the mesh mesh, named name.
virtual IServiceLoader * createServiceLoader()=0
Creates an instance of the service loader.
virtual IDataFactory * createDataFactory(IApplication *)=0
Creates a factory for data.
virtual ILoadBalanceMng * createLoadBalanceMng(ISubDomain *sd)=0
Creates a description manager for load balancing.
virtual ITimeStats * createTimeStats(ITimerMng *tim, ITraceMng *trm, const String &name)=0
Creates an instance of execution time statistics.
virtual ICaseMng * createCaseMng(ISubDomain *)=0
Creates an instance of the case manager.
virtual ICaseDocument * createCaseDocument(IApplication *)=0
Creates an instance of a case document.
virtual IModuleMng * createModuleMng(ISubDomain *)=0
Creates an instance of the module manager.
virtual IVariableMng * createVariableMng(ISubDomain *)=0
Creates an instance of the variable manager.
virtual ITimeLoop * createTimeLoop(IApplication *sm, const String &name)=0
Creates a time loop named name.
virtual IModuleMaster * createModuleMaster(ISubDomain *sd)=0
Creates the master module for the sub-domain sd.
virtual IArcaneMain * createArcaneMain(const ApplicationInfo &app_info)=0
Creates an instance of IArcaneMain.
virtual Ref< IAcceleratorMng > createAcceleratorMngRef(ITraceMng *tm)=0
Creates a manager for accelerators.
virtual ICaseDocument * createCaseDocument(IApplication *, const String &lang)=0
Creates an instance of a case document for a given language lang.
virtual IIOMng * createIOMng(IApplication *)=0
Creates an instance of the I/O manager.
virtual ICaseDocument * createCaseDocument(IApplication *, IXmlDocumentHolder *doc)=0
Creates an instance of a case document.
Module manager interface.
Definition IModuleMng.h:39
Interface of the parallelism manager for a subdomain.
Interface of the property manager.
Service manager interface.
Definition IServiceMng.h:32
Interface of the subdomain manager.
Definition ISubDomain.h:75
Class managing a history of values.
Interface for the time loop manager.
Interface of a time loop.
Definition ITimeLoop.h:33
Interface of a timer manager.
Definition ITimerMng.h:50
Interface for the configuration manager of a trace manager.
Variable manager interface.
Manager of a DOM document.
Mesh entity group.
Definition ItemGroup.h:51
Reference to an instance.
-- tab-width: 2; indent-tabs-mode: nil; coding: utf-8-with-signature --
eMeshAMRKind
AMR mesh type.
Definition MeshKind.h:49