91class ARCANE_MESH_EXPORT GraphIncrementalConnectivity
96 GraphIncrementalConnectivity(
IItemFamily const* dualnode_family,
102 : m_dualnode_family(dualnode_family)
103 , m_link_family(link_family)
104 , m_dualnode_connectivity(dualnode_connectivity)
105 , m_link_connectivity(link_connectivity)
106 , m_dualitem_connectivities(dualitem_connectivities)
107 , m_dualnode_to_connectivity_index(dualnode_to_connectivity)
110 GraphIncrementalConnectivity(GraphIncrementalConnectivity
const& rhs)
111 : m_dualnode_family(rhs.m_dualnode_family)
112 , m_link_family(rhs.m_link_family)
113 , m_dualnode_connectivity(rhs.m_dualnode_connectivity)
114 , m_link_connectivity(rhs.m_link_connectivity)
115 , m_dualitem_connectivities(rhs.m_dualitem_connectivities)
116 , m_dualnode_to_connectivity_index(rhs.m_dualnode_to_connectivity_index)
119 GraphIncrementalConnectivity(
GraphDoFs* graph);
121 virtual ~GraphIncrementalConnectivity() {}
125 auto dualitem_connectivity_accessor = m_dualitem_connectivities[m_dualnode_to_connectivity_index[dualNode]]->connectivityAccessor();
126 return dualitem_connectivity_accessor(
ItemLocalId(dualNode))[0];
131 return m_dualnode_connectivity->connectivityAccessor()(
ItemLocalId(dualNode));
136 return m_link_connectivity->connectivityAccessor()(
ItemLocalId(link));
149class ARCANE_MESH_EXPORT GraphDoFs
156 friend class GraphIncrementalConnectivity;
158 typedef DynamicMeshKindInfos::ItemInternalMap ItemInternalMap;
160 static const String dualNodeFamilyName() {
return "DualNodes"; }
161 static const String linkFamilyName() {
return "Links"; }
165 GraphDoFs(
IMesh*
mesh,
String particle_family_name = ParticleFamily::defaultFamilyName());
167 virtual ~GraphDoFs() {}
175 return m_graph_connectivity.get();
181 m_connectivity_observer.push_back(std::unique_ptr<IGraphConnectivityObserver>(observer));
185 void releaseGraphConnectivityObserver(
Integer observer_id)
override
187 if ((observer_id >= 0) && (observer_id < (
Integer)m_connectivity_observer.size()))
188 m_connectivity_observer[observer_id].reset();
194 m_graph_observer.push_back(std::unique_ptr<IGraphObserver>(observer));
198 void releaseGraphObserver(
Integer observer_id)
override
200 if ((observer_id >= 0) && (observer_id < (
Integer)m_graph_observer.size()))
201 m_graph_observer[observer_id].reset();
204 IItemFamily* dualNodeFamily()
override {
return m_dual_node_family->itemFamily(); }
207 IItemFamily* linkFamily()
override {
return m_link_family->itemFamily(); }
215 Integer nb_dual_nodes_per_link,
219 void addDualNodes(
Integer graph_nb_dual_node,
222 void addDualNodes(
Integer graph_nb_dual_node,
229 bool isUpdated()
override;
231 void endUpdate()
override;
233 void updateAfterMeshChanged()
override;
235 void printDualNodes()
const override;
236 void printLinks()
const override;
240 String _className()
const {
return "GraphDoFs"; }
243 ARCANE_ASSERT((dual_node_IT < NB_BASIC_ITEM_TYPE),
244 (
"dual node item type must be IT_DualNode, IT_DualEdge, IT_DualFace, IT_DualCell or IT_DualParticle"));
245 return m_connectivity_indexes_per_type[dual_node_IT];
252 if (kind == IK_Particle) {
253 return m_mesh->findItemFamily(kind, m_particle_family_name,
false);
256 return m_mesh->itemFamily(kind);
260 Int64 _doFUid(Integer dual_item_kind, Item
const& item)
262 switch (dual_item_kind) {
264 return Arcane::DualUniqueIdMng::uniqueIdOf<Node>(item.toNode());
266 return Arcane::DualUniqueIdMng::uniqueIdOf<Edge>(item.toEdge());
268 return Arcane::DualUniqueIdMng::uniqueIdOf<Face>(item.toFace());
270 return Arcane::DualUniqueIdMng::uniqueIdOf<Cell>(item.toCell());
271 case IT_DualParticle:
272 return Arcane::DualUniqueIdMng::uniqueIdOf<Particle>(item.toParticle());
278 void _allocateGraph();
280 IMesh* m_mesh =
nullptr;
281 IItemFamilyNetwork* m_item_family_network =
nullptr;
282 bool m_graph_allocated =
false;
285 DoFManager m_dof_mng;
286 IItemConnectivityMng* m_connectivity_mng;
287 IDoFFamily* m_dual_node_family =
nullptr;
288 IDoFFamily* m_link_family =
nullptr;
290 UniqueArray<Arcane::mesh::IncrementalItemConnectivity*> m_incremental_connectivities;
291 UniqueArray<Arcane::mesh::IncrementalItemConnectivity*> m_dual2dof_incremental_connectivities;
292 Arcane::mesh::IncrementalItemConnectivity* m_dualnodes_incremental_connectivity =
nullptr;
293 Arcane::mesh::IncrementalItemConnectivity* m_links_incremental_connectivity =
nullptr;
294 std::unique_ptr<GraphIncrementalConnectivity> m_graph_connectivity;
295 std::vector<std::unique_ptr<Arcane::IGraphConnectivityObserver>> m_connectivity_observer;
297 std::vector<std::unique_ptr<Arcane::IGraphObserver>> m_graph_observer;
299 std::vector<std::unique_ptr<Arcane::GhostLayerFromConnectivityComputer>> m_ghost_layer_computers;
301 std::array<Integer, NB_BASIC_ITEM_TYPE> m_dualnode_kinds = { IT_DualNode, IT_DualEdge, IT_DualFace, IT_DualCell, IT_DualParticle };
302 ItemScalarProperty<Integer> m_dual_node_to_connectivity_index;
304 UniqueArray<Int32> m_detached_dualnode_lids;
305 UniqueArray<Int32> m_detached_link_lids;
307 bool m_update_sync_info =
false;
309 String m_particle_family_name;