Arcane  4.2.3.0
Developer documentation
Loading...
Searching...
No Matches
FaceUniqueIdBuilder.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/* FaceUniqueIdBuilder.h (C) 2000-2026 */
9/* */
10/* Construction of unique face IDs. */
11/*---------------------------------------------------------------------------*/
12#ifndef ARCANE_MESH_FACEUNIQUEIDBUILDER_H
13#define ARCANE_MESH_FACEUNIQUEIDBUILDER_H
14/*---------------------------------------------------------------------------*/
15/*---------------------------------------------------------------------------*/
16
17#include "arcane/utils/TraceAccessor.h"
18
19#include "arcane/mesh/DynamicMeshIncrementalBuilder.h"
20
21/*---------------------------------------------------------------------------*/
22/*---------------------------------------------------------------------------*/
23
24namespace Arcane::mesh
25{
26
27/*---------------------------------------------------------------------------*/
28/*---------------------------------------------------------------------------*/
29
30class DynamicMesh;
31class T_CellFaceInfo;
32
33/*---------------------------------------------------------------------------*/
34/*---------------------------------------------------------------------------*/
39: public TraceAccessor
40{
41 public:
42
43 using BoundaryInfosMap = HashTableMapT<Int32, SharedArray<Int64>>;
44 using BoundaryInfosMapEnumerator = HashTableMapEnumeratorT<Int32, SharedArray<Int64>>;
45
46 public:
47
50
51 public:
52
53 void computeFacesUniqueIds();
54
55 private:
56
57 DynamicMesh* m_mesh = nullptr;
58 DynamicMeshIncrementalBuilder* m_mesh_builder = nullptr;
60 bool m_is_v1_distributed = false;
61
62 private:
63
66 void _v1Distributed();
67 void _v1CheckAndDump(Int64ConstArrayView faces_new_uid, Int64ConstArrayView faces_opposite_cell_uid);
68 void _v1CellBlockSizes(Int64ConstArrayView faces_opposite_cell_uid,
69 IntegerArray& my_cells_nb_back_face,
70 Array<T_CellFaceInfo>& my_cells_faces_info);
71 void _v1ByAllGather(Int64ArrayView faces_opposite_cell_uid,
72 IntegerArrayView faces_opposite_cell_index,
73 IntegerArrayView faces_opposite_cell_owner,
74 HashTableMapT<Int64, Int64>& cells_first_face_uid,
75 IntegerArray& my_cells_nb_back_face,
76 Array<T_CellFaceInfo>& my_cells_faces_info);
77 void _v1AssignFaceUniqueIds(Int64ConstArrayView faces_opposite_cell_uid,
78 IntegerConstArrayView faces_opposite_cell_index,
79 IntegerConstArrayView faces_opposite_cell_owner,
80 HashTableMapT<Int64, Int64>& cells_first_face_uid,
81 IntegerConstArrayView my_cells_nb_back_face);
83 void _exchangeData(IParallelExchanger* exchanger, BoundaryInfosMap& boundary_infos_to_send);
84 void _checkNoDuplicate();
85};
86
87/*---------------------------------------------------------------------------*/
88/*---------------------------------------------------------------------------*/
89
90} // End namespace Arcane::mesh
91
92/*---------------------------------------------------------------------------*/
93/*---------------------------------------------------------------------------*/
94
95#endif
Base class for 1D data vectors.
Enumerator for a HashTableMap.
Hash table for associative arrays.
Information exchange between processors.
TraceAccessor(ITraceMng *m)
Constructs an accessor via the trace manager m.
Implementation of a mesh.
Definition DynamicMesh.h:98
void _computeFacesUniqueIdsParallelV2()
Calculates the unique IDs for each face in parallel V2.
void _v1CheckAndDump(Int64ConstArrayView faces_new_uid, Int64ConstArrayView faces_opposite_cell_uid)
Checks that every face has been numbered and, in verbose mode, writes one line per (cell,...
void _v1CellBlockSizes(Int64ConstArrayView faces_opposite_cell_uid, IntegerArray &my_cells_nb_back_face, Array< T_CellFaceInfo > &my_cells_faces_info)
Sizes every cell's block of face ids: its back faces plus its faces of the domain boundary.
void _computeFacesUniqueIdsSequential()
Calculates the unique IDs for each face sequentially.
void _v1AssignFaceUniqueIds(Int64ConstArrayView faces_opposite_cell_uid, IntegerConstArrayView faces_opposite_cell_index, IntegerConstArrayView faces_opposite_cell_owner, HashTableMapT< Int64, Int64 > &cells_first_face_uid, IntegerConstArrayView my_cells_nb_back_face)
Gives every face its uniqueId and its owner from the block starts.
void _v1Distributed()
Distributed computation of the face numbering of version 1.
FaceUniqueIdBuilder(DynamicMeshIncrementalBuilder *mesh_builder)
Constructs an instance for the mesh.
void _exchangeData(IParallelExchanger *exchanger, BoundaryInfosMap &boundary_infos_to_send)
void _v1ByAllGather(Int64ArrayView faces_opposite_cell_uid, IntegerArrayView faces_opposite_cell_index, IntegerArrayView faces_opposite_cell_owner, HashTableMapT< Int64, Int64 > &cells_first_face_uid, IntegerArray &my_cells_nb_back_face, Array< T_CellFaceInfo > &my_cells_faces_info)
The all-gather: every rank receives every boundary face, then every cell of the mesh,...
void _checkNoDuplicate()
Checks that there are no duplicate uniqueIds.
bool m_is_v1_distributed
Distribute the face numbering of version 1 (ARCANE_DISTRIBUTED_FACE_NUMBERING=1).
void _computeFacesUniqueIdsParallelV1()
Calculates the unique numbers for each face in parallel.
Helper class for parallel determination of face unique_ids.
ArrayView< Int64 > Int64ArrayView
C equivalent of a 1D array of 64-bit integers.
Definition UtilsTypes.h:445
ArrayView< Integer > IntegerArrayView
C equivalent of a 1D array of integers.
Definition UtilsTypes.h:451
Array< Integer > IntegerArray
Dynamic one-dimensional array of integers.
Definition UtilsTypes.h:127
ConstArrayView< Int64 > Int64ConstArrayView
C equivalent of a 1D array of 64-bit integers.
Definition UtilsTypes.h:474
ConstArrayView< Integer > IntegerConstArrayView
C equivalent of a 1D array of integers.
Definition UtilsTypes.h:480