Arcane  v3.14.10.0
Documentation développeur
Chargement...
Recherche...
Aucune correspondance
MeshExchange.h
1// -*- tab-width: 2; indent-tabs-mode: nil; coding: utf-8-with-signature -*-
2//-----------------------------------------------------------------------------
3// Copyright 2000-2023 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/* MeshExchange.h (C) 2000-2023 */
9/* */
10/* Echange des entités de maillages entre entre sous-domaines. */
11/*---------------------------------------------------------------------------*/
12#ifndef ARCANE_MESH_MESHEXCHANGE_H
13#define ARCANE_MESH_MESHEXCHANGE_H
14/*---------------------------------------------------------------------------*/
15/*---------------------------------------------------------------------------*/
16
17#include "arcane/utils/TraceAccessor.h"
18
19#include "arcane/ArcaneTypes.h"
20#include "arcane/SerializeMessage.h"
21
22#include "arcane/mesh/MeshGlobal.h"
23
24#include <set>
25#include <map>
26
27/*---------------------------------------------------------------------------*/
28/*---------------------------------------------------------------------------*/
29
30namespace Arcane
31{
32class IMesh;
33class IParallelMng;
34class IItemFamily;
35}
36
37/*---------------------------------------------------------------------------*/
38/*---------------------------------------------------------------------------*/
39
40namespace Arcane::mesh
41{
42
43/*---------------------------------------------------------------------------*/
44/*---------------------------------------------------------------------------*/
49: public TraceAccessor
50{
51 private:
52
53 template<typename T>
55
56 template<typename T>
58
59 public:
60
61 MeshExchange(IMesh* mesh);
63
64 public:
65
67 void computeInfos();
68
69 public:
70
71 ARCCORE_DEPRECATED_2020("Do not use this method. Try to get ISubDomain from another way")
72 ISubDomain* subDomain() const;
73
74 IMesh* mesh() const { return m_mesh; }
75
78
79 private:
80
82 IParallelMng* m_parallel_mng;
83 Int32 m_nb_rank;
84 Int32 m_rank;
85 IItemFamily* m_cell_family;
86
89 void _addTreeCellToSend(ArrayView< std::set<Int32> > items_to_send,
90 Int32 local_id,Int32 cell_local_id,CellInfoListView cells);
91 void _addTreeItemToSend(Int32 cell_local_id, CellInfoListView cells);
92 void _addItemToSend2(ArrayView< std::set<Int32> > items_to_send,
93 Int32 item_local_id,Int32 cell_local_id);
94 void _familyTree (Int32Array& family,Cell item, const bool reset=true) const;
95 void _computeItemsToSend2();
96
97 void _computeMeshConnectivityInfos(Int32ConstArrayView cells_new_owner);
98 void _computeGraphConnectivityInfos();
99 void _exchangeCellDataInfos(Int32ConstArrayView cells_new_owner,bool use_active_cells);
100 void _computeItemsToSend(bool send_dof=false);
101 void _addItemToSend(ArrayView< std::set<Int32> > items_to_send,
102 Int32 item_local_id,Int32 cell_local_id,
103 bool use_itemfamily_network=false);
104
105 // Version based on ItemFamilyNetwork
107 void _exchangeCellDataInfos3();
108 void _computeItemsToSend3();
109 //void _addItemToSend3(ArrayView< std::set<Int32> > items_to_send,
110 // Int32 item_local_id,Int32 cell_local_id){}
111 void _propagatesToChildConnectivities(IItemFamily* family);
112 void _propagatesToChildDependencies(IItemFamily* family);
113 void _addDestRank(const Item& item, IItemFamily* item_family, const Integer new_owner);
114 void _addDestRank(const Item& item, IItemFamily* item_family, const Item& followed_item,
115 IItemFamily* followed_item_family);// add all the followed items destination rank to item
116 void _allocData(IItemFamily* family);
117 void _addGraphConnectivityToNewConnectivityInfo();
118
119 public:
120
121 std::map< IItemFamily*, UniqueArray< std::set<Int32> >* > m_items_to_send;
122
123 private:
124
125 IncrementalUnorderedMultiArray<Int32>* m_neighbour_cells_owner;
126 IncrementalUnorderedMultiArray<Int32>* m_neighbour_cells_new_owner;
127 DynamicMultiArray<Int32>* m_neighbour_extra_cells_owner;
128 DynamicMultiArray<Int32>* m_neighbour_extra_cells_new_owner;
129
132 void _setItemsToSend(IItemFamily* family);
133 void _printItemToSend(IItemFamily* family);// Debug print SDC
134 void _printItemToRemove(IItemFamily* family);// Debug print SDC
135
136 void _markRemovableItems(bool with_cell_family=true);
137 void _markRemovableDoFs();
138 void _markRemovableParticles();
139 void _markRemovableCells(Int32ConstArrayView cells_new_owner,bool use_active_cells);
140
141 // using ItemDestRankArray = IncrementalUnorderedMultiArray<Int32>; // l'un ou l'autre ?
143 using ItemDestRankMap = std::map<IItemFamily*,ItemDestRankArray*>;
145 ItemDestRankMap m_item_dest_ranks_map; // [family][item] = [item_destination_ranks]
146 ItemDestRankMapArray m_ghost_item_dest_ranks_map; //[rank][family][item]
147
148 void _debugPrint();
149
150 // Check subitems dest_ranks contain parent dest_rank (even after exchangeDataInfo...)
151 void _checkSubItemsDestRanks();
152 void _exchangeGhostItemDataInfos();
153 Integer _getSubdomainIndexInCommunicatingRanks(Integer rank, Int32ConstArrayView communicating_ranks);
154};
155
156/*---------------------------------------------------------------------------*/
157/*---------------------------------------------------------------------------*/
158
159} // End namespace Arcane::mesh
160
161/*---------------------------------------------------------------------------*/
162/*---------------------------------------------------------------------------*/
163
164#endif
Tableau d'items de types quelconques.
Vue sur les informations des mailles.
Maille d'un maillage.
Definition Item.h:1178
Interface d'une famille d'entités.
Interface du gestionnaire de parallélisme pour un sous-domaine.
Interface du gestionnaire d'un sous-domaine.
Definition ISubDomain.h:74
Classe de base d'un élément de maillage.
Definition Item.h:83
Lecteur des fichiers de maillage via la bibliothèque LIMA.
Definition Lima.cc:120
Echange des entités de maillages entre entre sous-domaines.
ConstArrayView< std::set< Int32 > > getItemsToSend(IItemFamily *family) const
Liste par sous-domaine des entités à envoyer pour la famille family.
void computeInfos()
Calcule les infos.
IMesh * m_mesh
Maillage.
ArrayView< std::set< Int32 > > _getItemsToSend(IItemFamily *family)
Liste par sous-domaine des entités à envoyer pour la famille family.
void _printItemToSend(IItemFamily *family)
Utilisant ItemFamilyNetwork.
void _computeMeshConnectivityInfos2(Int32ConstArrayView cells_new_owner)
AMR.
void _computeMeshConnectivityInfos3()
AMR OFF.
Vue modifiable d'un tableau d'un type T.
Vue constante d'un tableau de type T.
Vecteur 1D de données avec sémantique par valeur (style STL).
-*- tab-width: 2; indent-tabs-mode: nil; coding: utf-8-with-signature -*-