Arcane  4.1.12.0
User documentation
Loading...
Searching...
No Matches
Arcane::IMeshUtilities Class Referenceabstract

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.

Detailed Description

Interface of a class providing utility functions on meshes.

Definition at line 35 of file IMeshUtilities.h.

Member Function Documentation

◆ changeOwnersFromCells()

virtual void Arcane::IMeshUtilities::changeOwnersFromCells ( )
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.

Note
This method requires that the synchronization information be valid. If you want to determine the owners of entities without prior information, you must use computeAndSetOwnersForNodes() or computeAndSetOwnersForFaces().

References changeOwnersFromCells().

Referenced by changeOwnersFromCells().

◆ computeAdjacency()

void Arcane::IMeshUtilities::computeAdjacency ( const ItemPairGroup & adjacency_array,
eItemKind link_kind,
Integer nb_layer )
virtual

Calculates adjacencies, stored in adjacency_array.

Definition at line 328 of file InterfaceImpl.cc.

References computeAdjency().

Referenced by computeAdjency().

◆ computeAndSetOwnersForEdges()

virtual void Arcane::IMeshUtilities::computeAndSetOwnersForEdges ( )
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.

References computeAndSetOwnersForEdges().

Referenced by computeAndSetOwnersForEdges().

◆ computeAndSetOwnersForFaces()

virtual void Arcane::IMeshUtilities::computeAndSetOwnersForFaces ( )
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.

References computeAndSetOwnersForFaces().

Referenced by computeAndSetOwnersForFaces().

◆ computeAndSetOwnersForNodes()

virtual void Arcane::IMeshUtilities::computeAndSetOwnersForNodes ( )
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.

References computeAndSetOwnersForNodes().

Referenced by computeAndSetOwnersForNodes().

◆ computeDirection()

virtual Real3 Arcane::IMeshUtilities::computeDirection ( const NodeGroup & node_group,
const VariableNodeReal3 & nodes_coord,
Real3 * n1,
Real3 * n2 )
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().

References computeDirection().

Referenced by computeDirection().

◆ computeNormal()

virtual Real3 Arcane::IMeshUtilities::computeNormal ( const FaceGroup & face_group,
const VariableNodeReal3 & nodes_coord )
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().

References computeNormal().

Referenced by computeNormal().

◆ getFacesLocalIdFromConnectivity()

virtual void Arcane::IMeshUtilities::getFacesLocalIdFromConnectivity ( ConstArrayView< ItemTypeId > items_type,
ConstArrayView< Int64 > items_connectivity,
ArrayView< Int32 > local_ids,
bool allow_null = false )
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.

Parameters
items_typearray of ItemTypeId of the entities
items_connectivityarray containing the unique indices of the entities' nodes.
local_idsin 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.

References getFacesLocalIdFromConnectivity().

Referenced by getFacesLocalIdFromConnectivity().

◆ localIdsFromConnectivity()

virtual void Arcane::IMeshUtilities::localIdsFromConnectivity ( eItemKind item_kind,
IntegerConstArrayView items_nb_node,
Int64ConstArrayView items_connectivity,
Int32ArrayView local_ids,
bool allow_null = false )
pure virtual

Searches for the local IDs of entities based on their connectivity.

This method is only implemented for order 1 faces.

Deprecated
Use getFacesLocalIdFromConnectivity() instead.

References localIdsFromConnectivity().

Referenced by localIdsFromConnectivity().

◆ mergeNodes() [1/2]

virtual void Arcane::IMeshUtilities::mergeNodes ( Int32ConstArrayView nodes_local_id,
Int32ConstArrayView nodes_to_merge_local_id )
inlinevirtual

Merges nodes.

Definition at line 235 of file IMeshUtilities.h.

References mergeNodes().

Referenced by mergeNodes().

◆ mergeNodes() [2/2]

virtual void Arcane::IMeshUtilities::mergeNodes ( Int32ConstArrayView nodes_local_id,
Int32ConstArrayView nodes_to_merge_local_id,
bool allow_non_corresponding_face )
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).

◆ partitionAndExchangeMeshWithReplication()

virtual void Arcane::IMeshUtilities::partitionAndExchangeMeshWithReplication ( IMeshPartitionerBase * partitioner,
bool initial_partition )
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:

  • only the master replica performs the repartitioning by calling IMeshPartitioner::partitionMesh() with partitioner as the partitioner
  • the values of IItemFamily::itemsNewOwner() are then synchronized with the other replicas.
  • entity exchanges are performed via IPrimaryMesh::exchangeItems().

This method is collective across all replicas.

Precondition
All replicas must have the same mesh, meaning that all entity families must be identical except for particle families which are not concerned.
The mesh must be an instance of IPrimaryMesh.
Postcondition
All replicas have the same mesh except for particle families.
Parameters
partitionerInstance of the partitioner to be used
initial_partitionIndicates if it is the initial partitioning.

References partitionAndExchangeMeshWithReplication().

Referenced by partitionAndExchangeMeshWithReplication().

◆ recomputeItemsUniqueIdFromNodesUniqueId()

virtual void Arcane::IMeshUtilities::recomputeItemsUniqueIdFromNodesUniqueId ( )
pure virtual

Recalculates the uniqueId() of edges, faces, and cells based on the uniqueId() of the nodes.

Warning
This method is experimental and should only be used within Arcane. It assumes that the uniqueId() of the entities are constructed from generateHashUniqueId().

◆ writeToFile()

virtual bool Arcane::IMeshUtilities::writeToFile ( const String & file_name,
const String & service_name )
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.

Return values
trueif the specified service is not available.
falseif everything is ok.

References writeToFile().

Referenced by writeToFile().


The documentation for this class was generated from the following files: