Interface of a class providing utility functions on meshes. More...
#include <arcane/core/IMeshUtilities.h>
Public Member Functions | |
| virtual | ~IMeshUtilities ()=default |
| Frees resources. | |
| virtual void | localIdsFromConnectivity (eItemKind item_kind, IntegerConstArrayView items_nb_node, Int64ConstArrayView items_connectivity, Int32ArrayView local_ids, bool allow_null=false)=0 |
| Searches for the local IDs of entities based on their connectivity. | |
| virtual void | getFacesLocalIdFromConnectivity (ConstArrayView< ItemTypeId > items_type, ConstArrayView< Int64 > items_connectivity, ArrayView< Int32 > local_ids, bool allow_null=false)=0 |
| Searches for the local IDs of faces based on their connectivity. | |
| virtual Real3 | computeNormal (const FaceGroup &face_group, const VariableNodeReal3 &nodes_coord)=0 |
| Calculates the normal of a face group. | |
| virtual Real3 | computeDirection (const NodeGroup &node_group, const VariableNodeReal3 &nodes_coord, Real3 *n1, Real3 *n2)=0 |
| Calculates the direction vector of a line. | |
| virtual void | computeAdjency (ItemPairGroup adjacency_array, eItemKind link_kind, Integer nb_layer)=0 |
| Calculates adjacencies, stored in adjacency_array. | |
| virtual void | computeAdjacency (const ItemPairGroup &adjacency_array, eItemKind link_kind, Integer nb_layer) |
| Calculates adjacencies, stored in adjacency_array. | |
| virtual void | changeOwnersFromCells ()=0 |
| Positions the new owners of nodes, edges, and faces based on the cells. | |
| virtual void | computeAndSetOwnersForNodes ()=0 |
| Determines the owners of the nodes. | |
| virtual void | computeAndSetOwnersForEdges ()=0 |
| Determines the owners of the edges. | |
| virtual void | computeAndSetOwnersForFaces ()=0 |
| Determines the owners of the faces. | |
| virtual bool | writeToFile (const String &file_name, const String &service_name)=0 |
| Writes the mesh to a file. | |
| virtual void | partitionAndExchangeMeshWithReplication (IMeshPartitionerBase *partitioner, bool initial_partition)=0 |
| Repartitions and exchanges the mesh while managing replication. | |
| virtual void | mergeNodes (Int32ConstArrayView nodes_local_id, Int32ConstArrayView nodes_to_merge_local_id) |
| Merges nodes. | |
| virtual void | mergeNodes (Int32ConstArrayView nodes_local_id, Int32ConstArrayView nodes_to_merge_local_id, bool allow_non_corresponding_face)=0 |
| Merges nodes. | |
| virtual void | recomputeItemsUniqueIdFromNodesUniqueId ()=0 |
| Recalculates the uniqueId() of edges, faces, and cells based on the uniqueId() of the nodes. | |
Interface of a class providing utility functions on meshes.
Definition at line 35 of file IMeshUtilities.h.
|
pure virtual |
Positions the new owners of nodes, edges, and faces based on the cells.
Assuming the new owners of the cells are known (and synchronized), it determines the new owners of other entities and synchronizes them.
This method is collective.
Implemented in Arcane::UnstructuredMeshUtilities.
References changeOwnersFromCells().
Referenced by changeOwnersFromCells().
|
virtual |
Calculates adjacencies, stored in adjacency_array.
Definition at line 328 of file InterfaceImpl.cc.
References computeAdjency().
Referenced by computeAdjency(), and Arcane::mesh::ItemFamily::findAdjacencyItems().
|
pure virtual |
Calculates adjacencies, stored in adjacency_array.
Implemented in Arcane::UnstructuredMeshUtilities.
References computeAdjacency(), and computeAdjency().
Referenced by computeAdjacency(), and computeAdjency().
|
pure virtual |
Determines the owners of the edges.
The determination is based on the owners of the cells. There must be no ghost cell layers.
This operation is collective.
Implemented in Arcane::UnstructuredMeshUtilities.
References computeAndSetOwnersForEdges().
Referenced by computeAndSetOwnersForEdges().
|
pure virtual |
Determines the owners of the faces.
The determination is based on the owners of the cells. There must be no ghost cell layers.
This operation is collective.
Implemented in Arcane::UnstructuredMeshUtilities.
References computeAndSetOwnersForFaces().
Referenced by computeAndSetOwnersForFaces().
|
pure virtual |
Determines the owners of the nodes.
The determination is based on the owners of the cells. There must be no ghost cell layers.
This operation is collective.
Implemented in Arcane::UnstructuredMeshUtilities.
References computeAndSetOwnersForNodes().
Referenced by computeAndSetOwnersForNodes().
|
pure virtual |
Calculates the direction vector of a line.
This method calculates the direction vector of a group of nodes by assuming that it forms a line. For the calculation, the algorithm attempts to determine the nodes at the ends of this line and calculates a vector from these nodes. The direction of the vector is undefined.
If the group does not form a line, the result is undefined.
This method is collective. The algorithm used guarantees the same results in sequential and parallel execution.
If n1 and n2 are not null, they will contain the extreme coordinates from which the direction is calculated.
The variable nodes_coord is used as coordinates for the nodes. Generally, this is IMesh::nodesCoordinates().
Implemented in Arcane::UnstructuredMeshUtilities.
References computeDirection().
Referenced by computeDirection().
|
pure virtual |
Calculates the normal of a face group.
This method calculates the normal of a face group by assuming that this surface is a plane. For the calculation, the algorithm attempts to determine the nodes at the ends of this surface and calculates a normal from these nodes. The orientation of the normal (inward or outward) is undefined.
If the surface is not planar, the result is undefined.
The current algorithm does not always work on a surface composed only of triangles.
This method is collective. The algorithm used guarantees the same results in sequential and parallel execution.
The variable nodes_coord is used as coordinates for the nodes. Generally, this is IMesh::nodesCoordinates().
Implemented in Arcane::UnstructuredMeshUtilities.
References computeNormal().
Referenced by computeNormal().
|
pure virtual |
Searches for the local IDs of faces based on their connectivity.
Takes as input a list of entities described by the unique IDs (Item::uniqueId()) of their nodes and searches for the local IDs (Item::localId()) of these entities.
| items_type | array of ItemTypeId of the entities |
| items_connectivity | array containing the unique indices of the entities' nodes. |
| local_ids | in return, contains the local IDs of the entities. The number of elements in local_ids must be equal to that of items_nb_node. |
The array items_connectivity contains the node IDs of the faces, listed consecutively. For example, if items_type[0]==IT_Triangle3 and items_type[1]==IT_Quad4, then items_connectivity[0..2] will contain the nodes of entity 0, and items_connectivity[3..6] those of entity 1.
If allow_null is false, a fatal error is generated if an entity is not found; otherwise, NULL_ITEM_LOCAL_ID is returned for the corresponding entity.
Implemented in Arcane::UnstructuredMeshUtilities.
References getFacesLocalIdFromConnectivity().
Referenced by Arcane::VtkMeshIOService::_readFacesMesh(), and getFacesLocalIdFromConnectivity().
|
pure virtual |
Searches for the local IDs of entities based on their connectivity.
This method is only implemented for order 1 faces.
Implemented in Arcane::UnstructuredMeshUtilities.
References localIdsFromConnectivity().
Referenced by localIdsFromConnectivity().
|
inlinevirtual |
Merges nodes.
Definition at line 235 of file IMeshUtilities.h.
References mergeNodes().
Referenced by mergeNodes().
|
pure virtual |
Merges nodes.
Merges nodes in pairs from nodes_to_merge_local_id with those from nodes_local_id. Each node nodes_to_merge_local_id[i] is merged with nodes_local_id[i].
The nodes nodes_to_merge_local_id are destroyed after merging. Entities entirely resting on these merged nodes are also destroyed.
It is forbidden to merge two nodes from the same cell or the same face (after merging, a face or a cell cannot have the same node twice).
Once the merge is performed, the faces containing the merged nodes (nodes_to_merge_local_id) are destroyed. If allow_non_corresponding_face is false, then for each destroyed face, there must correspond an existing face with the merged nodes (nodes_local_id).
Implemented in Arcane::UnstructuredMeshUtilities.
|
pure virtual |
Repartitions and exchanges the mesh while managing replication.
This method performs a mesh repartitioning via the call to IMeshPartitioner::partitionMesh(bool) and proceeds to exchange entities via IPrimaryMesh::exchangeItems().
It also manages replication by ensuring that all replicas have the same mesh. The principle is as follows:
This method is collective across all replicas.
| partitioner | Instance of the partitioner to be used |
| initial_partition | Indicates if it is the initial partitioning. |
Implemented in Arcane::UnstructuredMeshUtilities.
References partitionAndExchangeMeshWithReplication().
Referenced by partitionAndExchangeMeshWithReplication().
|
pure virtual |
Recalculates the uniqueId() of edges, faces, and cells based on the uniqueId() of the nodes.
Implemented in Arcane::UnstructuredMeshUtilities.
|
pure virtual |
Writes the mesh to a file.
Writes the mesh to the file file_name using the service implementing the 'IMeshWriter' interface and named service_name.
| true | if the specified service is not available. |
| false | if everything is ok. |
Implemented in Arcane::UnstructuredMeshUtilities.
References writeToFile().
Referenced by writeToFile().