Skip to content
Snippets Groups Projects
Commit 28464781 authored by Oliver Sander's avatar Oliver Sander
Browse files

discrete functions spaces only get a const reference to the grid

[[Imported from SVN: r1714]]
parent da6d22b7
No related branches found
No related tags found
No related merge requests found
...@@ -73,7 +73,7 @@ namespace Dune { ...@@ -73,7 +73,7 @@ namespace Dune {
typedef GridTemp GridType; typedef GridTemp GridType;
//! Constructor //! Constructor
DiscreteFunctionSpaceInterface ( GridType & g, int ident, int level ) : DiscreteFunctionSpaceInterface (const GridType & g, int ident, int level ) :
FunctionSpaceType (ident), grid_ (g), level_(level) {}; FunctionSpaceType (ident), grid_ (g), level_(level) {};
//! Get base function set for given entity. //! Get base function set for given entity.
...@@ -105,7 +105,7 @@ namespace Dune { ...@@ -105,7 +105,7 @@ namespace Dune {
} }
//! return the corresponding Grid //! return the corresponding Grid
GridType & getGrid () const { return grid_; } const GridType & getGrid () const { return grid_; }
//! return number of degrees of freedom for spezified grid and level //! return number of degrees of freedom for spezified grid and level
//! which can also be the leaflevel and furthermore //! which can also be the leaflevel and furthermore
...@@ -141,7 +141,7 @@ namespace Dune { ...@@ -141,7 +141,7 @@ namespace Dune {
} }
//! the corresponding Grid //! the corresponding Grid
GridType & grid_ ; const GridType & grid_ ;
//! The grid level //! The grid level
int level_; int level_;
...@@ -165,7 +165,7 @@ namespace Dune { ...@@ -165,7 +165,7 @@ namespace Dune {
public: public:
// at the moment nothing // at the moment nothing
DiscreteFunctionSpaceDefault(GridTemp& g, int id, int level) DiscreteFunctionSpaceDefault(const GridTemp& g, int id, int level)
: DiscreteFunctionSpaceInterface < FunctionSpaceType , GridTemp, : DiscreteFunctionSpaceInterface < FunctionSpaceType , GridTemp,
DiscreteFunctionSpaceImp, BaseFunctionSetInter>(g, id, level) DiscreteFunctionSpaceImp, BaseFunctionSetInter>(g, id, level)
{} {}
......
...@@ -86,7 +86,7 @@ namespace Dune { ...@@ -86,7 +86,7 @@ namespace Dune {
//! Constructor generating for each different element type of the grid a //! Constructor generating for each different element type of the grid a
//! LagrangeBaseSet with polOrd //! LagrangeBaseSet with polOrd
LagrangeDiscreteFunctionSpace ( GridType & g, IndexSetType & iset , DofManagerType & dm , int level ); LagrangeDiscreteFunctionSpace ( const GridType & g, IndexSetType & iset , DofManagerType & dm , int level );
//! return max number of baseset that holds this space //! return max number of baseset that holds this space
int maxNumberBase () const; int maxNumberBase () const;
......
...@@ -10,7 +10,7 @@ namespace Dune { ...@@ -10,7 +10,7 @@ namespace Dune {
// Constructor // Constructor
template< class FunctionSpaceT, class GridType, class IndexSetType , int polOrd, class DofManagerType > template< class FunctionSpaceT, class GridType, class IndexSetType , int polOrd, class DofManagerType >
inline LagrangeDiscreteFunctionSpace<FunctionSpaceT,GridType,IndexSetType,polOrd,DofManagerType>:: inline LagrangeDiscreteFunctionSpace<FunctionSpaceT,GridType,IndexSetType,polOrd,DofManagerType>::
LagrangeDiscreteFunctionSpace ( GridType & g, IndexSetType & iset, DofManagerType & dm , int level) : LagrangeDiscreteFunctionSpace (const GridType & g, IndexSetType & iset, DofManagerType & dm , int level) :
DiscreteFunctionSpaceType (g,id, level) , dm_ ( dm ) , indexSet_ (iset) DiscreteFunctionSpaceType (g,id, level) , dm_ ( dm ) , indexSet_ (iset)
{ {
// add index set to list of indexset of dofmanager // add index set to list of indexset of dofmanager
......
...@@ -15,7 +15,7 @@ void Dune::MultiGridTransfer<DiscFuncType>::setup(const FunctionSpaceType& coars ...@@ -15,7 +15,7 @@ void Dune::MultiGridTransfer<DiscFuncType>::setup(const FunctionSpaceType& coars
DUNE_THROW(Exception, "The two function spaces don't belong to consecutive levels!"); DUNE_THROW(Exception, "The two function spaces don't belong to consecutive levels!");
typedef typename FunctionSpaceType::GridType GridType; typedef typename FunctionSpaceType::GridType GridType;
GridType& grid = coarseFSpace.getGrid(); const GridType& grid = coarseFSpace.getGrid();
if (&grid != &(fineFSpace.getGrid())) if (&grid != &(fineFSpace.getGrid()))
DUNE_THROW(Exception, "The two function spaces don't belong to the same grid!"); DUNE_THROW(Exception, "The two function spaces don't belong to the same grid!");
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment