Arcane  4.2.3.0
Developer documentation
Loading...
Searching...
No Matches
GhostLayerBuilder.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/* GhostLayerBuilder.h (C) 2000-2026 */
9/* */
10/* Construction of ghost layers. */
11/*---------------------------------------------------------------------------*/
12#ifndef ARCANE_MESH_GHOSTLAYERBUILDER_H
13#define ARCANE_MESH_GHOSTLAYERBUILDER_H
14/*---------------------------------------------------------------------------*/
15/*---------------------------------------------------------------------------*/
16
17#include "arcane/mesh/DynamicMeshKindInfos.h"
18#include "arcane/utils/TraceAccessor.h"
19
20/*---------------------------------------------------------------------------*/
21/*---------------------------------------------------------------------------*/
22
23namespace Arcane
24{
25class SerializeBuffer;
26}
27
28namespace Arcane::mesh
29{
30class DynamicMesh;
31
32/*---------------------------------------------------------------------------*/
33/*---------------------------------------------------------------------------*/
38: public TraceAccessor
39{
40 public:
41
42 typedef DynamicMeshKindInfos::ItemInternalMap ItemInternalMap;
43
44 typedef HashTableMapT<Int32, SharedArray<Int64>> BoundaryInfosMap;
45 typedef HashTableMapEnumeratorT<Int32, SharedArray<Int64>> BoundaryInfosMapEnumerator;
46
47 public:
48
50 explicit GhostLayerBuilder(IMesh* mesh);
51 virtual ~GhostLayerBuilder();
52
53 public:
54
55 void addGhostLayers(bool is_allocate);
56
59 void addGhostChildFromParent2(Array<Int64>& ghost_cell_to_refine);
60
61 private:
62
63 IMesh* m_mesh = nullptr;
64 IMeshInternal* m_mesh_internal = nullptr;
65
66 private:
67
68 void _addOneGhostLayerV2();
69 void _exchangeData(IParallelExchanger* exchanger, BoundaryInfosMap& boundary_infos_to_send);
70 void _printItem(ItemInternal* ii, std::ostream& o);
71 void _exchangeCells(HashTableMapT<Int32, SharedArray<Int32>>& cells_to_send, bool with_flags);
72};
73
74/*---------------------------------------------------------------------------*/
75/*---------------------------------------------------------------------------*/
76//TBD to be defined elsewhere
77class NodeUidToSubDomain
78{
79 public:
80
81 NodeUidToSubDomain(Int64 max_uid, Int32 nb_rank);
82
83 Int32 uidToRank(Int64 uid)
84 {
85 Int32 rank = (Int32)(uid / m_nb_by_rank);
86 if (rank >= m_nb_rank)
87 --rank;
88 Int32 nrank = rank % m_modulo;
89 return nrank;
90 }
91 Int32 modulo() const { return m_modulo; }
92
93 private:
94
95 Int32 m_nb_rank;
96 Int32 m_modulo;
97 Int64 m_nb_by_rank;
98};
99
100/*---------------------------------------------------------------------------*/
101/*---------------------------------------------------------------------------*/
102
103} // End namespace Arcane::mesh
104
105/*---------------------------------------------------------------------------*/
106/*---------------------------------------------------------------------------*/
107
108#endif
Base class for 1D data vectors.
Enumerator for a HashTableMap.
Hash table for associative arrays.
Internal part of IMesh.
Information exchange between processors.
Internal structure of a mesh entity.
Implementation of a buffer for serialization.
1D vector of data with reference semantics.
TraceAccessor(ITraceMng *m)
Constructs an accessor via the trace manager m.
Implementation of a mesh.
Definition DynamicMesh.h:98
GhostLayerBuilder(IMesh *mesh)
Constructs an instance for the mesh.
-- tab-width: 2; indent-tabs-mode: nil; coding: utf-8-with-signature --
std::int64_t Int64
Signed integer type of 64 bits.
std::int32_t Int32
Signed integer type of 32 bits.