Arcane  4.1.12.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-2024 */
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/utils/TraceAccessor.h"
18
19#include "arcane/mesh/DynamicMeshIncrementalBuilder.h"
20
21/*---------------------------------------------------------------------------*/
22/*---------------------------------------------------------------------------*/
23
24namespace Arcane
25{
26class SerializeBuffer;
27}
28
29namespace Arcane::mesh
30{
31class DynamicMesh;
32
33/*---------------------------------------------------------------------------*/
34/*---------------------------------------------------------------------------*/
39: public TraceAccessor
40{
41 public:
42
43 typedef DynamicMeshKindInfos::ItemInternalMap ItemInternalMap;
44
45 typedef HashTableMapT<Int32, SharedArray<Int64>> BoundaryInfosMap;
46 typedef HashTableMapEnumeratorT<Int32, SharedArray<Int64>> BoundaryInfosMapEnumerator;
47
48 public:
49
52 virtual ~GhostLayerBuilder();
53
54 public:
55
56 void addGhostLayers(bool is_allocate);
57
60 void addGhostChildFromParent2(Array<Int64>& ghost_cell_to_refine);
61
62 private:
63
64 DynamicMesh* m_mesh;
65 DynamicMeshIncrementalBuilder* m_mesh_builder;
66
67 private:
68
69 void _addOneGhostLayerV2();
70 void _exchangeData(IParallelExchanger* exchanger, BoundaryInfosMap& boundary_infos_to_send);
71 void _printItem(ItemInternal* ii, std::ostream& o);
72 void _exchangeCells(HashTableMapT<Int32, SharedArray<Int32>>& cells_to_send, bool with_flags);
73};
74
75/*---------------------------------------------------------------------------*/
76/*---------------------------------------------------------------------------*/
77//TBD to be defined elsewhere
78class NodeUidToSubDomain
79{
80 public:
81
82 NodeUidToSubDomain(Int64 max_uid, Int32 nb_rank);
83
84 Int32 uidToRank(Int64 uid)
85 {
86 Int32 rank = (Int32)(uid / m_nb_by_rank);
87 if (rank >= m_nb_rank)
88 --rank;
89 Int32 nrank = rank % m_modulo;
90 return nrank;
91 }
92 Int32 modulo() const { return m_modulo; }
93
94 private:
95
96 Int32 m_nb_rank;
97 Int32 m_modulo;
98 Int64 m_nb_by_rank;
99};
100
101/*---------------------------------------------------------------------------*/
102/*---------------------------------------------------------------------------*/
103
104} // End namespace Arcane::mesh
105
106/*---------------------------------------------------------------------------*/
107/*---------------------------------------------------------------------------*/
108
109#endif
Base class for 1D data vectors.
Enumerator for a HashTableMap.
Hash table for associative arrays.
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(DynamicMeshIncrementalBuilder *mesh_builder)
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.