Arcane  4.2.3.0
Developer documentation
Loading...
Searching...
No Matches
Arcane::mesh::IncrementalItemConnectivityBase Class Reference

Base class for incremental item->item[] connectivities. More...

#include <arcane/mesh/IncrementalItemConnectivity.h>

Inheritance diagram for Arcane::mesh::IncrementalItemConnectivityBase:
Collaboration diagram for Arcane::mesh::IncrementalItemConnectivityBase:

Classes

class  InternalApi

Public Member Functions

 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 ()
Public Member Functions inherited from Arcane::IIncrementalItemConnectivity
virtual void addConnectedItem (ItemLocalId source_item, ItemLocalId target_local_id)=0
 Adds the entity with localId() target_local_id to the connectivity of source_item.
virtual void setConnectedItems (ItemLocalId source_item, Int32ConstArrayView target_local_ids)
 Allocates and positions entities connected to source_item.
virtual void removeConnectedItem (ItemLocalId source_item, ItemLocalId target_local_id)=0
 Removes the entity with localId() target_local_id from the connectivity of source_item.
virtual void removeConnectedItems (ItemLocalId source_item)=0
 Removes all entities connected to source_item.
virtual void replaceConnectedItem (ItemLocalId source_item, Integer index, ItemLocalId target_local_id)=0
 Replaces the entity at index index of source_item with the entity with localId() target_local_id.
virtual void replaceConnectedItems (ItemLocalId source_item, Int32ConstArrayView target_local_ids)=0
 Replaces the entities of source_item with the entities with localId() target_local_ids.
virtual bool hasConnectedItem (ItemLocalId source_item, ItemLocalId target_local_id) const =0
 Tests the existence of a connectivity between source_item and the entity with localId() target_local_id.
virtual Integer preAllocatedSize () const =0
 Number of entities pre-allocated for the connectivity of each entity.
virtual void setPreAllocatedSize (Integer value)=0
 Sets the number of entities to pre-allocate for the connectivity of each entity.
virtual void dumpStats (std::ostream &out) const =0
 Dumps statistics on usage and memory used to the stream out.
Public Member Functions inherited from Arcane::IIncrementalItemSourceConnectivity
virtual void notifySourceItemAdded (ItemLocalId item)=0
 Notifies the connectivity that an entity has been added to the source family.
virtual void notifyReadFromDump ()=0
 Notifies the connectivity that a read has been performed from a dump.

Protected Member Functions

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

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

Private Member Functions

void _shrinkMemory ()
void _addMemoryInfos (ItemConnectivityMemoryInfo &mem_info)

Friends

template<class SourceFamily, class TargetFamily, class LegacyType, class CustomType>
class NewWithLegacyConnectivity

Detailed Description

Base class for incremental item->item[] connectivities.

Definition at line 98 of file IncrementalItemConnectivity.h.

Constructor & Destructor Documentation

◆ IncrementalItemConnectivityBase()

Arcane::mesh::IncrementalItemConnectivityBase::IncrementalItemConnectivityBase ( IItemFamily * source_family,
IItemFamily * target_family,
const String & aname )

Definition at line 250 of file IncrementalItemConnectivity.cc.

◆ ~IncrementalItemConnectivityBase()

Arcane::mesh::IncrementalItemConnectivityBase::~IncrementalItemConnectivityBase ( )
override

Definition at line 294 of file IncrementalItemConnectivity.cc.

Member Function Documentation

◆ _addMemoryInfos()

void Arcane::mesh::IncrementalItemConnectivityBase::_addMemoryInfos ( ItemConnectivityMemoryInfo & mem_info)
private

Definition at line 1091 of file IncrementalItemConnectivity.cc.

◆ _checkMaterialize()

void Arcane::mesh::IncrementalItemConnectivityBase::_checkMaterialize ( )
inlineprotected

Leaves the lazy state if this connectivity is still in it.

Definition at line 206 of file IncrementalItemConnectivity.h.

References _materialize(), and m_is_lazy.

Referenced by Arcane::mesh::IncrementalItemConnectivity::addConnectedItem(), Arcane::mesh::IncrementalItemConnectivity::removeConnectedItem(), Arcane::mesh::IncrementalItemConnectivity::removeConnectedItems(), Arcane::mesh::IncrementalItemConnectivity::replaceConnectedItem(), Arcane::mesh::IncrementalItemConnectivity::replaceConnectedItems(), Arcane::mesh::IncrementalItemConnectivity::resizeBulkConnectivity(), Arcane::mesh::IncrementalItemConnectivity::setBulkConnectivity(), and Arcane::mesh::IncrementalItemConnectivity::setConnectedItems().

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

◆ _computeMaxNbConnectedItem()

void Arcane::mesh::IncrementalItemConnectivityBase::_computeMaxNbConnectedItem ( )
protected

Definition at line 501 of file IncrementalItemConnectivity.cc.

◆ _connectedItems()

ItemVectorView Arcane::mesh::IncrementalItemConnectivityBase::_connectedItems ( ItemLocalId item,
ConnectivityItemVector & con_items ) const
finalprotectedvirtual

Fills con_items with the entities connected to item.

Implements Arcane::IItemConnectivityAccessor.

Definition at line 578 of file IncrementalItemConnectivity.cc.

References Arcane::ConnectivityItemVector::resizeAndCopy().

Here is the call graph for this function:

◆ _connectedItemsLocalId() [1/2]

Int32ArrayView Arcane::mesh::IncrementalItemConnectivityBase::_connectedItemsLocalId ( ItemLocalId lid)
inline

Definition at line 154 of file IncrementalItemConnectivity.h.

◆ _connectedItemsLocalId() [2/2]

Int32ConstArrayView Arcane::mesh::IncrementalItemConnectivityBase::_connectedItemsLocalId ( ItemLocalId lid) const
inline

Definition at line 146 of file IncrementalItemConnectivity.h.

◆ _initializeStorage()

void Arcane::mesh::IncrementalItemConnectivityBase::_initializeStorage ( ConnectivityItemVector * civ)
inlineoverrideprotectedvirtual

Implements the initialization of civ for this connectivity.

Implements Arcane::IItemConnectivityAccessor.

Definition at line 171 of file IncrementalItemConnectivity.h.

◆ _internalApi()

IIncrementalItemConnectivityInternal * Arcane::mesh::IncrementalItemConnectivityBase::_internalApi ( )
overridevirtual

◆ _lazyNotifySourceItemAdded()

void Arcane::mesh::IncrementalItemConnectivityBase::_lazyNotifySourceItemAdded ( Int32 lid)
protected

Definition at line 337 of file IncrementalItemConnectivity.cc.

◆ _materialize()

void Arcane::mesh::IncrementalItemConnectivityBase::_materialize ( )
protected

Leaves the lazy state: allocates the two per-source arrays for real.

Called by every method that writes a connectivity. From here on the connectivity behaves exactly as it always did.

Definition at line 409 of file IncrementalItemConnectivity.cc.

References m_is_lazy, and Arcane::mesh::IncrementalItemConnectivityContainer::m_lazy_pool.

Referenced by _checkMaterialize().

Here is the caller graph for this function:

◆ _notifyConnectivityIndexChanged()

void Arcane::mesh::IncrementalItemConnectivityBase::_notifyConnectivityIndexChanged ( )
protected

Definition at line 426 of file IncrementalItemConnectivity.cc.

◆ _notifyConnectivityListChanged()

void Arcane::mesh::IncrementalItemConnectivityBase::_notifyConnectivityListChanged ( )
protected

Definition at line 326 of file IncrementalItemConnectivity.cc.

◆ _notifyConnectivityNbItemChanged()

void Arcane::mesh::IncrementalItemConnectivityBase::_notifyConnectivityNbItemChanged ( )
protected

Definition at line 443 of file IncrementalItemConnectivity.cc.

◆ _notifyConnectivityNbItemChangedFromObservable()

void Arcane::mesh::IncrementalItemConnectivityBase::_notifyConnectivityNbItemChangedFromObservable ( )
protected

Method called when the number of entities is modified externally, for example during recovery or after a rollback.

Definition at line 471 of file IncrementalItemConnectivity.cc.

References m_is_lazy, and Arcane::mesh::IncrementalItemConnectivityContainer::m_lazy_pool.

◆ _publishLazyViews()

void Arcane::mesh::IncrementalItemConnectivityBase::_publishLazyViews ( Int32 nb_source)
protected

Points both per-source views at the shared zero buffer, so a reader of nbConnectedItem() gets 0 for every item.

Definition at line 354 of file IncrementalItemConnectivity.cc.

References Arcane::mesh::IncrementalItemConnectivityContainer::m_lazy_pool.

◆ _setLazyViews()

