Incremental item->item[] connectivity. More...
#include <arcane/mesh/IncrementalItemConnectivity.h>
Public Member Functions | |
| IncrementalItemConnectivity (IItemFamily *source_family, IItemFamily *target_family, const String &aname) | |
| void | addConnectedItems (ItemLocalId source_item, Integer nb_item) |
| void | setConnectedItems (ItemLocalId source_item, Int32ConstArrayView target_local_ids) override |
| Allocates and positions entities connected to source_item. | |
| void | setBulkConnectivity (Int32ConstArrayView nb_items, Int32ConstArrayView indexes, Int32ConstArrayView list) |
| Replaces the whole connectivity with one the caller already knows. | |
| void | resizeBulkConnectivity (Int32 nb_source, Int64 list_size, Int32ArrayView &nb_items, Int32ArrayView &indexes, Int32ArrayView &list) |
| Sizes the storage for a bulk fill and hands out the arrays to write. | |
| void | endBulkConnectivity () |
| Closes a fill started by resizeBulkConnectivity(). | |
| void | removeConnectedItems (ItemLocalId source_item) override |
| Removes all entities connected to source_item. | |
| void | addConnectedItem (ItemLocalId source_item, ItemLocalId target_local_id) override |
| Adds the entity with localId() target_local_id to the connectivity of source_item. | |
| void | removeConnectedItem (ItemLocalId source_item, ItemLocalId target_local_id) override |
| Removes the entity with localId() target_local_id from the connectivity of source_item. | |
| void | replaceConnectedItem (ItemLocalId source_item, Integer index, ItemLocalId target_local_id) override |
| Replaces the entity at index index of source_item with the entity with localId() target_local_id. | |
| void | replaceConnectedItems (ItemLocalId source_item, Int32ConstArrayView target_local_ids) override |
| Replaces the entities of source_item with the entities with localId() target_local_ids. | |
| bool | hasConnectedItem (ItemLocalId source_item, ItemLocalId target_local_id) const override |
| Tests the existence of a connectivity between source_item and the entity with localId() target_local_id. | |
| void | notifySourceItemAdded (ItemLocalId item) override |
| Notifies the connectivity that an entity has been added to the source family. | |
| void | notifyReadFromDump () override |
| Notifies the connectivity that a read has been performed from a dump. | |
| Integer | preAllocatedSize () const final |
| Number of entities pre-allocated for the connectivity of each entity. | |
| void | setPreAllocatedSize (Integer value) final |
| Sets the number of entities to pre-allocate for the connectivity of each entity. | |
| void | dumpStats (std::ostream &out) const override |
| Dumps statistics on usage and memory used to the stream out. | |
| void | compactConnectivityList () |
| Compresses the connectivity list. | |
| Public Member Functions inherited from Arcane::mesh::IncrementalItemConnectivityBase | |
| IncrementalItemConnectivityBase (IItemFamily *source_family, IItemFamily *target_family, const String &aname) | |
| IncrementalItemConnectivityBase (const IncrementalItemConnectivityBase &)=delete | |
| IncrementalItemConnectivityBase (IncrementalItemConnectivityBase &&)=delete | |
| IncrementalItemConnectivityBase & | operator= (const IncrementalItemConnectivityBase &)=delete |
| IncrementalItemConnectivityBase & | operator= (IncrementalItemConnectivityBase &&)=delete |
| void | notifySourceFamilyLocalIdChanged (Int32ConstArrayView new_to_old_ids) override |
| Notifies the connectivity that the source family has been compacted. | |
| void | notifyTargetFamilyLocalIdChanged (Int32ConstArrayView old_to_new_ids) override |
| Notifies the connectivity that the target family has been compacted. | |
| Integer | nbConnectedItem (ItemLocalId lid) const final |
| Number of entities connected to the source entity with local ID lid. | |
| Int32 | connectedItemLocalId (ItemLocalId lid, Integer index) const final |
| localId() of the index-th entity connected to the source entity with local ID lid | |
| IndexedItemConnectivityViewBase | connectivityView () const |
| IndexedItemConnectivityAccessor | connectivityAccessor () const |
| ItemConnectivityContainerView | connectivityContainerView () const |
| Int32 | maxNbConnectedItem () const override |
| Maximum number of entities connected to a source entity. | |
| void | reserveMemoryForNbSourceItems (Int32 n, bool pre_alloc_connectivity) override |
| Reserves memory for n source entities. | |
| IIncrementalItemConnectivityInternal * | _internalApi () override |
| Internal Arcane API. | |
| Int32ConstArrayView | _connectedItemsLocalId (ItemLocalId lid) const |
| Int32ArrayView | _connectedItemsLocalId (ItemLocalId lid) |
| Int32ArrayView | connectivityIndex () |
| Int32ArrayView | connectivityList () |
| void | setItemConnectivityList (ItemInternalConnectivityList *ilist, Int32 index) |
| Indicates that this connectivity is associated with one of the connectivities of ItemInternal. | |
| void | dumpInfos () |
| Public Member Functions inherited from Arcane::mesh::AbstractIncrementalItemConnectivity | |
| AbstractIncrementalItemConnectivity (IItemFamily *source_family, IItemFamily *target_family, const String &connectivity_name) | |
| String | name () const final |
| Name of the connectivity. | |
| ConstArrayView< IItemFamily * > | families () const override |
| List of families (sourceFamily() + targetFamily()). | |
| IItemFamily * | sourceFamily () const override |
| Source family. | |
| IItemFamily * | targetFamily () const override |
| Target family. | |
| Ref< IIncrementalItemSourceConnectivity > | toSourceReference () override |
| Returns a reference to the instance. | |
| Ref< IIncrementalItemTargetConnectivity > | toTargetReference () override |
| Returns a reference to the instance. | |
| 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 Member Functions inherited from Arcane::ReferenceCounterImpl | |
| void | addReference () |
| void | removeReference () |
| void | _internalAddReference () |
| bool | _internalRemoveReference () |
Private Member Functions | |
| void | _internalNotifySourceItemsAdded (ConstArrayView< Int32 > local_ids) override |
| void | _increaseIndexList (Int32 lid, Integer size, Int32 target_lid) |
| Integer | _increaseConnectivityList (Int32 new_lid) |
| Integer | _increaseConnectivityList (Int32 new_lid, Integer nb_value) |
| Integer | _computeAllocSize (Integer nb_item) |
| void | _checkAddNullItem () |
| void | _resetConnectivityList () |
Private Attributes | |
| Int64 | m_nb_add = 0 |
| Int64 | m_nb_remove = 0 |
| Int64 | m_nb_memcopy = 0 |
| Integer | m_pre_allocated_size = 0 |
Friends | |
| class | IndexedIncrementalItemConnectivityMng |
| For access to _internalNotifySourceItemsAdded(). | |
Additional Inherited Members | |
| Protected Member Functions inherited from Arcane::mesh::IncrementalItemConnectivityBase | |
| void | _initializeStorage (ConnectivityItemVector *civ) override |
| Implements the initialization of civ for this connectivity. | |
| ItemVectorView | _connectedItems (ItemLocalId item, ConnectivityItemVector &con_items) const final |
| Fills con_items with the entities connected to item. | |
| void | _lazyNotifySourceItemAdded (Int32 lid) |
| void | _publishLazyViews (Int32 nb_source) |
| Points both per-source views at the shared zero buffer, so a reader of nbConnectedItem() gets 0 for every item. | |
| void | _setLazyViews (ConstArrayView< Int32 > zeros) |
| void | _trimLazyViews () |
| Moves the lazy views to one zero buffer of the size of the mesh. | |
| void | _materialize () |
| Leaves the lazy state: allocates the two per-source arrays for real. | |
| void | _checkMaterialize () |
| Leaves the lazy state if this connectivity is still in it. | |
| void | _notifyConnectivityListChanged () |
| void | _notifyConnectivityIndexChanged () |
| void | _notifyConnectivityNbItemChanged () |
| void | _notifyConnectivityNbItemChangedFromObservable () |
| void | _computeMaxNbConnectedItem () |
| void | _setNewMaxNbConnectedItems (Int32 new_max) |
| void | _setMaxNbConnectedItemsInConnectivityList () |
| Protected Member Functions inherited from Arcane::mesh::AbstractIncrementalItemConnectivity | |
| ConstArrayView< IItemFamily * > | _families () const |
| IItemFamily * | _sourceFamily () const |
| IItemFamily * | _targetFamily () const |
| Protected Member Functions inherited from Arcane::TraceAccessor | |
| void | _setLocalVerboseLevel (Int32 v) |
| Int32 | _localVerboseLevel () const |
| Protected Attributes inherited from Arcane::mesh::IncrementalItemConnectivityBase | |
| bool | m_is_empty = true |
| bool | m_is_lazy = false |
| True while this connectivity has never had a connected item. | |
| Int32ArrayView | m_connectivity_nb_item |
| Int32ArrayView | m_connectivity_index |
| Int32ArrayView | m_connectivity_list |
| IncrementalItemConnectivityContainer * | m_p = nullptr |
| ItemInternalConnectivityList * | m_item_connectivity_list = nullptr |
| Integer | m_item_connectivity_index = -1 |
| std::unique_ptr< InternalApi > | m_internal_api |
Incremental item->item[] connectivity.
Definition at line 230 of file IncrementalItemConnectivity.h.
| Arcane::mesh::IncrementalItemConnectivity::IncrementalItemConnectivity | ( | IItemFamily * | source_family, |
| IItemFamily * | target_family, | ||
| const String & | aname ) |
Definition at line 637 of file IncrementalItemConnectivity.cc.
|
override |
Definition at line 661 of file IncrementalItemConnectivity.cc.
|
private |
Definition at line 1108 of file IncrementalItemConnectivity.cc.
|
inlineprivate |
Definition at line 781 of file IncrementalItemConnectivity.cc.
|
inlineprivate |
Definition at line 676 of file IncrementalItemConnectivity.cc.
|
inlineprivate |
Definition at line 688 of file IncrementalItemConnectivity.cc.
|
inlineprivate |
Definition at line 711 of file IncrementalItemConnectivity.cc.
|
overrideprivate |
Definition at line 971 of file IncrementalItemConnectivity.cc.
|
private |
Definition at line 700 of file IncrementalItemConnectivity.cc.
|
overridevirtual |
Adds the entity with localId() target_local_id to the connectivity of source_item.
Implements Arcane::IIncrementalItemConnectivity.
Definition at line 730 of file IncrementalItemConnectivity.cc.
References Arcane::mesh::IncrementalItemConnectivityBase::_checkMaterialize().
Referenced by IndexedIncrementalItemConnectivityMng.
| void Arcane::mesh::IncrementalItemConnectivity::addConnectedItems | ( | ItemLocalId | source_item, |
| Integer | nb_item ) |
Definition at line 799 of file IncrementalItemConnectivity.cc.
| void Arcane::mesh::IncrementalItemConnectivity::compactConnectivityList | ( | ) |
Compresses the connectivity list.
The current implementation is quite simple:
Definition at line 1137 of file IncrementalItemConnectivity.cc.
References ARCANE_FATAL, Arcane::Array< T >::data(), Arcane::TraceAccessor::info(), Arcane::mesh::IncrementalItemConnectivityBase::m_is_lazy, Arcane::mesh::AbstractIncrementalItemConnectivity::name(), and Arcane::AbstractArray< T >::size().
|
overridevirtual |
Dumps statistics on usage and memory used to the stream out.
Implements Arcane::IIncrementalItemConnectivity.
Definition at line 1051 of file IncrementalItemConnectivity.cc.
References Arcane::mesh::AbstractIncrementalItemConnectivity::name().
| void Arcane::mesh::IncrementalItemConnectivity::endBulkConnectivity | ( | ) |
Closes a fill started by resizeBulkConnectivity().
Definition at line 872 of file IncrementalItemConnectivity.cc.
Referenced by Arcane::mesh::DynamicMeshIncrementalBuilder::_fillBulkConnectivity(), Arcane::mesh::DynamicMeshIncrementalBuilder::_fillBulkReverseConnectivity(), and IndexedIncrementalItemConnectivityMng.
|
overridevirtual |
Tests the existence of a connectivity between source_item and the entity with localId() target_local_id.
Implements Arcane::IIncrementalItemConnectivity.
Definition at line 939 of file IncrementalItemConnectivity.cc.
Referenced by IndexedIncrementalItemConnectivityMng.
|
overridevirtual |
Notifies the connectivity that a read has been performed from a dump.
Implements Arcane::IIncrementalItemSourceConnectivity.
Definition at line 1000 of file IncrementalItemConnectivity.cc.
References Arcane::TraceAccessor::info(), Arcane::mesh::IncrementalItemConnectivityBase::m_is_lazy, and Arcane::mesh::AbstractIncrementalItemConnectivity::name().
Referenced by IndexedIncrementalItemConnectivityMng.
|
overridevirtual |
Notifies the connectivity that an entity has been added to the source family.
Implements Arcane::IIncrementalItemSourceConnectivity.
Definition at line 952 of file IncrementalItemConnectivity.cc.
References Arcane::mesh::IncrementalItemConnectivityBase::m_is_lazy.
Referenced by IndexedIncrementalItemConnectivityMng.
|
inlinefinalvirtual |
Number of entities pre-allocated for the connectivity of each entity.
Implements Arcane::IIncrementalItemConnectivity.
Definition at line 289 of file IncrementalItemConnectivity.h.
Referenced by Arcane::mesh::DynamicMeshIncrementalBuilder::_fillBulkConnectivity(), Arcane::mesh::DynamicMeshIncrementalBuilder::_fillBulkReverseConnectivity(), and Arcane::mesh::FaceFamily::setBulkBackAndFrontCells().
|
overridevirtual |
Removes the entity with localId() target_local_id from the connectivity of source_item.
Implements Arcane::IIncrementalItemConnectivity.
Definition at line 893 of file IncrementalItemConnectivity.cc.
References Arcane::mesh::IncrementalItemConnectivityBase::_checkMaterialize().
Referenced by IndexedIncrementalItemConnectivityMng.
|
overridevirtual |
Removes all entities connected to source_item.
Implements Arcane::IIncrementalItemConnectivity.
Definition at line 882 of file IncrementalItemConnectivity.cc.
References Arcane::mesh::IncrementalItemConnectivityBase::_checkMaterialize().
Referenced by IndexedIncrementalItemConnectivityMng, and setConnectedItems().
|
overridevirtual |
Replaces the entity at index index of source_item with the entity with localId() target_local_id.
Implements Arcane::IIncrementalItemConnectivity.
Definition at line 909 of file IncrementalItemConnectivity.cc.
References Arcane::mesh::IncrementalItemConnectivityBase::_checkMaterialize().
Referenced by IndexedIncrementalItemConnectivityMng.
|
overridevirtual |
Replaces the entities of source_item with the entities with localId() target_local_ids.
Implements Arcane::IIncrementalItemConnectivity.
Definition at line 922 of file IncrementalItemConnectivity.cc.
References Arcane::mesh::IncrementalItemConnectivityBase::_checkMaterialize(), and Arcane::ConstArrayView< T >::size().
Referenced by IndexedIncrementalItemConnectivityMng, and setConnectedItems().
| void Arcane::mesh::IncrementalItemConnectivity::resizeBulkConnectivity | ( | Int32 | nb_source, |
| Int64 | list_size, | ||
| Int32ArrayView & | nb_items, | ||
| Int32ArrayView & | indexes, | ||
| Int32ArrayView & | list ) |
Sizes the storage for a bulk fill and hands out the arrays to write.
The caller fills them in place, then calls endBulkConnectivity(). Same contract as setBulkConnectivity(), without the copy.
Definition at line 853 of file IncrementalItemConnectivity.cc.
References Arcane::mesh::IncrementalItemConnectivityBase::_checkMaterialize().
Referenced by Arcane::mesh::DynamicMeshIncrementalBuilder::_fillBulkConnectivity(), Arcane::mesh::DynamicMeshIncrementalBuilder::_fillBulkReverseConnectivity(), and IndexedIncrementalItemConnectivityMng.
| void Arcane::mesh::IncrementalItemConnectivity::setBulkConnectivity | ( | Int32ConstArrayView | nb_items, |
| Int32ConstArrayView | indexes, | ||
| Int32ConstArrayView | list ) |
Replaces the whole connectivity with one the caller already knows.
nb_items and indexes describe source item i, list holds the blocks they index. A caller that knows the connectivity of every source item writes three arrays here instead of calling addConnectedItem() once per connection.
list must keep the layout the incremental path produces: the null item holds the first block, and every block starts on a multiple of preAllocatedSize(), since compactConnectivityList() checks it.
Definition at line 829 of file IncrementalItemConnectivity.cc.
References Arcane::mesh::IncrementalItemConnectivityBase::_checkMaterialize(), ARCANE_FATAL, and Arcane::ConstArrayView< T >::size().
Referenced by IndexedIncrementalItemConnectivityMng, and Arcane::mesh::FaceFamily::setBulkBackAndFrontCells().
|
overridevirtual |
Allocates and positions entities connected to source_item.
If there were already entities connected to source_item, they are removed. target_local_ids contains the list of local IDs of entities to add. This method is equivalent to calling the following code but allows for memory management optimizations:
Reimplemented from Arcane::IIncrementalItemConnectivity.
Definition at line 817 of file IncrementalItemConnectivity.cc.
References Arcane::mesh::IncrementalItemConnectivityBase::_checkMaterialize(), removeConnectedItems(), replaceConnectedItems(), and Arcane::ConstArrayView< T >::size().
Referenced by IndexedIncrementalItemConnectivityMng.
|
finalvirtual |
Sets the number of entities to pre-allocate for the connectivity of each entity.
Implements Arcane::IIncrementalItemConnectivity.
Definition at line 1020 of file IncrementalItemConnectivity.cc.
References Arcane::mesh::IncrementalItemConnectivityBase::m_is_lazy, and Arcane::mesh::AbstractIncrementalItemConnectivity::name().
|
friend |
For access to _internalNotifySourceItemsAdded().
Definition at line 236 of file IncrementalItemConnectivity.h.
References addConnectedItem(), endBulkConnectivity(), hasConnectedItem(), IndexedIncrementalItemConnectivityMng, notifyReadFromDump(), notifySourceItemAdded(), removeConnectedItem(), removeConnectedItems(), replaceConnectedItem(), replaceConnectedItems(), resizeBulkConnectivity(), setBulkConnectivity(), and setConnectedItems().
Referenced by IndexedIncrementalItemConnectivityMng.
|
private |
Definition at line 298 of file IncrementalItemConnectivity.h.
|
private |
Definition at line 300 of file IncrementalItemConnectivity.h.
|
private |
Definition at line 299 of file IncrementalItemConnectivity.h.
|
private |
Definition at line 301 of file IncrementalItemConnectivity.h.