Mesh information for a given entity kind. More...
#include <arcane/mesh/DynamicMeshKindInfos.h>
Public Types | |
| typedef Arcane::mesh::ItemInternalMap | ItemInternalMap |
Public Member Functions | |
| DynamicMeshKindInfos (IMesh *mesh, eItemKind kind, const String &kind_name) | |
| Creates an instance for a given mesh and kind. | |
| ~DynamicMeshKindInfos () | |
| Frees resources. | |
| void | build () |
| void | finalizeMeshChanged () |
| Reallocates and recalculates structures after mesh modification. | |
| Integer | maxUsedLocalId () const |
| Largest local ID used. | |
| void | prepareForDump () |
| Prepares variables for dumps. | |
| void | readFromDump () |
| Restores info from dumps. | |
| ItemGroup | allItems () const |
| Group of all entities. | |
| Int32ConstArrayView | addedItems () const |
| List of entities added or removed since the last endUpdate(). | |
| Int32ConstArrayView | removedItems () const |
| ConstArrayView< ItemInternal * > | itemsInternal () const |
| Internal list of ItemInternals. | |
| ItemInternal * | itemInternal (Int32 local_id) const |
| ItemInternal * | allocOne (Int64 unique_id) |
| Adds an entity with a unique ID unique_id. | |
| ItemInternal * | allocOne (Int64 unique_id, bool &need_alloc) |
| Adds an entity with a unique ID unique_id. | |
| void | removeOne (ItemInternal *item) |
| Removes the entity item. | |
| void | removeDetachedOne (ItemInternal *item) |
| Removes the detached entity item. | |
| void | detachOne (ItemInternal *item) |
| Detaches the entity item. | |
| void | removeMany (Int32ConstArrayView local_ids) |
| Removes a list of entities. | |
| ItemInternal * | findOrAllocOne (Int64 uid, bool &is_alloc) |
| Finds the entity with unique ID unique_id and creates it if it does not exist. | |
| ItemInternal * | findOne (Int64 uid) |
| Finds the entity with unique ID uid. | |
| void | checkValid () |
| Checks if the internal structures of the instance are valid. | |
| ItemInternalMap & | itemsMap () |
| Integer | nbItem () const |
| eItemKind | kind () const |
| bool | changed () const |
| void | beginCompactItems (ItemFamilyCompactInfos &compact_infos) |
| Calculates the new local IDs of the entities so that they are consecutive. | |
| ARCANE_DEPRECATED_240 Int32ConstArrayView | oldToNewLocalIds () const |
| Conversion between old and new local IDs. | |
| void | allocMany (Int64ConstArrayView uids, Int32ArrayView lids) |
| Allocates every item of uids at once, returning their localIds. | |
| bool | hasNoItemInternal () const |
| Whether the family holds no ItemInternal at all. | |
| void | clear () |
| Removes all entities. | |
| ARCANE_DEPRECATED_240 Int32ConstArrayView | newToOldLocalIds () const |
| Conversion between new and old local IDs. | |
| void | finishCompactItems (ItemFamilyCompactInfos &compact_infos) |
| void | itemsUniqueIdToLocalId (ArrayView< Int64 > ids, bool do_fatal) const |
| void | itemsUniqueIdToLocalId (Int32ArrayView local_ids, Int64ConstArrayView unique_ids, bool do_fatal) const |
| void | itemsUniqueIdToLocalId (Int32ArrayView local_ids, ConstArrayView< ItemUniqueId > unique_ids, bool do_fatal) const |
| ItemFamily * | itemFamily () const |
| void | setItemFamily (ItemFamily *item_family) |
| bool | hasUniqueIdMap () const |
| void | setHasUniqueIdMap (bool v) |
| void | printFreeInternals (Integer max_print) |
| EventObservableView< const ItemFamilyItemListChangedEventArgs & > | itemListChangedEvent () |
| Public Member Functions inherited from Arcane::TraceAccessor | |
| TraceAccessor (ITraceMng *m) | |
| Constructs an accessor via the trace manager m. | |
| TraceAccessor (const TraceAccessor &rhs) | |
| Copy constructor. | |
| TraceAccessor & | operator= (const TraceAccessor &rhs) |
| Copy assignment operator. | |
| virtual | ~TraceAccessor () |
| Frees resources. | |
| ITraceMng * | traceMng () const |
| Trace manager. | |
| TraceMessage | info () const |
| Flow for an information message. | |
| TraceMessage | pinfo () const |
| Flow for a parallel information message. | |
| TraceMessage | info (char category) const |
| Flow for an information message of a given category. | |
| TraceMessage | pinfo (char category) const |
| Flow for a parallel information message of a given category. | |
| TraceMessage | info (bool v) const |
| Flow for an information message. | |
| TraceMessage | warning () const |
| Flow for a warning message. | |
| TraceMessage | pwarning () const |
| TraceMessage | error () const |
| Flow for an error message. | |
| TraceMessage | perror () const |
| TraceMessage | log () const |
| Flow for a log message. | |
| TraceMessage | plog () const |
| Flow for a log message. | |
| TraceMessage | logdate () const |
| Flow for a log message preceded by the date. | |
| TraceMessage | fatal () const |
| Flow for a fatal error message. | |
| TraceMessage | pfatal () const |
| Flow for a parallel fatal error message. | |
| TraceMessageDbg | debug (Trace::eDebugLevel=Trace::Medium) const |
| Flow for a debug message. | |
| Trace::eDebugLevel | configDbgLevel () const |
| Debug level of the configuration file. | |
| TraceMessage | info (Int32 verbose_level) const |
| Flow for an information message of a given level. | |
| TraceMessage | linfo () const |
| Flow for an information message with the local information level of this instance. | |
| TraceMessage | linfo (Int32 relative_level) const |
| Flow for an information message with the local information level of this instance. | |
| void | fatalMessage (const StandaloneTraceMessage &o) const |
Public Attributes | |
| UniqueArray< ItemInternal * > | m_internals |
| ItemInternals of the entities. | |
| Int32UniqueArray | m_free_internals |
| List of free ItemInternals from m_item_internals_buffer. | |
| UniqueArray< ItemInternal * > | m_free_internals_in_multi_buffer |
Private Types | |
| using | ItemInternalMapData = ItemInternalMap::BaseData |
Private Member Functions | |
| ItemInternal * | _allocOne (bool &need_alloc) |
| Adds an entity. | |
| void | _setSuppressed (ItemInternal *item) |
| void | _setAdded (ItemInternal *item) |
| void | _checkActiveItem (ItemInternal *item) |
| void | _dumpList () |
| void | _badSameUniqueId (Int64 unique_id) const |
| void | _badUniqueIdMap () const |
| void | _updateItemSharedInfoInternalView () |
| void | _notifyRemove (ItemInternal *item) |
| void | _notifyAdd (ItemInternal *item, Int64 uid) |
| void | _notifyRemove2 (ItemInternal *item) |
| void | _notifyAdd2 (ItemInternal *item, Int64 uid) |
Private Attributes | |
| IMesh * | m_mesh |
| Associated mesh. | |
| ItemFamily * | m_item_family |
| Associated mesh family. | |
| eItemKind | m_kind |
| Corresponding kind. | |
| String | m_kind_name |
| Name of the entity kind (Node, Cell, ...). | |
| String | m_all_group_name |
| Name of the group containing all entities. | |
| ItemInternalMap | m_items_map |
| Hash table for uniqueId() -> ItemInternal* conversion. | |
| ItemGroup | m_all_group |
| Integer | m_nb_item |
| Group of all entities. | |
| bool | m_is_verbose |
| Int32UniqueArray | m_added_items |
| Int32UniqueArray | m_removed_items |
| bool | m_use_new_finalize |
| bool | m_is_first_finalize |
| bool | m_has_unique_id_map |
| ItemFamilyCompactInfos * | m_compact_infos |
| Temporary while oldToNewLocalIds() and newToOldLocalIds() exist. | |
| ItemSharedInfo * | m_common_item_shared_info = nullptr |
| EventObservable< const ItemFamilyItemListChangedEventArgs & > | m_item_list_change_event |
| MultiBufferT< ItemInternal > * | m_item_internals_buffer |
| Buffer to store an instance of ItemInternal. | |
Additional Inherited Members | |
| Protected Member Functions inherited from Arcane::TraceAccessor | |
| void | _setLocalVerboseLevel (Int32 v) |
| Int32 | _localVerboseLevel () const |
Mesh information for a given entity kind.
An instance of this class manages all mesh structures for a given entity kind.
Definition at line 50 of file DynamicMeshKindInfos.h.
| typedef Arcane::mesh::ItemInternalMap Arcane::mesh::DynamicMeshKindInfos::ItemInternalMap |
Definition at line 56 of file DynamicMeshKindInfos.h.
|
private |
Definition at line 60 of file DynamicMeshKindInfos.h.
| Arcane::mesh::DynamicMeshKindInfos::DynamicMeshKindInfos | ( | IMesh * | mesh, |
| eItemKind | kind, | ||
| const String & | kind_name ) |
Creates an instance for a given mesh and kind.
Definition at line 49 of file DynamicMeshKindInfos.cc.
References m_compact_infos, m_item_family, m_item_internals_buffer, m_kind, m_kind_name, m_mesh, m_nb_item, Arcane::TraceAccessor::TraceAccessor(), and Arcane::TraceAccessor::traceMng().
| Arcane::mesh::DynamicMeshKindInfos::~DynamicMeshKindInfos | ( | ) |
Frees resources.
Definition at line 69 of file DynamicMeshKindInfos.cc.
References m_item_internals_buffer.
|
inlineprivate |
Adds an entity.
Definition at line 310 of file DynamicMeshKindInfos.h.
References Arcane::ItemBase::localId(), m_free_internals, m_internals, m_item_internals_buffer, and m_nb_item.
Referenced by allocOne(), allocOne(), and findOrAllocOne().
|
private |
Definition at line 930 of file DynamicMeshKindInfos.cc.
|
private |
Definition at line 940 of file DynamicMeshKindInfos.cc.
|
private |
Definition at line 895 of file DynamicMeshKindInfos.cc.
|
private |
Definition at line 906 of file DynamicMeshKindInfos.cc.
|
inlineprivate |
Definition at line 406 of file DynamicMeshKindInfos.h.
|
private |
Definition at line 992 of file DynamicMeshKindInfos.cc.
|
inlineprivate |
Definition at line 401 of file DynamicMeshKindInfos.h.
|
private |
Definition at line 981 of file DynamicMeshKindInfos.cc.
|
inlineprivate |
Definition at line 388 of file DynamicMeshKindInfos.h.
|
inlineprivate |
Definition at line 380 of file DynamicMeshKindInfos.h.
|
private |
Definition at line 962 of file DynamicMeshKindInfos.cc.
|
inline |
List of entities added or removed since the last endUpdate().
Definition at line 96 of file DynamicMeshKindInfos.h.
|
inline |
Group of all entities.
Definition at line 93 of file DynamicMeshKindInfos.h.
| void Arcane::mesh::DynamicMeshKindInfos::allocMany | ( | Int64ConstArrayView | uids, |
| Int32ArrayView | lids ) |
Allocates every item of uids at once, returning their localIds.
Same result as calling allocOne() for each uid, without the per-item republication of the ItemInternal views: those are updated once, at the end. Only valid on a family holding no freed item, since the localIds it hands out are consecutive.
Definition at line 104 of file DynamicMeshKindInfos.cc.
References ARCANE_FATAL, m_free_internals, m_internals, m_item_internals_buffer, m_items_map, m_nb_item, and Arcane::ConstArrayView< T >::size().
|
inline |
Adds an entity with a unique ID unique_id.
Definition at line 106 of file DynamicMeshKindInfos.h.
References _allocOne(), and m_items_map.
|
inline |
Adds an entity with a unique ID unique_id.
Definition at line 120 of file DynamicMeshKindInfos.h.
References _allocOne(), and m_items_map.
| void Arcane::mesh::DynamicMeshKindInfos::beginCompactItems | ( | ItemFamilyCompactInfos & | compact_infos | ) |
Calculates the new local IDs of the entities so that they are consecutive.
If do_sort is true, the entities are sorted such that their unique id and local id are in ascending order.
Before calling this function, the mesh must be valid and finalized
After calling this function, the oldToNewLocalIds() and newToOldLocalIds() arrays are populated and contain the conversions between new and old local numbers.
Definition at line 525 of file DynamicMeshKindInfos.cc.
References ARCANE_FATAL, Arcane::arcaneIsCheck(), checkValid(), Arcane::Array< T >::data(), Arcane::TraceAccessor::debug(), Arcane::Array< T >::fill(), Arcane::TraceAccessor::info(), Arcane::IMeshCompacter::isSorted(), Arcane::Timer::lastActivationTime(), m_compact_infos, m_internals, m_item_family, m_kind_name, m_mesh, m_nb_item, maxUsedLocalId(), Arcane::IItemInternalSortFunction::name(), Arcane::AbstractArray< T >::size(), Arcane::IItemInternalSortFunction::sortItems(), and Arcane::Timer::TimerReal.
| void Arcane::mesh::DynamicMeshKindInfos::build | ( | ) |
Definition at line 78 of file DynamicMeshKindInfos.cc.
|
inline |
Definition at line 231 of file DynamicMeshKindInfos.h.
| void Arcane::mesh::DynamicMeshKindInfos::checkValid | ( | ) |
Checks if the internal structures of the instance are valid.
Definition at line 392 of file DynamicMeshKindInfos.cc.
References ARCANE_FATAL, Arcane::TraceAccessor::debug(), Arcane::TraceAccessor::error(), Arcane::ItemBase::isOwn(), Arcane::ItemBase::isSuppressed(), Arcane::ItemBase::localId(), m_free_internals, m_internals, m_kind_name, m_mesh, m_nb_item, Arcane::ItemBase::owner(), and Arcane::ItemBase::uniqueId().
Referenced by beginCompactItems(), and finalizeMeshChanged().
| void Arcane::mesh::DynamicMeshKindInfos::clear | ( | ) |
Removes all entities.
Definition at line 808 of file DynamicMeshKindInfos.cc.
References removeMany().
|
inline |
Detaches the entity item.
The entity is removed from the list of uniqueIds() if the REMOVE_UID_ON_DETACH macro is defined
Definition at line 177 of file DynamicMeshKindInfos.h.
References m_items_map, Arcane::MutableItemBase::setDetached(), and Arcane::ItemBase::uniqueId().
| void Arcane::mesh::DynamicMeshKindInfos::finalizeMeshChanged | ( | ) |
Reallocates and recalculates structures after mesh modification.
Specifically injects the added and removed items into the total group of current all_items. Changes are made directly on this group without protection.
Definition at line 151 of file DynamicMeshKindInfos.cc.
References Arcane::arcaneIsCheck(), checkValid(), Arcane::IParallelMng::commRank(), Arcane::TraceAccessor::info(), Arcane::IParallelMng::isParallel(), Arcane::ItemBase::isSuppressed(), Arcane::ItemBase::localId(), m_internals, m_item_family, m_kind_name, m_mesh, m_nb_item, maxUsedLocalId(), Arcane::ItemBase::owner(), Arcane::TraceAccessor::traceMng(), and Arcane::ItemBase::uniqueId().
|
inline |
Finds the entity with unique ID uid.
Definition at line 213 of file DynamicMeshKindInfos.h.
References m_items_map.
|
inline |
Finds the entity with unique ID unique_id and creates it if it does not exist.
Definition at line 195 of file DynamicMeshKindInfos.h.
References _allocOne(), and m_items_map.
| void Arcane::mesh::DynamicMeshKindInfos::finishCompactItems | ( | ItemFamilyCompactInfos & | compact_infos | ) |
Definition at line 677 of file DynamicMeshKindInfos.cc.
|
inline |
Whether the family holds no ItemInternal at all.
Not the same as nbItem()==0: a deallocated or emptied family keeps its ItemInternal slots on a free list, and the localIds allocMany() hands out would then not start at 0.
Definition at line 263 of file DynamicMeshKindInfos.h.
References m_free_internals, and m_internals.
|
inline |
Definition at line 293 of file DynamicMeshKindInfos.h.
|
inline |
Definition at line 286 of file DynamicMeshKindInfos.h.
|
inline |
Definition at line 103 of file DynamicMeshKindInfos.h.
| EventObservableView< const ItemFamilyItemListChangedEventArgs & > Arcane::mesh::DynamicMeshKindInfos::itemListChangedEvent | ( | ) |
Definition at line 972 of file DynamicMeshKindInfos.cc.
|
inline |
Internal list of ItemInternals.
Read-only; the write version was removed as indicated in todo
Definition at line 101 of file DynamicMeshKindInfos.h.
References m_internals.
|
inline |
Definition at line 225 of file DynamicMeshKindInfos.h.
| void Arcane::mesh::DynamicMeshKindInfos::itemsUniqueIdToLocalId | ( | ArrayView< Int64 > | ids, |
| bool | do_fatal ) const |
Definition at line 235 of file DynamicMeshKindInfos.cc.
| void Arcane::mesh::DynamicMeshKindInfos::itemsUniqueIdToLocalId | ( | Int32ArrayView | local_ids, |
| ConstArrayView< ItemUniqueId > | unique_ids, | ||
| bool | do_fatal ) const |
Definition at line 322 of file DynamicMeshKindInfos.cc.
| void Arcane::mesh::DynamicMeshKindInfos::itemsUniqueIdToLocalId | ( | Int32ArrayView | local_ids, |
| Int64ConstArrayView | unique_ids, | ||
| bool | do_fatal ) const |
Definition at line 278 of file DynamicMeshKindInfos.cc.
|
inline |
Definition at line 229 of file DynamicMeshKindInfos.h.
|
inline |
Largest local ID used.
This number is used to allocate variable arrays on the mesh entities.
Definition at line 84 of file DynamicMeshKindInfos.h.
References m_internals.
Referenced by beginCompactItems(), and finalizeMeshChanged().
|
inline |
Definition at line 227 of file DynamicMeshKindInfos.h.
| Int32ConstArrayView Arcane::mesh::DynamicMeshKindInfos::newToOldLocalIds | ( | ) | const |
Conversion between new and old local IDs.
This method is only valid after calling beginCompactItems() and before finishCompactItems().
Definition at line 502 of file DynamicMeshKindInfos.cc.
References m_compact_infos.
| Int32ConstArrayView Arcane::mesh::DynamicMeshKindInfos::oldToNewLocalIds | ( | ) | const |
Conversion between old and new local IDs.
This method is only valid after calling beginCompactItems() and before finishCompactItems().
Definition at line 491 of file DynamicMeshKindInfos.cc.
References m_compact_infos.
| void Arcane::mesh::DynamicMeshKindInfos::prepareForDump | ( | ) |
Prepares variables for dumps.
Definition at line 366 of file DynamicMeshKindInfos.cc.
| void Arcane::mesh::DynamicMeshKindInfos::printFreeInternals | ( | Integer | max_print | ) |
Definition at line 826 of file DynamicMeshKindInfos.cc.
| void Arcane::mesh::DynamicMeshKindInfos::readFromDump | ( | ) |
Restores info from dumps.
Definition at line 374 of file DynamicMeshKindInfos.cc.
References m_all_group_name, m_free_internals, m_internals, m_item_internals_buffer, m_items_map, m_mesh, and m_nb_item.
|
inline |
Removes the detached entity item.
Definition at line 153 of file DynamicMeshKindInfos.h.
References Arcane::ItemBase::localId(), m_free_internals, m_items_map, m_nb_item, and Arcane::ItemBase::uniqueId().
|
inline |
Definition at line 97 of file DynamicMeshKindInfos.h.
| void Arcane::mesh::DynamicMeshKindInfos::removeMany | ( | Int32ConstArrayView | local_ids | ) |
Removes a list of entities.
Definition at line 843 of file DynamicMeshKindInfos.cc.
References Arcane::ConstArrayView< T >::data(), m_free_internals, m_internals, m_item_family, m_items_map, m_nb_item, and Arcane::ConstArrayView< T >::size().
Referenced by clear().
|
inline |
Removes the entity item.
Definition at line 133 of file DynamicMeshKindInfos.h.
References Arcane::ItemBase::localId(), m_free_internals, m_items_map, m_nb_item, and Arcane::ItemBase::uniqueId().
| void Arcane::mesh::DynamicMeshKindInfos::setHasUniqueIdMap | ( | bool | v | ) |
Definition at line 884 of file DynamicMeshKindInfos.cc.
| void Arcane::mesh::DynamicMeshKindInfos::setItemFamily | ( | ItemFamily * | item_family | ) |
Definition at line 952 of file DynamicMeshKindInfos.cc.
|
private |
Definition at line 352 of file DynamicMeshKindInfos.h.
|
private |
Definition at line 349 of file DynamicMeshKindInfos.h.
|
private |
Name of the group containing all entities.
Definition at line 347 of file DynamicMeshKindInfos.h.
Referenced by readFromDump().
|
private |
Definition at line 359 of file DynamicMeshKindInfos.h.
|
private |
Temporary while oldToNewLocalIds() and newToOldLocalIds() exist.
Definition at line 358 of file DynamicMeshKindInfos.h.
Referenced by beginCompactItems(), DynamicMeshKindInfos(), newToOldLocalIds(), and oldToNewLocalIds().
| Int32UniqueArray Arcane::mesh::DynamicMeshKindInfos::m_free_internals |
List of free ItemInternals from m_item_internals_buffer.
List of freed ItemInternals from m_internals
Definition at line 365 of file DynamicMeshKindInfos.h.
Referenced by _allocOne(), allocMany(), checkValid(), hasNoItemInternal(), readFromDump(), removeDetachedOne(), removeMany(), and removeOne().
| UniqueArray<ItemInternal*> Arcane::mesh::DynamicMeshKindInfos::m_free_internals_in_multi_buffer |
Definition at line 367 of file DynamicMeshKindInfos.h.
|
private |
Definition at line 356 of file DynamicMeshKindInfos.h.
| UniqueArray<ItemInternal*> Arcane::mesh::DynamicMeshKindInfos::m_internals |
ItemInternals of the entities.
Definition at line 364 of file DynamicMeshKindInfos.h.
Referenced by _allocOne(), allocMany(), beginCompactItems(), checkValid(), finalizeMeshChanged(), hasNoItemInternal(), itemsInternal(), maxUsedLocalId(), readFromDump(), and removeMany().
|
private |
Definition at line 355 of file DynamicMeshKindInfos.h.
|
private |
Definition at line 351 of file DynamicMeshKindInfos.h.
|
private |
Associated mesh family.
Definition at line 344 of file DynamicMeshKindInfos.h.
Referenced by beginCompactItems(), DynamicMeshKindInfos(), finalizeMeshChanged(), and removeMany().
|
private |
Buffer to store an instance of ItemInternal.
Definition at line 376 of file DynamicMeshKindInfos.h.
Referenced by _allocOne(), allocMany(), DynamicMeshKindInfos(), readFromDump(), and ~DynamicMeshKindInfos().
|
private |
Definition at line 360 of file DynamicMeshKindInfos.h.
|
private |
Hash table for uniqueId() -> ItemInternal* conversion.
Definition at line 348 of file DynamicMeshKindInfos.h.
Referenced by allocMany(), allocOne(), allocOne(), detachOne(), findOne(), findOrAllocOne(), readFromDump(), removeDetachedOne(), removeMany(), and removeOne().
|
private |
Corresponding kind.
Definition at line 345 of file DynamicMeshKindInfos.h.
Referenced by DynamicMeshKindInfos().
|
private |
Name of the entity kind (Node, Cell, ...).
Definition at line 346 of file DynamicMeshKindInfos.h.
Referenced by beginCompactItems(), checkValid(), DynamicMeshKindInfos(), and finalizeMeshChanged().
|
private |
Associated mesh.
Definition at line 343 of file DynamicMeshKindInfos.h.
Referenced by beginCompactItems(), checkValid(), DynamicMeshKindInfos(), finalizeMeshChanged(), and readFromDump().
|
private |
Group of all entities.
Number of allocated entities
Definition at line 350 of file DynamicMeshKindInfos.h.
Referenced by _allocOne(), allocMany(), beginCompactItems(), checkValid(), DynamicMeshKindInfos(), finalizeMeshChanged(), readFromDump(), removeDetachedOne(), removeMany(), and removeOne().
|
private |
Definition at line 353 of file DynamicMeshKindInfos.h.
|
private |
Definition at line 354 of file DynamicMeshKindInfos.h.