dune-fem  2.4.1-rc
scalarproducts.hh
Go to the documentation of this file.
1 #ifndef DUNE_FEM_SCALARPRODURCTS_HH
2 #define DUNE_FEM_SCALARPRODURCTS_HH
3 
4 //- system includes
5 #include <iostream>
6 #include <memory>
7 #include <set>
8 #include <map>
9 #include <limits>
10 #include <algorithm>
11 
12 //- Dune includes
13 #include <dune/common/exceptions.hh>
14 
15 #include <dune/common/genericiterator.hh>
16 #include <dune/common/ftraits.hh>
17 #include <dune/grid/common/gridenums.hh>
18 #include <dune/grid/common/datahandleif.hh>
19 
20 // in case of ISTL found include some more headers
21 #if HAVE_DUNE_ISTL
22 #include <dune/istl/scalarproducts.hh>
23 #endif
24 
25 //- Dune-fem includes
26 //#include <dune/fem/space/common/commoperations.hh>
30 
32 
33 namespace Dune
34 {
35 
36  namespace Fem
37  {
38 
43  template< class Space, class Mapper >
44  class SlaveDofs
45  {
47 
48  public:
49  class SingletonKey;
50 
51  private:
52  template< class Map >
53  struct InsertFunctor;
54 
55  class LinkBuilder;
56 
57  public:
59  typedef Space SpaceType;
60 
62  typedef SpaceType DiscreteFunctionSpaceType ;
63 
65  typedef typename SpaceType :: GridPartType GridPartType;
66 
68  typedef Mapper MapperType;
69 
70  protected:
72 
73  protected:
74  const SpaceType &space_;
75  const GridPartType &gridPart_;
76  const MapperType &mapper_;
77 
78  const int myRank_;
79  const int mySize_;
80 
81  // type of communication indices
82  IndexMapType slaves_;
83  std::set<int> slaveSet_;
84 
86  int sequence_;
87 
88  public:
90  inline SlaveDofs ( const SingletonKey &key )
91  : space_( key.space() ),
92  gridPart_( space_.gridPart() ),
93  mapper_( key.mapper() ),
94  myRank_( gridPart_.comm().rank() ),
95  mySize_( gridPart_.comm().size() ),
96  slaves_(),
97  sequence_( -1 )
98  {}
99 
100  private:
101  // prohibit copying
102  SlaveDofs ( const SlaveDofs & );
103 
104  public:
106  int operator [] ( const int index ) const
107  {
108  return slaves_[ index ];
109  }
110 
112  int size () const
113  {
114  return slaves_.size();
115  }
116 
118  bool isSlave( const int index ) const
119  {
120  typedef GenericIterator<const IndexMapType, const int> IteratorType;
121 
122  return std::binary_search(IteratorType(slaves_, 0),
123  IteratorType(slaves_, size()-1),
124  index);
125  }
126 
127  public:
129  inline void insert( const int index )
130  {
131  slaveSet_.insert( index );
132  }
133 
135  inline void initialize ()
136  {
137  sequence_ = -1;
138  slaveSet_.clear();
139  slaves_.clear();
140  }
141 
143  inline void finalize ()
144  {
145  // insert slaves
146  slaves_.set( slaveSet_ );
147 
148  // remove memory
149  slaveSet_.clear();
150 
151  // store actual sequence number
152  sequence_ = space_.sequence();
153  }
154 
156  inline void rebuild ()
157  {
158  // check whether grid has changed.
159  if( sequence_ != space_.sequence() )
160  {
161  initialize();
162  buildMaps();
163  finalize();
164  }
165  }
166 
168  const SpaceType& space () const { return space_; }
169 
170  protected:
171  // build linkage and index maps
172  inline void buildMaps ()
173  {
174  if( !space_.continuous() )
176  else
178  }
179 
180  // for discontinuous spaces we don't have to communicate
181  inline void buildDiscontinuousMaps ();
182 
183  inline void buildCommunicatedMaps ();
184  };
185 
186 
187 
188  // SlaveDofs::InsertFunctor
189  // ------------------------
190 
191  template< class Space, class Mapper >
192  template< class Map >
193  struct SlaveDofs< Space, Mapper >::InsertFunctor
194  {
195  explicit InsertFunctor ( Map &map ) : map_( map ) {}
196 
197  template< class Value >
198  void operator() ( const int, const Value &value )
199  {
200  map_.insert( value );
201  }
202 
203  private:
204  Map &map_;
205  };
206 
207 
208 
209  // Implementation of SlaveDofs
210  // ---------------------------
211 
212  template< class Space, class Mapper >
214  {
215  const PartitionIteratorType idxpitype = GridPartType :: indexSetPartitionType;
216 
217  typedef typename GridPartType :: template Codim< 0 >
218  :: template Partition< idxpitype > :: IteratorType
219  IteratorType;
220 
221  const IteratorType endit = gridPart_.template end< 0, idxpitype >();
222  for( IteratorType it = gridPart_.template begin< 0, idxpitype >(); it != endit; ++it )
223  {
224  typedef typename GridPartType :: template Codim< 0 > :: EntityType
225  EntityType;
226 
227  const EntityType &entity = *it;
228  if( entity.partitionType() != Dune::InteriorEntity )
229  {
230  mapper_.mapEachEntityDof( entity, InsertFunctor< ThisType >( *this ) );
231  }
232  }
233 
234  // insert overall size at the end
235  insert( mapper_.size() );
236  }
237 
238 
239 
240  template< class Space, class Mapper >
242  {
243  // we have to skip communication when parallel program is
244  // executed only on one processor
245  // otherwise YaspGrid and Lagrange polorder=2 fails :(
246  if( gridPart_.comm().size() > 1 )
247  {
248  try
249  {
250  typedef LinkBuilder LinkBuilderHandleType;
251  LinkBuilderHandleType handle( *this, space_ , mapper_ );
252 
253  gridPart_.communicate
254  ( handle, GridPartType::indexSetInterfaceType, ForwardCommunication );
255  }
256  // catch possible exceptions here to have a clue where it happend
257  catch( const Exception &e )
258  {
259  std::cerr << e << std::endl;
260  std::cerr << "Exception thrown in: " << __FILE__ << " line:" << __LINE__ << std::endl;
261  abort();
262  }
263  }
264 
265  // insert overall size at the end
266  insert( mapper_.size() );
267  }
268 
269 
270 
272  template< class Space, class Mapper >
273  class SlaveDofs< Space, Mapper > :: SingletonKey
274  {
275  public:
276  typedef Space SpaceType;
277  typedef Mapper MapperType;
278 
279  protected:
280  const SpaceType &space_;
281  const MapperType *const mapper_;
282 
283  public:
285  inline SingletonKey ( const SpaceType &space,
286  const MapperType &mapper )
287  : space_( space ),
288  mapper_( &mapper )
289  {}
290 
292  inline SingletonKey ( const SingletonKey &other )
293  : space_( other.space_ ),
294  mapper_( other.mapper_ )
295  {}
296 
298  inline bool operator== ( const SingletonKey &other ) const
299  {
300  return (space_ == other.space_) && (mapper_ == other.mapper_);
301  }
302 
304  const SpaceType &space () const
305  {
306  return space_;
307  }
308 
310  const MapperType &mapper () const
311  {
312  return *mapper_;
313  }
314  };
315 
316 
317 
318  template< class Space, class Mapper >
319  class SlaveDofs< Space,Mapper > :: LinkBuilder
320  : public CommDataHandleIF< LinkBuilder, int >
321  {
322  public:
323  typedef Space SpaceType;
324  typedef Mapper MapperType;
325 
326  enum { nCodim = SpaceType :: GridType :: dimension + 1 };
327 
328  public:
329  typedef int DataType;
330 
331  const int myRank_;
332  const int mySize_;
333 
335  IndexMapType &slaves_;
336 
337  const SpaceType &space_;
338  const MapperType &mapper_;
339 
340  public:
341  LinkBuilder( IndexMapType &slaves,
342  const SpaceType &space,
343  const MapperType& mapper )
344  : myRank_( space.gridPart().comm().rank() ),
345  mySize_( space.gridPart().comm().size() ),
346  slaves_( slaves ),
347  space_( space ),
348  mapper_( mapper )
349  {
350  }
351 
352  bool contains ( int dim, int codim ) const
353  {
354  return mapper_.contains( codim );
355  }
356 
357  bool fixedsize ( int dim, int codim ) const
358  {
359  return false;
360  }
361 
363  template< class MessageBuffer, class Entity >
364  inline void gather ( MessageBuffer &buffer,
365  const Entity &entity ) const
366  {
367  // for sending ranks write rank
368  if( sendRank( entity ) ) buffer.write( myRank_ );
369  }
370 
375  template< class MessageBuffer, class EntityType >
376  inline void scatter ( MessageBuffer &buffer,
377  const EntityType &entity,
378  size_t n )
379  {
380  // ERROR: An overlap cell may be overlay cell in another process
381  //assert( ( ! sendRank( entity ) ) ? (n > 0) : true);
382  if( n == 1 )
383  {
384  int rank;
385  buffer.read( rank );
386 
387  assert( (rank >= 0) && (rank < mySize_) );
388 
389  // if entity in not interiorBorder insert anyway
390  if ( rank < myRank_ || ! sendRank( entity ) )
391  mapper_.mapEachEntityDof( entity, InsertFunctor< IndexMapType >( slaves_ ) );
392  }
393  }
394 
396  template< class Entity >
397  size_t size ( const Entity &entity ) const
398  {
399  return (sendRank( entity )) ? 1 : 0;
400  }
401 
402  protected:
403  template <class Entity>
404  bool sendRank(const Entity& entity) const
405  {
406  const PartitionType ptype = entity.partitionType();
407  return (ptype == InteriorEntity) || (ptype == BorderEntity);
408  }
409  };
410 
413  template< class DiscreteFunctionSpace >
415  {
416  public:
419 
420  private:
422 
423  public:
425  typedef typename DiscreteFunctionSpaceType :: BlockMapperType MapperType;
426 
427  enum { blockSize = DiscreteFunctionSpaceType :: localBlockSize };
428 
429  // type of communication manager object which does communication
432 
435 
436  protected:
437  const DiscreteFunctionSpaceType &space_;
438 
439  // is singleton per space
440  SlaveDofsType *const slaveDofs_;
441 
442  public:
444  inline SlaveDofsProvider ( const DiscreteFunctionSpaceType &space )
445  : space_( space ),
446  slaveDofs_( getSlaveDofs( space_ ) )
447  {
448  }
449 
450  private:
451  // prohibit copying
452  SlaveDofsProvider( const ThisType & );
453 
454  public:
456  const DiscreteFunctionSpaceType& space() const { return space_; }
457 
460  {
461  SlaveDofsProviderType :: removeObject( *slaveDofs_ );
462  }
463 
464  inline SlaveDofsType &slaveDofs () const
465  {
466  // rebuild slave dofs if grid was changed
467  slaveDofs_->rebuild();
468  return *slaveDofs_;
469  }
470 
471  protected:
472  inline static SlaveDofsType *getSlaveDofs ( const DiscreteFunctionSpaceType &space )
473  {
474  SlaveDofsKeyType key( space, space.blockMapper() );
475  return &(SlaveDofsProviderType :: getObject( key ));
476  }
477  };
478 
479 #if HAVE_MPI
480  template< class DiscreteFunction >
484  : public SlaveDofsProvider< typename DiscreteFunction :: DiscreteFunctionSpaceType >
485  {
486  public:
487  typedef DiscreteFunction DiscreteFunctionType;
488 
490  typedef typename DiscreteFunctionType :: DiscreteFunctionSpaceType
492 
493  private:
496 
497  public:
499  typedef typename DiscreteFunctionSpaceType :: RangeFieldType RangeFieldType;
500 
502  typedef typename DiscreteFunctionSpaceType :: BlockMapperType MapperType;
503 
504  enum { blockSize = DiscreteFunctionSpaceType :: localBlockSize };
505 
506  // type of communication manager object which does communication
508 
509  typedef typename DiscreteFunctionType :: ConstDofBlockPtrType
511 
514  : BaseType( space )
515  {
516  }
517 
518  using BaseType :: space;
519 
520  public:
521  template < class OtherDiscreteFunctionType >
523  inline RangeFieldType scalarProductDofs ( const DiscreteFunctionType &x,
524  const OtherDiscreteFunctionType &y ) const
525  {
526  typedef typename OtherDiscreteFunctionType :: ConstDofBlockPtrType
527  OtherConstDofBlockPtrType;
528  SlaveDofsType &slaveDofs = this->slaveDofs();
529 
530  RangeFieldType scp = 0;
531 
532  const int numSlaves = slaveDofs.size();
533  for( int slave = 0, i = 0 ; slave < numSlaves; ++slave )
534  {
535  const int nextSlave = slaveDofs[ slave ];
536  for(; i < nextSlave; ++i )
537  {
538  ConstDofBlockPtrType xPtr = x.block( i );
539  OtherConstDofBlockPtrType yPtr = y.block( i );
540  for( unsigned int j = 0; j < blockSize; ++j )
541  scp += (*xPtr)[ j ] * (*yPtr)[ j ];
542  }
543 
544  // skip the slave dof
545  ++i;
546  }
547 
548  // do global sum
549  scp = space().gridPart().comm().sum( scp );
550  return scp;
551  }
552  };
553 #else
554  template< class DiscreteFunction >
558  {
559  public:
560  typedef DiscreteFunction DiscreteFunctionType;
561 
562  private:
564 
565  public:
567  typedef typename DiscreteFunctionType :: DiscreteFunctionSpaceType
569 
571  typedef typename DiscreteFunctionSpaceType :: RangeFieldType RangeFieldType;
572 
573  typedef typename DiscreteFunctionType :: ConstDofIteratorType
574  ConstDofIteratorType;
575 
576  public:
578  inline ParallelScalarProduct ( const DiscreteFunctionSpaceType & )
579  {
580  }
581 
582  private:
583  // prohibit copying
584  ParallelScalarProduct( const ThisType & );
585 
586  public:
587  template < class OtherDiscreteFunctionType >
589  inline RangeFieldType scalarProductDofs ( const DiscreteFunctionType &x,
590  const OtherDiscreteFunctionType &y ) const
591  {
592  RangeFieldType scp = 0;
593 
594  ConstDofIteratorType endit = x.dend ();
595  ConstDofIteratorType xit = x.dbegin ();
596 
597  typedef typename OtherDiscreteFunctionType :: ConstDofIteratorType
598  OtherConstDofIteratorType;
599  OtherConstDofIteratorType yit = y.dbegin();
600 
601  for( ; xit != endit; ++xit, ++yit )
602  scp += (*xit) * (*yit);
603  return scp;
604  }
605  };
606 #endif
607 
608 #if HAVE_DUNE_ISTL
609  template< class DiscreteFunctionSpaceImp >
613  < ISTLBlockVectorDiscreteFunction< DiscreteFunctionSpaceImp > >
614  : public ScalarProduct
615  < typename ISTLBlockVectorDiscreteFunction< DiscreteFunctionSpaceImp >
616  :: DofStorageType >
617  {
623  typedef typename DiscreteFunctionType :: DofStorageType BlockVectorType;
625  typedef typename DiscreteFunctionType :: DiscreteFunctionSpaceType
627 
629  typedef typename DiscreteFunctionSpaceType :: RangeFieldType RangeFieldType;
630 
632  typedef typename DiscreteFunctionSpaceType :: BlockMapperType MapperType;
633 
634  public:
635  // type of communication manager object which does communication
637  typedef typename SlaveDofsProviderType :: SlaveDofsType SlaveDofsType;
638 
639  public:
641  typedef BlockVectorType domain_type;
642  typedef typename BlockVectorType :: block_type :: field_type field_type;
643 
645  enum { category=SolverCategory::sequential };
646 
647  protected:
648  const DiscreteFunctionSpaceType & space_;
649  SlaveDofsProviderType slaveDofProvider_;
650 
651  ParallelScalarProduct ( const ThisType &org );
652  public:
654  ParallelScalarProduct ( const DiscreteFunctionSpaceType &space )
655  : space_( space ),
656  slaveDofProvider_( space )
657  {}
658 
661  {}
662 
663  SlaveDofsType& slaveDofs ()
664  {
665  return slaveDofProvider_.slaveDofs();
666  }
667 
668  const SlaveDofsType& slaveDofs () const
669  {
670  return slaveDofProvider_.slaveDofs();
671  }
672 
677  RangeFieldType scalarProductDofs(const DiscreteFunctionType& x,
678  const DiscreteFunctionType& y) const
679  {
680  std::cout << "ISTL prod" << std::endl;
681  return scalarProductDofs(x.blockVector(),y.blockVector());
682  }
683 
688  virtual field_type dot (const BlockVectorType& x,
689  const BlockVectorType& y)
690  {
691  return const_cast<ThisType&> (*this).scalarProductDofs(x,y);
692  }
693 
697  virtual typename Dune::FieldTraits< RangeFieldType >::real_type
698  norm (const BlockVectorType& x)
699  {
700  return std::abs( std::sqrt( const_cast<ThisType&> (*this).scalarProductDofs(x,x) ) );
701  }
702 
704  void deleteNonInterior(BlockVectorType& x) const
705  {
706 #if HAVE_MPI
707  // case of ALUGrid and DGSpace or FVSpace
708  const bool deleteGhostEntries = (space_.gridPart().grid().overlapSize( 0 ) == 0) && !space_.continuous();
709 
710  // only delete ghost entries
711  if( deleteGhostEntries )
712  {
713  // rebuild slave dofs if grid was changed
714  SlaveDofsType &slaveDofs = slaveDofProvider_.slaveDofs();
715 
716  // don't delete the last since this is the overall Size
717  const int slaveSize = slaveDofs.size() - 1;
718  for(int slave = 0; slave<slaveSize; ++slave)
719  {
720  x[ slaveDofs[slave] ] = 0;
721  }
722  }
723 #endif
724  }
725 
726  protected:
731  RangeFieldType scalarProductDofs(const BlockVectorType& x,
732  const BlockVectorType& y) const
733  {
734 #if HAVE_MPI
735  // rebuild slave dofs if grid was changed
736  SlaveDofsType &slaveDofs = slaveDofProvider_.slaveDofs();
737 
738  RangeFieldType scp = 0;
739  int i = 0;
740  const int slaveSize = slaveDofs.size();
741  for(int slave = 0; slave<slaveSize; ++slave)
742  {
743  const int nextSlave = slaveDofs[slave];
744  for(; i<nextSlave; ++i)
745  {
746  scp += x[i] * y[i];
747  }
748  // set i to next valid value
749  ++i;
750  }
751  scp = space_.gridPart().comm().sum( scp );
752  return scp;
753 #else
754  // return build-in scalar product
755  RangeFieldType scp = x * y;
756  scp = space_.gridPart().comm().sum( scp );
757  return scp;
758 #endif
759  }
760  };
761 #endif
762 
764 
765  } // end namespace Fem
766 
767 } // end namespace Dune
768 #endif // #ifndef DUNE_FEM_SCALARPRODURCTS_HH
const int myRank_
Definition: scalarproducts.hh:78
Space SpaceType
Definition: scalarproducts.hh:276
const SpaceType & space_
Definition: scalarproducts.hh:337
static double sqrt(const Double &v)
Definition: double.hh:870
static SlaveDofsType * getSlaveDofs(const DiscreteFunctionSpaceType &space)
Definition: scalarproducts.hh:472
SlaveDofs< Space, Mapper > IndexMapType
Definition: scalarproducts.hh:334
IndexMapType & slaves_
Definition: scalarproducts.hh:335
bool sendRank(const Entity &entity) const
Definition: scalarproducts.hh:404
int DataType
Definition: scalarproducts.hh:329
void insert(const int index)
insert index
Definition: scalarproducts.hh:129
Fem::CommunicationIndexMap IndexMapType
Definition: scalarproducts.hh:71
void gather(MessageBuffer &buffer, const Entity &entity) const
read buffer and apply operation
Definition: scalarproducts.hh:364
Mapper MapperType
type of used mapper
Definition: scalarproducts.hh:68
const SpaceType & space() const
return reference to index set
Definition: scalarproducts.hh:304
bool isSlave(const int index) const
return true if index is contained, meaning is a slave dof
Definition: scalarproducts.hh:118
LinkBuilder(IndexMapType &slaves, const SpaceType &space, const MapperType &mapper)
Definition: scalarproducts.hh:341
Mapper MapperType
Definition: scalarproducts.hh:324
const SpaceType & space_
Definition: scalarproducts.hh:74
Singleton list for key/object pairs.
Definition: singletonlist.hh:49
const DiscreteFunctionSpaceType & space_
Definition: scalarproducts.hh:437
Mapper MapperType
Definition: scalarproducts.hh:277
Space SpaceType
Definition: scalarproducts.hh:323
~SlaveDofsProvider()
remove object comm
Definition: scalarproducts.hh:459
SingletonKey(const SpaceType &space, const MapperType &mapper)
constructor taking space
Definition: scalarproducts.hh:285
SlaveDofsType::SingletonKey SlaveDofsKeyType
Definition: scalarproducts.hh:431
size_t size(const Entity &entity) const
return local dof size to be communicated
Definition: scalarproducts.hh:397
size_t size() const
return size of map
Definition: commindexmap.hh:87
DiscreteFunctionSpaceType::BlockMapperType MapperType
type of used mapper
Definition: scalarproducts.hh:425
SlaveDofsType & slaveDofs() const
Definition: scalarproducts.hh:464
SlaveDofs< DiscreteFunctionSpaceType, MapperType > SlaveDofsType
Definition: scalarproducts.hh:430
int size() const
return number of slave dofs
Definition: scalarproducts.hh:112
const MapperType & mapper() const
return reference to index set
Definition: scalarproducts.hh:310
void buildDiscontinuousMaps()
Definition: scalarproducts.hh:213
void buildMaps()
Definition: scalarproducts.hh:172
Key for CommManager singleton list.
Definition: scalarproducts.hh:273
Double abs(const Double &a)
Definition: double.hh:860
SlaveDofs(const SingletonKey &key)
constructor taking space
Definition: scalarproducts.hh:90
void clear()
clear index map
Definition: commindexmap.hh:44
bool operator==(const Double &a, const Double &b)
Definition: double.hh:589
const MapperType & mapper_
Definition: scalarproducts.hh:338
Definition: scalarproducts.hh:483
DiscreteFunctionType::ConstDofBlockPtrType ConstDofBlockPtrType
Definition: scalarproducts.hh:510
void initialize()
initialize
Definition: scalarproducts.hh:135
SlaveDofsType *const slaveDofs_
Definition: scalarproducts.hh:440
DiscreteFunctionSpaceType::BlockMapperType MapperType
type of used mapper
Definition: scalarproducts.hh:502
Definition: coordinate.hh:4
void set(const std::set< GlobalKey > &idxSet)
insert sorted set of indices
Definition: commindexmap.hh:71
const GridPartType & gridPart_
Definition: scalarproducts.hh:75
Definition: scalarproducts.hh:319
std::set< int > slaveSet_
Definition: scalarproducts.hh:83
void scatter(MessageBuffer &buffer, const EntityType &entity, size_t n)
Definition: scalarproducts.hh:376
int operator[](const int index) const
return dof number of salve with index
Definition: scalarproducts.hh:106
SlaveDofs< DiscreteFunctionSpaceType, MapperType > SlaveDofsType
Definition: scalarproducts.hh:507
Definition: commindexmap.hh:17
const MapperType *const mapper_
Definition: scalarproducts.hh:281
int sequence_
know grid sequence number
Definition: scalarproducts.hh:86
const int mySize_
Definition: scalarproducts.hh:332
const SpaceType & space() const
return reference to discrete function space
Definition: scalarproducts.hh:168
void buildCommunicatedMaps()
Definition: scalarproducts.hh:241
DiscreteFunctionType::DiscreteFunctionSpaceType DiscreteFunctionSpaceType
type of the discrete function space
Definition: scalarproducts.hh:491
RangeFieldType scalarProductDofs(const DiscreteFunctionType &x, const OtherDiscreteFunctionType &y) const
evaluate scalar product and omit slave nodes
Definition: scalarproducts.hh:523
Definition: scalarproducts.hh:414
discrete function space
Definition: blockvectorfunction/blockvectorfunction.hh:44
SlaveDofsProvider(const DiscreteFunctionSpaceType &space)
constructor taking space
Definition: scalarproducts.hh:444
SingletonList< SlaveDofsKeyType, SlaveDofsType > SlaveDofsProviderType
Definition: scalarproducts.hh:434
DiscreteFunctionSpaceType::RangeFieldType RangeFieldType
type of range field
Definition: scalarproducts.hh:499
SpaceType DiscreteFunctionSpaceType
for convenience
Definition: scalarproducts.hh:62
DiscreteFunction DiscreteFunctionType
Definition: scalarproducts.hh:487
const MapperType & mapper_
Definition: scalarproducts.hh:76
bool fixedsize(int dim, int codim) const
Definition: scalarproducts.hh:357
Space SpaceType
type of discrete function space
Definition: scalarproducts.hh:55
SingletonKey(const SingletonKey &other)
copy constructor
Definition: scalarproducts.hh:292
SpaceType::GridPartType GridPartType
type of grid part
Definition: scalarproducts.hh:65
const DiscreteFunctionSpaceType & space() const
return discrete function space
Definition: scalarproducts.hh:456
const int myRank_
Definition: scalarproducts.hh:331
IndexMapType slaves_
Definition: scalarproducts.hh:82
bool contains(int dim, int codim) const
Definition: scalarproducts.hh:352
void finalize()
finalize
Definition: scalarproducts.hh:143
void rebuild()
check if grid has changed and rebuild cache if necessary
Definition: scalarproducts.hh:156
const int mySize_
Definition: scalarproducts.hh:79
DiscreteFunctionSpace DiscreteFunctionSpaceType
type of the discrete function space
Definition: scalarproducts.hh:418
Definition: scalarproducts.hh:44
ParallelScalarProduct(const DiscreteFunctionSpaceType &space)
constructor taking space
Definition: scalarproducts.hh:513
const SpaceType & space_
Definition: scalarproducts.hh:280