dune-fem 2.12-git
Loading...
Searching...
No Matches
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#include <memory>
8#include <tuple>
9#include <type_traits>
10#include <utility>
11
12// dune-common includes
15
16// dune-fem includes
28#include <dune/fem/version.hh>
29
30// local includes
31#include "allgeomtypes.hh"
32#include "dofstorage.hh"
33
34
35namespace Dune
36{
37
38 namespace Fem
39 {
40
54 // ExportsDiscreteFunctionSpaceType
55 // --------------------------------
56
57 template< class T >
59 {
60 typedef char Small;
61 struct Big { char dummy[ 2 ]; };
62
63 template< class U >
64 static Small test ( const U &, typename U::DiscreteFunctionSpaceType * = nullptr );
65 static Big test ( ... );
66
67 static const T &makeT ();
68
69 template< class U, bool >
70 struct GetDiscreteFunctionSpaceType;
71
72 template< class U >
73 struct GetDiscreteFunctionSpaceType< U, true >
74 {
75 typedef typename U::DiscreteFunctionSpaceType Type;
76 };
77
78 template< class U >
79 struct GetDiscreteFunctionSpaceType< U, false >
80 {
81 typedef void Type;
82 };
83
84 public:
85 static const bool v = (sizeof( test( makeT() ) ) == sizeof( Small ));
86 typedef typename GetDiscreteFunctionSpaceType< T, v >::Type Type;
87 };
88
89
90
91 // DFSpaceIdentifier
92 // -----------------
93
109
111 {
112 switch( id )
113 {
114 case CombinedSpace_id : return "CombinedSpace";
115 case DFAdapter_id : return "DFAdapter";
116 case DGSpace_id : return "DiscontinuousGalerkinSpace";
117 case FiniteVolumeSpace_id : return "FiniteVolumeSpace";
118 case FourierSpace_id : return "FourierSpace";
119 case GenericSpace_id : return "GenericSpace";
120 case LagrangeSpace_id : return "LagrangeSpace";
121 case RannacherTurekSpace_id : return "RannacherTurekSpace";
122 case LegendreDGSpace_id : return "LegendreDGSpace";
123 case HierarchicLegendreDGSpace_id : return "HierarchicLegendreDGSpace";
124 case LagrangeDGSpace_id : return "LagrangeDGSpace";
125 default : return "unknown space";
126 }
127 }
128
131
132 template< class DiscreteFunctionSpaceImp,
133 class NewFunctionSpace>
135
136 template <class FunctionSpaceImp,
137 class GridPartImp,
138 int polOrd,
139 class StorageImp,
140 template <class,class,int,class> class DiscreteFunctionSpaceImp,
141 class NewFunctionSpace>
143 DiscreteFunctionSpaceImp<FunctionSpaceImp,GridPartImp,polOrd,StorageImp>,
144 NewFunctionSpace>
145 {
146 typedef DiscreteFunctionSpaceImp< NewFunctionSpace, GridPartImp, polOrd, StorageImp > Type;
147 };
148
149 template <class FunctionSpaceImp,
150 class GridPartImp,
151 int polOrd,
152 bool caching,
153 template <class,class,int,bool> class DiscreteFunctionSpaceImp,
154 class NewFunctionSpace>
156 DiscreteFunctionSpaceImp<FunctionSpaceImp,GridPartImp,polOrd,caching>,
157 NewFunctionSpace>
158 {
159 typedef DiscreteFunctionSpaceImp< NewFunctionSpace, GridPartImp, polOrd, caching > Type;
160 };
161
162
163 //**************************************************************************
164 //
165 // --DiscreteFunctionSpaceInterface
166 //
182 template< class FunctionSpaceTraits >
184 : public FunctionSpaceTraits :: FunctionSpaceType
185 {
186 public:
188 typedef FunctionSpaceTraits Traits;
189
191 typedef typename Traits :: DiscreteFunctionSpaceType
194 typedef typename Traits :: FunctionSpaceType FunctionSpaceType;
195
196 private:
197 typedef FunctionSpaceType BaseType;
198
199 public:
201 typedef typename Traits :: BasisFunctionSetType BasisFunctionSetType;
203 typedef typename Traits :: BlockMapperType BlockMapperType;
204
205 typedef typename Traits::LocalBlockIndices LocalBlockIndices;
206
209
211 typedef typename Traits :: GridPartType GridPartType;
212
214 typedef typename GridPartType :: GridType GridType;
216 typedef typename GridPartType :: IndexSetType IndexSetType;
221 typedef typename GridPartType :: template Codim< Traits::codimension > :: IteratorType
224 typedef typename GridPartType :: template Codim< Traits::codimension > :: EntityType EntityType;
226 typedef typename GridPartType :: IntersectionType IntersectionType;
229
231 [[deprecated("Use AuxiliaryDofsType instead!")]]
233
240 template< class DiscreteFunction,
241 class Operation = // get default type from traits
242 typename Traits :: template CommDataHandle< DiscreteFunction > :: OperationType
243 >
245 {
247 typedef typename Traits
250
252 typedef typename Traits
255 };
256
259
261 template< class NewFunctionSpace >
267
269 template< int newDimRange >
277
278 private:
280 "Domain field type of function space must equal field type of grid." );
281
282 protected:
285
286 public:
287
288 // Methods Provided by the Implementation
289 // --------------------------------------
290
295 {
297 return asImp().type();
298 }
299
307 inline const BasisFunctionSetType basisFunctionSet ( const EntityType &entity ) const
308 {
310 return asImp().basisFunctionSet( entity );
311 }
312
325 inline bool continuous () const
326 {
328 return asImp().continuous();
329 }
330
335 inline int sequence () const
336 {
338 return asImp().sequence();
339 }
340
346 inline int order () const
347 {
349 return asImp().order();
350 }
351
365 inline bool continuous (const IntersectionType &intersection) const
366 {
368 return asImp().continuous(intersection);
369 }
370
376 {
378 return asImp().blockMapper();
379 }
380
385 inline const GridType &grid () const
386 {
388 return asImp().grid();
389 }
390
395 inline GridType &grid ()
396 {
398 return asImp().grid();
399 }
400
406 {
408 return asImp().gridPart();
409 }
410
415 inline const IndexSetType &indexSet () const
416 {
418 return asImp().indexSet();
419 }
420
425 inline int size () const
426 {
428 return asImp().size();
429 }
430
435 inline int primarySize () const
436 {
438 return asImp().primarySize();
439 }
440
445 inline int auxiliarySize () const
446 {
448 return asImp().auxiliarySize();
449 }
450
456 inline IteratorType begin () const
457 {
459 return asImp().begin();
460 }
461
467 inline IteratorType end () const
468 {
470 return asImp().end();
471 }
472
483 template< class FunctorType >
484 inline void forEach ( FunctorType &f ) const
485 {
487 }
488
494 inline bool multipleGeometryTypes () const
495 {
497 return asImp().multipleGeometryTypes();
498 }
499
500
506 inline bool multipleBasisFunctionSets () const
507 {
509 return asImp().multipleBasisFunctionSets();
510 }
511
516 {
518 return asImp().communicationInterface();
519 }
520
525 {
527 return asImp().communicationDirection();
528 }
529
534 {
536 return asImp().communicator();
537 }
538
544 template <class DiscreteFunction>
545 void communicate(DiscreteFunction& discreteFunction) const
546 {
548 asImp().communicate( discreteFunction ) );
549 }
550
557 template <class DiscreteFunction, class Operation>
558 void communicate(DiscreteFunction& discreteFunction, const Operation& op) const
559 {
561 asImp().communicate( discreteFunction , op ) );
562 }
563
571 template< class DiscreteFunction, class Operation >
572 inline typename CommDataHandle< DiscreteFunction, Operation > :: Type
573 createDataHandle ( DiscreteFunction& discreteFunction,
574 const Operation &operation ) const
575 {
577 ( asImp().createDataHandle( discreteFunction, operation ) );
578 return asImp().createDataHandle( discreteFunction, operation );
579 }
580
583 {
585 return asImp().auxiliaryDofs();
586 }
587
589 [[deprecated("Use auxiliaryDofs instead!")]]
591 {
592 return auxiliaryDofs();
593 }
594
595 protected:
596 // Barton-Nackman trick
597 inline const DiscreteFunctionSpaceType &asImp () const
598 {
599 return static_cast< const DiscreteFunctionSpaceType & >( *this );
600 }
601
602 // Barton-Nackman trick
604 {
605 return static_cast< DiscreteFunctionSpaceType & >( *this );
606 }
607 }; // end class DiscreteFunctionSpaceInterface
608
609
610
621 template< class Traits >
624 {
625 return &(X.blockMapper()) == &(Y.blockMapper());
626 }
627
628
629
630 //---------------------------------------------------------------------------
631 //-
632 //- --DiscreteFunctionSpaceDefault
633 //-
634 //-
635 //---------------------------------------------------------------------------
645 template< class FunctionSpaceTraits >
647 : public DiscreteFunctionSpaceInterface< FunctionSpaceTraits >,
648 public std::enable_shared_from_this< typename FunctionSpaceTraits::DiscreteFunctionSpaceType >
649 {
650 public:
651 typedef FunctionSpaceTraits Traits;
652
653 private:
656
657 public:
658 typedef typename Traits :: DiscreteFunctionSpaceType
660
661 typedef typename BaseType :: GridPartType GridPartType;
662 typedef typename BaseType :: GridType GridType;
663 typedef typename BaseType :: IndexSetType IndexSetType;
664 typedef typename BaseType :: IteratorType IteratorType;
665 typedef typename BaseType :: EntityType EntityType;
666
667 protected:
668 using BaseType :: asImp;
669
670 public:
673 using BaseType :: order ;
674
677
680
683
684 protected:
686 {
688
693
694 static void deleteObject ( ObjectType *object ) { delete object; }
695 };
696
698
699 protected:
701
705
708
710
711 // set of all geometry types possible
714
715 // reference to dof manager
717
718 // communication manager
722
723 public:
726 const InterfaceType commInterface = InteriorBorder_All_Interface,
727 const CommunicationDirection commDirection = ForwardCommunication )
728 : BaseType(),
730 ldvStack_( 0 ),
733 dofManager_( DofManagerType :: instance( gridPart.grid() ) ),
734 commInterface_( commInterface ),
735 commDirection_( commDirection )
736 {}
737
739 inline int sequence () const
740 {
741 return dofManager_.sequence();
742 }
743
748 inline int order ( const EntityType& entity ) const
749 {
750 return asImp().basisFunctionSet( entity ).order();
751 }
752
754 inline const GridType &grid () const
755 {
756 return asImp().gridPart().grid();
757 }
758
760 inline GridType &grid ()
761 {
762 return asImp().gridPart().grid();
763 }
764
766 inline GridPartType &gridPart () const
767 {
768 return gridPart_;
769 }
770
772 inline const IndexSetType &indexSet () const
773 {
774 return asImp().gridPart().indexSet();
775 }
776
778 inline int size () const
779 {
780 return blockMapper().size() * localBlockSize ;
781 }
782
784 inline int primarySize () const
785 {
787 }
788
790 inline int auxiliarySize () const
791 {
792 // total size minus primary dofs
793 return size() - primarySize();
794 }
795
797 inline int maxNumDofs () const
798 {
799 return blockMapper().maxNumDofs() * localBlockSize;
800 }
801
807 inline IteratorType begin () const
808 {
809 return asImp().gridPart().template begin< 0 >();
810 }
811
817 inline IteratorType end () const
818 {
819 return asImp().gridPart().template end< 0 >();
820 }
821
831 template< class FunctorType >
832 inline void forEach ( FunctorType &f ) const
833 {
834 const IteratorType end = asImp().end();
835 for( IteratorType it = asImp().begin(); it != end; ++it )
836 f( *it );
837 }
838
840 inline bool multipleGeometryTypes () const
841 {
843 }
844
849 inline bool multipleBasisFunctionSets () const
850 {
851 return false;
852 }
853
856 {
857 return commInterface_;
858 }
859
865
868 {
869 if( !communicator_ )
871 assert( communicator_ != 0 );
872 return *communicator_;
873 }
874
876 template <class DiscreteFunction>
877 void communicate(DiscreteFunction& discreteFunction) const
878 {
879 // get type of default operation
880 typedef typename DiscreteFunction :: DiscreteFunctionSpaceType :: template
881 CommDataHandle< DiscreteFunction > :: OperationType DefaultOperationType;
882
883 // default communication operation
884 DefaultOperationType operation;
885
886 // exchange data
887 communicate( discreteFunction, operation );
888 }
889
891 template <class DiscreteFunction, class Operation>
892 void communicate(DiscreteFunction& discreteFunction, const Operation& op ) const
893 {
895 {
896 static_assert( std::is_same< typename DiscreteFunctionSpaceType::BlockMapperType,
897 typename DiscreteFunction::DiscreteFunctionSpaceType::BlockMapperType >::value &&
898 localBlockSize == static_cast< std::size_t >(DiscreteFunction::DiscreteFunctionSpaceType::localBlockSize),
899 "DiscreteFunctionSpaceDefault::communicate cannot be called with discrete functions defined over a different space" );
900 communicator().exchange( discreteFunction, op );
901 }
902 else
903 {
904 static_assert( std::is_base_of< IsBlockVector, DiscreteFunction> :: value, "DiscreteFunctionSpaceDefault::communicate needs at least a BlockVectorInterface and derived");
905 communicator().exchange( asImp(), discreteFunction, op );
906 }
907 }
908
916 template< class DiscreteFunction, class Operation >
917 inline typename BaseType
918 :: template CommDataHandle< DiscreteFunction, Operation > :: Type
919 createDataHandle( DiscreteFunction &discreteFunction,
920 const Operation& operation ) const
921 {
922 static_assert( std::is_same< typename DiscreteFunctionSpaceType::BlockMapperType,
923 typename DiscreteFunction::DiscreteFunctionSpaceType::BlockMapperType >::value &&
924 localBlockSize == static_cast< std::size_t >(DiscreteFunction::DiscreteFunctionSpaceType::localBlockSize),
925 "DiscreteFunctionSpaceDefault::createDataHandle cannot be called with discrete functions defined over a different space" );
926 return typename BaseType
928 :: Type( discreteFunction, operation );
929 }
930
933 {
934 if ( !auxiliaryDofs_ )
936 const int sequence = asImp().sequence();
937 if( auxiliaryDofs_->second != sequence )
938 {
939 auxiliaryDofs_->first.rebuild();
940 auxiliaryDofs_->second = sequence;
941 }
942 return auxiliaryDofs_->first;
943 }
944
946 template <class DiscreteFunction>
947 void addFunction( DiscreteFunction& df ) const
948 {
949 }
950
952 template <class DiscreteFunction>
953 void removeFunction( DiscreteFunction& df ) const
954 {
955 }
956
959 template <class Vector>
960 void adapt( const Vector& polynomialOrders, const int polOrderShift = 0 ) const
961 {
962 }
963
969 inline const std::vector<GeometryType>& geomTypes(int codim) const
970 {
971 return allGeomTypes_.geomTypes(codim);
972 }
973 protected:
974
975 // only combined space should use geomTypes
976 template <class , int , DofStoragePolicy> friend class CombinedSpace;
978 };
979
980
981
983 //
984 // DiscreteFunctionSpaceAdapter
985 //
987
996 template< class FunctionSpaceImp, class GridPartImp >
998 : public FunctionSpaceImp
999 , public std::enable_shared_from_this< DiscreteFunctionSpaceAdapter<FunctionSpaceImp,GridPartImp> >
1000 {
1001 public:
1002 // type of the underlying function space
1003 typedef FunctionSpaceImp FunctionSpaceType;
1005 typedef GridPartImp GridPartType;
1006
1007 private:
1009 ThisType;
1010 typedef FunctionSpaceType BaseType;
1011
1012 public:
1013 enum { polynomialOrder = 6 }; // default polynomial order basically for determination of quadrature orders
1014
1016 typedef typename GridPartType :: GridType GridType;
1018 typedef typename GridPartType :: IndexSetType IndexSetType;
1020 typedef typename GridPartType :: template Codim< 0 > :: IteratorType
1022 //- type of used entity
1023 typedef typename GridType :: template Codim< 0 > :: Entity EntityType;
1024 //- type of intersections
1025 typedef typename GridPartType :: IntersectionType IntersectionType;
1026
1029
1030 protected:
1032 const unsigned int order_;
1033
1034 public:
1037 ( const GridPartType &gridPart,
1038 unsigned int order = polynomialOrder )
1039 : BaseType(),
1041 order_( order )
1042 {
1043 }
1044
1047 : BaseType( other ),
1048 gridPart_( other.gridPart_ ),
1049 order_( other.order_ )
1050 {
1051 }
1052
1054 inline IteratorType begin () const
1055 {
1056 return gridPart_.template begin< 0 >();
1057 }
1058
1060 inline IteratorType end () const
1061 {
1062 return gridPart_.template end< 0 >();
1063 }
1064
1066 template< class FunctorType >
1067 inline void forEach ( FunctorType &f ) const
1068 {
1069 const IteratorType endit = end();
1070 for( IteratorType it = begin(); it != endit; ++it )
1071 f( *it );
1072 }
1073
1075 inline const GridPartType &gridPart () const
1076 {
1077 return gridPart_;
1078 }
1079
1081 inline const IndexSetType &indexSet () const
1082 {
1083 return gridPart_.indexSet();
1084 }
1085
1087 inline const GridType& grid () const
1088 {
1089 return gridPart_.grid();
1090 }
1091
1093 inline bool continuous () const
1094 {
1095 return true;
1096 }
1098 inline bool continuous (const IntersectionType &intersection) const
1099 {
1100 return true;
1101 }
1102
1104 inline int order () const
1105 {
1106 return order_;
1107 }
1108
1110 inline int order ( const EntityType& ) const
1111 {
1112 return order();
1113 }
1114
1116 inline DFSpaceIdentifier type () const
1117 {
1118 return DFAdapter_id;
1119 }
1120 };
1121
1123
1129 template <class KeyImp, class ObjectImp, class ObjectFactoryImp>
1131 {
1132 public:
1134 static ObjectImp * createObject( const KeyImp & key )
1135 {
1136 ObjectFactoryImp fac(key);
1137 return new ObjectImp(fac);
1138 }
1139
1141 static void deleteObject( ObjectImp * obj )
1142 {
1143 delete obj;
1144 }
1145 };
1146
1147 } // namespace Fem
1148
1149} // namespace Dune
1150#endif // #ifndef DUNE_FEM_DISCRETEFUNCTIONSPACE_HH
#define CHECK_AND_CALL_INTERFACE_IMPLEMENTATION(__interface_method_to_call__)
#define CHECK_INTERFACE_IMPLEMENTATION(dummy)
constexpr auto size(const T &t)
CommunicationDirection
InterfaceType
ForwardCommunication
InteriorBorder_All_Interface
bool operator==(const DiscreteFunctionInterface< ImplX > &x, const DiscreteFunctionInterface< ImplY > &y)
Definition common/discretefunction.hh:1053
void rebuild()
Definition auxiliarydofs.hh:151
void exchange(DiscreteFunction &discreteFunction) const
exchange data for a discrete function using the copy operation
Definition communicationmanager.hh:225
IndexType primarySize() const
return number of primaryDofs
Definition auxiliarydofs.hh:134
DFSpaceIdentifier
enumerator for identification of spaces
Definition discretefunctionspace.hh:95
std::string spaceName(const DFSpaceIdentifier id)
Definition discretefunctionspace.hh:110
@ CombinedSpace_id
id for Combined Space
Definition discretefunctionspace.hh:96
@ LagrangeSpace_id
id for Lagrange Space
Definition discretefunctionspace.hh:102
@ LegendreDGSpace_id
id for Legendre Discontinuous Galerkin Space
Definition discretefunctionspace.hh:104
@ GenericSpace_id
id for Generic Space
Definition discretefunctionspace.hh:101
@ LocalFiniteElementSpace_id
id for local finite element space
Definition discretefunctionspace.hh:107
@ DFAdapter_id
id for DiscreteFunctionSpace Adapter
Definition discretefunctionspace.hh:97
@ FourierSpace_id
id for Fourier space
Definition discretefunctionspace.hh:100
@ DGSpace_id
id for Discontinuous Galerkin Space
Definition discretefunctionspace.hh:98
@ LagrangeDGSpace_id
id for Lagrange Discontinuous Galerkin Space
Definition discretefunctionspace.hh:106
@ FiniteVolumeSpace_id
id for Finite Volume Space
Definition discretefunctionspace.hh:99
@ HierarchicLegendreDGSpace_id
id for Hierarchic Legendre Discontinuous Galerkin Space
Definition discretefunctionspace.hh:105
@ RannacherTurekSpace_id
id for Rannacher-Turek space
Definition discretefunctionspace.hh:103
int sequence() const
return number of sequence, if dofmanagers memory was changed by calling some method like resize,...
Definition dofmanager.hh:1007
Definition stackallocator.hh:61
A temporary function carrying values for one entity.
Definition temporary.hh:42
Definition combinedspace/combinedspace.hh:32
default implementation uses method geomTypes of given index set. Used in DiscreteFunctionSpaces.
Definition allgeomtypes.hh:99
static bool multipleGeomTypes()
UGGrid might have different geom types.
Definition allgeomtypes.hh:178
const std ::vector< GeometryType > & geomTypes(unsigned int codim) const
returns vector with geometry tpyes this index set has indices for
Definition allgeomtypes.hh:171
In parallel computations the dofs of a discrete function are made up by all primary dofs....
Definition auxiliarydofs.hh:46
default communication manager using just the grids communicate method
Definition communicationmanager.hh:78
Definition dofmanager.hh:786
Definition discretefunctionspace.hh:59
static const bool v
Definition discretefunctionspace.hh:85
GetDiscreteFunctionSpaceType< T, v >::Type Type
Definition discretefunctionspace.hh:86
Definition discretefunctionspace.hh:130
Definition discretefunctionspace.hh:134
DiscreteFunctionSpaceImp< NewFunctionSpace, GridPartImp, polOrd, StorageImp > Type
Definition discretefunctionspace.hh:146
DiscreteFunctionSpaceImp< NewFunctionSpace, GridPartImp, polOrd, caching > Type
Definition discretefunctionspace.hh:159
This is the interface for discrete function spaces. All methods declared here have to be implemented ...
Definition discretefunctionspace.hh:185
static constexpr std::size_t localBlockSize
size of local blocks
Definition discretefunctionspace.hh:208
Traits::BlockMapperType BlockMapperType
type of block mapper of this space
Definition discretefunctionspace.hh:203
const CommunicationManagerType & communicator() const
return reference to communicator (see CommunicationManager)
Definition discretefunctionspace.hh:533
GridPartType::GridType GridType
type of underlying dune grid
Definition discretefunctionspace.hh:214
AuxiliaryDofs< GridPartType, BlockMapperType > AuxiliaryDofsType
type of auxiliary dofs
Definition discretefunctionspace.hh:228
bool continuous() const
returns true if the space contains only globally continuous functions
Definition discretefunctionspace.hh:325
const IndexSetType & indexSet() const
Get a reference to the associated index set.
Definition discretefunctionspace.hh:415
Traits::LocalBlockIndices LocalBlockIndices
Definition discretefunctionspace.hh:205
const AuxiliaryDofsType & slaveDofs() const
deprecated method, use auxiliaryDofs
Definition discretefunctionspace.hh:590
const DiscreteFunctionSpaceType & asImp() const
Definition discretefunctionspace.hh:597
GridPartType::IndexSetType IndexSetType
type of used dune index set
Definition discretefunctionspace.hh:216
DiscreteFunctionSpaceType & asImp()
Definition discretefunctionspace.hh:603
Traits::FunctionSpaceType FunctionSpaceType
type of function space
Definition discretefunctionspace.hh:194
Traits::BasisFunctionSetType BasisFunctionSetType
type of basis function set of this space
Definition discretefunctionspace.hh:201
GridPartType::IntersectionType IntersectionType
type of the intersections
Definition discretefunctionspace.hh:226
int primarySize() const
get number of primary DoFs for this space
Definition discretefunctionspace.hh:435
bool multipleBasisFunctionSets() const
returns true if base function sets depend on the entity
Definition discretefunctionspace.hh:506
InterfaceType communicationInterface() const
return the communication interface appropriate for this space
Definition discretefunctionspace.hh:515
CommunicationManager< DiscreteFunctionSpaceType > CommunicationManagerType
type of communication manager
Definition discretefunctionspace.hh:258
int auxiliarySize() const
get number of auxiliary DoFs for this space
Definition discretefunctionspace.hh:445
const GridType & grid() const
get reference to grid this discrete function space belongs to
Definition discretefunctionspace.hh:385
FunctionSpaceTraits Traits
type of traits class
Definition discretefunctionspace.hh:188
Traits::GridPartType GridPartType
type of underlying grid part
Definition discretefunctionspace.hh:211
GridType & grid()
get reference to grid this discrete function space belongs to
Definition discretefunctionspace.hh:395
const BasisFunctionSetType basisFunctionSet(const EntityType &entity) const
get basis function set for given entity
Definition discretefunctionspace.hh:307
int order() const
get global order of space
Definition discretefunctionspace.hh:346
GridPartType::template Codim< Traits::codimension >::EntityType EntityType
type of entity of codimension 0
Definition discretefunctionspace.hh:224
DFSpaceIdentifier type() const
return type identifier of discrete function space
Definition discretefunctionspace.hh:294
GridPartType & gridPart()
get a reference to the associated grid partition
Definition discretefunctionspace.hh:405
bool continuous(const IntersectionType &intersection) const
returns true if discrete functions over this space have zero jump over the given intersection.
Definition discretefunctionspace.hh:365
GridPartType::template Codim< Traits::codimension >::IteratorType IteratorType
type of iterator for grid traversal
Definition discretefunctionspace.hh:222
DiscreteFunctionSpaceInterface()
Definition discretefunctionspace.hh:283
int sequence() const
get index of the sequence in grid sequences
Definition discretefunctionspace.hh:335
void forEach(FunctorType &f) const
apply a functor to each entity in the associated grid partition
Definition discretefunctionspace.hh:484
void communicate(DiscreteFunction &discreteFunction) const
communicate data for given discrete function using the space's default communication operation
Definition discretefunctionspace.hh:545
IteratorType end() const
get iterator pointing behind the last entity of the associated grid partition
Definition discretefunctionspace.hh:467
bool multipleGeometryTypes() const
returns true if the grid has more than one geometry type
Definition discretefunctionspace.hh:494
int size() const
get number of DoFs for this space
Definition discretefunctionspace.hh:425
IteratorType begin() const
get iterator pointing to the first entity of the associated grid partition
Definition discretefunctionspace.hh:456
AuxiliaryDofsType SlaveDofsType
deprecated type
Definition discretefunctionspace.hh:232
CommunicationDirection communicationDirection() const
return the communication direction appropriate for this space
Definition discretefunctionspace.hh:524
BlockMapperType & blockMapper() const
get a reference to the block mapper
Definition discretefunctionspace.hh:375
CommDataHandle< DiscreteFunction, Operation >::Type createDataHandle(DiscreteFunction &discreteFunction, const Operation &operation) const
Creates DataHandle for given discrete function.
Definition discretefunctionspace.hh:573
void communicate(DiscreteFunction &discreteFunction, const Operation &op) const
communicate data for given discrete function
Definition discretefunctionspace.hh:558
Traits::DiscreteFunctionSpaceType DiscreteFunctionSpaceType
type of DiscretefunctionSapce implementation (Barton-Nackman)
Definition discretefunctionspace.hh:192
const AuxiliaryDofsType & auxiliaryDofs() const
get auxiliary dofs
Definition discretefunctionspace.hh:582
defines type of data handle for communication
Definition discretefunctionspace.hh:245
Traits::template CommDataHandle< DiscreteFunction, Operation >::OperationType OperationType
type of operation to perform on scatter
Definition discretefunctionspace.hh:254
Traits::template CommDataHandle< DiscreteFunction, Operation >::Type Type
type of communication data handle
Definition discretefunctionspace.hh:249
typedef struct for defining the same discrete function space with a different function space
Definition discretefunctionspace.hh:263
DifferentDiscreteFunctionSpace< DiscreteFunctionSpaceType, NewFunctionSpace >::Type Type
type of my discrete function space with new function space
Definition discretefunctionspace.hh:265
typedef struct for defining the same discrete function space with a different dimRange
Definition discretefunctionspace.hh:271
ToNewFunctionSpace< NewFunctionSpaceType >::Type Type
type of my discrete function space with new dim range
Definition discretefunctionspace.hh:275
ToNewDimRangeFunctionSpace< FunctionSpaceType, newDimRange >::Type NewFunctionSpaceType
Definition discretefunctionspace.hh:272
This is the class with default implementations for discrete function. The methods not marked with hav...
Definition discretefunctionspace.hh:649
std::unique_ptr< std::pair< AuxiliaryDofsType, int >, typename AuxiliaryDofsProviderType::Deleter > auxiliaryDofs_
Definition discretefunctionspace.hh:977
const InterfaceType commInterface_
Definition discretefunctionspace.hh:719
LocalDofVectorAllocatorType ldvAllocator_
Definition discretefunctionspace.hh:707
BaseType::EntityType EntityType
Definition discretefunctionspace.hh:665
std::unique_ptr< CommunicationManagerType > communicator_
Definition discretefunctionspace.hh:721
BaseType::BlockMapperType BlockMapperType
Definition discretefunctionspace.hh:681
bool multipleBasisFunctionSets() const
returns true if base function sets depend on the entity
Definition discretefunctionspace.hh:849
BaseType::template CommDataHandle< DiscreteFunction, Operation >::Type createDataHandle(DiscreteFunction &discreteFunction, const Operation &operation) const
Definition discretefunctionspace.hh:919
int order(const EntityType &entity) const
default implementation of the method order
Definition discretefunctionspace.hh:748
BaseType::GridPartType GridPartType
Definition discretefunctionspace.hh:661
const std::vector< GeometryType > & geomTypes(int codim) const
returns true if the grid has more than one geometry type
Definition discretefunctionspace.hh:969
LocalDofVectorStackType ldvStack_
Definition discretefunctionspace.hh:706
const CommunicationManagerType & communicator() const
return reference to communicator (see CommunicationManager)
Definition discretefunctionspace.hh:867
BaseType::IndexSetType IndexSetType
Definition discretefunctionspace.hh:663
void addFunction(DiscreteFunction &df) const
default implementation of addFunction does nothing at the moment
Definition discretefunctionspace.hh:947
Traits::DiscreteFunctionSpaceType DiscreteFunctionSpaceType
Definition discretefunctionspace.hh:659
void removeFunction(DiscreteFunction &df) const
default implementation of removeFunction does nothing at the moment
Definition discretefunctionspace.hh:953
void communicate(DiscreteFunction &discreteFunction) const
communicate data for given discrete function using the space's default communication operation
Definition discretefunctionspace.hh:877
GridPartType & gridPart_
Definition discretefunctionspace.hh:700
const GridType & grid() const
get reference to grid this discrete function space belongs to
Definition discretefunctionspace.hh:754
InterfaceType communicationInterface() const
return the communication interface appropriate for this space
Definition discretefunctionspace.hh:855
SingletonList< std::pair< GridPartType *, BlockMapperType * >, std::pair< AuxiliaryDofsType, int >, AuxiliaryDofsFactory > AuxiliaryDofsProviderType
Definition discretefunctionspace.hh:697
void forEach(FunctorType &f) const
apply a functor to each entity in the associated grid partition
Definition discretefunctionspace.hh:832
const AllGeometryTypes allGeomTypes_
Definition discretefunctionspace.hh:713
int maxNumDofs() const
return the maximal number of dofs on entities
Definition discretefunctionspace.hh:797
int primarySize() const
get number of primary DoFs for this space
Definition discretefunctionspace.hh:784
GridType & grid()
get reference to grid this discrete function space belongs to
Definition discretefunctionspace.hh:760
int sequence() const
get index of the sequence in grid sequences
Definition discretefunctionspace.hh:739
const IndexSetType & indexSet() const
Get a reference to the associated index set.
Definition discretefunctionspace.hh:772
AllGeomTypes< IndexSetType, GridType > AllGeometryTypes
Definition discretefunctionspace.hh:712
BaseType::AuxiliaryDofsType AuxiliaryDofsType
Definition discretefunctionspace.hh:682
void communicate(DiscreteFunction &discreteFunction, const Operation &op) const
communicate data for given discrete function
Definition discretefunctionspace.hh:892
const AuxiliaryDofsType & auxiliaryDofs() const
get auxiliary dofs
Definition discretefunctionspace.hh:932
int size() const
get number of DoFs for this space
Definition discretefunctionspace.hh:778
void adapt(const Vector &polynomialOrders, const int polOrderShift=0) const
default implementation of adapt does nothing, its only used in PAdaptiveLagrangeSpace
Definition discretefunctionspace.hh:960
DofManagerType & dofManager_
Definition discretefunctionspace.hh:716
BaseType::IteratorType IteratorType
Definition discretefunctionspace.hh:664
BasicTemporaryLocalFunction< ThisType, LocalDofVectorType > LocalFunctionType
Definition discretefunctionspace.hh:709
GridPartType & gridPart() const
Definition discretefunctionspace.hh:766
BaseType::GridType GridType
Definition discretefunctionspace.hh:662
CommunicationManager< DiscreteFunctionSpaceType > CommunicationManagerType
type of communication manager
Definition discretefunctionspace.hh:679
const CommunicationDirection commDirection_
Definition discretefunctionspace.hh:720
CommunicationDirection communicationDirection() const
return the communication interface appropriate for this space
Definition discretefunctionspace.hh:861
IteratorType end() const
get iterator pointing behind the last entity of the associated grid partition
Definition discretefunctionspace.hh:817
DiscreteFunctionSpaceDefault(GridPartType &gridPart, const InterfaceType commInterface=InteriorBorder_All_Interface, const CommunicationDirection commDirection=ForwardCommunication)
constructor
Definition discretefunctionspace.hh:725
ThreadSafeValue< UninitializedObjectStack > LocalDofVectorStackType
Definition discretefunctionspace.hh:702
IteratorType begin() const
get iterator pointing to the first entity of the associated grid partition
Definition discretefunctionspace.hh:807
bool multipleGeometryTypes() const
returns true if the grid has more than one geometry type
Definition discretefunctionspace.hh:840
Dune::DynamicVector< typename BaseType::RangeFieldType, LocalDofVectorAllocatorType > LocalDofVectorType
Definition discretefunctionspace.hh:704
FunctionSpaceTraits Traits
Definition discretefunctionspace.hh:651
StackAllocator< typename BaseType::RangeFieldType, LocalDofVectorStackType * > LocalDofVectorAllocatorType
Definition discretefunctionspace.hh:703
DofManager< GridType > DofManagerType
type of DoF manager
Definition discretefunctionspace.hh:676
int auxiliarySize() const
get number of auxiliary DoFs for this space
Definition discretefunctionspace.hh:790
static void deleteObject(ObjectType *object)
Definition discretefunctionspace.hh:694
static ObjectType * createObject(std::pair< GridPartType *, BlockMapperType * > key)
Definition discretefunctionspace.hh:689
std::pair< AuxiliaryDofsType, int > ObjectType
Definition discretefunctionspace.hh:687
Create Obejct that behaves like a discrete function space without to provide functions with the itera...
Definition discretefunctionspace.hh:1000
IteratorType begin() const
get iterator pointing to the first entity of the associated grid partition
Definition discretefunctionspace.hh:1054
GridType::template Codim< 0 >::Entity EntityType
Definition discretefunctionspace.hh:1023
GridPartType::template Codim< 0 >::IteratorType IteratorType
type of the grid iterator
Definition discretefunctionspace.hh:1021
bool continuous(const IntersectionType &intersection) const
returns true if the space contains only globally continuous functions
Definition discretefunctionspace.hh:1098
DiscreteFunctionSpaceAdapter(const GridPartType &gridPart, unsigned int order=polynomialOrder)
constructor taking grid Part
Definition discretefunctionspace.hh:1037
DiscreteFunctionSpaceAdapter(const ThisType &other)
copy constructor
Definition discretefunctionspace.hh:1046
bool continuous() const
returns true if the space contains only globally continuous functions
Definition discretefunctionspace.hh:1093
DefaultCommunicationManager< ThisType > CommunicationManagerType
type of communication manager (only the default communication is valid here)
Definition discretefunctionspace.hh:1028
const GridPartType & gridPart() const
get a reference to the associated grid partition
Definition discretefunctionspace.hh:1075
int order() const
get global order of space
Definition discretefunctionspace.hh:1104
const GridType & grid() const
get reference to grid this discrete function space belongs to
Definition discretefunctionspace.hh:1087
IteratorType end() const
get iterator pointing behind the last entity of the associated grid partition
Definition discretefunctionspace.hh:1060
@ polynomialOrder
Definition discretefunctionspace.hh:1013
const GridPartType & gridPart_
Definition discretefunctionspace.hh:1031
GridPartImp GridPartType
type of the grid partition
Definition discretefunctionspace.hh:1005
GridPartType::IntersectionType IntersectionType
Definition discretefunctionspace.hh:1025
DFSpaceIdentifier type() const
return type identifier of discrete function space
Definition discretefunctionspace.hh:1116
void forEach(FunctorType &f) const
apply a functor to each entity in the associated grid partition
Definition discretefunctionspace.hh:1067
int order(const EntityType &) const
get global order of space
Definition discretefunctionspace.hh:1110
const IndexSetType & indexSet() const
Get a reference to the associated index set.
Definition discretefunctionspace.hh:1081
FunctionSpaceImp FunctionSpaceType
Definition discretefunctionspace.hh:1003
const unsigned int order_
Definition discretefunctionspace.hh:1032
GridPartType::IndexSetType IndexSetType
type of the index set
Definition discretefunctionspace.hh:1018
GridPartType::GridType GridType
type of the grid
Definition discretefunctionspace.hh:1016
BasisFunctionSetSingletonFactory provides method createObject and deleteObject for the SingletonList.
Definition discretefunctionspace.hh:1131
static ObjectImp * createObject(const KeyImp &key)
create new BaseFunctionSet
Definition discretefunctionspace.hh:1134
static void deleteObject(ObjectImp *obj)
delete BaseFunctionSet
Definition discretefunctionspace.hh:1141
convert functions space to space with new dim range
Definition functionspace.hh:250
Singleton list for key/object pairs.
Definition singletonlist.hh:53
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
Definition singletonlist.hh:65
T make_pair(T... args)
T make_tuple(T... args)
T piecewise_construct
T tie(T... args)