Loading...
Searching...
No Matches
owneroverlapcopy.hh
Go to the documentation of this file.
// SPDX-FileCopyrightText: Copyright © DUNE Project contributors, see file LICENSE.md in module root
// SPDX-License-Identifier: LicenseRef-GPL-2.0-only-with-DUNE-exception
// -*- tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*-
// vi: set et ts=4 sw=2 sts=2:
#ifndef DUNE_ISTL_OWNEROVERLAPCOPY_HH
#define DUNE_ISTL_OWNEROVERLAPCOPY_HH
#include <new>
#include <iostream>
#include <vector>
#include <list>
#include <map>
#include <set>
#include <tuple>
#include <cmath>
// MPI header
#if HAVE_MPI
#include <mpi.h>
#endif
#include <dune/common/enumset.hh>
#if HAVE_MPI
#include <dune/common/parallel/indexset.hh>
#include <dune/common/parallel/communicator.hh>
#include <dune/common/parallel/remoteindices.hh>
#include <dune/common/parallel/mpicommunication.hh>
#endif
#include "solvercategory.hh"
#include "istlexception.hh"
#include <dune/common/parallel/communication.hh>
#include <dune/istl/matrixmarket.hh>
template<int dim, template<class,class> class Comm>
void testRedistributed(int s);
namespace Dune {
struct OwnerOverlapCopyAttributeSet
{
enum AttributeSet {
owner=1, overlap=2, copy=3
};
};
template <class G, class L>
class IndexInfoFromGrid
{
public:
typedef G GlobalIdType;
typedef L LocalIdType;
typedef std::tuple<GlobalIdType,LocalIdType,int> IndexTripel;
typedef std::tuple<int,GlobalIdType,int> RemoteIndexTripel;
void addLocalIndex (const IndexTripel& x)
{
if (std::get<2>(x)!=OwnerOverlapCopyAttributeSet::owner &&
std::get<2>(x)!=OwnerOverlapCopyAttributeSet::overlap &&
std::get<2>(x)!=OwnerOverlapCopyAttributeSet::copy)
DUNE_THROW(ISTLError,"OwnerOverlapCopyCommunication: global index not in index set");
localindices.insert(x);
}
void addRemoteIndex (const RemoteIndexTripel& x)
{
if (std::get<2>(x)!=OwnerOverlapCopyAttributeSet::owner &&
std::get<2>(x)!=OwnerOverlapCopyAttributeSet::overlap &&
std::get<2>(x)!=OwnerOverlapCopyAttributeSet::copy)
DUNE_THROW(ISTLError,"OwnerOverlapCopyCommunication: global index not in index set");
remoteindices.insert(x);
}
const std::set<IndexTripel>& localIndices () const
{
return localindices;
}
const std::set<RemoteIndexTripel>& remoteIndices () const
{
return remoteindices;
}
void clear ()
{
localindices.clear();
remoteindices.clear();
}
private:
std::set<IndexTripel> localindices;
std::set<RemoteIndexTripel> remoteindices;
};
#if HAVE_MPI
template <class GlobalIdType, class LocalIdType=int>
class OwnerOverlapCopyCommunication
{
template<typename M, typename G, typename L>
friend void loadMatrixMarket(M&,
const std::string&,
OwnerOverlapCopyCommunication<G,L>&,
bool);
// used types
typedef typename IndexInfoFromGrid<GlobalIdType,LocalIdType>::IndexTripel IndexTripel;
typedef typename IndexInfoFromGrid<GlobalIdType,LocalIdType>::RemoteIndexTripel RemoteIndexTripel;
typedef typename std::set<IndexTripel>::const_iterator localindex_iterator;
typedef typename std::set<RemoteIndexTripel>::const_iterator remoteindex_iterator;
typedef typename OwnerOverlapCopyAttributeSet::AttributeSet AttributeSet;
typedef Dune::ParallelLocalIndex<AttributeSet> LI;
public:
typedef Dune::ParallelIndexSet<GlobalIdType,LI,512> PIS;
typedef Dune::RemoteIndices<PIS> RI;
typedef Dune::RemoteIndexListModifier<PIS,typename RI::Allocator,false> RILM;
typedef typename 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;
protected:
template<typename T>
struct CopyGatherScatter
{
typedef typename CommPolicy<T>::IndexedType V;
static V gather(const T& a, std::size_t i)
{
return a[i];
}
static void scatter(T& a, V v, std::size_t i)
{
a[i] = v;
}
};
template<typename T>
struct AddGatherScatter
{
typedef typename CommPolicy<T>::IndexedType V;
static V gather(const T& a, std::size_t i)
{
return a[i];
}
static void scatter(T& a, V v, std::size_t i)
{
a[i] += v;
}
};
void buildOwnerOverlapToAllInterface () const
{
if (OwnerOverlapToAllInterfaceBuilt)
OwnerOverlapToAllInterface.free();
OwnerOverlapSet sourceFlags;
Combine<OwnerOverlapSet,EnumItem<AttributeSet,OwnerOverlapCopyAttributeSet::copy>,AttributeSet>
destFlags;
OwnerOverlapToAllInterface.build(ri,sourceFlags,destFlags);
OwnerOverlapToAllInterfaceBuilt = true;
}
void buildOwnerToAllInterface () const
{
if (OwnerToAllInterfaceBuilt)
OwnerToAllInterface.free();
OwnerSet sourceFlags;
AllSet destFlags;
OwnerToAllInterface.build(ri,sourceFlags,destFlags);
OwnerToAllInterfaceBuilt = true;
}
void buildOwnerCopyToAllInterface () const
{
if (OwnerCopyToAllInterfaceBuilt)
OwnerCopyToAllInterface.free();
typedef Combine<EnumItem<AttributeSet,OwnerOverlapCopyAttributeSet::owner>,EnumItem<AttributeSet,OwnerOverlapCopyAttributeSet::copy>,AttributeSet> OwnerCopySet;
OwnerCopySet sourceFlags;
Combine<OwnerCopySet,EnumItem<AttributeSet,OwnerOverlapCopyAttributeSet::overlap>,AttributeSet> destFlags;
OwnerCopyToAllInterface.build(ri,sourceFlags,destFlags);
OwnerCopyToAllInterfaceBuilt = true;
}
void buildOwnerCopyToOwnerCopyInterface () const
{
if (OwnerCopyToOwnerCopyInterfaceBuilt)
OwnerCopyToOwnerCopyInterface.free();
typedef Combine<EnumItem<AttributeSet,OwnerOverlapCopyAttributeSet::owner>,EnumItem<AttributeSet,OwnerOverlapCopyAttributeSet::copy>,AttributeSet> OwnerCopySet;
OwnerCopySet sourceFlags;
OwnerCopySet destFlags;
OwnerCopyToOwnerCopyInterface.build(ri,sourceFlags,destFlags);
OwnerCopyToOwnerCopyInterfaceBuilt = true;
}
void buildCopyToAllInterface () const
{
if (CopyToAllInterfaceBuilt)
CopyToAllInterface.free();
CopySet sourceFlags;
AllSet destFlags;
CopyToAllInterface.build(ri,sourceFlags,destFlags);
CopyToAllInterfaceBuilt = true;
}
public:
SolverCategory::Category category () const {
return category_;
}
const Communication<MPI_Comm>& communicator() const
{
return cc;
}
template<class T>
void copyOwnerToAll (const T& source, T& dest) const
{
if (!OwnerToAllInterfaceBuilt)
buildOwnerToAllInterface ();
BC communicator;
communicator.template build<T>(OwnerToAllInterface);
communicator.template forward<CopyGatherScatter<T> >(source,dest);
communicator.free();
}
template<class T>
void copyCopyToAll (const T& source, T& dest) const
{
if (!CopyToAllInterfaceBuilt)
buildCopyToAllInterface ();
BC communicator;
communicator.template build<T>(CopyToAllInterface);
communicator.template forward<CopyGatherScatter<T> >(source,dest);
communicator.free();
}
template<class T>
void addOwnerOverlapToAll (const T& source, T& dest) const
{
if (!OwnerOverlapToAllInterfaceBuilt)
buildOwnerOverlapToAllInterface ();
BC communicator;
communicator.template build<T>(OwnerOverlapToAllInterface);
communicator.template forward<AddGatherScatter<T> >(source,dest);
communicator.free();
}
template<class T>
void addOwnerCopyToAll (const T& source, T& dest) const
{
if (!OwnerCopyToAllInterfaceBuilt)
buildOwnerCopyToAllInterface ();
BC communicator;
communicator.template build<T>(OwnerCopyToAllInterface);
communicator.template forward<AddGatherScatter<T> >(source,dest);
communicator.free();
}
template<class T>
void addOwnerCopyToOwnerCopy (const T& source, T& dest) const
{
if (!OwnerCopyToOwnerCopyInterfaceBuilt)
buildOwnerCopyToOwnerCopyInterface ();
BC communicator;
communicator.template build<T>(OwnerCopyToOwnerCopyInterface);
communicator.template forward<AddGatherScatter<T> >(source,dest);
communicator.free();
}
template<class T1, class T2>
void dot (const T1& x, const T1& y, T2& result) const
{
using real_type = typename FieldTraits<typename T1::field_type>::real_type;
// set up mask vector
if (mask.size()!=static_cast<typename std::vector<double>::size_type>(x.size()))
{
mask.resize(x.size());
for (typename std::vector<double>::size_type i=0; i<mask.size(); i++)
mask[i] = 1;
for (typename PIS::const_iterator i=pis.begin(); i!=pis.end(); ++i)
if (i->local().attribute()!=OwnerOverlapCopyAttributeSet::owner)
mask[i->local().local()] = 0;
}
result = T2(0.0);
for (typename T1::size_type i=0; i<x.size(); i++)
result += (x[i]*(y[i]))*static_cast<real_type>(mask[i]);
result = cc.sum(result);
}
template<class T1>
typename FieldTraits<typename T1::field_type>::real_type norm (const T1& x) const
{
using real_type = typename FieldTraits<typename T1::field_type>::real_type;
// set up mask vector
if (mask.size()!=static_cast<typename std::vector<double>::size_type>(x.size()))
{
mask.resize(x.size());
for (typename std::vector<double>::size_type i=0; i<mask.size(); i++)
mask[i] = 1;
for (typename PIS::const_iterator i=pis.begin(); i!=pis.end(); ++i)
if (i->local().attribute()!=OwnerOverlapCopyAttributeSet::owner)
mask[i->local().local()] = 0;
}
auto result = real_type(0.0);
for (typename T1::size_type i=0; i<x.size(); i++)
result += Impl::asVector(x[i]).two_norm2()*mask[i];
using std::sqrt;
return sqrt(cc.sum(result));
}
typedef Dune::EnumItem<AttributeSet,OwnerOverlapCopyAttributeSet::copy> CopyFlags;
typedef Dune::ParallelIndexSet<GlobalIdType,LI,512> ParallelIndexSet;
typedef Dune::RemoteIndices<PIS> RemoteIndices;
typedef Dune::GlobalLookupIndexSet<ParallelIndexSet> GlobalLookupIndexSet;
const ParallelIndexSet& indexSet() const
{
return pis;
}
const RemoteIndices& remoteIndices() const
{
return ri;
}
ParallelIndexSet& indexSet()
{
return pis;
}
RemoteIndices& remoteIndices()
{
return ri;
}
void buildGlobalLookup()
{
if(globalLookup_) {
if(pis.seqNo()==oldseqNo)
// Nothing changed!
return;
delete globalLookup_;
}
globalLookup_ = new GlobalLookupIndexSet(pis);
oldseqNo = pis.seqNo();
}
void buildGlobalLookup(std::size_t size)
{
if(globalLookup_) {
if(pis.seqNo()==oldseqNo)
// Nothing changed!
return;
delete globalLookup_;
}
globalLookup_ = new GlobalLookupIndexSet(pis, size);
oldseqNo = pis.seqNo();
}
void freeGlobalLookup()
{
delete globalLookup_;
globalLookup_=0;
}
const GlobalLookupIndexSet& globalLookup() const
{
assert(globalLookup_ != 0);
return *globalLookup_;
}
template<class T1>
void project (T1& x) const
{
for (typename PIS::const_iterator i=pis.begin(); i!=pis.end(); ++i)
if (i->local().attribute()==OwnerOverlapCopyAttributeSet::copy)
x[i->local().local()] = 0;
}
OwnerOverlapCopyCommunication (MPI_Comm comm_,
SolverCategory::Category cat_ = SolverCategory::overlapping,
bool freecomm_ = false)
: comm(comm_), cc(comm_), pis(), ri(pis,pis,comm_),
OwnerToAllInterfaceBuilt(false), OwnerOverlapToAllInterfaceBuilt(false),
OwnerCopyToAllInterfaceBuilt(false), OwnerCopyToOwnerCopyInterfaceBuilt(false),
CopyToAllInterfaceBuilt(false), globalLookup_(0), category_(cat_),
freecomm(freecomm_)
{}
OwnerOverlapCopyCommunication (SolverCategory::Category cat_ = SolverCategory::overlapping)
: comm(MPI_COMM_WORLD), cc(MPI_COMM_WORLD), pis(), ri(pis,pis,MPI_COMM_WORLD),
OwnerToAllInterfaceBuilt(false), OwnerOverlapToAllInterfaceBuilt(false),
OwnerCopyToAllInterfaceBuilt(false), OwnerCopyToOwnerCopyInterfaceBuilt(false),
CopyToAllInterfaceBuilt(false), globalLookup_(0), category_(cat_), freecomm(false)
{}
OwnerOverlapCopyCommunication (const IndexInfoFromGrid<GlobalIdType, LocalIdType>& indexinfo,
MPI_Comm comm_,
SolverCategory::Category cat_ = SolverCategory::overlapping,
bool freecomm_ = false)
: comm(comm_), cc(comm_), OwnerToAllInterfaceBuilt(false),
OwnerOverlapToAllInterfaceBuilt(false), OwnerCopyToAllInterfaceBuilt(false),
OwnerCopyToOwnerCopyInterfaceBuilt(false), CopyToAllInterfaceBuilt(false),
globalLookup_(0), category_(cat_), freecomm(freecomm_)
{
// set up an ISTL index set
pis.beginResize();
for (localindex_iterator i=indexinfo.localIndices().begin(); i!=indexinfo.localIndices().end(); ++i)
{
if (std::get<2>(*i)==OwnerOverlapCopyAttributeSet::owner)
pis.add(std::get<0>(*i),LI(std::get<1>(*i),OwnerOverlapCopyAttributeSet::owner,true));
if (std::get<2>(*i)==OwnerOverlapCopyAttributeSet::overlap)
pis.add(std::get<0>(*i),LI(std::get<1>(*i),OwnerOverlapCopyAttributeSet::overlap,true));
if (std::get<2>(*i)==OwnerOverlapCopyAttributeSet::copy)
pis.add(std::get<0>(*i),LI(std::get<1>(*i),OwnerOverlapCopyAttributeSet::copy,true));
// std::cout << cc.rank() << ": adding index " << std::get<0>(*i) << " " << std::get<1>(*i) << " " << std::get<2>(*i) << std::endl;
}
pis.endResize();
// build remote indices WITHOUT communication
// std::cout << cc.rank() << ": build remote indices" << std::endl;
ri.setIndexSets(pis,pis,cc);
if (indexinfo.remoteIndices().size()>0)
{
remoteindex_iterator i=indexinfo.remoteIndices().begin();
int p = std::get<0>(*i);
RILM modifier = ri.template getModifier<false,true>(p);
typename PIS::const_iterator pi=pis.begin();
for ( ; i!=indexinfo.remoteIndices().end(); ++i)
{
// handle processor change
if (p!=std::get<0>(*i))
{
p = std::get<0>(*i);
modifier = ri.template getModifier<false,true>(p);
pi=pis.begin();
}
// position to correct entry in parallel index set
while (pi->global()!=std::get<1>(*i) && pi!=pis.end())
++pi;
if (pi==pis.end())
DUNE_THROW(ISTLError,"OwnerOverlapCopyCommunication: global index not in index set");
// insert entry
// std::cout << cc.rank() << ": adding remote index " << std::get<0>(*i) << " " << std::get<1>(*i) << " " << std::get<2>(*i) << std::endl;
if (std::get<2>(*i)==OwnerOverlapCopyAttributeSet::owner)
modifier.insert(RX(OwnerOverlapCopyAttributeSet::owner,&(*pi)));
if (std::get<2>(*i)==OwnerOverlapCopyAttributeSet::overlap)
modifier.insert(RX(OwnerOverlapCopyAttributeSet::overlap,&(*pi)));
if (std::get<2>(*i)==OwnerOverlapCopyAttributeSet::copy)
modifier.insert(RX(OwnerOverlapCopyAttributeSet::copy,&(*pi)));
}
}else{
// Force remote indices to be synced!
ri.template getModifier<false,true>(0);
}
}
// destructor: free memory in some objects
~OwnerOverlapCopyCommunication ()
{
ri.free();
if (OwnerToAllInterfaceBuilt) OwnerToAllInterface.free();
if (OwnerOverlapToAllInterfaceBuilt) OwnerOverlapToAllInterface.free();
if (OwnerCopyToAllInterfaceBuilt) OwnerCopyToAllInterface.free();
if (OwnerCopyToOwnerCopyInterfaceBuilt) OwnerCopyToOwnerCopyInterface.free();
if (CopyToAllInterfaceBuilt) CopyToAllInterface.free();
if (globalLookup_) delete globalLookup_;
if (freecomm && (comm != MPI_COMM_NULL))
{
// If it is possible to query whether MPI_Finalize
// was called, only free the communicator before
// calling MPI_Finalize.
int wasFinalized = 0;
MPI_Finalized(&wasFinalized);
if (!wasFinalized) {
MPI_Comm_free(&comm);
}
}
}
private:
OwnerOverlapCopyCommunication (const OwnerOverlapCopyCommunication&)
{}
MPI_Comm comm;
Communication<MPI_Comm> cc;
PIS pis;
RI ri;
mutable IF OwnerToAllInterface;
mutable bool OwnerToAllInterfaceBuilt;
mutable IF OwnerOverlapToAllInterface;
mutable bool OwnerOverlapToAllInterfaceBuilt;
mutable IF OwnerCopyToAllInterface;
mutable bool OwnerCopyToAllInterfaceBuilt;
mutable IF OwnerCopyToOwnerCopyInterface;
mutable bool OwnerCopyToOwnerCopyInterfaceBuilt;
mutable IF CopyToAllInterface;
mutable bool CopyToAllInterfaceBuilt;
mutable std::vector<double> mask;
int oldseqNo;
GlobalLookupIndexSet* globalLookup_;
const SolverCategory::Category category_;
bool freecomm;
};
#endif
} // end namespace
#endif
testRedistributed
void testRedistributed(int s)
istlexception.hh
solvercategory.hh
matrixmarket.hh
Provides classes for reading and writing MatrixMarket Files with an extension for parallel matrices.
Dune
Definition allocator.hh:11
Dune::ISTLError
derive error class from the base class in common
Definition istlexception.hh:19
Dune::OwnerOverlapCopyAttributeSet
Attribute set for overlapping Schwarz.
Definition owneroverlapcopy.hh:59
Dune::OwnerOverlapCopyAttributeSet::AttributeSet
AttributeSet
Definition owneroverlapcopy.hh:60
Dune::OwnerOverlapCopyAttributeSet::owner
@ owner
Definition owneroverlapcopy.hh:61
Dune::OwnerOverlapCopyAttributeSet::copy
@ copy
Definition owneroverlapcopy.hh:61
Dune::OwnerOverlapCopyAttributeSet::overlap
@ overlap
Definition owneroverlapcopy.hh:61
Dune::IndexInfoFromGrid
Information about the index distribution.
Definition owneroverlapcopy.hh:78
Dune::IndexInfoFromGrid::IndexTripel
std::tuple< GlobalIdType, LocalIdType, int > IndexTripel
A triple describing a local index.
Definition owneroverlapcopy.hh:92
Dune::IndexInfoFromGrid::addRemoteIndex
void addRemoteIndex(const RemoteIndexTripel &x)
Add a new remote index triple to the set of remote indices.
Definition owneroverlapcopy.hh:120
Dune::IndexInfoFromGrid::GlobalIdType
G GlobalIdType
The type of the global index.
Definition owneroverlapcopy.hh:81
Dune::IndexInfoFromGrid::localIndices
const std::set< IndexTripel > & localIndices() const
Get the set of indices local to the process.
Definition owneroverlapcopy.hh:133
Dune::IndexInfoFromGrid::remoteIndices
const std::set< RemoteIndexTripel > & remoteIndices() const
Get the set of remote indices.
Definition owneroverlapcopy.hh:142
Dune::IndexInfoFromGrid::LocalIdType
L LocalIdType
The type of the local index.
Definition owneroverlapcopy.hh:84
Dune::IndexInfoFromGrid::clear
void clear()
Remove all indices from the sets.
Definition owneroverlapcopy.hh:150
Dune::IndexInfoFromGrid::addLocalIndex
void addLocalIndex(const IndexTripel &x)
Add a new index triple to the set of local indices.
Definition owneroverlapcopy.hh:106
Dune::IndexInfoFromGrid::RemoteIndexTripel
std::tuple< int, GlobalIdType, int > RemoteIndexTripel
A triple describing a remote index.
Definition owneroverlapcopy.hh:99
Dune::OwnerOverlapCopyCommunication
A class setting up standard communication for a two-valued attribute set with owner/overlap/copy sema...
Definition owneroverlapcopy.hh:174
Dune::OwnerOverlapCopyCommunication< T, T1 >::CopySet
EnumItem< AttributeSet, OwnerOverlapCopyAttributeSet::copy > CopySet
Definition owneroverlapcopy.hh:195
Dune::OwnerOverlapCopyCommunication::globalLookup
const GlobalLookupIndexSet & globalLookup() const
Definition owneroverlapcopy.hh:526
Dune::OwnerOverlapCopyCommunication::norm
FieldTraits< typenameT1::field_type >::real_type norm(const T1 &x) const
Compute the global Euclidean norm of a vector.
Definition owneroverlapcopy.hh:425
Dune::OwnerOverlapCopyCommunication::buildOwnerOverlapToAllInterface
void buildOwnerOverlapToAllInterface() const
Definition owneroverlapcopy.hh:233
Dune::OwnerOverlapCopyCommunication< T, T1 >::PIS
Dune::ParallelIndexSet< T, LI, 512 > PIS
Definition owneroverlapcopy.hh:188
Dune::OwnerOverlapCopyCommunication::buildOwnerCopyToAllInterface
void buildOwnerCopyToAllInterface() const
Definition owneroverlapcopy.hh:254
Dune::OwnerOverlapCopyCommunication::buildOwnerCopyToOwnerCopyInterface
void buildOwnerCopyToOwnerCopyInterface() const
Definition owneroverlapcopy.hh:266
Dune::OwnerOverlapCopyCommunication::OwnerOverlapCopyCommunication
OwnerOverlapCopyCommunication(const IndexInfoFromGrid< GlobalIdType, LocalIdType > &indexinfo, MPI_Comm comm_, SolverCategory::Category cat_=SolverCategory::overlapping, bool freecomm_=false)
Constructor.
Definition owneroverlapcopy.hh:586
Dune::OwnerOverlapCopyCommunication::category
SolverCategory::Category category() const
Get Solver Category.
Definition owneroverlapcopy.hh:295
Dune::OwnerOverlapCopyCommunication::addOwnerCopyToOwnerCopy
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 thos...
Definition owneroverlapcopy.hh:379
Dune::OwnerOverlapCopyCommunication::buildCopyToAllInterface
void buildCopyToAllInterface() const
Definition owneroverlapcopy.hh:279
Dune::OwnerOverlapCopyCommunication< T, T1 >::CopyFlags
Dune::EnumItem< AttributeSet, OwnerOverlapCopyAttributeSet::copy > CopyFlags
Definition owneroverlapcopy.hh:446
Dune::OwnerOverlapCopyCommunication::remoteIndices
RemoteIndices & remoteIndices()
Get the underlying remote indices.
Definition owneroverlapcopy.hh:490
Dune::OwnerOverlapCopyCommunication::indexSet
const ParallelIndexSet & indexSet() const
Get the underlying parallel index set.
Definition owneroverlapcopy.hh:462
Dune::OwnerOverlapCopyCommunication< T, T1 >::RI
Dune::RemoteIndices< PIS > RI
Definition owneroverlapcopy.hh:189
Dune::OwnerOverlapCopyCommunication::buildGlobalLookup
void buildGlobalLookup(std::size_t size)
Definition owneroverlapcopy.hh:508
Dune::OwnerOverlapCopyCommunication::addOwnerOverlapToAll
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.
Definition owneroverlapcopy.hh:345
Dune::OwnerOverlapCopyCommunication< T, T1 >::RemoteIndices
Dune::RemoteIndices< PIS > RemoteIndices
Definition owneroverlapcopy.hh:452
Dune::OwnerOverlapCopyCommunication::project
void project(T1 &x) const
Set vector to zero at copy dofs.
Definition owneroverlapcopy.hh:538
Dune::OwnerOverlapCopyCommunication< T, T1 >::AllSet
Dune::AllSet< AttributeSet > AllSet
Definition owneroverlapcopy.hh:197
Dune::OwnerOverlapCopyCommunication< T, T1 >::OwnerOverlapSet
Combine< EnumItem< AttributeSet, OwnerOverlapCopyAttributeSet::owner >, EnumItem< AttributeSet, OwnerOverlapCopyAttributeSet::overlap >, AttributeSet > OwnerOverlapSet
Definition owneroverlapcopy.hh:196
Dune::OwnerOverlapCopyCommunication::copyCopyToAll
void copyCopyToAll(const T &source, T &dest) const
Communicate values from copy data points to all other data points.
Definition owneroverlapcopy.hh:328
Dune::OwnerOverlapCopyCommunication< T, T1 >::GlobalLookupIndexSet
Dune::GlobalLookupIndexSet< ParallelIndexSet > GlobalLookupIndexSet
Definition owneroverlapcopy.hh:456
Dune::OwnerOverlapCopyCommunication< T, T1 >::IF
Dune::Interface IF
Definition owneroverlapcopy.hh:193
Dune::OwnerOverlapCopyCommunication::~OwnerOverlapCopyCommunication
~OwnerOverlapCopyCommunication()
Definition owneroverlapcopy.hh:650
Dune::OwnerOverlapCopyCommunication::buildGlobalLookup
void buildGlobalLookup()
Definition owneroverlapcopy.hh:495
Dune::OwnerOverlapCopyCommunication< T, T1 >::BC
Dune::BufferedCommunicator BC
Definition owneroverlapcopy.hh:192
Dune::OwnerOverlapCopyCommunication::OwnerOverlapCopyCommunication
OwnerOverlapCopyCommunication(MPI_Comm comm_, SolverCategory::Category cat_=SolverCategory::overlapping, bool freecomm_=false)
Construct the communication without any indices.
Definition owneroverlapcopy.hh:554
Dune::OwnerOverlapCopyCommunication::indexSet
ParallelIndexSet & indexSet()
Get the underlying parallel index set.
Definition owneroverlapcopy.hh:480
Dune::OwnerOverlapCopyCommunication::dot
void dot(const T1 &x, const T1 &y, T2 &result) const
Compute a global dot product of two vectors.
Definition owneroverlapcopy.hh:398
Dune::OwnerOverlapCopyCommunication::communicator
const Communication< MPI_Comm > & communicator() const
Definition owneroverlapcopy.hh:299
Dune::OwnerOverlapCopyCommunication::OwnerOverlapCopyCommunication
OwnerOverlapCopyCommunication(SolverCategory::Category cat_=SolverCategory::overlapping)
Construct the communication without any indices using MPI_COMM_WORLD.
Definition owneroverlapcopy.hh:572
Dune::OwnerOverlapCopyCommunication< T, T1 >::OwnerSet
EnumItem< AttributeSet, OwnerOverlapCopyAttributeSet::owner > OwnerSet
Definition owneroverlapcopy.hh:194
Dune::OwnerOverlapCopyCommunication::loadMatrixMarket
friend void loadMatrixMarket(M &, const std::string &, OwnerOverlapCopyCommunication< G, L > &, bool)
Load a parallel matrix/vector stored in matrix market format.
Definition matrixmarket.hh:1312
Dune::OwnerOverlapCopyCommunication::copyOwnerToAll
void copyOwnerToAll(const T &source, T &dest) const
Communicate values from owner data points to all other data points.
Definition owneroverlapcopy.hh:311
Dune::OwnerOverlapCopyCommunication::remoteIndices
const RemoteIndices & remoteIndices() const
Get the underlying remote indices.
Definition owneroverlapcopy.hh:471
Dune::OwnerOverlapCopyCommunication< T, T1 >::RX
RI::RemoteIndex RX
Definition owneroverlapcopy.hh:191
Dune::OwnerOverlapCopyCommunication::addOwnerCopyToAll
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 val...
Definition owneroverlapcopy.hh:362
Dune::OwnerOverlapCopyCommunication::freeGlobalLookup
void freeGlobalLookup()
Definition owneroverlapcopy.hh:520
Dune::OwnerOverlapCopyCommunication< T, T1 >::RILM
Dune::RemoteIndexListModifier< PIS, typename RI::Allocator, false > RILM
Definition owneroverlapcopy.hh:190
Dune::OwnerOverlapCopyCommunication< T, T1 >::ParallelIndexSet
Dune::ParallelIndexSet< T, LI, 512 > ParallelIndexSet
Definition owneroverlapcopy.hh:449
Dune::OwnerOverlapCopyCommunication::buildOwnerToAllInterface
void buildOwnerToAllInterface() const
Definition owneroverlapcopy.hh:244
Dune::OwnerOverlapCopyCommunication::CopyGatherScatter
gather/scatter callback for communication
Definition owneroverlapcopy.hh:204
Dune::OwnerOverlapCopyCommunication::CopyGatherScatter::gather
static V gather(const T &a, std::size_t i)
Definition owneroverlapcopy.hh:207
Dune::OwnerOverlapCopyCommunication::CopyGatherScatter::scatter
static void scatter(T &a, V v, std::size_t i)
Definition owneroverlapcopy.hh:212
Dune::OwnerOverlapCopyCommunication::CopyGatherScatter::V
CommPolicy< T >::IndexedType V
Definition owneroverlapcopy.hh:205
Dune::OwnerOverlapCopyCommunication::AddGatherScatter
Definition owneroverlapcopy.hh:219
Dune::OwnerOverlapCopyCommunication::AddGatherScatter::V
CommPolicy< T >::IndexedType V
Definition owneroverlapcopy.hh:220
Dune::OwnerOverlapCopyCommunication::AddGatherScatter::gather
static V gather(const T &a, std::size_t i)
Definition owneroverlapcopy.hh:222
Dune::OwnerOverlapCopyCommunication::AddGatherScatter::scatter
static void scatter(T &a, V v, std::size_t i)
Definition owneroverlapcopy.hh:227
Dune::SolverCategory::Category
Category
Definition solvercategory.hh:23
Dune::SolverCategory::overlapping
@ overlapping
Category for overlapping solvers.
Definition solvercategory.hh:29