Arcane  4.1.12.0
User documentation
Loading...
Searching...
No Matches
IMesh.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/* IMesh.h (C) 2000-2024 */
9/* */
10/* Interface of a mesh. */
11/*---------------------------------------------------------------------------*/
12#ifndef ARCANE_CORE_IMESH_H
13#define ARCANE_CORE_IMESH_H
14/*---------------------------------------------------------------------------*/
15/*---------------------------------------------------------------------------*/
16
19#include "arcane/core/IMeshBase.h"
20
21/*---------------------------------------------------------------------------*/
22/*---------------------------------------------------------------------------*/
23
24namespace Arcane
25{
26
27/*---------------------------------------------------------------------------*/
28/*---------------------------------------------------------------------------*/
29
30class IParallelMng;
33class XmlNode;
34class IMeshUtilities;
35class IMeshModifier;
36class IMeshMng;
37class Properties;
40class IUserData;
41class IUserDataList;
42class IGhostLayerMng;
43class IMeshChecker;
44class IMeshCompactMng;
45class MeshPartInfo;
47class MeshHandle;
48class IVariableMng;
49class ItemTypeMng;
51class MeshEventArgs;
52enum class eMeshEventType;
53
54/*---------------------------------------------------------------------------*/
55/*---------------------------------------------------------------------------*/
56
57//INFO: The complete documentation is in Mesh.dox
58class IMesh
59: public IMeshBase
60{
61 public:
62
63 virtual ~IMesh() = default; //<! Releases resources
64
65 public:
66
67 virtual void build() = 0;
68
69 //! Name of the factory used to create the mesh
70 virtual String factoryName() const = 0;
71
72 //! Internal array of mesh elements of type \a type
74
75 //! Node coordinates
77
78 //! Check for the validity of internal mesh structures (internal)
79 virtual void checkValidMesh() = 0;
80
81 /*!
82 * \brief Mesh validity check.
83 *
84 * This is a global check across all subdomains.
85 *
86 * It notably checks that connectivity is consistent between
87 * subdomains.
88 *
89 * The check can be quite CPU intensive.
90 * This method is collective.
91 */
92 virtual void checkValidMeshFull() = 0;
93
94 /*!
95 * \brief Synchronizes all mesh groups and variables.
96 *
97 * This operation is collective
98 */
100
101 public:
102
103 /*! \brief True if the mesh is allocated.
104 *
105 * A mesh is allocated as soon as an entity has been added, by allocateCells(),
106 * or reloadMesh()
107 */
108 virtual bool isAllocated() = 0;
109
110 /*!
111 * \brief Counter indicating the time of the last mesh modification.
112 *
113 * This counter increases with every call to endUpdate(). It is 0 upon
114 * initialization. It allows, for example, checking if the mesh topology
115 * has changed between two parts of the code.
116 */
117 virtual Int64 timestamp() = 0;
118
119 public:
120
121 //! Associated subdomain
122 ARCANE_DEPRECATED_LONG_TERM("Y2020: Do not use this method. Try to get 'ISubDomain' from another way")
123 virtual ISubDomain* subDomain() = 0;
124
125 public:
126
127 //! Parallelism manager
128 virtual IParallelMng* parallelMng() = 0;
129
130 public:
131
132 //! Connectivity descriptor
133 /*! This object allows reading/modifying connectivity */
135
136 //! AMR
137 //! Group of all active cells
139
140 //! Group of all active cells specific to the domain
142
143 //! Group of all cells of level \p level
144 virtual CellGroup allLevelCells(const Integer& level) = 0;
145
146 //! Group of all cells specific to the domain of level \p level
147 virtual CellGroup ownLevelCells(const Integer& level) = 0;
148
149 //! Group of all active faces
151
152 //! Group of all active faces specific to the domain.
154
155 //! Group of all active faces
157
158 //! Group of all active faces on the boundary.
160
161 public:
162
163 //! List of groups
165
166 //! Returns the group with name \a name or a null group if none exists.
167 virtual ItemGroup findGroup(const String& name) = 0;
168
169 //! Destroys all groups of all families.
170 virtual void destroyGroups() = 0;
171
172 public:
173
174 virtual MeshItemInternalList* meshItemInternalList() = 0;
175
176 public:
177
178 virtual void updateGhostLayers(bool remove_old_ghost) = 0;
179
180 /*!
181 * \internal
182 * \deprecated Use IMesh::cellFamily()->policyMng()->createSerializer() instead.
183 */
184 ARCANE_DEPRECATED_240 virtual void serializeCells(ISerializer* buffer, Int32ConstArrayView cells_local_id) = 0;
185
186 //! Prepares the instance for dumping
187 virtual void prepareForDump() = 0;
188
189 //! Initializes variables with values from the configuration file (internal)
190 virtual void initializeVariables(const XmlNode& init_node) = 0;
191
192 /*!
193 * \brief Sets the mesh check level.
194 *
195 * 0 - tests disabled
196 * 1 - partial tests, after endUpdate()
197 * 2 - full tests, after endUpdate()
198 */
199 virtual void setCheckLevel(Integer level) = 0;
200
201 //! Current check level
202 virtual Integer checkLevel() const = 0;
203
204 //! Indicates if the mesh is dynamic (can evolve)
205 virtual bool isDynamic() const = 0;
206
207 //!
208 virtual bool isAmrActivated() const = 0;
209
210 public:
211
212 //! \name Management of semi-conforming interfaces
213 //@{
214 //! Determines the semi-conforming interfaces
215 virtual void computeTiedInterfaces(const XmlNode& mesh_node) = 0;
216
217 //! True if semi-conforming interfaces exist in the mesh
218 virtual bool hasTiedInterface() = 0;
219
220 //! List of semi-conforming interfaces
222 //@}
223
224 //! Manager of partitioning constraints associated with this mesh.
226
227 public:
228
229 //! Associated utility functions interface
230 virtual IMeshUtilities* utilities() = 0;
231
232 //! Properties associated with this mesh
233 virtual Properties* properties() = 0;
234
235 public:
236
237 //! Associated modifier interface
238 virtual IMeshModifier* modifier() = 0;
239
240 public:
241
242 /*!
243 * \brief Node coordinates.
244 *
245 * Returns a native array (not shared like SharedVariable) of coordinates.
246 * This call is only valid on a primary mesh (not a sub-mesh).
247 */
249
250 //@{ @name Sub-mesh interface
251 /*!
252 * \brief Defines the parent mesh and group.
253 *
254 * Must be set on the mesh being constructed _before_ the build() phase
255 */
256 virtual void defineParentForBuild(IMesh* mesh, ItemGroup group) = 0;
257
258 /*!
259 * \brief Access to the parent mesh.
260 *
261 * Returns \a nullptr if the mesh does not have a parent mesh.
262 */
263 virtual IMesh* parentMesh() const = 0;
264
265 /*!
266 * \brief Parent group.
267 *
268 * Returns the null group if the mesh has no parent.
269 */
270 virtual ItemGroup parentGroup() const = 0;
271
272 //! Adds a sub-mesh to the parent mesh
273 virtual void addChildMesh(IMesh* sub_mesh) = 0;
274
275 //! List of sub-meshes of the current mesh
276 virtual MeshCollection childMeshes() const = 0;
277 //@}
278
279 public:
280
281 /*!
282 * \brief Indicates if the instance is a primary mesh.
283 *
284 * To be a primary mesh, the instance must
285 * be convertible to an IPrimaryMesh
286 * and not be a sub-mesh, meaning it
287 * does not have a parent mesh (parentMesh()==nullptr).
288 */
289 virtual bool isPrimaryMesh() const = 0;
290
291 /*!
292 * \brief Returns the instance in the form of an IPrimaryMesh.
293 *
294 * Throws a BadCastException if the instance
295 * is not of type IPrimaryMesh and if isPrimaryMesh() is false.
296 */
298
299 public:
300
301 //! Associated user data manager
303
304 //! Associated user data manager
305 virtual const IUserDataList* userDataList() const = 0;
306
307 public:
308
309 //! Associated ghost layer manager
310 virtual IGhostLayerMng* ghostLayerMng() const = 0;
311
312 //! Unique ID numbering manager
313 virtual IMeshUniqueIdMng* meshUniqueIdMng() const = 0;
314
315 //! Checker interface.
316 virtual IMeshChecker* checker() const = 0;
317
318 //! Mesh part information
319 virtual const MeshPartInfo& meshPartInfo() const = 0;
320
321 //! check if the network itemFamily dependencies is activated
322 virtual bool useMeshItemFamilyDependencies() const = 0;
323
324 //! Family network interface (connected families)
326
327 //! Interface of the indexed incremental connectivity manager.
329
330 //! Mesh characteristics
331 virtual const MeshKind meshKind() const = 0;
332
333 public:
334
335 //! Observable for an event
337
338 public:
339
340 //! \internal
341 virtual IMeshCompactMng* _compactMng() = 0;
342
343 /*!
344 * \internal
345 * \brief Connectivity usage policy
346 */
347 virtual InternalConnectivityPolicy _connectivityPolicy() const = 0;
348
349 public:
350
351 //! Associated mesh manager
352 virtual IMeshMng* meshMng() const = 0;
353
354 //! Associated variable manager
355 virtual IVariableMng* variableMng() const = 0;
356
357 //! Associated entity type manager
358 virtual ItemTypeMng* itemTypeMng() const = 0;
359
360 public:
361
362 /*!
363 * \brief Recalculates synchronization information.
364 *
365 * This operation is collective.
366 *
367 * Normally this is done automatically by %Arcane when it is
368 * necessary. However, it can happen following certain internal modifications
369 * that the information for synchronization needs to be manually updated.
370 */
371 virtual void computeSynchronizeInfos() = 0;
372
373 public:
374
375 //! Internal Arcane API
376 virtual IMeshInternal* _internalApi() = 0;
377};
378
379/*---------------------------------------------------------------------------*/
380/*---------------------------------------------------------------------------*/
381
382} // End namespace Arcane
383
384/*---------------------------------------------------------------------------*/
385/*---------------------------------------------------------------------------*/
386
387#endif
Declarations of Arcane's general types.
Interface of a builder for "extraordinary" ghost cells.
Interface of the manager for indexed incremental item connectivities.
virtual String name() const =0
Mesh name.
Interface for mesh verification methods.
Interface for managing the compaction of mesh families.
Mesh manager interface.
Definition IMeshMng.h:41
Mesh modification interface.
Interface of a mesh partitioning constraint manager.
Interface of a class providing utility functions on meshes.
virtual void checkValidMeshFull()=0
Mesh validity check.
virtual ItemGroup parentGroup() const =0
Parent group.
virtual VariableNodeReal3 & nodesCoordinates()=0
Node coordinates.
virtual IIndexedIncrementalItemConnectivityMng * indexedConnectivityMng()=0
Interface of the indexed incremental connectivity manager.
virtual IParallelMng * parallelMng()=0
Parallelism manager.
virtual IMeshUniqueIdMng * meshUniqueIdMng() const =0
Unique ID numbering manager.
virtual MeshCollection childMeshes() const =0
List of sub-meshes of the current mesh.
virtual IMeshChecker * checker() const =0
Checker interface.
virtual ItemInternalList itemsInternal(eItemKind)=0
Internal array of mesh elements of type type.
virtual void initializeVariables(const XmlNode &init_node)=0
Initializes variables with values from the configuration file (internal).
virtual IMeshModifier * modifier()=0
Associated modifier interface.
virtual void defineParentForBuild(IMesh *mesh, ItemGroup group)=0
Defines the parent mesh and group.
virtual FaceGroup outerActiveFaces()=0
Group of all active faces on the boundary.
virtual bool useMeshItemFamilyDependencies() const =0
check if the network itemFamily dependencies is activated
virtual VariableScalarInteger connectivity()=0
Connectivity descriptor.
virtual void destroyGroups()=0
Destroys all groups of all families.
virtual IMeshUtilities * utilities()=0
Associated utility functions interface.
virtual TiedInterfaceCollection tiedInterfaces()=0
List of semi-conforming interfaces.
virtual IMesh * parentMesh() const =0
Access to the parent mesh.
virtual CellGroup allLevelCells(const Integer &level)=0
Group of all cells of level level.
virtual void computeSynchronizeInfos()=0
Recalculates synchronization information.
virtual SharedVariableNodeReal3 sharedNodesCoordinates()=0
Node coordinates.
virtual IUserDataList * userDataList()=0
Associated user data manager.
virtual FaceGroup innerActiveFaces()=0
Group of all active faces.
virtual void synchronizeGroupsAndVariables()=0
Synchronizes all mesh groups and variables.
virtual ItemGroupCollection groups()=0
List of groups.
virtual ItemGroup findGroup(const String &name)=0
Returns the group with name name or a null group if none exists.
virtual String factoryName() const =0
Name of the factory used to create the mesh.
virtual void setCheckLevel(Integer level)=0
Sets the mesh check level.
virtual IMeshInternal * _internalApi()=0
Internal Arcane API.
virtual CellGroup allActiveCells()=0
ARCANE_DEPRECATED_LONG_TERM("Y2020: Do not use this method. Try to get 'ISubDomain' from another way") virtual ISubDomain *subDomain()=0
Associated subdomain.
virtual FaceGroup allActiveFaces()=0
Group of all active faces.
virtual Int64 timestamp()=0
Counter indicating the time of the last mesh modification.
virtual EventObservable< const MeshEventArgs & > & eventObservable(eMeshEventType type)=0
Observable for an event.
virtual const MeshKind meshKind() const =0
Mesh characteristics.
virtual ItemTypeMng * itemTypeMng() const =0
Associated entity type manager.
virtual void prepareForDump()=0
Prepares the instance for dumping.
virtual IMeshPartitionConstraintMng * partitionConstraintMng()=0
Manager of partitioning constraints associated with this mesh.
virtual CellGroup ownActiveCells()=0
Group of all active cells specific to the domain.
virtual IMeshMng * meshMng() const =0
Associated mesh manager.
virtual bool isAllocated()=0
True if the mesh is allocated.
virtual CellGroup ownLevelCells(const Integer &level)=0
Group of all cells specific to the domain of level level.
virtual IPrimaryMesh * toPrimaryMesh()=0
Returns the instance in the form of an IPrimaryMesh.
virtual IGhostLayerMng * ghostLayerMng() const =0
Associated ghost layer manager.
virtual bool isDynamic() const =0
Indicates if the mesh is dynamic (can evolve).
virtual void checkValidMesh()=0
Check for the validity of internal mesh structures (internal).
virtual Properties * properties()=0
Properties associated with this mesh.
virtual FaceGroup ownActiveFaces()=0
Group of all active faces specific to the domain.
virtual void computeTiedInterfaces(const XmlNode &mesh_node)=0
Determines the semi-conforming interfaces.
virtual void addChildMesh(IMesh *sub_mesh)=0
Adds a sub-mesh to the parent mesh.
virtual bool isPrimaryMesh() const =0
Indicates if the instance is a primary mesh.
virtual IItemFamilyNetwork * itemFamilyNetwork()=0
Family network interface (connected families).
virtual Integer checkLevel() const =0
Current check level.
virtual IVariableMng * variableMng() const =0
Associated variable manager.
virtual bool hasTiedInterface()=0
True if semi-conforming interfaces exist in the mesh.
virtual const MeshPartInfo & meshPartInfo() const =0
Mesh part information.
Interface of the parallelism manager for a subdomain.
Interface of a particle exchanger.
Interface of the subdomain manager.
Definition ISubDomain.h:75
Interface of a list that manages user data.
Interface for user data attached to another object.
Definition IUserData.h:33
Variable manager interface.
Mesh entity group.
Definition ItemGroup.h:51
Mesh entity type manager.
Definition ItemTypeMng.h:66
Arguments for mesh events.
Definition MeshEvents.h:44
Handle on a mesh.
Definition MeshHandle.h:48
Characteristics of a mesh.
Definition MeshKind.h:113
Information about a partitioned mesh.
List of properties.
Definition Properties.h:65
Node of a DOM tree.
Definition XmlNode.h:51
ItemGroupT< Cell > CellGroup
Group of cells.
Definition ItemTypes.h:184
ItemGroupT< Face > FaceGroup
Group of faces.
Definition ItemTypes.h:179
MeshVariableScalarRefT< Node, Real3 > VariableNodeReal3
Coordinate type quantity at node.
VariableRefScalarT< Integer > VariableScalarInteger
Scalar variable of integer type.
-- tab-width: 2; indent-tabs-mode: nil; coding: utf-8-with-signature --
Collection< ItemGroup > ItemGroupCollection
Collection of mesh item groups.
std::int64_t Int64
Signed integer type of 64 bits.
Int32 Integer
Type representing an integer.
ConstArrayView< Int32 > Int32ConstArrayView
C equivalent of a 1D array of 32-bit integers.
Definition UtilsTypes.h:482
ConstArrayView< ItemInternal * > ItemInternalList
Type of the internal list of entities.
Definition ItemTypes.h:466
eMeshEventType
Events generated by IMesh.
Definition MeshEvents.h:30
SharedMeshVariableScalarRefT< Node, Real3 > SharedVariableNodeReal3
Quantity at the node of coordinate type.
eItemKind
Mesh entity type.
Collection< IMesh * > MeshCollection
Collection of meshes.
InternalConnectivityPolicy
Connectivity usage policy.
Definition ItemTypes.h:517
Collection< ITiedInterface * > TiedInterfaceCollection
Collection of tied interfaces.