Arcane  4.1.12.0
Developer documentation
Loading...
Searching...
No Matches
Arcane::mesh::ItemInternalMap Class Reference

Associative array of ItemInternal. More...

#include <arcane/mesh/ItemInternalMap.h>

Collaboration diagram for Arcane::mesh::ItemInternalMap:

Classes

class  LookupData

Public Types

using ValueType = ItemInternal*

Public Member Functions

bool add (Int64 key, ItemInternal *v)
 Adds the value v corresponding to the key key.
void clear ()
 Removes all elements from the table.
Int32 count () const
 Number of elements in the table.
void remove (Int64 key)
 Removes the value associated with the key key.
bool hasKey (Int64 key)
 true if a value with the key id is present
void resize (Int32 new_size, bool use_prime=false)
 Resizes the hash table.
void notifyUniqueIdsChanged ()
 Notifies that the unique IDs of the entities have changed.
template<class Lambda>
void eachItem (const Lambda &lambda)
 Template function to iterate over the instance's entities.
Int32 nbBucket () const
 Number of buckets.
impl::ItemBase tryFind (Int64 key) const
 Returns the entity associated with key if found, or the null entity otherwise.
Int32 tryFindLocalId (Int64 key) const
 Returns the localId() associated with key if found, or none otherwise.
impl::ItemBase findItem (Int64 uid) const
 Returns the unique ID entity uid.
Int32 findLocalId (Int64 uid) const
 Returns the local number of the unique ID entity uid.
void checkValid () const
Data * lookup (Int64 key)
const Data * lookup (Int64 key) const
ConstArrayView< BaseData * > buckets () const
BaseData * lookupAdd (Int64 id, ItemInternal *value, bool &is_add)
BaseData * lookupAdd (Int64 uid)
ItemInternallookupValue (Int64 uid) const
ItemInternaloperator[] (Int64 uid) const

Static Public Attributes

static constexpr bool UseNewImpl = 1

Private Types

using LegacyImpl = HashTableMapT<Int64, ItemInternal*>
using NewImpl = impl::HashTableMap2<Int64, ItemInternal*>
using BaseData = LegacyImpl::Data

Private Member Functions

void _changeLocalIds (ArrayView< ItemInternal * > items_internal, ConstArrayView< Int32 > old_to_new_local_ids)
 Changes the values of localId().
LookupData _lookupAdd (Int64 id, ItemInternal *value, bool &is_add)
ItemInternal_tryFindItemInternal (Int64 key) const
 Returns the entity associated with key if found, or nullptr otherwise.
void _throwNotFound ARCANE_NORETURN (Int64 id) const
void _throwNotSupported ARCANE_NORETURN (const char *func_name) const
void _checkValid (Int64 uid, ItemInternal *v) const

Private Attributes

NewImpl m_new_impl

Friends

class DynamicMeshKindInfos

Detailed Description

Associative array of ItemInternal.

This class is internal to Arcane.

The key of this associative array is the UniqueId of the entities. If it changes, you must call notifyUniqueIdsChanged() to update the associative array.

Note
All methods that use or return an 'ItemInternal*' are obsolete and should not be used.

Definition at line 52 of file ItemInternalMap.h.

Member Typedef Documentation

◆ BaseData

using Arcane::mesh::ItemInternalMap::BaseData = LegacyImpl::Data
private

Definition at line 61 of file ItemInternalMap.h.

◆ LegacyImpl

using Arcane::mesh::ItemInternalMap::LegacyImpl = HashTableMapT<Int64, ItemInternal*>
private

Definition at line 59 of file ItemInternalMap.h.

◆ NewImpl

using Arcane::mesh::ItemInternalMap::NewImpl = impl::HashTableMap2<Int64, ItemInternal*>
private

Definition at line 60 of file ItemInternalMap.h.

◆ ValueType

using Arcane::mesh::ItemInternalMap::ValueType = ItemInternal*

Definition at line 104 of file ItemInternalMap.h.

Constructor & Destructor Documentation

◆ ItemInternalMap()

Arcane::mesh::ItemInternalMap::ItemInternalMap ( )

Definition at line 33 of file ItemInternalMap.cc.

Member Function Documentation

◆ _changeLocalIds()

void Arcane::mesh::ItemInternalMap::_changeLocalIds ( ArrayView< ItemInternal * > items_internal,
ConstArrayView< Int32 > old_to_new_local_ids )
private

Changes the values of localId().

Definition at line 74 of file ItemInternalMap.cc.

References Arcane::ItemBase::localId().

Here is the call graph for this function:

◆ _checkValid()

void Arcane::mesh::ItemInternalMap::_checkValid ( Int64 uid,
ItemInternal * v ) const
private

Definition at line 124 of file ItemInternalMap.cc.

◆ _lookupAdd()

