94class ARCANE_CORE_EXPORT ItemInternalConnectivityList
99 friend class ItemBase;
100 friend class ItemInternal;
104 friend mesh::IncrementalItemConnectivityBase;
105 friend mesh::PolyhedralFamily;
106 friend mesh::PolyhedralMeshImpl;
109 friend mesh::ItemFamily;
127 if (index == NULL_ITEM_LOCAL_ID) {
130 arcaneRangeError(index, m_size);
133 ARCANE_CHECK_AT(index, m_size);
135 return m_data[index];
144 void setNull(
const Int32* data)
179 static ItemInternalConnectivityList nullInstance;
183 ItemInternalConnectivityList()
186 for (
Integer i = 0; i < MAX_ITEM_KIND; ++i) {
187 m_kind_info[i].m_nb_item_null_data[0] = 0;
188 m_kind_info[i].m_nb_item_null_data[1] = 0;
189 m_kind_info[i].m_max_nb_item = 0;
192 for (
Integer i = 0; i < MAX_ITEM_KIND; ++i) {
193 m_container[i].m_nb_item.setNull(&m_kind_info[i].m_nb_item_null_data[1]);
200 void updateMeshItemInternalList()
202#ifdef ARCANE_CONNECTIVITYLIST_USE_OWN_SHAREDINFO
203 m_shared_infos.m_node = m_items->m_node_shared_info;
204 m_shared_infos.m_edge = m_items->m_edge_shared_info;
205 m_shared_infos.m_face = m_items->m_face_shared_info;
206 m_shared_infos.m_cell = m_items->m_cell_shared_info;
218 return m_container[item_kind].itemLocalId(lid, index);
221 Int64 nbAccess()
const {
return 0; }
223 Int64 nbAccessAll()
const {
return 0; }
230 m_container[item_kind].m_indexes = v;
235 m_container[item_kind].m_list = v;
241 m_container[item_kind].m_nb_item = v;
244 void _setMaxNbConnectedItem(
Int32 item_kind,
Int32 v)
246 m_kind_info[item_kind].m_max_nb_item = v;
252 ARCANE_DEPRECATED_REASON(
"Y2022: Use containerView() instead")
255 return m_container[item_kind].m_indexes;
258 ARCANE_DEPRECATED_REASON(
"Y2022: Use containerView() instead")
261 return m_container[item_kind].m_list;
264 ARCANE_DEPRECATED_REASON(
"Y2022: Use containerView() instead")
267 return m_container[item_kind].m_nb_item;
275 return m_kind_info[item_kind].m_max_nb_item;
280 return m_container[item_kind].containerView();
285 constexpr ItemBaseBuildInfo nodeBase(Int32 lid, Int32 aindex)
const
287 return ItemBaseBuildInfo(_nodeLocalIdV2(lid, aindex), A_INTERNAL_SI(node));
289 constexpr ItemBaseBuildInfo edgeBase(Int32 lid, Int32 aindex)
const
291 return ItemBaseBuildInfo(_edgeLocalIdV2(lid, aindex), A_INTERNAL_SI(edge));
293 constexpr ItemBaseBuildInfo faceBase(Int32 lid, Int32 aindex)
const
295 return ItemBaseBuildInfo(_faceLocalIdV2(lid, aindex), A_INTERNAL_SI(face));
297 constexpr ItemBaseBuildInfo cellBase(Int32 lid, Int32 aindex)
const
299 return ItemBaseBuildInfo(_cellLocalIdV2(lid, aindex), A_INTERNAL_SI(cell));
301 ItemBaseBuildInfo hParentBase(Int32 lid, Int32 aindex, ItemSharedInfo* isf)
const
303 return ItemBaseBuildInfo(_hParentLocalIdV2(lid, aindex), isf);
305 ItemBaseBuildInfo hChildBase(Int32 lid, Int32 aindex, ItemSharedInfo* isf)
const
307 return ItemBaseBuildInfo(_hChildLocalIdV2(lid, aindex), isf);
310 auto nodeList(Int32 lid)
const {
return impl::ItemIndexedListView{ A_INTERNAL_SI(node), _itemLocalIdListView(NODE_IDX, lid) }; }
311 auto edgeList(Int32 lid)
const {
return impl::ItemIndexedListView{ A_INTERNAL_SI(edge), _itemLocalIdListView(EDGE_IDX, lid) }; }
312 auto faceList(Int32 lid)
const {
return impl::ItemIndexedListView{ A_INTERNAL_SI(face), _itemLocalIdListView(FACE_IDX, lid) }; }
313 auto cellList(Int32 lid)
const {
return impl::ItemIndexedListView{ A_INTERNAL_SI(cell), _itemLocalIdListView(CELL_IDX, lid) }; }
319 ItemInternalVectorView nodesV2(Int32 lid)
const {
return { A_INTERNAL_SI(node), _itemLocalIdListView(NODE_IDX, lid) }; }
320 ItemInternalVectorView edgesV2(Int32 lid)
const {
return { A_INTERNAL_SI(edge), _itemLocalIdListView(EDGE_IDX, lid) }; }
321 ItemInternalVectorView facesV2(Int32 lid)
const {
return { A_INTERNAL_SI(face), _itemLocalIdListView(FACE_IDX, lid) }; }
322 ItemInternalVectorView cellsV2(Int32 lid)
const {
return { A_INTERNAL_SI(cell), _itemLocalIdListView(CELL_IDX, lid) }; }
331 constexpr Int32 _nodeLocalIdV2(Int32 lid, Int32 index)
const {
return itemLocalId(NODE_IDX, lid, index); }
332 constexpr Int32 _edgeLocalIdV2(Int32 lid, Int32 index)
const {
return itemLocalId(EDGE_IDX, lid, index); }
333 constexpr Int32 _faceLocalIdV2(Int32 lid, Int32 index)
const {
return itemLocalId(FACE_IDX, lid, index); }
334 constexpr Int32 _cellLocalIdV2(Int32 lid, Int32 index)
const {
return itemLocalId(CELL_IDX, lid, index); }
335 constexpr Int32 _hParentLocalIdV2(Int32 lid, Int32 index)
const {
return itemLocalId(HPARENT_IDX, lid, index); }
336 constexpr Int32 _hChildLocalIdV2(Int32 lid, Int32 index)
const {
return itemLocalId(HCHILD_IDX, lid, index); }
340 ItemInternal* _nodeV2(Int32 lid, Int32 aindex)
const {
return m_items->nodes[_nodeLocalIdV2(lid, aindex)]; }
341 ItemInternal* _edgeV2(Int32 lid, Int32 aindex)
const {
return m_items->edges[_edgeLocalIdV2(lid, aindex)]; }
342 ItemInternal* _faceV2(Int32 lid, Int32 aindex)
const {
return m_items->faces[_faceLocalIdV2(lid, aindex)]; }
343 ItemInternal* _cellV2(Int32 lid, Int32 aindex)
const {
return m_items->cells[_cellLocalIdV2(lid, aindex)]; }
344 ItemInternal* _hParentV2(Int32 lid, Int32 aindex)
const {
return m_items->cells[_hParentLocalIdV2(lid, aindex)]; }
345 ItemInternal* _hChildV2(Int32 lid, Int32 aindex)
const {
return m_items->cells[_hChildLocalIdV2(lid, aindex)]; }
349 constexpr Int32 _nbNodeV2(Int32 lid)
const {
return m_container[NODE_IDX].m_nb_item[lid]; }
350 constexpr Int32 _nbEdgeV2(Int32 lid)
const {
return m_container[EDGE_IDX].m_nb_item[lid]; }
351 constexpr Int32 _nbFaceV2(Int32 lid)
const {
return m_container[FACE_IDX].m_nb_item[lid]; }
352 constexpr Int32 _nbCellV2(Int32 lid)
const {
return m_container[CELL_IDX].m_nb_item[lid]; }
353 Int32 _nbHParentV2(Int32 lid)
const {
return m_container[HPARENT_IDX].m_nb_item[lid]; }
354 Int32 _nbHChildrenV2(Int32 lid)
const {
return m_container[HCHILD_IDX].m_nb_item[lid]; }
358 Int32 _nodeOffset(Int32 lid)
const {
return m_container[NODE_IDX].itemOffset(lid); }
359 Int32 _edgeOffset(Int32 lid)
const {
return m_container[EDGE_IDX].itemOffset(lid); }
360 Int32 _faceOffset(Int32 lid)
const {
return m_container[FACE_IDX].itemOffset(lid); }
361 Int32 _cellOffset(Int32 lid)
const {
return m_container[CELL_IDX].itemOffset(lid); }
362 Int32 _itemOffset(Int32 item_kind, Int32 lid)
const {
return m_container[item_kind].itemOffset(lid); }
366 impl::ItemLocalIdListContainerView _itemLocalIdListView(Int32 item_kind, Int32 lid)
const
368 return m_container[item_kind].itemLocalIdListView(lid);
377 impl::ItemLocalIdListContainerView itemLocalIdListView(Int32 lid)
const
379 return impl::ItemLocalIdListContainerView(itemLocalIdsData(lid), m_nb_item[lid], itemOffset(lid));
381 const Int32* itemLocalIdsData(Int32 lid)
const
383 return &(m_list[m_indexes[lid]]);
385 constexpr Int32 itemLocalId(Int32 lid, Integer index)
const
387 return m_list[m_indexes[lid] + index] + itemOffset(lid);
389 ItemConnectivityContainerView containerView()
const
391 return ItemConnectivityContainerView(m_list, m_indexes, m_nb_item);
393 constexpr Int32 itemOffset([[maybe_unused]] Int32 lid)
const
395#ifdef ARCANE_USE_OFFSET_FOR_CONNECTIVITY
396 return m_offset[lid];
404 ConstArrayView<Int32> m_indexes;
406 ArrayView<Int32> m_list;
407 ConstArrayView<Int32> m_offset;
413 Int32 m_nb_item_null_data[2];
418 Container m_container[MAX_ITEM_KIND];
419 KindInfo m_kind_info[MAX_ITEM_KIND];
421 MeshItemInternalList* m_items;
425#ifdef ARCANE_CONNECTIVITYLIST_USE_OWN_SHAREDINFO
426 impl::MeshItemSharedInfoList m_shared_infos;
449class ARCANE_CORE_EXPORT ItemBase
452 friend class ::Arcane::ItemInternal;
453 friend class ::Arcane::Item;
454 friend class ::Arcane::ItemInternalCompatibility;
456 friend class ::Arcane::ItemEnumerator;
457 friend MutableItemBase;
459 friend class ::Arcane::Node;
461 friend class ::Arcane::mesh::ItemFamily;
462 friend class ::Arcane::mesh::MeshRefinement;
467 : m_local_id(local_id)
468 , m_shared_info(shared_info)
474 : m_shared_info(ItemSharedInfo::nullItemSharedInfoPointer)
477 : m_local_id(x.m_local_id)
478 , m_shared_info(x.m_shared_info)
484 inline ItemBase(ItemInternal* x);
496 if (m_local_id != NULL_ITEM_LOCAL_ID)
497 arcaneCheckAt((
Integer)m_local_id, m_shared_info->m_unique_ids.size());
502 return ItemUniqueId(m_shared_info->m_unique_ids.data()[m_local_id]);
506 Int32 owner()
const {
return m_shared_info->_ownerV2(m_local_id); }
509 Int32 flags()
const {
return m_shared_info->_flagsV2(m_local_id); }
529 Int16 typeId()
const {
return m_shared_info->_typeId(m_local_id); }
545 return (this->hParentBase(0).
level() + 1);
559 return this->hChildBase(0).isAncestor();
591 return this->hChildBase(0).isSubactive();
599 bool null()
const {
return m_local_id == NULL_ITEM_LOCAL_ID; }
601 bool isNull()
const {
return m_local_id == NULL_ITEM_LOCAL_ID; }
633 return NULL_ITEM_LOCAL_ID;
647 return NULL_ITEM_LOCAL_ID;
651 if (flags() & II_SlaveFace)
661 Int32 parentId(
Integer index)
const {
return m_shared_info->_parentLocalIdV2(m_local_id, index); }
664 Int32 nodeId(Integer index)
const {
return _connectivity()->_nodeLocalIdV2(m_local_id, index); }
665 Int32 edgeId(Integer index)
const {
return _connectivity()->_edgeLocalIdV2(m_local_id, index); }
666 Int32 faceId(Integer index)
const {
return _connectivity()->_faceLocalIdV2(m_local_id, index); }
667 Int32 cellId(Integer index)
const {
return _connectivity()->_cellLocalIdV2(m_local_id, index); }
668 Int32 hParentId(Int32 index)
const {
return _connectivity()->_hParentLocalIdV2(m_local_id, index); }
669 Int32 hChildId(Int32 index)
const {
return _connectivity()->_hChildLocalIdV2(m_local_id, index); }
682 ARCANE_DEPRECATED_REASON(
"Y2023: Use nodeList() instead.")
684 ARCANE_DEPRECATED_REASON(
"Y2023: Use edgeList() instead.")
686 ARCANE_DEPRECATED_REASON(
"Y2023: Use faceList() instead.")
687 ItemInternalVectorView internalFaces()
const {
return _connectivity()->facesV2(m_local_id); }
688 ARCANE_DEPRECATED_REASON(
"Y2023: Use cellList() instead.")
689 ItemInternalVectorView internalCells()
const {
return _connectivity()->cellsV2(m_local_id); }
704 impl::ItemIndexedListView<DynExtent> faceList()
const {
return _connectivity()->faceList(m_local_id); }
705 impl::ItemIndexedListView<DynExtent> cellList()
const {
return _connectivity()->cellList(m_local_id); }
707 impl::ItemIndexedListView<DynExtent> itemList(Node*)
const {
return nodeList(); }
708 impl::ItemIndexedListView<DynExtent> itemList(Edge*)
const {
return edgeList(); }
709 impl::ItemIndexedListView<DynExtent> itemList(Face*)
const {
return faceList(); }
710 impl::ItemIndexedListView<DynExtent> itemList(Cell*)
const {
return cellList(); }
713 ItemBase nodeBase(Int32 index)
const {
return _connectivity()->nodeBase(m_local_id, index); }
714 ItemBase edgeBase(Int32 index)
const {
return _connectivity()->edgeBase(m_local_id, index); }
715 ItemBase faceBase(Int32 index)
const {
return _connectivity()->faceBase(m_local_id, index); }
716 ItemBase cellBase(Int32 index)
const {
return _connectivity()->cellBase(m_local_id, index); }
717 ItemBase hParentBase(Int32 index)
const {
return _connectivity()->hParentBase(m_local_id, index, m_shared_info); }
718 ItemBase hChildBase(Int32 index)
const {
return _connectivity()->hChildBase(m_local_id, index, m_shared_info); }
719 inline ItemBase parentBase(Int32 index)
const;
744 ARCANE_DEPRECATED_REASON(
"Y2024: This method is internal to Arcane.")
747 ARCANE_DEPRECATED_REASON(
"Y2024: This method is internal to Arcane.")
750 return _internalActiveCells2(local_ids);
755 Int32 _nbLinearNode()
const;
765 Int32 m_local_id = NULL_ITEM_LOCAL_ID;
771 ItemSharedInfo* m_shared_info =
nullptr;
775 ItemInternalConnectivityList* _connectivity()
const
777 return m_shared_info->m_connectivity;
779 void _setFromInternal(ItemBase* rhs)
781 m_local_id = rhs->m_local_id;
782 m_shared_info = rhs->m_shared_info;
784 void _setFromInternal(
const ItemBase& rhs)
786 m_local_id = rhs.m_local_id;
787 m_shared_info = rhs.m_shared_info;
789 ItemInternalVectorView _internalActiveCells2(Int32Array& local_ids)
const;
790 inline ItemInternal* _itemInternal()
const;
941:
public impl::MutableItemBase
944 friend class mesh::DynamicMeshKindInfos;
945 friend class mesh::ItemFamily;
958 ARCANE_DEPRECATED_REASON(
"Y2023: use ItemBase::boundaryCell() instead.")
961 ARCANE_DEPRECATED_REASON(
"Y2023: use ItemBase::backCell() instead.")
969 ARCANE_DEPRECATED_REASON(
"Y2023: use ItemBase::frontCell() instead.")
976 ARCANE_DEPRECATED_REASON(
"Y2023: use ItemBase::masterFace() instead.")
979 if (flags() & II_SlaveFace)
980 return _internalFace(0);
987 ARCANE_DEPRECATED_REASON(
"Y2022: This method is internal to Arcane and should not be used.")
992 ARCANE_DEPRECATED_REASON(
"Y2023: Use itemList() instead.")
994 ARCANE_DEPRECATED_REASON(
"Y2023: Use itemList() instead.")
995 ItemInternalVectorView internalItems(Edge*)
const {
return edgeList(); }
996 ARCANE_DEPRECATED_REASON(
"Y2023: Use itemList() instead.")
997 ItemInternalVectorView internalItems(Face*)
const {
return faceList(); }
998 ARCANE_DEPRECATED_REASON(
"Y2023: Use itemList() instead.")
999 ItemInternalVectorView internalItems(Cell*)
const {
return cellList(); }
1003 ARCANE_DEPRECATED_REASON(
"Y2023: Use nodeBase() instead.")
1004 ItemInternal* internalNode(Int32 index)
const {
return _connectivity()->_nodeV2(m_local_id, index); }
1005 ARCANE_DEPRECATED_REASON(
"Y2023: Use edgeBase() instead.")
1006 ItemInternal* internalEdge(Int32 index)
const {
return _connectivity()->_edgeV2(m_local_id, index); }
1007 ARCANE_DEPRECATED_REASON(
"Y2023: Use faceBase() instead.")
1008 ItemInternal* internalFace(Int32 index)
const {
return _connectivity()->_faceV2(m_local_id, index); }
1009 ARCANE_DEPRECATED_REASON(
"Y2023: Use cellBase() instead.")
1010 ItemInternal* internalCell(Int32 index)
const {
return _connectivity()->_cellV2(m_local_id, index); }
1011 ARCANE_DEPRECATED_REASON(
"Y2023: Use hParentBase() instead.")
1012 ItemInternal* internalHParent(Int32 index)
const {
return _connectivity()->_hParentV2(m_local_id, index); }
1013 ARCANE_DEPRECATED_REASON(
"Y2023: Use hChildBase() instead.")
1014 ItemInternal* internalHChild(Int32 index)
const {
return _connectivity()->_hChildV2(m_local_id, index); }
1015 ARCANE_DEPRECATED_REASON(
"Y2023: Use parentBase() instead.")
1016 ItemInternal* parent(Integer index)
const {
return m_shared_info->_parentV2(m_local_id, index); }
1020 const ItemInternal* topHParent()
const;
1021 ItemInternal* topHParent();
1025 ARCANE_DEPRECATED_REASON(
"Y2022: This method always returns 0")
1026 Int32 dataIndex() {
return 0; }
1041 ARCANE_DEPRECATED_REASON(
"Y2022: Use parentId() or setParent() instead")
1054 ARCANE_DEPRECATED_REASON(
"Y2022: This method always return 0")
1058 ARCANE_DEPRECATED_REASON(
"Y2022: This method always return 0")
1063 ARCANE_DEPRECATED_REASON(
"Y2023: Use nodeId() instead")
1064 Int32 nodeLocalId(
Integer index) {
return _connectivity()->_nodeLocalIdV2(m_local_id, index); }
1065 ARCANE_DEPRECATED_REASON(
"Y2023: Use edgeId() instead")
1066 Int32 edgeLocalId(Integer index) {
return _connectivity()->_edgeLocalIdV2(m_local_id, index); }
1067 ARCANE_DEPRECATED_REASON(
"Y2023: Use faceId() instead")
1068 Int32 faceLocalId(Integer index) {
return _connectivity()->_faceLocalIdV2(m_local_id, index); }
1069 ARCANE_DEPRECATED_REASON(
"Y2023: Use cellId() instead")
1070 Int32 cellLocalId(Integer index) {
return _connectivity()->_cellLocalIdV2(m_local_id, index); }
1074 ARCANE_DEPRECATED_REASON(
"Y2022: This method always throws an exception.")
1075 void setDataIndex(Integer);
1077 ARCANE_DEPRECATED_REASON(
"Y2022: This method is internal to Arcane and should not be used.")
1078 void setSharedInfo(ItemSharedInfo* shared_infos, ItemTypeId type_id)
1080 _setSharedInfo(shared_infos, type_id);
1086 typedef ItemInternal* ItemInternalPtr;
1089 ARCANE_DEPRECATED_REASON(
"Y2022: This method is internal to Arcane and should not be used.")
1090 static ItemSharedInfo* _getSharedInfo(const ItemInternalPtr* items)
1092 return ((items) ? items[0]->m_shared_info : ItemSharedInfo::nullInstance());
1097 void _setSharedInfo(ItemSharedInfo* shared_infos, ItemTypeId type_id)
1099 m_shared_info = shared_infos;
1100 shared_infos->_setTypeId(m_local_id, type_id.typeId());
1103 ItemInternal* _internalFace(Int32 index)
const {
return _connectivity()->_faceV2(m_local_id, index); }
1104 ItemInternal* _internalCell(Int32 index)
const {
return _connectivity()->_cellV2(m_local_id, index); }
1105 ItemInternal* _internalHParent(Int32 index)
const {
return _connectivity()->_hParentV2(m_local_id, index); }
1106 ItemInternal* _internalHChild(Int32 index)
const {
return _connectivity()->_hChildV2(m_local_id, index); }