Arcane  4.1.12.0
Developer documentation
Loading...
Searching...
No Matches
MeshUtils.h File Reference

Utility functions for the mesh. More...

#include "arcane/utils/FunctorUtils.h"
#include "arcane/utils/MemoryUtils.h"
#include "arcane/core/Item.h"
Include dependency graph for MeshUtils.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Namespaces

namespace  Arcane
 -- tab-width: 2; indent-tabs-mode: nil; coding: utf-8-with-signature --

Functions

void Arcane::MeshUtils::writeMeshItemInfo (ISubDomain *, Cell cell, bool depend_info=true)
void Arcane::MeshUtils::writeMeshItemInfo (ISubDomain *, Node node, bool depend_info=true)
void Arcane::MeshUtils::writeMeshItemInfo (ISubDomain *, Edge edge, bool depend_info=true)
void Arcane::MeshUtils::writeMeshItemInfo (ISubDomain *, Face face, bool depend_info=true)
bool Arcane::MeshUtils::reorderNodesOfFace (Int64ConstArrayView before_ids, Int64ArrayView after_ids)
 Reorders the nodes of a face.
bool Arcane::MeshUtils::reorderNodesOfFace2 (Int64ConstArrayView nodes_unique_id, Int32ArrayView new_index)
 Reorders the nodes of a face.
Face Arcane::MeshUtils::getFaceFromNodesLocalId (Node node, Int32ConstArrayView face_nodes_local_id)
 Searches for a face entity using the local numbers of these nodes.
Face Arcane::MeshUtils::getFaceFromNodesLocal (Node node, Int32ConstArrayView face_nodes_local_id)
Face Arcane::MeshUtils::getFaceFromNodesUniqueId (Node node, Int64ConstArrayView face_nodes_unique_id)
 Searches for a face entity using the unique numbers of these nodes.
Face Arcane::MeshUtils::getFaceFromNodesUnique (Node node, Int64ConstArrayView face_nodes_unique_id)
Int64 Arcane::MeshUtils::generateHashUniqueId (SmallSpan< const Int64 > nodes_unique_id)
 Generates a unique identifier from a list of node identifiers.
void Arcane::MeshUtils::removeItemAndKeepOrder (Int32ArrayView items, Int32 local_id)
 Removes an entity while preserving order.
void Arcane::MeshUtils::checkMeshProperties (IMesh *mesh, bool is_sorted, bool has_no_hole, bool check_faces)
 Checks if the mesh has certain properties.
void Arcane::MeshUtils::writeMeshInfosSorted (IMesh *mesh, const String &file_name)
 Writes the mesh info mesh to the file file_name.
void Arcane::MeshUtils::writeMeshInfos (IMesh *mesh, const String &file_name)
void Arcane::MeshUtils::writeMeshConnectivity (IMesh *mesh, const String &file_name)
 Writes the connectivity of the mesh mesh to the file file_name.
void Arcane::MeshUtils::checkMeshConnectivity (IMesh *mesh, const XmlNode &root_node, bool check_sub_domain)
void Arcane::MeshUtils::checkMeshConnectivity (IMesh *mesh, const String &file_name, bool check_sub_domain)
void Arcane::MeshUtils::printItems (std::ostream &ostr, const String &name, ItemGroup item_group)
 Writes the description of items in group item_group to the stream ostr.
Int64 Arcane::MeshUtils::printMeshGroupsMemoryUsage (IMesh *mesh, Int32 print_level)
 Displays the memory usage of the mesh groups.
void Arcane::MeshUtils::shrinkMeshGroups (IMesh *mesh)
 Optimizes the memory usage of the groups.
void Arcane::MeshUtils::dumpSynchronizerTopologyJSON (IVariableSynchronizer *var_syncer, const String &filename)
 Writes the topology information of a synchronizer to a file.
void Arcane::MeshUtils::computeConnectivityPatternOccurence (IMesh *mesh)
 Calculates and displays common patterns in the connectivities.
void Arcane::MeshUtils::markMeshConnectivitiesAsMostlyReadOnly (IMesh *mesh, RunQueue *q=nullptr, bool do_prefetch=false)
 Indicates that the mesh connectivities will not be regularly modified.
ItemBase Arcane::MeshUtils::findOneItem (IItemFamily *family, Int64 unique_id)
ItemBase Arcane::MeshUtils::findOneItem (IItemFamily *family, ItemUniqueId unique_id)
void Arcane::MeshUtils::visitGroups (IItemFamily *family, IFunctorWithArgumentT< ItemGroup & > *functor)
 Visits all groups of family using the functor functor.
