Dune Core Modules (2.6.0)

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 #ifndef DUNE_ISTL_OWNEROVERLAPCOPY_HH
4 #define DUNE_ISTL_OWNEROVERLAPCOPY_HH
5 
6 #include <new>
7 #include <iostream>
8 #include <vector>
9 #include <list>
10 #include <map>
11 #include <set>
12 #include <tuple>
13 
14 #include "cmath"
15 
16 // MPI header
17 #if HAVE_MPI
18 #include <mpi.h>
19 #endif
20 
21 #include <dune/common/enumset.hh>
22 
23 #if HAVE_MPI
28 #endif
29 
30 #include "solvercategory.hh"
31 #include "istlexception.hh"
34 
35 template<int dim, template<class,class> class Comm>
36 void testRedistributed(int s);
37 
38 
39 namespace Dune {
40 
57  {
58  enum AttributeSet {
59  owner=1, overlap=2, copy=3
60  };
61  };
62 
74  template <class G, class L>
76  {
77  public:
79  typedef G GlobalIdType;
80 
82  typedef L LocalIdType;
83 
90  typedef std::tuple<GlobalIdType,LocalIdType,int> IndexTripel;
97  typedef std::tuple<int,GlobalIdType,int> RemoteIndexTripel;
98 
104  void addLocalIndex (const IndexTripel& x)
105  {
106  if (std::get<2>(x)!=OwnerOverlapCopyAttributeSet::owner &&
107  std::get<2>(x)!=OwnerOverlapCopyAttributeSet::overlap &&
108  std::get<2>(x)!=OwnerOverlapCopyAttributeSet::copy)
109  DUNE_THROW(ISTLError,"OwnerOverlapCopyCommunication: global index not in index set");
110  localindices.insert(x);
111  }
112 
119  {
120  if (std::get<2>(x)!=OwnerOverlapCopyAttributeSet::owner &&
121  std::get<2>(x)!=OwnerOverlapCopyAttributeSet::overlap &&
122  std::get<2>(x)!=OwnerOverlapCopyAttributeSet::copy)
123  DUNE_THROW(ISTLError,"OwnerOverlapCopyCommunication: global index not in index set");
124  remoteindices.insert(x);
125  }
126 
131  const std::set<IndexTripel>& localIndices () const
132  {
133  return localindices;
134  }
135 
140  const std::set<RemoteIndexTripel>& remoteIndices () const
141  {
142  return remoteindices;
143  }
144 
148  void clear ()
149  {
150  localindices.clear();
151  remoteindices.clear();
152  }
153 
154  private:
156  std::set<IndexTripel> localindices;
158  std::set<RemoteIndexTripel> remoteindices;
159  };
160 
161 
162 #if HAVE_MPI
163 
170  template <class GlobalIdType, class LocalIdType=int>
172  {
173  template<typename M, typename G, typename L>
174  friend void loadMatrixMarket(M&,
175  const std::string&,
177  bool);
178  // used types
180  typedef typename IndexInfoFromGrid<GlobalIdType,LocalIdType>::RemoteIndexTripel RemoteIndexTripel;
181  typedef typename std::set<IndexTripel>::const_iterator localindex_iterator;
182  typedef typename std::set<RemoteIndexTripel>::const_iterator remoteindex_iterator;
183  typedef typename OwnerOverlapCopyAttributeSet::AttributeSet AttributeSet;
185  public:
189  typedef typename RI::RemoteIndex RX;
191  typedef Dune::Interface IF;
196  protected:
197 
198 
200  template<typename T>
202  {
203  typedef typename CommPolicy<T>::IndexedType V;
204 
205  static V gather(const T& a, std::size_t i)
206  {
207  return a[i];
208  }
209 
210  static void scatter(T& a, V v, std::size_t i)
211  {
212  a[i] = v;
213  }
214  };
215  template<typename T>
216  struct AddGatherScatter
217  {
218  typedef typename CommPolicy<T>::IndexedType V;
219 
220  static V gather(const T& a, std::size_t i)
221  {
222  return a[i];
223  }
224 
225  static void scatter(T& a, V v, std::size_t i)
226  {
227  a[i] += v;
228  }
229  };
230 
231  void buildOwnerOverlapToAllInterface () const
232  {
233  if (OwnerOverlapToAllInterfaceBuilt)
234  OwnerOverlapToAllInterface.free();
235  typedef Combine<EnumItem<AttributeSet,OwnerOverlapCopyAttributeSet::owner>,EnumItem<AttributeSet,OwnerOverlapCopyAttributeSet::overlap>,AttributeSet> OwnerOverlapSet;
236  typedef Combine<OwnerOverlapSet,EnumItem<AttributeSet,OwnerOverlapCopyAttributeSet::copy>,AttributeSet> AllSet;
237  OwnerOverlapSet sourceFlags;
238  AllSet destFlags;
239  OwnerOverlapToAllInterface.build(ri,sourceFlags,destFlags);
240  OwnerOverlapToAllInterfaceBuilt = true;
241  }
242 
243  void buildOwnerToAllInterface () const
244  {
245  if (OwnerToAllInterfaceBuilt)
246  OwnerToAllInterface.free();
247  OwnerSet sourceFlags;
248  AllSet destFlags;
249  OwnerToAllInterface.build(ri,sourceFlags,destFlags);
250  OwnerToAllInterfaceBuilt = true;
251  }
252 
253  void buildOwnerCopyToAllInterface () const
254  {
255  if (OwnerCopyToAllInterfaceBuilt)
256  OwnerCopyToAllInterface.free();
257  typedef Combine<EnumItem<AttributeSet,OwnerOverlapCopyAttributeSet::owner>,EnumItem<AttributeSet,OwnerOverlapCopyAttributeSet::copy>,AttributeSet> OwnerCopySet;
258  typedef Combine<OwnerCopySet,EnumItem<AttributeSet,OwnerOverlapCopyAttributeSet::overlap>,AttributeSet> AllSet;
259  OwnerCopySet sourceFlags;
260  AllSet destFlags;
261  OwnerCopyToAllInterface.build(ri,sourceFlags,destFlags);
262  OwnerCopyToAllInterfaceBuilt = true;
263  }
264 
265  void buildOwnerCopyToOwnerCopyInterface () const
266  {
267  if (OwnerCopyToOwnerCopyInterfaceBuilt)
268  OwnerCopyToOwnerCopyInterface.free();
269  typedef Combine<EnumItem<AttributeSet,OwnerOverlapCopyAttributeSet::owner>,EnumItem<AttributeSet,OwnerOverlapCopyAttributeSet::copy>,AttributeSet> OwnerCopySet;
270  OwnerCopySet sourceFlags;
271  OwnerCopySet destFlags;
272  OwnerCopyToOwnerCopyInterface.build(ri,sourceFlags,destFlags);
273  OwnerCopyToOwnerCopyInterfaceBuilt = true;
274  }
275 
276  void buildCopyToAllInterface () const
277  {
278  if (CopyToAllInterfaceBuilt)
279  CopyToAllInterface.free();
280  CopySet sourceFlags;
281  AllSet destFlags;
282  CopyToAllInterface.build(ri,sourceFlags,destFlags);
283  CopyToAllInterfaceBuilt = true;
284  }
285 
286  public:
287 
292  category = set;
293  }
294 
300  return category;
301  }
302 
303  const CollectiveCommunication<MPI_Comm>& communicator() const
304  {
305  return cc;
306  }
307 
314  template<class T>
315  void copyOwnerToAll (const T& source, T& dest) const
316  {
317  if (!OwnerToAllInterfaceBuilt)
318  buildOwnerToAllInterface ();
319  BC communicator;
320  communicator.template build<T>(OwnerToAllInterface);
321  communicator.template forward<CopyGatherScatter<T> >(source,dest);
322  communicator.free();
323  }
324 
331  template<class T>
332  void copyCopyToAll (const T& source, T& dest) const
333  {
334  if (!CopyToAllInterfaceBuilt)
335  buildCopyToAllInterface ();
336  BC communicator;
337  communicator.template build<T>(CopyToAllInterface);
338  communicator.template forward<CopyGatherScatter<T> >(source,dest);
339  communicator.free();
340  }
341 
348  template<class T>
349  void addOwnerOverlapToAll (const T& source, T& dest) const
350  {
351  if (!OwnerOverlapToAllInterfaceBuilt)
352  buildOwnerOverlapToAllInterface ();
353  BC communicator;
354  communicator.template build<T>(OwnerOverlapToAllInterface);
355  communicator.template forward<AddGatherScatter<T> >(source,dest);
356  communicator.free();
357  }
358 
365  template<class T>
366  void addOwnerCopyToAll (const T& source, T& dest) const
367  {
368  if (!OwnerCopyToAllInterfaceBuilt)
369  buildOwnerCopyToAllInterface ();
370  BC communicator;
371  communicator.template build<T>(OwnerCopyToAllInterface);
372  communicator.template forward<AddGatherScatter<T> >(source,dest);
373  communicator.free();
374  }
375 
382  template<class T>
383  void addOwnerCopyToOwnerCopy (const T& source, T& dest) const
384  {
385  if (!OwnerCopyToOwnerCopyInterfaceBuilt)
386  buildOwnerCopyToOwnerCopyInterface ();
387  BC communicator;
388  communicator.template build<T>(OwnerCopyToOwnerCopyInterface);
389  communicator.template forward<AddGatherScatter<T> >(source,dest);
390  communicator.free();
391  }
392 
393 
401  template<class T1, class T2>
402  void dot (const T1& x, const T1& y, T2& result) const
403  {
404  // set up mask vector
405  if (mask.size()!=static_cast<typename std::vector<double>::size_type>(x.size()))
406  {
407  mask.resize(x.size());
408  for (typename std::vector<double>::size_type i=0; i<mask.size(); i++)
409  mask[i] = 1;
410  for (typename PIS::const_iterator i=pis.begin(); i!=pis.end(); ++i)
411  if (i->local().attribute()!=OwnerOverlapCopyAttributeSet::owner)
412  mask[i->local().local()] = 0;
413  }
414  result = T2(0.0);
415 
416  for (typename T1::size_type i=0; i<x.size(); i++)
417  result += x[i]*(y[i])*mask[i];
418  result = cc.sum(result);
419  return;
420  }
421 
428  template<class T1>
429  typename FieldTraits<typename T1::field_type>::real_type norm (const T1& x) const
430  {
431  // set up mask vector
432  if (mask.size()!=static_cast<typename std::vector<double>::size_type>(x.size()))
433  {
434  mask.resize(x.size());
435  for (typename std::vector<double>::size_type i=0; i<mask.size(); i++)
436  mask[i] = 1;
437  for (typename PIS::const_iterator i=pis.begin(); i!=pis.end(); ++i)
438  if (i->local().attribute()!=OwnerOverlapCopyAttributeSet::owner)
439  mask[i->local().local()] = 0;
440  }
441  typename T1::field_type result = typename T1::field_type(0.0);
442  for (typename T1::size_type i=0; i<x.size(); i++)
443  result += x[i].two_norm2()*mask[i];
444  return static_cast<double>(sqrt(cc.sum(result)));
445  }
446 
448 
451 
454 
458 
463  const ParallelIndexSet& indexSet() const
464  {
465  return pis;
466  }
467 
473  {
474  return ri;
475  }
476 
482  {
483  return pis;
484  }
485 
486 
492  {
493  return ri;
494  }
495 
496  void buildGlobalLookup()
497  {
498  if(globalLookup_) {
499  if(pis.seqNo()==oldseqNo)
500  // Nothing changed!
501  return;
502  delete globalLookup_;
503  }
504 
505  globalLookup_ = new GlobalLookupIndexSet(pis);
506  oldseqNo = pis.seqNo();
507  }
508 
509  void buildGlobalLookup(std::size_t size)
510  {
511  if(globalLookup_) {
512  if(pis.seqNo()==oldseqNo)
513  // Nothing changed!
514  return;
515  delete globalLookup_;
516  }
517  globalLookup_ = new GlobalLookupIndexSet(pis, size);
518  oldseqNo = pis.seqNo();
519  }
520 
521  void freeGlobalLookup()
522  {
523  delete globalLookup_;
524  globalLookup_=0;
525  }
526 
527  const GlobalLookupIndexSet& globalLookup() const
528  {
529  assert(globalLookup_ != 0);
530  return *globalLookup_;
531  }
532 
538  template<class T1>
539  void project (T1& x) const
540  {
541  for (typename PIS::const_iterator i=pis.begin(); i!=pis.end(); ++i)
542  if (i->local().attribute()==OwnerOverlapCopyAttributeSet::copy)
543  x[i->local().local()] = 0;
544  }
545 
557  bool freecomm_ = false)
558  : comm(comm_), cc(comm_), pis(), ri(pis,pis,comm_),
559  OwnerToAllInterfaceBuilt(false), OwnerOverlapToAllInterfaceBuilt(false),
560  OwnerCopyToAllInterfaceBuilt(false), OwnerCopyToOwnerCopyInterfaceBuilt(false),
561  CopyToAllInterfaceBuilt(false), globalLookup_(0), category(cat_),
562  freecomm(freecomm_)
563  {}
564 
574  : comm(MPI_COMM_WORLD), cc(MPI_COMM_WORLD), pis(), ri(pis,pis,MPI_COMM_WORLD),
575  OwnerToAllInterfaceBuilt(false), OwnerOverlapToAllInterfaceBuilt(false),
576  OwnerCopyToAllInterfaceBuilt(false), OwnerCopyToOwnerCopyInterfaceBuilt(false),
577  CopyToAllInterfaceBuilt(false), globalLookup_(0), category(cat_), freecomm(false)
578  {}
579 
588  MPI_Comm comm_,
590  bool freecomm_ = false)
591  : comm(comm_), cc(comm_), OwnerToAllInterfaceBuilt(false),
592  OwnerOverlapToAllInterfaceBuilt(false), OwnerCopyToAllInterfaceBuilt(false),
593  OwnerCopyToOwnerCopyInterfaceBuilt(false), CopyToAllInterfaceBuilt(false),
594  globalLookup_(0), category(cat_), freecomm(freecomm_)
595  {
596  // set up an ISTL index set
597  pis.beginResize();
598  for (localindex_iterator i=indexinfo.localIndices().begin(); i!=indexinfo.localIndices().end(); ++i)
599  {
600  if (std::get<2>(*i)==OwnerOverlapCopyAttributeSet::owner)
601  pis.add(std::get<0>(*i),LI(std::get<1>(*i),OwnerOverlapCopyAttributeSet::owner,true));
602  if (std::get<2>(*i)==OwnerOverlapCopyAttributeSet::overlap)
603  pis.add(std::get<0>(*i),LI(std::get<1>(*i),OwnerOverlapCopyAttributeSet::overlap,true));
604  if (std::get<2>(*i)==OwnerOverlapCopyAttributeSet::copy)
605  pis.add(std::get<0>(*i),LI(std::get<1>(*i),OwnerOverlapCopyAttributeSet::copy,true));
606  // std::cout << cc.rank() << ": adding index " << std::get<0>(*i) << " " << std::get<1>(*i) << " " << std::get<2>(*i) << std::endl;
607  }
608  pis.endResize();
609 
610  // build remote indices WITHOUT communication
611  // std::cout << cc.rank() << ": build remote indices" << std::endl;
612  ri.setIndexSets(pis,pis,cc);
613  if (indexinfo.remoteIndices().size()>0)
614  {
615  remoteindex_iterator i=indexinfo.remoteIndices().begin();
616  int p = std::get<0>(*i);
617  RILM modifier = ri.template getModifier<false,true>(p);
618  typename PIS::const_iterator pi=pis.begin();
619  for ( ; i!=indexinfo.remoteIndices().end(); ++i)
620  {
621  // handle processor change
622  if (p!=std::get<0>(*i))
623  {
624  p = std::get<0>(*i);
625  modifier = ri.template getModifier<false,true>(p);
626  pi=pis.begin();
627  }
628 
629  // position to correct entry in parallel index set
630  while (pi->global()!=std::get<1>(*i) && pi!=pis.end())
631  ++pi;
632  if (pi==pis.end())
633  DUNE_THROW(ISTLError,"OwnerOverlapCopyCommunication: global index not in index set");
634 
635  // insert entry
636  // std::cout << cc.rank() << ": adding remote index " << std::get<0>(*i) << " " << std::get<1>(*i) << " " << std::get<2>(*i) << std::endl;
637  if (std::get<2>(*i)==OwnerOverlapCopyAttributeSet::owner)
638  modifier.insert(RX(OwnerOverlapCopyAttributeSet::owner,&(*pi)));
639  if (std::get<2>(*i)==OwnerOverlapCopyAttributeSet::overlap)
640  modifier.insert(RX(OwnerOverlapCopyAttributeSet::overlap,&(*pi)));
641  if (std::get<2>(*i)==OwnerOverlapCopyAttributeSet::copy)
642  modifier.insert(RX(OwnerOverlapCopyAttributeSet::copy,&(*pi)));
643  }
644  }else{
645  // Force remote indices to be synced!
646  ri.template getModifier<false,true>(0);
647  }
648  }
649 
650  // destructor: free memory in some objects
652  {
653  ri.free();
654  if (OwnerToAllInterfaceBuilt) OwnerToAllInterface.free();
655  if (OwnerOverlapToAllInterfaceBuilt) OwnerOverlapToAllInterface.free();
656  if (OwnerCopyToAllInterfaceBuilt) OwnerCopyToAllInterface.free();
657  if (OwnerCopyToOwnerCopyInterfaceBuilt) OwnerCopyToOwnerCopyInterface.free();
658  if (CopyToAllInterfaceBuilt) CopyToAllInterface.free();
659  if (globalLookup_) delete globalLookup_;
660  if (freecomm==true)
661  if(comm!=MPI_COMM_NULL)
662  {
663 #ifdef MPI_2
664  // If it is possible to query whether MPI_Finalize
665  // was called, only free the communicator before
666  // calling MPI_Finalize.
667  int wasFinalized = 0;
668  MPI_Finalized( &wasFinalized );
669  if(!wasFinalized)
670 #endif
671  MPI_Comm_free(&comm);
672  }
673  }
674 
675  private:
677  {}
678  MPI_Comm comm;
679  CollectiveCommunication<MPI_Comm> cc;
680  PIS pis;
681  RI ri;
682  mutable IF OwnerToAllInterface;
683  mutable bool OwnerToAllInterfaceBuilt;
684  mutable IF OwnerOverlapToAllInterface;
685  mutable bool OwnerOverlapToAllInterfaceBuilt;
686  mutable IF OwnerCopyToAllInterface;
687  mutable bool OwnerCopyToAllInterfaceBuilt;
688  mutable IF OwnerCopyToOwnerCopyInterface;
689  mutable bool OwnerCopyToOwnerCopyInterfaceBuilt;
690  mutable IF CopyToAllInterface;
691  mutable bool CopyToAllInterfaceBuilt;
692  mutable std::vector<double> mask;
693  int oldseqNo;
694  GlobalLookupIndexSet* globalLookup_;
695  SolverCategory::Category category;
696  bool freecomm;
697  };
698 
699 #endif
700 
701 
704 } // end namespace
705 
706 #endif
A set containing everything.
Definition: enumset.hh:43
A communicator that uses buffers to gather and scatter the data to be send or received.
Definition: communicator.hh:459
void free()
Free the allocated memory (i.e. buffers and message information.
Specialization of CollectiveCommunication for MPI.
Definition: mpicollectivecommunication.hh:143
T sum(const T &in) const
Compute the sum of the argument over all processes and return the result in every process....
Definition: mpicollectivecommunication.hh:176
A set combining two other sets.
Definition: enumset.hh:110
A constant random access iterator for the Dune::ArrayList class.
Definition: arraylist.hh:379
A set consisting only of one item.
Definition: enumset.hh:60
derive error class from the base class in common
Definition: istlexception.hh:16
Information about the index distribution.
Definition: owneroverlapcopy.hh:76
std::tuple< GlobalIdType, LocalIdType, int > IndexTripel
A triple describing a local index.
Definition: owneroverlapcopy.hh:90
void addRemoteIndex(const RemoteIndexTripel &x)
Add a new remote index triple to the set of remote indices.
Definition: owneroverlapcopy.hh:118
G GlobalIdType
The type of the global index.
Definition: owneroverlapcopy.hh:79
L LocalIdType
The type of the local index.
Definition: owneroverlapcopy.hh:82
const std::set< IndexTripel > & localIndices() const
Get the set of indices local to the process.
Definition: owneroverlapcopy.hh:131
void clear()
Remove all indices from the sets.
Definition: owneroverlapcopy.hh:148
void addLocalIndex(const IndexTripel &x)
Add a new index triple to the set of local indices.
Definition: owneroverlapcopy.hh:104
const std::set< RemoteIndexTripel > & remoteIndices() const
Get the set of remote indices.
Definition: owneroverlapcopy.hh:140
std::tuple< int, GlobalIdType, int > RemoteIndexTripel
A triple describing a remote index.
Definition: owneroverlapcopy.hh:97
Communication interface between remote and local indices.
Definition: interface.hh:207
A class setting up standard communication for a two-valued attribute set with owner/overlap/copy sema...
Definition: owneroverlapcopy.hh:172
const ParallelIndexSet & indexSet() const
Get the underlying parallel index set.
Definition: owneroverlapcopy.hh:463
RemoteIndices & remoteIndices()
Get the underlying remote indices.
Definition: owneroverlapcopy.hh:491
ParallelIndexSet & indexSet()
Get the underlying parallel index set.
Definition: owneroverlapcopy.hh:481
OwnerOverlapCopyCommunication(const IndexInfoFromGrid< GlobalIdType, LocalIdType > &indexinfo, MPI_Comm comm_, SolverCategory::Category cat_=SolverCategory::overlapping, bool freecomm_=false)
Constructor.
Definition: owneroverlapcopy.hh:587
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:383
FieldTraits< typename T1::field_type >::real_type norm(const T1 &x) const
Compute the global euclidian norm of a vector.
Definition: owneroverlapcopy.hh:429
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:349
Dune::RemoteIndices< PIS > RemoteIndices
The type of the remote indices.
Definition: owneroverlapcopy.hh:453
void project(T1 &x) const
Set vector to zero at copy dofs.
Definition: owneroverlapcopy.hh:539
void copyCopyToAll(const T &source, T &dest) const
Communicate values from copy data points to all other data points.
Definition: owneroverlapcopy.hh:332
Dune::GlobalLookupIndexSet< ParallelIndexSet > GlobalLookupIndexSet
The type of the reverse lookup of indices.
Definition: owneroverlapcopy.hh:457
OwnerOverlapCopyCommunication(MPI_Comm comm_, SolverCategory::Category cat_=SolverCategory::overlapping, bool freecomm_=false)
Construct the communication without any indices.
Definition: owneroverlapcopy.hh:555
void dot(const T1 &x, const T1 &y, T2 &result) const
Compute a global dot product of two vectors.
Definition: owneroverlapcopy.hh:402
OwnerOverlapCopyCommunication(SolverCategory::Category cat_=SolverCategory::overlapping)
Construct the communication without any indices using MPI_COMM_WORLD.
Definition: owneroverlapcopy.hh:573
void setSolverCategory(SolverCategory set)
Set right Solver Category (default is overlapping).
Definition: owneroverlapcopy.hh:291
const RemoteIndices & remoteIndices() const
Get the underlying remote indices.
Definition: owneroverlapcopy.hh:472
void copyOwnerToAll(const T &source, T &dest) const
Communicate values from owner data points to all other data points.
Definition: owneroverlapcopy.hh:315
friend void loadMatrixMarket(M &, const std::string &, OwnerOverlapCopyCommunication< G, L > &, bool)
Load a parallel matrix/vector stored in matrix market format.
Definition: matrixmarket.hh:1031
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:366
SolverCategory::Category getSolverCategory() const
Get Solver Category.
Definition: owneroverlapcopy.hh:299
Dune::ParallelIndexSet< GlobalIdType, LI, 512 > ParallelIndexSet
The type of the parallel index set.
Definition: owneroverlapcopy.hh:450
An index present on the local process with an additional attribute flag.
Definition: plocalindex.hh:47
Modifier for adding and/or deleting remote indices from the remote index list.
Definition: remoteindices.hh:550
void insert(const RemoteIndex &index)
Insert an index to the list.
Definition: remoteindices.hh:1618
Information about an index residing on another processor.
Definition: remoteindices.hh:71
void setIndexSets(const ParallelIndexSet &source, const ParallelIndexSet &destination, const MPI_Comm &comm, const std::vector< int > &neighbours=std::vector< int >())
Set the index sets and communicator we work with.
Definition: remoteindices.hh:985
void free()
Free the index lists.
Definition: remoteindices.hh:1435
Implements an utility class that provides collective communication methods for sequential programs.
Provides utility classes for syncing distributed data via MPI communication.
Classes for building sets out of enumeration values.
void beginResize()
Indicate that the index set is to be resized.
void build(const R &remoteIndices, const T1 &sourceFlags, const T2 &destFlags)
Builds the interface.
Definition: interface.hh:459
void add(const GlobalIndex &global)
Add an new index to the set.
iterator begin()
Get an iterator over the indices positioned at the first index.
iterator end()
Get an iterator over the indices positioned after the last index.
void endResize()
Indicate that the resizing finishes.
int seqNo() const
Get the internal sequence number.
void free()
Frees memory allocated during the build.
Definition: interface.hh:490
#define DUNE_THROW(E, m)
Definition: exceptions.hh:216
Provides a map between global and local indices.
Provides classes for reading and writing MatrixMarket Files with an extension for parallel matrices.
Implements an utility class that provides MPI's collective communication methods.
Dune namespace.
Definition: alignedallocator.hh:10
Classes describing a distributed indexset.
V::value_type IndexedType
The type we get at each index with operator[].
Definition: communicator.hh:146
Attribute set for overlapping schwarz.
Definition: owneroverlapcopy.hh:57
gather/scatter callback for communcation
Definition: owneroverlapcopy.hh:202
Categories for the solvers.
Definition: solvercategory.hh:20
Category
Definition: solvercategory.hh:21
@ overlapping
Category for overlapping solvers.
Definition: solvercategory.hh:27
Creative Commons License   |  Legal Statements / Impressum  |  Hosted by TU Dresden  |  generated with Hugo v0.80.0 (Apr 24, 22:30, 2024)