dune-istl  2.6-git
Classes | Public Types | Public Member Functions | Protected Member Functions | Friends | List of all members
Dune::OwnerOverlapCopyCommunication< GlobalIdType, LocalIdType > Class Template Reference

A class setting up standard communication for a two-valued attribute set with owner/overlap/copy semantics. More...

#include <dune/istl/owneroverlapcopy.hh>

Classes

struct  AddGatherScatter
 
struct  CopyGatherScatter
 gather/scatter callback for communcation More...
 

Public Types

typedef Dune::ParallelIndexSet< GlobalIdType, LI, 512 > PIS
 
typedef Dune::RemoteIndices< PISRI
 
typedef Dune::RemoteIndexListModifier< PIS, typename RI::Allocator, false > RILM
 
typedef RI::RemoteIndex RX
 
typedef Dune::BufferedCommunicator BC
 
typedef Dune::Interface IF
 
typedef EnumItem< AttributeSet, OwnerOverlapCopyAttributeSet::ownerOwnerSet
 
typedef EnumItem< AttributeSet, OwnerOverlapCopyAttributeSet::copyCopySet
 
typedef Combine< EnumItem< AttributeSet, OwnerOverlapCopyAttributeSet::owner >, EnumItem< AttributeSet, OwnerOverlapCopyAttributeSet::overlap >, AttributeSetOwnerOverlapSet
 
typedef Dune::AllSet< AttributeSetAllSet
 
typedef Dune::EnumItem< AttributeSet, OwnerOverlapCopyAttributeSet::copyCopyFlags
 
typedef Dune::ParallelIndexSet< GlobalIdType, LI, 512 > ParallelIndexSet
 The type of the parallel index set. More...
 
typedef Dune::RemoteIndices< PISRemoteIndices
 The type of the remote indices. More...
 
typedef Dune::GlobalLookupIndexSet< ParallelIndexSetGlobalLookupIndexSet
 The type of the reverse lookup of indices. More...
 

Public Member Functions

void setSolverCategory (SolverCategory set)
 Set right Solver Category (default is overlapping). More...
 
SolverCategory::Category getSolverCategory () const
 Get Solver Category. More...
 
const CollectiveCommunication< MPI_Comm > & communicator () const
 
template<class T >
void copyOwnerToAll (const T &source, T &dest) const
 Communicate values from owner data points to all other data points. More...
 
template<class T >
void copyCopyToAll (const T &source, T &dest) const
 Communicate values from copy data points to all other data points. More...
 
template<class T >
void addOwnerOverlapToAll (const T &source, T &dest) const
 Communicate values from owner data points to all other data points and add them to those values. More...
 
template<class T >
void addOwnerCopyToAll (const T &source, T &dest) const
 Communicate values from owner and copy data points to all other data points and add them to those values. More...
 
template<class T >
void addOwnerCopyToOwnerCopy (const T &source, T &dest) const
 Communicate values from owner and copy data points to owner and copy data points and add them to those values. More...
 
template<class T1 , class T2 >
void dot (const T1 &x, const T1 &y, T2 &result) const
 Compute a global dot product of two vectors. More...
 
template<class T1 >
FieldTraits< typename T1::field_type >::real_type norm (const T1 &x) const
 Compute the global euclidian norm of a vector. More...
 
const ParallelIndexSetindexSet () const
 Get the underlying parallel index set. More...
 
const RemoteIndicesremoteIndices () const
 Get the underlying remote indices. More...
 
ParallelIndexSetindexSet ()
 Get the underlying parallel index set. More...
 
RemoteIndicesremoteIndices ()
 Get the underlying remote indices. More...
 
void buildGlobalLookup ()
 
void buildGlobalLookup (std::size_t size)
 
void freeGlobalLookup ()
 
const GlobalLookupIndexSetglobalLookup () const
 
