98 friend mesh::IncrementalItemConnectivityBase;
99 friend mesh::PolyhedralFamily;
100 friend mesh::PolyhedralMeshImpl;
103 friend mesh::ItemFamily;
117 Int32 operator[](Int32 index)
const
120 if (index==NULL_ITEM_LOCAL_ID){
123 arcaneRangeError(index,m_size);
126 ARCANE_CHECK_AT(index,m_size);
128 return m_data[index];
137 void setNull(
const Int32* data)
177 for( Integer i=0; i<MAX_ITEM_KIND; ++i ){
178 m_kind_info[i].m_nb_item_null_data[0] = 0;
179 m_kind_info[i].m_nb_item_null_data[1] = 0;
180 m_kind_info[i].m_max_nb_item = 0;
183 for( Integer i=0; i<MAX_ITEM_KIND; ++i ){
184 m_container[i].m_nb_item.setNull(&m_kind_info[i].m_nb_item_null_data[1]);
191 void updateMeshItemInternalList()
193#ifdef ARCANE_CONNECTIVITYLIST_USE_OWN_SHAREDINFO
194 m_shared_infos.m_node = m_items->m_node_shared_info;
195 m_shared_infos.m_edge = m_items->m_edge_shared_info;
196 m_shared_infos.m_face = m_items->m_face_shared_info;
197 m_shared_infos.m_cell = m_items->m_cell_shared_info;
207 Int32 itemLocalId(Int32 item_kind,Int32 lid,Integer index)
const
209 return m_container[item_kind].itemLocalId(lid,index);
212 Int64 nbAccess()
const {
return 0; }
214 Int64 nbAccessAll()
const {
return 0; }
221 m_container[item_kind].m_indexes = v;
226 m_container[item_kind].m_list = v;
232 m_container[item_kind].m_nb_item = v;
235 void _setMaxNbConnectedItem(Int32 item_kind,Int32 v)
237 m_kind_info[item_kind].m_max_nb_item = v;
243 ARCANE_DEPRECATED_REASON(
"Y2022: Use containerView() instead")
246 return m_container[item_kind].m_indexes;
249 ARCANE_DEPRECATED_REASON(
"Y2022: Use containerView() instead")
252 return m_container[item_kind].m_list;
255 ARCANE_DEPRECATED_REASON(
"Y2022: Use containerView() instead")
258 return m_container[item_kind].m_nb_item;
266 return m_kind_info[item_kind].m_max_nb_item;
271 return m_container[item_kind].containerView();
276 ItemBaseBuildInfo nodeBase(Int32 lid,Int32 aindex)
const
277 {
return ItemBaseBuildInfo(_nodeLocalIdV2(lid,aindex),A_INTERNAL_SI(node)); }
278 ItemBaseBuildInfo edgeBase(Int32 lid,Int32 aindex)
const
279 {
return ItemBaseBuildInfo(_edgeLocalIdV2(lid,aindex),A_INTERNAL_SI(edge)); }
280 ItemBaseBuildInfo faceBase(Int32 lid,Int32 aindex)
const
281 {
return ItemBaseBuildInfo(_faceLocalIdV2(lid,aindex),A_INTERNAL_SI(face)); }
282 ItemBaseBuildInfo cellBase(Int32 lid,Int32 aindex)
const
283 {
return ItemBaseBuildInfo(_cellLocalIdV2(lid,aindex),A_INTERNAL_SI(cell)); }
284 ItemBaseBuildInfo hParentBase(Int32 lid, Int32 aindex, ItemSharedInfo* isf)
const
286 return ItemBaseBuildInfo(_hParentLocalIdV2(lid, aindex), isf);
288 ItemBaseBuildInfo hChildBase(Int32 lid, Int32 aindex, ItemSharedInfo* isf)
const
290 return ItemBaseBuildInfo(_hChildLocalIdV2(lid, aindex), isf);
293 auto nodeList(Int32 lid)
const {
return impl::ItemIndexedListView { A_INTERNAL_SI(node),_itemLocalIdListView(NODE_IDX,lid) }; }
294 auto edgeList(Int32 lid)
const {
return impl::ItemIndexedListView { A_INTERNAL_SI(edge),_itemLocalIdListView(EDGE_IDX,lid) }; }
295 auto faceList(Int32 lid)
const {
return impl::ItemIndexedListView { A_INTERNAL_SI(face),_itemLocalIdListView(FACE_IDX,lid) }; }
296 auto cellList(Int32 lid)
const {
return impl::ItemIndexedListView { A_INTERNAL_SI(cell),_itemLocalIdListView(CELL_IDX,lid) }; }
302 ItemInternalVectorView nodesV2(Int32 lid)
const {
return { A_INTERNAL_SI(node),_itemLocalIdListView(NODE_IDX,lid) }; }
303 ItemInternalVectorView edgesV2(Int32 lid)
const {
return { A_INTERNAL_SI(edge),_itemLocalIdListView(EDGE_IDX,lid) }; }
304 ItemInternalVectorView facesV2(Int32 lid)
const {
return { A_INTERNAL_SI(face),_itemLocalIdListView(FACE_IDX,lid) }; }
305 ItemInternalVectorView cellsV2(Int32 lid)
const {
return { A_INTERNAL_SI(cell),_itemLocalIdListView(CELL_IDX,lid) }; }
314 Int32 _nodeLocalIdV2(Int32 lid,Int32 index)
const {
return itemLocalId(NODE_IDX,lid,index); }
315 Int32 _edgeLocalIdV2(Int32 lid,Int32 index)
const {
return itemLocalId(EDGE_IDX,lid,index); }
316 Int32 _faceLocalIdV2(Int32 lid,Int32 index)
const {
return itemLocalId(FACE_IDX,lid,index); }
317 Int32 _cellLocalIdV2(Int32 lid,Int32 index)
const {
return itemLocalId(CELL_IDX,lid,index); }
318 Int32 _hParentLocalIdV2(Int32 lid,Int32 index)
const {
return itemLocalId(HPARENT_IDX,lid,index); }
319 Int32 _hChildLocalIdV2(Int32 lid,Int32 index)
const {
return itemLocalId(HCHILD_IDX,lid,index); }
323 ItemInternal* _nodeV2(Int32 lid,Int32 aindex)
const {
return m_items->nodes[ _nodeLocalIdV2(lid,aindex) ]; }
324 ItemInternal* _edgeV2(Int32 lid,Int32 aindex)
const {
return m_items->edges[ _edgeLocalIdV2(lid,aindex) ]; }
325 ItemInternal* _faceV2(Int32 lid,Int32 aindex)
const {
return m_items->faces[ _faceLocalIdV2(lid,aindex) ]; }
326 ItemInternal* _cellV2(Int32 lid,Int32 aindex)
const {
return m_items->cells[ _cellLocalIdV2(lid,aindex) ]; }
327 ItemInternal* _hParentV2(Int32 lid,Int32 aindex)
const {
return m_items->cells[ _hParentLocalIdV2(lid,aindex) ]; }
328 ItemInternal* _hChildV2(Int32 lid,Int32 aindex)
const {
return m_items->cells[ _hChildLocalIdV2(lid,aindex) ]; }
332 Int32 _nbNodeV2(Int32 lid)
const {
return m_container[NODE_IDX].m_nb_item[lid]; }
333 Int32 _nbEdgeV2(Int32 lid)
const {
return m_container[EDGE_IDX].m_nb_item[lid]; }
334 Int32 _nbFaceV2(Int32 lid)
const {
return m_container[FACE_IDX].m_nb_item[lid]; }
335 Int32 _nbCellV2(Int32 lid)
const {
return m_container[CELL_IDX].m_nb_item[lid]; }
336 Int32 _nbHParentV2(Int32 lid)
const {
return m_container[HPARENT_IDX].m_nb_item[lid]; }
337 Int32 _nbHChildrenV2(Int32 lid)
const {
return m_container[HCHILD_IDX].m_nb_item[lid]; }
341 Int32 _nodeOffset(Int32 lid)
const {
return m_container[NODE_IDX].itemOffset(lid); }
342 Int32 _edgeOffset(Int32 lid)
const {
return m_container[EDGE_IDX].itemOffset(lid); }
343 Int32 _faceOffset(Int32 lid)
const {
return m_container[FACE_IDX].itemOffset(lid); }
344 Int32 _cellOffset(Int32 lid)
const {
return m_container[CELL_IDX].itemOffset(lid); }
345 Int32 _itemOffset(Int32 item_kind,Int32 lid)
const {
return m_container[item_kind].itemOffset(lid); }
349 impl::ItemLocalIdListContainerView _itemLocalIdListView(Int32 item_kind,Int32 lid)
const
351 return m_container[item_kind].itemLocalIdListView(lid);
360 impl::ItemLocalIdListContainerView itemLocalIdListView(Int32 lid)
const
362 return impl::ItemLocalIdListContainerView(itemLocalIdsData(lid),m_nb_item[lid],itemOffset(lid));
364 const Int32* itemLocalIdsData(Int32 lid)
const
366 return &(m_list[ m_indexes[lid] ]);
368 Int32 itemLocalId(Int32 lid,Integer index)
const
370 return m_list[ m_indexes[lid] + index] + itemOffset(lid);
372 ItemConnectivityContainerView containerView()
const
374 return ItemConnectivityContainerView( m_list, m_indexes, m_nb_item );
376 Int32 itemOffset([[maybe_unused]] Int32 lid)
const
378#ifdef ARCANE_USE_OFFSET_FOR_CONNECTIVITY
379 return m_offset[lid];
387 ConstArrayView<Int32> m_indexes;
389 ConstArrayView<Int32> m_list;
390 ConstArrayView<Int32> m_offset;
396 Int32 m_nb_item_null_data[2];
401 Container m_container[MAX_ITEM_KIND];
402 KindInfo m_kind_info[MAX_ITEM_KIND];
404 MeshItemInternalList* m_items;
408#ifdef ARCANE_CONNECTIVITYLIST_USE_OWN_SHAREDINFO
409 impl::MeshItemSharedInfoList m_shared_infos;
434 friend class ::Arcane::ItemInternal;
435 friend class ::Arcane::Item;
436 friend class ::Arcane::ItemInternalCompatibility;
437 friend class ::Arcane::Materials::ComponentItemSharedInfo;
438 friend class ::Arcane::ItemEnumerator;
441 friend class ::Arcane::Node;
443 friend class ::Arcane::mesh::ItemFamily;
444 friend class ::Arcane::mesh::MeshRefinement;
449 : m_local_id(local_id), m_shared_info(shared_info) {}
453 ItemBase() : m_shared_info(ItemSharedInfo::nullItemSharedInfoPointer) {}
471 if (m_local_id!=NULL_ITEM_LOCAL_ID)
472 arcaneCheckAt((Integer)m_local_id,m_shared_info->m_unique_ids.size());
477 return ItemUniqueId(m_shared_info->m_unique_ids.data()[m_local_id]);
481 Int32
owner()
const {
return m_shared_info->_ownerV2(m_local_id); }
484 Int32
flags()
const {
return m_shared_info->_flagsV2(m_local_id); }
487 Integer
nbNode()
const {
return _connectivity()->_nbNodeV2(m_local_id); }
489 Integer
nbEdge()
const {
return _connectivity()->_nbEdgeV2(m_local_id); }
491 Integer
nbFace()
const {
return _connectivity()->_nbFaceV2(m_local_id); }
493 Integer
nbCell()
const {
return _connectivity()->_nbCellV2(m_local_id); }
495 Int32
nbHParent()
const {
return _connectivity()->_nbHParentV2(m_local_id); }
497 Int32
nbHChildren()
const {
return _connectivity()->_nbHChildrenV2(m_local_id); }
499 Integer
nbParent()
const {
return m_shared_info->nbParent(); }
504 Int16
typeId()
const {
return m_shared_info->_typeId(m_local_id); }
518 if (this->nbHParent() == 0)
521 return (this->hParentBase(0).level() + 1);
528 if (this->isActive())
530 if (!this->hasHChildren())
532 if (this->hChildBase(0).isActive())
534 return this->hChildBase(0).isAncestor();
540 if (this->nbHChildren() == 0)
551 if ( (flags() & II_Inactive) | (flags() & II_CoarsenInactive))
561 if (this->isActive())
563 if (!this->hasHChildren())
565 return this->hChildBase(0).isSubactive();
573 bool null()
const {
return m_local_id==NULL_ITEM_LOCAL_ID; }
575 bool isNull()
const {
return m_local_id==NULL_ITEM_LOCAL_ID; }
577 bool isOwn()
const {
return ItemFlags::isOwn(flags()); }
584 bool isShared()
const {
return ItemFlags::isShared(flags()); }
589 bool isDetached()
const {
return (flags() & II_Detached)!=0; }
592 bool isBoundary()
const {
return ItemFlags::isBoundary(flags()); }
598 if (flags() & II_HasBackCell)
599 return cellBase((flags() & II_BackCellIsFirst) ? 0 : 1);
605 if (flags() & II_HasBackCell)
606 return cellId((flags() & II_BackCellIsFirst) ? 0 : 1);
607 return NULL_ITEM_LOCAL_ID;
612 if (flags() & II_HasFrontCell)
613 return cellBase((flags() & II_FrontCellIsFirst) ? 0 : 1);
619 if (flags() & II_HasFrontCell)
620 return cellId((flags() & II_FrontCellIsFirst) ? 0 : 1);
621 return NULL_ITEM_LOCAL_ID;
625 if (flags() & II_SlaveFace)
633 inline bool isSlaveFace()
const {
return flags() & II_SlaveFace; }
635 Int32 parentId(Integer index)
const {
return m_shared_info->_parentLocalIdV2(m_local_id,index); }
638 Int32 nodeId(Integer index)
const {
return _connectivity()->_nodeLocalIdV2(m_local_id,index); }
639 Int32 edgeId(Integer index)
const {
return _connectivity()->_edgeLocalIdV2(m_local_id,index); }
640 Int32 faceId(Integer index)
const {
return _connectivity()->_faceLocalIdV2(m_local_id,index); }
641 Int32 cellId(Integer index)
const {
return _connectivity()->_cellLocalIdV2(m_local_id,index); }
642 Int32 hParentId(Int32 index)
const {
return _connectivity()->_hParentLocalIdV2(m_local_id,index); }
643 Int32 hChildId(Int32 index)
const {
return _connectivity()->_hChildLocalIdV2(m_local_id,index); }
657 ARCANE_DEPRECATED_REASON(
"Y2023: Use nodeList() instead.")
659 ARCANE_DEPRECATED_REASON(
"Y2023: Use edgeList() instead.")
661 ARCANE_DEPRECATED_REASON(
"Y2023: Use faceList() instead.")
662 ItemInternalVectorView internalFaces()
const {
return _connectivity()->facesV2(m_local_id); }
663 ARCANE_DEPRECATED_REASON(
"Y2023: Use cellList() instead.")
664 ItemInternalVectorView internalCells()
const {
return _connectivity()->cellsV2(m_local_id); }
680 impl::ItemIndexedListView<DynExtent> faceList()
const {
return _connectivity()->faceList(m_local_id); }
681 impl::ItemIndexedListView<DynExtent> cellList()
const {
return _connectivity()->cellList(m_local_id); }
683 impl::ItemIndexedListView<DynExtent> itemList(Node*)
const {
return nodeList(); }
684 impl::ItemIndexedListView<DynExtent> itemList(Edge*)
const {
return edgeList(); }
685 impl::ItemIndexedListView<DynExtent> itemList(Face*)
const {
return faceList(); }
686 impl::ItemIndexedListView<DynExtent> itemList(Cell*)
const {
return cellList(); }
689 ItemBase nodeBase(Int32 index)
const {
return _connectivity()->nodeBase(m_local_id,index); }
690 ItemBase edgeBase(Int32 index)
const {
return _connectivity()->edgeBase(m_local_id,index); }
691 ItemBase faceBase(Int32 index)
const {
return _connectivity()->faceBase(m_local_id,index); }
692 ItemBase cellBase(Int32 index)
const {
return _connectivity()->cellBase(m_local_id,index); }
693 ItemBase hParentBase(Int32 index)
const {
return _connectivity()->hParentBase(m_local_id, index, m_shared_info); }
694 ItemBase hChildBase(Int32 index)
const {
return _connectivity()->hChildBase(m_local_id, index, m_shared_info); }
695 inline ItemBase parentBase(Int32 index)
const;
704 Int32 whichChildAmI(Int32 local_id)
const;
708 ItemBase topHParentBase()
const;
713 inline MutableItemBase toMutable();
717 ARCANE_DEPRECATED_REASON(
"Y2024: This method is internal to Arcane.")
718 inline ItemInternal* itemInternal() const;
720 ARCANE_DEPRECATED_REASON("Y2024: This method is internal to
Arcane.")
721 ItemInternalVectorView _internalActiveCells(Int32Array& local_ids)
const
723 return _internalActiveCells2(local_ids);
734 Int32 m_local_id = NULL_ITEM_LOCAL_ID;
740 ItemSharedInfo* m_shared_info =
nullptr;
744 ItemInternalConnectivityList* _connectivity()
const
746 return m_shared_info->m_connectivity;
748 void _setFromInternal(ItemBase* rhs)
750 m_local_id = rhs->m_local_id;
751 m_shared_info = rhs->m_shared_info;
753 void _setFromInternal(
const ItemBase& rhs)
755 m_local_id = rhs.m_local_id;
756 m_shared_info = rhs.m_shared_info;
758 ItemInternalVectorView _internalActiveCells2(Int32Array& local_ids)
const;
759 inline ItemInternal* _itemInternal()
const;
910 friend class mesh::DynamicMeshKindInfos;
911 friend class mesh::ItemFamily;
917 static ItemInternal* nullItem() {
return &nullItemInternal; }
924 ARCANE_DEPRECATED_REASON(
"Y2023: use ItemBase::boundaryCell() instead.")
925 ItemInternal* boundaryCell()
const {
return (flags() & II_Boundary) ? _internalCell(0) : nullItem(); }
927 ARCANE_DEPRECATED_REASON(
"Y2023: use ItemBase::backCell() instead.")
930 if (flags() & II_HasBackCell)
931 return _internalCell((flags() & II_BackCellIsFirst) ? 0 : 1);
935 ARCANE_DEPRECATED_REASON(
"Y2023: use ItemBase::frontCell() instead.")
938 if (flags() & II_HasFrontCell)
939 return _internalCell((flags() & II_FrontCellIsFirst) ? 0 : 1);
942 ARCANE_DEPRECATED_REASON(
"Y2023: use ItemBase::masterFace() instead.")
945 if (flags() & II_SlaveFace)
946 return _internalFace(0);
953 ARCANE_DEPRECATED_REASON(
"Y2022: This method is internal to Arcane and should not be used.")
958 ARCANE_DEPRECATED_REASON(
"Y2023: Use itemList() instead.")
960 ARCANE_DEPRECATED_REASON(
"Y2023: Use itemList() instead.")
961 ItemInternalVectorView internalItems(Edge*)
const {
return edgeList(); }
962 ARCANE_DEPRECATED_REASON(
"Y2023: Use itemList() instead.")
963 ItemInternalVectorView internalItems(Face*)
const {
return faceList(); }
964 ARCANE_DEPRECATED_REASON(
"Y2023: Use itemList() instead.")
965 ItemInternalVectorView internalItems(Cell*)
const {
return cellList(); }
969 ARCANE_DEPRECATED_REASON(
"Y2023: Use nodeBase() instead.")
970 ItemInternal* internalNode(Int32 index)
const {
return _connectivity()->_nodeV2(m_local_id,index); }
971 ARCANE_DEPRECATED_REASON(
"Y2023: Use edgeBase() instead.")
972 ItemInternal* internalEdge(Int32 index)
const {
return _connectivity()->_edgeV2(m_local_id,index); }
973 ARCANE_DEPRECATED_REASON(
"Y2023: Use faceBase() instead.")
974 ItemInternal* internalFace(Int32 index)
const {
return _connectivity()->_faceV2(m_local_id,index); }
975 ARCANE_DEPRECATED_REASON(
"Y2023: Use cellBase() instead.")
976 ItemInternal* internalCell(Int32 index)
const {
return _connectivity()->_cellV2(m_local_id,index); }
977 ARCANE_DEPRECATED_REASON(
"Y2023: Use hParentBase() instead.")
978 ItemInternal* internalHParent(Int32 index)
const {
return _connectivity()->_hParentV2(m_local_id,index); }
979 ARCANE_DEPRECATED_REASON(
"Y2023: Use hChildBase() instead.")
980 ItemInternal* internalHChild(Int32 index)
const {
return _connectivity()->_hChildV2(m_local_id,index); }
981 ARCANE_DEPRECATED_REASON(
"Y2023: Use parentBase() instead.")
982 ItemInternal* parent(Integer index)
const {
return m_shared_info->_parentV2(m_local_id,index); }
986 const ItemInternal* topHParent()
const;
987 ItemInternal* topHParent();
991 ARCANE_DEPRECATED_REASON(
"Y2022: This method always returns 0")
992 Int32 dataIndex() {
return 0; }
1007 ARCANE_DEPRECATED_REASON(
"Y2022: Use parentId() or setParent() instead")
1008 Int32* parentPtr() {
return m_shared_info->_parentPtr(m_local_id); }
1020 ARCANE_DEPRECATED_REASON(
"Y2022: This method always return 0")
1021 constexpr Integer neededMemory()
const {
return 0; }
1024 ARCANE_DEPRECATED_REASON(
"Y2022: This method always return 0")
1025 constexpr Integer minimumNeededMemory()
const {
return 0; }
1029 ARCANE_DEPRECATED_REASON(
"Y2023: Use nodeId() instead")
1030 Int32 nodeLocalId(Integer index) {
return _connectivity()->_nodeLocalIdV2(m_local_id,index); }
1031 ARCANE_DEPRECATED_REASON(
"Y2023: Use edgeId() instead")
1032 Int32 edgeLocalId(Integer index) {
return _connectivity()->_edgeLocalIdV2(m_local_id,index); }
1033 ARCANE_DEPRECATED_REASON(
"Y2023: Use faceId() instead")
1034 Int32 faceLocalId(Integer index) {
return _connectivity()->_faceLocalIdV2(m_local_id,index); }
1035 ARCANE_DEPRECATED_REASON(
"Y2023: Use cellId() instead")
1036 Int32 cellLocalId(Integer index) {
return _connectivity()->_cellLocalIdV2(m_local_id,index); }
1040 ARCANE_DEPRECATED_REASON(
"Y2022: This method always throws an exception.")
1041 void setDataIndex(Integer);
1043 ARCANE_DEPRECATED_REASON("Y2022: This method is internal to
Arcane and should not be used.")
1044 void setSharedInfo(ItemSharedInfo* shared_infos,ItemTypeId type_id)
1046 _setSharedInfo(shared_infos,type_id);
1052 typedef ItemInternal* ItemInternalPtr;
1055 ARCANE_DEPRECATED_REASON(
"Y2022: This method is internal to Arcane and should not be used.")
1056 static ItemSharedInfo* _getSharedInfo(const ItemInternalPtr* items)
1058 return ((items) ? items[0]->m_shared_info : ItemSharedInfo::nullInstance());
1063 void _setSharedInfo(ItemSharedInfo* shared_infos,ItemTypeId type_id)
1065 m_shared_info = shared_infos;
1066 shared_infos->_setTypeId(m_local_id,type_id.typeId());
1069 ItemInternal* _internalFace(Int32 index)
const {
return _connectivity()->_faceV2(m_local_id, index); }
1070 ItemInternal* _internalCell(Int32 index)
const {
return _connectivity()->_cellV2(m_local_id, index); }
1071 ItemInternal* _internalHParent(Int32 index)
const {
return _connectivity()->_hParentV2(m_local_id, index); }
1072 ItemInternal* _internalHChild(Int32 index)
const {
return _connectivity()->_hChildV2(m_local_id, index); }