12#ifndef ARCANE_CORE_ITEM_H
13#define ARCANE_CORE_ITEM_H
18#include "arcane/core/ItemInternal.h"
19#include "arcane/core/ItemLocalId.h"
35#define ARCANE_CHECK_KIND(type) _checkKind(type())
37#define ARCANE_CHECK_KIND(type)
41#define ARCANE_WANT_ITEM_STAT
44#ifdef ARCANE_WANT_ITEM_STAT
45#define ARCANE_ITEM_ADD_STAT(var) ++var
47#define ARCANE_ITEM_ADD_STAT(var)
83class ARCANE_CORE_EXPORT
Item
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;
102 friend class ItemCompatibility;
111 using ItemBase = impl::ItemBase;
128 : m_local_id(NULL_ITEM_LOCAL_ID)
130 explicit Index(
Int32 id)
140 Int32 localId()
const {
return m_local_id; }
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
178 ARCCORE_DEPRECATED_2021(
"Use ItemTypeMng::typeName() instead")
198 ARCANE_CHECK_PTR(ainternal);
201 ARCANE_ITEM_ADD_STAT(m_nb_created_from_internal);
207 constexpr ARCCORE_HOST_DEVICE
Item(
const ItemBase& abase)
217 ARCANE_ITEM_ADD_STAT(m_nb_created_from_internalptr);
284 inline Node toNode()
const;
286 inline Cell toCell()
const;
288 inline Edge toEdge()
const;
290 inline Face toFace()
const;
294 inline DoF toDoF()
const;
367 ARCANE_DEPRECATED_REASON(
"Y2024: This method is internal to Arcane. use itemBase() or mutableItemBase() instead")
372 return ItemInternal::nullItem();
410 ARCANE_DEPRECATED_REASON(
"Y2022: Do not use this operator. Use operator '.' instead")
411 Item* operator->() {
return this; }
413 ARCANE_DEPRECATED_REASON(
"Y2022: Do not use this operator. Use operator '.' instead")
414 const Item* operator->()
const {
return this; }
433 constexpr void _checkKind(
bool is_valid)
const
438 [[noreturn]]
void _badConversion()
const;
441 _setFromInternal(ainternal);
443 constexpr void _set(
const Item& rhs)
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); }
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;
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); }
497 return m_shared_info->m_connectivity;
499 void _setFromInternal(ItemBase* rhs)
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;
505 constexpr void _setFromItem(
const Item& rhs)
507 m_local_id = rhs.m_local_id;
508 m_shared_info = rhs.m_shared_info;
513 static void dumpStats(ITraceMng* tm);
514 static void resetStats();
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;
524 ItemInternal* _internal()
const
526 if (m_local_id != NULL_ITEM_LOCAL_ID)
528 return ItemInternal::nullItem();
579#include "arcane/core/ItemVectorView.h"
580#include "arcane/core/ItemConnectedListView.h"
599 using ThatClass =
Node;
601 friend class ItemEnumeratorBaseT<ThatClass>;
610 friend class ItemLocalIdToItemConverterT<ThatClass>;
618 class ARCANE_DEPRECATED_REASON(
"Y2024: Use NodeLocalId instead") Index
627 explicit Index(
Int32 id)
633 operator NodeLocalId()
const {
return NodeLocalId{ localId() }; }
640 :
Item(local_id, shared_info)
655 ARCANE_CHECK_KIND(
isNode);
659 constexpr Node(
const ItemBase& abase)
662 ARCANE_CHECK_KIND(
isNode);
669 ARCANE_CHECK_KIND(
isNode);
674 :
Item(internals, local_id)
676 ARCANE_CHECK_KIND(
isNode);
744 return _toItemBase()._internalActiveCells2(local_ids);
747 ARCANE_DEPRECATED_REASON(
"Y2022: Do not use this operator. Use operator '.' instead")
748 Node* operator->() {
return this; }
750 ARCANE_DEPRECATED_REASON(
"Y2022: Do not use this operator. Use operator '.' instead")
751 const Node* operator->()
const {
return this; }
757constexpr inline Node Item::
758_node(
Int32 index)
const
760 return Node(_connectivity()->nodeBase(
m_local_id, index));
776 friend class ItemEnumeratorBaseT<ThatClass>;
785 friend class ItemLocalIdToItemConverterT<ThatClass>;
791 :
Item(local_id, shared_info)
822 :
Item(internals, local_id)
856 ARCANE_DEPRECATED_REASON(
"Y2022: Do not use this operator. Use operator '.' instead")
859 ARCANE_DEPRECATED_REASON(
"Y2022: Do not use this operator. Use operator '.' instead")
860 const ItemWithNodes* operator->()
const {
return this; }
876 using ThatClass =
Edge;
895 class ARCANE_DEPRECATED_REASON(
"Y2024: Use EdgeLocalId instead") Index
904 explicit Index(
Int32 id)
910 operator EdgeLocalId()
const {
return EdgeLocalId{ localId() }; }
932 ARCANE_CHECK_KIND(
isEdge);
939 ARCANE_CHECK_KIND(
isEdge);
946 ARCANE_CHECK_KIND(
isEdge);
953 ARCANE_CHECK_KIND(
isEdge);
1004 ARCANE_DEPRECATED_REASON(
"Y2022: Do not use this operator. Use operator '.' instead")
1005 Edge* operator->() {
return this; }
1007 ARCANE_DEPRECATED_REASON(
"Y2022: Do not use this operator. Use operator '.' instead")
1008 const Edge* operator->()
const {
return this; }
1014constexpr inline Edge Item::
1015_edge(
Int32 index)
const
1017 return Edge(_connectivity()->edgeBase(
m_local_id, index));
1033 using ThatClass =
Face;
1052 class ARCANE_DEPRECATED_REASON(
"Y2024: Use FaceLocalId instead") Index
1061 explicit Index(
Int32 id)
1067 operator FaceLocalId()
const {
return FaceLocalId{ localId() }; }
1089 ARCANE_CHECK_KIND(
isFace);
1096 ARCANE_CHECK_KIND(
isFace);
1103 ARCANE_CHECK_KIND(
isFace);
1110 ARCANE_CHECK_KIND(
isFace);
1173 inline Cell boundaryCell()
const;
1176 inline Cell backCell()
const;
1182 inline Cell frontCell()
const;
1192 inline Cell oppositeCell(
Cell cell)
const;
1201 ARCANE_ASSERT((
backCellId() == cell_id ||
frontCellId() == cell_id), (
"cell is not connected to the face"));
1254 ARCANE_DEPRECATED_REASON(
"Y2022: Do not use this operator. Use operator '.' instead")
1255 Face* operator->() {
return this; }
1257 ARCANE_DEPRECATED_REASON(
"Y2022: Do not use this operator. Use operator '.' instead")
1258 const Face* operator->()
const {
return this; }
1264constexpr inline Face Item::
1265_face(
Int32 index)
const
1267 return Face(_connectivity()->faceBase(
m_local_id, index));
1301 using ThatClass =
Cell;
1320 class ARCANE_DEPRECATED_REASON(
"Y2024: Use CellLocalId instead") Index
1329 explicit Index(
Int32 id)
1335 operator CellLocalId()
const {
return CellLocalId{ localId() }; }
1357 ARCANE_CHECK_KIND(
isCell);
1364 ARCANE_CHECK_KIND(
isCell);
1371 ARCANE_CHECK_KIND(
isCell);
1378 ARCANE_CHECK_KIND(
isCell);
1451 bool isActive()
const {
return _toItemBase().isActive(); }
1453 bool isSubactive()
const {
return _toItemBase().isSubactive(); }
1481 return (this->_hParentBase(0).
level() + 1);
1491 return _toItemBase().whichChildAmI(iitem->
localId());
1501 return _toItemBase().whichChildAmI(local_id);
1504 ARCANE_DEPRECATED_REASON(
"Y2022: Do not use this operator. Use operator '.' instead")
1505 Cell* operator->() {
return this; }
1507 ARCANE_DEPRECATED_REASON(
"Y2022: Do not use this operator. Use operator '.' instead")
1508 const Cell* operator->()
const {
return this; }
1514constexpr inline Cell Item::
1515_cell(
Int32 index)
const
1532 friend class ItemEnumeratorBaseT<ThatClass>;
1541 friend class ItemLocalIdToItemConverterT<ThatClass>;
1547 :
Item(local_id, shared_info)
1581 :
Item(internals, local_id)
1609 CellLocalId
cellId()
const {
return _cellId(0); }
1621 Int32 cell_local_id = _cellId(0).localId();
1622 if (cell_local_id == NULL_ITEM_LOCAL_ID)
1627 ARCANE_DEPRECATED_REASON(
"Y2022: Do not use this operator. Use operator '.' instead")
1628 Particle* operator->() {
return this; }
1630 ARCANE_DEPRECATED_REASON(
"Y2022: Do not use this operator. Use operator '.' instead")
1631 const
Particle* operator->()
const {
return this; }
1650 using ThatClass =
DoF;
1652 friend class ItemEnumeratorBaseT<ThatClass>;
1661 friend class ItemLocalIdToItemConverterT<ThatClass>;
1667 :
Item(local_id, shared_info)
1681 ARCANE_CHECK_KIND(
isDoF);
1685 constexpr DoF(
const ItemBase& abase)
1688 ARCANE_CHECK_KIND(
isDoF);
1695 ARCANE_CHECK_KIND(
isDoF);
1700 :
Item(internals, local_id)
1702 ARCANE_CHECK_KIND(
isDoF);
1712 ARCANE_DEPRECATED_REASON(
"Y2022: Do not use this operator. Use operator '.' instead")
1713 DoF* operator->() {
return this; }
1715 ARCANE_DEPRECATED_REASON(
"Y2022: Do not use this operator. Use operator '.' instead")
1716 const
DoF* operator->()
const {
return this; }
1811 ARCANE_CHECK_KIND(
isNode);
1818 ARCANE_CHECK_KIND(
isEdge);
1825 ARCANE_CHECK_KIND(
isFace);
1832 ARCANE_CHECK_KIND(
isCell);
1846 ARCANE_CHECK_KIND(
isDoF);
1854ItemLocalId(
Item item)
1855: m_local_id(item.localId())
1859template <
typename ItemType>
inline ItemLocalIdT<ItemType>::
1860ItemLocalIdT(ItemType item)
1861: ItemLocalId(item.localId())
1871 return Item(local_id.localId(), m_item_shared_info);
1880 return Item(local_id, m_item_shared_info);
1889 return ItemType(local_id.localId(), m_item_shared_info);
1898 return ItemType(local_id, m_item_shared_info);
1907 return Item(local_id.localId(), m_item_shared_info);
1916 return Item(local_id, m_item_shared_info);
1922template <
typename ItemType_>
inline constexpr ARCCORE_HOST_DEVICE ItemType_
1926 return ItemType(local_id.localId(), m_item_shared_info);
1932template <
typename ItemType_>
inline constexpr ARCCORE_HOST_DEVICE ItemType_
1936 return ItemType(local_id, m_item_shared_info);
1947#include "arcane/core/ItemCompatibility.h"
Declarations of types on entities.
Cell topHParent() const
level 0 parent for AMR
Int32 nbEdge() const
Number of edges of the cell.
constexpr Cell(const ItemBase &abase)
Constructs a reference to the base entity.
FaceConnectedListViewType faces() const
List of faces of the cell.
Int32 nbHChildren() const
Number of children for AMR.
Cell(Int32 local_id, ItemSharedInfo *shared_info)
Constructor reserved for enumerators.
Face face(Int32 i) const
i-th face of the cell
FaceLocalIdView faceIds() const
List of faces of the cell.
Cell(ItemInternal *ainternal)
(deprecated) Constructs a reference to the internal entity
Int32 nbFace() const
Number of faces of the cell.
Cell & operator=(ItemInternal *ainternal)
Copy operator.
Cell(const ItemInternalPtr *internals, Int32 local_id)
Constructs a reference to the internal entity.
CellLocalId itemLocalId() const
Local identifier of the entity in the processor subdomain.
EdgeLocalIdView edgeIds() const
List of edges of the cell.
EdgeLocalId edgeId(Int32 i) const
i-th edge of the cell
Int32 whichChildAmI(const ItemInternal *iitem) const
constexpr Cell(const Item &aitem)
Constructs a reference to the item entity.
Cell hChild(Int32 i) const
i-th AMR child
bool hasHChildren() const
Edge edge(Int32 i) const
i-th edge of the cell
Cell()=default
Constructor of a null cell.
Int32 whichChildAmI(CellLocalId local_id) const
FaceLocalId faceId(Int32 i) const
i-th face of the cell
EdgeConnectedListViewType edges() const
List of edges of the cell.
Int32 nbHParent() const
Number of parents for AMR.
constexpr eItemKind kind() const
Entity kind.
CellLocalId LocalIdType
Type of localId().
constexpr DoF(Int32 local_id, ItemSharedInfo *shared_info)
Constructor reserved for enumerators.
DoF(const ItemInternalPtr *internals, Int32 local_id)
Constructs a reference to the internal entity.
DoF()=default
Constructor for a non-connected cell.
DoFLocalId itemLocalId() const
Local identifier of the entity in the processor subdomain.
constexpr DoF(const Item &aitem)
Constructs a reference to the abase entity.
DoF & operator=(ItemInternal *ainternal)
Copy operator.
DoF(ItemInternal *ainternal)
(deprecated) Constructs a reference to the internal entity
constexpr DoF(const ItemBase &abase)
Constructs a reference to the abase entity.
constexpr eItemKind kind() const
Entity kind.
FaceConnectedListViewType faces() const
List of faces of the edge.
constexpr eItemKind kind() const
Kind of the entity.
CellConnectedListViewType cells() const
List of edge cells.
Cell cell(Int32 i) const
i-th cell of the edge
Face face(Int32 i) const
i-th face of the edge
Edge(const ItemInternalPtr *internals, Int32 local_id)
Constructs a reference to the entity internal.
constexpr Edge(const Item &aitem)
Constructs a reference to the entity aitem.
FaceLocalIdView faceIds() const
List of faces of the edge.
Edge & operator=(ItemInternal *ainternal)
Copy operator.
Int32 nbFace() const
Number of faces connected to the edge.
CellLocalIdView cellIds() const
List of edge cells.
constexpr Edge(const ItemBase &abase)
Constructs a reference to the entity abase.
Edge()=default
Creates a null edge.
FaceLocalId faceId(Int32 i) const
i-th face of the edge
Edge(ItemInternal *ainternal)
(deprecated) Constructs a reference to the entity internal
EdgeLocalId LocalIdType
Type of localId().
Edge(Int32 local_id, ItemSharedInfo *shared_info)
Constructor reserved for enumerators.
Int32 nbNode() const
Number of vertices of the edge.
CellLocalId cellId(Int32 i) const
i-th edge cell
Int32 nbCell() const
Number of cells connected to the edge.
EdgeLocalId itemLocalId() const
Local identifier of the entity in the processor subdomain.
Face()=default
Creation of a face not connected to the mesh.
bool isMasterFace() const
true if it is the master face of an interface
constexpr eItemKind kind() const
Entity kind.
FaceLocalId LocalIdType
Type of localId().
CellLocalId frontCellId() const
Cell in front of the face (null cell if none).
Cell frontCell() const
Cell in front of the face (null cell if none).
CellLocalId cellId(Int32 i) const
i-th cell of the face
EdgeLocalIdView edgeIds() const
List of edges of the face.
Cell cell(Int32 i) const
i-th cell of the face
Int32 nbCell() const
Number of cells of the face (1 or 2).
ARCANE_DEPRECATED_118 bool isBoundary() const
FaceConnectedListViewType slaveFaces() const
List of slave faces associated with this master face.
constexpr Face(const Item &aitem)
Constructs a reference to the item entity.
ARCANE_DEPRECATED_118 bool isBoundaryOutside() const
Indicates if the face is on the subdomain boundary facing outwards.
EdgeConnectedListViewType edges() const
List of edges of the face.
bool isSubDomainBoundary() const
Indicates if the face is on the subdomain boundary (i.e nbCell()==1).
FaceLocalId itemLocalId() const
Local identifier of the entity in the processor subdomain.
EdgeLocalId edgeId(Int32 i) const
i-th edge of the face
CellConnectedListViewType cells() const
List of cells of the face.
Face masterFace() const
Master face associated with this face.
bool isSlaveFace() const
true if it is a slave face of an interface
Edge edge(Int32 i) const
i-th edge of the face
constexpr Face(const ItemBase &abase)
Constructs a reference to the base entity.
CellLocalId backCellId() const
Cell behind the face (null cell if none).
Face(const ItemInternalPtr *internals, Int32 local_id)
Constructs a reference to the internal entity.
bool isSubDomainBoundaryOutside() const
Indicates if the face is on the subdomain boundary facing outwards.
Face(ItemInternal *ainternal)
(deprecated) Constructs a reference to the internal entity
Cell boundaryCell() const
Cell associated with this boundary face (null cell if none).
Int32 nbEdge() const
Number of edges of the face.
bool isTiedFace() const
true if it is a slave or master face of an interface
CellLocalIdView cellIds() const
List of cells of the face.
Face & operator=(ItemInternal *ainternal)
Copy operator.
Cell backCell() const
Cell behind the face (null cell if none).
constexpr Face(Int32 local_id, ItemSharedInfo *shared_info)
Constructor reserved for enumerators.
Cell oppositeCell(Cell cell) const
Opposite cell of this face to the cell cell.
CellLocalId oppositeCellId(CellLocalId cell_id) const
Opposite cell of this face to the cell cell.
Interface of an entity family.
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.
@ II_Shared
The entity is shared by another subdomain.
@ II_HasBackCell
The entity has a back cell.
@ II_Own
The entity is a domain-specific entity.
@ II_Boundary
The entity is on the boundary.
Base class for specialized views of entity information.
ItemType operator[](ItemLocalId local_id) const
Entity associated with local ID local_id.
Item operator[](ItemLocalId local_id) const
Entity associated with local ID local_id.
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.
constexpr __host__ __device__ Item operator[](ItemLocalId local_id) const
Entity of local ID local_id.
Index of an Item in a variable.
Internal shared structure of a mesh entity.
ConstArrayView< ItemInternal * > m_items_internal
ItemInternal of entities.
Type of an entity (Item).
Info on a mesh entity type.
Unique identifier of an entity.
View on a typed array of entities.
Mesh element based on nodes (Edge,Face,Cell).
ItemWithNodes(const ItemInternalPtr *internals, Int32 local_id)
Constructs a reference to the entity internal.
NodeLocalId nodeId(Int32 index) const
i-th node of the entity.
constexpr ItemWithNodes(const Item &aitem)
Constructs a reference to the entity aitem.
Node node(Int32 i) const
i-th node of the entity
constexpr ItemWithNodes(Int32 local_id, ItemSharedInfo *shared_info)
Constructor reserved for enumerators.
Int32 nbLinearNode() const
Number of nodes of the associated linear entity (if entity order 2 or more).
NodeConnectedListViewType nodes() const
List of nodes of the entity.
ItemWithNodes(ItemInternal *ainternal)
(deprecated) Constructs a reference to the entity internal
ItemWithNodes()=default
Creation of an entity not connected to the mesh.
Int32 nbNode() const
Number of nodes of the entity.
constexpr ItemWithNodes(const ItemBase &abase)
Constructs a reference to the entity abase.
NodeLocalIdView nodeIds() const
List of nodes of the entity.
ItemWithNodes & operator=(ItemInternal *ainternal)
Copy operator.
Index of an Item in a variable.
Base class for a mesh element.
Int32 nbParent() const
Number of parents for submeshes.
constexpr bool isDoF() const
true if the entity is of the DoF kind
const ItemTypeInfo * typeInfo() const
Information about the entity type.
impl::MutableItemBase mutableItemBase() const
Mutable internal part of the entity.
Int32 _nbHParent() const
Number of parents for AMR.
static const Int32 NULL_ELEMENT
Null element index.
constexpr Int32 flags() const
Entity flags.
Item(ItemInternal *ainternal)
Constructs a reference to the internal entity.
ItemInternal * internal() const
Internal part of the entity.
constexpr Int32 localId() const
Local identifier of the entity in the processor subdomain.
Edge toEdge() const
Converts the entity to the Edge kind.
Item(const ItemInternalPtr *internals, Int32 local_id)
Constructs a reference to the internal entity.
constexpr Integer _nbCell() const
Number of cells connected to the entity (for nodes, edges and faces).
Item()=default
Creation of a null mesh entity.
constexpr bool isFace() const
true if the entity is of the Face kind.
static String typeName(Int32 type)
Cell type name cell_type.
Int32 owner() const
Owner subdomain number of the entity.
ItemSharedInfo * m_shared_info
Shared information among all entities with the same characteristics.
ItemLocalId LocalIdType
Type of localId().
constexpr bool isParticle() const
true if the entity is of the Particle kind.
ItemWithNodes toItemWithNodes() const
Converts the entity to the ItemWithNodes kind.
DoF toDoF() const
Converts the entity to the DoF kind.
Cell toCell() const
Converts the entity to the Cell kind.
@ Tri3
Triangle type element (3 vertices, 2D).
@ Quad4
Quad type element (4 vertices, 2D).
@ Pentagon5
Pentagon type element (5 vertices, 2D).
@ Unknown
Null type element.
@ Pyramid
Pyramid type element (5 vertices, 3D).
@ Bar2
Edge type element (2 vertices, 1D, 2D and 3D).
@ Vertex
Node type element (1 vertex 1D, 2D and 3D).
@ Hexa
Hexahedron type element (8 vertices, 3D).
@ Hexagon6
Hexagon type element (6 vertices, 2D).
@ Penta
Pentahedron type element (6 vertices, 3D).
@ Wedge8
Prism type element with 8 faces (hexagonal base).
@ Wedge7
Prism type element with 7 faces (pentagonal base).
@ Tetra
Tetrahedron type element (4 vertices, 3D).
constexpr Integer _nbFace() const
Number of faces of the entity or number of faces connected to the entity (for nodes and edges).
IItemFamily * itemFamily() const
Family from which the entity originates.
constexpr Integer _nbEdge() const
Number of edges of the entity or number of edges connected to the entity (for nodes).
Particle toParticle() const
Converts the entity to the Particle kind.
constexpr bool hasFlags(Int32 flags) const
Returns if the flags are set for the entity.
constexpr __host__ __device__ Item(const ItemBase &abase)
Constructs a reference to the abase entity.
constexpr bool isNode() const
true if the entity is of the Node kind.
ItemUniqueId uniqueId() const
Unique identifier across all domains.
constexpr __host__ __device__ Item(Int32 local_id, ItemSharedInfo *shared_info)
Constructor reserved for enumerators.
constexpr bool null() const
true if the entity is null (i.e. not connected to the mesh)
constexpr bool isItemWithNodes() const
true if the entity is of the ItemWithNodes kind.
constexpr Integer _nbNode() const
Number of nodes of the entity.
constexpr ItemLocalId itemLocalId() const
Local identifier of the entity in the processor subdomain.
Face toFace() const
Converts the entity to the Face kind.
constexpr bool isOwn() const
true if the entity belongs to the subdomain
Integer _nbParent() const
Number of parents for submeshes.
constexpr bool isCell() const
true if the entity is of the Cell kind.
Item parent(Int32 i) const
i-th parent for submeshes
ItemTypeId itemTypeId() const
Entity type.
Item parent() const
first parent for submeshes
Int32 m_local_id
Local number (in the subdomain) of the entity.
constexpr bool isEdge() const
true if the entity is of the Edge kind.
impl::ItemBase itemBase() const
Internal part of the entity.
bool isShared() const
True if the entity is shared by other subdomains.
constexpr eItemKind kind() const
Entity kind.
Int32 _nbHChildren() const
Number of children for AMR.
constexpr Int32 _flags() const
Entity flags.
Int16 type() const
Entity type.
Int32 _nbLinearNode() const
Number of nodes of the entity.
Item & operator=(ItemInternal *ainternal)
Copy operator.
Node toNode() const
Converts the entity to the Node kind.
constexpr NodeLocalId itemLocalId() const
Local identifier of the entity in the processor subdomain.
Cell cell(Int32 i) const
i-th cell of the node
constexpr eItemKind kind() const
Kind of the entity.
FaceLocalIdView faceIds() const
List of faces of the node.
Node(const ItemInternalPtr *internals, Int32 local_id)
Constructs a reference to the entity internal.
CellConnectedListViewType cells() const
List of cells of the node.
CellVectorView _internalActiveCells(Int32Array &local_ids) const
Enumerates the cells connected to the node.
constexpr Int32 nbFace() const
Number of faces connected to the node.
Node(ItemInternal *ainternal)
(deprecated) Constructs a reference to the entity internal
EdgeLocalIdView edgeIds() const
List of edges of the node.
FaceLocalId faceId(Int32 i) const
i-th face of the node
constexpr Int32 nbEdge() const
Number of edges connected to the node.
FaceConnectedListViewType faces() const
List of faces of the node.
constexpr Node(Int32 local_id, ItemSharedInfo *shared_info)
Constructor reserved for enumerators.
Node & operator=(ItemInternal *ainternal)
Copy operator.
Face face(Int32 i) const
i-th face of the node
constexpr Node(const Item &aitem)
Constructs a reference to the entity abase.
CellLocalIdView cellIds() const
List of cells of the node.
constexpr Node(const ItemBase &abase)
Constructs a reference to the entity abase.
Edge edge(Int32 i) const
i-th edge of the node
Int32 nbCell() const
Number of cells connected to the node.
EdgeConnectedListViewType edges() const
List of edges of the node.
CellLocalId cellId(Int32 i) const
i-th cell of the node
EdgeLocalId edgeId(Int32 i) const
i-th edge of the node
NodeLocalId LocalIdType
Type of localId().
Particle()=default
Constructor for a null particle.
bool hasCell() const
True if the particle is in a mesh cell.
Particle(Int32 local_id, ItemSharedInfo *shared_info)
Constructor reserved for enumerators.
ParticleLocalId itemLocalId() const
Local identifier of the entity in the processor subdomain.
constexpr eItemKind kind() const
Entity kind.
Cell cell() const
Cell to which the particle belongs. You must call setCell() before calling this function....
CellLocalId cellId() const
Cell connected to the particle.
Particle(const ItemInternalPtr *internals, Int32 local_id)
Constructs a reference to the internal entity.
constexpr Particle(const ItemBase &abase)
Constructs a reference to the abase entity.
Cell cellOrNull() const
Cell to which the particle belongs or null cell. Returns cell() if the particle is in a cell or the n...
Particle & operator=(ItemInternal *ainternal)
Copy operator.
ParticleLocalId LocalIdType
Type of localId().
constexpr Particle(const Item &aitem)
Constructs a reference to the aitem entity.
Particle(ItemInternal *ainternal)
(deprecated) Constructs a reference to the internal entity
Manages a vector of ItemType entities.
Unicode character string.
ItemLocalIdListViewT< Node > NodeLocalIdView
View over the localId() of a list of nodes.
ItemVectorViewT< Cell > CellVectorView
View over a vector of cells.
ItemLocalIdListViewT< Edge > EdgeLocalIdView
View over the localId() of a list of edges.
ItemLocalIdListViewT< Face > FaceLocalIdView
View on the localIds() of a list of faces.
ItemLocalIdListViewT< Cell > CellLocalIdView
View on the localIds() of a list of cells.
-- tab-width: 2; indent-tabs-mode: nil; coding: utf-8-with-signature --
NodeConnectedListView NodeConnectedListViewType
List of connected nodes.
Int32 Integer
Type representing an integer.
CellConnectedListView CellConnectedListViewType
List of connected cells.
bool operator<(const Item &item1, const Item &item2)
Compare two entities.
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.
EdgeConnectedListView EdgeConnectedListViewType
List of connected edges.
FaceConnectedListView FaceConnectedListViewType
List of connected faces.
@ Cell
The mesh is AMR by cell.
std::int32_t Int32
Signed integer type of 32 bits.