template<class T1 >
void project (T1 &x) const
 Set vector to zero at copy dofs. More...
 
 OwnerOverlapCopyCommunication (MPI_Comm comm_, SolverCategory::Category cat_=SolverCategory::overlapping, bool freecomm_=false)
 Construct the communication without any indices. More...
 
 OwnerOverlapCopyCommunication (SolverCategory::Category cat_=SolverCategory::overlapping)
 Construct the communication without any indices using MPI_COMM_WORLD. More...
 
 OwnerOverlapCopyCommunication (const IndexInfoFromGrid< GlobalIdType, LocalIdType > &indexinfo, MPI_Comm comm_, SolverCategory::Category cat_=SolverCategory::overlapping, bool freecomm_=false)
 Constructor. More...
 
 ~OwnerOverlapCopyCommunication ()
 

Protected Member Functions

void buildOwnerOverlapToAllInterface () const
 
void buildOwnerToAllInterface () const
 
void buildOwnerCopyToAllInterface () const
 
void buildOwnerCopyToOwnerCopyInterface () const
 
void buildCopyToAllInterface () const
 

Friends

template<typename M , typename G , typename L >
void loadMatrixMarket (M &, const std::string &, OwnerOverlapCopyCommunication< G, L > &, bool)
 Load a parallel matrix/vector stored in matrix market format. More...
 

Detailed Description

template<class GlobalIdType, class LocalIdType = int>
class Dune::OwnerOverlapCopyCommunication< GlobalIdType, LocalIdType >

A class setting up standard communication for a two-valued attribute set with owner/overlap/copy semantics.

set up communication from known distribution with owner/overlap/copy semantics

Member Typedef Documentation

◆ AllSet

template<class GlobalIdType, class LocalIdType = int>
typedef Dune::AllSet<AttributeSet> Dune::OwnerOverlapCopyCommunication< GlobalIdType, LocalIdType >::AllSet

◆ BC

template<class GlobalIdType, class LocalIdType = int>
typedef Dune::BufferedCommunicator Dune::OwnerOverlapCopyCommunication< GlobalIdType, LocalIdType >::BC

◆ CopyFlags

template<class GlobalIdType, class LocalIdType = int>
typedef Dune::EnumItem<AttributeSet,OwnerOverlapCopyAttributeSet::copy> Dune::OwnerOverlapCopyCommunication< GlobalIdType, LocalIdType >::CopyFlags

◆ CopySet

template<class GlobalIdType, class LocalIdType = int>
typedef EnumItem<AttributeSet,OwnerOverlapCopyAttributeSet::copy> Dune::OwnerOverlapCopyCommunication< GlobalIdType, LocalIdType >::CopySet

◆ GlobalLookupIndexSet

template<class GlobalIdType, class LocalIdType = int>
typedef Dune::GlobalLookupIndexSet<ParallelIndexSet> Dune::OwnerOverlapCopyCommunication< GlobalIdType, LocalIdType >::GlobalLookupIndexSet

The type of the reverse lookup of indices.

◆ IF

template<class GlobalIdType, class LocalIdType = int>
typedef Dune::Interface Dune::OwnerOverlapCopyCommunication< GlobalIdType, LocalIdType >::IF

◆ OwnerOverlapSet

template<class GlobalIdType, class LocalIdType = int>
typedef Combine<EnumItem<AttributeSet,OwnerOverlapCopyAttributeSet::owner>,EnumItem<AttributeSet,OwnerOverlapCopyAttributeSet::overlap>,AttributeSet> Dune::OwnerOverlapCopyCommunication< GlobalIdType, LocalIdType >::OwnerOverlapSet

◆ OwnerSet

template<class GlobalIdType, class LocalIdType = int>
typedef EnumItem<AttributeSet,OwnerOverlapCopyAttributeSet::owner> Dune::OwnerOverlapCopyCommunication< GlobalIdType, LocalIdType >::OwnerSet

◆ ParallelIndexSet

template<class GlobalIdType, class LocalIdType = int>
typedef Dune::ParallelIndexSet<GlobalIdType,LI,512> Dune::OwnerOverlapCopyCommunication< GlobalIdType, LocalIdType >::ParallelIndexSet

The type of the parallel index set.

◆ PIS

template<class GlobalIdType, class LocalIdType = int>
typedef Dune::ParallelIndexSet<GlobalIdType,LI,512> Dune::OwnerOverlapCopyCommunication< GlobalIdType, LocalIdType >::PIS

◆ RemoteIndices

template<class GlobalIdType, class LocalIdType = int>
typedef Dune::RemoteIndices<PIS> Dune::OwnerOverlapCopyCommunication< GlobalIdType, LocalIdType >::RemoteIndices

The type of the remote indices.

◆ RI

template<class GlobalIdType, class LocalIdType = int>
typedef Dune::RemoteIndices<PIS> Dune::OwnerOverlapCopyCommunication< GlobalIdType, LocalIdType >::RI

◆ RILM

template<class GlobalIdType, class LocalIdType = int>
typedef Dune::RemoteIndexListModifier<PIS,typename RI::Allocator,false> Dune::OwnerOverlapCopyCommunication< GlobalIdType, LocalIdType >::RILM

◆ RX

template<class GlobalIdType, class LocalIdType = int>
typedef RI::RemoteIndex Dune::OwnerOverlapCopyCommunication< GlobalIdType, LocalIdType >::RX

Constructor & Destructor Documentation

◆ OwnerOverlapCopyCommunication() [1/3]

template<class GlobalIdType, class LocalIdType = int>
Dune::OwnerOverlapCopyCommunication< GlobalIdType, LocalIdType >::OwnerOverlapCopyCommunication ( MPI_Comm  comm_,
SolverCategory::Category  cat_ = SolverCategory::overlapping,
bool  freecomm_ = false 
)
inline

Construct the communication without any indices.

The local index set and the remote indices have to be set up later on.

Parameters
comm_The MPI Communicator to use, e. g. MPI_COMM_WORLD
cat_The Solver category, default is overlapping
freecomm_Whether to free the communicator comm_ in the destructor, default is false

◆ OwnerOverlapCopyCommunication() [2/3]

template<class GlobalIdType, class LocalIdType = int>
Dune::OwnerOverlapCopyCommunication< GlobalIdType, LocalIdType >::OwnerOverlapCopyCommunication ( SolverCategory::Category  cat_ = SolverCategory::overlapping)
inline

Construct the communication without any indices using MPI_COMM_WORLD.

The local index set and the remote indices have to be set up later on.

Parameters
cat_The Solver category, default is overlapping is false

◆ OwnerOverlapCopyCommunication() [3/3]

template<class GlobalIdType, class LocalIdType = int>
Dune::OwnerOverlapCopyCommunication< GlobalIdType, LocalIdType >::OwnerOverlapCopyCommunication ( const IndexInfoFromGrid< GlobalIdType, LocalIdType > &  indexinfo,
MPI_Comm  comm_,
SolverCategory::Category  cat_ = SolverCategory::overlapping,
bool  freecomm_ = false 
)
inline

Constructor.

Parameters
indexinfoThe set of IndexTripels describing the local and remote indices.
comm_The communicator to use in the communication.
cat_The Solver category, default is overlapping
freecomm_Whether to free the communicator comm_ in the destructor, default is false

◆ ~OwnerOverlapCopyCommunication()

template<class GlobalIdType, class LocalIdType = int>
Dune::OwnerOverlapCopyCommunication< GlobalIdType, LocalIdType >::~OwnerOverlapCopyCommunication ( )
inline

Member Function Documentation

◆ addOwnerCopyToAll()

template<class GlobalIdType, class LocalIdType = int>
template<class T >
void Dune::OwnerOverlapCopyCommunication< GlobalIdType, LocalIdType >::addOwnerCopyToAll ( const T &  source,
T &  dest 
) const
inline

Communicate values from owner and copy data points to all other data points and add them to those values.

