dune-common 2.9.0
Loading...
Searching...
No Matches
Classes | Public Types | Public Member Functions | Static Public Attributes | List of all members
Dune::RemoteIndexListModifier< T, A, mode > Class Template Reference

Modifier for adding and/or deleting remote indices from the remote index list. More...

#include <dune/common/parallel/remoteindices.hh>

Classes

class  InvalidPosition
 

Public Types

typedef T ParallelIndexSet
 Type of the index set we use.
 
typedef ParallelIndexSet::GlobalIndex GlobalIndex
 The type of the global index.
 
typedef ParallelIndexSet::LocalIndex LocalIndex
 The type of the local index.
 
typedef LocalIndex::Attribute Attribute
 The type of the attribute.
 
typedef Dune::RemoteIndex< GlobalIndex, AttributeRemoteIndex
 Type of the remote indices we manage.
 
typedef A Allocator
 The type of the allocator for the remote index list.
 
typedef Dune::SLList< RemoteIndex, AllocatorRemoteIndexList
 The type of the remote index list.
 
typedef SLListModifyIterator< RemoteIndex, AllocatorModifyIterator
 The type of the modifying iterator of the remote index list.
 
typedef RemoteIndexList::const_iterator ConstIterator
 The type of the remote index list iterator.
 

Public Member Functions

void insert (const RemoteIndex &index)
 Insert an index to the list.
 
void insert (const RemoteIndex &index, const GlobalIndex &global)
 Insert an index to the list.
 
bool remove (const GlobalIndex &global)
 Remove a remote index.
 
void repairLocalIndexPointers ()
 Repair the pointers to the local index pairs.
 
 RemoteIndexListModifier (const RemoteIndexListModifier &)
 
 RemoteIndexListModifier ()
 Default constructor.
 

Static Public Attributes

static constexpr bool MODIFYINDEXSET = mode
 If true the index set corresponding to the remote indices might get modified.
 

Detailed Description

template<class T, class A, bool mode>
class Dune::RemoteIndexListModifier< T, A, mode >

Modifier for adding and/or deleting remote indices from the remote index list.

In some cases all the information about the indices also present on remote process might already be known. In this case this information can be provided to the RemoteIndices via this modifier. This prevents the global communication needed by a call to RemoteIndices::rebuild.

In some cases it might advisable to run IndicesSyncer::sync afterwards.

Warning
Use with care. If the indices are not consistent afterwards communication attempts might deadlock!

Member Typedef Documentation

◆ Allocator

template<class T , class A , bool mode>
typedef A Dune::RemoteIndexListModifier< T, A, mode >::Allocator

The type of the allocator for the remote index list.

◆ Attribute

template<class T , class A , bool mode>
typedef LocalIndex::Attribute Dune::RemoteIndexListModifier< T, A, mode >::Attribute

The type of the attribute.

◆ ConstIterator

template<class T , class A , bool mode>
typedef RemoteIndexList::const_iterator Dune::RemoteIndexListModifier< T, A, mode >::ConstIterator

The type of the remote index list iterator.

◆ GlobalIndex

template<class T , class A , bool mode>
typedef ParallelIndexSet::GlobalIndex Dune::RemoteIndexListModifier< T, A, mode >::GlobalIndex

The type of the global index.

◆ LocalIndex

template<class T , class A , bool mode>
typedef ParallelIndexSet::LocalIndex Dune::RemoteIndexListModifier< T, A, mode >::LocalIndex

The type of the local index.

◆ ModifyIterator

template<class T , class A , bool mode>
typedef SLListModifyIterator<RemoteIndex,Allocator> Dune::RemoteIndexListModifier< T, A, mode >::ModifyIterator

The type of the modifying iterator of the remote index list.

◆ ParallelIndexSet

template<class T , class A , bool mode>
typedef T Dune::RemoteIndexListModifier< T, A, mode >::ParallelIndexSet

Type of the index set we use.

◆ RemoteIndex

template<class T , class A , bool mode>
typedef Dune::RemoteIndex<GlobalIndex,Attribute> Dune::RemoteIndexListModifier< T, A, mode >::RemoteIndex

Type of the remote indices we manage.

◆ RemoteIndexList

template<class T , class A , bool mode>
typedef Dune::SLList<RemoteIndex,Allocator> Dune::RemoteIndexListModifier< T, A, mode >::RemoteIndexList

The type of the remote index list.

Constructor & Destructor Documentation

◆ RemoteIndexListModifier() [1/2]

template<typename T , typename A , bool mode>
Dune::RemoteIndexListModifier< T, A, mode >::RemoteIndexListModifier ( const RemoteIndexListModifier< T, A, mode > &  other)

◆ RemoteIndexListModifier() [2/2]

template<class T , class A , bool mode>
Dune::RemoteIndexListModifier< T, A, mode >::RemoteIndexListModifier ( )
inline

Default constructor.

Warning
Object is not usable!

Member Function Documentation

◆ insert() [1/2]

template<typename T , typename A , bool mode>
void Dune::RemoteIndexListModifier< T, A, mode >::insert ( const RemoteIndex index)
inline

Insert an index to the list.

Moves to the position where the index fits and inserts it. After the insertion only indices with an bigger global index than the inserted can be inserted.

This method is only available if MODIFYINDEXSET is false.

Parameters
indexThe index to insert.
Exceptions
InvalidPositionThrown if the index at the current position or the one before has bigger global index than the one to be inserted.

◆ insert() [2/2]

template<typename T , typename A , bool mode>
void Dune::RemoteIndexListModifier< T, A, mode >::insert ( const RemoteIndex index,
const GlobalIndex global 
)
inline

Insert an index to the list.

Moves to the position where the index fits and inserts it. After the insertion only indices with an bigger global index than the inserted can be inserted.

This method is only available if MODIFYINDEXSET is true.

Parameters
indexThe index to insert.
globalThe global index of the remote index.
Exceptions
InvalidPositionThrown if the index at the current position or the one before has bigger global index than the one to be inserted.

◆ remove()

template<typename T , typename A , bool mode>
bool Dune::RemoteIndexListModifier< T, A, mode >::remove ( const GlobalIndex global)

Remove a remote index.

Parameters
globalThe global index corresponding to the remote index.
Returns
True If there was a corresponding remote index.
Exceptions
InvalidPostionIf there was an insertion or deletion of a remote index corresponding to a bigger global index before.

◆ repairLocalIndexPointers()

template<typename T , typename A , bool mode>
void Dune::RemoteIndexListModifier< T, A, mode >::repairLocalIndexPointers ( )
inline

Repair the pointers to the local index pairs.

Due to adding new indices or/and deleting indices in the index set all pointers to the local index pair might become invalid during ParallelIndexSet::endResize(). This method repairs them.

Exceptions
InvalidIndexSetStateThrown if the underlying index set is not in ParallelIndexSetState::GROUND mode (only when compiled with DUNE_ISTL_WITH_CHECKING!).

Member Data Documentation

◆ MODIFYINDEXSET

template<class T , class A , bool mode>
constexpr bool Dune::RemoteIndexListModifier< T, A, mode >::MODIFYINDEXSET = mode
staticconstexpr

If true the index set corresponding to the remote indices might get modified.

If for example new indices are added to an index set all pointers of the remote indices to the local indices become invalid after ParallelIndexSet::endResize() was called.


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