@@ -76,8 +76,10 @@ class ARCANE_CORE_EXPORT AllEnvCellVectorView
76
76
77
77
protected:
78
78
79
- AllEnvCellVectorView (Int32ConstArrayView local_ids, ConstArrayView<ComponentItemInternal> items_internal)
80
- : m_local_ids(local_ids), m_items_internal(items_internal)
79
+ AllEnvCellVectorView (Int32ConstArrayView local_ids,
80
+ ComponentItemSharedInfo* shared_info)
81
+ : m_local_ids(local_ids)
82
+ , m_shared_info(shared_info)
81
83
{
82
84
}
83
85
@@ -87,22 +89,18 @@ class ARCANE_CORE_EXPORT AllEnvCellVectorView
87
89
Integer size () const { return m_local_ids.size (); }
88
90
89
91
// \i ème maille du vecteur
90
- AllEnvCell operator [](Integer index)
92
+ AllEnvCell operator [](Integer index) const
91
93
{
92
- const ComponentItemInternal* c = &m_items_internal[m_local_ids[index ]];
93
- return AllEnvCell (matimpl::ConstituentItemBase (const_cast <ComponentItemInternal*>(c)));
94
+ return AllEnvCell (m_shared_info->_item (ConstituentItemIndex (m_local_ids[index ])));
94
95
}
95
96
96
97
// localId() de la \i ème maille du vecteur
97
- Int32 localId (Integer index)
98
- {
99
- return m_local_ids[index ];
100
- }
98
+ Int32 localId (Integer index) const { return m_local_ids[index ]; }
101
99
102
100
private:
103
101
104
102
Int32ConstArrayView m_local_ids;
105
- ConstArrayView<ComponentItemInternal> m_items_internal ;
103
+ ComponentItemSharedInfo* m_shared_info = nullptr ;
106
104
};
107
105
108
106
/* ---------------------------------------------------------------------------*/
@@ -298,7 +296,7 @@ class ARCANE_CORE_EXPORT ComponentPartCellEnumerator
298
296
Integer m_base_index;
299
297
Int32ConstArrayView m_value_indexes;
300
298
Int32ConstArrayView m_item_indexes;
301
- ConstituentItemLocalIdListView m_constituent_list_view; // ConstArrayView<ComponentItemInternal*> m_items_internal;
299
+ ConstituentItemLocalIdListView m_constituent_list_view;
302
300
IMeshComponent* m_component;
303
301
304
302
protected:
@@ -364,8 +362,8 @@ class ARCANE_CORE_EXPORT CellComponentCellEnumerator
364
362
365
363
ARCCORE_HOST_DEVICE explicit CellComponentCellEnumerator (ComponentCell super_item)
366
364
: m_size(super_item.nbSubItem())
367
- , m_items_begin (super_item._firstSubConstituentLocalId().localId())
368
- , m_item_internal_list (super_item.m_shared_info->m_sub_component_item_shared_info->m_component_item_internal_view )
365
+ , m_first_sub_index (super_item._firstSubConstituentLocalId().localId())
366
+ , m_sub_constituent_shared_info (super_item.m_shared_info->m_sub_component_item_shared_info)
369
367
{
370
368
}
371
369
@@ -377,9 +375,12 @@ class ARCANE_CORE_EXPORT CellComponentCellEnumerator
377
375
ARCCORE_HOST_DEVICE ComponentCell operator *() const
378
376
{
379
377
ARCANE_CHECK_AT (m_index,m_size);
380
- return ComponentCell (_currentItemBase ());
378
+ return ComponentCell (_currentSubItemBase ());
379
+ }
380
+ ARCCORE_HOST_DEVICE MatVarIndex _varIndex () const
381
+ {
382
+ return m_sub_constituent_shared_info->_varIndex (ConstituentItemIndex (m_first_sub_index + m_index));
381
383
}
382
- ARCCORE_HOST_DEVICE MatVarIndex _varIndex () const { return m_item_internal_list[m_items_begin+m_index].variableIndex (); }
383
384
ARCCORE_HOST_DEVICE Integer index () const { return m_index; }
384
385
ARCCORE_HOST_DEVICE operator ComponentItemLocalId () const
385
386
{
@@ -390,14 +391,14 @@ class ARCANE_CORE_EXPORT CellComponentCellEnumerator
390
391
391
392
Int32 m_index = 0 ;
392
393
Int32 m_size = 0 ;
393
- Int32 m_items_begin = -1 ;
394
- ArrayView<ComponentItemInternal> m_item_internal_list ;
394
+ Int32 m_first_sub_index = -1 ;
395
+ ComponentItemSharedInfo* m_sub_constituent_shared_info = nullptr ;
395
396
396
397
protected:
397
398
398
- ARCCORE_HOST_DEVICE matimpl::ConstituentItemBase _currentItemBase () const
399
+ ARCCORE_HOST_DEVICE matimpl::ConstituentItemBase _currentSubItemBase () const
399
400
{
400
- return matimpl::ConstituentItemBase ( const_cast <ComponentItemInternal*>(m_item_internal_list. ptrAt (m_items_begin +m_index) ));
401
+ return m_sub_constituent_shared_info-> _item ( ConstituentItemIndex (m_first_sub_index +m_index));
401
402
}
402
403
};
403
404
@@ -419,7 +420,7 @@ template <typename ComponentCellType> class CellComponentCellEnumeratorT
419
420
ARCCORE_HOST_DEVICE ComponentCellType operator *() const
420
421
{
421
422
ARCANE_CHECK_AT (m_index,m_size);
422
- return ComponentCellType (_currentItemBase ());
423
+ return ComponentCellType (_currentSubItemBase ());
423
424
}
424
425
};
425
426
0 commit comments