dune-fem  2.4.1-rc
padaptivespace/adaptmanager.hh
Go to the documentation of this file.
1 #ifndef DUNE_FEM_SPACE_PADAPTIVE_ADAPTMANAGER_HH
2 #define DUNE_FEM_SPACE_PADAPTIVE_ADAPTMANAGER_HH
3 
4 #include <dune/grid/common/capabilities.hh>
5 
10 
11 #include "declaration.hh"
12 #include "restrictprolong.hh"
13 
14 
15 namespace Dune
16 {
17 
18  namespace Fem
19  {
20 
21  // DefaultLocalRestrictProlong
22  // ---------------------------
23 
24  template< class FS, class GP, int ord, template< class > class S >
26  : public PLagrangeLocalRestrictProlong< typename GP::GridType, Fem::PAdaptiveLagrangeSpace< FS, GP, ord, S > >
27  {
28  public:
30  : PLagrangeLocalRestrictProlong< typename GP::GridType, Fem::PAdaptiveLagrangeSpace< FS, GP, ord, S > >( space )
31  {}
32  };
33 
34 
35  template< class FunctionSpaceImp, class GridPartImp, int polOrd, template< class > class StorageImp >
36  class DefaultLocalRestrictProlong< Fem::PAdaptiveDGSpace< FunctionSpaceImp, GridPartImp, polOrd, StorageImp > >
37  : public DiscontinuousGalerkinLocalRestrictProlong< Fem::PAdaptiveDGSpace< FunctionSpaceImp, GridPartImp, polOrd, StorageImp >, false > // invert mass matrix or not
38  {
39  public:
41  FunctionSpaceImp,
42  GridPartImp,
43  polOrd, StorageImp >, false > BaseType ;
45  : BaseType( space )
46  {}
47  };
48 
49  template< class FunctionSpaceImp, class GridPartImp, template< class > class StorageImp >
50  class DefaultLocalRestrictProlong< Fem::PAdaptiveDGSpace< FunctionSpaceImp, GridPartImp, 0, StorageImp > >
51  : public ConstantLocalRestrictProlong< Fem::PAdaptiveDGSpace< FunctionSpaceImp, GridPartImp, 0, StorageImp > >
52  {
53  public:
55  {}
56  };
57 
58 
59  // pAdaptation
60  // -----------
61 
62  template <class DF, class Vector, class DFS>
63  void pAdaptation( DF& df, const Vector& polynomialOrders, const DFS &space, const int )
64  {}
65 
73  template <class DF, class Vector,
74  class FS, class GP, int p,
75  template< class > class Storage >
76  void pAdaptation( DF& df,
77  const Vector& polynomialOrders,
79  const int polOrderShift = 0 )
80  {
81  /*
82  typedef typename DF :: DiscreteFunctionSpaceType DiscreteFunctionSpaceType;
83  typedef typename DiscreteFunctionSpaceType :: GridPartType GridPartType;
84  typedef typename GridPartType :: GridType GridType;
85 
86  DiscreteFunctionSpaceType& newSpace = const_cast< DiscreteFunctionSpaceType& > (df.space());
87  DiscreteFunctionSpaceType oldSpace( df.space().gridPart() );
88 
89  typedef DofManager< GridType > DofManagerType;
90  DofManagerType& dm = DofManagerType :: instance( newSpace.grid() );
91 
92  for( const auto& entity : newSpace )
93  oldSpace.blockMapper().setPolynomOrder( entity, newSpace.blockMapper().polynomOrder( entity ) );
94 
95  dm.resize();
96  dm.compress();
97 
98  AdaptiveDiscreteFunction< DiscreteFunctionSpaceType > tmp( "padaptation", oldSpace );
99 
100  newSpace.adapt( tmp )
101  tmp.assign( df );
102 
103  for( const auto& entity : newSpace )
104  {
105  const int polOrder = polynomialOrders[ newSpace.indexSet().index( entity ) ] + polOrderShift ;
106  newSpace.blockMapper().setPolynomOrder( entity, polOrder );
107  }
108 
109  dm.resize();
110  dm.compress();
111 
112  LagrangeInterpolation< DF > :: interpolateFunction( tmp, df );
113  */
114  }
115 
122  template <class DF, class Vector>
123  void pAdaptation( DF& df,
124  const Vector& polynomialOrders,
125  const int polOrderShift = 0 )
126  {
127  pAdaptation( df, polynomialOrders, df.space(), polOrderShift );
128  }
129 
130  } // namespace Fem
131 
132 } // namespace Dune
133 
134 #endif // #ifndef DUNE_FEM_SPACE_PADAPTIVE_ADAPTMANAGER_HH
adaptive DG discrete function space
Definition: space/padaptivespace/declaration.hh:14
void pAdaptation(DF &df, const Vector &polynomialOrders, const DFS &space, const int)
Definition: padaptivespace/adaptmanager.hh:63
DiscontinuousGalerkinLocalRestrictProlong< Fem::PAdaptiveDGSpace< FunctionSpaceImp, GridPartImp, polOrd, StorageImp >, false > BaseType
Definition: padaptivespace/adaptmanager.hh:43
Lagrange discrete function space.
Definition: space/padaptivespace/declaration.hh:21
Definition: discontinuousgalerkin/localrestrictprolong.hh:30
Definition: padaptivespace/restrictprolong.hh:20
Definition: common/localrestrictprolong.hh:24
DefaultLocalRestrictProlong(const Fem::PAdaptiveDGSpace< FunctionSpaceImp, GridPartImp, 0, StorageImp > &)
Definition: padaptivespace/adaptmanager.hh:54
Definition: coordinate.hh:4
DefaultLocalRestrictProlong(const Fem::PAdaptiveDGSpace< FunctionSpaceImp, GridPartImp, polOrd, StorageImp > &space)
Definition: padaptivespace/adaptmanager.hh:44
DefaultLocalRestrictProlong(const Fem::PAdaptiveLagrangeSpace< FS, GP, ord, S > &space)
Definition: padaptivespace/adaptmanager.hh:29
Definition: common/localrestrictprolong.hh:16