dune-fem  2.8-git
dofmanager.hh
Go to the documentation of this file.
1 #ifndef DUNE_FEM_DOFMANAGER_HH
2 #define DUNE_FEM_DOFMANAGER_HH
3 
4 #include <cassert>
5 #include <string>
6 #include <list>
7 
8 #include <dune/common/exceptions.hh>
9 #include <dune/common/stdstreams.hh>
10 #include <dune/common/version.hh>
11 
12 #if HAVE_DUNE_ALUGRID
13 #include <dune/alugrid/common/interfaces.hh>
14 #endif
15 
17 #include <dune/fem/io/parameter.hh>
26 
27 #include <dune/grid/common/datahandleif.hh>
28 #if HAVE_DUNE_ALUGRID
29 #include <dune/alugrid/common/ldbhandleif.hh>
30 #endif
31 
32 namespace Dune
33 {
34 
35  namespace Fem
36  {
37 
43  // forward declaration
44  template <class GridType> class DofManager;
45  template <class DofManagerImp> class DofManagerFactory;
46 
47 
49  //
50  // ManagedIndexSetInterface
51  //
53 
59  {
61  protected:
62  // use address of object as id
63  typedef const void * IdentifierType;
64  // pointer to compare index sets
66  // reference counter
68 
69  template< class IndexSet >
70  explicit ManagedIndexSetInterface ( const IndexSet &iset )
71  : setPtr_( getIdentifier( iset ) ),
73  {
74  }
75 
76  public:
77  virtual ~ManagedIndexSetInterface () = default;
78 
80  virtual void resize () = 0;
82  virtual bool compress () = 0;
83 
85  virtual void backup() const = 0;
87  virtual void restore() = 0;
88 
90  virtual void write( StandardOutStream& out ) const = 0;
91  virtual void read( StandardInStream& out ) = 0;
92 
95 
97  bool removeReference ( )
98  {
99  return (--referenceCounter_ == 0);
100  }
101 
102  template< class IndexSet >
103  bool equals ( const IndexSet &iset ) const
104  {
105  return (getIdentifier( iset ) == setPtr_);
106  }
107 
108  private:
109  template< class IndexSet >
110  IdentifierType getIdentifier ( const IndexSet &iset ) const
111  {
112  return static_cast< IdentifierType >( &iset );
113  }
114  };
115 
116  template <class IndexSetType, class EntityType> class RemoveIndicesFromSet;
117  template <class IndexSetType, class EntityType> class InsertIndicesToSet;
118 
119  template <class IndexSetType, class EntityType>
121  public ManagedIndexSetInterface ,
122  public LocalInlinePlus < ManagedIndexSet<IndexSetType,EntityType> , EntityType >
123  {
125  protected:
126  // the dof set stores number of dofs on entity for each codim
127  IndexSetType & indexSet_;
128 
129  // insertion and removal of indices
132 
136 
137  public:
140 
142  ManagedIndexSet ( const IndexSetType & iset,
143  LocalIndexSetObjectsType & indexSetList,
144  LocalIndexSetObjectsType & insertList,
145  LocalIndexSetObjectsType & removeList )
146  : BaseType( iset )
147  , indexSet_ (const_cast<IndexSetType &> (iset))
149  , indexSetList_(indexSetList)
150  , insertList_(insertList)
151  , removeList_(removeList)
152  {
153  this->setPtr_ = (void *) &indexSet_;
154 
155  indexSetList_ += *this;
157  {
160  }
161  }
162 
165  {
166  indexSetList_.remove( *this );
168  {
171  }
172  }
173 
175  void resize ()
176  {
177  indexSet_.resize();
178  }
179 
181  bool compress ()
182  {
183  return indexSet_.compress();
184  }
185 
186  // forward backup call to indexSet
187  virtual void backup () const
188  {
189  indexSet_.backup();
190  }
191 
192  // forward restore call to indexSet
193  virtual void restore ()
194  {
195  indexSet_.restore();
196  }
197 
199  virtual void read( StandardInStream& in ) { indexSet_.read( in ); }
200 
202  virtual void write( StandardOutStream& out ) const { indexSet_.write( out ); }
203  };
204 
206  //
207  // DofStorageInterface
208  //
210 
213  {
214  protected:
216  DofStorageInterface() = default;
217 
218  public:
220  virtual ~DofStorageInterface() = default;
221 
223  virtual void enableDofCompression() { }
224 
226  virtual int size () const = 0;
227  };
228 
229 
234  {
235  protected:
238 
239  public:
241  virtual ~ManagedDofStorageInterface() = default;
242 
244  virtual void resize ( const bool enlargeOnly ) = 0;
246  virtual void reserve (int newSize) = 0;
249  virtual void dofCompress ( const bool clearResizedArrays ) = 0;
251  virtual size_t usedMemorySize() const = 0;
252  };
253 
254 
255  template <class MemObjectType> class ResizeMemoryObjects;
256  template <class MemObjectType> class ReserveMemoryObjects;
257 
269  template <class GridImp, class MapperType , class DofArrayType>
271  {
272  // interface for MemObject lists
274  protected:
275  // type of this class
277 
279 
280  // reference to dof manager
282 
283  // the dof set stores number of dofs on entity for each codim
284  MapperType &mapper_;
285 
286  // Array which the dofs are stored in
287  DofArrayType& array_;
288 
293 
294  // true if data need to be compressed
296 
297  public:
299 
300  protected:
302  ManagedDofStorageImplementation ( const GridImp& grid,
303  const MapperType& mapper,
304  DofArrayType& array )
305  : dm_( DofManagerType :: instance( grid ) ),
306  mapper_ ( const_cast<MapperType& >(mapper)),
307  array_( array ),
308  resizeMemObj_(*this),
309  reserveMemObj_(*this),
311  {
312  // add to dof manager
313  dm_.addDofStorage( *this );
314 
315  // set memory over estimate factor, only for DofArray
316  array_.setMemoryFactor( dm_.memoryFactor() );
317  }
318 
321  {
322  // remove from dof manager
323  dm_.removeDofStorage( *this );
324  }
325 
326  public:
329 
332 
334  int size () const { return array_.size(); }
335 
337  void resize ( const bool enlargeOnly )
338  {
339  resize( std::integral_constant< bool, Capabilities::isAdaptiveDofMapper< MapperType >::v >(), enlargeOnly );
340  }
341 
343  inline void reserve ( const int needed )
344  {
345  // if index set is compressible, then add requested size
346  if( mapper().consecutive() )
347  {
348  const int nSize = size() + (needed * mapper().maxNumDofs());
349  array_.reserve( nSize );
350  }
351  else
352  {
353  // if compress is not needed just resize with given size
354  // therefore use newSize to enleage array
355  assert( ! mapper().consecutive() );
356  // resize array
357  resize ( false );
358  }
359  }
360 
362  void dofCompress ( const bool clearResizedArrays )
363  {
364  // get current size
365  const int nSize = mapper().size();
366 
367  // if data is non-temporary do data compression
369  {
370  // get old size (which we still have in array)
371  const int oldSize = array_.size();
372 
373  // NOTE: new size can also be larger than old size
374  // e.g. during loadBalancing when ghosts where
375  // introduced before compressing the index set
376 
377  // begin with block zero since closing of holes
378  // has to be done anyway if the mapper is consecutive
379  const int numBlocks = mapper().numBlocks();
380  for( int block = 0; block < numBlocks; ++block )
381  {
382  // move memory
383  moveToFront( oldSize, block );
384 
385  // only close holes for consecutive mappers
386  if( mapper().consecutive () )
387  {
388  // run over all holes and copy array vules to new place
389  const int holes = mapper().numberOfHoles( block );
390  for( int i = 0; i < holes; ++i )
391  {
392  const int oldIndex = mapper().oldIndex( i, block );
393  const int newIndex = mapper().newIndex( i, block );
394 
395  assert( newIndex < nSize );
396  // implements array_[ newIndex ] = array_[ oldIndex ] ;
397  array_.copyContent( newIndex, oldIndex );
398  }
399  }
400  }
401  }
402 
403  // store new size, which should be smaller then actual size
404  array_.resize( nSize );
405 
406  if( clearResizedArrays && ! dataCompressionEnabled_ )
407  {
408  // if enabled clear temporary data to avoid occasionally NaN values
409  array_.clear();
410  }
411  }
412 
414  size_t usedMemorySize() const
415  {
416  return ((size_t) sizeof(ThisType) + array_.usedMemorySize());
417  }
418 
421  {
423  }
424 
426  DofArrayType & getArray() { return array_; }
427 
428  protected:
429  inline MapperType &mapper () const
430  {
431  return mapper_;
432  }
433 
434  // resize for non-adaptive mappers
435  void resize ( std::false_type, const bool enlargeOnly )
436  {
437  // note: The mapper might already have been updated, so do not use
438  // it to obtain old array size.
439  mapper().update(); // make sure the mapper is up2date
440 
441  const int newSize = mapper().size();
442  const int oldSize = array_.size();
443 
444  if( enlargeOnly && newSize < oldSize ) return ;
445 
446  if( newSize != oldSize )
447  array_.resize( newSize );
448  }
449 
450  // resize for adaptive mappers
451  void resize ( std::true_type, const bool enlargeOnly )
452  {
453  // note: The mapper is adaptive and has been updated automatically, so
454  // do not use it to obtain old array size.
455  const int oldSize = array_.size();
456 
457  // get current size
458  const int nSize = mapper().size();
459 
460  // if enlarge only option is given only resize
461  // if new size if larger than old size
462  if( enlargeOnly && nSize <= oldSize ) return ;
463 
464  // if nothing changed do nothing
465  if( nSize == oldSize ) return ;
466 
467  // resize memory to current value
468  array_.resize( nSize );
469 
470  // if data is only temporary data, don't adjust memory
471  if( ! dataCompressionEnabled_ || enlargeOnly ) return ;
472 
473  // now check all blocks beginning with the largest
474  const int numBlocks = mapper().numBlocks();
475 
476  // initialize upperBound
477  int upperBound = oldSize ;
478 
479  // make sure offset of block 0 is zero
480  assert( mapper().offSet( 0 ) == 0 );
481  assert( mapper().oldOffSet( 0 ) == 0 );
482 
483  // skip block 0 (since offset == 0)
484  for( int block = numBlocks-1; block >= 1; --block )
485  {
486  // get offsets
487  const int newOffSet = mapper().offSet( block );
488  const int oldOffSet = mapper().oldOffSet( block );
489 
490  // make sure new offset is larger
491  assert( newOffSet >= oldOffSet );
492 
493  // if off set is not zero
494  if( newOffSet > oldOffSet )
495  {
496  // calculate block size
497  const int blockSize = upperBound - oldOffSet;
498  // move block backward
499  array_.memMoveBackward( blockSize, oldOffSet, newOffSet );
500 
501  // update upper bound
502  upperBound = oldOffSet;
503  }
504  }
505  }
506 
507  // move array to rear insertion points
509  {
510  }
511 
513  void moveToFront ( const int oldSize, const int block )
514  {
515  // get insertion point from block
516  const int oldOffSet = mapper().oldOffSet( block );
517 
518  // get new off set
519  const int newOffSet = mapper().offSet( block );
520 
521  // here we should have at least the same offsets
522  assert( newOffSet <= oldOffSet );
523 
524  // only if block is not starting from zero
525  if( newOffSet < oldOffSet )
526  {
527  // get number of blocks
528  const int numBlocks = mapper().numBlocks();
529 
530  // for last section upperBound is size
531  const int upperBound
532  = (block == numBlocks - 1) ? oldSize : mapper().oldOffSet( block + 1 );
533  const int blockSize = upperBound - oldOffSet;
534 
535  // move block forward
536  array_.memMoveForward( blockSize, oldOffSet, newOffSet );
537  }
538  }
539  };
540 
542  template <class GridImp, class MapperType , class DofArrayType>
543  class ManagedDofStorage : public ManagedDofStorageImplementation< GridImp, MapperType, DofArrayType >
544  {
546  protected:
547  DofArrayType myArray_;
548  public:
550  ManagedDofStorage( const GridImp& grid,
551  const MapperType& mapper )
552  : BaseType( grid, mapper, myArray_ ),
553  myArray_( mapper.size() )
554  {
555  }
556  };
557 
559  template< class DofStorageType, class GridType, class MapperType >
560  static inline std::pair< DofStorageInterface* , DofStorageType* >
561  allocateManagedDofStorage( const GridType& grid,
562  const MapperType& mapper,
563  const DofStorageType * = 0 )
564  {
565  // create managed dof storage
566  typedef ManagedDofStorage< GridType, MapperType,
567  DofStorageType > ManagedDofStorageType;
568 
569  ManagedDofStorageType* mds = new ManagedDofStorageType( grid, mapper );
570  assert( mds );
571 
572  // return pair with dof storage pointer and array pointer
573  return std::pair< DofStorageInterface* , DofStorageType* >
574  ( mds , & mds->getArray () );
575  }
576 
577 
578 
580  //
581  // RestrictPorlong for Index Sets
582  //
584 
585  template <class IndexSetType, class EntityType>
587  : public LocalInlinePlus < RemoveIndicesFromSet<IndexSetType,EntityType> , EntityType >
588  {
589  private:
590  // the dof set stores number of dofs on entity for each codim
591  IndexSetType & indexSet_;
592 
593  public:
594  // Constructor of MemObject, only to call from DofManager
595  explicit RemoveIndicesFromSet ( IndexSetType & iset ) : indexSet_ (iset) {}
596 
598  inline void apply ( EntityType & entity )
599  {
600  indexSet_.removeEntity( entity );
601  }
602  };
603 
604  template <class IndexSetType, class EntityType>
606  : public LocalInlinePlus < InsertIndicesToSet< IndexSetType, EntityType > , EntityType >
607  {
608  private:
609  // the dof set stores number of dofs on entity for each codim
610  IndexSetType & indexSet_;
611 
612  public:
613  // Constructor of MemObject, only to call from DofManager
614  explicit InsertIndicesToSet ( IndexSetType & iset ) : indexSet_ (iset) {}
615 
617  inline void apply ( EntityType & entity )
618  {
619  indexSet_.insertEntity( entity );
620  }
621  };
622 
623  template <class MemObjectType>
625  : public LocalInlinePlus < ResizeMemoryObjects < MemObjectType > , int >
626  {
627  private:
628  // the dof set stores number of dofs on entity for each codim
629  MemObjectType & memobj_;
630 
631  public:
632  // Constructor of MemObject, only to call from DofManager
633  ResizeMemoryObjects ( MemObjectType & mo ) : memobj_ (mo) {}
635  : memobj_(org.memobj_)
636  {}
637 
638  // resize mem object, parameter not needed
639  inline void apply ( int& enlargeOnly )
640  {
641  memobj_.resize( bool(enlargeOnly) );
642  }
643  };
644 
645  // this class is the object for a single MemObject to
646  template <class MemObjectType>
648  : public LocalInlinePlus < ReserveMemoryObjects < MemObjectType > , int >
649  {
650  private:
651  // the dof set stores number of dofs on entity for each codim
652  MemObjectType & memobj_;
653 
654  public:
655  // Constructor of MemObject, only to call from DofManager
656  ReserveMemoryObjects ( MemObjectType & mo ) : memobj_ (mo) {}
657 
658  // reserve for at least chunkSize new values
659  inline void apply ( int & chunkSize )
660  {
661  memobj_.reserve( chunkSize );
662  }
663  };
664 
665 
666  // this is the dofmanagers object which is being used during restriction
667  // and prolongation process for adding and removing indices to and from
668  // index sets which belong to functions that belong to that dofmanager
669  template <class DofManagerType , class RestrictProlongIndexSetType, bool doResize >
672  RestrictProlongTraits<
673  IndexSetRestrictProlong<DofManagerType,RestrictProlongIndexSetType,doResize>, double > >
674  {
675  DofManagerType & dm_;
676 
677  RestrictProlongIndexSetType & insert_;
678  RestrictProlongIndexSetType & remove_;
679  public:
680 
681  IndexSetRestrictProlong ( DofManagerType & dm , RestrictProlongIndexSetType & is, RestrictProlongIndexSetType & rm )
682  : dm_(dm) , insert_( is ), remove_( rm ) {}
683 
685  template <class EntityType>
686  inline void restrictLocal ( const EntityType & father, const EntityType & son , bool initialize ) const
687  {
688  // insert index of father
689  insert_.apply( father );
690  // mark index of son for removal
691  remove_.apply( son );
692 
693  // resize memory if doResize is true
694  if ( doResize )
695  {
696  dm_.resizeMemory();
697  }
698  }
699 
700  template <class EntityType>
701  inline void restrictFinalize( const EntityType &father ) const
702  {}
703 
705  template <class EntityType>
706  inline void prolongLocal ( const EntityType & father, const EntityType & son , bool initialize ) const
707  {
708  // mark index of father for removal
709  remove_.apply( father );
710  // insert index of son
711  insert_.apply( son );
712 
713  // resize memory if doResize is true
714  if ( doResize )
715  {
716  dm_.resizeMemory();
717  }
718  }
719  };
720 
721  // empty restrict prolong operator
723  public RestrictProlongInterface< RestrictProlongTraits< EmptyIndexSetRestrictProlong, double > >
724  {
725  public:
728  template <class EntityType>
729  inline void restrictLocal ( EntityType & father, EntityType & son , bool initialize ) const {}
731  template <class EntityType>
732  inline void prolongLocal ( EntityType & father, EntityType & son , bool initialize ) const {}
733  };
734 
735 
736  class DofManError : public Exception {};
737 
753  // --DofManager
754  template< class Grid >
755  class DofManager :
756 #if HAVE_DUNE_ALUGRID
757  public IsDofManager,
758  public LoadBalanceHandleWithReserveAndCompress,
759 #endif
760  // DofManager behaves like a communication data handle for load balancing
761  public CommDataHandleIF< DofManager< Grid >, char >
762  {
764 
765  friend struct DefaultSingletonFactory< const Grid*, ThisType >;
766  friend class DofManagerFactory< ThisType >;
767 
768  public:
770  typedef Grid GridType;
771 
774  public:
775  // types of inlining and xtraction stream types
776  typedef MessageBufferIF< XtractStreamImplType > XtractStreamType;
777  typedef MessageBufferIF< InlineStreamImplType > InlineStreamType;
778 
779  // types of data collectors
782 
783  typedef typename GridType :: template Codim< 0 > :: Entity ElementType ;
784 
785  private:
786  typedef std::list< ManagedDofStorageInterface* > ListType;
788  typedef std::list< ManagedIndexSetInterface * > IndexListType;
789 
790  // list with MemObjects, for each DiscreteFunction we have one MemObject
791  ListType memList_;
792 
793  // list of all different indexsets
794  IndexListType indexList_;
795 
796  // the dofmanager belong to one grid only
797  const GridType &grid_;
798 
799  // index set for mapping
800  mutable DataInlinerType dataInliner_;
801  mutable DataXtractorType dataXtractor_;
802 
805  typedef const ElementType ConstElementType;
807 
808  mutable LocalIndexSetObjectsType indexSets_;
809 
810  mutable LocalIndexSetObjectsType insertIndices_;
811  mutable LocalIndexSetObjectsType removeIndices_;
812 
813  // lists containing all MemObjects
814  // to have fast access during resize and reserve
815  mutable MemObjectCheckType resizeMemObjs_;
816  mutable MemObjectCheckType reserveMemObjs_;
817 
819  const int defaultChunkSize_;
820 
822  int sequence_;
823 
824  public:
829 
830  // old type
832 
833  // this class needs to call resizeMemory
835  friend class IndexSetRestrictProlong< ThisType , LocalIndexSetObjectsType , false > ;
836 
837  private:
838  // combine object holding all index set for restrict and prolong
839  NewIndexSetRestrictProlongType indexSetRestrictProlong_;
840  IndexSetRestrictProlongNoResizeType indexSetRestrictProlongNoResize_;
841 
842  // old type
843  IndexSetRestrictProlongType indexRPop_;
844 
846  double memoryFactor_;
847 
849  const bool clearResizedArrays_;
850 
851  //**********************************************************
852  //**********************************************************
854  inline explicit DofManager ( const GridType *grid )
855  : grid_( *grid ),
856  defaultChunkSize_( 128 ),
857  sequence_( 0 ),
858  indexSetRestrictProlong_( *this, insertIndices_ , removeIndices_ ),
859  indexSetRestrictProlongNoResize_( *this, insertIndices_ , removeIndices_ ),
860  indexRPop_(),
861  memoryFactor_( Parameter :: getValidValue( "fem.dofmanager.memoryfactor", double( 1.1 ),
862  [] ( double value ) { return value >= 1.0; } ) ),
863  clearResizedArrays_( Parameter :: getValue("fem.dofmanager.clearresizedarrays", bool( true ) ) )
864  {
865  // only print memory factor if it deviates from the default value
866  if( std::abs( memoryFactor_ - 1.1 ) > 1e-12 )
867  if( Parameter::verbose() && (grid_.comm().rank() == 0) )
868  std::cout << "Created DofManager with memory factor " << memoryFactor_ << "." << std::endl;
869  }
870 
872  ~DofManager ();
873 
874  public:
875  DofManager( const ThisType& ) = delete;
876 
878  double memoryFactor() const { return memoryFactor_; }
879 
898  template <class IndexSetType>
899  inline void addIndexSet (const IndexSetType &iset );
900 
908  template <class IndexSetType>
909  inline void removeIndexSet (const IndexSetType &iset );
910 
915  template <class ManagedDofStorageImp>
916  void addDofStorage(ManagedDofStorageImp& dofStorage);
917 
922  template <class ManagedDofStorageImp>
923  void removeDofStorage(ManagedDofStorageImp& dofStorage);
924 
927  {
928  // hier muss statt dessen ein Combiniertes Object erzeugt werden.
929  // dafuer sollte bei einhaengen der IndexSets ein Methoden Pointer
930  // erzeugt werden, welcher die den IndexSet mit einem anderen Object
931  // kombiniert
932  return indexSetRestrictProlong_;
933  }
934 
937  {
938  // return index set restrict/prolong operator that is only inserting
939  // and mark for removal indices but not doing resize
940  return indexSetRestrictProlongNoResize_;
941  }
942 
944  bool hasIndexSets() const
945  {
946  return ! insertIndices_.empty();
947  }
948 
950  size_t usedMemorySize () const
951  {
952  size_t used = 0;
953  for(auto memObjectPtr : memList_)
954  used += memObjectPtr->usedMemorySize();
955  return used;
956  }
957 
962  {
963  resizeMemory();
964  }
965 
968  void reserveMemory ( int nsize, bool dummy = false )
969  {
970  int localChunkSize = std::max(nsize, defaultChunkSize_ );
971  assert( localChunkSize > 0 );
972 
973  // reserves (size + chunkSize * elementMemory), see above
974  reserveMemObjs_.apply ( localChunkSize );
975  }
976 
981  int sequence () const { return sequence_; }
982 
986  void resize()
987  {
988  for(auto indexSetPtr : indexList_)
989  indexSetPtr->resize();
990  resizeMemory();
991  }
992 
994  inline void insertEntity( ConstElementType & element )
995  {
996  // insert new index
997  insertIndices_.apply( element );
998 
999  // resize memory
1000  resizeMemory();
1001  }
1002 
1004  inline void removeEntity( ConstElementType & element )
1005  {
1006  removeIndices_.apply( element );
1007  }
1008 
1011  {
1012  int enlargeOnly = 0;
1013  // pass dummy parameter
1014  resizeMemObjs_.apply ( enlargeOnly );
1015  }
1016 
1019  {
1020  int enlargeOnly = 1;
1021  // pass dummy parameter
1022  resizeMemObjs_.apply ( enlargeOnly );
1023  }
1024 
1029  {
1030  // mark next sequence
1031  ++sequence_;
1032 
1033  // check that sequence number is the same for all processes
1034  assert( sequence_ == grid_.comm().max( sequence_ ) );
1035  }
1036 
1037  //- --compress
1041  void compress()
1042  {
1043  // mark next sequence
1045 
1046  // compress indexsets first
1047  for(auto indexSetPtr : indexList_)
1048  {
1049  // reset compressed so the next time compress of index set is called
1050  indexSetPtr->compress();
1051  }
1052 
1053  // compress all data now
1054  for(auto memObjectPtr : memList_)
1055  {
1056  // if correponding index was not compressed yet, this is called in
1057  // the MemObject dofCompress, if index has not changes, nothing happens
1058  // if IndexSet actual needs no compress, nothing happens to the
1059  // data either
1060  // also data is resized, which means the vector is getting shorter
1061  memObjectPtr->dofCompress ( clearResizedArrays_ );
1062  }
1063  }
1064 
1066  bool notifyGlobalChange( const bool wasChanged ) const
1067  {
1068  // make sure that wasChanged is the same on all cores
1069  int wasChangedCounter = int( wasChanged );
1070  return bool( grid_.comm().max( wasChangedCounter ) );
1071  }
1072 
1074  template <class DataCollType>
1075  void addDataInliner ( DataCollType & d)
1076  {
1077  dataInliner_ += d;
1078  }
1079 
1082  {
1083  dataInliner_.clear();
1084  }
1085 
1087  template <class DataCollType>
1088  void addDataXtractor ( DataCollType & d)
1089  {
1090  dataXtractor_ += d;
1091  }
1092 
1095  {
1096  dataXtractor_.clear();
1097  }
1098 
1100  // CommDataHandleIF methods
1102 
1104  bool contains( const int dim, const int codim ) const
1105  {
1106  return ( codim == 0 );
1107  }
1108 
1110  bool fixedSize( const int dim, const int codim ) const
1111  {
1112  return false;
1113  }
1114 
1116  template <class Entity>
1117  size_t size( const Entity& ) const
1118  {
1119  DUNE_THROW(NotImplemented,"DofManager::size should not be called!");
1120  return 0;
1121  }
1122 
1124  void gather( InlineStreamType& str, ConstElementType& element ) const
1125  {
1126  dataInliner_.apply(str, element);
1127 
1128  // remove entity from index sets
1129  const_cast< ThisType & >( *this ).removeEntity( element );
1130  }
1131 
1132  template <class MessageBuffer, class Entity>
1133  void gather( MessageBuffer& str, const Entity& entity ) const
1134  {
1135  DUNE_THROW(NotImplemented,"DofManager::gather( entity ) with codim > 0 not implemented");
1136  }
1137 
1139  void scatter ( XtractStreamType& str, ConstElementType& element, size_t )
1140  {
1141  // insert entity into index sets
1142  insertEntity( element );
1143 
1144  // here the elements already have been created
1145  // that means we can xtract data
1146  dataXtractor_.apply(str, element);
1147  }
1148 
1150  template <class MessageBuffer, class Entity>
1151  void scatter ( MessageBuffer & str, const Entity& entity, size_t )
1152  {
1153  DUNE_THROW(NotImplemented,"DofManager::scatter( entity ) with codim > 0 not implemented");
1154  }
1155 
1156  //********************************************************
1157  // Interface for PersistentObjects
1158  //********************************************************
1159 
1161  void backup () const
1162  {
1163  for(auto indexSetPtr : indexList_)
1164  indexSetPtr->backup();
1165  }
1166 
1168  void restore ()
1169  {
1170  for(auto indexSetPtr : indexList_)
1171  indexSetPtr->restore();
1172 
1173  // make all index sets consistent
1174  // before any data is read this can be
1175  // assured since DofManager is an
1176  // AutoPersistentObject and thus in the
1177  // beginning of the list, fater the grid of course
1178  resize();
1179  }
1180 
1181  //********************************************************
1182  // read/write using fem streams
1183  //********************************************************
1188  template < class OutStream >
1189  void write( OutStream& out ) const
1190  {
1191  for(auto indexSetPtr : indexList_)
1192  indexSetPtr->write( out );
1193  }
1194 
1199  template < class InStream >
1200  void read( InStream& in )
1201  {
1202  for(auto indexSetPtr : indexList_)
1203  indexSetPtr->read( in );
1204  }
1205 
1206  //********************************************************
1207  // Interface for DofManager access
1208  //********************************************************
1209 
1216  static inline ThisType& instance( const GridType& grid )
1217  {
1218  typedef DofManagerFactory< ThisType > DofManagerFactoryType;
1219  return DofManagerFactoryType :: instance( grid );
1220  }
1221  };
1222 
1223  //***************************************************************************
1224  //
1225  // inline implemenations
1226  //
1227  //***************************************************************************
1228 
1229  template <class GridType>
1230  inline DofManager<GridType>::~DofManager ()
1231  {
1232  if(memList_.size() > 0)
1233  {
1234  while( memList_.rbegin() != memList_.rend())
1235  {
1236  DofStorageInterface * mobj = (* memList_.rbegin() );
1237  dverb << "Removing '" << mobj << "' from DofManager!\n";
1238  memList_.pop_back();
1239  }
1240  }
1241 
1242  if(indexList_.size() > 0)
1243  {
1244 #ifndef NDEBUG
1245  std::cerr << "ERROR: Not all index sets have been removed from DofManager yet!" << std::endl;
1246 #endif
1247  while ( indexList_.rbegin() != indexList_.rend())
1248  {
1249  ManagedIndexSetInterface* iobj = (* indexList_.rbegin() );
1250  indexList_.pop_back();
1251  if(iobj) delete iobj;
1252  }
1253  }
1254  }
1255 
1256  template <class GridType>
1257  template <class IndexSetType>
1259  addIndexSet (const IndexSetType &iset )
1260  {
1261  assert( Fem :: ThreadManager:: singleThreadMode() );
1262 
1263  typedef ManagedIndexSet< IndexSetType, ConstElementType > ManagedIndexSetType;
1264  ManagedIndexSetType * indexSet = 0;
1265 
1266  // search index set list in reverse order to find latest index sets faster
1267  auto endit = indexList_.rend();
1268  for(auto it = indexList_.rbegin(); it != endit; ++it )
1269  {
1270  ManagedIndexSetInterface *set = *it;
1271  if( set->equals( iset ) )
1272  {
1273  set->addReference();
1274 
1275  indexSet = static_cast< ManagedIndexSetType * >( set );
1276  break;
1277  }
1278  }
1279 
1280  if( !indexSet )
1281  {
1282  indexSet = new ManagedIndexSetType ( iset, indexSets_ , insertIndices_ , removeIndices_ );
1283  indexList_.push_back( static_cast< ManagedIndexSetInterface * >( indexSet ) );
1284  }
1285  }
1286 
1287  template <class GridType>
1288  template <class IndexSetType>
1289  inline void DofManager<GridType>::removeIndexSet ( const IndexSetType &iset )
1290  {
1291  assert( Fem :: ThreadManager:: singleThreadMode() );
1292 
1293  // search index set list in reverse order to find latest index sets faster
1294  auto endit = indexList_.rend();
1295  for( auto it = indexList_.rbegin(); it != endit; ++it )
1296  {
1297  ManagedIndexSetInterface *set = *it;
1298  if( set->equals( iset ) )
1299  {
1300  if( set->removeReference() )
1301  {
1302  // reverse iterators cannot be erased directly, so erase the base
1303  // (forward) iterator
1304  // Note: see, e.g., Stroustrup, section 16.3.2 about the decrement
1305  auto fit = it.base();
1306  indexList_.erase( --fit );
1307  // delete proxy
1308  delete set;
1309  }
1310  return;
1311  }
1312  }
1313 
1314  // we should never get here
1315  DUNE_THROW(InvalidStateException,"Could not remove index from DofManager set!");
1316  }
1317 
1318  template <class GridType>
1319  template <class ManagedDofStorageImp>
1320  void DofManager<GridType>::addDofStorage(ManagedDofStorageImp& dofStorage)
1321  {
1322  // make sure we got an ManagedDofStorage
1323  ManagedDofStorageInterface* obj = &dofStorage;
1324 
1325  // push_front, makes search faster
1326  memList_.push_front( obj );
1327 
1328  // add the special object to the memResize list object
1329  resizeMemObjs_ += dofStorage.resizeMemoryObject();
1330 
1331  // the same for the reserve call
1332  reserveMemObjs_ += dofStorage.reserveMemoryObject();
1333  }
1334 
1335 
1336  template <class GridType>
1337  template <class ManagedDofStorageImp>
1338  void DofManager<GridType>::removeDofStorage(ManagedDofStorageImp& dofStorage)
1339  {
1340  // make sure we got an ManagedDofStorage
1341  auto obj = &dofStorage;
1342 
1343  // search list starting from tail
1344  auto endit = memList_.end();
1345  for( auto it = memList_.begin();it != endit ; ++it)
1346  {
1347  if(*it == obj)
1348  {
1349  // alloc new mem and copy old mem
1350  memList_.erase( it );
1351 
1352  // remove from list
1353  resizeMemObjs_.remove( dofStorage.resizeMemoryObject() );
1354  reserveMemObjs_.remove( dofStorage.reserveMemoryObject() );
1355 
1356  return ;
1357  }
1358  }
1359  }
1360 
1362 
1363 
1371  template< class DofManagerImp >
1373  {
1375 
1376  public:
1377  typedef DofManagerImp DofManagerType;
1378  typedef typename DofManagerType :: GridType GridType;
1379 
1380  private:
1381  typedef const GridType *KeyType;
1382 
1384 
1385  // declare friendship becase of methods instance
1386  friend class DofManager< GridType >;
1387 
1388  protected:
1395  inline static DofManagerType &instance ( const GridType &grid )
1396  {
1397  DofManagerType *dm = getDmFromList( grid );
1398  if( !dm )
1399  return DMProviderType :: getObject( &grid );
1400  return *dm;
1401  }
1402 
1404  inline static bool
1406  const std :: string &filename,
1407  int timestep )
1408  {
1409  DofManagerType *dm = getDmFromList( grid );
1410  /*
1411  if( dm )
1412  return dm->writeIndexSets( filename, timestep );
1413  */
1414  return false;
1415  }
1416 
1418  inline static bool
1420  const std :: string &filename,
1421  int timestep )
1422  {
1423  DofManagerType *dm = getDmFromList( grid );
1424  /*
1425  if( dm )
1426  return dm->readIndexSets( filename, timestep );
1427  */
1428  return false;
1429  }
1430 
1431  public:
1433  inline static void deleteDofManager ( DofManagerType &dm )
1434  {
1436  }
1437 
1438  private:
1439  // return pointer to dof manager for given grid
1440  inline static DofManagerType *getDmFromList( const GridType &grid )
1441  {
1442  return (DMProviderType :: getObjFromList( &grid )).first;
1443  }
1444  };
1445 
1446  } // namespace Fem
1447 
1448 } // namespace Dune
1449 
1450 #endif // #ifndef DUNE_FEM_DOFMANAGER_HH
virtual void backup() const =0
:: backup
IdentifierType setPtr_
Definition: dofmanager.hh:65
DofManagerType & dm_
Definition: dofmanager.hh:281
RemoveIndicesFromSet(IndexSetType &iset)
Definition: dofmanager.hh:595
bool removeReference()
decrease reference counter and return true if zero reached
Definition: dofmanager.hh:97
void resizeAndMoveToRear()
Definition: dofmanager.hh:508
virtual bool compress()=0
compress of index set
GridObjectStreamTraits< GridType >::InStreamType XtractStreamImplType
Definition: dofmanager.hh:772
void restrictLocal(const EntityType &father, const EntityType &son, bool initialize) const
restrict data to father and resize memory if doResize is true
Definition: dofmanager.hh:686
DofManager(const ThisType &)=delete
void scatter(MessageBuffer &str, const Entity &entity, size_t)
unpacks all data of this entity from message buffer
Definition: dofmanager.hh:1151
void enlargeMemory()
resize the MemObject if necessary
Definition: dofmanager.hh:1018
LocalIndexSetObjectsType & indexSetList_
Definition: dofmanager.hh:133
ManagedDofStorageImplementation< GridImp, MapperType, DofArrayType > ThisType
Definition: dofmanager.hh:276
void resize()
wrap resize of index set
Definition: dofmanager.hh:175
DataCollectorInterface< GridType, InlineStreamType > DataInlinerType
Definition: dofmanager.hh:781
size_t usedMemorySize() const
return used memory size of all MemObjects in bytes.
Definition: dofmanager.hh:950
ResizeMemoryObjects< ThisType > ResizeMemoryObjectType
Definition: dofmanager.hh:289
ResizeMemoryObjectType resizeMemObj_
Definition: dofmanager.hh:291
size_t usedMemorySize() const
return used memory size
Definition: dofmanager.hh:414
void addDataXtractor(DataCollType &d)
add data handler for data xtracting to dof manager
Definition: dofmanager.hh:1088
void enableDofCompression()
enable dof compression for this MemObject
Definition: dofmanager.hh:420
DofManager< GridImp > DofManagerType
Definition: dofmanager.hh:278
virtual void write(StandardOutStream &out) const
new write method
Definition: dofmanager.hh:202
void resize()
Resize index sets and memory due to what the mapper has as new size.
Definition: dofmanager.hh:986
LocalIndexSetObjectsType & removeList_
Definition: dofmanager.hh:135
virtual void backup() const
:: backup
Definition: dofmanager.hh:187
int size() const
return size of underlying array
Definition: dofmanager.hh:334
void restore()
:: restore
Definition: dofmanager.hh:1168
void reserveMemory(int nsize, bool dummy=false)
reserve memory for at least nsize elements, dummy is needed for dune-grid ALUGrid version
Definition: dofmanager.hh:968
DofArrayType & getArray()
return reference to array for DiscreteFunction
Definition: dofmanager.hh:426
bool compress()
wrap compress of index set
Definition: dofmanager.hh:181
ManagedDofStorageImplementation(const ManagedDofStorageImplementation &)=delete
ResizeMemoryObjects(MemObjectType &mo)
Definition: dofmanager.hh:633
void resize(std::false_type, const bool enlargeOnly)
Definition: dofmanager.hh:435
virtual void read(StandardInStream &out)=0
void removeIndexSet(const IndexSetType &iset)
removed index set from dof manager's list of index sets
Definition: dofmanager.hh:1289
virtual void restore()=0
:: restore
void prolongLocal(const EntityType &father, const EntityType &son, bool initialize) const
prolong data to children and resize memory if doResize is true
Definition: dofmanager.hh:706
void resizeMemory()
resize the MemObject if necessary
Definition: dofmanager.hh:1010
void insertEntity(ConstElementType &element)
Inserts entity to all index sets added to dof manager.
Definition: dofmanager.hh:994
IndexSetType & indexSet_
Definition: dofmanager.hh:127
static void deleteDofManager(DofManagerType &dm)
delete the dof manager that belong to the given grid
Definition: dofmanager.hh:1433
IndexSetRestrictProlong< ThisType, LocalIndexSetObjectsType, true > NewIndexSetRestrictProlongType
Definition: dofmanager.hh:826
ReserveMemoryObjects(MemObjectType &mo)
Definition: dofmanager.hh:656
size_t size(const Entity &) const
for convenience
Definition: dofmanager.hh:1117
DataCollectorInterface< GridType, XtractStreamType > DataXtractorType
Definition: dofmanager.hh:780
const void * IdentifierType
Definition: dofmanager.hh:63
ReserveMemoryObjects< ThisType > ReserveMemoryObjectType
Definition: dofmanager.hh:290
void apply(int &chunkSize)
Definition: dofmanager.hh:659
GridType ::template Codim< 0 >::Entity ElementType
Definition: dofmanager.hh:783
void moveToFront(const int oldSize, const int block)
move block to front again
Definition: dofmanager.hh:513
void apply(int &enlargeOnly)
Definition: dofmanager.hh:639
double memoryFactor() const
return factor to over estimate new memory allocation
Definition: dofmanager.hh:878
void prolongLocal(EntityType &father, EntityType &son, bool initialize) const
prolong data to children and resize memory if doResize is true
Definition: dofmanager.hh:732
static bool writeDofManagerNew(const GridType &grid, const std ::string &filename, int timestep)
writes DofManager of corresponding grid, when DofManager exists
Definition: dofmanager.hh:1405
ManagedDofStorageImplementation(const GridImp &grid, const MapperType &mapper, DofArrayType &array)
Constructor of ManagedDofStorageImplementation, only to call from derived classes.
Definition: dofmanager.hh:302
virtual void resize(const bool enlargeOnly)=0
resize memory
virtual ~ManagedDofStorageInterface()=default
destructor
IndexSetRestrictProlongNoResizeType & indexSetRestrictProlongNoResize()
returns the index set restriction and prolongation operator
Definition: dofmanager.hh:936
Grid GridType
type of Grid this DofManager belongs to
Definition: dofmanager.hh:770
void resize(std::true_type, const bool enlargeOnly)
Definition: dofmanager.hh:451
void resize(const bool enlargeOnly)
resize the memory with the new size
Definition: dofmanager.hh:337
ManagedIndexSetInterface BaseType
type of base class
Definition: dofmanager.hh:139
DofArrayType & array_
Definition: dofmanager.hh:287
virtual void dofCompress(const bool clearResizedArrays)=0
static std::pair< DofStorageInterface *, DofStorageType * > allocateManagedDofStorage(const GridType &grid, const MapperType &mapper, const DofStorageType *=0)
default implementation for creating a managed dof storage
Definition: dofmanager.hh:561
DofStorageInterface()=default
do not allow to create explicit instances
void gather(InlineStreamType &str, ConstElementType &element) const
packs all data attached to this entity
Definition: dofmanager.hh:1124
~ManagedIndexSet()
desctructor
Definition: dofmanager.hh:164
ManagedDofStorageInterface()=default
do not allow to create explicit instances
MapperType & mapper() const
Definition: dofmanager.hh:429
virtual void read(StandardInStream &in)
new write method
Definition: dofmanager.hh:199
void dofCompress(const bool clearResizedArrays)
copy the dof from the rear section of the vector to the holes
Definition: dofmanager.hh:362
ManagedIndexSet(const IndexSetType &iset, LocalIndexSetObjectsType &indexSetList, LocalIndexSetObjectsType &insertList, LocalIndexSetObjectsType &removeList)
Constructor of MemObject, only to call from DofManager.
Definition: dofmanager.hh:142
virtual void reserve(int newSize)=0
resize memory
void read(InStream &in)
read all index sets from a given stream
Definition: dofmanager.hh:1200
void apply(EntityType &entity)
apply wraps the insertEntity method of the index set
Definition: dofmanager.hh:617
MessageBufferIF< InlineStreamImplType > InlineStreamType
Definition: dofmanager.hh:777
static ThisType & instance(const GridType &grid)
obtain a reference to the DofManager for a given grid
Definition: dofmanager.hh:1216
RemoveIndicesFromSet< IndexSetType, EntityType > removeIdxObj_
Definition: dofmanager.hh:131
void addDofStorage(ManagedDofStorageImp &dofStorage)
add a managed dof storage to the dof manager.
Definition: dofmanager.hh:1320
void compress()
Compress all data that is hold by this dofmanager.
Definition: dofmanager.hh:1041
NewIndexSetRestrictProlongType & indexSetRestrictProlong()
returns the index set restriction and prolongation operator
Definition: dofmanager.hh:926
virtual ~ManagedIndexSetInterface()=default
void incrementSequenceNumber()
increase the DofManagers internal sequence number
Definition: dofmanager.hh:1028
void restrictLocal(EntityType &father, EntityType &son, bool initialize) const
restrict data to father and resize memory if doResize is true
Definition: dofmanager.hh:729
static bool readDofManagerNew(const GridType &grid, const std ::string &filename, int timestep)
reads DofManager of corresponding grid, when DofManager exists
Definition: dofmanager.hh:1419
GridObjectStreamTraits< GridType >::OutStreamType InlineStreamImplType
Definition: dofmanager.hh:773
void addReference()
increase reference counter
Definition: dofmanager.hh:94
MessageBufferIF< XtractStreamImplType > XtractStreamType
Definition: dofmanager.hh:776
ResizeMemoryObjects(const ResizeMemoryObjects &org)
Definition: dofmanager.hh:634
virtual void write(StandardOutStream &out) const =0
new read/write methods using binary streams
void apply(EntityType &entity)
apply wraps the removeEntity Method of the index set
Definition: dofmanager.hh:598
void removeEntity(ConstElementType &element)
Removes entity from all index sets added to dof manager.
Definition: dofmanager.hh:1004
EmptyIndexSetRestrictProlong IndexSetRestrictProlongType
Definition: dofmanager.hh:831
void write(OutStream &out) const
write all index sets to a given stream
Definition: dofmanager.hh:1189
void removeDofStorage(ManagedDofStorageImp &dofStorage)
remove a managed dof storage from the dof manager.
Definition: dofmanager.hh:1338
void gather(MessageBuffer &str, const Entity &entity) const
Definition: dofmanager.hh:1133
EmptyIndexSetRestrictProlong()
Definition: dofmanager.hh:726
static DofManagerType & instance(const GridType &grid)
obtain a reference to the DofManager for a given grid
Definition: dofmanager.hh:1395
DofManagerImp DofManagerType
Definition: dofmanager.hh:1377
void restrictFinalize(const EntityType &father) const
Definition: dofmanager.hh:701
void clearDataXtractors()
clear data xtractor list
Definition: dofmanager.hh:1094
bool contains(const int dim, const int codim) const
the dof manager only transfers element data during load balancing
Definition: dofmanager.hh:1104
void reserve(const int needed)
reserve memory for what is comming
Definition: dofmanager.hh:343
virtual void restore()
:: restore
Definition: dofmanager.hh:193
void resizeForRestrict()
resize memory before data restriction during grid adaptation is done.
Definition: dofmanager.hh:961
bool equals(const IndexSet &iset) const
Definition: dofmanager.hh:103
virtual void enableDofCompression()
enable dof compression for dof storage (default is empty)
Definition: dofmanager.hh:223
DofArrayType myArray_
Definition: dofmanager.hh:547
DofManagerType ::GridType GridType
Definition: dofmanager.hh:1378
ReserveMemoryObjectType reserveMemObj_
Definition: dofmanager.hh:292
void clearDataInliners()
clear data inliner list
Definition: dofmanager.hh:1081
MapperType & mapper_
Definition: dofmanager.hh:284
bool notifyGlobalChange(const bool wasChanged) const
communicate new sequence number
Definition: dofmanager.hh:1066
IndexSetRestrictProlong(DofManagerType &dm, RestrictProlongIndexSetType &is, RestrictProlongIndexSetType &rm)
Definition: dofmanager.hh:681
bool fixedSize(const int dim, const int codim) const
fixed size is false
Definition: dofmanager.hh:1110
void backup() const
:: backup
Definition: dofmanager.hh:1161
void addDataInliner(DataCollType &d)
add data handler for data inlining to dof manager
Definition: dofmanager.hh:1075
ReserveMemoryObjectType & reserveMemoryObject()
return object that calls reserve of this memory object
Definition: dofmanager.hh:331
void scatter(XtractStreamType &str, ConstElementType &element, size_t)
unpacks all data attached of this entity from message buffer
Definition: dofmanager.hh:1139
ManagedDofStorage(const GridImp &grid, const MapperType &mapper)
Constructor of ManagedDofStorage.
Definition: dofmanager.hh:550
LocalIndexSetObjectsType & insertList_
Definition: dofmanager.hh:134
ManagedIndexSetInterface(const IndexSet &iset)
Definition: dofmanager.hh:70
ResizeMemoryObjectType & resizeMemoryObject()
return object that calls resize of this memory object
Definition: dofmanager.hh:328
size_t referenceCounter_
Definition: dofmanager.hh:67
bool dataCompressionEnabled_
Definition: dofmanager.hh:295
bool hasIndexSets() const
if dofmanagers list is not empty return true
Definition: dofmanager.hh:944
virtual size_t usedMemorySize() const =0
return size of mem used by MemObject
virtual void resize()=0
resize of index set
virtual int size() const =0
size of space, i.e. mapper.size()
InsertIndicesToSet< IndexSetType, EntityType > insertIdxObj_
Definition: dofmanager.hh:130
InsertIndicesToSet(IndexSetType &iset)
Definition: dofmanager.hh:614
~ManagedDofStorageImplementation()
destructor deleting MemObject from resize and reserve List
Definition: dofmanager.hh:320
void addIndexSet(const IndexSetType &iset)
add index set to dof manager's list of index sets
Definition: dofmanager.hh:1259
IndexSetRestrictProlong< ThisType, LocalIndexSetObjectsType, false > IndexSetRestrictProlongNoResizeType
Definition: dofmanager.hh:828
virtual ~DofStorageInterface()=default
destructor
int sequence() const
return number of sequence, if dofmanagers memory was changed by calling some method like resize,...
Definition: dofmanager.hh:981
Definition: bindguard.hh:11
Double abs(const Double &a)
Definition: double.hh:871
static constexpr T max(T a)
Definition: utility.hh:77
interface documentation for (grid part) index sets
Definition: common/indexset.hh:104
specialize with true if index set implements the interface for consecutive index sets
Definition: common/indexset.hh:42
Container for User Specified Parameters.
Definition: io/parameter.hh:191
static bool verbose()
obtain the cached value for fem.verbose
Definition: io/parameter.hh:445
static T getValue(const std::string &key)
get a mandatory parameter from the container
Definition: io/parameter.hh:333
output stream writing into a given std::ostream
Definition: standardstreams.hh:61
input stream reading from a given std::istream
Definition: standardstreams.hh:196
Definition: gridobjectstreams.hh:18
Definition: dofmanager.hh:762
Definition: datacollector.hh:232
void apply(ParamType &p) const
for all pointer to local operators call the func pointer
Definition: datacollector.hh:163
bool empty() const
Definition: datacollector.hh:224
void remove(const OpType &op)
Definition: datacollector.hh:203
virtual void clear()
clear object list
Definition: datacollector.hh:379
virtual void apply(ObjectStreamType &str, const EntityType &entity) const
Definition: datacollector.hh:289
Singleton provider for the DofManager.
Definition: dofmanager.hh:1373
Definition: dofmanager.hh:59
Definition: dofmanager.hh:588
Definition: dofmanager.hh:607
Definition: dofmanager.hh:123
Interface class for a dof storage object to be stored in discrete functions.
Definition: dofmanager.hh:213
Interface class for a dof storage object that can be managed (resized and compressed) by the DofManag...
Definition: dofmanager.hh:234
Definition: dofmanager.hh:626
Definition: dofmanager.hh:649
Definition: dofmanager.hh:271
Definition: dofmanager.hh:544
Definition: dofmanager.hh:674
Definition: dofmanager.hh:724
Definition: dofmanager.hh:736
Interface class defining the local behaviour of the restrict/prolong operation (using BN)
Definition: restrictprolonginterface.hh:39
void initialize()
initialize restrict prolong object (if necessary) before adaptation takes place
Definition: restrictprolonginterface.hh:51
Definition: space/mapper/capabilities.hh:22
Definition: singletonlist.hh:25
Singleton list for key/object pairs.
Definition: singletonlist.hh:53
static void removeObject(const ObjectType &object)
Definition: singletonlist.hh:120
static ValueType getObjFromList(const KeyType &key)
Definition: singletonlist.hh:140
static auto getObject(const KeyType &key, Args &&... args) -> std::enable_if_t< std::is_same< decltype(FactoryType::createObject(key, std::forward< Args >(args)...)), ObjectType * >::value, ObjectType & >
Definition: singletonlist.hh:94