Skip to content

Commit 5039f68

Browse files
[arcane,materials] Retourne un 'ConstituentItemBase' au lieu de 'ComponentItemInternal*' pour les sous-entités.
1 parent 0c54575 commit 5039f68

File tree

2 files changed

+20
-10
lines changed

2 files changed

+20
-10
lines changed

arcane/src/arcane/core/materials/ComponentItemInternal.h

Lines changed: 18 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -199,7 +199,7 @@ class ARCANE_CORE_EXPORT ConstituentItemBase
199199
//! Première entité sous-composant.
200200
inline ARCCORE_HOST_DEVICE ComponentItemInternalLocalId _firstSubItemLocalId() const;
201201

202-
inline ARCCORE_HOST_DEVICE ComponentItemInternal* _subItem(Int32 i) const;
202+
inline ARCCORE_HOST_DEVICE matimpl::ConstituentItemBase _subItemBase(Int32 i) const;
203203

204204
//! Positionne le nombre de sous-composants.
205205
inline void _setNbSubItem(Int32 nb_sub_item);
@@ -383,10 +383,7 @@ class ARCANE_CORE_EXPORT ComponentItemInternal
383383
return m_first_sub_component_item_local_id;
384384
}
385385

386-
ARCCORE_HOST_DEVICE ComponentItemInternal* _subItem(Int32 i) const
387-
{
388-
return &m_shared_info->m_component_item_internal_view[m_first_sub_component_item_local_id.localId() + i];
389-
}
386+
ARCCORE_HOST_DEVICE matimpl::ConstituentItemBase _subItemBase(Int32 i) const;
390387

391388
//! Positionne le nombre de sous-composants.
392389
void _setNbSubItem(Int32 nb_sub_item)
@@ -453,6 +450,19 @@ ConstituentItemBase(ComponentItemSharedInfo* shared_info, ComponentItemInternalL
453450
{
454451
}
455452

453+
/*---------------------------------------------------------------------------*/
454+
/*---------------------------------------------------------------------------*/
455+
456+
inline ARCCORE_HOST_DEVICE matimpl::ConstituentItemBase ComponentItemInternal::
457+
_subItemBase(Int32 i) const
458+
{
459+
ComponentItemInternalLocalId lid(m_first_sub_component_item_local_id.localId() + i);
460+
return m_shared_info->_item(lid);
461+
}
462+
463+
/*---------------------------------------------------------------------------*/
464+
/*---------------------------------------------------------------------------*/
465+
456466
inline ARCCORE_HOST_DEVICE constexpr MatVarIndex matimpl::ConstituentItemBase::
457467
variableIndex() const
458468
{
@@ -532,10 +542,10 @@ _firstSubItemLocalId() const
532542
return m_component_item->_firstSubItemLocalId();
533543
}
534544

535-
inline ARCCORE_HOST_DEVICE ComponentItemInternal* matimpl::ConstituentItemBase::
536-
_subItem(Int32 i) const
545+
inline ARCCORE_HOST_DEVICE matimpl::ConstituentItemBase matimpl::ConstituentItemBase::
546+
_subItemBase(Int32 i) const
537547
{
538-
return m_component_item->_subItem(i);
548+
return m_component_item->_subItemBase(i);
539549
}
540550

541551
//! Positionne le nombre de sous-composants.

arcane/src/arcane/core/materials/MatItem.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -139,7 +139,7 @@ class EnvCell
139139
//! i-ème maille matériau de cette maille
140140
inline MatCell cell(Integer i)
141141
{
142-
return matimpl::ConstituentItemBase(m_internal->_subItem(i));
142+
return m_internal->_subItemBase(i);
143143
}
144144

145145
//! Milieu associé
@@ -201,7 +201,7 @@ class AllEnvCell
201201
//! i-ème maille milieu
202202
EnvCell cell(Int32 i) const
203203
{
204-
return EnvCell(matimpl::ConstituentItemBase(m_internal->_subItem(i)));
204+
return EnvCell(m_internal->_subItemBase(i));
205205
}
206206
};
207207

0 commit comments

Comments
 (0)