void Arcane::MeshUtils::visitGroups (IMesh *mesh, IFunctorWithArgumentT< ItemGroup & > *functor)
 Visits all groups of mesh using the functor functor.
template<typename LambdaType>
void Arcane::MeshUtils::visitGroups (IItemFamily *family, const LambdaType &f)
 Visits all groups of family using the lambda f.
template<typename LambdaType>
void Arcane::MeshUtils::visitGroups (IMesh *mesh, const LambdaType &f)
 Visits all groups of mesh using the lambda f.
Int64 Arcane::MeshUtils::impl::computeCapacity (Int64 size)
template<typename DataType>
bool Arcane::MeshUtils::checkResizeArray (Array< DataType > &array, Int64 new_size, bool force_resize)
 Resizes an array that is indexed by 'ItemLocalId'.
ItemUniqueId Arcane::MeshUtils::getMaxItemUniqueIdCollective (IMesh *mesh)
 Returns the maximum of the uniqueId() of the standard entities of the mesh.
void Arcane::MeshUtils::checkUniqueIdsHashCollective (IItemFamily *family, IHashAlgorithm *hash_algo, const String &expected_hash, bool print_hash_value, bool include_ghost)
 Checks the hash of the uniqueId() of entities in a family.
void Arcane::MeshUtils::fillUniqueIds (ItemVectorView items, Array< Int64 > &uids)
 Fills uids with the uniqueId() of the entities in view.
Ref< IIndexedIncrementalItemConnectivityArcane::MeshUtils::computeNodeNodeViaEdgeConnectivity (IMesh *mesh, const String &connectivity_name)
 Creates or recreates a node-node connectivity via edges.
Ref< IIndexedIncrementalItemConnectivityArcane::MeshUtils::computeBoundaryNodeNodeViaEdgeConnectivity (IMesh *mesh, const String &connectivity_name)
 Creates or recreates a node-node connectivity via edges for nodes on the boundary faces of the mesh.
void Arcane::MeshUtils::computeAndSetOwnerForNodes (IMesh *mesh)
 Determines the owners of the nodes.
void Arcane::MeshUtils::computeAndSetOwnerForEdges (IMesh *mesh)
 Determines the owners of the edges.
void Arcane::MeshUtils::computeAndSetOwnerForFaces (IMesh *mesh)
 Determines the owners of the faces.
void Arcane::mesh_utils::checkMeshConnectivity (IMesh *mesh, const XmlNode &root_node, bool check_sub_domain)
void Arcane::mesh_utils::checkMeshProperties (IMesh *mesh, bool is_sorted, bool has_no_hole, bool check_faces)
 Checks if the mesh has certain properties.
void Arcane::mesh_utils::computeConnectivityPatternOccurence (IMesh *mesh)
 Calculates and displays common patterns in the connectivities.
void Arcane::mesh_utils::dumpSynchronizerTopologyJSON (IVariableSynchronizer *var_syncer, const String &filename)
 Writes the topology information of a synchronizer to a file.
Face Arcane::mesh_utils::getFaceFromNodesLocal (Node node, Int32ConstArrayView face_nodes_local_id)
Face Arcane::mesh_utils::getFaceFromNodesUnique (Node node, Int64ConstArrayView face_nodes_unique_id)
void Arcane::mesh_utils::printItems (std::ostream &ostr, const String &name, ItemGroup item_group)
 Writes the description of items in group item_group to the stream ostr.
Int64 Arcane::mesh_utils::printMeshGroupsMemoryUsage (IMesh *mesh, Int32 print_level)
 Displays the memory usage of the mesh groups.
void Arcane::mesh_utils::removeItemAndKeepOrder (Int32ArrayView items, Int32 local_id)
 Removes an entity while preserving order.
bool Arcane::mesh_utils::reorderNodesOfFace (Int64ConstArrayView before_ids, Int64ArrayView after_ids)
 Reorders the nodes of a face.
bool Arcane::mesh_utils::reorderNodesOfFace2 (Int64ConstArrayView nodes_unique_id, Int32ArrayView new_index)
 Reorders the nodes of a face.
void Arcane::mesh_utils::shrinkMeshGroups (IMesh *mesh)
 Optimizes the memory usage of the groups.
