Arcane  4.1.12.0
Developer documentation
Loading...
Searching...
No Matches
Item.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/* Item.h (C) 2000-2025 */
9/* */
10/* Information about mesh elements. */
11/*---------------------------------------------------------------------------*/
12#ifndef ARCANE_CORE_ITEM_H
13#define ARCANE_CORE_ITEM_H
14/*---------------------------------------------------------------------------*/
15/*---------------------------------------------------------------------------*/
16
18#include "arcane/core/ItemInternal.h"
19#include "arcane/core/ItemLocalId.h"
20
21#include <atomic>
22
23/*---------------------------------------------------------------------------*/
24/*---------------------------------------------------------------------------*/
25
26namespace Arcane
27{
28
29/*---------------------------------------------------------------------------*/
30/*---------------------------------------------------------------------------*/
31
32// Macro to check in Check mode that conversions between the
33// entity kinds are correct.
34#ifdef ARCANE_CHECK
35#define ARCANE_CHECK_KIND(type) _checkKind(type())
36#else
37#define ARCANE_CHECK_KIND(type)
38#endif
39
40#ifdef ARCANE_CHECK
41#define ARCANE_WANT_ITEM_STAT
42#endif
43
44#ifdef ARCANE_WANT_ITEM_STAT
45#define ARCANE_ITEM_ADD_STAT(var) ++var
46#else
47#define ARCANE_ITEM_ADD_STAT(var)
48#endif
49
50/*---------------------------------------------------------------------------*/
51/*---------------------------------------------------------------------------*/
52
83class ARCANE_CORE_EXPORT Item
84{
85 // To access private constructors
86 friend class ItemEnumeratorBaseT<Item>;
88 friend class ItemVector;
89 friend class ItemVectorView;
90 friend class ItemVectorViewConstIterator;
91 friend class ItemConnectedListViewConstIterator;
92 friend class SimdItem;
93 friend class SimdItemEnumeratorBase;
94 friend class ItemInfoListView;
95 friend class ItemLocalIdToItemConverter;
96 template <typename ItemType> friend class ItemLocalIdToItemConverterT;
97 friend class ItemPairEnumerator;
98 template <int Extent> friend class ItemConnectedListView;
99 template <typename ItemType> friend class ItemEnumeratorBaseT;
100
101 // To access _internal()
102 friend class ItemCompatibility;
103
104 public:
105
106 typedef ItemInternal* ItemInternalPtr;
107
110
111 using ItemBase = impl::ItemBase;
112
113 public:
114
119 class Index
120 {
121 // TODO Deprecate when we remove
122 // the obsolete derived classes.
123 // We cannot do this before because it generates too many
124 // compilation warnings.
125 public:
126
127 Index()
128 : m_local_id(NULL_ITEM_LOCAL_ID)
129 {}
130 explicit Index(Int32 id)
131 : m_local_id(id)
132 {}
133 Index(Item item)
134 : m_local_id(item.localId())
135 {}
136 operator ItemLocalId() const { return ItemLocalId{ m_local_id }; }
137
138 public:
139
140 Int32 localId() const { return m_local_id; }
141
142 private:
143
144 Int32 m_local_id;
145 };
146
147 public:
148
156 enum
157 {
158 Unknown ARCANE_DEPRECATED_REASON("Use 'IT_NullType' instead") = IT_NullType,
159 Vertex ARCANE_DEPRECATED_REASON("Use 'IT_Vertex' instead") = IT_Vertex,
160 Bar2 ARCANE_DEPRECATED_REASON("Use 'IT_Line2' instead") = IT_Line2,
161 Tri3 ARCANE_DEPRECATED_REASON("Use 'IT_Triangle3' instead") = IT_Triangle3,
162 Quad4 ARCANE_DEPRECATED_REASON("Use 'IT_Quad4' instead") = IT_Quad4,
163 Pentagon5 ARCANE_DEPRECATED_REASON("Use 'IT_Pentagon5' instead") = IT_Pentagon5,
164 Hexagon6 ARCANE_DEPRECATED_REASON("Use 'IT_Hexagon6' instead") = IT_Hexagon6,
165 Tetra ARCANE_DEPRECATED_REASON("Use 'IT_Tetraedron4' instead") = IT_Tetraedron4,
166 Pyramid ARCANE_DEPRECATED_REASON("Use 'IT_Pyramid5' instead") = IT_Pyramid5,
167 Penta ARCANE_DEPRECATED_REASON("Use 'IT_Pentaedron6' instead") = IT_Pentaedron6,
168 Hexa ARCANE_DEPRECATED_REASON("Use 'IT_Hexaedron8' instead") = IT_Hexaedron8,
169 Wedge7 ARCANE_DEPRECATED_REASON("Use 'IT_Heptaedron10' instead") = IT_Heptaedron10,
170 Wedge8 ARCANE_DEPRECATED_REASON("Use 'IT_Octaedron12' instead") = IT_Octaedron12
171 // Reduced to minimum for compatibility.
172 };
173
175 static const Int32 NULL_ELEMENT = NULL_ITEM_ID;
176
178 ARCCORE_DEPRECATED_2021("Use ItemTypeMng::typeName() instead")
179 static String typeName(Int32 type);
180
181 protected:
182
184 constexpr ARCCORE_HOST_DEVICE Item(Int32 local_id, ItemSharedInfo* shared_info)
185 : m_shared_info(shared_info)
186 , m_local_id(local_id)
187 {}
188
189 public:
190
192 Item() = default;
193
195 //ARCANE_DEPRECATED_REASON("Remove this overload")
196 Item(ItemInternal* ainternal)
197 {
198 ARCANE_CHECK_PTR(ainternal);
199 m_shared_info = ainternal->m_shared_info;
200 m_local_id = ainternal->m_local_id;
201 ARCANE_ITEM_ADD_STAT(m_nb_created_from_internal);
202 }
203
204 // NOTE: For the following constructor; it is essential to use
205 // const& to avoid ambiguity with the copy constructor
207 constexpr ARCCORE_HOST_DEVICE Item(const ItemBase& abase)
209 , m_local_id(abase.m_local_id)
210 {
211 }
212
214 Item(const ItemInternalPtr* internals, Int32 local_id)
215 : Item(local_id, internals[local_id]->m_shared_info)
216 {
217 ARCANE_ITEM_ADD_STAT(m_nb_created_from_internalptr);
218 }
219
222 {
223 _set(ainternal);
224 return (*this);
225 }
226
227 public:
228
230 constexpr bool null() const { return m_local_id == NULL_ITEM_ID; }
231
233 constexpr Int32 localId() const { return m_local_id; }
234
236 constexpr ItemLocalId itemLocalId() const { return ItemLocalId{ m_local_id }; }
237
240 {
241#ifdef ARCANE_CHECK
242 if (m_local_id != NULL_ITEM_LOCAL_ID)
243 arcaneCheckAt((Integer)m_local_id, m_shared_info->m_unique_ids.size());
244#endif
245 // Do not use the normal accessor because this array may be used for the
246 // null cell and in this case m_local_id equals NULL_ITEM_LOCAL_ID (which is negative)
247 // which causes an exception for array overflow.
248 return ItemUniqueId(m_shared_info->m_unique_ids.data()[m_local_id]);
249 }
250
252 Int32 owner() const { return m_shared_info->_ownerV2(m_local_id); }
253
255 Int16 type() const { return m_shared_info->_typeId(m_local_id); }
256
258 ItemTypeId itemTypeId() const { return ItemTypeId(type()); }
259
261 IItemFamily* itemFamily() const { return m_shared_info->m_item_family; }
262
264 constexpr eItemKind kind() const { return m_shared_info->m_item_kind; }
265
267 constexpr bool isOwn() const { return (_flags() & ItemFlags::II_Own) != 0; }
268
279 bool isShared() const { return (_flags() & ItemFlags::II_Shared) != 0; }
280
282 inline ItemWithNodes toItemWithNodes() const;
284 inline Node toNode() const;
286 inline Cell toCell() const;
288 inline Edge toEdge() const;
290 inline Face toFace() const;
292 inline Particle toParticle() const;
294 inline DoF toDoF() const;
295
297 Int32 nbParent() const { return _nbParent(); }
298
300 Item parent(Int32 i) const { return m_shared_info->_parentV2(m_local_id, i); }
301
303 Item parent() const { return m_shared_info->_parentV2(m_local_id, 0); }
304
305 public:
306
308 constexpr bool isItemWithNodes() const
309 {
310 eItemKind ik = kind();
311 return (ik == IK_Unknown || ik == IK_Edge || ik == IK_Face || ik == IK_Cell);
312 }
313
315 constexpr bool isNode() const
316 {
317 eItemKind ik = kind();
318 return (ik == IK_Unknown || ik == IK_Node);
319 }
320
321 constexpr bool isCell() const
322 {
323 eItemKind ik = kind();
324 return (ik == IK_Unknown || ik == IK_Cell);
325 }
326
327 constexpr bool isEdge() const
328 {
329 eItemKind ik = kind();
330 return (ik == IK_Unknown || ik == IK_Edge);
331 }
332
333 constexpr bool isFace() const
334 {
335 eItemKind ik = kind();
336 return (ik == IK_Unknown || ik == IK_Face);
337 }
338
339 constexpr bool isParticle() const
340 {
341 eItemKind ik = kind();
342 return (ik == IK_Unknown || ik == IK_Particle);
343 }
344 constexpr
345 bool isDoF() const
346 {
347 eItemKind ik = kind();
348 return (ik == IK_Unknown || ik == IK_DoF);
349 }
350
352 constexpr bool hasFlags(Int32 flags) const { return (_flags() & flags); }
353
355 constexpr Int32 flags() const { return m_shared_info->_flagsV2(m_local_id); }
356
357 public:
358
367 ARCANE_DEPRECATED_REASON("Y2024: This method is internal to Arcane. use itemBase() or mutableItemBase() instead")
369 {
370 if (m_local_id != NULL_ITEM_LOCAL_ID)
371 return m_shared_info->m_items_internal[m_local_id];
372 return ItemInternal::nullItem();
373 }
374
375 public:
376
383 impl::ItemBase itemBase() const
384 {
385 return impl::ItemBase(m_local_id, m_shared_info);
386 }
387
394 impl::MutableItemBase mutableItemBase() const
395 {
396 return impl::MutableItemBase(m_local_id, m_shared_info);
397 }
398
406 const ItemTypeInfo* typeInfo() const { return m_shared_info->typeInfoFromId(type()); }
407
408 public:
409
410 ARCANE_DEPRECATED_REASON("Y2022: Do not use this operator. Use operator '.' instead")
411 Item* operator->() { return this; }
412
413 ARCANE_DEPRECATED_REASON("Y2022: Do not use this operator. Use operator '.' instead")
414 const Item* operator->() const { return this; }
415
416 private:
417
419 ItemSharedInfo* m_shared_info = ItemSharedInfo::nullItemSharedInfoPointer;
420
421 protected:
422
429 Int32 m_local_id = NULL_ITEM_LOCAL_ID;
430
431 protected:
432
433 constexpr void _checkKind(bool is_valid) const
434 {
435 if (!is_valid)
436 _badConversion();
437 }
438 [[noreturn]] void _badConversion() const;
439 void _set(ItemInternal* ainternal)
440 {
441 _setFromInternal(ainternal);
442 }
443 constexpr void _set(const Item& rhs)
444 {
445 _setFromItem(rhs);
446 }
447
448 protected:
449
451 constexpr Int32 _flags() const { return m_shared_info->_flagsV2(m_local_id); }
453 constexpr Integer _nbNode() const { return _connectivity()->_nbNodeV2(m_local_id); }
455 constexpr Integer _nbEdge() const { return _connectivity()->_nbEdgeV2(m_local_id); }
457 constexpr Integer _nbFace() const { return _connectivity()->_nbFaceV2(m_local_id); }
459 constexpr Integer _nbCell() const { return _connectivity()->_nbCellV2(m_local_id); }
461 Int32 _nbHParent() const { return _connectivity()->_nbHParentV2(m_local_id); }
463 Int32 _nbHChildren() const { return _connectivity()->_nbHChildrenV2(m_local_id); }
465 Integer _nbParent() const { return m_shared_info->nbParent(); }
466 constexpr NodeLocalId _nodeId(Int32 index) const { return NodeLocalId(_connectivity()->_nodeLocalIdV2(m_local_id, index)); }
467 constexpr EdgeLocalId _edgeId(Int32 index) const { return EdgeLocalId(_connectivity()->_edgeLocalIdV2(m_local_id, index)); }
468 constexpr FaceLocalId _faceId(Int32 index) const { return FaceLocalId(_connectivity()->_faceLocalIdV2(m_local_id, index)); }
469 constexpr CellLocalId _cellId(Int32 index) const { return CellLocalId(_connectivity()->_cellLocalIdV2(m_local_id, index)); }
470 Int32 _hParentId(Int32 index) const { return _connectivity()->_hParentLocalIdV2(m_local_id, index); }
471 Int32 _hChildId(Int32 index) const { return _connectivity()->_hChildLocalIdV2(m_local_id, index); }
472 impl::ItemIndexedListView<DynExtent> _nodeList() const { return _connectivity()->nodeList(m_local_id); }
473 impl::ItemIndexedListView<DynExtent> _edgeList() const { return _connectivity()->edgeList(m_local_id); }
474 impl::ItemIndexedListView<DynExtent> _faceList() const { return _connectivity()->faceList(m_local_id); }
475 impl::ItemIndexedListView<DynExtent> _cellList() const { return _connectivity()->cellList(m_local_id); }
476 NodeLocalIdView _nodeIds() const { return _connectivity()->nodeLocalIdsView(m_local_id); }
477 EdgeLocalIdView _edgeIds() const { return _connectivity()->edgeLocalIdsView(m_local_id); }
478 FaceLocalIdView _faceIds() const { return _connectivity()->faceLocalIdsView(m_local_id); }
479 CellLocalIdView _cellIds() const { return _connectivity()->cellLocalIdsView(m_local_id); }
480
481 constexpr inline Node _node(Int32 index) const;
482 constexpr inline Edge _edge(Int32 index) const;
483 constexpr inline Face _face(Int32 index) const;
484 constexpr inline Cell _cell(Int32 index) const;
485
486 ItemBase _hParentBase(Int32 index) const { return _connectivity()->hParentBase(m_local_id, index, m_shared_info); }
487 ItemBase _hChildBase(Int32 index) const { return _connectivity()->hChildBase(m_local_id, index, m_shared_info); }
488 ItemBase _toItemBase() const { return ItemBase(m_local_id, m_shared_info); }
489
491 Int32 _nbLinearNode() const { return itemBase()._nbLinearNode(); }
492
493 private:
494
495 constexpr ItemInternalConnectivityList* _connectivity() const
496 {
497 return m_shared_info->m_connectivity;
498 }
499 void _setFromInternal(ItemBase* rhs)
500 {
501 ARCANE_ITEM_ADD_STAT(m_nb_set_from_internal);
502 m_local_id = rhs->m_local_id;
503 m_shared_info = rhs->m_shared_info;
504 }
505 constexpr void _setFromItem(const Item& rhs)
506 {
507 m_local_id = rhs.m_local_id;
508 m_shared_info = rhs.m_shared_info;
509 }
510
511 public:
512
513 static void dumpStats(ITraceMng* tm);
514 static void resetStats();
515
516 private:
517
518 static std::atomic<int> m_nb_created_from_internal;
519 static std::atomic<int> m_nb_created_from_internalptr;
520 static std::atomic<int> m_nb_set_from_internal;
521
522 private:
523
524 ItemInternal* _internal() const
525 {
526 if (m_local_id != NULL_ITEM_LOCAL_ID)
527 return m_shared_info->m_items_internal[m_local_id];
528 return ItemInternal::nullItem();
529 }
530};
531
532/*---------------------------------------------------------------------------*/
533/*---------------------------------------------------------------------------*/
534
541inline bool
542operator==(const Item& item1, const Item& item2)
543{
544 return item1.localId() == item2.localId();
545}
546
553inline bool
554operator!=(const Item& item1, const Item& item2)
555{
556 return item1.localId() != item2.localId();
557}
558
565inline bool
566operator<(const Item& item1, const Item& item2)
567{
568 return item1.localId() < item2.localId();
569}
570
571/*---------------------------------------------------------------------------*/
572/*---------------------------------------------------------------------------*/
573
574} // End namespace Arcane
575
576/*---------------------------------------------------------------------------*/
577/*---------------------------------------------------------------------------*/
578
579#include "arcane/core/ItemVectorView.h"
580#include "arcane/core/ItemConnectedListView.h"
581
582/*---------------------------------------------------------------------------*/
583/*---------------------------------------------------------------------------*/
584
585namespace Arcane
586{
587
588/*---------------------------------------------------------------------------*/
589/*---------------------------------------------------------------------------*/
590
596class ARCANE_CORE_EXPORT Node
597: public Item
598{
599 using ThatClass = Node;
600 // For accessing private constructors
601 friend class ItemEnumeratorBaseT<ThatClass>;
602 friend class ItemConnectedEnumeratorBaseT<ThatClass>;
603 friend class ItemVectorT<ThatClass>;
604 friend class ItemVectorViewT<ThatClass>;
605 friend class ItemConnectedListViewT<ThatClass>;
606 friend class ItemVectorViewConstIteratorT<ThatClass>;
607 friend class ItemConnectedListViewConstIteratorT<ThatClass>;
608 friend class SimdItemT<ThatClass>;
609 friend class ItemInfoListViewT<ThatClass>;
610 friend class ItemLocalIdToItemConverterT<ThatClass>;
611
612 public:
613
618 class ARCANE_DEPRECATED_REASON("Y2024: Use NodeLocalId instead") Index
619 : public Item::Index
620 {
621 public:
622
623 typedef Item::Index Base;
624
625 public:
626
627 explicit Index(Int32 id)
628 : Base(id)
629 {}
630 Index(Node item)
631 : Base(item)
632 {}
633 operator NodeLocalId() const { return NodeLocalId{ localId() }; }
634 };
635
636 protected:
637
639 constexpr Node(Int32 local_id, ItemSharedInfo* shared_info)
640 : Item(local_id, shared_info)
641 {}
642
643 public:
644
646 typedef NodeLocalId LocalIdType;
647
649 Node() = default;
650
652 Node(ItemInternal* ainternal)
653 : Item(ainternal)
654 {
655 ARCANE_CHECK_KIND(isNode);
656 }
657
659 constexpr Node(const ItemBase& abase)
660 : Item(abase)
661 {
662 ARCANE_CHECK_KIND(isNode);
663 }
664
666 constexpr explicit Node(const Item& aitem)
667 : Item(aitem)
668 {
669 ARCANE_CHECK_KIND(isNode);
670 }
671
673 Node(const ItemInternalPtr* internals, Int32 local_id)
674 : Item(internals, local_id)
675 {
676 ARCANE_CHECK_KIND(isNode);
677 }
678
681 {
682 _set(ainternal);
683 return (*this);
684 }
685
686 public:
687
689 constexpr eItemKind kind() const { return IK_Node; }
690
692 constexpr NodeLocalId itemLocalId() const { return NodeLocalId{ m_local_id }; }
693
695 constexpr Int32 nbEdge() const { return _nbEdge(); }
696
698 constexpr Int32 nbFace() const { return _nbFace(); }
699
701 Int32 nbCell() const { return _nbCell(); }
702
704 inline Edge edge(Int32 i) const;
705
707 inline Face face(Int32 i) const;
708
710 inline Cell cell(Int32 i) const;
711
713 EdgeLocalId edgeId(Int32 i) const { return _edgeId(i); }
714
716 FaceLocalId faceId(Int32 i) const { return _faceId(i); }
717
719 CellLocalId cellId(Int32 i) const { return _cellId(i); }
720
722 EdgeConnectedListViewType edges() const { return _edgeList(); }
723
725 FaceConnectedListViewType faces() const { return _faceList(); }
726
728 CellConnectedListViewType cells() const { return _cellList(); }
729
731 EdgeLocalIdView edgeIds() const { return _edgeIds(); }
732
734 FaceLocalIdView faceIds() const { return _faceIds(); }
735
737 CellLocalIdView cellIds() const { return _cellIds(); }
738
739 // AMR
740
743 {
744 return _toItemBase()._internalActiveCells2(local_ids);
745 }
746
747 ARCANE_DEPRECATED_REASON("Y2022: Do not use this operator. Use operator '.' instead")
748 Node* operator->() { return this; }
749
750 ARCANE_DEPRECATED_REASON("Y2022: Do not use this operator. Use operator '.' instead")
751 const Node* operator->() const { return this; }
752};
753
754/*---------------------------------------------------------------------------*/
755/*---------------------------------------------------------------------------*/
756
757constexpr inline Node Item::
758_node(Int32 index) const
759{
760 return Node(_connectivity()->nodeBase(m_local_id, index));
761}
762
763/*---------------------------------------------------------------------------*/
764/*---------------------------------------------------------------------------*/
765
771class ARCANE_CORE_EXPORT ItemWithNodes
772: public Item
773{
774 using ThatClass = ItemWithNodes;
775 // For accessing private constructors
776 friend class ItemEnumeratorBaseT<ThatClass>;
777 friend class ItemConnectedEnumeratorBaseT<ThatClass>;
778 friend class ItemVectorT<ThatClass>;
779 friend class ItemVectorViewT<ThatClass>;
780 friend class ItemConnectedListViewT<ThatClass>;
781 friend class ItemVectorViewConstIteratorT<ThatClass>;
782 friend class ItemConnectedListViewConstIteratorT<ThatClass>;
783 friend class SimdItemT<ThatClass>;
784 friend class ItemInfoListViewT<ThatClass>;
785 friend class ItemLocalIdToItemConverterT<ThatClass>;
786
787 protected:
788
790 constexpr ItemWithNodes(Int32 local_id, ItemSharedInfo* shared_info)
791 : Item(local_id, shared_info)
792 {}
793
794 public:
795
797 ItemWithNodes() = default;
798
801 : Item(ainternal)
802 {
803 ARCANE_CHECK_KIND(isItemWithNodes);
804 }
805
807 constexpr ItemWithNodes(const ItemBase& abase)
808 : Item(abase)
809 {
810 ARCANE_CHECK_KIND(isItemWithNodes);
811 }
812
814 constexpr explicit ItemWithNodes(const Item& aitem)
815 : Item(aitem)
816 {
817 ARCANE_CHECK_KIND(isItemWithNodes);
818 }
819
821 ItemWithNodes(const ItemInternalPtr* internals, Int32 local_id)
822 : Item(internals, local_id)
823 {
824 ARCANE_CHECK_KIND(isItemWithNodes);
825 }
826
829 {
830 _set(ainternal);
831 return (*this);
832 }
833
834 public:
835
837 Int32 nbNode() const { return _nbNode(); }
838
840 Node node(Int32 i) const { return _node(i); }
841
843 NodeConnectedListViewType nodes() const { return _nodeList(); }
844
846 NodeLocalIdView nodeIds() const { return _nodeIds(); }
847
849 NodeLocalId nodeId(Int32 index) const { return _nodeId(index); }
850
852 Int32 nbLinearNode() const { return _nbLinearNode(); }
853
854 public:
855
856 ARCANE_DEPRECATED_REASON("Y2022: Do not use this operator. Use operator '.' instead")
857 ItemWithNodes* operator->() { return this; }
858
859 ARCANE_DEPRECATED_REASON("Y2022: Do not use this operator. Use operator '.' instead")
860 const ItemWithNodes* operator->() const { return this; }
861};
862
863/*---------------------------------------------------------------------------*/
864/*---------------------------------------------------------------------------*/
865
873class ARCANE_CORE_EXPORT Edge
874: public ItemWithNodes
875{
876 using ThatClass = Edge;
877 // For accessing private constructors
878 friend class ItemEnumeratorBaseT<ThatClass>;
879 friend class ItemConnectedEnumeratorBaseT<ThatClass>;
880 friend class ItemVectorT<ThatClass>;
881 friend class ItemVectorViewT<ThatClass>;
882 friend class ItemConnectedListViewT<ThatClass>;
883 friend class ItemVectorViewConstIteratorT<ThatClass>;
884 friend class ItemConnectedListViewConstIteratorT<ThatClass>;
885 friend class SimdItemT<ThatClass>;
886 friend class ItemInfoListViewT<ThatClass>;
887 friend class ItemLocalIdToItemConverterT<ThatClass>;
888
889 public:
890
895 class ARCANE_DEPRECATED_REASON("Y2024: Use EdgeLocalId instead") Index
896 : public Item::Index
897 {
898 public:
899
900 typedef Item::Index Base;
901
902 public:
903
904 explicit Index(Int32 id)
905 : Base(id)
906 {}
907 Index(Edge item)
908 : Base(item)
909 {}
910 operator EdgeLocalId() const { return EdgeLocalId{ localId() }; }
911 };
912
913 private:
914
916 Edge(Int32 local_id, ItemSharedInfo* shared_info)
917 : ItemWithNodes(local_id, shared_info)
918 {}
919
920 public:
921
923 typedef EdgeLocalId LocalIdType;
924
926 Edge() = default;
927
929 Edge(ItemInternal* ainternal)
930 : ItemWithNodes(ainternal)
931 {
932 ARCANE_CHECK_KIND(isEdge);
933 }
934
936 constexpr Edge(const ItemBase& abase)
937 : ItemWithNodes(abase)
938 {
939 ARCANE_CHECK_KIND(isEdge);
940 }
941
943 constexpr explicit Edge(const Item& aitem)
944 : ItemWithNodes(aitem)
945 {
946 ARCANE_CHECK_KIND(isEdge);
947 }
948
950 Edge(const ItemInternalPtr* internals, Int32 local_id)
951 : ItemWithNodes(internals, local_id)
952 {
953 ARCANE_CHECK_KIND(isEdge);
954 }
955
958 {
959 _set(ainternal);
960 return (*this);
961 }
962
963 public:
964
966 constexpr eItemKind kind() const { return IK_Edge; }
967
969 EdgeLocalId itemLocalId() const { return EdgeLocalId{ m_local_id }; }
970
972 Int32 nbNode() const { return 2; }
973
975 Int32 nbFace() const { return _nbFace(); }
976
978 Int32 nbCell() const { return _nbCell(); }
979
981 inline Cell cell(Int32 i) const;
982
984 CellConnectedListViewType cells() const { return _cellList(); }
985
987 CellLocalId cellId(Int32 i) const { return _cellId(i); }
988
990 CellLocalIdView cellIds() const { return _cellIds(); }
991
993 inline Face face(Int32 i) const;
994
996 FaceConnectedListViewType faces() const { return _faceList(); }
997
999 FaceLocalId faceId(Int32 i) const { return _faceId(i); }
1000
1002 FaceLocalIdView faceIds() const { return _faceIds(); }
1003
1004 ARCANE_DEPRECATED_REASON("Y2022: Do not use this operator. Use operator '.' instead")
1005 Edge* operator->() { return this; }
1006
1007 ARCANE_DEPRECATED_REASON("Y2022: Do not use this operator. Use operator '.' instead")
1008 const Edge* operator->() const { return this; }
1009};
1010
1011/*---------------------------------------------------------------------------*/
1012/*---------------------------------------------------------------------------*/
1013
1014constexpr inline Edge Item::
1015_edge(Int32 index) const
1016{
1017 return Edge(_connectivity()->edgeBase(m_local_id, index));
1018}
1019
1020/*---------------------------------------------------------------------------*/
1021/*---------------------------------------------------------------------------*/
1022
1030class ARCANE_CORE_EXPORT Face
1031: public ItemWithNodes
1032{
1033 using ThatClass = Face;
1034 // To access private constructors
1035 friend class ItemEnumeratorBaseT<ThatClass>;
1036 friend class ItemConnectedEnumeratorBaseT<ThatClass>;
1037 friend class ItemVectorT<ThatClass>;
1038 friend class ItemVectorViewT<ThatClass>;
1039 friend class ItemConnectedListViewT<ThatClass>;
1040 friend class ItemVectorViewConstIteratorT<ThatClass>;
1041 friend class ItemConnectedListViewConstIteratorT<ThatClass>;
1042 friend class SimdItemT<ThatClass>;
1043 friend class ItemInfoListViewT<ThatClass>;
1044 friend class ItemLocalIdToItemConverterT<ThatClass>;
1045
1046 public:
1047
1052 class ARCANE_DEPRECATED_REASON("Y2024: Use FaceLocalId instead") Index
1053 : public Item::Index
1054 {
1055 public:
1056
1057 typedef Item::Index Base;
1058
1059 public:
1060
1061 explicit Index(Int32 id)
1062 : Base(id)
1063 {}
1064 Index(Face item)
1065 : Base(item)
1066 {}
1067 operator FaceLocalId() const { return FaceLocalId{ localId() }; }
1068 };
1069
1070 private:
1071
1073 constexpr Face(Int32 local_id, ItemSharedInfo* shared_info)
1074 : ItemWithNodes(local_id, shared_info)
1075 {}
1076
1077 public:
1078
1080 typedef FaceLocalId LocalIdType;
1081
1083 Face() = default;
1084
1086 Face(ItemInternal* ainternal)
1087 : ItemWithNodes(ainternal)
1088 {
1089 ARCANE_CHECK_KIND(isFace);
1090 }
1091
1093 constexpr Face(const ItemBase& abase)
1094 : ItemWithNodes(abase)
1095 {
1096 ARCANE_CHECK_KIND(isFace);
1097 }
1098
1100 constexpr explicit Face(const Item& aitem)
1101 : ItemWithNodes(aitem)
1102 {
1103 ARCANE_CHECK_KIND(isFace);
1104 }
1105
1107 Face(const ItemInternalPtr* internals, Int32 local_id)
1108 : ItemWithNodes(internals, local_id)
1109 {
1110 ARCANE_CHECK_KIND(isFace);
1111 }
1112
1115 {
1116 _set(ainternal);
1117 return (*this);
1118 }
1119
1120 public:
1121
1123 constexpr eItemKind kind() const { return IK_Face; }
1124
1126 FaceLocalId itemLocalId() const { return FaceLocalId{ m_local_id }; }
1127
1129 Int32 nbCell() const { return _nbCell(); }
1130
1132 inline Cell cell(Int32 i) const;
1133
1135 CellConnectedListViewType cells() const { return _cellList(); }
1136
1138 CellLocalId cellId(Int32 i) const { return _cellId(i); }
1139
1141 CellLocalIdView cellIds() const { return _cellIds(); }
1142
1148 bool isSubDomainBoundary() const { return (_flags() & ItemFlags::II_Boundary) != 0; }
1149
1154 ARCANE_DEPRECATED_118 bool isBoundary() const { return isSubDomainBoundary(); }
1155
1158 {
1160 }
1161
1167 ARCANE_DEPRECATED_118 bool isBoundaryOutside() const
1168 {
1170 }
1171
1173 inline Cell boundaryCell() const;
1174
1176 inline Cell backCell() const;
1177
1179 CellLocalId backCellId() const { return CellLocalId(_toItemBase().backCellId()); }
1180
1182 inline Cell frontCell() const;
1183
1185 CellLocalId frontCellId() const { return CellLocalId(_toItemBase().frontCellId()); }
1186
1192 inline Cell oppositeCell(Cell cell) const;
1193
1199 CellLocalId oppositeCellId(CellLocalId cell_id) const
1200 {
1201 ARCANE_ASSERT((backCellId() == cell_id || frontCellId() == cell_id), ("cell is not connected to the face"));
1202 return (backCellId() == cell_id) ? frontCellId() : backCellId();
1203 }
1204
1213 Face masterFace() const { return _toItemBase().masterFace(); }
1214
1216 bool isMasterFace() const { return _toItemBase().isMasterFace(); }
1217
1219 bool isSlaveFace() const { return _toItemBase().isSlaveFace(); }
1220
1222 bool isTiedFace() const { return isSlaveFace() || isMasterFace(); }
1223
1231 {
1232 if (_toItemBase().isMasterFace())
1233 return _faceList();
1235 }
1236
1237 public:
1238
1240 Int32 nbEdge() const { return _nbEdge(); }
1241
1243 Edge edge(Int32 i) const { return _edge(i); }
1244
1246 EdgeConnectedListViewType edges() const { return _edgeList(); }
1247
1249 EdgeLocalId edgeId(Int32 i) const { return _edgeId(i); }
1250
1252 EdgeLocalIdView edgeIds() const { return _edgeIds(); }
1253
1254 ARCANE_DEPRECATED_REASON("Y2022: Do not use this operator. Use operator '.' instead")
1255 Face* operator->() { return this; }
1256
1257 ARCANE_DEPRECATED_REASON("Y2022: Do not use this operator. Use operator '.' instead")
1258 const Face* operator->() const { return this; }
1259};
1260
1261/*---------------------------------------------------------------------------*/
1262/*---------------------------------------------------------------------------*/
1263
1264constexpr inline Face Item::
1265_face(Int32 index) const
1266{
1267 return Face(_connectivity()->faceBase(m_local_id, index));
1268}
1269
1270/*---------------------------------------------------------------------------*/
1271/*---------------------------------------------------------------------------*/
1272
1298class ARCANE_CORE_EXPORT Cell
1299: public ItemWithNodes
1300{
1301 using ThatClass = Cell;
1302 // To access private constructors
1303 friend class ItemEnumeratorBaseT<ThatClass>;
1304 friend class ItemConnectedEnumeratorBaseT<ThatClass>;
1305 friend class ItemVectorT<ThatClass>;
1306 friend class ItemVectorViewT<ThatClass>;
1307 friend class ItemConnectedListViewT<ThatClass>;
1308 friend class ItemVectorViewConstIteratorT<ThatClass>;
1309 friend class ItemConnectedListViewConstIteratorT<ThatClass>;
1310 friend class SimdItemT<ThatClass>;
1311 friend class ItemInfoListViewT<ThatClass>;
1312 friend class ItemLocalIdToItemConverterT<ThatClass>;
1313
1314 public:
1315
1320 class ARCANE_DEPRECATED_REASON("Y2024: Use CellLocalId instead") Index
1321 : public Item::Index
1322 {
1323 public:
1324
1325 typedef Item::Index Base;
1326
1327 public:
1328
1329 explicit Index(Int32 id)
1330 : Base(id)
1331 {}
1332 Index(Cell item)
1333 : Base(item)
1334 {}
1335 operator CellLocalId() const { return CellLocalId{ localId() }; }
1336 };
1337
1338 private:
1339
1341 Cell(Int32 local_id, ItemSharedInfo* shared_info)
1342 : ItemWithNodes(local_id, shared_info)
1343 {}
1344
1345 public:
1346
1348 typedef CellLocalId LocalIdType;
1349
1351 Cell() = default;
1352
1354 Cell(ItemInternal* ainternal)
1355 : ItemWithNodes(ainternal)
1356 {
1357 ARCANE_CHECK_KIND(isCell);
1358 }
1359
1361 constexpr Cell(const ItemBase& abase)
1362 : ItemWithNodes(abase)
1363 {
1364 ARCANE_CHECK_KIND(isCell);
1365 }
1366
1368 constexpr explicit Cell(const Item& aitem)
1369 : ItemWithNodes(aitem)
1370 {
1371 ARCANE_CHECK_KIND(isCell);
1372 }
1373
1375 Cell(const ItemInternalPtr* internals, Int32 local_id)
1376 : ItemWithNodes(internals, local_id)
1377 {
1378 ARCANE_CHECK_KIND(isCell);
1379 }
1380
1383 {
1384 _set(ainternal);
1385 return (*this);
1386 }
1387
1388 public:
1389
1391 constexpr eItemKind kind() const { return IK_Cell; }
1392
1394 CellLocalId itemLocalId() const { return CellLocalId{ m_local_id }; }
1395
1397 Int32 nbFace() const { return _nbFace(); }
1398
1400 Face face(Int32 i) const { return _face(i); }
1401
1403 FaceConnectedListViewType faces() const { return _faceList(); }
1404
1406 FaceLocalId faceId(Int32 i) const { return _faceId(i); }
1407
1409 FaceLocalIdView faceIds() const { return _faceIds(); }
1410
1412 Int32 nbEdge() const { return _nbEdge(); }
1413
1415 Edge edge(Int32 i) const { return _edge(i); }
1416
1418 EdgeLocalId edgeId(Int32 i) const { return _edgeId(i); }
1419
1421 EdgeConnectedListViewType edges() const { return _edgeList(); }
1422
1424 EdgeLocalIdView edgeIds() const { return _edgeIds(); }
1425
1432 Cell hParent() const { return Cell(_hParentBase(0)); }
1433
1435 Int32 nbHParent() const { return _nbHParent(); }
1436
1438 Int32 nbHChildren() const { return _nbHChildren(); }
1439
1441 Cell hChild(Int32 i) const { return Cell(_hChildBase(i)); }
1442
1444 Cell topHParent() const { return Cell(_toItemBase().topHParentBase()); }
1445
1451 bool isActive() const { return _toItemBase().isActive(); }
1452
1453 bool isSubactive() const { return _toItemBase().isSubactive(); }
1454
1460 bool isAncestor() const { return _toItemBase().isAncestor(); }
1461
1466 bool hasHChildren() const { return _toItemBase().hasHChildren(); }
1467
1473 Int32 level() const
1474 {
1478 if (this->_nbHParent() == 0)
1479 return 0;
1481 return (this->_hParentBase(0).level() + 1);
1482 }
1483
1490 {
1491 return _toItemBase().whichChildAmI(iitem->localId());
1492 }
1493
1499 Int32 whichChildAmI(CellLocalId local_id) const
1500 {
1501 return _toItemBase().whichChildAmI(local_id);
1502 }
1503
1504 ARCANE_DEPRECATED_REASON("Y2022: Do not use this operator. Use operator '.' instead")
1505 Cell* operator->() { return this; }
1506
1507 ARCANE_DEPRECATED_REASON("Y2022: Do not use this operator. Use operator '.' instead")
1508 const Cell* operator->() const { return this; }
1509};
1510
1511/*---------------------------------------------------------------------------*/
1512/*---------------------------------------------------------------------------*/
1513
1514constexpr inline Cell Item::
1515_cell(Int32 index) const
1516{
1517 return Cell(_connectivity()->cellBase(m_local_id, index));
1518}
1519
1520/*---------------------------------------------------------------------------*/
1521/*---------------------------------------------------------------------------*/
1522
1528: public Item
1529{
1530 using ThatClass = Particle;
1531 // Pour accéder aux constructeurs privés
1532 friend class ItemEnumeratorBaseT<ThatClass>;
1533 friend class ItemConnectedEnumeratorBaseT<ThatClass>;
1534 friend class ItemVectorT<ThatClass>;
1535 friend class ItemVectorViewT<ThatClass>;
1536 friend class ItemConnectedListViewT<ThatClass>;
1537 friend class ItemVectorViewConstIteratorT<ThatClass>;
1538 friend class ItemConnectedListViewConstIteratorT<ThatClass>;
1539 friend class SimdItemT<ThatClass>;
1540 friend class ItemInfoListViewT<ThatClass>;
1541 friend class ItemLocalIdToItemConverterT<ThatClass>;
1542
1543 private:
1544
1546 Particle(Int32 local_id, ItemSharedInfo* shared_info)
1547 : Item(local_id, shared_info)
1548 {}
1549
1550 public:
1551
1553 typedef ParticleLocalId LocalIdType;
1554
1556 Particle() = default;
1557
1560 : Item(ainternal)
1561 {
1562 ARCANE_CHECK_KIND(isParticle);
1563 }
1564
1566 constexpr Particle(const ItemBase& abase)
1567 : Item(abase)
1568 {
1569 ARCANE_CHECK_KIND(isParticle);
1570 }
1571
1573 constexpr explicit Particle(const Item& aitem)
1574 : Item(aitem)
1575 {
1576 ARCANE_CHECK_KIND(isParticle);
1577 }
1578
1580 Particle(const ItemInternalPtr* internals, Int32 local_id)
1581 : Item(internals, local_id)
1582 {
1583 ARCANE_CHECK_KIND(isParticle);
1584 }
1585
1588 {
1589 _set(ainternal);
1590 return (*this);
1591 }
1592
1593 public:
1594
1596 constexpr eItemKind kind() const { return IK_Particle; }
1597
1599 ParticleLocalId itemLocalId() const { return ParticleLocalId{ m_local_id }; }
1600
1606 Cell cell() const { return _cell(0); }
1607
1609 CellLocalId cellId() const { return _cellId(0); }
1610
1612 bool hasCell() const { return (_cellId(0).localId() != NULL_ITEM_LOCAL_ID); }
1613
1620 {
1621 Int32 cell_local_id = _cellId(0).localId();
1622 if (cell_local_id == NULL_ITEM_LOCAL_ID)
1623 return Cell();
1624 return _cell(0);
1625 }
1626
1627 ARCANE_DEPRECATED_REASON("Y2022: Do not use this operator. Use operator '.' instead")
1628 Particle* operator->() { return this; }
1629
1630 ARCANE_DEPRECATED_REASON("Y2022: Do not use this operator. Use operator '.' instead")
1631 const Particle* operator->() const { return this; }
1632};
1633
1634/*---------------------------------------------------------------------------*/
1635/*---------------------------------------------------------------------------*/
1636
1647class DoF
1648: public Item
1649{
1650 using ThatClass = DoF;
1651 // Pour accéder aux constructeurs privés
1652 friend class ItemEnumeratorBaseT<ThatClass>;
1653 friend class ItemConnectedEnumeratorBaseT<ThatClass>;
1654 friend class ItemVectorT<ThatClass>;
1655 friend class ItemVectorViewT<ThatClass>;
1656 friend class ItemConnectedListViewT<ThatClass>;
1657 friend class ItemVectorViewConstIteratorT<ThatClass>;
1658 friend class ItemConnectedListViewConstIteratorT<ThatClass>;
1659 friend class SimdItemT<ThatClass>;
1660 friend class ItemInfoListViewT<ThatClass>;
1661 friend class ItemLocalIdToItemConverterT<ThatClass>;
1662
1663 private:
1664
1666 constexpr DoF(Int32 local_id, ItemSharedInfo* shared_info)
1667 : Item(local_id, shared_info)
1668 {}
1669
1670 public:
1671
1672 using LocalIdType = DoFLocalId;
1673
1675 DoF() = default;
1676
1678 DoF(ItemInternal* ainternal)
1679 : Item(ainternal)
1680 {
1681 ARCANE_CHECK_KIND(isDoF);
1682 }
1683
1685 constexpr DoF(const ItemBase& abase)
1686 : Item(abase)
1687 {
1688 ARCANE_CHECK_KIND(isDoF);
1689 }
1690
1692 constexpr explicit DoF(const Item& aitem)
1693 : Item(aitem)
1694 {
1695 ARCANE_CHECK_KIND(isDoF);
1696 }
1697
1699 DoF(const ItemInternalPtr* internals, Int32 local_id)
1700 : Item(internals, local_id)
1701 {
1702 ARCANE_CHECK_KIND(isDoF);
1703 }
1704
1707 {
1708 _set(ainternal);
1709 return (*this);
1710 }
1711
1712 ARCANE_DEPRECATED_REASON("Y2022: Do not use this operator. Use operator '.' instead")
1713 DoF* operator->() { return this; }
1714
1715 ARCANE_DEPRECATED_REASON("Y2022: Do not use this operator. Use operator '.' instead")
1716 const DoF* operator->() const { return this; }
1717
1719 constexpr eItemKind kind() const { return IK_DoF; }
1720
1722 DoFLocalId itemLocalId() const { return DoFLocalId{ m_local_id }; }
1723};
1724
1725/*---------------------------------------------------------------------------*/
1726/*---------------------------------------------------------------------------*/
1727
1728/*---------------------------------------------------------------------------*/
1729/*---------------------------------------------------------------------------*/
1730
1732edge(Int32 i) const
1733{
1734 return _edge(i);
1735}
1736
1738face(Int32 i) const
1739{
1740 return _face(i);
1741}
1742
1744cell(Int32 i) const
1745{
1746 return _cell(i);
1747}
1748
1749/*---------------------------------------------------------------------------*/
1750/*---------------------------------------------------------------------------*/
1751
1753face(Int32 i) const
1754{
1755 return _face(i);
1756}
1757
1759cell(Int32 i) const
1760{
1761 return _cell(i);
1762}
1763
1764/*---------------------------------------------------------------------------*/
1765/*---------------------------------------------------------------------------*/
1766
1768boundaryCell() const
1769{
1770 return Cell(_toItemBase().boundaryCell());
1771}
1772
1774backCell() const
1775{
1776 return Cell(_toItemBase().backCell());
1777}
1778
1780frontCell() const
1781{
1782 return Cell(_toItemBase().frontCell());
1783}
1784
1786oppositeCell(Cell cell) const
1787{
1788 ARCANE_ASSERT((backCell() == cell || frontCell() == cell), ("cell is not connected to the face"));
1789 return (backCell() == cell) ? frontCell() : backCell();
1790}
1791
1793cell(Int32 i) const
1794{
1795 return _cell(i);
1796}
1797
1798/*---------------------------------------------------------------------------*/
1799/*---------------------------------------------------------------------------*/
1800
1802toItemWithNodes() const
1803{
1804 ARCANE_CHECK_KIND(isItemWithNodes);
1805 return ItemWithNodes(*this);
1806}
1807
1809toNode() const
1810{
1811 ARCANE_CHECK_KIND(isNode);
1812 return Node(*this);
1813}
1814
1816toEdge() const
1817{
1818 ARCANE_CHECK_KIND(isEdge);
1819 return Edge(*this);
1820}
1821
1823toFace() const
1824{
1825 ARCANE_CHECK_KIND(isFace);
1826 return Face(*this);
1827}
1828
1830toCell() const
1831{
1832 ARCANE_CHECK_KIND(isCell);
1833 return Cell(*this);
1834}
1835
1837toParticle() const
1838{
1839 ARCANE_CHECK_KIND(isParticle);
1840 return Particle(*this);
1841}
1842
1844toDoF() const
1845{
1846 ARCANE_CHECK_KIND(isDoF);
1847 return DoF(*this);
1848}
1849
1850/*---------------------------------------------------------------------------*/
1851/*---------------------------------------------------------------------------*/
1852
1853inline ItemLocalId::
1854ItemLocalId(Item item)
1855: m_local_id(item.localId())
1856{
1857}
1858
1859template <typename ItemType> inline ItemLocalIdT<ItemType>::
1860ItemLocalIdT(ItemType item)
1861: ItemLocalId(item.localId())
1862{
1863}
1864
1865/*---------------------------------------------------------------------------*/
1866/*---------------------------------------------------------------------------*/
1867
1869operator[](ItemLocalId local_id) const
1870{
1871 return Item(local_id.localId(), m_item_shared_info);
1872}
1873
1874/*---------------------------------------------------------------------------*/
1875/*---------------------------------------------------------------------------*/
1876
1878operator[](Int32 local_id) const
1879{
1880 return Item(local_id, m_item_shared_info);
1881}
1882
1883/*---------------------------------------------------------------------------*/
1884/*---------------------------------------------------------------------------*/
1885
1886template <typename ItemType> inline ItemType ItemInfoListViewT<ItemType>::
1887operator[](ItemLocalId local_id) const
1888{
1889 return ItemType(local_id.localId(), m_item_shared_info);
1890}
1891
1892/*---------------------------------------------------------------------------*/
1893/*---------------------------------------------------------------------------*/
1894
1895template <typename ItemType> inline ItemType ItemInfoListViewT<ItemType>::
1896operator[](Int32 local_id) const
1897{
1898 return ItemType(local_id, m_item_shared_info);
1899}
1900
1901/*---------------------------------------------------------------------------*/
1902/*---------------------------------------------------------------------------*/
1903
1904inline constexpr ARCCORE_HOST_DEVICE Item ItemLocalIdToItemConverter::
1905operator[](ItemLocalId local_id) const
1906{
1907 return Item(local_id.localId(), m_item_shared_info);
1908}
1909
1910/*---------------------------------------------------------------------------*/
1911/*---------------------------------------------------------------------------*/
1912
1913inline constexpr ARCCORE_HOST_DEVICE Item ItemLocalIdToItemConverter::
1914operator[](Int32 local_id) const
1915{
1916 return Item(local_id, m_item_shared_info);
1917}
1918
1919/*---------------------------------------------------------------------------*/
1920/*---------------------------------------------------------------------------*/
1921
1922template <typename ItemType_> inline constexpr ARCCORE_HOST_DEVICE ItemType_
1924operator[](ItemLocalIdType local_id) const
1925{
1926 return ItemType(local_id.localId(), m_item_shared_info);
1927}
1928
1929/*---------------------------------------------------------------------------*/
1930/*---------------------------------------------------------------------------*/
1931
1932template <typename ItemType_> inline constexpr ARCCORE_HOST_DEVICE ItemType_
1934operator[](Int32 local_id) const
1935{
1936 return ItemType(local_id, m_item_shared_info);
1937}
1938
1939/*---------------------------------------------------------------------------*/
1940/*---------------------------------------------------------------------------*/
1941
1942} // End namespace Arcane
1943
1944/*---------------------------------------------------------------------------*/
1945/*---------------------------------------------------------------------------*/
1946
1947#include "arcane/core/ItemCompatibility.h"
1948
1949/*---------------------------------------------------------------------------*/
1950/*---------------------------------------------------------------------------*/
1951
1952#endif
Declarations of types on entities.
Cell of a mesh.
Definition Item.h:1300
Cell topHParent() const
level 0 parent for AMR
Definition Item.h:1444
Int32 nbEdge() const
Number of edges of the cell.
Definition Item.h:1412
constexpr Cell(const ItemBase &abase)
Constructs a reference to the base entity.
Definition Item.h:1361
FaceConnectedListViewType faces() const
List of faces of the cell.
Definition Item.h:1403
Int32 nbHChildren() const
Number of children for AMR.
Definition Item.h:1438
bool isAncestor() const
Definition Item.h:1460
Cell(Int32 local_id, ItemSharedInfo *shared_info)
Constructor reserved for enumerators.
Definition Item.h:1341
Face face(Int32 i) const
i-th face of the cell
Definition Item.h:1400
FaceLocalIdView faceIds() const
List of faces of the cell.
Definition Item.h:1409
Cell(ItemInternal *ainternal)
(deprecated) Constructs a reference to the internal entity
Definition Item.h:1354
Int32 nbFace() const
Number of faces of the cell.
Definition Item.h:1397
Cell & operator=(ItemInternal *ainternal)
Copy operator.
Definition Item.h:1382
Cell(const ItemInternalPtr *internals, Int32 local_id)
Constructs a reference to the internal entity.
Definition Item.h:1375
CellLocalId itemLocalId() const
Local identifier of the entity in the processor subdomain.
Definition Item.h:1394
EdgeLocalIdView edgeIds() const
List of edges of the cell.
Definition Item.h:1424
EdgeLocalId edgeId(Int32 i) const
i-th edge of the cell
Definition Item.h:1418
Int32 whichChildAmI(const ItemInternal *iitem) const
Definition Item.h:1489
constexpr Cell(const Item &aitem)
Constructs a reference to the item entity.
Definition Item.h:1368
Cell hChild(Int32 i) const
i-th AMR child
Definition Item.h:1441
bool hasHChildren() const
Definition Item.h:1466
Edge edge(Int32 i) const
i-th edge of the cell
Definition Item.h:1415
Cell()=default
Constructor of a null cell.
Int32 whichChildAmI(CellLocalId local_id) const
Definition Item.h:1499
FaceLocalId faceId(Int32 i) const
i-th face of the cell
Definition Item.h:1406
bool isActive() const
Definition Item.h:1451
Int32 level() const
Definition Item.h:1473
Cell hParent() const
Definition Item.h:1432
EdgeConnectedListViewType edges() const
List of edges of the cell.
Definition Item.h:1421
Int32 nbHParent() const
Number of parents for AMR.
Definition Item.h:1435
constexpr eItemKind kind() const
Entity kind.
Definition Item.h:1391
CellLocalId LocalIdType
Type of localId().
Definition Item.h:1348
degree of freedom class.
Definition Item.h:1649
constexpr DoF(Int32 local_id, ItemSharedInfo *shared_info)
Constructor reserved for enumerators.
Definition Item.h:1666
DoF(const ItemInternalPtr *internals, Int32 local_id)
Constructs a reference to the internal entity.
Definition Item.h:1699
DoF()=default
Constructor for a non-connected cell.
DoFLocalId itemLocalId() const
Local identifier of the entity in the processor subdomain.
Definition Item.h:1722
constexpr DoF(const Item &aitem)
Constructs a reference to the abase entity.
Definition Item.h:1692
DoF & operator=(ItemInternal *ainternal)
Copy operator.
Definition Item.h:1706
DoF(ItemInternal *ainternal)
(deprecated) Constructs a reference to the internal entity
Definition Item.h:1678
constexpr DoF(const ItemBase &abase)
Constructs a reference to the abase entity.
Definition Item.h:1685
constexpr eItemKind kind() const
Entity kind.
Definition Item.h:1719
Edge of a cell.
Definition Item.h:875
FaceConnectedListViewType faces() const
List of faces of the edge.
Definition Item.h:996
constexpr eItemKind kind() const
Kind of the entity.
Definition Item.h:966
CellConnectedListViewType cells() const
List of edge cells.
Definition Item.h:984
Cell cell(Int32 i) const
i-th cell of the edge
Definition Item.h:1759
Face face(Int32 i) const
i-th face of the edge
Definition Item.h:1753
Edge(const ItemInternalPtr *internals, Int32 local_id)
Constructs a reference to the entity internal.
Definition Item.h:950
constexpr Edge(const Item &aitem)
Constructs a reference to the entity aitem.
Definition Item.h:943
FaceLocalIdView faceIds() const
List of faces of the edge.
Definition Item.h:1002
Edge & operator=(ItemInternal *ainternal)
Copy operator.
Definition Item.h:957
Int32 nbFace() const
Number of faces connected to the edge.
Definition Item.h:975
CellLocalIdView cellIds() const
List of edge cells.
Definition Item.h:990
constexpr Edge(const ItemBase &abase)
Constructs a reference to the entity abase.
Definition Item.h:936
Edge()=default
Creates a null edge.
FaceLocalId faceId(Int32 i) const
i-th face of the edge
Definition Item.h:999
Edge(ItemInternal *ainternal)
(deprecated) Constructs a reference to the entity internal
Definition Item.h:929
EdgeLocalId LocalIdType
Type of localId().
Definition Item.h:923
Edge(Int32 local_id, ItemSharedInfo *shared_info)
Constructor reserved for enumerators.
Definition Item.h:916
Int32 nbNode() const
Number of vertices of the edge.
Definition Item.h:972
CellLocalId cellId(Int32 i) const
i-th edge cell
Definition Item.h:987
Int32 nbCell() const
Number of cells connected to the edge.
Definition Item.h:978
EdgeLocalId itemLocalId() const
Local identifier of the entity in the processor subdomain.
Definition Item.h:969
Face of a cell.
Definition Item.h:1032
Face()=default
Creation of a face not connected to the mesh.
bool isMasterFace() const
true if it is the master face of an interface
Definition Item.h:1216
constexpr eItemKind kind() const
Entity kind.
Definition Item.h:1123
FaceLocalId LocalIdType
Type of localId().
Definition Item.h:1080
CellLocalId frontCellId() const
Cell in front of the face (null cell if none).
Definition Item.h:1185
Cell frontCell() const
Cell in front of the face (null cell if none).
Definition Item.h:1780
CellLocalId cellId(Int32 i) const
i-th cell of the face
Definition Item.h:1138
EdgeLocalIdView edgeIds() const
List of edges of the face.
Definition Item.h:1252
Cell cell(Int32 i) const
i-th cell of the face
Definition Item.h:1793
Int32 nbCell() const
Number of cells of the face (1 or 2).
Definition Item.h:1129
ARCANE_DEPRECATED_118 bool isBoundary() const
Definition Item.h:1154
FaceConnectedListViewType slaveFaces() const
List of slave faces associated with this master face.
Definition Item.h:1230
constexpr Face(const Item &aitem)
Constructs a reference to the item entity.
Definition Item.h:1100
ARCANE_DEPRECATED_118 bool isBoundaryOutside() const
Indicates if the face is on the subdomain boundary facing outwards.
Definition Item.h:1167
EdgeConnectedListViewType edges() const
List of edges of the face.
Definition Item.h:1246
bool isSubDomainBoundary() const
Indicates if the face is on the subdomain boundary (i.e nbCell()==1).
Definition Item.h:1148
FaceLocalId itemLocalId() const
Local identifier of the entity in the processor subdomain.
Definition Item.h:1126
EdgeLocalId edgeId(Int32 i) const
i-th edge of the face
Definition Item.h:1249
CellConnectedListViewType cells() const
List of cells of the face.
Definition Item.h:1135
Face masterFace() const
Master face associated with this face.
Definition Item.h:1213
bool isSlaveFace() const
true if it is a slave face of an interface
Definition Item.h:1219
Edge edge(Int32 i) const
i-th edge of the face
Definition Item.h:1243
constexpr Face(const ItemBase &abase)
Constructs a reference to the base entity.
Definition Item.h:1093
CellLocalId backCellId() const
Cell behind the face (null cell if none).
Definition Item.h:1179
Face(const ItemInternalPtr *internals, Int32 local_id)
Constructs a reference to the internal entity.
Definition Item.h:1107
bool isSubDomainBoundaryOutside() const
Indicates if the face is on the subdomain boundary facing outwards.
Definition Item.h:1157
Face(ItemInternal *ainternal)
(deprecated) Constructs a reference to the internal entity
Definition Item.h:1086
Cell boundaryCell() const
Cell associated with this boundary face (null cell if none).
Definition Item.h:1768
Int32 nbEdge() const
Number of edges of the face.
Definition Item.h:1240
bool isTiedFace() const
true if it is a slave or master face of an interface
Definition Item.h:1222
CellLocalIdView cellIds() const
List of cells of the face.
Definition Item.h:1141
Face & operator=(ItemInternal *ainternal)
Copy operator.
Definition Item.h:1114
Cell backCell() const
Cell behind the face (null cell if none).
Definition Item.h:1774
constexpr Face(Int32 local_id, ItemSharedInfo *shared_info)
Constructor reserved for enumerators.
Definition Item.h:1073
Cell oppositeCell(Cell cell) const
Opposite cell of this face to the cell cell.
Definition Item.h:1786
CellLocalId oppositeCellId(CellLocalId cell_id) const
Opposite cell of this face to the cell cell.
Definition Item.h:1199
Interface of an entity family.
Definition IItemFamily.h:83
Base class for mesh entities.
Int32 m_local_id
Local number (in the subdomain) of the entity.
ItemSharedInfo * m_shared_info
Shared info between all entities with the same characteristics.
Int32 localId() const
Local number (in the subdomain) of the entity.
Typed base class for enumerators over a list of connected entities.
View of a list of entities connected to another.
Base class for enumerators over a list of entities.
@ II_Shared
The entity is shared by another subdomain.
Definition ItemFlags.h:59
@ II_HasBackCell
The entity has a back cell.
Definition ItemFlags.h:53
@ II_Own
The entity is a domain-specific entity.
Definition ItemFlags.h:56
@ II_Boundary
The entity is on the boundary.
Definition ItemFlags.h:51
Base class for specialized views of entity information.
ItemType operator[](ItemLocalId local_id) const
Entity associated with local ID local_id.
Definition Item.h:1887
Item operator[](ItemLocalId local_id) const
Entity associated with local ID local_id.
Definition Item.h:1869
Connectivity information, for an entity family, allowing transition between old and new connectivity ...
Internal structure of a mesh entity.
Class to convert an ItemLocalId to an entity (Item).
constexpr __host__ __device__ ItemType operator[](ItemLocalIdType local_id) const
Entity of local ID local_id.
Definition Item.h:1924
constexpr __host__ __device__ Item operator[](ItemLocalId local_id) const
Entity of local ID local_id.
Definition Item.h:1905
Index of an Item in a variable.
Definition ItemLocalId.h:42
Internal shared structure of a mesh entity.
ConstArrayView< ItemInternal * > m_items_internal
ItemInternal of entities.
Type of an entity (Item).
Definition ItemTypeId.h:33
Info on a mesh entity type.
Unique identifier of an entity.
Typed entity vector.
Definition ItemVector.h:168
View on a typed array of entities.
Mesh element based on nodes (Edge,Face,Cell).
Definition Item.h:773
ItemWithNodes(const ItemInternalPtr *internals, Int32 local_id)
Constructs a reference to the entity internal.
Definition Item.h:821
NodeLocalId nodeId(Int32 index) const
i-th node of the entity.
Definition Item.h:849
constexpr ItemWithNodes(const Item &aitem)
Constructs a reference to the entity aitem.
Definition Item.h:814
Node node(Int32 i) const
i-th node of the entity
Definition Item.h:840
constexpr ItemWithNodes(Int32 local_id, ItemSharedInfo *shared_info)
Constructor reserved for enumerators.
Definition Item.h:790
Int32 nbLinearNode() const
Number of nodes of the associated linear entity (if entity order 2 or more).
Definition Item.h:852
NodeConnectedListViewType nodes() const
List of nodes of the entity.
Definition Item.h:843
ItemWithNodes(ItemInternal *ainternal)
(deprecated) Constructs a reference to the entity internal
Definition Item.h:800
ItemWithNodes()=default
Creation of an entity not connected to the mesh.
Int32 nbNode() const
Number of nodes of the entity.
Definition Item.h:837
constexpr ItemWithNodes(const ItemBase &abase)
Constructs a reference to the entity abase.
Definition Item.h:807
NodeLocalIdView nodeIds() const
List of nodes of the entity.
Definition Item.h:846
ItemWithNodes & operator=(ItemInternal *ainternal)
Copy operator.
Definition Item.h:828
Index of an Item in a variable.
Definition Item.h:120
Base class for a mesh element.
Definition Item.h:84
Int32 nbParent() const
Number of parents for submeshes.
Definition Item.h:297
constexpr bool isDoF() const
true if the entity is of the DoF kind
Definition Item.h:345
const ItemTypeInfo * typeInfo() const
Information about the entity type.
Definition Item.h:406
impl::MutableItemBase mutableItemBase() const
Mutable internal part of the entity.
Definition Item.h:394
Int32 _nbHParent() const
Number of parents for AMR.
Definition Item.h:461
static const Int32 NULL_ELEMENT
Null element index.
Definition Item.h:175
constexpr Int32 flags() const
Entity flags.
Definition Item.h:355
Item(ItemInternal *ainternal)
Constructs a reference to the internal entity.
Definition Item.h:196
ItemInternal * internal() const
Internal part of the entity.
Definition Item.h:368
constexpr Int32 localId() const
Local identifier of the entity in the processor subdomain.
Definition Item.h:233
Edge toEdge() const
Converts the entity to the Edge kind.
Definition Item.h:1816
Item(const ItemInternalPtr *internals, Int32 local_id)
Constructs a reference to the internal entity.
Definition Item.h:214
constexpr Integer _nbCell() const
Number of cells connected to the entity (for nodes, edges and faces).
Definition Item.h:459
Item()=default
Creation of a null mesh entity.
constexpr bool isFace() const
true if the entity is of the Face kind.
Definition Item.h:333
static String typeName(Int32 type)
Cell type name cell_type.
Definition Item.cc:54
Int32 owner() const
Owner subdomain number of the entity.
Definition Item.h:252
ItemSharedInfo * m_shared_info
Shared information among all entities with the same characteristics.
Definition Item.h:419
ItemLocalId LocalIdType
Type of localId().
Definition Item.h:109
constexpr bool isParticle() const
true if the entity is of the Particle kind.
Definition Item.h:339
ItemWithNodes toItemWithNodes() const
Converts the entity to the ItemWithNodes kind.
Definition Item.h:1802
DoF toDoF() const
Converts the entity to the DoF kind.
Definition Item.h:1844
Cell toCell() const
Converts the entity to the Cell kind.
Definition Item.h:1830
@ Tri3
Triangle type element (3 vertices, 2D).
Definition Item.h:161
@ Quad4
Quad type element (4 vertices, 2D).
Definition Item.h:162
@ Pentagon5
Pentagon type element (5 vertices, 2D).
Definition Item.h:163
@ Unknown
Null type element.
Definition Item.h:158
@ Pyramid
Pyramid type element (5 vertices, 3D).
Definition Item.h:166
@ Bar2
Edge type element (2 vertices, 1D, 2D and 3D).
Definition Item.h:160
@ Vertex
Node type element (1 vertex 1D, 2D and 3D).
Definition Item.h:159
@ Hexa
Hexahedron type element (8 vertices, 3D).
Definition Item.h:168
@ Hexagon6
Hexagon type element (6 vertices, 2D).
Definition Item.h:164
@ Penta
Pentahedron type element (6 vertices, 3D).
Definition Item.h:167
@ Wedge8
Prism type element with 8 faces (hexagonal base).
Definition Item.h:170
@ Wedge7
Prism type element with 7 faces (pentagonal base).
Definition Item.h:169
@ Tetra
Tetrahedron type element (4 vertices, 3D).
Definition Item.h:165
constexpr Integer _nbFace() const
Number of faces of the entity or number of faces connected to the entity (for nodes and edges).
Definition Item.h:457
IItemFamily * itemFamily() const
Family from which the entity originates.
Definition Item.h:261
constexpr Integer _nbEdge() const
Number of edges of the entity or number of edges connected to the entity (for nodes).
Definition Item.h:455
Particle toParticle() const
Converts the entity to the Particle kind.
Definition Item.h:1837
constexpr bool hasFlags(Int32 flags) const
Returns if the flags are set for the entity.
Definition Item.h:352
constexpr __host__ __device__ Item(const ItemBase &abase)
Constructs a reference to the abase entity.
Definition Item.h:207
constexpr bool isNode() const
true if the entity is of the Node kind.
Definition Item.h:315
ItemUniqueId uniqueId() const
Unique identifier across all domains.
Definition Item.h:239
constexpr __host__ __device__ Item(Int32 local_id, ItemSharedInfo *shared_info)
Constructor reserved for enumerators.
Definition Item.h:184
constexpr bool null() const
true if the entity is null (i.e. not connected to the mesh)
Definition Item.h:230
constexpr bool isItemWithNodes() const
true if the entity is of the ItemWithNodes kind.
Definition Item.h:308
constexpr Integer _nbNode() const
Number of nodes of the entity.
Definition Item.h:453
constexpr ItemLocalId itemLocalId() const
Local identifier of the entity in the processor subdomain.
Definition Item.h:236
Face toFace() const
Converts the entity to the Face kind.
Definition Item.h:1823
constexpr bool isOwn() const
true if the entity belongs to the subdomain
Definition Item.h:267
Integer _nbParent() const
Number of parents for submeshes.
Definition Item.h:465
constexpr bool isCell() const
true if the entity is of the Cell kind.
Definition Item.h:321
Item parent(Int32 i) const
i-th parent for submeshes
Definition Item.h:300
ItemTypeId itemTypeId() const
Entity type.
Definition Item.h:258
Item parent() const
first parent for submeshes
Definition Item.h:303
Int32 m_local_id
Local number (in the subdomain) of the entity.
Definition Item.h:429
constexpr bool isEdge() const
true if the entity is of the Edge kind.
Definition Item.h:327
impl::ItemBase itemBase() const
Internal part of the entity.
Definition Item.h:383
bool isShared() const
True if the entity is shared by other subdomains.
Definition Item.h:279
constexpr eItemKind kind() const
Entity kind.
Definition Item.h:264
Int32 _nbHChildren() const
Number of children for AMR.
Definition Item.h:463
constexpr Int32 _flags() const
Entity flags.
Definition Item.h:451
Int16 type() const
Entity type.
Definition Item.h:255
Int32 _nbLinearNode() const
Number of nodes of the entity.
Definition Item.h:491
Item & operator=(ItemInternal *ainternal)
Copy operator.
Definition Item.h:221
Node toNode() const
Converts the entity to the Node kind.
Definition Item.h:1809
Node of a mesh.
Definition Item.h:598
constexpr NodeLocalId itemLocalId() const
Local identifier of the entity in the processor subdomain.
Definition Item.h:692
Cell cell(Int32 i) const
i-th cell of the node
Definition Item.h:1744
constexpr eItemKind kind() const
Kind of the entity.
Definition Item.h:689
FaceLocalIdView faceIds() const
List of faces of the node.
Definition Item.h:734
Node(const ItemInternalPtr *internals, Int32 local_id)
Constructs a reference to the entity internal.
Definition Item.h:673
CellConnectedListViewType cells() const
List of cells of the node.
Definition Item.h:728
CellVectorView _internalActiveCells(Int32Array &local_ids) const
Enumerates the cells connected to the node.
Definition Item.h:742
constexpr Int32 nbFace() const
Number of faces connected to the node.
Definition Item.h:698
Node(ItemInternal *ainternal)
(deprecated) Constructs a reference to the entity internal
Definition Item.h:652
EdgeLocalIdView edgeIds() const
List of edges of the node.
Definition Item.h:731
FaceLocalId faceId(Int32 i) const
i-th face of the node
Definition Item.h:716
constexpr Int32 nbEdge() const
Number of edges connected to the node.
Definition Item.h:695
FaceConnectedListViewType faces() const
List of faces of the node.
Definition Item.h:725
constexpr Node(Int32 local_id, ItemSharedInfo *shared_info)
Constructor reserved for enumerators.
Definition Item.h:639
Node & operator=(ItemInternal *ainternal)
Copy operator.
Definition Item.h:680
Face face(Int32 i) const
i-th face of the node
Definition Item.h:1738
constexpr Node(const Item &aitem)
Constructs a reference to the entity abase.
Definition Item.h:666
CellLocalIdView cellIds() const
List of cells of the node.
Definition Item.h:737
constexpr Node(const ItemBase &abase)
Constructs a reference to the entity abase.
Definition Item.h:659
Edge edge(Int32 i) const
i-th edge of the node
Definition Item.h:1732
Int32 nbCell() const
Number of cells connected to the node.
Definition Item.h:701
EdgeConnectedListViewType edges() const
List of edges of the node.
Definition Item.h:722
CellLocalId cellId(Int32 i) const
i-th cell of the node
Definition Item.h:719
EdgeLocalId edgeId(Int32 i) const
i-th edge of the node
Definition Item.h:713
NodeLocalId LocalIdType
Type of localId().
Definition Item.h:646
Particle.
Definition Item.h:1529
Particle()=default
Constructor for a null particle.
bool hasCell() const
True if the particle is in a mesh cell.
Definition Item.h:1612
Particle(Int32 local_id, ItemSharedInfo *shared_info)
Constructor reserved for enumerators.
Definition Item.h:1546
ParticleLocalId itemLocalId() const
Local identifier of the entity in the processor subdomain.
Definition Item.h:1599
constexpr eItemKind kind() const
Entity kind.
Definition Item.h:1596
Cell cell() const
Cell to which the particle belongs. You must call setCell() before calling this function....
Definition Item.h:1606
CellLocalId cellId() const
Cell connected to the particle.
Definition Item.h:1609
Particle(const ItemInternalPtr *internals, Int32 local_id)
Constructs a reference to the internal entity.
Definition Item.h:1580
constexpr Particle(const ItemBase &abase)
Constructs a reference to the abase entity.
Definition Item.h:1566
Cell cellOrNull() const
Cell to which the particle belongs or null cell. Returns cell() if the particle is in a cell or the n...
Definition Item.h:1619
Particle & operator=(ItemInternal *ainternal)
Copy operator.
Definition Item.h:1587
ParticleLocalId LocalIdType
Type of localId().
Definition Item.h:1553
constexpr Particle(const Item &aitem)
Constructs a reference to the aitem entity.
Definition Item.h:1573
Particle(ItemInternal *ainternal)
(deprecated) Constructs a reference to the internal entity
Definition Item.h:1559
Manages a vector of ItemType entities.
Definition SimdItem.h:272
ItemLocalIdListViewT< Node > NodeLocalIdView
View over the localId() of a list of nodes.
Definition ItemTypes.h:407
ItemVectorViewT< Cell > CellVectorView
View over a vector of cells.
Definition ItemTypes.h:305
ItemLocalIdListViewT< Edge > EdgeLocalIdView
View over the localId() of a list of edges.
Definition ItemTypes.h:417
ItemLocalIdListViewT< Face > FaceLocalIdView
View on the localIds() of a list of faces.
Definition ItemTypes.h:427
ItemLocalIdListViewT< Cell > CellLocalIdView
View on the localIds() of a list of cells.
Definition ItemTypes.h:437
-- tab-width: 2; indent-tabs-mode: nil; coding: utf-8-with-signature --
NodeConnectedListView NodeConnectedListViewType
List of connected nodes.
Definition ItemTypes.h:350
Int32 Integer
Type representing an integer.
CellConnectedListView CellConnectedListViewType
List of connected cells.
Definition ItemTypes.h:356
bool operator<(const Item &item1, const Item &item2)
Compare two entities.
Definition Item.h:566
eItemKind
Mesh entity type.
@ IK_Particle
Particle mesh entity.
@ IK_Node
Node mesh entity.
@ IK_Cell
Cell mesh entity.
@ IK_Unknown
Unknown or uninitialized mesh entity.
@ IK_Face
Face mesh entity.
@ IK_DoF
Degree of Freedom mesh entity.
@ IK_Edge
Edge mesh entity.
std::int16_t Int16
Signed integer type of 16 bits.
Array< Int32 > Int32Array
Dynamic one-dimensional array of 32-bit integers.
Definition UtilsTypes.h:127
EdgeConnectedListView EdgeConnectedListViewType
List of connected edges.
Definition ItemTypes.h:352
FaceConnectedListView FaceConnectedListViewType
List of connected faces.
Definition ItemTypes.h:354
@ Cell
The mesh is AMR by cell.
Definition MeshKind.h:53
std::int32_t Int32
Signed integer type of 32 bits.