From 906a2e70cf5ef788d92210f03c9e5ce4a3bb939b Mon Sep 17 00:00:00 2001 From: Gilles Grospellier Date: Wed, 11 Sep 2024 15:13:18 +0200 Subject: [PATCH 1/4] =?UTF-8?q?[arcane,mesh]=20Supprime=20utilisation=20ex?= =?UTF-8?q?terne=20=C3=A0=20'ItemInternalMap'=20de=20la=20macro=20'ENUMERA?= =?UTF-8?q?TE=5FITEM=5FINTERNAL=5FMAP=5FDATA'.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- arcane/src/arcane/mesh/DoFFamily.cc | 17 +++++++++++- arcane/src/arcane/mesh/DoFFamily.h | 27 +++++-------------- .../src/arcane/mesh/DynamicMeshKindInfos.cc | 6 +---- arcane/src/arcane/mesh/ItemInternalMap.cc | 25 ++++++++++++++++- arcane/src/arcane/mesh/ItemInternalMap.h | 18 ++++++++++--- 5 files changed, 63 insertions(+), 30 deletions(-) diff --git a/arcane/src/arcane/mesh/DoFFamily.cc b/arcane/src/arcane/mesh/DoFFamily.cc index cdd5344b2d..74b174400c 100644 --- a/arcane/src/arcane/mesh/DoFFamily.cc +++ b/arcane/src/arcane/mesh/DoFFamily.cc @@ -26,13 +26,28 @@ namespace Arcane::mesh { +Int64 DoFUids:: +getMaxItemUid(IItemFamily* family) +{ + Int64 max_uid = 0; + // This method can be used within IItemFamily::endUpdate when new items have been created but the groups are not yet updated. + // Therefore we use internal map enumeration instead of group enumeration + ItemFamily* item_family = ARCANE_CHECK_POINTER(dynamic_cast(family)); + item_family->itemsMap().eachItem([&](Item item) { + if (max_uid < item.uniqueId().asInt64()) + max_uid = item.uniqueId().asInt64(); + }); + Int64 pmax_uid = family->mesh()->parallelMng()->reduce(Parallel::ReduceMax, max_uid); + return pmax_uid; +} + /*---------------------------------------------------------------------------*/ /*---------------------------------------------------------------------------*/ DoFFamily:: DoFFamily(IMesh* mesh, const String& name) : ItemFamily(mesh,IK_DoF,name) - , m_shared_info(0) +, m_shared_info(nullptr) {} /*---------------------------------------------------------------------------*/ diff --git a/arcane/src/arcane/mesh/DoFFamily.h b/arcane/src/arcane/mesh/DoFFamily.h index a2a4774fa1..3a138f10be 100644 --- a/arcane/src/arcane/mesh/DoFFamily.h +++ b/arcane/src/arcane/mesh/DoFFamily.h @@ -7,17 +7,17 @@ /*---------------------------------------------------------------------------*/ /* DoFFamily.h (C) 2000-2024 */ /* */ -/* Famille de degres de liberte (DoF) */ +/* Famille de degrés de liberté (DoF) */ /*---------------------------------------------------------------------------*/ #ifndef ARCANE_MESH_DOFFAMILY_H #define ARCANE_MESH_DOFFAMILY_H /*---------------------------------------------------------------------------*/ /*---------------------------------------------------------------------------*/ -#include "arcane/ItemTypes.h" -#include "arcane/IMesh.h" -#include "arcane/IParallelMng.h" -#include "arcane/IDoFFamily.h" +#include "arcane/core/ItemTypes.h" +#include "arcane/core/IMesh.h" +#include "arcane/core/IParallelMng.h" +#include "arcane/core/IDoFFamily.h" #include "arcane/mesh/ItemFamily.h" @@ -34,7 +34,7 @@ class DynamicMesh; /*---------------------------------------------------------------------------*/ /*---------------------------------------------------------------------------*/ -class DoFUids +class ARCANE_MESH_EXPORT DoFUids { /*! * Utilitaire d'obtention d'identifiant unique. Version triviale pour experimentation. @@ -54,20 +54,7 @@ class DoFUids } // very temporary solution... // utilities - static Int64 getMaxItemUid(IItemFamily* family) - { - Int64 max_uid = 0; - // This method can be used within IItemFamily::endUpdate when new items have been created but the groups are not yet updated. - // Therefore we use internal map enumeration instead of group enumeration - ItemFamily* item_family = static_cast(family); - ENUMERATE_ITEM_INTERNAL_MAP_DATA(item, item_family->itemsMap()) - { - if (max_uid < item->value()->uniqueId().asInt64()) - max_uid = item->value()->uniqueId().asInt64(); - } - Int64 pmax_uid = family->mesh()->parallelMng()->reduce(Parallel::ReduceMax, max_uid); - return pmax_uid; - } + static Int64 getMaxItemUid(IItemFamily* family); }; /*---------------------------------------------------------------------------*/ diff --git a/arcane/src/arcane/mesh/DynamicMeshKindInfos.cc b/arcane/src/arcane/mesh/DynamicMeshKindInfos.cc index 44cdd5dc18..c4b4b45749 100644 --- a/arcane/src/arcane/mesh/DynamicMeshKindInfos.cc +++ b/arcane/src/arcane/mesh/DynamicMeshKindInfos.cc @@ -651,11 +651,7 @@ finishCompactItems(ItemFamilyCompactInfos& compact_infos) // IMPORTANT: Cette opération doit toujours être la dernière car ensuite // on perd la relation entre les anciens local_ids et les nouveaux à // travers cette structure - ENUMERATE_ITEM_INTERNAL_MAP_DATA(nbid,m_items_map){ - ItemInternal* item = nbid->value(); - Integer current_local_id = item->localId(); - nbid->setValue(m_internals[ old_to_new_local_ids[ current_local_id ] ]); - } + m_items_map.changeLocalIds(m_internals, old_to_new_local_ids); if (m_is_verbose){ info() << "DumpItemsBefore:"; diff --git a/arcane/src/arcane/mesh/ItemInternalMap.cc b/arcane/src/arcane/mesh/ItemInternalMap.cc index 4e2739e649..638fbe7746 100644 --- a/arcane/src/arcane/mesh/ItemInternalMap.cc +++ b/arcane/src/arcane/mesh/ItemInternalMap.cc @@ -27,6 +27,10 @@ namespace Arcane::mesh { +#define ENUMERATE_ITEM_INTERNAL_MAP_DATA2(iter, item_list) \ + for (auto __i__##iter : item_list.buckets()) \ + for (auto* iter = __i__##iter; iter; iter = iter->next()) + /*---------------------------------------------------------------------------*/ /*---------------------------------------------------------------------------*/ @@ -55,15 +59,34 @@ notifyUniqueIdsChanged() }); } - ENUMERATE_ITEM_INTERNAL_MAP_DATA(nbid,c){ + ENUMERATE_ITEM_INTERNAL_MAP_DATA2(nbid, c) + { nbid->setKey(nbid->value()->uniqueId().asInt64()); } + this->rehash(); } /*---------------------------------------------------------------------------*/ /*---------------------------------------------------------------------------*/ +void ItemInternalMap:: +changeLocalIds(ArrayView items_internal, + ConstArrayView old_to_new_local_ids) +{ + ItemInternalMap& c = *this; + + ENUMERATE_ITEM_INTERNAL_MAP_DATA2(nbid, c) + { + ItemInternal* item = nbid->value(); + Int32 current_local_id = item->localId(); + nbid->setValue(items_internal[old_to_new_local_ids[current_local_id]]); + } +} + +/*---------------------------------------------------------------------------*/ +/*---------------------------------------------------------------------------*/ + } // End namespace Arcane::mesh /*---------------------------------------------------------------------------*/ diff --git a/arcane/src/arcane/mesh/ItemInternalMap.h b/arcane/src/arcane/mesh/ItemInternalMap.h index cfa5fc0073..377cd73388 100644 --- a/arcane/src/arcane/mesh/ItemInternalMap.h +++ b/arcane/src/arcane/mesh/ItemInternalMap.h @@ -60,7 +60,6 @@ class ItemInternalMap public: using BaseClass::add; - using BaseClass::buckets; using BaseClass::clear; using BaseClass::count; using BaseClass::lookupAdd; @@ -93,7 +92,7 @@ class ItemInternalMap template void eachItem(const Lambda& lambda) { - ConstArrayView b = buckets(); + ConstArrayView b = BaseClass::buckets(); for (Int32 k = 0, n = b.size(); k < n; ++k) { BaseData* nbid = b[k]; for (; nbid; nbid = nbid->next()) { @@ -126,7 +125,7 @@ class ItemInternalMap return (d ? d->value() : nullptr); } - private: + public: ARCANE_DEPRECATED_REASON("This method is internal to Arcane") Data* lookup(Int64 key) @@ -139,6 +138,19 @@ class ItemInternalMap { return BaseClass::lookup(key); } + + ARCANE_DEPRECATED_REASON("This method is internal to Arcane") + ConstArrayView buckets() const { return BaseClass::buckets(); } + + private: + + /*! + * \brief Change la valeurs des localId(0. + * + * Cette méthode ne doit être appelée que par DynamicMeshKindInfos. + */ + void changeLocalIds(ArrayView items_internal, + ConstArrayView old_to_new_local_ids); }; /*---------------------------------------------------------------------------*/ From e9c0478f92cf10038726489e8874e43780433860 Mon Sep 17 00:00:00 2001 From: Gilles Grospellier Date: Wed, 11 Sep 2024 15:31:28 +0200 Subject: [PATCH 2/4] =?UTF-8?q?[arcane,mesh]=20Rend=20obsol=C3=A8te=20les?= =?UTF-8?q?=20m=C3=A9thodes=20'lookupAdd'=20et=20'lookupValue'=20de=20'Ite?= =?UTF-8?q?mInternalMap'.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/arcane/mesh/DynamicMeshKindInfos.cc | 2 +- arcane/src/arcane/mesh/DynamicMeshKindInfos.h | 2 +- arcane/src/arcane/mesh/ItemInternalMap.cc | 4 +- arcane/src/arcane/mesh/ItemInternalMap.h | 55 +++++++++++++++++-- 4 files changed, 54 insertions(+), 9 deletions(-) diff --git a/arcane/src/arcane/mesh/DynamicMeshKindInfos.cc b/arcane/src/arcane/mesh/DynamicMeshKindInfos.cc index c4b4b45749..eddd2cd986 100644 --- a/arcane/src/arcane/mesh/DynamicMeshKindInfos.cc +++ b/arcane/src/arcane/mesh/DynamicMeshKindInfos.cc @@ -651,7 +651,7 @@ finishCompactItems(ItemFamilyCompactInfos& compact_infos) // IMPORTANT: Cette opération doit toujours être la dernière car ensuite // on perd la relation entre les anciens local_ids et les nouveaux à // travers cette structure - m_items_map.changeLocalIds(m_internals, old_to_new_local_ids); + m_items_map._changeLocalIds(m_internals, old_to_new_local_ids); if (m_is_verbose){ info() << "DumpItemsBefore:"; diff --git a/arcane/src/arcane/mesh/DynamicMeshKindInfos.h b/arcane/src/arcane/mesh/DynamicMeshKindInfos.h index 8abb2e4ff9..c09d91bc23 100644 --- a/arcane/src/arcane/mesh/DynamicMeshKindInfos.h +++ b/arcane/src/arcane/mesh/DynamicMeshKindInfos.h @@ -187,7 +187,7 @@ class ARCANE_MESH_EXPORT DynamicMeshKindInfos if (!m_has_unique_id_map) _badUniqueIdMap(); #endif - ItemInternalMapData* item_data = m_items_map.lookupAdd(uid,0,is_alloc); + ItemInternalMapData* item_data = m_items_map._lookupAdd(uid, 0, is_alloc); if (is_alloc){ bool need_alloc; item_data->setValue(_allocOne(need_alloc)); diff --git a/arcane/src/arcane/mesh/ItemInternalMap.cc b/arcane/src/arcane/mesh/ItemInternalMap.cc index 638fbe7746..b2ada0f882 100644 --- a/arcane/src/arcane/mesh/ItemInternalMap.cc +++ b/arcane/src/arcane/mesh/ItemInternalMap.cc @@ -71,8 +71,8 @@ notifyUniqueIdsChanged() /*---------------------------------------------------------------------------*/ void ItemInternalMap:: -changeLocalIds(ArrayView items_internal, - ConstArrayView old_to_new_local_ids) +_changeLocalIds(ArrayView items_internal, + ConstArrayView old_to_new_local_ids) { ItemInternalMap& c = *this; diff --git a/arcane/src/arcane/mesh/ItemInternalMap.h b/arcane/src/arcane/mesh/ItemInternalMap.h index 377cd73388..2ad7c2b1bc 100644 --- a/arcane/src/arcane/mesh/ItemInternalMap.h +++ b/arcane/src/arcane/mesh/ItemInternalMap.h @@ -62,8 +62,6 @@ class ItemInternalMap using BaseClass::add; using BaseClass::clear; using BaseClass::count; - using BaseClass::lookupAdd; - using BaseClass::lookupValue; using BaseClass::remove; using BaseClass::operator[]; using BaseClass::hasKey; @@ -116,6 +114,26 @@ class ItemInternalMap return (d ? d->value()->localId() : NULL_ITEM_LOCAL_ID); } + /*! + * \brief Retourne l'entité de numéro unique \a uid. + * + * Lève une exception si l'entité n'est pas dans la table. + */ + impl::ItemBase findItem(Int64 uid) const + { + return impl::ItemBase(BaseClass::lookupValue(uid)); + } + + /*! + * \brief Retourne le numéro local de l'entité de numéro unique \a uid. + * + * Lève une exception si l'entité n'est pas dans la table. + */ + Int32 findLocalId(Int64 uid) const + { + return BaseClass::lookupValue(uid)->localId(); + } + private: //! Retourne l'entité associée à \a key si trouvé ou nullptr sinon @@ -142,6 +160,24 @@ class ItemInternalMap ARCANE_DEPRECATED_REASON("This method is internal to Arcane") ConstArrayView buckets() const { return BaseClass::buckets(); } + ARCANE_DEPRECATED_REASON("This method is internal to Arcane") + BaseData* lookupAdd(Int64 id, ItemInternal* value, bool& is_add) + { + return BaseClass::lookupAdd(id, value, is_add); + } + + ARCANE_DEPRECATED_REASON("This method is internal to Arcane") + BaseData* lookupAdd(Int64 uid) + { + return BaseClass::lookupAdd(uid); + } + + ARCANE_DEPRECATED_REASON("Use findItem() instead") + ItemInternal* lookupValue(Int64 uid) const + { + return BaseClass::lookupValue(uid); + } + private: /*! @@ -149,14 +185,23 @@ class ItemInternalMap * * Cette méthode ne doit être appelée que par DynamicMeshKindInfos. */ - void changeLocalIds(ArrayView items_internal, - ConstArrayView old_to_new_local_ids); + void _changeLocalIds(ArrayView items_internal, + ConstArrayView old_to_new_local_ids); + + BaseData* _lookupAdd(Int64 id, ItemInternal* value, bool& is_add) + { + return BaseClass::lookupAdd(id, value, is_add); + } }; /*---------------------------------------------------------------------------*/ /*---------------------------------------------------------------------------*/ -//! Macro pour itérer sur les valeurs d'un ItemInternalMap +/*! + * \brief Macro pour itérer sur les valeurs d'un ItemInternalMap. + * + * \deprecated Utiliser ItemInternalMap::eachItem() à la place. + */ #define ENUMERATE_ITEM_INTERNAL_MAP_DATA(iter,item_list) \ for( auto __i__##iter : item_list .buckets() ) \ for (auto* iter = __i__##iter; iter; iter = iter->next()) From 7c514ec4721c1f62e6c6f745f6f924815269fcc5 Mon Sep 17 00:00:00 2001 From: Gilles Grospellier Date: Wed, 11 Sep 2024 15:42:05 +0200 Subject: [PATCH 3/4] =?UTF-8?q?[arcane,mesh]=20Remplace=20usage=20obsol?= =?UTF-8?q?=C3=A8te=20de=20'ItemInternal::lookupValue()'.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/arcane/mesh/DynamicMeshKindInfos.cc | 6 +-- arcane/src/arcane/mesh/GhostLayerBuilder2.cc | 2 +- arcane/src/arcane/mesh/OneMeshItemAdder.cc | 48 +++++++++---------- 3 files changed, 28 insertions(+), 28 deletions(-) diff --git a/arcane/src/arcane/mesh/DynamicMeshKindInfos.cc b/arcane/src/arcane/mesh/DynamicMeshKindInfos.cc index eddd2cd986..28ee66b12f 100644 --- a/arcane/src/arcane/mesh/DynamicMeshKindInfos.cc +++ b/arcane/src/arcane/mesh/DynamicMeshKindInfos.cc @@ -192,7 +192,7 @@ itemsUniqueIdToLocalId(ArrayView ids,bool do_fatal) const if (do_fatal){ for( Integer i=0, s=ids.size(); ilocalId(); + ids[i] = m_items_map.findLocalId(unique_id); } } else{ @@ -236,7 +236,7 @@ itemsUniqueIdToLocalId(Int32ArrayView local_ids, if (do_fatal){ for( Integer i=0, s=unique_ids.size(); ilocalId(); + local_ids[i] = (unique_id == NULL_ITEM_UNIQUE_ID) ? NULL_ITEM_LOCAL_ID : m_items_map.findLocalId(unique_id); } } else{ @@ -280,7 +280,7 @@ itemsUniqueIdToLocalId(Int32ArrayView local_ids, if (do_fatal){ for( Integer i=0, s=unique_ids.size(); ilocalId(); + local_ids[i] = m_items_map.findLocalId(unique_id); } } else{ diff --git a/arcane/src/arcane/mesh/GhostLayerBuilder2.cc b/arcane/src/arcane/mesh/GhostLayerBuilder2.cc index 4aa4dc49bb..b1163b587a 100644 --- a/arcane/src/arcane/mesh/GhostLayerBuilder2.cc +++ b/arcane/src/arcane/mesh/GhostLayerBuilder2.cc @@ -728,7 +728,7 @@ _addGhostLayer(Integer current_layer,Int32ConstArrayView node_layer) ++index; Int64 nb_cell = recv_infos[index]; ++index; - Node current_node(nodes_map.lookupValue(node_uid)); + Node current_node(nodes_map.findItem(node_uid)); if (is_verbose) info() << "NODE uid=" << node_uid << " nb_cell=" << nb_cell << " idx=" << (index-2); my_cells.clear(); diff --git a/arcane/src/arcane/mesh/OneMeshItemAdder.cc b/arcane/src/arcane/mesh/OneMeshItemAdder.cc index 447f7fba64..dcb0e07aed 100644 --- a/arcane/src/arcane/mesh/OneMeshItemAdder.cc +++ b/arcane/src/arcane/mesh/OneMeshItemAdder.cc @@ -221,10 +221,10 @@ template<> Face OneMeshItemAdder:: _findInternalFace(Integer i_face, const CellInfoProxy& cell_info, bool& is_add) { - ItemInternalMap& nodes_map = m_mesh->nodesMap(); + const ItemInternalMap& nodes_map = m_mesh->nodesMap(); ItemTypeInfo* cell_type_info = cell_info.typeInfo(); const ItemTypeInfo::LocalFace& lf = cell_type_info->localFace(i_face); - ItemInternal* nbi = nodes_map.lookupValue(m_work_face_sorted_nodes[0]); + Node nbi = nodes_map.findItem(m_work_face_sorted_nodes[0]); Face face_internal = ItemTools::findFaceInNode2(nbi,lf.typeId(),m_work_face_sorted_nodes); if (face_internal.null()) { if (!cell_info.allowBuildFace()){ @@ -271,8 +271,8 @@ _findInternalEdge(Integer i_edge, const CellInfoProxy& cell_info, Int64 first_no { ARCANE_UNUSED(i_edge); - ItemInternalMap& nodes_map = m_mesh->nodesMap(); - ItemInternal* nbi = nodes_map.lookupValue(first_node); + const ItemInternalMap& nodes_map = m_mesh->nodesMap(); + Node nbi = nodes_map.findItem(first_node); Edge edge_internal = ItemTools::findEdgeInNode2(nbi,first_node,second_node); if (edge_internal.null()){ if (!cell_info.allowBuildEdge()) @@ -630,14 +630,14 @@ _addOneCell(const CellInfo& cell_info) edge_internal.mutableItemBase().setOwner(cell_info.edgeOwner(i_edge),m_mesh_info.rank()); { - ItemInternal* current_node_internal = nodes_map.lookupValue(first_node); - m_edge_family.replaceNode(ItemLocalId(edge_internal),0,ItemLocalId(current_node_internal)); - m_node_family.addEdgeToNode(current_node_internal,edge_internal); + Node current_node = nodes_map.findItem(first_node); + m_edge_family.replaceNode(ItemLocalId(edge_internal), 0, current_node); + m_node_family.addEdgeToNode(current_node, edge_internal); } { - ItemInternal* current_node_internal = nodes_map.lookupValue(second_node); - m_edge_family.replaceNode(ItemLocalId(edge_internal),1,ItemLocalId(current_node_internal)); - m_node_family.addEdgeToNode(current_node_internal,edge_internal); + Node current_node = nodes_map.findItem(second_node); + m_edge_family.replaceNode(ItemLocalId(edge_internal), 1, current_node); + m_node_family.addEdgeToNode(current_node, edge_internal); } ++m_mesh_info.nbEdge(); } @@ -666,9 +666,9 @@ _addOneCell(const CellInfo& cell_info) face.mutableItemBase().setOwner(cell_info.faceOwner(i_face),m_mesh_info.rank()); for( Integer i_node=0; i_nodehasEdge()) { @@ -899,14 +899,14 @@ addOneParentItem(const Item & item, const eItemKind submesh_kind, const bool fat edge_internal->setOwner(parent_item.owner(),m_mesh_info.rank()); { - ItemInternal* current_node_internal = nodes_map.lookupValue(first_node); - m_edge_family.replaceNode(ItemLocalId(edge_internal),0,ItemLocalId(current_node_internal)); - m_node_family.addEdgeToNode(current_node_internal,edge_internal); + Node current_node = nodes_map.findItem(first_node); + m_edge_family.replaceNode(ItemLocalId(edge_internal), 0, current_node); + m_node_family.addEdgeToNode(current_node, edge_internal); } { - ItemInternal* current_node_internal = nodes_map.lookupValue(second_node); - m_edge_family.replaceNode(ItemLocalId(edge_internal),1,ItemLocalId(current_node_internal)); - m_node_family.addEdgeToNode(current_node_internal,edge_internal); + Node current_node = nodes_map.findItem(second_node); + m_edge_family.replaceNode(ItemLocalId(edge_internal), 1, current_node); + m_node_family.addEdgeToNode(current_node, edge_internal); } ++m_mesh_info.nbEdge(); } @@ -952,14 +952,14 @@ addOneParentItem(const Item & item, const eItemKind submesh_kind, const bool fat } else if (kind==IK_Face) { if (m_mesh->dimension() == 1) { // is 1d mesh - parent_item = parent_nodes_map.lookupValue(m_work_face_sorted_nodes[0]); + parent_item = parent_nodes_map.findItem(m_work_face_sorted_nodes[0]); } else { // Algo sans CT_FaceToEdge Int64 first_node = m_work_face_sorted_nodes[0]; Int64 second_node = m_work_face_sorted_nodes[1]; if (first_node > second_node) std::swap(first_node,second_node); - ItemInternal* nbi = parent_nodes_map.lookupValue(first_node); + Node nbi = parent_nodes_map.findItem(first_node); parent_item = ItemTools::findEdgeInNode2(nbi,first_node,second_node); } } @@ -979,9 +979,9 @@ addOneParentItem(const Item & item, const eItemKind submesh_kind, const bool fat face_internal->setOwner(parent_item.owner(),m_mesh_info.rank()); for( Integer i_node=0; i_nodehasEdge()) { From 389a555c4cb8f46de6c561503d1275de2f63d0a0 Mon Sep 17 00:00:00 2001 From: Gilles Grospellier Date: Wed, 11 Sep 2024 15:51:44 +0200 Subject: [PATCH 4/4] =?UTF-8?q?[arcane,mesh]=20Ajoute=20m=C3=A9thode=20'It?= =?UTF-8?q?emInternalMap::nbBucket()'=20pour=20retourner=20le=20nombre=20d?= =?UTF-8?q?e=20bucket.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- arcane/src/arcane/mesh/DoFFamily.cc | 8 +++----- arcane/src/arcane/mesh/ItemInternalMap.h | 14 ++++++++------ arcane/src/arcane/mesh/ParticleFamily.cc | 2 +- arcane/src/arcane/mesh/PolyhedralMesh.cc | 2 +- 4 files changed, 13 insertions(+), 13 deletions(-) diff --git a/arcane/src/arcane/mesh/DoFFamily.cc b/arcane/src/arcane/mesh/DoFFamily.cc index 74b174400c..021ec54861 100644 --- a/arcane/src/arcane/mesh/DoFFamily.cc +++ b/arcane/src/arcane/mesh/DoFFamily.cc @@ -172,23 +172,21 @@ _printInfos(Integer nb_added) info() << "DoFFamily: added=" << nb_added << " nb_internal=" << infos().m_internals.size() << " nb_free=" << infos().m_free_internals.size() - << " map_nb_bucket=" << itemsMap().buckets().size() + << " map_nb_bucket=" << itemsMap().nbBucket() << " map_size=" << nb_in_map; } /*---------------------------------------------------------------------------*/ /*---------------------------------------------------------------------------*/ -void -DoFFamily:: +void DoFFamily:: preAllocate(Integer nb_item) { // Copy paste de particle, pas utilise pour l'instant - Integer nb_hash = itemsMap().buckets().size(); + Integer nb_hash = itemsMap().nbBucket(); Integer wanted_size = 2*(nb_item+infos().nbItem()); if (nb_hash buckets() const { return BaseClass::buckets(); } ARCANE_DEPRECATED_REASON("This method is internal to Arcane") @@ -166,13 +168,13 @@ class ItemInternalMap return BaseClass::lookupAdd(id, value, is_add); } - ARCANE_DEPRECATED_REASON("This method is internal to Arcane") + ARCANE_DEPRECATED_REASON("Y2024: This method is internal to Arcane") BaseData* lookupAdd(Int64 uid) { return BaseClass::lookupAdd(uid); } - ARCANE_DEPRECATED_REASON("Use findItem() instead") + ARCANE_DEPRECATED_REASON("Y2024: Use findItem() instead") ItemInternal* lookupValue(Int64 uid) const { return BaseClass::lookupValue(uid); diff --git a/arcane/src/arcane/mesh/ParticleFamily.cc b/arcane/src/arcane/mesh/ParticleFamily.cc index a42e70bdee..ae837dabb3 100644 --- a/arcane/src/arcane/mesh/ParticleFamily.cc +++ b/arcane/src/arcane/mesh/ParticleFamily.cc @@ -377,7 +377,7 @@ readFromDump() void ParticleFamily:: preAllocate(Integer nb_item) { - Integer nb_hash = itemsMap().buckets().size(); + Integer nb_hash = itemsMap().nbBucket(); Integer wanted_size = 2 * (nb_item + infos().nbItem()); if (nb_hash < wanted_size) itemsMap().resize(wanted_size, true); diff --git a/arcane/src/arcane/mesh/PolyhedralMesh.cc b/arcane/src/arcane/mesh/PolyhedralMesh.cc index 2eeb21c120..41b489fc10 100644 --- a/arcane/src/arcane/mesh/PolyhedralMesh.cc +++ b/arcane/src/arcane/mesh/PolyhedralMesh.cc @@ -94,7 +94,7 @@ namespace mesh void preAllocate(Integer nb_item) { - Integer nb_hash = itemsMap().buckets().size(); + Integer nb_hash = itemsMap().nbBucket(); Integer wanted_size = 2 * (nb_item + infos().nbItem()); if (nb_hash < wanted_size) itemsMap().resize(wanted_size, true);