Arcane  4.1.12.0
Developer documentation
Loading...
Searching...
No Matches
EmptyMesh.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/* EmptyMesh (C) 2000-2024 */
9/* */
10/* Brief code description */
11/*---------------------------------------------------------------------------*/
12/*---------------------------------------------------------------------------*/
13#ifndef ARCANE_EMPTYMESH_H
14#define ARCANE_EMPTYMESH_H
15/*---------------------------------------------------------------------------*/
16/*---------------------------------------------------------------------------*/
17
18#include "arcane/utils/IUserDataList.h"
19#include "arcane/utils/IUserData.h"
20#include "arcane/utils/Collection.h"
21#include "arcane/utils/ITraceMng.h"
22#include "arcane/utils/NotImplementedException.h"
23
24#include "arcane/core/IMesh.h"
27#include "arcane/core/IParallelMng.h"
28#include "arcane/core/MeshItemInternalList.h"
29#include "arcane/core/XmlNode.h"
30#include "arcane/core/IMeshPartitionConstraintMng.h"
31#include "arcane/core/IMeshUtilities.h"
32#include "arcane/core/IMeshModifier.h"
33#include "arcane/core/IMeshChecker.h"
34#include "arcane/core/IMeshCompactMng.h"
35#include "arcane/core/IMeshMng.h"
36#include "arcane/core/IGhostLayerMng.h"
37#include "arcane/core/Properties.h"
38#include "arcane/core/MeshPartInfo.h"
39#include "arcane/core/IItemFamilyNetwork.h"
40#include "arcane/core/IItemFamily.h"
41#include "arcane/core/IVariableMng.h"
42#include "arcane/core/MeshVariableScalarRef.h"
43#include "arcane/core/SharedVariable.h"
44#include "arcane/core/VariableRefScalar.h"
45#include "arcane/core/MeshHandle.h"
46#include "arcane/core/IParticleExchanger.h"
47#include "arcane/core/IExtraGhostCellsBuilder.h"
48
49/*---------------------------------------------------------------------------*/
50/*---------------------------------------------------------------------------*/
51
52namespace Arcane::mesh
53{
54
55/*---------------------------------------------------------------------------*/
56/*---------------------------------------------------------------------------*/
57
58class EmptyMesh
59: public IPrimaryMesh
60{
61
62 public:
63
64 ITraceMng* m_trace_mng;
65
66 explicit EmptyMesh(ITraceMng* trace_mng)
67 : m_trace_mng(trace_mng)
68 {}
69 ~EmptyMesh() override = default;
70
71 private:
72
73 void _error() const { m_trace_mng->fatal() << "Using EmptyMesh"; }
74
75 public:
76
77 MeshHandle handle() const override
78 {
79 _error();
80 return MeshHandle{};
81 }
82
83 // IPrimaryMesh API
84 public:
85
87 {
88 _error();
89 auto var = new VariableNodeReal3{ nullptr };
90 return *var;
91 }
92 void setDimension(Integer) override { _error(); }
93 void reloadMesh() override { _error(); }
94 void allocateCells(Integer, Int64ConstArrayView, bool) override { _error(); }
95 void endAllocate() override { _error(); }
96 void deallocate() override { _error(); }
98 {
99 _error();
100 auto var = new VariableItemInt32{ nullptr };
101 return *var;
102 };
103 void exchangeItems() override { _error(); }
104 void setOwnersFromCells() override { _error(); }
105 void setMeshPartInfo(const MeshPartInfo&) override { _error(); }
106
107 // IMesh API
108 public:
109
110 String name() const override
111 {
112 _error();
113 return String{};
114 }
115 Integer nbNode() override
116 {
117 _error();
118 return -1;
119 }
120 Integer nbEdge() override
121 {
122 _error();
123 return -1;
124 }
125 Integer nbFace() override
126 {
127 _error();
128 return -1;
129 }
130 Integer nbCell() override
131 {
132 _error();
133 return -1;
134 }
136 {
137 _error();
138 return -1;
139 }
140 ITraceMng* traceMng() override
141 {
142 _error();
143 return nullptr;
144 }
146 {
147 _error();
148 return -1;
149 }
151 {
152 _error();
153 return NodeGroup{};
154 }
156 {
157 _error();
158 return EdgeGroup{};
159 }
161 {
162 _error();
163 return FaceGroup{};
164 }
166 {
167 _error();
168 return CellGroup{};
169 }
171 {
172 _error();
173 return NodeGroup{};
174 }
176 {
177 _error();
178 return EdgeGroup{};
179 }
181 {
182 _error();
183 return FaceGroup{};
184 }
186 {
187 _error();
188 return CellGroup{};
189 }
191 {
192 _error();
193 return FaceGroup{};
194 }
195
196 public:
197
199 {
200 _error();
201 return nullptr;
202 }
203 IItemFamily* findItemFamily(eItemKind, const String&, bool, bool) override
204 {
205 _error();
206 return nullptr;
207 }
208 IItemFamily* findItemFamily(const String&, bool) override
209 {
210 _error();
211 return nullptr;
212 }
214 {
215 _error();
216 return nullptr;
217 }
219 {
220 _error();
221 return nullptr;
222 }
224 {
225 _error();
226 return nullptr;
227 }
229 {
230 _error();
231 return nullptr;
232 }
234 {
235 _error();
236 return nullptr;
237 }
239 {
240 _error();
241 return nullptr;
242 }
243 IItemFamilyCollection itemFamilies() override
244 {
245 _error();
246 return IItemFamilyCollection{};
247 }
248
249 public:
250
251 void build() override { _error(); }
252 String factoryName() const override
253 {
254 _error();
255 return String{};
256 }
258 {
259 _error();
260 return ItemInternalList{};
261 }
263 {
264 _error();
266 }
267 void checkValidMesh() override { _error(); }
268 void checkValidMeshFull() override { _error(); }
269 void synchronizeGroupsAndVariables() override { _error(); }
270
271 public:
272
273 bool isAllocated() override
274 {
275 _error();
276 return false;
277 }
278 Int64 timestamp() override
279 {
280 _error();
281 return -1;
282 }
283
284 public:
285
286 ISubDomain* subDomain() override
287 {
288 _error();
289 return nullptr;
290 }
291
292 public:
293
295 {
296 _error();
297 return nullptr;
298 }
299
300 public:
301
303 {
304 _error();
305 return VariableScalarInteger{ nullptr };
306 }
307
309 {
310 _error();
311 return CellGroup{};
312 }
314 {
315 _error();
316 return CellGroup{};
317 }
319 {
320 _error();
321 return CellGroup{};
322 }
324 {
325 _error();
326 return CellGroup{};
327 }
329 {
330 _error();
331 return FaceGroup{};
332 }
334 {
335 _error();
336 return FaceGroup{};
337 }
339 {
340 _error();
341 return FaceGroup{};
342 }
344 {
345 _error();
346 return FaceGroup{};
347 }
348
349 public:
350
352 {
353 _error();
354 return ItemGroupCollection{};
355 }
356 ItemGroup findGroup(const String&) override
357 {
358 _error();
359 return ItemGroup{};
360 }
361 void destroyGroups() override { _error(); }
362
363 public:
364
365 MeshItemInternalList* meshItemInternalList() override
366 {
367 _error();
368 return nullptr;
369 }
370
371 public:
372
373 void updateGhostLayers(bool) override { _error(); }
374 void serializeCells(ISerializer*, Int32ConstArrayView) override { _error(); }
375 void prepareForDump() override { _error(); }
376 void initializeVariables(const XmlNode&) override { _error(); }
377 void setCheckLevel(Integer) override { _error(); }
378 Integer checkLevel() const override
379 {
380 _error();
381 return -1;
382 }
383 bool isDynamic() const override
384 {
385 _error();
386 return false;
387 }
388 bool isAmrActivated() const override
389 {
390 _error();
391 return false;
392 }
393
394 public:
395
396 void computeTiedInterfaces(const XmlNode&) override { _error(); }
397 bool hasTiedInterface() override
398 {
399 _error();
400 return false;
401 }
403 {
404 _error();
406 }
408 {
409 _error();
410 return nullptr;
411 }
412
413 public:
414
416 {
417 _error();
418 return nullptr;
419 }
421 {
422 _error();
423 return nullptr;
424 }
425
426 public:
427
429 {
430 _error();
431 return nullptr;
432 }
433
434 public:
435
436 void defineParentForBuild(IMesh*, ItemGroup) override { _error(); }
437 IMesh* parentMesh() const override
438 {
439 _error();
440 return nullptr;
441 }
442 ItemGroup parentGroup() const override
443 {
444 _error();
445 return ItemGroup{};
446 }
447 void addChildMesh(IMesh*) override { _error(); }
449 {
450 _error();
451 return MeshCollection{};
452 }
453
454 public:
455
456 bool isPrimaryMesh() const override
457 {
458 _error();
459 return false;
460 }
461 IPrimaryMesh* toPrimaryMesh() override { return this; }
462
463 public:
464
466 {
467 _error();
468 return nullptr;
469 }
470 const IUserDataList* userDataList() const override
471 {
472 _error();
473 return nullptr;
474 }
475
476 public:
477
479 {
480 _error();
481 return nullptr;
482 }
484 {
485 _error();
486 return nullptr;
487 }
488 IMeshChecker* checker() const override
489 {
490 _error();
491 return nullptr;
492 }
493 const MeshPartInfo& meshPartInfo() const override
494 {
495 _error();
496 auto var = new MeshPartInfo{};
497 return *var;
498 }
499 bool useMeshItemFamilyDependencies() const override
500 {
501 _error();
502 return false;
503 }
505 {
506 _error();
507 return nullptr;
508 }
510 {
511 _error();
512 return nullptr;
513 }
514
515 public:
516
518 {
519 _error();
520 return nullptr;
521 }
523 {
524 _error();
526 }
527
528 public:
529
530 IMeshMng* meshMng() const override
531 {
532 _error();
533 return nullptr;
534 }
535 IVariableMng* variableMng() const override
536 {
537 _error();
538 return nullptr;
539 }
540 ItemTypeMng* itemTypeMng() const override
541 {
542 _error();
543 return nullptr;
544 }
545
547 {
549 }
550
555};
556
557/*---------------------------------------------------------------------------*/
558/*---------------------------------------------------------------------------*/
559
560} // End namespace Arcane::mesh
561
562/*---------------------------------------------------------------------------*/
563/*---------------------------------------------------------------------------*/
564
565#endif
#define ARCANE_THROW(exception_class,...)
Macro for throwing an exception with formatting.
Declarations of Arcane's general types.
Interface of the manager for indexed incremental item connectivities.
Interface for modifying a family.
Interface of an entity family.
Definition IItemFamily.h:83
Interface for mesh verification methods.
Interface for managing the compaction of mesh families.
Internal part of IMesh.
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.
Interface of the parallelism manager for a subdomain.
Interface of the subdomain manager.
Definition ISubDomain.h:75
Interface of a list that manages user data.
Variable manager interface.
Mesh entity group.
Definition ItemGroup.h:51
Mesh entity type manager.
Definition ItemTypeMng.h:66
Handle on a mesh.
Definition MeshHandle.h:48
Indirection tables for mesh entities.
Information about a partitioned mesh.
List of properties.
Definition Properties.h:65
Node of a DOM tree.
Definition XmlNode.h:51
CellGroup ownLevelCells(const Integer &) override
Group of all cells specific to the domain of level level.
Definition EmptyMesh.h:323
void destroyGroups() override
Destroys all groups of all families.
Definition EmptyMesh.h:361
Integer nbNode() override
Number of mesh nodes.
Definition EmptyMesh.h:115
ITraceMng * traceMng() override
Associated message manager.
Definition EmptyMesh.h:140
void initializeVariables(const XmlNode &) override
Initializes variables with values from the configuration file (internal).
Definition EmptyMesh.h:376
bool hasTiedInterface() override
True if semi-conforming interfaces exist in the mesh.
Definition EmptyMesh.h:397
FaceGroup ownFaces() override
Group of all domain-specific faces.
Definition EmptyMesh.h:180
IItemFamily * createItemFamily(eItemKind, const String &) override
Create a particle family named name.
Definition EmptyMesh.h:198
IUserDataList * userDataList() override
Associated user data manager.
Definition EmptyMesh.h:465
IItemFamily * itemFamily(eItemKind) override
Returns the entity family of type ik.
Definition EmptyMesh.h:218
void setDimension(Integer) override
Positions the mesh dimension (1D, 2D, or 3D).
Definition EmptyMesh.h:92
void serializeCells(ISerializer *, Int32ConstArrayView) override
Definition EmptyMesh.h:374
IItemFamily * faceFamily() override
Returns the face family.
Definition EmptyMesh.h:233
VariableItemInt32 & itemsNewOwner(eItemKind) override
Variable containing the identifier of the owning subdomain.
Definition EmptyMesh.h:97
ItemTypeMng * itemTypeMng() const override
Associated entity type manager.
Definition EmptyMesh.h:540
TiedInterfaceCollection tiedInterfaces() override
List of semi-conforming interfaces.
Definition EmptyMesh.h:402
void defineParentForBuild(IMesh *, ItemGroup) override
Defines the parent mesh and group.
Definition EmptyMesh.h:436
VariableNodeReal3 & nodesCoordinates() override
Node coordinates.
Definition EmptyMesh.h:86
IMeshChecker * checker() const override
Checker interface.
Definition EmptyMesh.h:488
IMeshPartitionConstraintMng * partitionConstraintMng() override
Manager of partitioning constraints associated with this mesh.
Definition EmptyMesh.h:407
FaceGroup outerFaces() override
Group of all faces on the boundary.
Definition EmptyMesh.h:190
Integer dimension() override
Mesh dimension (1D, 2D, or 3D).
Definition EmptyMesh.h:145
void synchronizeGroupsAndVariables() override
Synchronizes all mesh groups and variables.
Definition EmptyMesh.h:269
IGhostLayerMng * ghostLayerMng() const override
Associated ghost layer manager.
Definition EmptyMesh.h:478
bool useMeshItemFamilyDependencies() const override
check if the network itemFamily dependencies is activated
Definition EmptyMesh.h:499
bool isPrimaryMesh() const override
Indicates if the instance is a primary mesh.
Definition EmptyMesh.h:456
void checkValidMeshFull() override
Mesh validity check.
Definition EmptyMesh.h:268
IMeshModifier * modifier() override
Associated modifier interface.
Definition EmptyMesh.h:428
IMeshCompactMng * _compactMng() override
Definition EmptyMesh.h:517
Integer nbCell() override
Number of mesh cells.
Definition EmptyMesh.h:130
void setOwnersFromCells() override
Positions entity owners based on the cell owner.
Definition EmptyMesh.h:104
SharedVariableNodeReal3 sharedNodesCoordinates() override
Node coordinates.
Definition EmptyMesh.h:262
IParallelMng * parallelMng() override
Parallelism manager.
Definition EmptyMesh.h:294
IItemFamily * findItemFamily(const String &, bool) override
Returns the family named name.
Definition EmptyMesh.h:208
void allocateCells(Integer, Int64ConstArrayView, bool) override
Allocation of a mesh.
Definition EmptyMesh.h:94
void exchangeItems() override
Changes the owning subdomains of entities.
Definition EmptyMesh.h:103
IItemFamily * edgeFamily() override
Returns the edge family.
Definition EmptyMesh.h:228
VariableScalarInteger connectivity() override
Connectivity descriptor.
Definition EmptyMesh.h:302
InternalConnectivityPolicy _connectivityPolicy() const override
Connectivity usage policy.
Definition EmptyMesh.h:522
FaceGroup allActiveFaces() override
Group of all active faces.
Definition EmptyMesh.h:328
void checkValidMesh() override
Check for the validity of internal mesh structures (internal).
Definition EmptyMesh.h:267
void prepareForDump() override
Prepares the instance for dumping.
Definition EmptyMesh.h:375
IPrimaryMesh * toPrimaryMesh() override
Returns the instance in the form of an IPrimaryMesh.
Definition EmptyMesh.h:461
ItemGroupCollection groups() override
List of groups.
Definition EmptyMesh.h:351
IItemFamilyModifier * findItemFamilyModifier(eItemKind, const String &) override
Returns the IItemFamilyModifier interface for the family named name and of type ik.
Definition EmptyMesh.h:213
void reloadMesh() override
Reloads the mesh from protected variables.
Definition EmptyMesh.h:93
CellGroup allActiveCells() override
Definition EmptyMesh.h:308
Properties * properties() override
Properties associated with this mesh.
Definition EmptyMesh.h:420
void computeTiedInterfaces(const XmlNode &) override
Determines the semi-conforming interfaces.
Definition EmptyMesh.h:396
Integer nbEdge() override
Number of mesh edges.
Definition EmptyMesh.h:120
FaceGroup innerActiveFaces() override
Group of all active faces.
Definition EmptyMesh.h:338
IItemFamily * cellFamily() override
Returns the cell family.
Definition EmptyMesh.h:238
CellGroup ownActiveCells() override
Group of all active cells specific to the domain.
Definition EmptyMesh.h:313
FaceGroup allFaces() override
Group of all faces.
Definition EmptyMesh.h:160
Int64 timestamp() override
Counter indicating the time of the last mesh modification.
Definition EmptyMesh.h:278
ItemInternalList itemsInternal(eItemKind) override
Internal array of mesh elements of type type.
Definition EmptyMesh.h:257
const MeshPartInfo & meshPartInfo() const override
Mesh part information.
Definition EmptyMesh.h:493
ItemGroup parentGroup() const override
Parent group.
Definition EmptyMesh.h:442
void addChildMesh(IMesh *) override
Adds a sub-mesh to the parent mesh.
Definition EmptyMesh.h:447
void deallocate() override
Deallocates the mesh.
Definition EmptyMesh.h:96
IVariableMng * variableMng() const override
Associated variable manager.
Definition EmptyMesh.h:535
const IUserDataList * userDataList() const override
Associated user data manager.
Definition EmptyMesh.h:470
MeshHandle handle() const override
Handle on this mesh.
Definition EmptyMesh.h:77
IMeshMng * meshMng() const override
Associated mesh manager.
Definition EmptyMesh.h:530
void endAllocate() override
Indicates the end of cell allocation.
Definition EmptyMesh.h:95
ItemGroup findGroup(const String &) override
Returns the group with name name or a null group if none exists.
Definition EmptyMesh.h:356
IMeshUtilities * utilities() override
Associated utility functions interface.
Definition EmptyMesh.h:415
IItemFamily * nodeFamily() override
Returns the node family.
Definition EmptyMesh.h:223
Integer checkLevel() const override
Current check level.
Definition EmptyMesh.h:378
Integer nbFace() override
Number of mesh faces.
Definition EmptyMesh.h:125
EdgeGroup allEdges() override
Group of all edges.
Definition EmptyMesh.h:155
IItemFamily * findItemFamily(eItemKind, const String &, bool, bool) override
Returns the family named name.
Definition EmptyMesh.h:203
IItemFamilyNetwork * itemFamilyNetwork() override
Family network interface (connected families).
Definition EmptyMesh.h:504
MeshCollection childMeshes() const override
List of sub-meshes of the current mesh.
Definition EmptyMesh.h:448
CellGroup ownCells() override
Group of all domain-specific cells.
Definition EmptyMesh.h:185
void setMeshPartInfo(const MeshPartInfo &) override
Positions partitioning information.
Definition EmptyMesh.h:105
CellGroup allLevelCells(const Integer &) override
Group of all cells of level level.
Definition EmptyMesh.h:318
NodeGroup ownNodes() override
Group of all domain-specific nodes.
Definition EmptyMesh.h:170
IMeshInternal * _internalApi() override
Internal Arcane API.
Definition EmptyMesh.h:551
NodeGroup allNodes() override
Group of all nodes.
Definition EmptyMesh.h:150
FaceGroup ownActiveFaces() override
Group of all active faces specific to the domain.
Definition EmptyMesh.h:333
bool isDynamic() const override
Indicates if the mesh is dynamic (can evolve).
Definition EmptyMesh.h:383
void setCheckLevel(Integer) override
Sets the mesh check level.
Definition EmptyMesh.h:377
String name() const override
Mesh name.
Definition EmptyMesh.h:110
bool isAllocated() override
True if the mesh is allocated.
Definition EmptyMesh.h:273
IMeshUniqueIdMng * meshUniqueIdMng() const override
Unique ID numbering manager.
Definition EmptyMesh.h:483
IIndexedIncrementalItemConnectivityMng * indexedConnectivityMng() override
Interface of the indexed incremental connectivity manager.
Definition EmptyMesh.h:509
FaceGroup outerActiveFaces() override
Group of all active faces on the boundary.
Definition EmptyMesh.h:343
IMesh * parentMesh() const override
Access to the parent mesh.
Definition EmptyMesh.h:437
CellGroup allCells() override
Group of all cells.
Definition EmptyMesh.h:165
String factoryName() const override
Name of the factory used to create the mesh.
Definition EmptyMesh.h:252
EdgeGroup ownEdges() override
Group of all domain-specific edges.
Definition EmptyMesh.h:175
void computeSynchronizeInfos() override
Recalculates synchronization information.
Definition EmptyMesh.h:546
Integer nbItem(eItemKind) override
Number of elements of type ik.
Definition EmptyMesh.h:135
ItemGroupT< Cell > CellGroup
Group of cells.
Definition ItemTypes.h:184
ItemGroupT< Face > FaceGroup
Group of faces.
Definition ItemTypes.h:179
ItemGroupT< Edge > EdgeGroup
Group of edges.
Definition ItemTypes.h:174
ItemGroupT< Node > NodeGroup
Group of nodes.
Definition ItemTypes.h:168
MeshVariableScalarRefT< Node, Real3 > VariableNodeReal3
Coordinate type quantity at node.
ItemVariableScalarRefT< Int32 > VariableItemInt32
32-bit integer type quantity
VariableRefScalarT< Integer > VariableScalarInteger
Scalar variable of integer type.
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
Collection< IItemFamily * > IItemFamilyCollection
Collection of item families.
ConstArrayView< Int64 > Int64ConstArrayView
C equivalent of a 1D array of 64-bit integers.
Definition UtilsTypes.h:480
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.