dune-istl  2.2.1
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::owner
OwnerSet
typedef EnumItem< AttributeSet,
OwnerOverlapCopyAttributeSet::copy
CopySet
typedef Combine< EnumItem
< AttributeSet,
OwnerOverlapCopyAttributeSet::owner >
, EnumItem< AttributeSet,
OwnerOverlapCopyAttributeSet::overlap >
, AttributeSet
OwnerOverlapSet
typedef Dune::AllSet
< AttributeSet
AllSet
typedef Dune::EnumItem
< AttributeSet,
OwnerOverlapCopyAttributeSet::copy
CopyFlags
typedef Dune::ParallelIndexSet
< GlobalIdType, LI, 512 > 
ParallelIndexSet
 The type of the parallel index set.
typedef Dune::RemoteIndices< PISRemoteIndices
 The type of the remote indices.
typedef
Dune::GlobalLookupIndexSet
< ParallelIndexSet
GlobalLookupIndexSet
 The type of the reverse lookup of indices.

Public Member Functions

void setSolverCategory (SolverCategory set)
 Set right Solver Category (default is overlapping).
const SolverCategory::Category getSolverCategory () const
 Set Solver Category.
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.
template<class T >
void copyCopyToAll (const T &source, T &dest) const
 Communicate values from copy data points to all other data points.
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.
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.
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.
template<class T1 , class T2 >
void dot (const T1 &x, const T1 &y, T2 &result) const
 Compute a global dot product of two vectors.
template<class T1 >
double norm (const T1 &x) const
 Compute the global euclidian norm of a vector.
const ParallelIndexSetindexSet () const
 Get the underlying parallel index set.
const RemoteIndicesremoteIndices () const
 Get the underlying remote indices.
ParallelIndexSetindexSet ()
 Get the underlying parallel index set.
RemoteIndicesremoteIndices ()
 Get the underlying remote indices.
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.
 OwnerOverlapCopyCommunication (MPI_Comm comm_, SolverCategory::Category cat_=SolverCategory::overlapping, bool freecomm_=false)
 Construct the communication without any indices.
 OwnerOverlapCopyCommunication (SolverCategory::Category cat_=SolverCategory::overlapping)
 Construct the communication without any indices using MPI_COMM_WORLD.
 OwnerOverlapCopyCommunication (const IndexInfoFromGrid< GlobalIdType, LocalIdType > &indexinfo, MPI_Comm comm_, SolverCategory::Category cat_=SolverCategory::overlapping, bool freecomm_=false)
 Constructor.
 ~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.

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

template<class GlobalIdType, class LocalIdType = int>
typedef Dune::AllSet<AttributeSet> Dune::OwnerOverlapCopyCommunication< GlobalIdType, LocalIdType >::AllSet
template<class GlobalIdType, class LocalIdType = int>
typedef Dune::BufferedCommunicator Dune::OwnerOverlapCopyCommunication< GlobalIdType, LocalIdType >::BC
template<class GlobalIdType, class LocalIdType = int>
typedef Dune::EnumItem<AttributeSet,OwnerOverlapCopyAttributeSet::copy> Dune::OwnerOverlapCopyCommunication< GlobalIdType, LocalIdType >::CopyFlags
template<class GlobalIdType, class LocalIdType = int>
typedef EnumItem<AttributeSet,OwnerOverlapCopyAttributeSet::copy> Dune::OwnerOverlapCopyCommunication< GlobalIdType, LocalIdType >::CopySet
template<class GlobalIdType, class LocalIdType = int>
typedef Dune::GlobalLookupIndexSet<ParallelIndexSet> Dune::OwnerOverlapCopyCommunication< GlobalIdType, LocalIdType >::GlobalLookupIndexSet

The type of the reverse lookup of indices.

template<class GlobalIdType, class LocalIdType = int>
typedef Dune::Interface Dune::OwnerOverlapCopyCommunication< GlobalIdType, LocalIdType >::IF
template<class GlobalIdType, class LocalIdType = int>
typedef Combine<EnumItem<AttributeSet,OwnerOverlapCopyAttributeSet::owner>,EnumItem<AttributeSet,OwnerOverlapCopyAttributeSet::overlap>,AttributeSet> Dune::OwnerOverlapCopyCommunication< GlobalIdType, LocalIdType >::OwnerOverlapSet
template<class GlobalIdType, class LocalIdType = int>
typedef EnumItem<AttributeSet,OwnerOverlapCopyAttributeSet::owner> Dune::OwnerOverlapCopyCommunication< GlobalIdType, LocalIdType >::OwnerSet
template<class GlobalIdType, class LocalIdType = int>
typedef Dune::ParallelIndexSet<GlobalIdType,LI,512> Dune::OwnerOverlapCopyCommunication< GlobalIdType, LocalIdType >::ParallelIndexSet

