14#include "arcane/core/internal/ItemGroupInternal.h"
16#include "arcane/utils/ITraceMng.h"
18#include "arcane/core/IItemFamily.h"
19#include "arcane/core/IMesh.h"
20#include "arcane/core/MeshKind.h"
31ItemGroupSubPartsByType::
33: m_group_internal(igi)
36 if (
auto v = Convert::Type<Int32>::tryParseFromEnvironment(
"ARCANE_APPLYOPERATION_VERSION",
true))
37 m_use_v2_for_apply_operation = (v.value() == 2);
39 if (
auto v = Convert::Type<Int32>::tryParseFromEnvironment(
"ARCANE_DEBUG_APPLYOPERATION",
true))
40 m_is_debug_apply_operation = (v.value() > 0);
46void ItemGroupSubPartsByType::
47_initChildrenByTypeV2()
49 bool is_verbose = m_is_debug_apply_operation;
51 m_group_internal->mesh()->traceMng()->info() <<
"ItemGroupImpl::_initChildrenByTypeV2() name=" << m_group_internal->name();
53 Int32 nb_basic_item_type = ItemTypeMng::nbBasicItemType();
54 m_children_by_type_ids.resize(nb_basic_item_type);
55 for (Integer i = 0; i < nb_basic_item_type; ++i) {
56 m_children_by_type_ids[i] = UniqueArray<Int32>{ MemoryUtils::getDefaultDataAllocator() };
60void ItemGroupSubPartsByType::
61_computeChildrenByTypeV2()
63 ItemGroup that_group(m_group_impl);
64 Int32 nb_item = m_group_internal->nbItem();
65 IMesh* mesh = m_group_internal->mesh();
66 ItemTypeMng* type_mng = mesh->itemTypeMng();
67 ITraceMng* trace = mesh->traceMng();
68 bool is_verbose = m_is_debug_apply_operation;
70 trace->info() <<
"ItemGroupImpl::_computeChildrenByTypeV2 for " << m_group_internal->name();
73 if (nb_item > 0 && mesh->meshKind().meshStructure() == eMeshStructure::Cartesian) {
74 ItemInfoListView lv(m_group_internal->m_item_family->itemInfoListView());
75 m_unique_children_type = ItemTypeId{ lv.typeId(m_group_internal->itemsLocalId()[0]) };
79 Int32 nb_basic_item_type = ItemTypeMng::nbBasicItemType();
80 m_unique_children_type = ItemTypeId{ IT_NullType };
82 UniqueArray<Int32> nb_items_by_type(nb_basic_item_type);
83 nb_items_by_type.fill(0);
86 Int16 item_type = item.type();
87 if (item_type < nb_basic_item_type)
88 ++nb_items_by_type[item_type];
90 const String& name = m_group_internal->name();
91 Int32 nb_different_type = 0;
92 for (Int32 i = 0; i < nb_basic_item_type; ++i) {
93 m_children_by_type_ids[i].clear();
94 const Int32 n = nb_items_by_type[i];
95 m_children_by_type_ids[i].reserve(n);
99 trace->info() <<
"ItemGroupImpl::_computeChildrenByTypeV2 for " << name
100 <<
" type=" << type_mng->typeName(i) <<
" nb=" << n;
103 trace->info() <<
"ItemGroupImpl::_computeChildrenByTypeV2 for " << name
104 <<
" nb_item=" << nb_item <<
" nb_different_type=" << nb_different_type;
109 if (nb_item > 0 && nb_different_type == 1) {
110 ItemInfoListView lv(m_group_internal->m_item_family->itemInfoListView());
111 m_unique_children_type = ItemTypeId{ lv.typeId(m_group_internal->itemsLocalId()[0]) };
113 trace->info() <<
"ItemGroupImpl::_computeChildrenByTypeV2 for " << name
114 <<
" unique_type=" << type_mng->typeName(m_unique_children_type);
120 Integer item_type = item.type();
121 if (item_type < nb_basic_item_type)
122 m_children_by_type_ids[item_type].add(iitem.itemLocalId());
125 for (Int32 i = 0; i < nb_basic_item_type; ++i)
126 applySimdPadding(m_children_by_type_ids[i]);
Implémentation de la classe ItemGroupImpl.
-*- tab-width: 2; indent-tabs-mode: nil; coding: utf-8-with-signature -*-
Int32 Integer
Type représentant un entier.