source The data to send from. dest The data to add them communicated values to.

◆ addOwnerCopyToOwnerCopy()

template<class GlobalIdType, class LocalIdType = int>
template<class T >
void Dune::OwnerOverlapCopyCommunication< GlobalIdType, LocalIdType >::addOwnerCopyToOwnerCopy ( const T &  source,
T &  dest 
) const
inline

Communicate values from owner and copy data points to owner and copy data points and add them to those values.

source The data to send from. dest The data to add the communicated values to.

◆ addOwnerOverlapToAll()

template<class GlobalIdType, class LocalIdType = int>
template<class T >
void Dune::OwnerOverlapCopyCommunication< GlobalIdType, LocalIdType >::addOwnerOverlapToAll ( const T &  source,
T &  dest 
) const
inline

Communicate values from owner data points to all other data points and add them to those values.

source The data to send from. dest The data to add them communicated values to.

◆ buildCopyToAllInterface()

template<class GlobalIdType, class LocalIdType = int>
void Dune::OwnerOverlapCopyCommunication< GlobalIdType, LocalIdType >::buildCopyToAllInterface ( ) const
inlineprotected

◆ buildGlobalLookup() [1/2]

template<class GlobalIdType, class LocalIdType = int>
void Dune::OwnerOverlapCopyCommunication< GlobalIdType, LocalIdType >::buildGlobalLookup ( )
inline

◆ buildGlobalLookup() [2/2]

template<class GlobalIdType, class LocalIdType = int>
void Dune::OwnerOverlapCopyCommunication< GlobalIdType, LocalIdType >::buildGlobalLookup ( std::size_t  size)
inline

◆ buildOwnerCopyToAllInterface()

template<class GlobalIdType, class LocalIdType = int>
void Dune::OwnerOverlapCopyCommunication< GlobalIdType, LocalIdType >::buildOwnerCopyToAllInterface ( ) const
inlineprotected

◆ buildOwnerCopyToOwnerCopyInterface()

template<class GlobalIdType, class LocalIdType = int>
void Dune::OwnerOverlapCopyCommunication< GlobalIdType, LocalIdType >::buildOwnerCopyToOwnerCopyInterface ( ) const
inlineprotected

◆ buildOwnerOverlapToAllInterface()

template<class GlobalIdType, class LocalIdType = int>
void Dune::OwnerOverlapCopyCommunication< GlobalIdType, LocalIdType >::buildOwnerOverlapToAllInterface ( ) const
inlineprotected

◆ buildOwnerToAllInterface()

template<class GlobalIdType, class LocalIdType = int>
void Dune::OwnerOverlapCopyCommunication< GlobalIdType, LocalIdType >::buildOwnerToAllInterface ( ) const
inlineprotected

◆ communicator()

template<class GlobalIdType, class LocalIdType = int>
const CollectiveCommunication<MPI_Comm>& Dune::OwnerOverlapCopyCommunication< GlobalIdType, LocalIdType >::communicator ( ) const
inline

◆ copyCopyToAll()

template<class GlobalIdType, class LocalIdType = int>
template<class T >
void Dune::OwnerOverlapCopyCommunication< GlobalIdType, LocalIdType >::copyCopyToAll ( const T &  source,
T &  dest 
) const
inline

Communicate values from copy data points to all other data points.

source The data to send from. dest The data to send to.

◆ copyOwnerToAll()

template<class GlobalIdType, class LocalIdType = int>
template<class T >
void Dune::OwnerOverlapCopyCommunication< GlobalIdType, LocalIdType >::copyOwnerToAll ( const T &  source,
T &  dest 
) const
inline

Communicate values from owner data points to all other data points.

source The data to send from. dest The data to send to.

◆ dot()

template<class GlobalIdType, class LocalIdType = int>
template<class T1 , class T2 >
void Dune::OwnerOverlapCopyCommunication< GlobalIdType, LocalIdType >::dot ( const T1 &  x,
const T1 &  y,
T2 &  result 
) const
inline

