diff --git a/fem/common/discretefunctionspace.hh b/fem/common/discretefunctionspace.hh index 8b1fb4ec1b5e58ae5dd6cc0b25f9525f6d74bb1d..70c5911c8a097b552a279aeebc9cbe6409739520 100644 --- a/fem/common/discretefunctionspace.hh +++ b/fem/common/discretefunctionspace.hh @@ -73,8 +73,8 @@ namespace Dune { typedef GridTemp GridType; //! Constructor - DiscreteFunctionSpaceInterface ( GridType & g, int ident ) : - FunctionSpaceType (ident), grid_ (g) {}; + DiscreteFunctionSpaceInterface ( GridType & g, int ident, int level ) : + FunctionSpaceType (ident), grid_ (g), level_(level) {}; //! Get base function set for given entity. //! For a type of element the base function set is unique. @@ -112,6 +112,9 @@ namespace Dune { //! this depends also on the base function set int size () const { return asImp().size(); }; + /** \brief Return the grid level */ + int level () const { return level_; } + //! return boundary type for given boundary id BoundaryType boundaryType ( int id ) const { @@ -139,6 +142,10 @@ namespace Dune { //! the corresponding Grid GridType & grid_ ; + + //! The grid level + int level_; + }; //************************************************************************** @@ -158,6 +165,11 @@ namespace Dune { public: // at the moment nothing + DiscreteFunctionSpaceDefault(GridTemp& g, int id, int level) + : DiscreteFunctionSpaceInterface < FunctionSpaceType , GridTemp, + DiscreteFunctionSpaceImp, BaseFunctionSetInter>(g, id, level) + {} + private: //! Barton-Nackman trick DiscreteFunctionSpaceImp &asImp() diff --git a/fem/lagrangebase.hh b/fem/lagrangebase.hh index 2fb283d8df2cdaa74607a1e064b6ba410a842d27..519cca79eb0e1eb34060b05ca6a6418b92183ea9 100644 --- a/fem/lagrangebase.hh +++ b/fem/lagrangebase.hh @@ -23,7 +23,7 @@ namespace Dune { template< class FunctionSpaceType, class GridType,int polOrd, class DofManagerType = DofManager<GridType> > class LagrangeDiscreteFunctionSpace - : public DiscreteFunctionSpaceInterface < FunctionSpaceType , GridType, + : public DiscreteFunctionSpaceDefault < FunctionSpaceType , GridType, LagrangeDiscreteFunctionSpace < FunctionSpaceType , GridType, polOrd, DofManagerType >, FastBaseFunctionSet < LagrangeDiscreteFunctionSpace < FunctionSpaceType , GridType, polOrd, DofManagerType > > > @@ -34,7 +34,7 @@ namespace Dune { < FunctionSpaceType , GridType , polOrd , DofManagerType > LagrangeDiscreteFunctionSpaceType; /** \todo Please doc me! */ - typedef DiscreteFunctionSpaceInterface < + typedef DiscreteFunctionSpaceDefault < FunctionSpaceType , GridType, LagrangeDiscreteFunctionSpaceType, FastBaseFunctionSet < LagrangeDiscreteFunctionSpaceType > > DiscreteFunctionSpaceType; @@ -116,9 +116,6 @@ namespace Dune { //! number of unknows for this function space int size () const; - //! The grid level that this space belongs to - int level () const {return level_;} - //! return boundary type for given boundary id //! uses the parameter class BoundaryIdentifierType BoundaryType boundaryType ( int id ) const; @@ -159,9 +156,6 @@ namespace Dune { //! the corresponding LagrangeMapper LagrangeMapperType *mapper_; - // the level of the function space - int level_; - }; // end class LagrangeDiscreteFunctionSpace diff --git a/fem/lagrangebase/lagrangespace.cc b/fem/lagrangebase/lagrangespace.cc index 3178ba8da7c12559ca2ec6f9a2902230089346da..23de1690276029adbf0cf15dcaa97772d28d423d 100644 --- a/fem/lagrangebase/lagrangespace.cc +++ b/fem/lagrangebase/lagrangespace.cc @@ -11,7 +11,7 @@ namespace Dune { template< class FunctionSpaceType, class GridType,int polOrd, class DofManagerType > inline LagrangeDiscreteFunctionSpace<FunctionSpaceType,GridType,polOrd,DofManagerType>:: LagrangeDiscreteFunctionSpace ( GridType & g, DofManagerType & dm , int level) : - DiscreteFunctionSpaceType (g,id) , dm_ ( dm ) , level_ (level) + DiscreteFunctionSpaceType (g,id, level) , dm_ ( dm ) { mapper_ = 0; maxNumBase_ = 0; @@ -210,7 +210,7 @@ namespace Dune { BaseFuncSetType * baseFuncSet = new BaseFuncSetType ( *this ); - mapper_ = new LagrangeMapperType (dm_.indexSet(), baseFuncSet->getNumberOfBaseFunctions() , level_ ); + mapper_ = new LagrangeMapperType (dm_.indexSet(), baseFuncSet->getNumberOfBaseFunctions() , this->level_ ); return baseFuncSet; }