dune-fem  2.4.1-rc
discretefunctionspace.hh
Go to the documentation of this file.
1 #ifndef DUNE_FEM_DISCRETEFUNCTIONSPACE_HH
2 #define DUNE_FEM_DISCRETEFUNCTIONSPACE_HH
3 
4 // C++ includes
5 #include <cassert>
6 
7 // dune-common includes
8 #include <dune/common/bartonnackmanifcheck.hh>
9 #include <dune/common/dynvector.hh>
10 #include <dune/common/nullptr.hh>
11 
12 // dune-fem includes
21 #include <dune/fem/version.hh>
22 
23 // local includes
24 #include "allgeomtypes.hh"
25 #include "dofstorage.hh"
26 
27 
28 namespace Dune
29 {
30 
31  namespace Fem
32  {
33 
47  // ExportsDiscreteFunctionSpaceType
48  // --------------------------------
49 
50  template< class T >
52  {
53  typedef char Small;
54  struct Big { char dummy[ 2 ]; };
55 
56  template< class U >
57  static Small test ( const U &, typename U::DiscreteFunctionSpaceType * = nullptr );
58  static Big test ( ... );
59 
60  static const T &makeT ();
61 
62  template< class U, bool >
63  struct GetDiscreteFunctionSpaceType;
64 
65  template< class U >
66  struct GetDiscreteFunctionSpaceType< U, true >
67  {
68  typedef typename U::DiscreteFunctionSpaceType Type;
69  };
70 
71  template< class U >
72  struct GetDiscreteFunctionSpaceType< U, false >
73  {
74  typedef void Type;
75  };
76 
77  public:
78  static const bool v = (sizeof( test( makeT() ) ) == sizeof( Small ));
79  typedef typename GetDiscreteFunctionSpaceType< T, v >::Type Type;
80  };
81 
82 
83 
84  // DFSpaceIdentifier
85  // -----------------
86 
100  };
101 
102  inline std::string spaceName( const DFSpaceIdentifier id )
103  {
104  switch( id )
105  {
106  case CombinedSpace_id : return "CombinedSpace";
107  case DFAdapter_id : return "DFAdapter";
108  case DGSpace_id : return "DiscontinuousGalerkinSpace";
109  case FiniteVolumeSpace_id : return "FiniteVolumeSpace";
110  case FourierSpace_id : return "FourierSpace";
111  case GenericSpace_id : return "GenericSpace";
112  case LagrangeSpace_id : return "LagrangeSpace";
113  case RannacherTurekSpace_id : return "RannacherTurekSpace";
114  case LegendreDGSpace_id : return "LegendreDGSpace";
115  case HierarchicLegendreDGSpace_id : return "HierarchicLegendreDGSpace";
116  case LagrangeDGSpace_id : return "LagrangeDGSpace";
117  default : return "unknown space";
118  }
119  }
120 
122  {};
123 
124  template< class DiscreteFunctionSpaceImp,
125  class NewFunctionSpace>
127 
128  template <class FunctionSpaceImp,
129  class GridPartImp,
130  int polOrd,
131  template <class> class StorageImp,
132  template <class,class,int,template <class> class> class DiscreteFunctionSpaceImp,
133  class NewFunctionSpace>
135  DiscreteFunctionSpaceImp<FunctionSpaceImp,GridPartImp,polOrd,StorageImp>,
136  NewFunctionSpace>
137  {
138  typedef DiscreteFunctionSpaceImp< NewFunctionSpace, GridPartImp, polOrd, StorageImp > Type;
139  };
140 
141  //**************************************************************************
142  //
143  // --DiscreteFunctionSpaceInterface
144  //
160  template< class FunctionSpaceTraits >
162  : public FunctionSpaceTraits :: FunctionSpaceType
163  {
164  public:
166  typedef FunctionSpaceTraits Traits;
167 
169  typedef typename Traits :: DiscreteFunctionSpaceType
173 
174  private:
175  typedef FunctionSpaceType BaseType;
176 
177  public:
182 
184  enum { localBlockSize = Traits :: localBlockSize };
185 
188 
190  typedef typename GridPartType :: GridType GridType;
192  typedef typename GridPartType :: IndexSetType IndexSetType;
197  typedef typename GridPartType :: template Codim< Traits::codimension > :: IteratorType
200  typedef typename GridPartType :: template Codim< Traits::codimension > :: EntityType EntityType;
202  typedef typename GridPartType :: IntersectionType IntersectionType;
203 
210  template< class DiscreteFunction,
211  class Operation = // get default type from traits
212  typename Traits :: template CommDataHandle< DiscreteFunction > :: OperationType
213  >
215  {
217  typedef typename Traits
220 
222  typedef typename Traits
225  };
226 
229 
231  template< class NewFunctionSpace >
233  {
236  };
237 
239  template< int newDimRange >
241  {
243 
246  };
247 
248  private:
249  static_assert( (Conversion<typename BaseType::DomainFieldType,
250  typename GridType::ctype>::sameType),
251  "Domain field type of function space must equal field type of grid." );
252 
253  protected:
255  {}
256 
257  public:
258 
259  // Methods Provided by the Implementation
260  // --------------------------------------
261 
266  {
267  CHECK_INTERFACE_IMPLEMENTATION(asImp().type());
268  return asImp().type();
269  }
270 
278  inline const BasisFunctionSetType basisFunctionSet ( const EntityType &entity ) const
279  {
280  CHECK_INTERFACE_IMPLEMENTATION( asImp().basisFunctionSet( entity ) );
281  return asImp().basisFunctionSet( entity );
282  }
283 
296  inline bool continuous () const
297  {
298  CHECK_INTERFACE_IMPLEMENTATION( asImp().continuous() );
299  return asImp().continuous();
300  }
301 
306  inline int sequence () const
307  {
308  CHECK_INTERFACE_IMPLEMENTATION( asImp().sequence() );
309  return asImp().sequence();
310  }
311 
317  inline int order () const
318  {
319  CHECK_INTERFACE_IMPLEMENTATION( asImp().order() );
320  return asImp().order();
321  }
322 
336  inline bool continuous (const IntersectionType &intersection) const
337  {
338  CHECK_INTERFACE_IMPLEMENTATION( asImp().continuous(intersection) );
339  return asImp().continuous(intersection);
340  }
341 
346  inline BlockMapperType &blockMapper () const
347  {
348  CHECK_INTERFACE_IMPLEMENTATION( asImp().blockMapper() );
349  return asImp().blockMapper();
350  }
351 
356  inline const GridType &grid () const
357  {
358  CHECK_INTERFACE_IMPLEMENTATION( asImp().grid() );
359  return asImp().grid();
360  }
361 
366  inline GridType &grid ()
367  {
368  CHECK_INTERFACE_IMPLEMENTATION( asImp().grid() );
369  return asImp().grid();
370  }
371 
372 #if 0
373 
377  inline const GridPartType &gridPart () const
378  {
379  CHECK_INTERFACE_IMPLEMENTATION( asImp().gridPart() );
380  return asImp().gridPart();
381  }
382 #endif
383 
388  inline GridPartType &gridPart ()
389  {
390  CHECK_INTERFACE_IMPLEMENTATION(asImp().gridPart());
391  return asImp().gridPart();
392  }
393 
398  inline const IndexSetType &indexSet () const
399  {
400  CHECK_INTERFACE_IMPLEMENTATION( asImp().indexSet() );
401  return asImp().indexSet();
402  }
403 
408  inline int size () const
409  {
410  CHECK_INTERFACE_IMPLEMENTATION( asImp().size() );
411  return asImp().size();
412  }
413 
419  inline IteratorType begin () const
420  {
421  CHECK_INTERFACE_IMPLEMENTATION( asImp().begin() );
422  return asImp().begin();
423  }
424 
430  inline IteratorType end () const
431  {
432  CHECK_INTERFACE_IMPLEMENTATION( asImp().end() );
433  return asImp().end();
434  }
435 
446  template< class FunctorType >
447  inline void forEach ( FunctorType &f ) const
448  {
449  CHECK_AND_CALL_INTERFACE_IMPLEMENTATION( asImp().forEach( f ) );
450  }
451 
457  inline bool multipleGeometryTypes () const
458  {
459  CHECK_INTERFACE_IMPLEMENTATION( asImp().multipleGeometryTypes() );
460  return asImp().multipleGeometryTypes();
461  }
462 
463 
469  inline bool multipleBasisFunctionSets () const
470  {
471  CHECK_INTERFACE_IMPLEMENTATION( asImp().multipleBasisFunctionSets() );
472  return asImp().multipleBasisFunctionSets();
473  }
474 
478  InterfaceType communicationInterface() const
479  {
480  CHECK_INTERFACE_IMPLEMENTATION( asImp().communicationInterface() );
481  return asImp().communicationInterface();
482  }
483 
487  CommunicationDirection communicationDirection() const
488  {
489  CHECK_INTERFACE_IMPLEMENTATION( asImp().communicationDirection() );
490  return asImp().communicationDirection();
491  }
492 
496  const CommunicationManagerType& communicator() const
497  {
498  CHECK_INTERFACE_IMPLEMENTATION( asImp().communicator() );
499  return asImp().communicator();
500  }
501 
507  template <class DiscreteFunction>
508  void communicate(DiscreteFunction& discreteFunction) const
509  {
510  CHECK_AND_CALL_INTERFACE_IMPLEMENTATION(
511  asImp().communicate( discreteFunction ) );
512  }
513 
520  template <class DiscreteFunction, class Operation>
521  void communicate(DiscreteFunction& discreteFunction, const Operation* op) const
522  {
523  CHECK_AND_CALL_INTERFACE_IMPLEMENTATION(
524  asImp().communicate( discreteFunction , op ) );
525  }
526 
534  template< class DiscreteFunction, class Operation >
535  inline typename CommDataHandle< DiscreteFunction, Operation > :: Type
536  createDataHandle ( DiscreteFunction& discreteFunction,
537  const Operation *operation ) const
538  {
539  CHECK_INTERFACE_IMPLEMENTATION
540  ( asImp().createDataHandle( discreteFunction, operation ) );
541  return asImp().createDataHandle( discreteFunction, operation );
542  }
543 
544  protected:
545  // Barton-Nackman trick
546  inline const DiscreteFunctionSpaceType &asImp () const
547  {
548  return static_cast< const DiscreteFunctionSpaceType & >( *this );
549  }
550 
551  // Barton-Nackman trick
553  {
554  return static_cast< DiscreteFunctionSpaceType & >( *this );
555  }
556  }; // end class DiscreteFunctionSpaceInterface
557 
558 
559 
570  template< class Traits >
573  {
574  return &(X.blockMapper()) == &(Y.blockMapper());
575  }
576 
577 
578 
579  //---------------------------------------------------------------------------
580  //-
581  //- --DiscreteFunctionSpaceDefault
582  //-
583  //-
584  //---------------------------------------------------------------------------
594  template< class FunctionSpaceTraits >
596  : public DiscreteFunctionSpaceInterface< FunctionSpaceTraits >
597  {
598  public:
599  typedef FunctionSpaceTraits Traits;
600 
601  private:
604 
605  public:
606  typedef typename Traits :: DiscreteFunctionSpaceType
608 
609  typedef typename BaseType :: GridPartType GridPartType;
610  typedef typename BaseType :: GridType GridType;
611  typedef typename BaseType :: IndexSetType IndexSetType;
612  typedef typename BaseType :: IteratorType IteratorType;
613  typedef typename BaseType :: EntityType EntityType;
614 
616  enum { localBlockSize = BaseType :: localBlockSize };
617 
618  protected:
619  using BaseType :: asImp;
620 
621  public:
622  using BaseType :: blockMapper;
623  using BaseType :: order ;
624 
627 
630  protected:
631  GridPartType &gridPart_;
632 
635  typedef Dune::DynamicVector< typename BaseType::RangeFieldType, LocalDofVectorAllocatorType > LocalDofVectorType;
636 
637  mutable LocalDofVectorStackType ldvStack_;
638  mutable LocalDofVectorAllocatorType ldvAllocator_;
639 
641 
642  // set of all geometry types possible
644  const AllGeometryTypes allGeomTypes_;
645 
646  // reference to dof manager
647  DofManagerType& dofManager_;
648 
649  // communication manager
650  const InterfaceType commInterface_;
651  const CommunicationDirection commDirection_;
652  mutable std::unique_ptr< CommunicationManagerType > communicator_;
653 
654  public:
656  explicit DiscreteFunctionSpaceDefault( GridPartType &gridPart,
657  const InterfaceType commInterface = InteriorBorder_All_Interface,
658  const CommunicationDirection commDirection = ForwardCommunication )
659  : BaseType(),
660  gridPart_( gridPart ),
661  ldvStack_( 0 ),
662  ldvAllocator_( &ldvStack_ ),
663  allGeomTypes_( gridPart.indexSet() ),
664  dofManager_( DofManagerType :: instance( gridPart.grid() ) ),
665  commInterface_( commInterface ),
666  commDirection_( commDirection )
667  {}
668 
670  inline int sequence () const
671  {
672  return dofManager_.sequence();
673  }
674 
679  inline int order ( const EntityType& entity ) const
680  {
681  return asImp().basisFunctionSet( entity ).order();
682  }
683 
691  DUNE_VERSION_DEPRECATED(3,0,remove)
692  LocalFunctionType localFunction ( const EntityType &entity ) const
693  {
694  if( static_cast< const UninitializedObjectStack& >(ldvStack_).objectSize() == 0 )
695  static_cast< UninitializedObjectStack&>( ldvStack_ ).resize(
696  sizeof( typename BaseType::RangeFieldType ) * blockMapper().maxNumDofs() * localBlockSize );
697 
698  return LocalFunctionType( *this, entity, LocalDofVectorType( ldvAllocator_ ) );
699  }
700 
702  inline const GridType &grid () const
703  {
704  return asImp().gridPart().grid();
705  }
706 
708  inline GridType &grid ()
709  {
710  return asImp().gridPart().grid();
711  }
712 
714  inline GridPartType &gridPart () const
715  {
716  return gridPart_;
717  }
718 
720  inline const IndexSetType &indexSet () const
721  {
722  return asImp().gridPart().indexSet();
723  }
724 
726  inline int size () const
727  {
728  return blockMapper().size() * localBlockSize ;
729  }
730 
736  inline IteratorType begin () const
737  {
738  return asImp().gridPart().template begin< 0 >();
739  }
740 
746  inline IteratorType end () const
747  {
748  return asImp().gridPart().template end< 0 >();
749  }
750 
760  template< class FunctorType >
761  inline void forEach ( FunctorType &f ) const
762  {
763  const IteratorType end = asImp().end();
764  for( IteratorType it = asImp().begin(); it != end; ++it )
765  f( *it );
766  }
767 
769  inline bool multipleGeometryTypes () const
770  {
771  return allGeomTypes_.multipleGeomTypes();
772  }
773 
778  inline bool multipleBasisFunctionSets () const
779  {
780  return false;
781  }
782 
784  InterfaceType communicationInterface () const
785  {
786  return commInterface_;
787  }
788 
790  CommunicationDirection communicationDirection () const
791  {
792  return commDirection_;
793  }
794 
796  const CommunicationManagerType& communicator() const
797  {
798  if( !communicator_ )
799  communicator_.reset( new CommunicationManagerType( asImp(), commInterface_, commDirection_ ) );
800  assert( communicator_ != 0 );
801  return *communicator_;
802  }
803 
805  template <class DiscreteFunction>
806  void communicate(DiscreteFunction& discreteFunction) const
807  {
808  // get type of default operation
809  typedef typename DiscreteFunction :: DiscreteFunctionSpaceType :: template
810  CommDataHandle< DiscreteFunction > :: OperationType DefaultOperationType;
811 
812  // exchange data
813  communicate( discreteFunction, (DefaultOperationType*) 0);
814  }
815 
817  template <class DiscreteFunction, class Operation>
818  void communicate(DiscreteFunction& discreteFunction, const Operation *op ) const
819  {
820  communicator().exchange( discreteFunction, (Operation *) 0);
821  }
822 
830  template< class DiscreteFunction, class Operation >
831  inline typename BaseType
832  :: template CommDataHandle< DiscreteFunction, Operation > :: Type
833  createDataHandle( DiscreteFunction &discreteFunction,
834  const Operation *operation ) const
835  {
836  return typename BaseType
837  :: template CommDataHandle< DiscreteFunction, Operation >
838  :: Type( discreteFunction );
839  }
840 
842  template <class DiscreteFunction>
843  void addFunction( DiscreteFunction& df ) const
844  {
845  }
846 
848  template <class DiscreteFunction>
849  void removeFunction( DiscreteFunction& df ) const
850  {
851  }
852 
855  template <class Vector>
856  void adapt( const Vector& polynomialOrders, const int polOrderShift = 0 ) const
857  {
858  }
859 
860  protected:
866  inline const std::vector<GeometryType>& geomTypes(int codim) const
867  {
868  return allGeomTypes_.geomTypes(codim);
869  }
870 
871  // only combined space should use geomTypes
872  template <class , int , DofStoragePolicy> friend class CombinedSpace;
873  };
874 
875 
876 
878  //
879  // DiscreteFunctionSpaceAdapter
880  //
882 
891  template< class FunctionSpaceImp, class GridPartImp >
893  : public FunctionSpaceImp
894  {
895  public:
896  // type of the underlying function space
897  typedef FunctionSpaceImp FunctionSpaceType;
899  typedef GridPartImp GridPartType;
900 
901  private:
903  ThisType;
904  typedef FunctionSpaceType BaseType;
905 
906  public:
907  enum { polynomialOrder = 111 };
908 
910  typedef typename GridPartType :: GridType GridType;
912  typedef typename GridPartType :: IndexSetType IndexSetType;
914  typedef typename GridPartType :: template Codim< 0 > :: IteratorType
916  //- type of used entity
917  typedef typename GridType :: template Codim< 0 > :: Entity EntityType;
918  //- type of intersections
919  typedef typename GridPartType :: IntersectionType IntersectionType;
920 
923 
924  protected:
925  const GridPartType &gridPart_;
926  const unsigned int order_;
927 
928  public:
930  inline explicit DiscreteFunctionSpaceAdapter
931  ( const GridPartType &gridPart,
932  unsigned int order = polynomialOrder )
933  : BaseType(),
934  gridPart_( gridPart ),
935  order_( order )
936  {
937  }
938 
940  inline DiscreteFunctionSpaceAdapter( const ThisType &other )
941  : BaseType( other ),
942  gridPart_( other.gridPart_ ),
943  order_( other.order_ )
944  {
945  }
946 
948  inline IteratorType begin () const
949  {
950  return gridPart_.template begin< 0 >();
951  }
952 
954  inline IteratorType end () const
955  {
956  return gridPart_.template end< 0 >();
957  }
958 
960  template< class FunctorType >
961  inline void forEach ( FunctorType &f ) const
962  {
963  const IteratorType endit = end();
964  for( IteratorType it = begin(); it != endit; ++it )
965  f( *it );
966  }
967 
969  inline const GridPartType &gridPart () const
970  {
971  return gridPart_;
972  }
973 
975  inline const IndexSetType &indexSet () const
976  {
977  return gridPart_.indexSet();
978  }
979 
981  inline const GridType& grid () const
982  {
983  return gridPart_.grid();
984  }
985 
987  inline bool continuous () const
988  {
989  return true;
990  }
992  inline bool continuous (const IntersectionType &intersection) const
993  {
994  return true;
995  }
996 
998  inline int order () const
999  {
1000  return order_;
1001  }
1002 
1004  inline int order ( const EntityType& ) const
1005  {
1006  return order();
1007  }
1008 
1010  inline DFSpaceIdentifier type () const
1011  {
1012  return DFAdapter_id;
1013  }
1014  };
1015 
1017 
1023  template <class KeyImp, class ObjectImp, class ObjectFactoryImp>
1025  {
1026  public:
1028  static ObjectImp * createObject( const KeyImp & key )
1029  {
1030  ObjectFactoryImp fac(key);
1031  return new ObjectImp(fac);
1032  }
1033 
1035  static void deleteObject( ObjectImp * obj )
1036  {
1037  delete obj;
1038  }
1039  };
1040 
1041  } // namespace Fem
1042 
1043 } // namespace Dune
1044 #endif // #ifndef DUNE_FEM_DISCRETEFUNCTIONSPACE_HH
const IndexSetType & indexSet() const
Get a reference to the associated index set.
Definition: discretefunctionspace.hh:398
const IndexSetType & indexSet() const
Get a reference to the associated index set.
Definition: discretefunctionspace.hh:720
void communicate(DiscreteFunction &discreteFunction, const Operation *op) const
communicate data for given discrete function
Definition: discretefunctionspace.hh:818
BaseType::GridType GridType
Definition: discretefunctionspace.hh:610
Definition: discretefunctionspace.hh:121
BaseType::template CommDataHandle< DiscreteFunction, Operation >::Type createDataHandle(DiscreteFunction &discreteFunction, const Operation *operation) const
Definition: discretefunctionspace.hh:833
DiscreteFunctionSpaceAdapter(const ThisType &other)
copy constructor
Definition: discretefunctionspace.hh:940
LocalDofVectorStackType ldvStack_
Definition: discretefunctionspace.hh:637
VectorSpaceTraits< DomainField, RangeField, dimD, dimR >::RangeFieldType RangeFieldType
Intrinsic type used for values in the range field (usually a double)
Definition: functionspaceinterface.hh:62
const CommunicationDirection commDirection_
Definition: discretefunctionspace.hh:651
id for Finite Volume Space
Definition: discretefunctionspace.hh:92
StackAllocator< typename BaseType::RangeFieldType, LocalDofVectorStackType * > LocalDofVectorAllocatorType
Definition: discretefunctionspace.hh:634
BaseType::EntityType EntityType
Definition: discretefunctionspace.hh:613
FunctionSpaceTraits Traits
Definition: discretefunctionspace.hh:599
CommunicationDirection communicationDirection() const
return the communication interface appropriate for this space
Definition: discretefunctionspace.hh:790
DofManagerType & dofManager_
Definition: discretefunctionspace.hh:647
A vector valued function space.
Definition: functionspace.hh:16
void communicate(DiscreteFunction &discreteFunction) const
communicate data for given discrete function using the space&#39;s default communication operation ...
Definition: discretefunctionspace.hh:508
Traits::template CommDataHandle< DiscreteFunction, Operation >::OperationType OperationType
type of operation to perform on scatter
Definition: discretefunctionspace.hh:224
GridPartType::IntersectionType IntersectionType
Definition: discretefunctionspace.hh:919
const unsigned int order_
Definition: discretefunctionspace.hh:926
DFSpaceIdentifier type() const
return type identifier of discrete function space
Definition: discretefunctionspace.hh:1010
int order(const EntityType &entity) const
default implementation of the method order
Definition: discretefunctionspace.hh:679
bool multipleGeometryTypes() const
returns true if the grid has more than one geometry type
Definition: discretefunctionspace.hh:457
id for DiscreteFunctionSpace Adapter
Definition: discretefunctionspace.hh:90
ToNewFunctionSpace< NewFunctionSpaceType >::Type Type
type of my discrete function space with new dim range
Definition: discretefunctionspace.hh:245
DofManager< GridType > DofManagerType
type of DoF manager
Definition: discretefunctionspace.hh:626
typedef struct for defining the same discrete function space with a different function space ...
Definition: discretefunctionspace.hh:232
GridPartType::GridType GridType
type of underlying dune grid
Definition: discretefunctionspace.hh:190
BaseType::IndexSetType IndexSetType
Definition: discretefunctionspace.hh:611
DFSpaceIdentifier
enumerator for identification of spaces
Definition: discretefunctionspace.hh:88
std::unique_ptr< CommunicationManagerType > communicator_
Definition: discretefunctionspace.hh:652
bool continuous() const
returns true if the space contains only globally continuous functions
Definition: discretefunctionspace.hh:987
GridType & grid()
get reference to grid this discrete function space belongs to
Definition: discretefunctionspace.hh:708
static ObjectImp * createObject(const KeyImp &key)
create new BaseFunctionSet
Definition: discretefunctionspace.hh:1028
Lagrange discrete function space.
Definition: space/padaptivespace/declaration.hh:21
LocalDofVectorAllocatorType ldvAllocator_
Definition: discretefunctionspace.hh:638
Traits::FunctionSpaceType FunctionSpaceType
type of function space
Definition: discretefunctionspace.hh:172
DiscreteFunctionSpaceInterface()
Definition: discretefunctionspace.hh:254
bool multipleBasisFunctionSets() const
returns true if base function sets depend on the entity
Definition: discretefunctionspace.hh:778
const CommunicationManagerType & communicator() const
return reference to communicator (see CommunicationManager)
Definition: discretefunctionspace.hh:496
const GridPartType & gridPart_
Definition: discretefunctionspace.hh:925
Definition: datacollector.hh:45
Definition: mapper.hh:30
GridPartType::template Codim< Traits::codimension >::IteratorType IteratorType
type of iterator for grid traversal
Definition: discretefunctionspace.hh:198
DFSpaceIdentifier type() const
return type identifier of discrete function space
Definition: discretefunctionspace.hh:265
Traits::BasisFunctionSetType BasisFunctionSetType
type of basis function set of this space
Definition: discretefunctionspace.hh:179
A temporary function carrying values for one entity.
Definition: temporary.hh:18
bool continuous(const IntersectionType &intersection) const
returns true if discrete functions over this space have zero jump over the given intersection.
Definition: discretefunctionspace.hh:336
Definition: discretefunctionspace.hh:126
GetDiscreteFunctionSpaceType< T, v >::Type Type
Definition: discretefunctionspace.hh:79
GridPartType & gridPart()
get a reference to the associated grid partition
Definition: discretefunctionspace.hh:388
const GridPartType & gridPart() const
get a reference to the associated grid partition
Definition: discretefunctionspace.hh:969
int order(const EntityType &) const
get global order of space
Definition: discretefunctionspace.hh:1004
GridType::template Codim< 0 >::Entity EntityType
Definition: discretefunctionspace.hh:917
id for Combined Space
Definition: discretefunctionspace.hh:89
Traits::BlockMapperType BlockMapperType
type of block mapper of this space
Definition: discretefunctionspace.hh:181
IteratorType end() const
get iterator pointing behind the last entity of the associated grid partition
Definition: discretefunctionspace.hh:954
bool continuous(const IntersectionType &intersection) const
returns true if the space contains only globally continuous functions
Definition: discretefunctionspace.hh:992
static const bool v
Definition: discretefunctionspace.hh:78
This is the interface for discrete function spaces. All methods declared here have to be implemented ...
Definition: discretefunctionspace.hh:161
void forEach(FunctorType &f) const
apply a functor to each entity in the associated grid partition
Definition: discretefunctionspace.hh:447
DiscreteFunctionSpaceImp< NewFunctionSpace, GridPartImp, polOrd, StorageImp > Type
Definition: discretefunctionspace.hh:138
bool continuous() const
returns true if the space contains only globally continuous functions
Definition: discretefunctionspace.hh:296
GridType & grid()
get reference to grid this discrete function space belongs to
Definition: discretefunctionspace.hh:366
GridPartType & gridPart_
Definition: discretefunctionspace.hh:631
std::string spaceName(const DFSpaceIdentifier id)
Definition: discretefunctionspace.hh:102
const DiscreteFunctionSpaceType & asImp() const
Definition: discretefunctionspace.hh:546
IteratorType begin() const
get iterator pointing to the first entity of the associated grid partition
Definition: discretefunctionspace.hh:736
Traits::GridPartType GridPartType
type of underlying grid part
Definition: discretefunctionspace.hh:187
id for Lagrange Discontinuous Galerkin Space
Definition: discretefunctionspace.hh:99
void communicate(DiscreteFunction &discreteFunction) const
communicate data for given discrete function using the space&#39;s default communication operation ...
Definition: discretefunctionspace.hh:806
bool operator==(const Double &a, const Double &b)
Definition: double.hh:589
GridPart GridPartType
Definition: padaptivespace/lagrange.hh:50
defines type of data handle for communication
Definition: discretefunctionspace.hh:214
void addFunction(DiscreteFunction &df) const
default implementation of addFunction does nothing at the moment
Definition: discretefunctionspace.hh:843
id for Rannacher-Turek space
Definition: discretefunctionspace.hh:96
int sequence() const
return number of sequence, if dofmanagers memory was changed by calling some method like resize...
Definition: dofmanager.hh:1047
IteratorType end() const
get iterator pointing behind the last entity of the associated grid partition
Definition: discretefunctionspace.hh:430
void forEach(FunctorType &f) const
apply a functor to each entity in the associated grid partition
Definition: discretefunctionspace.hh:761
Definition: coordinate.hh:4
int order() const
get global order of space
Definition: discretefunctionspace.hh:317
CommunicationDirection communicationDirection() const
return the communication direction appropriate for this space
Definition: discretefunctionspace.hh:487
int order() const
get global order of space
Definition: discretefunctionspace.hh:998
void adapt(const Vector &polynomialOrders, const int polOrderShift=0) const
default implementation of adapt does nothing, its only used in PAdaptiveLagrangeSpace ...
Definition: discretefunctionspace.hh:856
typedef struct for defining the same discrete function space with a different dimRange ...
Definition: discretefunctionspace.hh:240
BaseType::IteratorType IteratorType
Definition: discretefunctionspace.hh:612
Traits::template CommDataHandle< DiscreteFunction, Operation >::Type Type
type of communication data handle
Definition: discretefunctionspace.hh:219
Definition: combinedspace/combinedspace.hh:32
DiscreteFunctionSpaceType & asImp()
Definition: discretefunctionspace.hh:552
const GridType & grid() const
get reference to grid this discrete function space belongs to
Definition: discretefunctionspace.hh:981
const std::vector< GeometryType > & geomTypes(int codim) const
returns true if the grid has more than one geometry type
Definition: discretefunctionspace.hh:866
DiscreteFunctionSpaceDefault(GridPartType &gridPart, const InterfaceType commInterface=InteriorBorder_All_Interface, const CommunicationDirection commDirection=ForwardCommunication)
constructor
Definition: discretefunctionspace.hh:656
InterfaceType communicationInterface() const
return the communication interface appropriate for this space
Definition: discretefunctionspace.hh:784
void forEach(FunctorType &f) const
apply a functor to each entity in the associated grid partition
Definition: discretefunctionspace.hh:961
bool multipleGeometryTypes() const
returns true if the grid has more than one geometry type
Definition: discretefunctionspace.hh:769
const AllGeometryTypes allGeomTypes_
Definition: discretefunctionspace.hh:644
GridPartType::IndexSetType IndexSetType
type of used dune index set
Definition: discretefunctionspace.hh:192
IteratorType end() const
get iterator pointing behind the last entity of the associated grid partition
Definition: discretefunctionspace.hh:746
GridPartType::template Codim< 0 >::IteratorType IteratorType
type of the grid iterator
Definition: discretefunctionspace.hh:915
#define DUNE_VERSION_DEPRECATED(major, minor, newmethod)
Definition: version.hh:20
int size() const
get number of DoFs for this space
Definition: discretefunctionspace.hh:408
BaseType::GridPartType GridPartType
Definition: discretefunctionspace.hh:609
DefaultCommunicationManager< ThisType > CommunicationManagerType
type of communication manager (only the default communication is valid here)
Definition: discretefunctionspace.hh:922
ToNewDimRangeFunctionSpace< FunctionSpaceType, newDimRange >::Type NewFunctionSpaceType
Definition: discretefunctionspace.hh:242
CommDataHandle< DiscreteFunction, Operation >::Type createDataHandle(DiscreteFunction &discreteFunction, const Operation *operation) const
Creates DataHandle for given discrete function.
Definition: discretefunctionspace.hh:536
void removeFunction(DiscreteFunction &df) const
default implementation of removeFunction does nothing at the moment
Definition: discretefunctionspace.hh:849
GridPartImp GridPartType
type of the grid partition
Definition: discretefunctionspace.hh:899
default implementation uses method geomTypes of given index set. Used in DiscreteFunctionSpaces.
Definition: allgeomtypes.hh:89
Definition: stackallocator.hh:20
const IndexSetType & indexSet() const
Get a reference to the associated index set.
Definition: discretefunctionspace.hh:975
const InterfaceType commInterface_
Definition: discretefunctionspace.hh:650
ThreadSafeValue< UninitializedObjectStack > LocalDofVectorStackType
Definition: discretefunctionspace.hh:633
bool multipleBasisFunctionSets() const
returns true if base function sets depend on the entity
Definition: discretefunctionspace.hh:469
id for Discontinuous Galerkin Space
Definition: discretefunctionspace.hh:91
FunctionSpaceImp FunctionSpaceType
Definition: discretefunctionspace.hh:897
BlockMapperType & blockMapper() const
get a reference to the block mapper
Definition: discretefunctionspace.hh:346
void communicate(DiscreteFunction &discreteFunction, const Operation *op) const
communicate data for given discrete function
Definition: discretefunctionspace.hh:521
This is the class with default implementations for discrete function. The methods not marked with hav...
Definition: discretefunctionspace.hh:595
GridPartType::IndexSetType IndexSetType
type of the index set
Definition: discretefunctionspace.hh:912
BasisFunctionSetSingletonFactory provides method createObject and deleteObject for the SingletonList...
Definition: discretefunctionspace.hh:1024
IteratorType begin() const
get iterator pointing to the first entity of the associated grid partition
Definition: discretefunctionspace.hh:948
const CommunicationManagerType & communicator() const
return reference to communicator (see CommunicationManager)
Definition: discretefunctionspace.hh:796
CommunicationManager< DiscreteFunctionSpaceType > CommunicationManagerType
type of communication manager
Definition: discretefunctionspace.hh:228
FunctionSpaceTraits Traits
type of traits class
Definition: discretefunctionspace.hh:166
GridPartType::IntersectionType IntersectionType
type of the intersections
Definition: discretefunctionspace.hh:202
GridPartType & gridPart() const
Definition: discretefunctionspace.hh:714
Definition: discretefunctionspace.hh:51
default communication manager using just the grids communicate method
Definition: communicationmanager.hh:84
AllGeomTypes< IndexSetType, GridType > AllGeometryTypes
Definition: discretefunctionspace.hh:643
CommunicationManager< DiscreteFunctionSpaceType > CommunicationManagerType
type of communication manager
Definition: discretefunctionspace.hh:629
static void deleteObject(ObjectImp *obj)
delete BaseFunctionSet
Definition: discretefunctionspace.hh:1035
BasicTemporaryLocalFunction< ThisType, LocalDofVectorType > LocalFunctionType
Definition: discretefunctionspace.hh:640
Traits::DiscreteFunctionSpaceType DiscreteFunctionSpaceType
Definition: discretefunctionspace.hh:607
const GridType & grid() const
get reference to grid this discrete function space belongs to
Definition: discretefunctionspace.hh:356
Dune::DynamicVector< typename BaseType::RangeFieldType, LocalDofVectorAllocatorType > LocalDofVectorType
Definition: discretefunctionspace.hh:635
id for Lagrange Space
Definition: discretefunctionspace.hh:95
GridPartType::template Codim< Traits::codimension >::EntityType EntityType
type of entity of codimension 0
Definition: discretefunctionspace.hh:200
InterfaceType communicationInterface() const
return the communication interface appropriate for this space
Definition: discretefunctionspace.hh:478
int size() const
get number of DoFs for this space
Definition: discretefunctionspace.hh:726
IteratorType begin() const
get iterator pointing to the first entity of the associated grid partition
Definition: discretefunctionspace.hh:419
id for Legendre Discontinuous Galerkin Space
Definition: discretefunctionspace.hh:97
const GridType & grid() const
get reference to grid this discrete function space belongs to
Definition: discretefunctionspace.hh:702
GridPartType::GridType GridType
type of the grid
Definition: discretefunctionspace.hh:910
id for Fourier space
Definition: discretefunctionspace.hh:93
DifferentDiscreteFunctionSpace< DiscreteFunctionSpaceType, NewFunctionSpace >::Type Type
type of my discrete function space with new function space
Definition: discretefunctionspace.hh:235
int sequence() const
get index of the sequence in grid sequences
Definition: discretefunctionspace.hh:306
Create Obejct that behaves like a discrete function space without to provide functions with the itera...
Definition: discretefunctionspace.hh:892
const BasisFunctionSetType basisFunctionSet(const EntityType &entity) const
get basis function set for given entity
Definition: discretefunctionspace.hh:278
id for Generic Space
Definition: discretefunctionspace.hh:94
implementation of a basis function set for given entity
Definition: default.hh:46
convert functions space to space with new dim range
Definition: functionspace.hh:246
int sequence() const
get index of the sequence in grid sequences
Definition: discretefunctionspace.hh:670
id for Hierarchic Legendre Discontinuous Galerkin Space
Definition: discretefunctionspace.hh:98
Traits::DiscreteFunctionSpaceType DiscreteFunctionSpaceType
type of DiscretefunctionSapce implementation (Barton-Nackman)
Definition: discretefunctionspace.hh:170