@@ -25,6 +25,8 @@ namespace Arcane::Materials
25
25
{
26
26
class MeshEnvironment ;
27
27
class MeshComponentData ;
28
+ class AllEnvData ;
29
+ class MeshMaterialMng ;
28
30
namespace matimpl
29
31
{
30
32
class ConstituentItemBase ;
@@ -103,7 +105,8 @@ class ARCANE_CORE_EXPORT ComponentItemSharedInfo
103
105
ItemSharedInfo* m_item_shared_info = ItemSharedInfo::nullInstance();
104
106
Int16 m_level = (-1 );
105
107
ConstArrayView<IMeshComponent*> m_components;
106
- ComponentItemSharedInfo* m_parent_component_item_shared_info = null_shared_info_pointer;
108
+ ComponentItemSharedInfo* m_super_component_item_shared_info = null_shared_info_pointer;
109
+ ComponentItemSharedInfo* m_sub_component_item_shared_info = null_shared_info_pointer;
107
110
ArrayView<ComponentItemInternal> m_component_item_internal_view;
108
111
};
109
112
@@ -126,6 +129,8 @@ class ARCANE_CORE_EXPORT ConstituentItemBase
126
129
friend Arcane::Materials::AllEnvCell;
127
130
friend Arcane::Materials::EnvCell;
128
131
friend Arcane::Materials::MatCell;
132
+ friend Arcane::Materials::AllEnvData;
133
+ friend Arcane::Materials::MeshMaterialMng;
129
134
130
135
friend Arcane::Materials::MeshEnvironment;
131
136
friend Arcane::Materials::MeshComponentData;
@@ -220,6 +225,15 @@ class ARCANE_CORE_EXPORT ConstituentItemBase
220
225
private:
221
226
222
227
ComponentItemInternal* m_component_item = nullptr ;
228
+
229
+ private:
230
+
231
+ void _checkIsInt16 (Int32 v)
232
+ {
233
+ if (v < (-32768 ) || v > 32767 )
234
+ _throwBadCast (v);
235
+ }
236
+ void _throwBadCast (Int32 v);
223
237
};
224
238
225
239
/* ---------------------------------------------------------------------------*/
@@ -354,60 +368,17 @@ class ARCANE_CORE_EXPORT ComponentItemInternal
354
368
return &nullComponentItemInternal;
355
369
}
356
370
357
- // ! Positionne l'indexeur dans les variables matériaux.
358
- void _setVariableIndex (MatVarIndex index)
359
- {
360
- m_var_index = index ;
361
- }
362
-
363
- // ! Composant supérieur (0 si aucun)
364
- matimpl::ConstituentItemBase _superItemBase () const
365
- {
366
- return &m_shared_info->m_component_item_internal_view [m_super_component_item_local_id.localId ()];
367
- }
368
-
369
- void _setSuperAndGlobalItem (ComponentItemInternalLocalId cii, ItemLocalId ii)
370
- {
371
- m_super_component_item_local_id = cii;
372
- m_global_item_local_id = ii.localId ();
373
- }
374
-
375
- void _setGlobalItem (ItemLocalId ii)
376
- {
377
- m_global_item_local_id = ii.localId ();
378
- }
371
+ // ! Composant supérieur (null si aucun)
372
+ inline matimpl::ConstituentItemBase _superItemBase () const ;
379
373
380
- // ! Première entité sous-composant.
374
+ // ! Première entité du sous-constituant
381
375
ARCCORE_HOST_DEVICE ComponentItemInternalLocalId _firstSubItemLocalId () const
382
376
{
383
377
return m_first_sub_component_item_local_id;
384
378
}
385
379
386
380
ARCCORE_HOST_DEVICE matimpl::ConstituentItemBase _subItemBase (Int32 i) const ;
387
381
388
- // ! Positionne le nombre de sous-composants.
389
- void _setNbSubItem (Int32 nb_sub_item)
390
- {
391
- #ifdef ARCANE_CHECK
392
- _checkIsInt16 (nb_sub_item);
393
- #endif
394
- m_nb_sub_component_item = static_cast <Int16>(nb_sub_item);
395
- }
396
-
397
- // ! Positionne le premier sous-composant.
398
- void _setFirstSubItem (ComponentItemInternalLocalId first_sub_item)
399
- {
400
- m_first_sub_component_item_local_id = first_sub_item;
401
- }
402
-
403
- void _setComponent (Int32 component_id)
404
- {
405
- #ifdef ARCANE_CHECK
406
- _checkIsInt16 (component_id);
407
- #endif
408
- m_component_id = static_cast <Int16>(component_id);
409
- }
410
-
411
382
ARCCORE_HOST_DEVICE ComponentItemInternalLocalId _internalLocalId () const
412
383
{
413
384
return m_component_item_internal_local_id;
@@ -457,7 +428,14 @@ inline ARCCORE_HOST_DEVICE matimpl::ConstituentItemBase ComponentItemInternal::
457
428
_subItemBase (Int32 i) const
458
429
{
459
430
ComponentItemInternalLocalId lid (m_first_sub_component_item_local_id.localId () + i);
460
- return m_shared_info->_item (lid);
431
+ return m_shared_info->m_sub_component_item_shared_info ->_item (lid);
432
+ }
433
+
434
+ matimpl::ConstituentItemBase ComponentItemInternal::
435
+ _superItemBase () const
436
+ {
437
+ ComponentItemInternalLocalId lid (m_super_component_item_local_id.localId ());
438
+ return m_shared_info->m_super_component_item_shared_info ->_item (lid);
461
439
}
462
440
463
441
/* ---------------------------------------------------------------------------*/
@@ -514,7 +492,7 @@ componentUniqueId() const
514
492
inline void matimpl::ConstituentItemBase::
515
493
_setVariableIndex (MatVarIndex index)
516
494
{
517
- m_component_item->_setVariableIndex ( index ) ;
495
+ m_component_item->m_var_index = index ;
518
496
}
519
497
520
498
inline matimpl::ConstituentItemBase matimpl::ConstituentItemBase::
@@ -526,13 +504,14 @@ _superItemBase() const
526
504
inline void matimpl::ConstituentItemBase::
527
505
_setSuperAndGlobalItem (ComponentItemInternalLocalId cii, ItemLocalId ii)
528
506
{
529
- m_component_item->_setSuperAndGlobalItem (cii, ii);
507
+ m_component_item->m_super_component_item_local_id = cii;
508
+ m_component_item->m_global_item_local_id = ii.localId ();
530
509
}
531
510
532
511
inline void matimpl::ConstituentItemBase::
533
512
_setGlobalItem (ItemLocalId ii)
534
513
{
535
- m_component_item->_setGlobalItem (ii );
514
+ m_component_item->m_global_item_local_id = ii. localId ( );
536
515
}
537
516
538
517
// ! Première entité sous-composant.
@@ -552,26 +531,32 @@ _subItemBase(Int32 i) const
552
531
inline void matimpl::ConstituentItemBase::
553
532
_setNbSubItem (Int32 nb_sub_item)
554
533
{
555
- m_component_item->_setNbSubItem (nb_sub_item);
534
+ #ifdef ARCANE_CHECK
535
+ _checkIsInt16 (nb_sub_item);
536
+ #endif
537
+ m_component_item->m_nb_sub_component_item = static_cast <Int16>(nb_sub_item);
556
538
}
557
539
558
540
// ! Positionne le premier sous-composant.
559
541
inline void matimpl::ConstituentItemBase::
560
542
_setFirstSubItem (ComponentItemInternalLocalId first_sub_item)
561
543
{
562
- m_component_item->_setFirstSubItem ( first_sub_item) ;
544
+ m_component_item->m_first_sub_component_item_local_id = first_sub_item;
563
545
}
564
546
565
547
inline void matimpl::ConstituentItemBase::
566
548
_setComponent (Int32 component_id)
567
549
{
568
- m_component_item->_setComponent (component_id);
550
+ #ifdef ARCANE_CHECK
551
+ _checkIsInt16 (component_id);
552
+ #endif
553
+ m_component_item->m_component_id = static_cast <Int16>(component_id);
569
554
}
570
555
571
556
inline ARCCORE_HOST_DEVICE ComponentItemInternalLocalId matimpl::ConstituentItemBase::
572
557
_internalLocalId () const
573
558
{
574
- return m_component_item->_internalLocalId () ;
559
+ return m_component_item->m_component_item_internal_local_id ;
575
560
}
576
561
577
562
inline void matimpl::ConstituentItemBase::
0 commit comments