Utility functions for the mesh. More...
#include "arcane/utils/FunctorUtils.h"#include "arcane/utils/MemoryUtils.h"#include "arcane/core/Item.h"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) |
| 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< IIndexedIncrementalItemConnectivity > | Arcane::MeshUtils::computeNodeNodeViaEdgeConnectivity (IMesh *mesh, const String &connectivity_name) |
| Creates or recreates a node-node connectivity via edges. | |
| 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. | |
| 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) |
| 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) |
Utility functions for the mesh.
Definition in file MeshUtils.h.
| void Arcane::MeshUtils::checkMeshConnectivity | ( | IMesh * | mesh, |
| const XmlNode & | root_node, | ||
| bool | check_sub_domain ) |
Definition at line 212 of file MeshUtils.cc.
| void Arcane::MeshUtils::checkMeshConnectivity | ( | IMesh * | mesh, |
| const String & | file_name, | ||
| bool | check_sub_domain ) |
Definition at line 1137 of file MeshUtils.cc.
| void Arcane::MeshUtils::checkMeshConnectivity | ( | IMesh * | mesh, |
| const XmlNode & | root_node, | ||
| bool | check_sub_domain ) |
Definition at line 1128 of file MeshUtils.cc.
| 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.
| 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().
|
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.
| true | if a resize occurred |
| false | otherwise |
Definition at line 401 of file MeshUtils.h.
References Arcane::MemoryUtils::checkResizeArrayWithCapacity().
| 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().
| 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.
| 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.
| 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.
| 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().
|
inline |
Definition at line 375 of file MeshUtils.h.
| void Arcane::MeshUtils::computeConnectivityPatternOccurence | ( | IMesh * | mesh | ) |
Definition at line 254 of file MeshUtils.cc.
| void Arcane::MeshUtils::computeConnectivityPatternOccurence | ( | IMesh * | mesh | ) |
Definition at line 1781 of file MeshUtils.cc.
| 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().
| 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 247 of file MeshUtils.cc.
| 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().
| 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().
| impl::ItemBase Arcane::MeshUtils::findOneItem | ( | IItemFamily * | family, |
| Int64 | unique_id ) |
Definition at line 1825 of file MeshUtils.cc.
| impl::ItemBase Arcane::MeshUtils::findOneItem | ( | IItemFamily * | family, |
| ItemUniqueId | unique_id ) |
Definition at line 1837 of file MeshUtils.cc.
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().
|
inline |
Definition at line 126 of file MeshUtils.h.
|
inline |
Definition at line 126 of file MeshUtils.h.
| 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().
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().
|
inline |
Definition at line 148 of file MeshUtils.h.
|
inline |
Definition at line 148 of file MeshUtils.h.
| 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().
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().
| 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.
| 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().
| 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.
| 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.
| 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 234 of file MeshUtils.cc.
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().
| 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 173 of file MeshUtils.cc.
| 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().
| 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:
This allows faces to be oriented identically in parallel.
before_ids and to must have the same number of elements
| before_ids | global numbers of the face nodes before renumbering. |
| after_ids | (output), global numbers of the face nodes after renumbering |
| true | if the face changes orientation during renumbering |
| false | otherwise. |
Definition at line 76 of file MeshUtils.cc.
| 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:
This allows faces to be oriented identically in parallel.
before_ids and to must have the same number of elements
| before_ids | global numbers of the face nodes before renumbering. |
| after_ids | (output), global numbers of the face nodes after renumbering |
| true | if the face changes orientation during renumbering |
| false | otherwise. |
Definition at line 1407 of file MeshUtils.cc.
References Arcane::ConstArrayView< T >::size().
| 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:
This allows faces to be oriented identically in parallel.
nodes_unique_id and new_index must have the same number of elements
| nodes_unique_id | unique 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).
| true | if the face changes orientation during renumbering |
| false | otherwise. |
| 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:
This allows faces to be oriented identically in parallel.
nodes_unique_id and new_index must have the same number of elements
| nodes_unique_id | unique 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).
| true | if the face changes orientation during renumbering |
| false | otherwise. |
| void Arcane::MeshUtils::shrinkMeshGroups | ( | IMesh * | mesh | ) |
Optimizes the memory usage of the groups.
Definition at line 238 of file MeshUtils.cc.
| void Arcane::MeshUtils::shrinkMeshGroups | ( | IMesh * | mesh | ) |
Optimizes the memory usage of the groups.
Definition at line 1634 of file MeshUtils.cc.
|
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:
Definition at line 339 of file MeshUtils.h.
| 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().
|
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:
Definition at line 365 of file MeshUtils.h.
| 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().
| 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.
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 828 of file MeshUtils.cc.
References Arcane::Array< T >::add(), Arcane::arcaneCheckArraySize(), Arcane::Node::cells(), Arcane::Array< T >::clear(), ENUMERATE_, ENUMERATE_FACE, Arcane::TiedFace::face(), Arcane::IK_Cell, Arcane::IK_Edge, Arcane::IK_Face, Arcane::IK_Node, Arcane::ITraceMng::info(), Arcane::ItemGroup::isLocalToSubDomain(), Arcane::TiedNode::isoCoordinates(), Arcane::itemKindName(), Arcane::String::localstr(), Arcane::ItemGroup::name(), Arcane::TiedNode::node(), Arcane::Item::null(), Arcane::ItemBase::owner(), Arcane::Array< T >::reserve(), Arcane::Array< T >::resize(), Arcane::AbstractArray< T >::size(), Arcane::ConstMultiArray2View< DataType >::size(), Arcane::Item::uniqueId(), and Arcane::ItemBase::uniqueId().
Definition at line 201 of file MeshUtils.cc.
Definition at line 692 of file MeshUtils.cc.
| 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.
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().
| void Arcane::MeshUtils::writeMeshItemInfo | ( | ISubDomain * | sd, |
| Cell | cell, | ||
| bool | depend_info = true ) |
Definition at line 46 of file MeshUtils.cc.
| void Arcane::MeshUtils::writeMeshItemInfo | ( | ISubDomain * | sd, |
| Cell | cell, | ||
| bool | depend_info = true ) |
Definition at line 157 of file MeshUtils.cc.
| void Arcane::MeshUtils::writeMeshItemInfo | ( | ISubDomain * | sd, |
| Edge | edge, | ||
| bool | depend_info = true ) |
Definition at line 273 of file MeshUtils.cc.
| void Arcane::MeshUtils::writeMeshItemInfo | ( | ISubDomain * | sd, |
| Face | face, | ||
| bool | depend_info = true ) |
Definition at line 327 of file MeshUtils.cc.
| void Arcane::MeshUtils::writeMeshItemInfo | ( | ISubDomain * | sd, |
| Node | node, | ||
| bool | depend_info = true ) |
Definition at line 219 of file MeshUtils.cc.