void Arcane::mesh_utils::writeMeshConnectivity (IMesh *mesh, const String &file_name)
 Writes the connectivity of the mesh mesh to the file file_name.
void Arcane::mesh_utils::writeMeshInfos (IMesh *mesh, const String &file_name)
void Arcane::mesh_utils::writeMeshInfosSorted (IMesh *mesh, const String &file_name)
 Writes the mesh info mesh to the file file_name.
void Arcane::mesh_utils::writeMeshItemInfo (ISubDomain *, Cell cell, bool depend_info=true)

Detailed Description

Utility functions for the mesh.

Definition in file MeshUtils.h.

Function Documentation

◆ checkMeshConnectivity() [1/3]

void Arcane::MeshUtils::checkMeshConnectivity ( IMesh * mesh,
const XmlNode & root_node,
bool check_sub_domain )

Definition at line 212 of file MeshUtils.cc.

◆ checkMeshConnectivity() [2/3]

void Arcane::MeshUtils::checkMeshConnectivity ( IMesh * mesh,
const String & file_name,
bool check_sub_domain )

Definition at line 1137 of file MeshUtils.cc.

◆ checkMeshConnectivity() [3/3]

void Arcane::MeshUtils::checkMeshConnectivity ( IMesh * mesh,
const XmlNode & root_node,
bool check_sub_domain )

Definition at line 1128 of file MeshUtils.cc.

◆ checkMeshProperties() [1/2]

void Arcane::MeshUtils::checkMeshProperties ( IMesh * mesh,
bool is_sorted,
bool has_no_hole,
bool check_faces )

Checks if the mesh has certain properties.

If is_sorted, checks that the mesh entities are sorted by ascending order of their uniqueId(). If has_no_hole is true, checks that if the mesh has n entities of a certain type, their local number ranges from 0 to n-1. If check_faces is true, it checks the faces. This option is only usable for older generation meshes (MeshV1) and will be removed as soon as this option is no longer used.

Definition at line 190 of file MeshUtils.cc.

◆ checkMeshProperties() [2/2]

void Arcane::MeshUtils::checkMeshProperties ( IMesh * mesh,
bool is_sorted,
bool has_no_hole,
bool check_faces )

Checks if the mesh has certain properties.

If is_sorted, checks that the mesh entities are sorted by ascending order of their uniqueId(). If has_no_hole is true, checks that if the mesh has n entities of a certain type, their local number ranges from 0 to n-1. If check_faces is true, it checks the faces. This option is only usable for older generation meshes (MeshV1) and will be removed as soon as this option is no longer used.

Definition at line 1352 of file MeshUtils.cc.

References ARCANE_FATAL, ENUMERATE_ITEM, Arcane::ITraceMng::error(), Arcane::IK_Face, Arcane::IK_Particle, Arcane::Item::localId(), Arcane::Item::null(), and Arcane::Item::uniqueId().

Here is the call graph for this function:

◆ checkResizeArray()

template<typename DataType>
bool Arcane::MeshUtils::checkResizeArray ( Array< DataType > & array,
Int64 new_size,
bool force_resize )
inline

Resizes an array that is indexed by 'ItemLocalId'.

The array array is resized only if new_size is greater than the current size of the array or if force_resize is true.

If the array is resized, additional capacity is reserved to avoid reallocating every time.

This function is generally called for arrays indexed by an ItemLocalId, and therefore this function can be called every time an entity is added to the mesh.

Return values
trueif a resize occurred
falseotherwise

Definition at line 401 of file MeshUtils.h.

References Arcane::MemoryUtils::checkResizeArrayWithCapacity().

Here is the call graph for this function:

◆ checkUniqueIdsHashCollective()

void Arcane::MeshUtils::checkUniqueIdsHashCollective ( IItemFamily * family,
IHashAlgorithm * hash_algo,
const String & expected_hash,
bool print_hash_value,
bool include_ghost )

Checks the hash of the uniqueId() of entities in a family.

Calculates a hash of the uniqueId() of entities in a family using the hash_algo algorithm. For this calculation, rank 0 retrieves the set of uniqueIds() of the local entities of each subdomain, sorts them, and calculates the hash on the sorted array.

Since most of the work is performed by rank 0, this method is not very extensible and should therefore only be used for testing purposes.

expected_hash is the expected hash value in hexadecimal characters (obtained via Convert::toHexaString()). If expected_hash is not null, it compares the result with this value and, if different, throws a FatalErrorException.

This operation is collective.

Definition at line 1881 of file MeshUtils.cc.

References Arcane::Array< T >::add(), Arcane::IParallelMng::allGatherVariable(), Arcane::IItemFamily::allItems(), ARCANE_CHECK_POINTER, ARCANE_FATAL, Arcane::asBytes(), Arcane::Array< T >::begin(), Arcane::IHashAlgorithm::computeHash64(), Arcane::Array< T >::constSpan(), Arcane::String::empty(), Arcane::Array< T >::end(), ENUMERATE_, Arcane::IItemFamily::fullName(), Arcane::ITraceMng::info(), Arcane::IItemFamily::name(), Arcane::ItemGroup::own(), Arcane::IItemFamily::parallelMng(), Arcane::Convert::toHexaString(), Arcane::IItemFamily::traceMng(), and Arcane::Item::uniqueId().

Here is the call graph for this function:

◆ computeAndSetOwnerForEdges()

void Arcane::MeshUtils::computeAndSetOwnerForEdges ( IMesh * mesh)

Determines the owners of the edges.

The determination is based on the owners of the cells. There should be no layers of ghost cells.

This operation is collective.

Definition at line 1962 of file MeshUtils.cc.

References ARCANE_CHECK_POINTER.

◆ computeAndSetOwnerForFaces()

void Arcane::MeshUtils::computeAndSetOwnerForFaces ( IMesh * mesh)

Determines the owners of the faces.

The determination is based on the owners of the cells. There should be no layers of ghost cells.

This operation is collective.

Definition at line 1972 of file MeshUtils.cc.

References ARCANE_CHECK_POINTER.

◆ computeAndSetOwnerForNodes()

void Arcane::MeshUtils::computeAndSetOwnerForNodes ( IMesh * mesh)

Determines the owners of the nodes.

The determination is based on the owners of the cells. There should be no layers of ghost cells.

This operation is collective.

Definition at line 1952 of file MeshUtils.cc.

References ARCANE_CHECK_POINTER.

◆ computeBoundaryNodeNodeViaEdgeConnectivity()

Ref< IIndexedIncrementalItemConnectivity > Arcane::MeshUtils::computeBoundaryNodeNodeViaEdgeConnectivity ( IMesh * mesh,
const String & connectivity_name )

Creates or recreates a node-node connectivity via edges for nodes on the boundary faces of the mesh.

The connectivity will be named connectivity_name.

Definition at line 129 of file MeshUtils2.cc.

References ARCANE_CHECK_POINTER, Arcane::ItemTypeInfo::LocalEdge::beginNode(), Arcane::Face::cell(), Arcane::Node::cells(), Arcane::ItemTypeInfo::LocalEdge::endNode(), ENUMERATE_, Arcane::Item::isOwn(), Arcane::ItemTypeInfo::localEdge(), Arcane::Face::nbCell(), Arcane::ItemTypeInfo::nbLocalEdge(), Arcane::ItemWithNodes::nodeIds(), and Arcane::Item::owner().

Here is the call graph for this function:

◆ computeCapacity()

Int64 Arcane::MeshUtils::impl::computeCapacity ( Int64 size)
inline

Definition at line 375 of file MeshUtils.h.

◆ computeConnectivityPatternOccurence() [1/2]

Calculates and displays common patterns in the connectivities.

Definition at line 254 of file MeshUtils.cc.

◆ computeConnectivityPatternOccurence() [2/2]

void Arcane::MeshUtils::computeConnectivityPatternOccurence ( IMesh * mesh)

Calculates and displays common patterns in the connectivities.

Definition at line 1781 of file MeshUtils.cc.

References ARCANE_CHECK_POINTER.

◆ computeNodeNodeViaEdgeConnectivity()

Ref< IIndexedIncrementalItemConnectivity > Arcane::MeshUtils::computeNodeNodeViaEdgeConnectivity ( IMesh * mesh,
const String & connectivity_name )

Creates or recreates a node-node connectivity via edges.

The connectivity will be named connectivity_name.

Definition at line 94 of file MeshUtils2.cc.

References ARCANE_CHECK_POINTER, Arcane::ItemTypeInfo::LocalEdge::beginNode(), Arcane::Node::cells(), Arcane::ItemTypeInfo::LocalEdge::endNode(), ENUMERATE_, Arcane::ItemTypeInfo::localEdge(), Arcane::Item::localId(), and Arcane::ItemTypeInfo::nbLocalEdge().

Here is the call graph for this function:

◆ dumpSynchronizerTopologyJSON() [1/2]

Writes the topology information of a synchronizer to a file.

Writes the topology information of var_syncer to the file filename. This method is collective. Only rank 0 writes the topology information.

Definition at line 247 of file MeshUtils.cc.

◆ dumpSynchronizerTopologyJSON() [2/2]

void Arcane::MeshUtils::dumpSynchronizerTopologyJSON ( IVariableSynchronizer * var_syncer,
const String & filename )

Writes the topology information of a synchronizer to a file.

Writes the topology information of var_syncer to the file filename. This method is collective. Only rank 0 writes the topology information.

Definition at line 1675 of file MeshUtils.cc.

References Arcane::StringView::bytes(), Arcane::IParallelMng::commRank(), Arcane::IParallelMng::commSize(), Arcane::IVariableSynchronizer::communicatingRanks(), Arcane::IParallelMng::gather(), Arcane::IParallelMng::gatherVariable(), Arcane::ITraceMng::info(), Arcane::String::localstr(), Arcane::IVariableSynchronizer::parallelMng(), Arcane::IVariableSynchronizer::sharedItems(), Arcane::ConstArrayView< T >::size(), and Arcane::IParallelMng::traceMng().

Here is the call graph for this function:

◆ fillUniqueIds()

void Arcane::MeshUtils::fillUniqueIds ( ItemVectorView items,
Array< Int64 > & uids )

Fills uids with the uniqueId() of the entities in view.

Definition at line 1916 of file MeshUtils.cc.

References ENUMERATE_ITEM, Arcane::Array< T >::resize(), and Arcane::ItemVectorView::size().

Here is the call graph for this function:

◆ findOneItem() [1/2]

impl::ItemBase Arcane::MeshUtils::findOneItem ( IItemFamily * family,
Int64 unique_id )

Definition at line 1825 of file MeshUtils.cc.

◆ findOneItem() [2/2]

impl::ItemBase Arcane::MeshUtils::findOneItem ( IItemFamily * family,
ItemUniqueId unique_id )

Definition at line 1837 of file MeshUtils.cc.

◆ generateHashUniqueId()

Int64 Arcane::MeshUtils::generateHashUniqueId ( SmallSpan< const Int64 > nodes_unique_id)

Generates a unique identifier from a list of node identifiers.

Definition at line 1928 of file MeshUtils.cc.

References Arcane::SpanImpl< T, SizeType, Extent >::size().

Here is the call graph for this function:

◆ getFaceFromNodesLocal() [1/2]

Face Arcane::MeshUtils::getFaceFromNodesLocal ( Node node,
Int32ConstArrayView face_nodes_local_id )
inline

Definition at line 126 of file MeshUtils.h.

◆ getFaceFromNodesLocal() [2/2]

Face Arcane::MeshUtils::getFaceFromNodesLocal ( Node node,
Int32ConstArrayView face_nodes_local_id )
inline

Definition at line 126 of file MeshUtils.h.

◆ getFaceFromNodesLocalId()

Face Arcane::MeshUtils::getFaceFromNodesLocalId ( Node node,
Int32ConstArrayView face_nodes_local_id )

Searches for a face entity using the local numbers of these nodes.

Searches for the face given by the sorted list of local numbers of these nodes face_nodes_local_id. node must be the first node of the face. The nodes of the face must be correctly oriented, as after calling reorderNodesOfFace().

Returns
the corresponding face or a null face if it is not found.

Definition at line 1555 of file MeshUtils.cc.

References Arcane::Node::face(), Arcane::Item::localId(), Arcane::Node::nbFace(), Arcane::ItemWithNodes::nbNode(), Arcane::ItemWithNodes::node(), and Arcane::ConstArrayView< T >::size().

Here is the call graph for this function:

◆ getFaceFromNodesUnique() [1/2]

Face Arcane::MeshUtils::getFaceFromNodesUnique ( Node node,
Int64ConstArrayView face_nodes_unique_id )
inline

Definition at line 148 of file MeshUtils.h.

◆ getFaceFromNodesUnique() [2/2]

Face Arcane::MeshUtils::getFaceFromNodesUnique ( Node node,
Int64ConstArrayView face_nodes_unique_id )
inline

Definition at line 148 of file MeshUtils.h.