Compute a global dot product of two vectors.

Parameters
xThe first vector of the product.
yThe second vector of the product.
resultReference to store the result in.

◆ freeGlobalLookup()

template<class GlobalIdType, class LocalIdType = int>
void Dune::OwnerOverlapCopyCommunication< GlobalIdType, LocalIdType >::freeGlobalLookup ( )
inline

◆ getSolverCategory()

template<class GlobalIdType, class LocalIdType = int>
SolverCategory::Category Dune::OwnerOverlapCopyCommunication< GlobalIdType, LocalIdType >::getSolverCategory ( ) const
inline

Get Solver Category.

Returns
The Solver Category.

◆ globalLookup()

template<class GlobalIdType, class LocalIdType = int>
const GlobalLookupIndexSet& Dune::OwnerOverlapCopyCommunication< GlobalIdType, LocalIdType >::globalLookup ( ) const
inline

◆ indexSet() [1/2]

template<class GlobalIdType, class LocalIdType = int>
const ParallelIndexSet& Dune::OwnerOverlapCopyCommunication< GlobalIdType, LocalIdType >::indexSet ( ) const
inline

Get the underlying parallel index set.

Returns
The underlying parallel index set.

◆ indexSet() [2/2]

template<class GlobalIdType, class LocalIdType = int>
ParallelIndexSet& Dune::OwnerOverlapCopyCommunication< GlobalIdType, LocalIdType >::indexSet ( )
inline

Get the underlying parallel index set.

Returns
The underlying parallel index set.

◆ norm()

template<class GlobalIdType, class LocalIdType = int>
template<class T1 >
FieldTraits<typename T1::field_type>::real_type Dune::OwnerOverlapCopyCommunication< GlobalIdType, LocalIdType >::norm ( const T1 &  x) const
inline

Compute the global euclidian norm of a vector.

Parameters
xThe vector to compute the norm of.
Returns
The global euclidian norm of that vector.

◆ project()

template<class GlobalIdType, class LocalIdType = int>
template<class T1 >
void Dune::OwnerOverlapCopyCommunication< GlobalIdType, LocalIdType >::project ( T1 &  x) const
inline

Set vector to zero at copy dofs.

Parameters
xThe vector to project.

◆ remoteIndices() [1/2]

template<class GlobalIdType, class LocalIdType = int>
const RemoteIndices& Dune::OwnerOverlapCopyCommunication< GlobalIdType, LocalIdType >::remoteIndices ( ) const
inline

Get the underlying remote indices.

Returns
The underlying remote indices.

◆ remoteIndices() [2/2]

template<class GlobalIdType, class LocalIdType = int>
RemoteIndices& Dune::OwnerOverlapCopyCommunication< GlobalIdType, LocalIdType >::remoteIndices ( )
inline

Get the underlying remote indices.

Returns
The underlying remote indices.

◆ setSolverCategory()

template<class GlobalIdType, class LocalIdType = int>
void Dune::OwnerOverlapCopyCommunication< GlobalIdType, LocalIdType >::setSolverCategory ( SolverCategory  set)
inline

Set right Solver Category (default is overlapping).

Friends And Related Function Documentation

◆ loadMatrixMarket

template<class GlobalIdType, class LocalIdType = int>
template<typename M , typename G , typename L >
void loadMatrixMarket ( M &  matrix,
const std::string &  filename,
OwnerOverlapCopyCommunication< G, L > &  comm,
bool  readIndices = true 
)
friend

Load a parallel matrix/vector stored in matrix market format.

More about the matrix market exchange format can be found here.

Parameters
matrixWhere to store the matrix/vector.
filenamethe name of the filename (without suffix and rank!) rank i will read the file filename_i.mm
commThe information about the data distribution.
readIndicesWhether to read the parallel index information. If true rank i reads the index information form file filename_i.idx And builds the remote indices information.

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