12#ifndef ARCANE_CORE_MESHUTILS_H
13#define ARCANE_CORE_MESHUTILS_H
17#include "arcane/utils/FunctorUtils.h"
20#include "arcane/core/Item.h"
43namespace Arcane::MeshUtils
45extern "C++" ARCANE_CORE_EXPORT
void
46writeMeshItemInfo(ISubDomain*,
Cell cell,
bool depend_info =
true);
47extern "C++" ARCANE_CORE_EXPORT
void
48writeMeshItemInfo(ISubDomain*, Node node,
bool depend_info =
true);
49extern "C++" ARCANE_CORE_EXPORT
void
50writeMeshItemInfo(ISubDomain*, Edge edge,
bool depend_info =
true);
51extern "C++" ARCANE_CORE_EXPORT
void
52writeMeshItemInfo(ISubDomain*, Face face,
bool depend_info =
true);
75extern "C++" ARCANE_CORE_EXPORT
bool
78extern "C++" ARCANE_CORE_EXPORT
bool
106extern "C++" ARCANE_CORE_EXPORT
bool
121extern "C++" ARCANE_CORE_EXPORT
Face
124ARCANE_DEPRECATED_REASON(
"Y2025: Use getFaceFromNodesLocalId() instead")
143extern "C++" ARCANE_CORE_EXPORT
Face
146ARCANE_DEPRECATED_REASON(
"Y2025: Use getFaceFromNodesUniqueId() instead")
150 return getFaceFromNodesUniqueId(node, face_nodes_unique_id);
159extern "C++" ARCANE_CORE_EXPORT Int64
160generateHashUniqueId(SmallSpan<const Int64> nodes_unique_id);
172extern "C++" ARCANE_CORE_EXPORT
void
189extern "C++" ARCANE_CORE_EXPORT
void
190checkMeshProperties(IMesh* mesh,
bool is_sorted,
bool has_no_hole,
bool check_faces);
197extern "C++" ARCANE_CORE_EXPORT
void
198writeMeshInfosSorted(IMesh* mesh,
const String& file_name);
200extern "C++" ARCANE_CORE_EXPORT
void
201writeMeshInfos(IMesh* mesh,
const String& file_name);
208extern "C++" ARCANE_CORE_EXPORT
void
209writeMeshConnectivity(IMesh* mesh,
const String& file_name);
211extern "C++" ARCANE_CORE_EXPORT
void
212checkMeshConnectivity(IMesh* mesh,
const XmlNode& root_node,
bool check_sub_domain);
214extern "C++" ARCANE_CORE_EXPORT
void
215checkMeshConnectivity(IMesh* mesh,
const String& file_name,
bool check_sub_domain);
222extern "C++" ARCANE_CORE_EXPORT
void
223printItems(std::ostream& ostr,
const String& name, ItemGroup item_group);
233extern "C++" ARCANE_CORE_EXPORT Int64
234printMeshGroupsMemoryUsage(IMesh* mesh, Int32 print_level);
237extern "C++" ARCANE_CORE_EXPORT
void
238shrinkMeshGroups(IMesh* mesh);
246extern "C++" ARCANE_CORE_EXPORT
void
247dumpSynchronizerTopologyJSON(IVariableSynchronizer* var_syncer,
const String& filename);
253extern "C++" ARCANE_CORE_EXPORT
void
254computeConnectivityPatternOccurence(IMesh* mesh);
274extern "C++" ARCANE_CORE_EXPORT
void
275markMeshConnectivitiesAsMostlyReadOnly(IMesh* mesh, RunQueue* q =
nullptr,
276 bool do_prefetch =
false);
288extern "C++" ARCANE_CORE_EXPORT ItemBase
289findOneItem(IItemFamily* family, Int64 unique_id);
301extern "C++" ARCANE_CORE_EXPORT ItemBase
302findOneItem(IItemFamily* family, ItemUniqueId unique_id);
310extern "C++" ARCANE_CORE_EXPORT
void
311visitGroups(IItemFamily* family, IFunctorWithArgumentT<ItemGroup&>* functor);
319extern "C++" ARCANE_CORE_EXPORT
void
320visitGroups(IMesh* mesh, IFunctorWithArgumentT<ItemGroup&>* functor);
338template <
typename LambdaType>
inline void
364template <
typename LambdaType>
inline void
400template <
typename DataType>
inline bool
416getMaxItemUniqueIdCollective(
IMesh*
mesh);
439extern "C++" ARCANE_CORE_EXPORT
void
441 const String& expected_hash,
bool print_hash_value,
450extern "C++" ARCANE_CORE_EXPORT
void
462computeNodeNodeViaEdgeConnectivity(
IMesh*
mesh,
const String& connectivity_name);
474computeBoundaryNodeNodeViaEdgeConnectivity(
IMesh*
mesh,
const String& connectivity_name);
487extern "C++" ARCANE_CORE_EXPORT
void
501extern "C++" ARCANE_CORE_EXPORT
void
515extern "C++" ARCANE_CORE_EXPORT
void
526namespace Arcane::mesh_utils
531using MeshUtils::checkMeshConnectivity;
532using MeshUtils::checkMeshProperties;
533using MeshUtils::computeConnectivityPatternOccurence;
534using MeshUtils::dumpSynchronizerTopologyJSON;
535using MeshUtils::getFaceFromNodesLocal;
536using MeshUtils::getFaceFromNodesUnique;
537using MeshUtils::printItems;
538using MeshUtils::printMeshGroupsMemoryUsage;
539using MeshUtils::removeItemAndKeepOrder;
540using MeshUtils::reorderNodesOfFace;
541using MeshUtils::reorderNodesOfFace2;
542using MeshUtils::shrinkMeshGroups;
543using MeshUtils::writeMeshConnectivity;
544using MeshUtils::writeMeshInfos;
545using MeshUtils::writeMeshInfosSorted;
546using MeshUtils::writeMeshItemInfo;
bool checkResizeArray(Array< DataType > &array, Int64 new_size, bool force_resize)
Resizes an array that is indexed by 'ItemLocalId'.
bool reorderNodesOfFace(Int64ConstArrayView before_ids, Int64ArrayView after_ids)
Reorders the nodes of a face.
void visitGroups(IItemFamily *family, IFunctorWithArgumentT< ItemGroup & > *functor)
Visits all groups of family using the functor functor.
bool reorderNodesOfFace2(Int64ConstArrayView nodes_unique_id, Int32ArrayView new_index)
Reorders the nodes of a face.
Face getFaceFromNodesLocalId(Node node, Int32ConstArrayView face_nodes_local_id)
Searches for a face entity using the local numbers of these nodes.
Memory and allocator management functions.
Int64 computeCapacity(Int64 size)
Calculates an appropriate capacity for a size size.
Base class for 1D data vectors.
Interface of a functor with an argument but without a return value.
Interface of a hashing algorithm.
Interface of an entity family.
Interface of a variable synchronization service.
Unique identifier of an entity.
View on a vector of entities.
Reference to an instance.
Generic Functor using the std::function class.
Unicode character string.
Int32 checkResizeArrayWithCapacity(Array< DataType > &array, Int64 new_size, bool force_resize)
Resizes an array by adding a memory reserve.
-- tab-width: 2; indent-tabs-mode: nil; coding: utf-8-with-signature --
ArrayView< Int64 > Int64ArrayView
C equivalent of a 1D array of 64-bit integers.
std::int64_t Int64
Signed integer type of 64 bits.
ConstArrayView< Int32 > Int32ConstArrayView
C equivalent of a 1D array of 32-bit integers.
ConstArrayView< Int64 > Int64ConstArrayView
C equivalent of a 1D array of 64-bit integers.
ArrayView< Int32 > Int32ArrayView
C equivalent of a 1D array of 32-bit integers.
@ Cell
The mesh is AMR by cell.