◆ getFaceFromNodesUniqueId()

Face Arcane::MeshUtils::getFaceFromNodesUniqueId ( Node node,
Int64ConstArrayView face_nodes_unique_id )

Searches for a face entity using the unique numbers of these nodes.

Searches for the face given by the sorted list of unique numbers of these nodes face_nodes_unique_id. node must be the first node of the face. The nodes of the face must be correctly oriented, as after calling reorderNodesOfFace().

Returns
the corresponding face or a null face if it is not found.

Definition at line 1579 of file MeshUtils.cc.

References Arcane::Node::face(), Arcane::Node::nbFace(), Arcane::ItemWithNodes::nbNode(), Arcane::ItemWithNodes::node(), Arcane::ConstArrayView< T >::size(), and Arcane::Item::uniqueId().

Here is the call graph for this function:

◆ getMaxItemUniqueIdCollective()

ItemUniqueId Arcane::MeshUtils::getMaxItemUniqueIdCollective ( IMesh * mesh)

Returns the maximum of the uniqueId() of the standard entities of the mesh.

Standard entities are nodes, cells, faces, and edges. The operation is collective on mesh->parallelMng().

Definition at line 1866 of file MeshUtils.cc.

References Arcane::MessagePassing::ReduceMax.

◆ markMeshConnectivitiesAsMostlyReadOnly()

void Arcane::MeshUtils::markMeshConnectivitiesAsMostlyReadOnly ( IMesh * mesh,
RunQueue * q = nullptr,
bool do_prefetch = false )

Indicates that the mesh connectivities will not be regularly modified.

This function allows indicating that the connectivities associated with mesh entities (Node, Edge, Face, and Cell) are mostly read-only. Note that this does not concern particles.

When used on an accelerator, this allows duplicating information between the accelerator and the host to avoid multiple round trips if the connectivities are used on both simultaneously.

If q is non-null and do_prefetch is true, then VariableUtils::prefetchVariableAsync() is called for each variable managing the connectivity.

Definition at line 1799 of file MeshUtils.cc.

References Arcane::IVariable::hasTag(), Arcane::HostAndDeviceMostlyRead, Arcane::IVariable::meshHandle(), Arcane::MeshHandle::meshOrNull(), Arcane::IVariable::setAllocationInfo(), and Arcane::IVariableMng::usedVariables().

Here is the call graph for this function:

◆ printItems() [1/2]

void Arcane::MeshUtils::printItems ( std::ostream & ostr,
const String & name,
ItemGroup item_group )

Writes the description of items in group item_group to the stream ostr.

For display, a name name is associated.

Definition at line 223 of file MeshUtils.cc.

◆ printItems() [2/2]

void Arcane::MeshUtils::printItems ( std::ostream & ostr,
const String & name,
ItemGroup item_group )

Writes the description of items in group item_group to the stream ostr.

For display, a name name is associated.

Definition at line 1395 of file MeshUtils.cc.

References ENUMERATE_ITEM.

◆ printMeshGroupsMemoryUsage() [1/2]

Displays the memory usage of the mesh groups.

If print_level is 0, only the total memory usage is displayed. If print_level is 1 or more, the usage for each group is displayed.

Returns the memory consumed in bytes.

Definition at line 234 of file MeshUtils.cc.

◆ printMeshGroupsMemoryUsage() [2/2]

Int64 Arcane::MeshUtils::printMeshGroupsMemoryUsage ( IMesh * mesh,
Int32 print_level )

Displays the memory usage of the mesh groups.

If print_level is 0, only the total memory usage is displayed. If print_level is 1 or more, the usage for each group is displayed.

Returns the memory consumed in bytes.

Definition at line 1646 of file MeshUtils.cc.

References Arcane::ItemGroupImpl::capacity(), Arcane::ItemGroupImpl::hasComputeFunctor(), Arcane::ITraceMng::info(), Arcane::ItemGroupImpl::nbRef(), and Arcane::ItemGroupImpl::size().

Here is the call graph for this function:

◆ removeItemAndKeepOrder() [1/2]

Removes an entity while preserving order.

Removes the entity with local number local_id from the list items. Entities located after the removed entity are shifted to fill the gap. If no value in items equals local_id, an exception is raised.

Definition at line 173 of file MeshUtils.cc.

◆ removeItemAndKeepOrder() [2/2]

void Arcane::MeshUtils::removeItemAndKeepOrder ( Int32ArrayView items,
Int32 local_id )

Removes an entity while preserving order.

Removes the entity with local number local_id from the list items. Entities located after the removed entity are shifted to fill the gap. If no value in items equals local_id, an exception is raised.

Definition at line 1603 of file MeshUtils.cc.

References ARCANE_FATAL, and Arcane::ArrayView< T >::size().

Here is the call graph for this function:

◆ reorderNodesOfFace() [1/2]

Reorders the nodes of a face.

This method reorders the list of nodes of a face so that the following properties are respected:

  • the first node of the face is the one with the smallest global number.
  • the second node of the face is the one with the second smallest global number.

This allows faces to be oriented identically in parallel.

before_ids and to must have the same number of elements

Parameters
before_idsglobal numbers of the face nodes before renumbering.
after_ids(output), global numbers of the face nodes after renumbering
Return values
trueif the face changes orientation during renumbering
falseotherwise.

Definition at line 76 of file MeshUtils.cc.

◆ reorderNodesOfFace() [2/2]

bool Arcane::MeshUtils::reorderNodesOfFace ( Int64ConstArrayView before_ids,
Int64ArrayView after_ids )

Reorders the nodes of a face.

This method reorders the list of nodes of a face so that the following properties are respected:

  • the first node of the face is the one with the smallest global number.
  • the second node of the face is the one with the second smallest global number.

This allows faces to be oriented identically in parallel.

before_ids and to must have the same number of elements

Parameters
before_idsglobal numbers of the face nodes before renumbering.
after_ids(output), global numbers of the face nodes after renumbering
Return values
trueif the face changes orientation during renumbering
falseotherwise.

Definition at line 1407 of file MeshUtils.cc.

References Arcane::ConstArrayView< T >::size().

Here is the call graph for this function:

◆ reorderNodesOfFace2() [1/2]

Reorders the nodes of a face.

This method reorders the list of nodes of a face so that the following properties are respected:

  • the first node of the face is the one with the smallest global number.
  • the second node of the face is the one with the second smallest global number.

This allows faces to be oriented identically in parallel.

nodes_unique_id and new_index must have the same number of elements

Parameters
nodes_unique_idunique numbers of the face nodes.
new_index(output), position of the node numbers after reorientation.

For example, if a face has 4 nodes with unique numbers 7 3 2 5, the reorientation will yield the quadruplet (2 3 7 5), which is the following index array (2,1,0,3).

Return values
trueif the face changes orientation during renumbering
falseotherwise.

◆ reorderNodesOfFace2() [2/2]

bool Arcane::MeshUtils::reorderNodesOfFace2 ( Int64ConstArrayView nodes_unique_id,
Int32ArrayView new_index )

Reorders the nodes of a face.

This method reorders the list of nodes of a face so that the following properties are respected:

  • the first node of the face is the one with the smallest global number.
  • the second node of the face is the one with the second smallest global number.

This allows faces to be oriented identically in parallel.

nodes_unique_id and new_index must have the same number of elements

Parameters
nodes_unique_idunique numbers of the face nodes.
new_index(output), position of the node numbers after reorientation.

For example, if a face has 4 nodes with unique numbers 7 3 2 5, the reorientation will yield the quadruplet (2 3 7 5), which is the following index array (2,1,0,3).

Return values
trueif the face changes orientation during renumbering
falseotherwise.

◆ shrinkMeshGroups() [1/2]

Optimizes the memory usage of the groups.

Definition at line 238 of file MeshUtils.cc.

◆ shrinkMeshGroups() [2/2]

void Arcane::MeshUtils::shrinkMeshGroups ( IMesh * mesh)

Optimizes the memory usage of the groups.

Definition at line 1634 of file MeshUtils.cc.

◆ visitGroups() [1/4]

template<typename LambdaType>
void Arcane::MeshUtils::visitGroups ( IItemFamily * family,
const LambdaType & f )
inline

Visits all groups of family using the lambda f.

This function allows applying a visitor to all groups of the family family.

For example:

IMesh* mesh = ...;
auto xx = [](const ItemGroup& x) { std::cout << "name=" << x.name(); };
MeshUtils::visitGroups(mesh,xx);

Definition at line 339 of file MeshUtils.h.

◆ visitGroups() [2/4]

void Arcane::MeshUtils::visitGroups ( IItemFamily * family,
IFunctorWithArgumentT< ItemGroup & > * functor )

Visits all groups of family using the functor functor.

Definition at line 31 of file MeshVisitor.cc.

References Arcane::IItemFamily::groups().

Here is the call graph for this function:

◆ visitGroups() [3/4]

template<typename LambdaType>
void Arcane::MeshUtils::visitGroups ( IMesh * mesh,
const LambdaType & f )
inline

Visits all groups of mesh using the lambda f.

This function allows applying a visitor to all groups of the families in the mesh mesh

It is used as follows:

IMesh* mesh = ...;
auto xx = [](const ItemGroup& x) { std::cout << "name=" << x.name(); };
MeshVisitor::visitGroups(mesh,xx);

Definition at line 365 of file MeshUtils.h.

◆ visitGroups() [4/4]

void Arcane::MeshUtils::visitGroups ( IMesh * mesh,
IFunctorWithArgumentT< ItemGroup & > * functor )

Visits all groups of mesh using the functor functor.

Definition at line 43 of file MeshVisitor.cc.

References Arcane::IItemFamily::groups().

Here is the call graph for this function:

◆ writeMeshConnectivity() [1/2]

void Arcane::MeshUtils::writeMeshConnectivity ( IMesh * mesh,
const String & file_name )

Writes the connectivity of the mesh mesh to the file file_name.

The connectivity of each edge, face, and cell entity is saved.

Definition at line 209 of file MeshUtils.cc.

◆ writeMeshConnectivity() [2/2]

◆ writeMeshInfos() [1/2]

void Arcane::MeshUtils::writeMeshInfos ( IMesh * mesh,
const String & file_name )

Definition at line 201 of file MeshUtils.cc.

◆ writeMeshInfos() [2/2]

void Arcane::MeshUtils::writeMeshInfos ( IMesh * mesh,
const String & file_name )

Definition at line 692 of file MeshUtils.cc.

◆ writeMeshInfosSorted() [1/2]

void Arcane::MeshUtils::writeMeshInfosSorted ( IMesh * mesh,
const String & file_name )

Writes the mesh info mesh to the file file_name.

Entity identifiers are sorted so that the mesh is identical regardless of the initial numbering.

Definition at line 198 of file MeshUtils.cc.

◆ writeMeshInfosSorted() [2/2]

void Arcane::MeshUtils::writeMeshInfosSorted ( IMesh * mesh,
const String & file_name )

Writes the mesh info mesh to the file file_name.

Entity identifiers are sorted so that the mesh is identical regardless of the initial numbering.

Definition at line 522 of file MeshUtils.cc.

References Arcane::Face::backCell(), Arcane::Edge::cell(), Arcane::Face::cell(), Arcane::Face::edge(), Arcane::Edge::face(), Arcane::Face::frontCell(), Arcane::IK_Cell, Arcane::IK_Edge, Arcane::IK_Face, Arcane::Item::localId(), Arcane::String::localstr(), Arcane::Edge::nbCell(), Arcane::Face::nbCell(), Arcane::Face::nbEdge(), Arcane::Edge::nbFace(), Arcane::Edge::nbNode(), Arcane::ItemWithNodes::nbNode(), Arcane::ItemWithNodes::node(), and Arcane::Item::null().

Here is the call graph for this function:

◆ writeMeshItemInfo() [1/5]

void Arcane::MeshUtils::writeMeshItemInfo ( ISubDomain * sd,
Cell cell,
bool depend_info = true )

Definition at line 46 of file MeshUtils.cc.

◆ writeMeshItemInfo() [2/5]

void Arcane::MeshUtils::writeMeshItemInfo ( ISubDomain * sd,
Cell cell,
bool depend_info = true )

Definition at line 157 of file MeshUtils.cc.

◆ writeMeshItemInfo() [3/5]

void Arcane::MeshUtils::writeMeshItemInfo ( ISubDomain * sd,
Edge edge,
bool depend_info = true )

Definition at line 273 of file MeshUtils.cc.

◆ writeMeshItemInfo() [4/5]

void Arcane::MeshUtils::writeMeshItemInfo ( ISubDomain * sd,
Face face,
bool depend_info = true )

Definition at line 327 of file MeshUtils.cc.

◆ writeMeshItemInfo() [5/5]

void Arcane::MeshUtils::writeMeshItemInfo ( ISubDomain * sd,
Node node,
bool depend_info = true )

Definition at line 219 of file MeshUtils.cc.