void Arcane::mesh::IncrementalItemConnectivityBase::_setLazyViews ( ConstArrayView< Int32 > zeros)
protected

Definition at line 369 of file IncrementalItemConnectivity.cc.

◆ _setMaxNbConnectedItemsInConnectivityList()

void Arcane::mesh::IncrementalItemConnectivityBase::_setMaxNbConnectedItemsInConnectivityList ( )
protected

Definition at line 458 of file IncrementalItemConnectivity.cc.

◆ _setNewMaxNbConnectedItems()

void Arcane::mesh::IncrementalItemConnectivityBase::_setNewMaxNbConnectedItems ( Int32 new_max)
protected

Definition at line 489 of file IncrementalItemConnectivity.cc.

◆ _shrinkMemory()

void Arcane::mesh::IncrementalItemConnectivityBase::_shrinkMemory ( )
private

Definition at line 1077 of file IncrementalItemConnectivity.cc.

◆ _trimLazyViews()

void Arcane::mesh::IncrementalItemConnectivityBase::_trimLazyViews ( )
protected

Moves the lazy views to one zero buffer of the size of the mesh.

Called once the whole mesh is updated: the views no longer need room to grow, and every lazy connectivity of the mesh, whatever its source family, can read the same buffer, sized for the largest family.

Definition at line 390 of file IncrementalItemConnectivity.cc.

References m_is_lazy, Arcane::mesh::IncrementalItemConnectivityContainer::m_lazy_pool, and Arcane::math::max().

Here is the call graph for this function:

◆ connectedItemLocalId()

Int32 Arcane::mesh::IncrementalItemConnectivityBase::connectedItemLocalId ( ItemLocalId lid,
Integer index ) const
inlinefinalvirtual

localId() of the index-th entity connected to the source entity with local ID lid

Implements Arcane::IItemConnectivityAccessor.

Definition at line 130 of file IncrementalItemConnectivity.h.

◆ connectivityAccessor()

IndexedItemConnectivityAccessor Arcane::mesh::IncrementalItemConnectivityBase::connectivityAccessor ( ) const

Definition at line 605 of file IncrementalItemConnectivity.cc.

◆ connectivityContainerView()

ItemConnectivityContainerView Arcane::mesh::IncrementalItemConnectivityBase::connectivityContainerView ( ) const

Definition at line 587 of file IncrementalItemConnectivity.cc.

◆ connectivityIndex()

Int32ArrayView Arcane::mesh::IncrementalItemConnectivityBase::connectivityIndex ( )
inline

Definition at line 163 of file IncrementalItemConnectivity.h.

◆ connectivityList()

Int32ArrayView Arcane::mesh::IncrementalItemConnectivityBase::connectivityList ( )
inline

Definition at line 164 of file IncrementalItemConnectivity.h.

◆ connectivityView()

IndexedItemConnectivityViewBase Arcane::mesh::IncrementalItemConnectivityBase::connectivityView ( ) const

Definition at line 596 of file IncrementalItemConnectivity.cc.

◆ dumpInfos()

void Arcane::mesh::IncrementalItemConnectivityBase::dumpInfos ( )

Definition at line 623 of file IncrementalItemConnectivity.cc.

◆ maxNbConnectedItem()

Int32 Arcane::mesh::IncrementalItemConnectivityBase::maxNbConnectedItem ( ) const
overridevirtual

Maximum number of entities connected to a source entity.

This value may be greater than the current maximum number of connected entities if removeConnectedItem() and removeConnectedItems() have been called.

Implements Arcane::IIncrementalItemConnectivity.

Definition at line 516 of file IncrementalItemConnectivity.cc.

◆ nbConnectedItem()

Integer Arcane::mesh::IncrementalItemConnectivityBase::nbConnectedItem ( ItemLocalId lid) const
inlinefinalvirtual

Number of entities connected to the source entity with local ID lid.

Implements Arcane::IItemConnectivityAccessor.

Definition at line 126 of file IncrementalItemConnectivity.h.

Referenced by Arcane::mesh::FaceToCellIncrementalItemConnectivity::_removeConnectedItem().

Here is the caller graph for this function:

◆ notifySourceFamilyLocalIdChanged()

void Arcane::mesh::IncrementalItemConnectivityBase::notifySourceFamilyLocalIdChanged ( Int32ConstArrayView new_to_old_ids)
overridevirtual

Notifies the connectivity that the source family has been compacted.

Implements Arcane::IIncrementalItemSourceConnectivity.

Reimplemented in Arcane::mesh::OneItemIncrementalItemConnectivity.

Definition at line 546 of file IncrementalItemConnectivity.cc.

References m_is_lazy, and Arcane::ConstArrayView< T >::size().

Here is the call graph for this function:

◆ notifyTargetFamilyLocalIdChanged()

void Arcane::mesh::IncrementalItemConnectivityBase::notifyTargetFamilyLocalIdChanged ( Int32ConstArrayView old_to_new_ids)
overridevirtual

Notifies the connectivity that the target family has been compacted.

Implements Arcane::IIncrementalItemTargetConnectivity.

Definition at line 565 of file IncrementalItemConnectivity.cc.

References Arcane::ArrayView< T >::size().

Here is the call graph for this function:

◆ reserveMemoryForNbSourceItems()

void Arcane::mesh::IncrementalItemConnectivityBase::reserveMemoryForNbSourceItems ( Int32 n,
bool pre_alloc_connectivity )
overridevirtual

Reserves memory for n source entities.

Calling this method is optional but prevents multiple reallocations during successive calls to notifySourceItemAdded().

If pre_alloc_connectivity is true, it also pre-allocates the list of connectivities based on the value of preAllocatedSize(). For example, if preAllocatedSize() is 4 and n is 10000, we will pre-allocate for 40000 connectivities. To avoid unnecessary memory overconsumption, connectivities should only be pre-allocated if we are sure we will use them.

Reimplemented from Arcane::IIncrementalItemSourceConnectivity.

Definition at line 303 of file IncrementalItemConnectivity.cc.

References m_is_lazy, and Arcane::IIncrementalItemConnectivity::preAllocatedSize().

Here is the call graph for this function:

◆ setItemConnectivityList()

void Arcane::mesh::IncrementalItemConnectivityBase::setItemConnectivityList ( ItemInternalConnectivityList * ilist,
Int32 index )

Indicates that this connectivity is associated with one of the connectivities of ItemInternal.

This allows direct updating of the ilist structure whenever this connectivity is modified.

Definition at line 531 of file IncrementalItemConnectivity.cc.

References Arcane::TraceAccessor::info(), and Arcane::mesh::AbstractIncrementalItemConnectivity::name().

Here is the call graph for this function:

◆ NewWithLegacyConnectivity

template<class SourceFamily, class TargetFamily, class LegacyType, class CustomType>
friend class NewWithLegacyConnectivity
friend

Definition at line 106 of file IncrementalItemConnectivity.h.

Member Data Documentation

◆ m_connectivity_index

Int32ArrayView Arcane::mesh::IncrementalItemConnectivityBase::m_connectivity_index
protected

Definition at line 191 of file IncrementalItemConnectivity.h.

◆ m_connectivity_list

Int32ArrayView Arcane::mesh::IncrementalItemConnectivityBase::m_connectivity_list
protected

Definition at line 192 of file IncrementalItemConnectivity.h.

◆ m_connectivity_nb_item

Int32ArrayView Arcane::mesh::IncrementalItemConnectivityBase::m_connectivity_nb_item
protected

Definition at line 190 of file IncrementalItemConnectivity.h.

◆ m_internal_api

std::unique_ptr<InternalApi> Arcane::mesh::IncrementalItemConnectivityBase::m_internal_api
protected

Definition at line 196 of file IncrementalItemConnectivity.h.

◆ m_is_empty

bool Arcane::mesh::IncrementalItemConnectivityBase::m_is_empty = true
protected

Definition at line 179 of file IncrementalItemConnectivity.h.

◆ m_is_lazy

bool Arcane::mesh::IncrementalItemConnectivityBase::m_is_lazy = false
protected

◆ m_item_connectivity_index

Integer Arcane::mesh::IncrementalItemConnectivityBase::m_item_connectivity_index = -1
protected

Definition at line 195 of file IncrementalItemConnectivity.h.

◆ m_item_connectivity_list

ItemInternalConnectivityList* Arcane::mesh::IncrementalItemConnectivityBase::m_item_connectivity_list = nullptr
protected

Definition at line 194 of file IncrementalItemConnectivity.h.

◆ m_p

IncrementalItemConnectivityContainer* Arcane::mesh::IncrementalItemConnectivityBase::m_p = nullptr
protected

Definition at line 193 of file IncrementalItemConnectivity.h.


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