LookupData Arcane::mesh::ItemInternalMap::_lookupAdd ( Int64 id,
ItemInternal * value,
bool & is_add )
inlineprivate

Definition at line 294 of file ItemInternalMap.h.

◆ _tryFindItemInternal()

ItemInternal * Arcane::mesh::ItemInternalMap::_tryFindItemInternal ( Int64 key) const
inlineprivate

Returns the entity associated with key if found, or nullptr otherwise.

Definition at line 302 of file ItemInternalMap.h.

◆ add()

bool Arcane::mesh::ItemInternalMap::add ( Int64 key,
ItemInternal * v )
inline

Adds the value v corresponding to the key key.

If a value corresponding to id already exists, it is replaced.

Return values
trueif the key is added
falseif the key already exists and is replaced

Definition at line 120 of file ItemInternalMap.h.

Referenced by Arcane::mesh::ItemFamily::experimentalChangeUniqueId(), and Arcane::mesh::ParallelAMRConsistency::makeNewItemsConsistent().

Here is the caller graph for this function:

◆ buckets()

ConstArrayView< BaseData * > Arcane::mesh::ItemInternalMap::buckets ( ) const
inline

Definition at line 250 of file ItemInternalMap.h.

◆ checkValid()

void Arcane::mesh::ItemInternalMap::checkValid ( ) const

Definition at line 91 of file ItemInternalMap.cc.

◆ clear()

void Arcane::mesh::ItemInternalMap::clear ( )
inline

Removes all elements from the table.

Definition at line 126 of file ItemInternalMap.h.

◆ count()

Int32 Arcane::mesh::ItemInternalMap::count ( ) const
inline

Number of elements in the table.

Definition at line 132 of file ItemInternalMap.h.

Referenced by Arcane::mesh::FaceUniqueIdBuilder2::_computeSequential(), and Arcane::mesh::ItemFamily::removeNeedRemoveMarkedItems().

Here is the caller graph for this function:

◆ eachItem()

template<class Lambda>
void Arcane::mesh::ItemInternalMap::eachItem ( const Lambda & lambda)
inline

Template function to iterate over the instance's entities.

The type of the template argument can be any type of entity that can be constructed from an impl::ItemBase.

ItemInternalMap item_map = ...
item_map.eachItem([&](Item item){
std::cout << "LID=" << item_base.localId() << "\n";
});
Base class for a mesh element.
Definition Item.h:84

Definition at line 181 of file ItemInternalMap.h.

Referenced by Arcane::mesh::FaceUniqueIdBuilder2::_checkFacesUniqueId(), Arcane::mesh::FaceUniqueIdBuilder::_checkNoDuplicate(), Arcane::mesh::FaceUniqueIdBuilder2::_computeAndSortBoundaryFaces(), Arcane::mesh::EdgeUniqueIdBuilder::_computeEdgesUniqueIdsSequential(), Arcane::mesh::FaceUniqueIdBuilder::_computeFacesUniqueIdsParallelV1(), Arcane::mesh::FaceUniqueIdBuilder::_computeFacesUniqueIdsParallelV2(), Arcane::mesh::FaceUniqueIdBuilder::_computeFacesUniqueIdsSequential(), Arcane::mesh::FaceUniqueIdBuilder2::_computeParallel(), Arcane::mesh::FaceUniqueIdBuilder2::_computeSequential(), Arcane::mesh::MeshRefinement::_contract(), Arcane::mesh::SubMeshTools::_fillGhostItems(), Arcane::mesh::GhostLayerBuilder2::_markBoundaryItems(), Arcane::mesh::GhostLayerBuilder2::_markBoundaryNodes(), Arcane::mesh::FaceUniqueIdBuilder2::_unsetFacesUniqueId(), Arcane::mesh::GhostLayerBuilder::addGhostChildFromParent(), Arcane::mesh::GhostLayerBuilder2::addGhostLayers(), Arcane::mesh::Parallel3EdgeUniqueIdBuilder::compute(), Arcane::mesh::CartesianFaceUniqueIdBuilder::computeFacesUniqueIdAndOwner(), Arcane::mesh::FaceUniqueIdBuilder2::computeFacesUniqueIdAndOwnerVersion5(), Arcane::mesh::ParallelAMRConsistency::makeNewItemsConsistent2(), notifyUniqueIdsChanged(), Arcane::mesh::DynamicMeshIncrementalBuilder::removeNeedRemoveMarkedItems(), Arcane::mesh::ItemFamily::removeNeedRemoveMarkedItems(), and Arcane::mesh::ParticleFamily::removeNeedRemoveMarkedItems().

Here is the caller graph for this function:

◆ findItem()

impl::ItemBase Arcane::mesh::ItemInternalMap::findItem ( Int64 uid) const
inline

Returns the unique ID entity uid.

Throws an exception if the entity is not in the table.

Definition at line 212 of file ItemInternalMap.h.

