13#ifndef ARCANE_POLYHEDRALMESH_H
14#define ARCANE_POLYHEDRALMESH_H
18#include "arcane/core/MeshHandle.h"
19#include "arcane/core/ItemGroup.h"
20#include "arcane/core/MeshItemInternalList.h"
21#include "arcane/core/ISubDomain.h"
22#include "arcane/core/Properties.h"
25#include "arcane/mesh/EmptyMesh.h"
26#include "arcane/mesh/EmptyMeshModifier.h"
27#include "arcane/mesh/MeshEventsImpl.h"
29#include "arcane/core/ItemAllocationInfo.h"
31#include "arcane/utils/Collection.h"
32#include "arcane/utils/String.h"
33#include "arcane/utils/List.h"
34#include "arcane/core/IMeshInitialAllocator.h"
35#include "arcane/core/IParallelMng.h"
36#include "arcane/core/MeshKind.h"
40#ifdef ARCANE_HAS_POLYHEDRAL_MESH_TOOLS
44#include "arcane/core/IVariableMng.h"
45#include "DynamicMeshChecker.h"
66class PolyhedralFamily;
67class PolyhedralFamilySerializer;
68class PolyhedralFamilySerializerMng;
69namespace PolyhedralTools
78,
public EmptyMeshModifier
82 friend class PolyhedralFamily;
83 friend class PolyhedralFamilySerializer;
90 inline static const String m_mesh_handle_name =
"polyhedral_mesh_handle";
92 std::unique_ptr<Properties> m_properties;
93 std::unique_ptr<PolyhedralMeshImpl> m_mesh;
96 bool m_is_allocated =
false;
100 std::unique_ptr<PolyhedralFamilySerializerMng> m_polyhedral_family_serializer_mng;
110 void applyScheduledAllocateItems(
UniqueArray<std::shared_ptr<PolyhedralTools::ItemLocalIds>> item_lids);
111 void removeNeedRemoveMarkedItems();
112 PolyhedralFamilySerializerMng* polyhedralFamilySerializerMng();
121 static String handleName() {
return m_mesh_handle_name; }
123 void read(
String const& filename);
131 return m_mesh_events.eventObservable(
type);
134#ifdef ARCANE_HAS_POLYHEDRAL_MESH_TOOLS
149 class PolyhedralMeshModifier;
150 class NoCompactionMeshCompacter;
151 class NoCompactionMeshCompactMng;
155 std::vector<std::unique_ptr<PolyhedralFamily>> m_arcane_families;
156 std::array<std::unique_ptr<PolyhedralFamily>, NB_ITEM_KIND> m_empty_arcane_families;
157 std::array<PolyhedralFamily*, NB_ITEM_KIND> m_default_arcane_families;
158 std::vector<std::unique_ptr<VariableItemReal3>> m_arcane_item_coords;
159 std::unique_ptr<VariableNodeReal3> m_arcane_node_coords =
nullptr;
161 InitialAllocator m_initial_allocator;
162 IVariableMng* m_variable_mng =
nullptr;
163 DynamicMeshChecker m_mesh_checker;
164 List<IItemFamily*> m_item_family_collection;
165 std::unique_ptr<InternalApi> m_internal_api;
166 std::unique_ptr<IMeshCompactMng> m_compact_mng;
167 std::unique_ptr<IMeshUtilities> m_mesh_utilities;
168 std::unique_ptr<IMeshExchangeMng> m_mesh_exchange_mng;
169 std::unique_ptr<IItemFamilyNetwork> m_item_family_network;
170 std::unique_ptr<IGhostLayerMng> m_ghost_layer_mng;
171 bool m_is_dynamic =
false;
174 IMeshInitialAllocator*
initialAllocator()
override {
return &m_initial_allocator; }
176 void _allocateItems(
const Arcane::ItemAllocationInfo& item_allocation_info, ArrayView<Int32UniqueArray> family_lids);
181 MeshHandle
handle()
const override;
185 void build()
override {}
187 String
name()
const override;
223 ISubDomain* subDomain()
override {
return m_subdomain; }
224 MeshItemInternalList* meshItemInternalList()
override {
return &m_mesh_item_internal_list; }
226 Properties*
properties()
override {
return m_properties.
get(); }
228 const MeshPartInfo&
meshPartInfo()
const override {
return m_mesh_part_info; };
237 IParallelMng*
parallelMng()
override {
return m_subdomain->parallelMng(); }
239 bool isAllocated()
override {
return m_is_allocated; }
241 bool isAmrActivated()
const override {
return false; }
249 IMesh*
parentMesh()
const override {
return nullptr; }
251 PolyhedralFamily* arcaneDefaultFamily(
eItemKind ik);
267 m_mesh_checker.checkValidMesh();
270 IVariableMng*
variableMng()
const override {
return m_variable_mng; }
283 IMeshModifier*
modifier()
override {
return this; }
284 bool isDynamic()
const override {
return m_is_dynamic; }
285 void setDynamic(
bool is_dynamic)
override { m_is_dynamic = is_dynamic; }
289 if (m_subdomain->parallelMng()->isParallel()) {
290 ARCANE_NOT_YET_IMPLEMENTED(
"Parallel for polyhedral mesh is WIP");
296 if (m_subdomain->parallelMng()->isParallel()) {
297 ARCANE_NOT_YET_IMPLEMENTED(
"Parallel for polyhedral mesh is WIP");
303 if (m_subdomain->parallelMng()->isParallel()) {
304 ARCANE_NOT_YET_IMPLEMENTED(
"Parallel for polyhedral mesh is WIP");
330 IUserDataList*
userDataList()
override {
return m_mesh_handle.meshUserDataList(); }
331 const IUserDataList*
userDataList()
const override {
return m_mesh_handle.meshUserDataList(); }
343 void connectivities(IItemFamily* source_family);
352 PolyhedralFamily* _createItemFamily(
eItemKind ik,
const String&
name);
353 PolyhedralFamily* _itemFamily(
eItemKind ik);
354 PolyhedralFamily* _findItemFamily(
eItemKind ik,
const String&
name,
bool create_if_needed =
false);
355 const char* _className()
const {
return "PolyhedralMesh"; }
357 void _exchangeItems();
359 void _endUpdateFamilies();
361 void _computeFamilySynchronizeInfos();
363 void _notifyEndUpdateForFamilies();
365 void _computeGroupSynchronizeInfos();
371 [[noreturn]]
void _errorEmptyMesh()
const;
373 void _createUnitMesh();
374 void _updateMeshInternalList(
eItemKind kind);
375 PolyhedralMeshImpl* _impl();
Arcane configuration file.
Declarations of Arcane's general types.
Modifiable view of an array of type T.
Base class for an event handler.
virtual String name() const =0
Mesh name.
Interface for managing mesh exchanges between subdomains.
Interface for allocating mesh entities.
Interface of the parallelism manager for a subdomain.
Allocator for polyhedral meshes.
virtual IMeshInitialAllocator * initialAllocator()
Specific initial allocator.
Interface of the subdomain manager.
Mesh entity type manager.
Parameters necessary for building a mesh.
Indirection tables for mesh entities.
Characteristics of a mesh.
Information about a partitioned mesh.
bool get(const String &name, bool &value) const
Value of the property named name.
Unicode character string.
1D data vector with value semantics (STL style).
void addNodes(Int64ConstArrayView, Int32ArrayView) override
Adds nodes.
IMeshModifierInternal * _modifierInternalApi() override
Internal API for Arcane.
void setDynamic(bool) override
Sets the property indicating whether the mesh can evolve.
void addExtraGhostCellsBuilder(IExtraGhostCellsBuilder *) override
addition of the "extraordinary" ghost cells addition algorithm.
void removeExtraGhostCellsBuilder(IExtraGhostCellsBuilder *) override
Removes the association with the builder instance.
CellGroup ownLevelCells(const Integer &) override
Group of all cells specific to the domain of level level.
void destroyGroups() override
Destroys all groups of all families.
Integer nbNode() override
Number of mesh nodes.
ITraceMng * traceMng() override
Associated message manager.
FaceGroup ownFaces() override
Group of all domain-specific faces.
IItemFamily * createItemFamily(eItemKind, const String &) override
Create a particle family named name.
IUserDataList * userDataList() override
Associated user data manager.
IItemFamily * itemFamily(eItemKind) override
Returns the entity family of type ik.
IItemFamily * faceFamily() override
Returns the face family.
VariableItemInt32 & itemsNewOwner(eItemKind) override
Variable containing the identifier of the owning subdomain.
ItemTypeMng * itemTypeMng() const override
Associated entity type manager.
VariableNodeReal3 & nodesCoordinates() override
Node coordinates.
IMeshPartitionConstraintMng * partitionConstraintMng() override
Manager of partitioning constraints associated with this mesh.
FaceGroup outerFaces() override
Group of all faces on the boundary.
Integer dimension() override
Mesh dimension (1D, 2D, or 3D).
IGhostLayerMng * ghostLayerMng() const override
Associated ghost layer manager.
bool useMeshItemFamilyDependencies() const override
check if the network itemFamily dependencies is activated
IMeshModifier * modifier() override
Associated modifier interface.
IMeshCompactMng * _compactMng() override
Integer nbCell() override
Number of mesh cells.
IParallelMng * parallelMng() override
Parallelism manager.
void exchangeItems() override
Changes the owning subdomains of entities.
IItemFamily * edgeFamily() override
Returns the edge family.
VariableScalarInteger connectivity() override
Connectivity descriptor.
InternalConnectivityPolicy _connectivityPolicy() const override
Connectivity usage policy.
FaceGroup allActiveFaces() override
Group of all active faces.
void checkValidMesh() override
Check for the validity of internal mesh structures (internal).
void prepareForDump() override
Prepares the instance for dumping.
ItemGroupCollection groups() override
List of groups.
IItemFamilyModifier * findItemFamilyModifier(eItemKind, const String &) override
Returns the IItemFamilyModifier interface for the family named name and of type ik.
CellGroup allActiveCells() override
Properties * properties() override
Properties associated with this mesh.
Integer nbEdge() override
Number of mesh edges.
FaceGroup innerActiveFaces() override
Group of all active faces.
IItemFamily * cellFamily() override
Returns the cell family.
CellGroup ownActiveCells() override
Group of all active cells specific to the domain.
FaceGroup allFaces() override
Group of all faces.
const MeshPartInfo & meshPartInfo() const override
Mesh part information.
IVariableMng * variableMng() const override
Associated variable manager.
MeshHandle handle() const override
Handle on this mesh.
ItemGroup findGroup(const String &) override
Returns the group with name name or a null group if none exists.
IMeshUtilities * utilities() override
Associated utility functions interface.
IItemFamily * nodeFamily() override
Returns the node family.
Integer checkLevel() const override
Current check level.
Integer nbFace() override
Number of mesh faces.
EdgeGroup allEdges() override
Group of all edges.
IItemFamily * findItemFamily(eItemKind, const String &, bool, bool) override
Returns the family named name.
IItemFamilyNetwork * itemFamilyNetwork() override
Family network interface (connected families).
CellGroup ownCells() override
Group of all domain-specific cells.
CellGroup allLevelCells(const Integer &) override
Group of all cells of level level.
NodeGroup ownNodes() override
Group of all domain-specific nodes.
IMeshInternal * _internalApi() override
Internal Arcane API.
NodeGroup allNodes() override
Group of all nodes.
FaceGroup ownActiveFaces() override
Group of all active faces specific to the domain.
bool isDynamic() const override
Indicates if the mesh is dynamic (can evolve).
String name() const override
Mesh name.
bool isAllocated() override
True if the mesh is allocated.
FaceGroup outerActiveFaces() override
Group of all active faces on the boundary.
IMesh * parentMesh() const override
Access to the parent mesh.
CellGroup allCells() override
Group of all cells.
String factoryName() const override
Name of the factory used to create the mesh.
EdgeGroup ownEdges() override
Group of all domain-specific edges.
Integer nbItem(eItemKind) override
Number of elements of type ik.
Implementation of mesh events.
EventObservable< const MeshEventArgs & > & eventObservable(eMeshEventType type) override
Observable for an event.
void endUpdate()
Notifies the instance that mesh modification is finished.
const MeshKind meshKind() const override
Mesh characteristics.
ItemGroupT< Cell > CellGroup
Group of cells.
ItemGroupT< Face > FaceGroup
Group of faces.
ItemGroupT< Edge > EdgeGroup
Group of edges.
ItemGroupT< Node > NodeGroup
Group of nodes.
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.
-- tab-width: 2; indent-tabs-mode: nil; coding: utf-8-with-signature --
Collection< ItemGroup > ItemGroupCollection
Collection of mesh item groups.
Int32 Integer
Type representing an integer.
ConstArrayView< Int32 > Int32ConstArrayView
C equivalent of a 1D array of 32-bit integers.
List< ItemGroup > ItemGroupList
Array of mesh item groups.
Collection< IItemFamily * > IItemFamilyCollection
Collection of item families.
ConstArrayView< Int64 > Int64ConstArrayView
C equivalent of a 1D array of 64-bit integers.
eMeshEventType
Events generated by IMesh.
ArrayView< Int32 > Int32ArrayView
C equivalent of a 1D array of 32-bit integers.
eItemKind
Mesh entity type.
InternalConnectivityPolicy
Connectivity usage policy.
@ NewOnly
Allocates only the new connectivities.