Arcane  4.1.12.0
Developer documentation
Loading...
Searching...
No Matches
IMeshUtilities.h
1// -*- tab-width: 2; indent-tabs-mode: nil; coding: utf-8-with-signature -*-
2//-----------------------------------------------------------------------------
3// Copyright 2000-2026 CEA (www.cea.fr) IFPEN (www.ifpenergiesnouvelles.com)
4// See the top-level COPYRIGHT file for details.
5// SPDX-License-Identifier: Apache-2.0
6//-----------------------------------------------------------------------------
7/*---------------------------------------------------------------------------*/
8/* IMeshUtilities.h (C) 2000-2025 */
9/* */
10/* Interface of a class providing utility functions on meshes. */
11/*---------------------------------------------------------------------------*/
12#ifndef ARCANE_CORE_IMESHUTILITIES_H
13#define ARCANE_CORE_IMESHUTILITIES_H
14/*---------------------------------------------------------------------------*/
15/*---------------------------------------------------------------------------*/
16
17#include "arcane/utils/Real3.h"
18
22
23/*---------------------------------------------------------------------------*/
24/*---------------------------------------------------------------------------*/
25
26namespace Arcane
27{
28
29/*---------------------------------------------------------------------------*/
30/*---------------------------------------------------------------------------*/
31
35class ARCANE_CORE_EXPORT IMeshUtilities
36{
37 public:
38
39 virtual ~IMeshUtilities() = default;
40
41 public:
42
51 ARCANE_DEPRECATED_REASON("Y2025: Use getFacesLocalIdFromConnectivity() instead")
52 virtual void localIdsFromConnectivity(eItemKind item_kind,
53 IntegerConstArrayView items_nb_node,
54 Int64ConstArrayView items_connectivity,
55 Int32ArrayView local_ids,
56 bool allow_null = false) = 0;
57
83 ConstArrayView<Int64> items_connectivity,
84 ArrayView<Int32> local_ids,
85 bool allow_null = false) = 0;
86
107 virtual Real3 computeNormal(const FaceGroup& face_group,
108 const VariableNodeReal3& nodes_coord) = 0;
109
129 virtual Real3 computeDirection(const NodeGroup& node_group,
130 const VariableNodeReal3& nodes_coord,
131 Real3* n1, Real3* n2) = 0;
132
134 ARCANE_DEPRECATED_REASON("Y2020: Use computeAdjacency() instead")
135 virtual void computeAdjency(ItemPairGroup adjacency_array, eItemKind link_kind,
136 Integer nb_layer) = 0;
137
139 virtual void computeAdjacency(const ItemPairGroup& adjacency_array, eItemKind link_kind,
140 Integer nb_layer);
141
156 virtual void changeOwnersFromCells() = 0;
157
166 ARCANE_DEPRECATED_REASON("Y2025: Use MeshUtils::computeAndSetOwnerForNodes() instead")
167 virtual void computeAndSetOwnersForNodes() = 0;
168
177 ARCANE_DEPRECATED_REASON("Y2025: Use MeshUtils::computeAndSetOwnerForEdges() instead")
178 virtual void computeAndSetOwnersForEdges() = 0;
179
188 ARCANE_DEPRECATED_REASON("Y2025: Use MeshUtils::computeAndSetOwnerForFaces() instead")
189 virtual void computeAndSetOwnersForFaces() = 0;
190
200 virtual bool writeToFile(const String& file_name, const String& service_name) = 0;
201
230 bool initial_partition) = 0;
231
235 virtual void mergeNodes(Int32ConstArrayView nodes_local_id,
236 Int32ConstArrayView nodes_to_merge_local_id)
237 {
238 this->mergeNodes(nodes_local_id, nodes_to_merge_local_id, false);
239 }
240
259 virtual void mergeNodes(Int32ConstArrayView nodes_local_id,
260 Int32ConstArrayView nodes_to_merge_local_id,
261 bool allow_non_corresponding_face) = 0;
271};
272
273/*---------------------------------------------------------------------------*/
274/*---------------------------------------------------------------------------*/
275
276} // End namespace Arcane
277
278/*---------------------------------------------------------------------------*/
279/*---------------------------------------------------------------------------*/
280
281#endif
Declarations of Arcane's general types.
Declarations of types on entities.
Modifiable view of an array of type T.
Constant view of an array of type T.
Interface of a mesh partitioner.
Interface of a class providing utility functions on meshes.
virtual void changeOwnersFromCells()=0
Positions the new owners of nodes, edges, and faces based on the cells.
virtual ~IMeshUtilities()=default
Frees resources.
virtual void mergeNodes(Int32ConstArrayView nodes_local_id, Int32ConstArrayView nodes_to_merge_local_id)
Merges nodes.
virtual Real3 computeNormal(const FaceGroup &face_group, const VariableNodeReal3 &nodes_coord)=0
Calculates the normal of a face group.
virtual void computeAdjency(ItemPairGroup adjacency_array, eItemKind link_kind, Integer nb_layer)=0
Calculates adjacencies, stored in adjacency_array.
virtual void mergeNodes(Int32ConstArrayView nodes_local_id, Int32ConstArrayView nodes_to_merge_local_id, bool allow_non_corresponding_face)=0
Merges nodes.
virtual void computeAndSetOwnersForFaces()=0
Determines the owners of the faces.
virtual void computeAdjacency(const ItemPairGroup &adjacency_array, eItemKind link_kind, Integer nb_layer)
Calculates adjacencies, stored in adjacency_array.
virtual void computeAndSetOwnersForEdges()=0
Determines the owners of the edges.
virtual void computeAndSetOwnersForNodes()=0
Determines the owners of the nodes.
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 void partitionAndExchangeMeshWithReplication(IMeshPartitionerBase *partitioner, bool initial_partition)=0
Repartitions and exchanges the mesh while managing replication.
virtual Real3 computeDirection(const NodeGroup &node_group, const VariableNodeReal3 &nodes_coord, Real3 *n1, Real3 *n2)=0
Calculates the direction vector of a line.
virtual bool writeToFile(const String &file_name, const String &service_name)=0
Writes the mesh to a file.
virtual void recomputeItemsUniqueIdFromNodesUniqueId()=0
Recalculates the uniqueId() of edges, faces, and cells based on the uniqueId() of the nodes.
Table of entity lists.
Type of an entity (Item).
Definition ItemTypeId.h:33
Class managing a 3-dimensional real vector.
Definition Real3.h:132
ItemGroupT< Face > FaceGroup
Group of faces.
Definition ItemTypes.h:179
ItemGroupT< Node > NodeGroup
Group of nodes.
Definition ItemTypes.h:168
MeshVariableScalarRefT< Node, Real3 > VariableNodeReal3
Coordinate type quantity at node.
-- tab-width: 2; indent-tabs-mode: nil; coding: utf-8-with-signature --
std::int64_t Int64
Signed integer type of 64 bits.
Int32 Integer
Type representing an integer.
ConstArrayView< Int32 > Int32ConstArrayView
C equivalent of a 1D array of 32-bit integers.
Definition UtilsTypes.h:482
ConstArrayView< Int64 > Int64ConstArrayView
C equivalent of a 1D array of 64-bit integers.
Definition UtilsTypes.h:480
ArrayView< Int32 > Int32ArrayView
C equivalent of a 1D array of 32-bit integers.
Definition UtilsTypes.h:453
eItemKind
Mesh entity type.
ConstArrayView< Integer > IntegerConstArrayView
C equivalent of a 1D array of integers.
Definition UtilsTypes.h:486
std::int32_t Int32
Signed integer type of 32 bits.