dune-istl  2.3.1
owneroverlapcopy.hh
Go to the documentation of this file.
1 // -*- tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*-
2 // vi: set et ts=4 sw=2 sts=2:
3 // $Id$
4 #ifndef DUNE_OWNEROVERLAPCOPY_HH
5 #define DUNE_OWNEROVERLAPCOPY_HH
6 
7 #include <new>
8 #include <iostream>
9 #include <vector>
10 #include <list>
11 #include <map>
12 #include <set>
13 
14 #include "cmath"
15 
16 // MPI header
17 #if HAVE_MPI
18 #include <mpi.h>
19 #endif
20 
21 
22 #include <dune/common/tuples.hh>
23 #include <dune/common/enumset.hh>
24 
25 #if HAVE_MPI
26 #include <dune/common/parallel/indexset.hh>
27 #include <dune/common/parallel/communicator.hh>
28 #include <dune/common/parallel/remoteindices.hh>
29 #include <dune/common/parallel/mpicollectivecommunication.hh>
30 #endif
31 
32 #include "solvercategory.hh"
33 #include "istlexception.hh"
34 #include <dune/common/parallel/collectivecommunication.hh>
35 
36 template<int dim, template<class,class> class Comm>
37 void testRedistributed(int s);
38 
39 
40 namespace Dune {
41 
58  {
59  enum AttributeSet {
60  owner=1, overlap=2, copy=3
61  };
62  };
63 
75  template <class G, class L>
77  {
78  public:
80  typedef G GlobalIdType;
81 
83  typedef L LocalIdType;
84 
91  typedef tuple<GlobalIdType,LocalIdType,int> IndexTripel;
98  typedef tuple<int,GlobalIdType,int> RemoteIndexTripel;
99 
105  void addLocalIndex (const IndexTripel& x)
106  {
107  if (get<2>(x)!=OwnerOverlapCopyAttributeSet::owner &&
110  DUNE_THROW(ISTLError,"OwnerOverlapCopyCommunication: global index not in index set");
111  localindices.insert(x);
112  }
113 
120  {
121  if (get<2>(x)!=OwnerOverlapCopyAttributeSet::owner &&
124  DUNE_THROW(ISTLError,"OwnerOverlapCopyCommunication: global index not in index set");
125  remoteindices.insert(x);
126  }
127 
132  const std::set<IndexTripel>& localIndices () const
133  {
134  return localindices;
135  }
136 
141  const std::set<RemoteIndexTripel>& remoteIndices () const
142  {
143  return remoteindices;
144  }
145 
149  void clear ()
150  {
151  localindices.clear();
152  remoteindices.clear();
153  }
154 
155  private:
157  std::set<IndexTripel> localindices;
159  std::set<RemoteIndexTripel> remoteindices;
160  };
161 
162 
163 #if HAVE_MPI
164 
171  template <class GlobalIdType, class LocalIdType=int>
173  {
174  template<typename M, typename G, typename L>
175  friend void loadMatrixMarket(M&,
176  const std::string&,
178  bool);
179  // used types
181  typedef typename IndexInfoFromGrid<GlobalIdType,LocalIdType>::RemoteIndexTripel RemoteIndexTripel;
182  typedef typename std::set<IndexTripel>::const_iterator localindex_iterator;
183  typedef typename std::set<RemoteIndexTripel>::const_iterator remoteindex_iterator;
185  typedef Dune::ParallelLocalIndex<AttributeSet> LI;
186  public:
187  typedef Dune::ParallelIndexSet<GlobalIdType,LI,512> PIS;
188  typedef Dune::RemoteIndices<PIS> RI;
189  typedef Dune::RemoteIndexListModifier<PIS,typename RI::Allocator,false> RILM;
190  typedef typename RI::RemoteIndex RX;
191  typedef Dune::BufferedCommunicator BC;
192  typedef Dune::Interface IF;
193  typedef EnumItem<AttributeSet,OwnerOverlapCopyAttributeSet::owner> OwnerSet;
194  typedef EnumItem<AttributeSet,OwnerOverlapCopyAttributeSet::copy> CopySet;
195  typedef Combine<EnumItem<AttributeSet,OwnerOverlapCopyAttributeSet::owner>,EnumItem<AttributeSet,OwnerOverlapCopyAttributeSet::overlap>,AttributeSet> OwnerOverlapSet;
196  typedef Dune::AllSet<AttributeSet> AllSet;
197  protected:
198 
199 
201  template<typename T>
203  {
204  typedef typename CommPolicy<T>::IndexedType V;
205 
206  static V gather(const T& a, std::size_t i)
207  {
208  return a[i];
209  }
210 
211  static void scatter(T& a, V v, std::size_t i)
212  {
213  a[i] = v;
214  }
215  };
216  template<typename T>
218  {
219  typedef typename CommPolicy<T>::IndexedType V;
220 
221  static V gather(const T& a, std::size_t i)
222  {
223  return a[i];
224  }
225 
226  static void scatter(T& a, V v, std::size_t i)
227  {
228  a[i] += v;
229  }
230  };
231 
233  {
234  if (OwnerOverlapToAllInterfaceBuilt)
235  OwnerOverlapToAllInterface.free();
236  typedef Combine<EnumItem<AttributeSet,OwnerOverlapCopyAttributeSet::owner>,EnumItem<AttributeSet,OwnerOverlapCopyAttributeSet::overlap>,AttributeSet> OwnerOverlapSet;
237  typedef Combine<OwnerOverlapSet,EnumItem<AttributeSet,OwnerOverlapCopyAttributeSet::copy>,AttributeSet> AllSet;
238  OwnerOverlapSet sourceFlags;
239  AllSet destFlags;
240  OwnerOverlapToAllInterface.build(ri,sourceFlags,destFlags);
241  OwnerOverlapToAllInterfaceBuilt = true;
242  }
243 
245  {
246  if (OwnerToAllInterfaceBuilt)
247  OwnerToAllInterface.free();
248  OwnerSet sourceFlags;
249  AllSet destFlags;
250  OwnerToAllInterface.build(ri,sourceFlags,destFlags);
251  OwnerToAllInterfaceBuilt = true;
252  }
253 
255  {
256  if (OwnerCopyToAllInterfaceBuilt)
257  OwnerCopyToAllInterface.free();
258  typedef Combine<EnumItem<AttributeSet,OwnerOverlapCopyAttributeSet::owner>,EnumItem<AttributeSet,OwnerOverlapCopyAttributeSet::copy>,AttributeSet> OwnerCopySet;
259  typedef Combine<OwnerCopySet,EnumItem<AttributeSet,OwnerOverlapCopyAttributeSet::overlap>,AttributeSet> AllSet;
260  OwnerCopySet sourceFlags;
261  AllSet destFlags;
262  OwnerCopyToAllInterface.build(ri,sourceFlags,destFlags);
263  OwnerCopyToAllInterfaceBuilt = true;
264  }
265 
267  {
268  if (OwnerCopyToOwnerCopyInterfaceBuilt)
269  OwnerCopyToOwnerCopyInterface.free();
270  typedef Combine<EnumItem<AttributeSet,OwnerOverlapCopyAttributeSet::owner>,EnumItem<AttributeSet,OwnerOverlapCopyAttributeSet::copy>,AttributeSet> OwnerCopySet;
271  OwnerCopySet sourceFlags;
272  OwnerCopySet destFlags;
273  OwnerCopyToOwnerCopyInterface.build(ri,sourceFlags,destFlags);
274  OwnerCopyToOwnerCopyInterfaceBuilt = true;
275  }
276 
278  {
279  if (CopyToAllInterfaceBuilt)
280  CopyToAllInterface.free();
281  CopySet sourceFlags;
282  AllSet destFlags;
283  CopyToAllInterface.build(ri,sourceFlags,destFlags);
284  CopyToAllInterfaceBuilt = true;
285  }
286 
287  public:
288 
294  category = set;
295  }
296 
303  return category;
304  }
305 
306  const CollectiveCommunication<MPI_Comm>& communicator() const
307  {
308  return cc;
309  }
310 
317  template<class T>
318  void copyOwnerToAll (const T& source, T& dest) const
319  {
320  if (!OwnerToAllInterfaceBuilt)
323  communicator.template build<T>(OwnerToAllInterface);
324  communicator.template forward<CopyGatherScatter<T> >(source,dest);
325  communicator.free();
326  }
327 
334  template<class T>
335  void copyCopyToAll (const T& source, T& dest) const
336  {
337  if (!CopyToAllInterfaceBuilt)
340  communicator.template build<T>(CopyToAllInterface);
341  communicator.template forward<CopyGatherScatter<T> >(source,dest);
342  communicator.free();
343  }
344 
351  template<class T>
352  void addOwnerOverlapToAll (const T& source, T& dest) const
353  {
354  if (!OwnerOverlapToAllInterfaceBuilt)
357  communicator.template build<T>(OwnerOverlapToAllInterface);
358  communicator.template forward<AddGatherScatter<T> >(source,dest);
359  communicator.free();
360  }
361 
368  template<class T>
369  void addOwnerCopyToAll (const T& source, T& dest) const
370  {
371  if (!OwnerCopyToAllInterfaceBuilt)
374  communicator.template build<T>(OwnerCopyToAllInterface);
375  communicator.template forward<AddGatherScatter<T> >(source,dest);
376  communicator.free();
377  }
378 
385  template<class T>
386  void addOwnerCopyToOwnerCopy (const T& source, T& dest) const
387  {
388  if (!OwnerCopyToOwnerCopyInterfaceBuilt)
391  communicator.template build<T>(OwnerCopyToOwnerCopyInterface);
392  communicator.template forward<AddGatherScatter<T> >(source,dest);
393  communicator.free();
394  }
395 
396 
404  template<class T1, class T2>
405  void dot (const T1& x, const T1& y, T2& result) const
406  {
407  // set up mask vector
408  if (mask.size()!=static_cast<typename std::vector<double>::size_type>(x.size()))
409  {
410  mask.resize(x.size());
411  for (typename std::vector<double>::size_type i=0; i<mask.size(); i++)
412  mask[i] = 1;
413  for (typename PIS::const_iterator i=pis.begin(); i!=pis.end(); ++i)
414  if (i->local().attribute()!=OwnerOverlapCopyAttributeSet::owner)
415  mask[i->local().local()] = 0;
416  }
417  result = 0;
418 
419  for (typename T1::size_type i=0; i<x.size(); i++)
420  result += x[i]*(y[i])*mask[i];
421  result = cc.sum(result);
422  return;
423  }
424 
431  template<class T1>
432  double norm (const T1& x) const
433  {
434  // set up mask vector
435  if (mask.size()!=static_cast<typename std::vector<double>::size_type>(x.size()))
436  {
437  mask.resize(x.size());
438  for (typename std::vector<double>::size_type i=0; i<mask.size(); i++)
439  mask[i] = 1;
440  for (typename PIS::const_iterator i=pis.begin(); i!=pis.end(); ++i)
441  if (i->local().attribute()!=OwnerOverlapCopyAttributeSet::owner)
442  mask[i->local().local()] = 0;
443  }
444  double result = 0;
445  for (typename T1::size_type i=0; i<x.size(); i++)
446  result += x[i].two_norm2()*mask[i];
447  return sqrt(cc.sum(result));
448  }
449 
450  typedef Dune::EnumItem<AttributeSet,OwnerOverlapCopyAttributeSet::copy> CopyFlags;
451 
453  typedef Dune::ParallelIndexSet<GlobalIdType,LI,512> ParallelIndexSet;
454 
456  typedef Dune::RemoteIndices<PIS> RemoteIndices;
457 
460  typedef Dune::GlobalLookupIndexSet<ParallelIndexSet> GlobalLookupIndexSet;
461 
466  const ParallelIndexSet& indexSet() const
467  {
468  return pis;
469  }
470 
476  {
477  return ri;
478  }
479 
485  {
486  return pis;
487  }
488 
489 
495  {
496  return ri;
497  }
498 
500  {
501  if(globalLookup_) {
502  if(pis.seqNo()==oldseqNo)
503  // Nothing changed!
504  return;
505  delete globalLookup_;
506  }
507 
508  globalLookup_ = new GlobalLookupIndexSet(pis);
509  oldseqNo = pis.seqNo();
510  }
511 
512  void buildGlobalLookup(std::size_t size)
513  {
514  if(globalLookup_) {
515  if(pis.seqNo()==oldseqNo)
516  // Nothing changed!
517  return;
518  delete globalLookup_;
519  }
520  globalLookup_ = new GlobalLookupIndexSet(pis, size);
521  oldseqNo = pis.seqNo();
522  }
523 
525  {
526  delete globalLookup_;
527  globalLookup_=0;
528  }
529 
531  {
532  assert(globalLookup_ != 0);
533  return *globalLookup_;
534  }
535 
541  template<class T1>
542  void project (T1& x) const
543  {
544  for (typename PIS::const_iterator i=pis.begin(); i!=pis.end(); ++i)
545  if (i->local().attribute()==OwnerOverlapCopyAttributeSet::copy)
546  x[i->local().local()] = 0;
547  }
548 
560  bool freecomm_ = false)
561  : comm(comm_), cc(comm_), pis(), ri(pis,pis,comm_),
562  OwnerToAllInterfaceBuilt(false), OwnerOverlapToAllInterfaceBuilt(false),
563  OwnerCopyToAllInterfaceBuilt(false), OwnerCopyToOwnerCopyInterfaceBuilt(false),
564  CopyToAllInterfaceBuilt(false), globalLookup_(0), category(cat_),
565  freecomm(freecomm_)
566  {}
567 
577  : comm(MPI_COMM_WORLD), cc(MPI_COMM_WORLD), pis(), ri(pis,pis,MPI_COMM_WORLD),
578  OwnerToAllInterfaceBuilt(false), OwnerOverlapToAllInterfaceBuilt(false),
579  OwnerCopyToAllInterfaceBuilt(false), OwnerCopyToOwnerCopyInterfaceBuilt(false),
580  CopyToAllInterfaceBuilt(false), globalLookup_(0), category(cat_), freecomm(false)
581  {}
582 
591  MPI_Comm comm_,
593  bool freecomm_ = false)
594  : comm(comm_), cc(comm_), OwnerToAllInterfaceBuilt(false),
595  OwnerOverlapToAllInterfaceBuilt(false), OwnerCopyToAllInterfaceBuilt(false),
596  OwnerCopyToOwnerCopyInterfaceBuilt(false), CopyToAllInterfaceBuilt(false),
597  globalLookup_(0), category(cat_), freecomm(freecomm_)
598  {
599  // set up an ISTL index set
600  pis.beginResize();
601  for (localindex_iterator i=indexinfo.localIndices().begin(); i!=indexinfo.localIndices().end(); ++i)
602  {
603  if (get<2>(*i)==OwnerOverlapCopyAttributeSet::owner)
604  pis.add(get<0>(*i),LI(get<1>(*i),OwnerOverlapCopyAttributeSet::owner,true));
606  pis.add(get<0>(*i),LI(get<1>(*i),OwnerOverlapCopyAttributeSet::overlap,true));
607  if (get<2>(*i)==OwnerOverlapCopyAttributeSet::copy)
608  pis.add(get<0>(*i),LI(get<1>(*i),OwnerOverlapCopyAttributeSet::copy,true));
609  // std::cout << cc.rank() << ": adding index " << get<0>(*i) << " " << get<1>(*i) << " " << get<2>(*i) << std::endl;
610  }
611  pis.endResize();
612 
613  // build remote indices WITHOUT communication
614  // std::cout << cc.rank() << ": build remote indices" << std::endl;
615  ri.setIndexSets(pis,pis,cc);
616  if (indexinfo.remoteIndices().size()>0)
617  {
618  remoteindex_iterator i=indexinfo.remoteIndices().begin();
619  int p = get<0>(*i);
620  RILM modifier = ri.template getModifier<false,true>(p);
621  typename PIS::const_iterator pi=pis.begin();
622  for ( ; i!=indexinfo.remoteIndices().end(); ++i)
623  {
624  // handle processor change
625  if (p!=get<0>(*i))
626  {
627  p = get<0>(*i);
628  modifier = ri.template getModifier<false,true>(p);
629  pi=pis.begin();
630  }
631 
632  // position to correct entry in parallel index set
633  while (pi->global()!=get<1>(*i) && pi!=pis.end())
634  ++pi;
635  if (pi==pis.end())
636  DUNE_THROW(ISTLError,"OwnerOverlapCopyCommunication: global index not in index set");
637 
638  // insert entry
639  // std::cout << cc.rank() << ": adding remote index " << get<0>(*i) << " " << get<1>(*i) << " " << get<2>(*i) << std::endl;
640  if (get<2>(*i)==OwnerOverlapCopyAttributeSet::owner)
641  modifier.insert(RX(OwnerOverlapCopyAttributeSet::owner,&(*pi)));
643  modifier.insert(RX(OwnerOverlapCopyAttributeSet::overlap,&(*pi)));
644  if (get<2>(*i)==OwnerOverlapCopyAttributeSet::copy)
645  modifier.insert(RX(OwnerOverlapCopyAttributeSet::copy,&(*pi)));
646  }
647  }else{
648  // Force remote indices to be synced!
649  ri.template getModifier<false,true>(0);
650  }
651  }
652 
653  // destructor: free memory in some objects
655  {
656  ri.free();
657  if (OwnerToAllInterfaceBuilt) OwnerToAllInterface.free();
658  if (OwnerOverlapToAllInterfaceBuilt) OwnerOverlapToAllInterface.free();
659  if (OwnerCopyToAllInterfaceBuilt) OwnerCopyToAllInterface.free();
660  if (OwnerCopyToOwnerCopyInterfaceBuilt) OwnerCopyToOwnerCopyInterface.free();
661  if (CopyToAllInterfaceBuilt) CopyToAllInterface.free();
662  if (globalLookup_) delete globalLookup_;
663  if (freecomm==true)
664  if(comm!=MPI_COMM_NULL)
665  {
666 #ifdef MPI_2
667  // If it is possible to query whether MPI_Finalize
668  // was called, only free the communicator before
669  // calling MPI_Finalize.
670  int wasFinalized = 0;
671  MPI_Finalized( &wasFinalized );
672  if(!wasFinalized)
673 #endif
674  MPI_Comm_free(&comm);
675  }
676  }
677 
678  private:
680  {}
681  MPI_Comm comm;
682  CollectiveCommunication<MPI_Comm> cc;
683  PIS pis;
684  RI ri;
685  mutable IF OwnerToAllInterface;
686  mutable bool OwnerToAllInterfaceBuilt;
687  mutable IF OwnerOverlapToAllInterface;
688  mutable bool OwnerOverlapToAllInterfaceBuilt;
689  mutable IF OwnerCopyToAllInterface;
690  mutable bool OwnerCopyToAllInterfaceBuilt;
691  mutable IF OwnerCopyToOwnerCopyInterface;
692  mutable bool OwnerCopyToOwnerCopyInterfaceBuilt;
693  mutable IF CopyToAllInterface;
694  mutable bool CopyToAllInterfaceBuilt;
695  mutable std::vector<double> mask;
696  int oldseqNo;
697  GlobalLookupIndexSet* globalLookup_;
698  SolverCategory::Category category;
699  bool freecomm;
700  };
701 
702 #endif
703 
704 
707 } // end namespace
708 
709 #endif
void copyOwnerToAll(const T &source, T &dest) const
Communicate values from owner data points to all other data points.
Definition: owneroverlapcopy.hh:318
Dune::GlobalLookupIndexSet< ParallelIndexSet > GlobalLookupIndexSet
The type of the reverse lookup of indices.
Definition: owneroverlapcopy.hh:460
EnumItem< AttributeSet, OwnerOverlapCopyAttributeSet::copy > CopySet
Definition: owneroverlapcopy.hh:194
Category for ovelapping solvers.
Definition: solvercategory.hh:26
void clear()
Remove all indices from the sets.
Definition: owneroverlapcopy.hh:149
const GlobalLookupIndexSet & globalLookup() const
Definition: owneroverlapcopy.hh:530
static V gather(const T &a, std::size_t i)
Definition: owneroverlapcopy.hh:206
EnumItem< AttributeSet, OwnerOverlapCopyAttributeSet::owner > OwnerSet
Definition: owneroverlapcopy.hh:193
friend void loadMatrixMarket(M &, const std::string &, OwnerOverlapCopyCommunication< G, L > &, bool)
Load a parallel matrix/vector stored in matrix market format.
Definition: matrixmarket.hh:1044
AttributeSet
Definition: owneroverlapcopy.hh:59
void testRedistributed(int s)
Definition: owneroverlapcopy.hh:60
Attribute set for overlapping schwarz.
Definition: owneroverlapcopy.hh:57
CommPolicy< T >::IndexedType V
Definition: owneroverlapcopy.hh:219
void addLocalIndex(const IndexTripel &x)
Add a new index triple to the set of local indices.
Definition: owneroverlapcopy.hh:105
Dune::ParallelIndexSet< GlobalIdType, LI, 512 > PIS
Definition: owneroverlapcopy.hh:187
Dune::EnumItem< AttributeSet, OwnerOverlapCopyAttributeSet::copy > CopyFlags
Definition: owneroverlapcopy.hh:450
OwnerOverlapCopyCommunication(MPI_Comm comm_, SolverCategory::Category cat_=SolverCategory::overlapping, bool freecomm_=false)
Construct the communication without any indices.
Definition: owneroverlapcopy.hh:558
const std::set< IndexTripel > & localIndices() const
Get the set of indices local to the process.
Definition: owneroverlapcopy.hh:132
void buildOwnerOverlapToAllInterface() const
Definition: owneroverlapcopy.hh:232
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:352
~OwnerOverlapCopyCommunication()
Definition: owneroverlapcopy.hh:654
void buildOwnerToAllInterface() const
Definition: owneroverlapcopy.hh:244
Dune::RemoteIndices< PIS > RemoteIndices
The type of the remote indices.
Definition: owneroverlapcopy.hh:456
Categories for the solvers.
Definition: solvercategory.hh:18
void buildGlobalLookup(std::size_t size)
Definition: owneroverlapcopy.hh:512
Information about the index distribution.
Definition: owneroverlapcopy.hh:76
void buildGlobalLookup()
Definition: owneroverlapcopy.hh:499
static V gather(const T &a, std::size_t i)
Definition: owneroverlapcopy.hh:221
gather/scatter callback for communcation
Definition: owneroverlapcopy.hh:202
RI::RemoteIndex RX
Definition: owneroverlapcopy.hh:190
Category
Definition: solvercategory.hh:20
void dot(const T1 &x, const T1 &y, T2 &result) const
Compute a global dot product of two vectors.
Definition: owneroverlapcopy.hh:405
G GlobalIdType
The type of the global index.
Definition: owneroverlapcopy.hh:80
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:386
void project(T1 &x) const
Set vector to zero at copy dofs.
Definition: owneroverlapcopy.hh:542
RemoteIndices & remoteIndices()
Get the underlying remote indices.
Definition: owneroverlapcopy.hh:494
CommPolicy< T >::IndexedType V
Definition: owneroverlapcopy.hh:204
Dune::Interface IF
Definition: owneroverlapcopy.hh:192
void addRemoteIndex(const RemoteIndexTripel &x)
Add a new remote index triple to the set of remote indices.
Definition: owneroverlapcopy.hh:119
const CollectiveCommunication< MPI_Comm > & communicator() const
Definition: owneroverlapcopy.hh:306
Combine< EnumItem< AttributeSet, OwnerOverlapCopyAttributeSet::owner >, EnumItem< AttributeSet, OwnerOverlapCopyAttributeSet::overlap >, AttributeSet > OwnerOverlapSet
Definition: owneroverlapcopy.hh:195
tuple< int, GlobalIdType, int > RemoteIndexTripel
A triple describing a remote index.
Definition: owneroverlapcopy.hh:98
OwnerOverlapCopyCommunication(const IndexInfoFromGrid< GlobalIdType, LocalIdType > &indexinfo, MPI_Comm comm_, SolverCategory::Category cat_=SolverCategory::overlapping, bool freecomm_=false)
Constructor.
Definition: owneroverlapcopy.hh:590
Dune::RemoteIndexListModifier< PIS, typename RI::Allocator, false > RILM
Definition: owneroverlapcopy.hh:189
const std::set< RemoteIndexTripel > & remoteIndices() const
Get the set of remote indices.
Definition: owneroverlapcopy.hh:141
void copyCopyToAll(const T &source, T &dest) const
Communicate values from copy data points to all other data points.
Definition: owneroverlapcopy.hh:335
Dune::ParallelIndexSet< GlobalIdType, LI, 512 > ParallelIndexSet
The type of the parallel index set.
Definition: owneroverlapcopy.hh:453
Definition: owneroverlapcopy.hh:60
const RemoteIndices & remoteIndices() const
Get the underlying remote indices.
Definition: owneroverlapcopy.hh:475
const ParallelIndexSet & indexSet() const
Get the underlying parallel index set.
Definition: owneroverlapcopy.hh:466
derive error class from the base class in common
Definition: istlexception.hh:16
Dune::BufferedCommunicator BC
Definition: owneroverlapcopy.hh:191
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:369
L LocalIdType
The type of the local index.
Definition: owneroverlapcopy.hh:83
void buildOwnerCopyToOwnerCopyInterface() const
Definition: owneroverlapcopy.hh:266
tuple< GlobalIdType, LocalIdType, int > IndexTripel
A triple describing a local index.
Definition: owneroverlapcopy.hh:91
const SolverCategory::Category getSolverCategory() const
Set Solver Category.
Definition: owneroverlapcopy.hh:302
static void scatter(T &a, V v, std::size_t i)
Definition: owneroverlapcopy.hh:211
double norm(const T1 &x) const
Compute the global euclidian norm of a vector.
Definition: owneroverlapcopy.hh:432
Dune::RemoteIndices< PIS > RI
Definition: owneroverlapcopy.hh:188
void buildOwnerCopyToAllInterface() const
Definition: owneroverlapcopy.hh:254
A class setting up standard communication for a two-valued attribute set with owner/overlap/copy sema...
Definition: owneroverlapcopy.hh:172
void buildCopyToAllInterface() const
Definition: owneroverlapcopy.hh:277
static void scatter(T &a, V v, std::size_t i)
Definition: owneroverlapcopy.hh:226
void setSolverCategory(SolverCategory set)
Set right Solver Category (default is overlapping).
Definition: owneroverlapcopy.hh:293
void freeGlobalLookup()
Definition: owneroverlapcopy.hh:524
Definition: owneroverlapcopy.hh:60
OwnerOverlapCopyCommunication(SolverCategory::Category cat_=SolverCategory::overlapping)
Construct the communication without any indices using MPI_COMM_WORLD.
Definition: owneroverlapcopy.hh:576
ParallelIndexSet & indexSet()
Get the underlying parallel index set.
Definition: owneroverlapcopy.hh:484
Dune::AllSet< AttributeSet > AllSet
Definition: owneroverlapcopy.hh:196