Referenced by Arcane::mesh::OneMeshItemAdder::_addOneCell(), Arcane::mesh::GhostLayerBuilder::addGhostChildFromParent(), Arcane::mesh::OneMeshItemAdder::addOneParentItem(), and Arcane::mesh::ParallelAMRConsistency::makeNewItemsConsistent().

Here is the caller graph for this function:

◆ findLocalId()

Int32 Arcane::mesh::ItemInternalMap::findLocalId ( Int64 uid) const
inline

Returns the local number of the unique ID entity uid.

Throws an exception if the entity is not in the table.

Definition at line 225 of file ItemInternalMap.h.

◆ hasKey()

bool Arcane::mesh::ItemInternalMap::hasKey ( Int64 key)
inline

true if a value with the key id is present

Definition at line 151 of file ItemInternalMap.h.

Referenced by Arcane::mesh::FaceUniqueIdBuilder::_computeFacesUniqueIdsParallelV1().

Here is the caller graph for this function:

◆ lookup() [1/2]

Data * Arcane::mesh::ItemInternalMap::lookup ( Int64 key)
inline

Definition at line 238 of file ItemInternalMap.h.

◆ lookup() [2/2]

const Data * Arcane::mesh::ItemInternalMap::lookup ( Int64 key) const
inline

Definition at line 244 of file ItemInternalMap.h.

◆ lookupAdd() [1/2]

BaseData * Arcane::mesh::ItemInternalMap::lookupAdd ( Int64 id,
ItemInternal * value,
bool & is_add )
inline

Definition at line 256 of file ItemInternalMap.h.

◆ lookupAdd() [2/2]

BaseData * Arcane::mesh::ItemInternalMap::lookupAdd ( Int64 uid)
inline

Definition at line 264 of file ItemInternalMap.h.

◆ lookupValue()

ItemInternal * Arcane::mesh::ItemInternalMap::lookupValue ( Int64 uid) const
inline

Definition at line 270 of file ItemInternalMap.h.

◆ nbBucket()

Int32 Arcane::mesh::ItemInternalMap::nbBucket ( ) const
inline

Number of buckets.

Definition at line 187 of file ItemInternalMap.h.

◆ notifyUniqueIdsChanged()

void Arcane::mesh::ItemInternalMap::notifyUniqueIdsChanged ( )

Notifies that the unique IDs of the entities have changed.

This call may cause a complete recalculation of the associative array.

Definition at line 41 of file ItemInternalMap.cc.

References ARCANE_FATAL, Arcane::arcaneIsCheck(), eachItem(), Arcane::Item::uniqueId(), and Arcane::ItemBase::uniqueId().

Referenced by Arcane::mesh::ParallelAMRConsistency::makeNewItemsConsistent2().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ operator[]()

ItemInternal * Arcane::mesh::ItemInternalMap::operator[] ( Int64 uid) const
inline

Definition at line 276 of file ItemInternalMap.h.

◆ remove()

void Arcane::mesh::ItemInternalMap::remove ( Int64 key)
inline

Removes the value associated with the key key.

Throws an exception if there are no values associated with the key

Definition at line 142 of file ItemInternalMap.h.

Referenced by Arcane::mesh::ItemFamily::experimentalChangeUniqueId(), and Arcane::mesh::ParallelAMRConsistency::makeNewItemsConsistent().

Here is the caller graph for this function:

◆ resize()

void Arcane::mesh::ItemInternalMap::resize ( Int32 new_size,
bool use_prime = false )
inline

Resizes the hash table.

Definition at line 157 of file ItemInternalMap.h.

◆ tryFind()

impl::ItemBase Arcane::mesh::ItemInternalMap::tryFind ( Int64 key) const
inline

Returns the entity associated with key if found, or the null entity otherwise.

Definition at line 195 of file ItemInternalMap.h.

Referenced by Arcane::mesh::FaceUniqueIdBuilder::_computeFacesUniqueIdsParallelV1(), and Arcane::mesh::FaceUniqueIdBuilder::_computeFacesUniqueIdsParallelV2().

Here is the caller graph for this function:

◆ tryFindLocalId()

Int32 Arcane::mesh::ItemInternalMap::tryFindLocalId ( Int64 key) const
inline

Returns the localId() associated with key if found, or none otherwise.

Definition at line 201 of file ItemInternalMap.h.

◆ DynamicMeshKindInfos

friend class DynamicMeshKindInfos
friend

Definition at line 55 of file ItemInternalMap.h.

Member Data Documentation

◆ m_new_impl

NewImpl Arcane::mesh::ItemInternalMap::m_new_impl
private

Definition at line 283 of file ItemInternalMap.h.

◆ UseNewImpl

bool Arcane::mesh::ItemInternalMap::UseNewImpl = 1
staticconstexpr

Definition at line 65 of file ItemInternalMap.h.


The documentation for this class was generated from the following files: