1 #ifndef DUNE_FEM_SPACE_DISCONTINUOUSGALERKIN_HLEGENDRE_HH 2 #define DUNE_FEM_SPACE_DISCONTINUOUSGALERKIN_HLEGENDRE_HH 3 4 #include <cassert> 5 6 #include <dune/common/power.hh> 7 8 #include <dune/geometry/type.hh> 9 10 #include <dune/grid/common/gridenums.hh> 11 12 #include <dune/fem/common/hybrid.hh> 13 #include <dune/fem/gridpart/common/capabilities.hh> 14 #include <dune/fem/space/common/capabilities.hh> 15 #include <dune/fem/space/common/commoperations.hh> 16 #include <dune/fem/space/common/defaultcommhandler.hh> 17 #include <dune/fem/space/common/functionspace.hh> 18 #include <dune/fem/space/shapefunctionset/legendre.hh> 19 #include <dune/fem/space/shapefunctionset/selectcaching.hh> 20 21 #include "legendre.hh" 22 23 namespace Dune 24 { 25 26 namespace Fem 27 { 28 29 // HierarchicalLegendreDiscontinuousGalerkinSpace 30 // ---------------------------------------------- 31 32 template< class FunctionSpace, class GridPart, int polOrder, class Storage > 33 class HierarchicLegendreDiscontinuousGalerkinSpace 34 : public LegendreDiscontinuousGalerkinSpaceBase< FunctionSpace, GridPart, polOrder, Storage, true > 35 { 36 // hierarchicalOrdering = true 37 typedef LegendreDiscontinuousGalerkinSpaceBase< FunctionSpace, GridPart, polOrder, Storage, true > BaseType; 38 typedef HierarchicLegendreDiscontinuousGalerkinSpace< FunctionSpace, GridPart, polOrder, Storage > ThisType; 39 40 public: 41 typedef typename BaseType::GridPartType GridPartType; 42 typedef typename BaseType::EntityType EntityType; 43 typedef DiscontinuousGalerkinLocalInterpolation< ThisType > InterpolationType; 44 typedef InterpolationType InterpolationImplType; 45 HierarchicLegendreDiscontinuousGalerkinSpace(GridPartType & gridPart,const InterfaceType commInterface=InteriorBorder_All_Interface,const CommunicationDirection commDirection=ForwardCommunication)46 explicit HierarchicLegendreDiscontinuousGalerkinSpace ( GridPartType &gridPart, 47 const InterfaceType commInterface = InteriorBorder_All_Interface, 48 const CommunicationDirection commDirection = ForwardCommunication ) 49 : BaseType( gridPart, commInterface, commDirection ) 50 {} 51 interpolation() const52 InterpolationType interpolation () const 53 { 54 return InterpolationType( *this ); 55 } 56 57 [[deprecated("Use LocalInterpolation( space ) instead!")]] interpolation(const EntityType & entity) const58 InterpolationType interpolation ( const EntityType &entity ) const 59 { 60 return interpolation(); 61 } 62 localInterpolation() const63 InterpolationType localInterpolation () const 64 { 65 return interpolation(); 66 } 67 68 69 }; 70 71 namespace Capabilities 72 { 73 74 template< class FunctionSpace, class GridPart, int polOrder, class Storage > 75 struct hasFixedPolynomialOrder< HierarchicLegendreDiscontinuousGalerkinSpace< FunctionSpace, GridPart, polOrder, Storage > > 76 { 77 static const bool v = true; 78 }; 79 80 template< class FunctionSpace, class GridPart, int polOrder, class Storage > 81 struct hasStaticPolynomialOrder< HierarchicLegendreDiscontinuousGalerkinSpace< FunctionSpace, GridPart, polOrder, Storage > > 82 { 83 static const bool v = true; 84 static const int order = polOrder; 85 }; 86 87 template< class FunctionSpace, class GridPart, int polOrder, class Storage > 88 struct isContinuous< HierarchicLegendreDiscontinuousGalerkinSpace< FunctionSpace, GridPart, polOrder, Storage > > 89 { 90 static const bool v = false; 91 }; 92 93 template< class FunctionSpace, class GridPart, int polOrder, class Storage > 94 struct isLocalized< HierarchicLegendreDiscontinuousGalerkinSpace< FunctionSpace, GridPart, polOrder, Storage > > 95 { 96 static const bool v = true; 97 }; 98 99 template< class FunctionSpace, class GridPart, int polOrder, class Storage > 100 struct isAdaptive< HierarchicLegendreDiscontinuousGalerkinSpace< FunctionSpace, GridPart, polOrder, Storage > > 101 { 102 static const bool v = true; 103 }; 104 105 template< class FunctionSpace, class GridPart, int polOrder, class Storage > 106 struct threadSafe< HierarchicLegendreDiscontinuousGalerkinSpace< FunctionSpace, GridPart, polOrder, Storage > > 107 { 108 static const bool v = false; 109 }; 110 111 template< class FunctionSpace, class GridPart, int polOrder, class Storage > 112 struct viewThreadSafe< HierarchicLegendreDiscontinuousGalerkinSpace< FunctionSpace, GridPart, polOrder, Storage > > 113 { 114 static const bool v = true; 115 }; 116 117 template< class FunctionSpace, class GridPart, int polOrder, class Storage > 118 struct isHierarchic< HierarchicLegendreDiscontinuousGalerkinSpace< FunctionSpace, GridPart, polOrder, Storage > > 119 { 120 static const bool v = true; 121 }; 122 123 } // namespace Capabilities 124 125 } // namespace Fem 126 127 } // namespace Dune 128 129 #endif // #ifndef DUNE_FEM_SPACE_DISCONTINUOUSGALERKIN_HLEGENDRE_HH 130