The type of the parallel index set.

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

The type of the remote indices.

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

Constructor & Destructor Documentation

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
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.
  @param cat_ The Solver category, default is overlapping

is false

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

References Dune::OwnerOverlapCopyAttributeSet::copy, Dune::IndexInfoFromGrid< G, L >::localIndices(), Dune::OwnerOverlapCopyAttributeSet::overlap, Dune::OwnerOverlapCopyAttributeSet::owner, and Dune::IndexInfoFromGrid< G, L >::remoteIndices().

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

Member Function Documentation

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.

References Dune::OwnerOverlapCopyCommunication< GlobalIdType, LocalIdType >::buildOwnerCopyToAllInterface(), and Dune::OwnerOverlapCopyCommunication< GlobalIdType, LocalIdType >::communicator().

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.

References Dune::OwnerOverlapCopyCommunication< GlobalIdType, LocalIdType >::buildOwnerCopyToOwnerCopyInterface(), and Dune::OwnerOverlapCopyCommunication< GlobalIdType, LocalIdType >::communicator().

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.

References Dune::OwnerOverlapCopyCommunication< GlobalIdType, LocalIdType >::buildOwnerOverlapToAllInterface(), and Dune::OwnerOverlapCopyCommunication< GlobalIdType, LocalIdType >::communicator().

template<class GlobalIdType, class LocalIdType = int>
void Dune::OwnerOverlapCopyCommunication< GlobalIdType, LocalIdType >::buildCopyToAllInterface ( ) const
inlineprotected
template<class GlobalIdType, class LocalIdType = int>
void Dune::OwnerOverlapCopyCommunication< GlobalIdType, LocalIdType >::buildGlobalLookup ( )
inline
template<class GlobalIdType, class LocalIdType = int>
void Dune::OwnerOverlapCopyCommunication< GlobalIdType, LocalIdType >::buildGlobalLookup ( std::size_t  size)
inline
template<class GlobalIdType, class LocalIdType = int>
void Dune::OwnerOverlapCopyCommunication< GlobalIdType, LocalIdType >::buildOwnerCopyToAllInterface ( ) const
inlineprotected
template<class GlobalIdType, class LocalIdType = int>
void Dune::OwnerOverlapCopyCommunication< GlobalIdType, LocalIdType >::buildOwnerCopyToOwnerCopyInterface ( ) const
inlineprotected
template<class GlobalIdType, class LocalIdType = int>
void Dune::OwnerOverlapCopyCommunication< GlobalIdType, LocalIdType >::buildOwnerOverlapToAllInterface ( ) const
inlineprotected
template<class GlobalIdType, class LocalIdType = int>
void Dune::OwnerOverlapCopyCommunication< GlobalIdType, LocalIdType >::buildOwnerToAllInterface ( ) const
inlineprotected
template<class GlobalIdType, class LocalIdType = int>
const CollectiveCommunication<MPI_Comm>& Dune::OwnerOverlapCopyCommunication< GlobalIdType, LocalIdType >::communicator ( ) const
inline
template<class GlobalIdType, class LocalIdType = int>
template<class T >
void Dune::OwnerOverlapCopyCommunication< GlobalIdType, LocalIdType >::copyCopyToAll ( const T &  source,
T &  dest 
) const
inline
template<class GlobalIdType, class LocalIdType = int>
template<class T >
void Dune::OwnerOverlapCopyCommunication< GlobalIdType, LocalIdType >::copyOwnerToAll ( const T &  source,
T &  dest 
) const
inline
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.

References Dune::OwnerOverlapCopyAttributeSet::owner.

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

Referenced by Dune::fillIndexSetHoles().

template<class GlobalIdType, class LocalIdType = int>
const SolverCategory::Category Dune::OwnerOverlapCopyCommunication< GlobalIdType, LocalIdType >::getSolverCategory ( ) const
inline
template<class GlobalIdType, class LocalIdType = int>
const GlobalLookupIndexSet& Dune::OwnerOverlapCopyCommunication< GlobalIdType, LocalIdType >::globalLookup ( ) const
inline
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.

Referenced by Dune::buildCommunication(), Dune::fillIndexSetHoles(), Dune::graphRepartition(), and Dune::storeMatrixMarket().

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.
template<class GlobalIdType, class LocalIdType = int>
template<class T1 >
double 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.

References Dune::OwnerOverlapCopyAttributeSet::owner.

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.

References Dune::OwnerOverlapCopyAttributeSet::copy.

Referenced by Dune::Amg::Transfer< V, V1, OwnerOverlapCopyCommunication< T1, T2 > >::restrict().

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

Get the underlying remote indices.

Returns
The underlying remote indices.
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

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: