12#ifndef ARCANE_CORE_ITEMCONNECTIVITYCONTAINERVIEW_H
13#define ARCANE_CORE_ITEMCONNECTIVITYCONTAINERVIEW_H
20#include "arcane/core/ItemLocalId.h"
43class ARCANE_CORE_EXPORT ItemConnectivityContainerView
47 friend ItemInternalConnectivityList;
48 friend IndexedItemConnectivityViewBase;
49 friend IndexedItemConnectivityViewBase2;
51 template <
typename ItemType1,
typename ItemType2>
52 friend class IndexedItemConnectivityGenericViewT;
56 ItemConnectivityContainerView() =
default;
60 : m_list_data(_list.
data())
61 , m_indexes(_indexes.
data())
62 , m_nb_connected_items(_nb_connected_item.
data())
63 , m_list_data_size(_list.
size())
64 , m_nb_item(_nb_connected_item.
size())
67 _checkSize(_indexes.
size(), _nb_connected_item.
size());
78 void checkSame(ItemConnectivityContainerView rhs)
const;
83 template <
typename ItemType>
constexpr ARCCORE_HOST_DEVICE
87 ARCANE_CHECK_AT(lid.localId(), m_nb_item);
88 Int32 x = m_indexes[lid];
89 ARCANE_CHECK_AT(x, m_list_data_size);
90 auto* p = &m_list_data[x];
92 return { p, m_nb_connected_items[lid], 0 };
96 template <
typename ItemLocalIdType>
constexpr ARCCORE_HOST_DEVICE
100 ARCANE_CHECK_AT(lid.localId(), m_nb_item);
101 Int32 x = m_indexes[lid] + index;
102 ARCANE_CHECK_AT(x, m_list_data_size);
103 return ItemLocalIdType(m_list_data[x]);
108 indexes()
const {
return { m_indexes, m_nb_item }; }
115 constexpr ARCCORE_HOST_DEVICE
Int32 nbItem()
const {
return m_nb_item; }
119 Int32* m_list_data =
nullptr;
120 const Int32* m_indexes =
nullptr;
121 const Int32* m_nb_connected_items =
nullptr;
122 Int32 m_list_data_size = 0;
127 void _checkSize(
Int32 indexes_size,
Int32 nb_connected_item_size);
133 ARCCORE_HOST_DEVICE
void _setParticleCellId(
ItemLocalId particle_lid, CellLocalId cell_lid)
const
135 ARCANE_CHECK_AT(particle_lid.localId(), m_nb_item);
136 m_list_data[m_indexes[particle_lid]] = cell_lid;
Declarations of types on entities.
Types and functions associated with the classes SpanImpl, SmallSpan and Span.
constexpr __host__ __device__ Int32 nbItem() const
Number of entities.
constexpr __host__ __device__ SmallSpan< const Int32 > nbConnectedItems() const
Array of the number of entities connected to another entity.
void checkSame(ItemConnectivityContainerView rhs) const
Checks that the two instances this and rhs have the same values.
constexpr __host__ __device__ ItemLocalIdType itemId(ItemLocalId lid, Int32 index) const
index-th entity connected to the entity with localId() lid
constexpr __host__ __device__ ItemLocalIdListViewT< ItemType > itemsIds(ItemLocalId lid) const
List of entities connected to the entity with localId() lid.
constexpr __host__ __device__ SmallSpan< const Int32 > indexes() const
Array of indices in the connectivity table.
Connectivity information, for an entity family, allowing transition between old and new connectivity ...
Typed view over a list of connectivity entities.
Index of an Item in a variable.
Editable view of Particle->Cell connectivity.
View of an array of elements of type T.
constexpr __host__ __device__ pointer data() const noexcept
Pointer to the start of the view.
constexpr __host__ __device__ SizeType size() const noexcept
Returns the size of the array.
Base class for incremental item->item[] connectivities.
-- tab-width: 2; indent-tabs-mode: nil; coding: utf-8-with-signature --
std::int32_t Int32
Signed integer type of 32 bits.