Common subdirectories: grid/albertagrid and ../dune-grid-1.1/grid/albertagrid
Common subdirectories: grid/alugrid and ../dune-grid-1.1/grid/alugrid
diff -p --exclude=Makefile.am --exclude=Makefile.in grid/alugrid.hh ../dune-grid-1.1/grid/alugrid.hh
*** grid/alugrid.hh	Tue Dec  4 10:52:22 2007
--- ../dune-grid-1.1/grid/alugrid.hh	Wed Apr  9 01:01:09 2008
*************** namespace Dune { 
*** 39,45 ****
     \li Party Lib ( version 1.1 and higher, see http://wwwcs.upb.de/fachbereich/AG/monien/RESEARCH/PART/party.html)
  
     \li Available Implementations 
!         - Dune::ALUCubeGrid<3,3> 
  */
  template <int dim,int dimworld> class ALUCubeGrid {};
    
--- 39,47 ----
     \li Party Lib ( version 1.1 and higher, see http://wwwcs.upb.de/fachbereich/AG/monien/RESEARCH/PART/party.html)
  
     \li Available Implementations 
!         - Dune::ALUCubeGrid<3,3>
! 
!    For installation instructions see http://www.dune-project.org/doc/contrib-software.html#alugrid .
  */
  template <int dim,int dimworld> class ALUCubeGrid {};
    
*************** class ALUCubeGrid<3,3> : 
*** 210,215 ****
--- 212,218 ----
            - Dune::ALUSimplexGrid<3,3> 
            - Dune::ALUSimplexGrid<2,2>
  
+    For installation instructions see http://www.dune-project.org/doc/contrib-software.html#alugrid .
  */
  template <int dim,int dimworld> class ALUSimplexGrid {};
  
*************** class ALUSimplexGrid<2,2> : 
*** 314,320 ****
    //! \brief constructor for creating ALUSimplexGrid from given macro grid file
    //! \param macroName filename for macro grid in ALUGrid triangle format
    ALUSimplexGrid(const std::string macroName ) 
!     : BaseType(macroName, 1) 
    {
      std::cout << "\nCreated serial ALUSimplexGrid<"<<dim<<","<<dimworld;
      std::cout <<"> from macro grid file '" << macroName << "'. \n\n";     
--- 317,323 ----
    //! \brief constructor for creating ALUSimplexGrid from given macro grid file
    //! \param macroName filename for macro grid in ALUGrid triangle format
    ALUSimplexGrid(const std::string macroName ) 
!     : BaseType(macroName,1) 
    {
      std::cout << "\nCreated serial ALUSimplexGrid<"<<dim<<","<<dimworld;
      std::cout <<"> from macro grid file '" << macroName << "'. \n\n";     
*************** class ALUSimplexGrid<2,2> : 
*** 431,436 ****
--- 434,440 ----
     \li Available Implementations 
            - Dune::ALUConformGrid<2,2> 
  
+    For installation instructions see http://www.dune-project.org/doc/contrib-software.html#alugrid .
  */
  template <int dim, int dimworld>
  class ALUConformGrid {};
Common subdirectories: grid/common and ../dune-grid-1.1/grid/common
Common subdirectories: grid/io and ../dune-grid-1.1/grid/io
Common subdirectories: grid/onedgrid and ../dune-grid-1.1/grid/onedgrid
diff -p --exclude=Makefile.am --exclude=Makefile.in grid/onedgrid.hh ../dune-grid-1.1/grid/onedgrid.hh
*** grid/onedgrid.hh	Tue Dec  4 10:52:22 2007
--- ../dune-grid-1.1/grid/onedgrid.hh	Wed Apr  9 01:01:09 2008
*************** class OneDGrid : public GridDefaultImple
*** 213,226 ****
      template<int codim_, int dim_, class GridImp_, template<int,int,class> class EntityImp_>
      friend class Entity;
  
-     /** \brief The type used by to store coordinates */
-     typedef double OneDCType;
- 
      // **********************************************************
      // The Interface Methods
      // **********************************************************
  
  public:  
      /** \brief GridFamily of OneDGrid */
      typedef OneDGridFamily<dim,dimworld> GridFamily;
  
--- 213,232 ----
      template<int codim_, int dim_, class GridImp_, template<int,int,class> class EntityImp_>
      friend class Entity;
  
      // **********************************************************
      // The Interface Methods
      // **********************************************************
  
  public:  
+ 
+     /** \brief The type used to store coordinates
+ 
+     If you ever want OneDGrid to use a different type for coordinates,
+     you need to change this type and the third template argument of
+     the base class.
+     */
+     typedef double ctype;
+ 
      /** \brief GridFamily of OneDGrid */
      typedef OneDGridFamily<dim,dimworld> GridFamily;
  
*************** public:  
*** 228,237 ****
      typedef OneDGridFamily<dim,dimworld>::Traits Traits;
  
      /** \brief Constructor with an explicit set of coordinates */
!     OneDGrid(const std::vector<OneDCType>& coords);
  
      /** \brief Constructor for a uniform grid */
!     OneDGrid(int numElements, double leftBoundary, double rightBoundary);
  
      //! Destructor 
      ~OneDGrid();
--- 234,243 ----
      typedef OneDGridFamily<dim,dimworld>::Traits Traits;
  
      /** \brief Constructor with an explicit set of coordinates */
!     OneDGrid(const std::vector<ctype>& coords);
  
      /** \brief Constructor for a uniform grid */
!     OneDGrid(int numElements, const ctype& leftBoundary, const ctype& rightBoundary);
  
      //! Destructor 
      ~OneDGrid();
Common subdirectories: grid/sgrid and ../dune-grid-1.1/grid/sgrid
diff -p --exclude=Makefile.am --exclude=Makefile.in grid/sgrid.hh ../dune-grid-1.1/grid/sgrid.hh
*** grid/sgrid.hh	Tue Dec  4 10:52:22 2007
--- ../dune-grid-1.1/grid/sgrid.hh	Wed Apr  9 01:01:09 2008
*************** public:
*** 138,144 ****
  private:
          FieldVector<sgrid_ctype, cdim> s;         //!< position of element
          FieldMatrix<sgrid_ctype,mydim,cdim> A;     //!< direction vectors as matrix
!         FixedArray<FieldVector<sgrid_ctype, cdim>, 1<<mydim> c; //!< coordinate vectors of corners
          mutable FieldMatrix<sgrid_ctype,mydim,mydim> Jinv;       //!< storage for inverse of jacobian
          mutable bool builtinverse;
  };
--- 138,144 ----
  private:
          FieldVector<sgrid_ctype, cdim> s;         //!< position of element
          FieldMatrix<sgrid_ctype,mydim,cdim> A;     //!< direction vectors as matrix
!         array<FieldVector<sgrid_ctype, cdim>, 1<<mydim> c; //!< coordinate vectors of corners
          mutable FieldMatrix<sgrid_ctype,mydim,mydim> Jinv;       //!< storage for inverse of jacobian
          mutable bool builtinverse;
  };
*************** public:
*** 167,176 ****
          void make (FieldMatrix<sgrid_ctype,1,cdim>& __As);
  
          //! maps a local coordinate within reference element to global coordinate in element 
!         FieldVector<sgrid_ctype, 1> global (const FieldVector<sgrid_ctype, 0>& local) const { return this->operator[] (0); }
  
          //! maps a global coordinate within the element to a local coordinate in its reference element
!         FieldVector<sgrid_ctype, 0> local (const FieldVector<sgrid_ctype, 1>& global) const { return FieldVector<sgrid_ctype,0> (0.0); } 
  
          /*! Integration over a general element is done by integrating over the reference element
            and using the transformation from the reference element to the global element as follows:
--- 167,176 ----
          void make (FieldMatrix<sgrid_ctype,1,cdim>& __As);
  
          //! maps a local coordinate within reference element to global coordinate in element 
!         FieldVector<sgrid_ctype, cdim> global (const FieldVector<sgrid_ctype, 0>& local) const { return this->operator[] (0); }
  
          //! maps a global coordinate within the element to a local coordinate in its reference element
!         FieldVector<sgrid_ctype, 0> local (const FieldVector<sgrid_ctype, cdim>& global) const { return FieldVector<sgrid_ctype,0> (0.0); } 
  
          /*! Integration over a general element is done by integrating over the reference element
            and using the transformation from the reference element to the global element as follows:
*************** public:
*** 358,364 ****
  	  
  	  // this is a vertex which is not on the finest level
  	  // move coordinates up to maxlevel (multiply by 2 for each level
! 	  FixedArray<int,dim> coord;
  	  for (int k=0; k<dim; k++)
  		coord[k] = z[k]*(1<<(grid->maxLevel()-l));
  
--- 358,364 ----
  	  
  	  // this is a vertex which is not on the finest level
  	  // move coordinates up to maxlevel (multiply by 2 for each level
! 	  array<int,dim> coord;
  	  for (int k=0; k<dim; k++)
  		coord[k] = z[k]*(1<<(grid->maxLevel()-l));
  
*************** protected:
*** 371,377 ****
    GridImp* grid;         //!< grid containes mapper, geometry, etc.
    int l;                 //!< level where element is on
    int id;                //!< my consecutive id
!   FixedArray<int,dim> z; //!< my coordinate, number of even components = codim
    mutable MakeableGeometry geo; //!< geometry, is only built on demand
    mutable bool builtgeometry;   //!< true if geometry has been constructed
  };
--- 371,377 ----
    GridImp* grid;         //!< grid containes mapper, geometry, etc.
    int l;                 //!< level where element is on
    int id;                //!< my consecutive id
!   array<int,dim> z; //!< my coordinate, number of even components = codim
    mutable MakeableGeometry geo; //!< geometry, is only built on demand
    mutable bool builtgeometry;   //!< true if geometry has been constructed
  };
*************** public:
*** 430,438 ****
    of an element!
   */
  
- static FixedArray <int,2> zrefGlob;
- static FixedArray <int,2> zentityGlob;
- 
  /**
    A Grid is a container of grid entities. An entity is parametrized by
    the codimension.  An entity of codimension c in dimension d is a d-c
--- 430,435 ----
*************** class SEntity<0,dim,GridImp> : public SE
*** 449,454 ****
--- 446,452 ----
    enum { dimworld = GridImp::dimensionworld };
  public:
    typedef typename GridImp::template Codim<0>::Geometry Geometry;
+   typedef typename GridImp::template Codim<0>::LocalGeometry LocalGeometry;
    typedef SMakeableGeometry<dim, dimworld, const GridImp> MakeableGeometry;
    template <int cd>
    struct Codim
*************** public:
*** 552,558 ****
       on-the-fly implementation of numerical algorithms is only done for
       simple discretizations.  Assumes that meshes are nested.
    */
!   const Geometry& geometryInFather () const;
  
    /**
       @brief Inter-level access to son elements on higher levels<=maxLevel.
--- 550,556 ----
       on-the-fly implementation of numerical algorithms is only done for
       simple discretizations.  Assumes that meshes are nested.
    */
!   const LocalGeometry& geometryInFather () const;
  
    /**
       @brief Inter-level access to son elements on higher levels<=maxLevel.
*************** private:
*** 595,601 ****
  
    mutable bool built_father;
    mutable int father_id;
!   mutable MakeableGeometry in_father_local;
    void make_father() const;
  };
  
--- 593,599 ----
  
    mutable bool built_father;
    mutable int father_id;
!     mutable SMakeableGeometry<dim,dim,const GridImp> in_father_local;
    void make_father() const;
  };
  
*************** private:
*** 855,861 ****
    mutable EntityPointer ne;                     //!< EntityPointer for neighbor
    const GridImp * grid;                         //!< Pointer to the grid
    const int partition;                          //!< partition number of self, needed for coordinate expansion
!   const FixedArray<int,dim> zred;                 //!< reduced coordinates of myself, allows easy computation of neighbors
    mutable int count;                              //!< number of neighbor
    mutable bool valid_count;                       //!< true if count is in range
    mutable bool valid_nb;                          //!< true if nb is initialized
--- 853,859 ----
    mutable EntityPointer ne;                     //!< EntityPointer for neighbor
    const GridImp * grid;                         //!< Pointer to the grid
    const int partition;                          //!< partition number of self, needed for coordinate expansion
!   const array<int,dim> zred;                 //!< reduced coordinates of myself, allows easy computation of neighbors
    mutable int count;                              //!< number of neighbor
    mutable bool valid_count;                       //!< true if count is in range
    mutable bool valid_nb;                          //!< true if nb is initialized
*************** template<class GridImp>
*** 1035,1041 ****
  class SGridLeafIndexSet : public IndexSetDefaultImplementation<GridImp,SGridLeafIndexSet<GridImp>,SGridLeafIndexSetTypes<GridImp> >
  {
    typedef IndexSetDefaultImplementation<GridImp,SGridLeafIndexSet<GridImp>,SGridLeafIndexSetTypes<GridImp> > Base;
!     enum {dim = RemoveConst<GridImp>::Type::dimension};
  public:
  
    //! constructor stores reference to a grid and level
--- 1033,1039 ----
  class SGridLeafIndexSet : public IndexSetDefaultImplementation<GridImp,SGridLeafIndexSet<GridImp>,SGridLeafIndexSetTypes<GridImp> >
  {
    typedef IndexSetDefaultImplementation<GridImp,SGridLeafIndexSet<GridImp>,SGridLeafIndexSetTypes<GridImp> > Base;
!     enum {dim = remove_const<GridImp>::type::dimension};
  public:
  
    //! constructor stores reference to a grid and level
*************** public:
*** 1048,1069 ****
  
    //! get index of an entity
    /*
!     We use the RemoveConst to extract the Type from the mutable class,
      because the const class is not instantiated yet.
    */
    template<int cd>
!   int index (const typename RemoveConst<GridImp>::Type::Traits::template Codim<cd>::Entity& e) const 
    {
  	return grid.template getRealEntity<cd>(e).compressedLeafIndex(); 
    }
  
    //! get index of subentity of a codim 0 entity
    /*
!     We use the RemoveConst to extract the Type from the mutable class,
      because the const class is not instantiated yet.
    */
    template<int cc>
!   int subIndex (const typename RemoveConst<GridImp>::Type::Traits::template Codim<0>::Entity& e, int i) const
    {
  	return grid.template getRealEntity<0>(e).template subCompressedLeafIndex<cc>(i);
    }
--- 1046,1067 ----
  
    //! get index of an entity
    /*
!     We use the remove_const to extract the Type from the mutable class,
      because the const class is not instantiated yet.
    */
    template<int cd>
!   int index (const typename remove_const<GridImp>::type::Traits::template Codim<cd>::Entity& e) const 
    {
  	return grid.template getRealEntity<cd>(e).compressedLeafIndex(); 
    }
  
    //! get index of subentity of a codim 0 entity
    /*
!     We use the remove_const to extract the Type from the mutable class,
      because the const class is not instantiated yet.
    */
    template<int cc>
!   int subIndex (const typename remove_const<GridImp>::type::Traits::template Codim<0>::Entity& e, int i) const
    {
  	return grid.template getRealEntity<0>(e).template subCompressedLeafIndex<cc>(i);
    }
*************** private:
*** 1115,1155 ****
  
  template<class GridImp>
  class SGridGlobalIdSet :
!   public IdSetDefaultImplementation<GridImp,SGridGlobalIdSet<GridImp>, typename RemoveConst<GridImp>::Type::PersistentIndexType>
    /*
!     We used the RemoveConst to extract the Type from the mutable class,
      because the const class is not instantiated yet.
    */
  {
  public:
    //! define the type used for persisitent indices
    /*
!     We use the RemoveConst to extract the Type from the mutable class,
      because the const class is not instantiated yet.
    */
!   typedef typename RemoveConst<GridImp>::Type::PersistentIndexType IdType;
  
    //! constructor stores reference to a grid
    SGridGlobalIdSet (const GridImp& g) : grid(g) {}
  
    //! get id of an entity
    /*
!     We use the RemoveConst to extract the Type from the mutable class,
      because the const class is not instantiated yet.
    */
    template<int cd>
!   IdType id (const typename RemoveConst<GridImp>::Type::Traits::template Codim<cd>::Entity& e) const 
    {
  	  return grid.template getRealEntity<cd>(e).persistentIndex();
    }
  
    //! get id of subentity
    /*
!     We use the RemoveConst to extract the Type from the mutable class,
      because the const class is not instantiated yet.
    */
    template<int cc>
!   IdType subId (const typename RemoveConst<GridImp>::Type::Traits::template Codim<0>::Entity& e, int i) const
    {
    	return grid.template getRealEntity<0>(e).template subPersistentIndex<cc>(i);
    }
--- 1113,1153 ----
  
  template<class GridImp>
  class SGridGlobalIdSet :
!   public IdSetDefaultImplementation<GridImp,SGridGlobalIdSet<GridImp>, typename remove_const<GridImp>::type::PersistentIndexType>
    /*
!     We used the remove_const to extract the Type from the mutable class,
      because the const class is not instantiated yet.
    */
  {
  public:
    //! define the type used for persisitent indices
    /*
!     We use the remove_const to extract the Type from the mutable class,
      because the const class is not instantiated yet.
    */
!   typedef typename remove_const<GridImp>::type::PersistentIndexType IdType;
  
    //! constructor stores reference to a grid
    SGridGlobalIdSet (const GridImp& g) : grid(g) {}
  
    //! get id of an entity
    /*
!     We use the remove_const to extract the Type from the mutable class,
      because the const class is not instantiated yet.
    */
    template<int cd>
!   IdType id (const typename remove_const<GridImp>::type::Traits::template Codim<cd>::Entity& e) const 
    {
  	  return grid.template getRealEntity<cd>(e).persistentIndex();
    }
  
    //! get id of subentity
    /*
!     We use the remove_const to extract the Type from the mutable class,
      because the const class is not instantiated yet.
    */
    template<int cc>
!   IdType subId (const typename remove_const<GridImp>::type::Traits::template Codim<0>::Entity& e, int i) const
    {
    	return grid.template getRealEntity<0>(e).template subPersistentIndex<cc>(i);
    }
*************** struct SGridFamily
*** 1185,1194 ****
  //************************************************************************
  /**
   \brief [<em> provides \ref Dune::Grid </em>]
!  \brief A structured mesh in d dimensions consisting of "cubes" (pilot implementation of the Dune grid interface, for debugging only).
   \ingroup GridImplementations
  
!         This module describes the pilot implementation of the Dune grid interface.
          It implements the grid interface for simple structured meshes.
  
          \warning SGrid is slow. It is intended for debugging only.
--- 1183,1192 ----
  //************************************************************************
  /**
   \brief [<em> provides \ref Dune::Grid </em>]
!  \brief A structured mesh in d dimensions consisting of "cubes" (pilot implementation of the %Dune grid interface, for debugging only).
   \ingroup GridImplementations
  
!         This module describes the pilot implementation of the %Dune grid interface.
          It implements the grid interface for simple structured meshes.
  
          \warning SGrid is slow. It is intended for debugging only.
*************** struct SGridFamily
*** 1229,1238 ****
    The Grid is assumed to be hierachically refined and nested. It enables iteration over
    entities of a given level and codimension.
  
-   The grid can consist of several subdomains and it can be non-matching.
- 
    All information is provided to allocate degrees of freedom in appropriate vector
!   data structures (which are not part of this module).
   */
  template<int dim, int dimworld>
  class SGrid : public GridDefaultImplementation <dim,dimworld,sgrid_ctype,SGridFamily<dim,dimworld> >
--- 1227,1238 ----
    The Grid is assumed to be hierachically refined and nested. It enables iteration over
    entities of a given level and codimension.
  
    All information is provided to allocate degrees of freedom in appropriate vector
!   data structures.
! 
!   \note When SGrid is instantiated with dimworld strictly greater than dim, the result is a
!   dim-dimensional structured grid which is embedded in the first dim components of 
!   dimworld-dimensional Euclidean space.
   */
  template<int dim, int dimworld>
  class SGrid : public GridDefaultImplementation <dim,dimworld,sgrid_ctype,SGridFamily<dim,dimworld> >
*************** public:
*** 1403,1409 ****
    void globalRefine (int refCount);
  
      /** \brief Get number of elements in each coordinate direction */
!     const FixedArray<int, dim>& dims(int level) const {
          return N[level];
      }
  
--- 1403,1409 ----
    void globalRefine (int refCount);
  
      /** \brief Get number of elements in each coordinate direction */
!     const array<int, dim>& dims(int level) const {
          return N[level];
      }
  
*************** public:
*** 1426,1455 ****
    
  
    //! map expanded coordinates to position
!   FieldVector<sgrid_ctype, dim> pos (int level, FixedArray<int,dim>& z) const;
   
    //! compute codim from coordinate
!   int calc_codim (int level, const FixedArray<int,dim>& z) const;
  
    //! compute number from expanded coordinate
!   int n (int level, const FixedArray<int,dim> z) const;
  
    //! compute coordinates from number and codimension
!   FixedArray<int,dim> z (int level, int i, int codim) const;
          
    //! compress from expanded coordinates to grid for a single partition number
!   FixedArray<int,dim> compress (int level, const FixedArray<int,dim>& z) const; 
  
    //! expand with respect to partition number
!   FixedArray<int,dim> expand (int level, const FixedArray<int,dim>& r, int b) const; 
  
    /*! There are \f$2^d\f$ possibilities of having even/odd coordinates. 
          The binary representation is called partition number.
    */
!   int partition (int level, const FixedArray<int,dim>& z) const; 
  
    //! given reduced coordinates of an element, determine if element is in the grid
!   bool exists (int level, const FixedArray<int,dim>& zred) const;
  
  
    // The new index sets from DDM 11.07.2005
--- 1426,1455 ----
    
  
    //! map expanded coordinates to position
!   FieldVector<sgrid_ctype, dimworld> pos (int level, array<int,dim>& z) const;
   
    //! compute codim from coordinate
!   int calc_codim (int level, const array<int,dim>& z) const;
  
    //! compute number from expanded coordinate
!   int n (int level, const array<int,dim>& z) const;
  
    //! compute coordinates from number and codimension
!   array<int,dim> z (int level, int i, int codim) const;
          
    //! compress from expanded coordinates to grid for a single partition number
!   array<int,dim> compress (int level, const array<int,dim>& z) const; 
  
    //! expand with respect to partition number
!   array<int,dim> expand (int level, const array<int,dim>& r, int b) const; 
  
    /*! There are \f$2^d\f$ possibilities of having even/odd coordinates. 
          The binary representation is called partition number.
    */
!   int partition (int level, const array<int,dim>& z) const; 
  
    //! given reduced coordinates of an element, determine if element is in the grid
!   bool exists (int level, const array<int,dim>& zred) const;
  
  
    // The new index sets from DDM 11.07.2005
*************** private:
*** 1582,1594 ****
    int L;                          // number of levels in hierarchic mesh 0<=level<L
    FieldVector<sgrid_ctype, dim> low;     // lower left corner of the grid
    FieldVector<sgrid_ctype, dim> H;       // length of cube per direction
!   FixedArray<int,dim> *N;                // number of elements per direction
    FieldVector<sgrid_ctype, dim> *h;      // mesh size per direction
    mutable CubeMapper<dim> *mapper;       // a mapper for each level
    
    // faster implemantation od subIndex 
!   mutable FixedArray <int,dim> zrefStatic;     // for subIndex of SEntity
!   mutable FixedArray <int,dim> zentityStatic;  // for subIndex of SEntity
  };
  
  namespace Capabilities
--- 1582,1594 ----
    int L;                          // number of levels in hierarchic mesh 0<=level<L
    FieldVector<sgrid_ctype, dim> low;     // lower left corner of the grid
    FieldVector<sgrid_ctype, dim> H;       // length of cube per direction
!   array<int,dim> *N;                // number of elements per direction
    FieldVector<sgrid_ctype, dim> *h;      // mesh size per direction
    mutable CubeMapper<dim> *mapper;       // a mapper for each level
    
    // faster implemantation od subIndex 
!   mutable array <int,dim> zrefStatic;     // for subIndex of SEntity
!   mutable array <int,dim> zentityStatic;  // for subIndex of SEntity
  };
  
  namespace Capabilities
Common subdirectories: grid/test and ../dune-grid-1.1/grid/test
Common subdirectories: grid/uggrid and ../dune-grid-1.1/grid/uggrid
diff -p --exclude=Makefile.am --exclude=Makefile.in grid/uggrid.hh ../dune-grid-1.1/grid/uggrid.hh
*** grid/uggrid.hh	Tue Dec  4 10:52:22 2007
--- ../dune-grid-1.1/grid/uggrid.hh	Wed Apr  9 01:01:09 2008
***************
*** 8,15 ****
  #include <dune/grid/common/capabilities.hh>
  #include <dune/grid/common/grid.hh>
  #include <dune/grid/common/boundarysegment.hh>
- #include <dune/common/misc.hh>
  #include <dune/common/collectivecommunication.hh>
  
  /* The following lines including the necessary UG headers are somewhat
     tricky.  Here's what's happening:
--- 8,16 ----
  #include <dune/grid/common/capabilities.hh>
  #include <dune/grid/common/grid.hh>
  #include <dune/grid/common/boundarysegment.hh>
  #include <dune/common/collectivecommunication.hh>
+ #include <dune/common/deprecated.hh>
+ #include <dune/common/static_assert.hh>
  
  /* The following lines including the necessary UG headers are somewhat
     tricky.  Here's what's happening:
***************
*** 34,44 ****
  
  // Wrap a few large UG macros by functions before they get undef'ed away.
  // Here: The 2d-version of the macros
! #include "uggrid/ugwrapper2d.hh"
  
  // UG defines a whole load of preprocessor macros.  ug_undefs.hh undefines
  // them all, so we don't get name clashes.
  #include "uggrid/ug_undefs.hh"
  #undef _2
  
  /* Now we're done with 2d, and we can do the whole thing over again for 3d */
--- 35,51 ----
  
  // Wrap a few large UG macros by functions before they get undef'ed away.
  // Here: The 2d-version of the macros
! #define UG_DIM 2
! #include "uggrid/ugwrapper.hh"
! #undef UG_DIM
  
  // UG defines a whole load of preprocessor macros.  ug_undefs.hh undefines
  // them all, so we don't get name clashes.
+ #ifdef UG_LGMDOMAIN
+ #include "uggrid/ug_undefs_lgm_seq.hh"
+ #else
  #include "uggrid/ug_undefs.hh"
+ #endif
  #undef _2
  
  /* Now we're done with 2d, and we can do the whole thing over again for 3d */
***************
*** 61,70 ****
  
  // Wrap a few large UG macros by functions before they get undef'ed away.
  // This time it's the 3d-versions.
! #include "uggrid/ugwrapper3d.hh"
  
  // undef all macros defined by UG
  #include "uggrid/ug_undefs.hh"
  #undef _3
  #undef FOR_DUNE
  
--- 68,84 ----
  
  // Wrap a few large UG macros by functions before they get undef'ed away.
  // This time it's the 3d-versions.
! #define UG_DIM 3
! #include "uggrid/ugwrapper.hh"
! #undef UG_DIM
  
  // undef all macros defined by UG
+ #ifdef UG_LGMDOMAIN
+ #include "uggrid/ug_undefs_lgm_seq.hh"
+ #else
  #include "uggrid/ug_undefs.hh"
+ #endif
+ 
  #undef _3
  #undef FOR_DUNE
  
*************** struct UGGridFamily
*** 96,104 ****
                       UGGridLevelIndexSetTypes< const UGGrid<dim> >,
                       UGGridLeafIndexSet< const UGGrid<dim> >,
                       UGGridLeafIndexSetTypes< const UGGrid<dim> >,
!                      UGGridGlobalIdSet< const UGGrid<dim> >,
                       unsigned int,
!                      UGGridLocalIdSet< const UGGrid<dim> >,
                       unsigned int,
                       CollectiveCommunication<Dune::UGGrid<dim> > > 
    Traits;
--- 110,118 ----
                       UGGridLevelIndexSetTypes< const UGGrid<dim> >,
                       UGGridLeafIndexSet< const UGGrid<dim> >,
                       UGGridLeafIndexSetTypes< const UGGrid<dim> >,
!                      UGGridIdSet< const UGGrid<dim>, false >,
                       unsigned int,
!                      UGGridIdSet< const UGGrid<dim>, true >,
                       unsigned int,
                       CollectiveCommunication<Dune::UGGrid<dim> > > 
    Traits;
*************** struct UGGridFamily
*** 141,150 ****
  
    Please send any questions, suggestions, or bug reports to
    sander@math.fu-berlin.de
!  */
  template <int dim>
  class UGGrid : public GridDefaultImplementation  <dim, dim, double, UGGridFamily<dim,dim> >
  {
      friend class UGGridEntity <0,dim,const UGGrid<dim> >;
      friend class UGGridEntity <dim,dim,const UGGrid<dim> >;
      friend class UGGridHierarchicIterator<const UGGrid<dim> >;
--- 155,171 ----
  
    Please send any questions, suggestions, or bug reports to
    sander@math.fu-berlin.de
! 
!   For installation instructions see http://www.dune-project.org/doc/contrib-software.html#uggrid .
! */
  template <int dim>
  class UGGrid : public GridDefaultImplementation  <dim, dim, double, UGGridFamily<dim,dim> >
  {
+     friend class UGGridGeometry<0,dim,const UGGrid<dim> >;
+     friend class UGGridGeometry<dim,dim,const UGGrid<dim> >;
+     friend class UGGridGeometry<1,2,const UGGrid<dim> >;
+     friend class UGGridGeometry<2,3,const UGGrid<dim> >;
+ 
      friend class UGGridEntity <0,dim,const UGGrid<dim> >;
      friend class UGGridEntity <dim,dim,const UGGrid<dim> >;
      friend class UGGridHierarchicIterator<const UGGrid<dim> >;
*************** class UGGrid : public GridDefaultImpleme
*** 153,160 ****
  
      friend class UGGridLevelIndexSet<const UGGrid<dim> >;
      friend class UGGridLeafIndexSet<const UGGrid<dim> >;
!     friend class UGGridGlobalIdSet<const UGGrid<dim> >;
!     friend class UGGridLocalIdSet<const UGGrid<dim> >;
  
      template <int codim_, PartitionIteratorType PiType_, class GridImp_>
      friend class UGGridLeafIterator;
--- 174,181 ----
  
      friend class UGGridLevelIndexSet<const UGGrid<dim> >;
      friend class UGGridLeafIndexSet<const UGGrid<dim> >;
!     friend class UGGridIdSet<const UGGrid<dim>, false >;
!     friend class UGGridIdSet<const UGGrid<dim>, true >;
  
      template <int codim_, PartitionIteratorType PiType_, class GridImp_>
      friend class UGGridLeafIterator;
*************** class UGGrid : public GridDefaultImpleme
*** 162,169 ****
      friend class Entity;
  
      /** \brief UGGrid is only implemented for 2 and 3 dimension */
!     CompileTimeChecker< ((dim==2) || (dim==3)) >   Use_UGGrid_only_for_2d_and_3d;   
!     
      // The different instantiations are mutual friends so they can access
      // each others numOfUGGrids field
      friend class UGGrid<2>;
--- 183,190 ----
      friend class Entity;
  
      /** \brief UGGrid is only implemented for 2 and 3 dimension */
!     dune_static_assert(dim==2 || dim==3, "Use UGGrid only for 2d and 3d!");
! 
      // The different instantiations are mutual friends so they can access
      // each others numOfUGGrids field
      friend class UGGrid<2>;
*************** public:  
*** 179,199 ****
      typedef typename UGGridFamily<dim,dim>::Traits Traits;
  
      //! The type used to store coordinates
!     typedef double ctype;
  
      /** \brief Constructor with control over UG's memory requirements 
       *
       * \param heapSize The size of UG's internal memory in megabytes for this grid.
-      * \param envHeapSize The size of UG's environment heap, also in megabytes.  
       */
!     UGGrid(unsigned int heapSize, unsigned int envHeapSize);
!  
!     /** \brief Constructor with default memory settings
       *
!      * The default values are 500MB for the general heap and 10MB for
!      * the environment heap.
       */
!     UGGrid();
  
      //! Destructor 
      ~UGGrid();
--- 200,221 ----
      typedef typename UGGridFamily<dim,dim>::Traits Traits;
  
      //! The type used to store coordinates
!     typedef UG::DOUBLE ctype;
  
      /** \brief Constructor with control over UG's memory requirements 
       *
       * \param heapSize The size of UG's internal memory in megabytes for this grid.
       */
!     UGGrid(unsigned int heapSize=500);
! 
!      /** \brief Constructor with control over UG's memory requirements 
       *
!      * \param heapSize The size of UG's internal memory in megabytes for this grid.
!      * \param envHeapSize The size of UG's environment heap, also in megabytes.  
!      \deprecated This constructor will be removed in the next release, because
!      the second argument is not necessary anymore.
       */
!     UGGrid(unsigned int heapSize, unsigned int envHeapSize) DUNE_DEPRECATED;
  
      //! Destructor 
      ~UGGrid();
*************** public:  
*** 293,307 ****
      /** @name Grid Refinement Methods */
      /*@{*/
  
!         /** \brief Mark entity for refinement
!      *
!      * This only works for entities of codim 0.
!      * The parameter is currently ignored
!      *
!      * \return <ul>
!      * <li> true, if element was marked </li>
!      * <li> false, if nothing changed </li>
!      * </ul>
       */
      bool mark(int refCount, const typename Traits::template Codim<0>::EntityPointer & e );
  
--- 315,331 ----
      /** @name Grid Refinement Methods */
      /*@{*/
  
!     /** \brief Mark element for refinement
!         \param refCount <ul>
!         <li> 1: mark for red refinement </li>
!         <li> -1: mark for coarsening </li>
!         <li> 0: delete a possible refinement mark </li>
!         </ul>
!         \param e Element to be marked
!     \return <ul>
!         <li> true, if element was marked </li>
!         <li> false, if nothing changed </li>
!         </ul>
       */
      bool mark(int refCount, const typename Traits::template Codim<0>::EntityPointer & e );
  
*************** public:  
*** 413,418 ****
--- 437,447 ----
      /** \brief End the coarse grid creation process */
      void createEnd();
  
+     /** \brief When UGGrid has been configured to use the LGM domain manager,
+         this routine sets up a grid from an LGM and an NG file
+     */
+     void createLGMGrid(const std::string& name);
+ 
      /** \brief Method to insert an arbitrarily shaped boundary segment into a coarse grid
          \param vertices The indices of the vertices of the segment
          \param boundarySegment Class implementing the geometry of the boundary segment.
*************** public:  
*** 433,448 ****
      
      /*@}*/
  
-     /** \brief Adapt the grid without constructing the green closure
- 
-     WARNING: This is a very special method.  Omitting the green closure does
-     not mean that UG creates correct nonconforming meshes.  For internal
-     reasons (bugs?) though, it allows you to do uniform refinement with
-     a few anisotropic refinement rules such as UG::D3::PRISM_QUADSECT or
-     UG::D3::HEX_QUADSECT_0.
-     */
-     void adaptWithoutClosure();
- 
      /** \brief Rudimentary substitute for a hierarchic iterator on faces
          \param e, elementSide Grid face specified by an element and one of its sides
          \param maxl The finest level that should be traversed by the iterator
--- 462,467 ----
*************** public:  
*** 461,471 ****
--- 480,502 ----
          /** \brief New level consists of the refined elements and the unrefined ones, too */
          COPY};
  
+     /** \brief Decide whether to add a green closure to locally refined grid sections or not */
+     enum ClosureType {
+         /** \brief Standard red/green refinement */
+         GREEN,
+         /** \brief No closure, results in nonconforming meshes */
+         NONE};
+ 
      /** \brief Sets the type of grid refinement */
      void setRefinementType(RefinementType type) {
          refinementType_ = type;
      }
  
+     /** \brief Sets the type of grid refinement closure */
+     void setClosureType(ClosureType type) {
+         closureType_ = type;
+     }
+ 
      /** \brief Collapses the grid hierarchy into a single grid level*/
      void collapse() {
          if (Collapse(multigrid_))
*************** public:  
*** 480,491 ****
--- 511,530 ----
      void setPosition(typename Traits::template Codim<dim>::EntityPointer& e,
                       const FieldVector<double, dim>& pos);
  
+     /** \brief For a point on the grid boundary return its position on the domain boundary */
+     FieldVector<ctype,dim> getBoundaryPosition(const IntersectionIterator<const UGGrid<dim>, UGGridLevelIntersectionIterator>& iIt,
+                                                const FieldVector<ctype,dim-1>& localPos) const;
+ 
      /** \brief Does uniform refinement
       *
       * \param n Number of uniform refinement steps
       */
      void globalRefine(int n);
  
+     void saveState(const std::string& filename) const;
+ 
+     void loadState(const std::string& filename);
+ 
  private:
      /** \brief UG multigrid, which contains the actual grid hierarchy structure */
      typename UG_NS<dim>::MultiGrid* multigrid_;
*************** private:
*** 494,514 ****
      std::vector<const BoundarySegment<dim>*> boundarySegments_;
  
      /** \brief Buffer for the vertices of each explicitly given boundary segment */
!     std::vector<FixedArray<unsigned int, dim*2-2> > boundarySegmentVertices_;
  
    CollectiveCommunication<UGGrid> ccobj;
  
-     // Start up the UG system
-     void init(unsigned int heapSize, unsigned int envHeapSize);
- 
-     /** \brief Convenience method to insert a linear boundary segment into a UG coarse grid
-         \param vertices The indices of the vertices of the segment
-         \param coordinates The coordinates of the vertices of the segment
-     */
-     void insertLinearSegment(const std::vector<int>& vertices,
-                              const std::vector<FieldVector<double,dim> >& coordinates,
-                              unsigned int segmentIndex);
- 
      // Recomputes entity indices after the grid was changed
      void setIndices();
  
--- 533,542 ----
      std::vector<const BoundarySegment<dim>*> boundarySegments_;
  
      /** \brief Buffer for the vertices of each explicitly given boundary segment */
!     std::vector<array<unsigned int, dim*2-2> > boundarySegmentVertices_;
  
    CollectiveCommunication<UGGrid> ccobj;
  
      // Recomputes entity indices after the grid was changed
      void setIndices();
  
*************** private:
*** 521,540 ****
  
      UGGridLeafIndexSet<const UGGrid<dim> > leafIndexSet_;
  
!     UGGridGlobalIdSet<const UGGrid<dim> > globalIdSet_;
! 
!     UGGridLocalIdSet<const UGGrid<dim> > localIdSet_;
  
!     //! Marks whether the UG environment heap size is taken from
!     //! an existing defaults file or whether the values from
!     //! the UGGrid constructor are taken
!     static bool useExistingDefaultsFile;
  
      //! The type of grid refinement currently in use
      RefinementType refinementType_;
  
!     //! 
!     bool omitGreenClosure_;
  
      /** \brief While inserting the elements this array records the number of
          vertices of each element. */
--- 549,563 ----
  
      UGGridLeafIndexSet<const UGGrid<dim> > leafIndexSet_;
  
!     UGGridIdSet<const UGGrid<dim>, false > globalIdSet_;
  
!     UGGridIdSet<const UGGrid<dim>, true > localIdSet_;
  
      //! The type of grid refinement currently in use
      RefinementType refinementType_;
  
!     //! The type of grid refinement closure currently in use
!     ClosureType closureType_;
  
      /** \brief While inserting the elements this array records the number of
          vertices of each element. */
*************** private:
*** 559,565 ****
      /** \brief Remember whether some element has been marked for refinement
          ever since the last call to adapt().
  
!         This is here to implement the return value of adapt().
      */
      bool someElementHasBeenMarkedForRefinement_;
  
--- 582,588 ----
      /** \brief Remember whether some element has been marked for refinement
          ever since the last call to adapt().
  
!         This is here to implement the return value of preAdapt().
      */
      bool someElementHasBeenMarkedForRefinement_;
  
*************** namespace Capabilities
*** 610,616 ****
    template<int dim>
    struct isParallel< UGGrid<dim> >
    {
!     static const bool v = true;
    };
  
    /** \brief UGGrid is levelwise conforming
--- 633,643 ----
    template<int dim>
    struct isParallel< UGGrid<dim> >
    {
! #ifdef ModelP
!       static const bool v = true;
! #else
!       static const bool v = false;
! #endif
    };
  
    /** \brief UGGrid is levelwise conforming
*************** namespace Capabilities
*** 622,643 ****
      static const bool v = true;
    };
  
!   /** \brief UGGrid is leafwise conforming (by green closures)
    \ingroup UGGrid
    */
    template<int dim>
    struct isLeafwiseConforming< UGGrid<dim> >
    {
!     static const bool v = true;
    };
  
!   /** \brief UGGrid does not support hanging nodes
    \ingroup UGGrid
    */
    template<int dim>
    struct hasHangingNodes< UGGrid<dim> >
    {
!     static const bool v = false;
    };
    
  }
--- 649,670 ----
      static const bool v = true;
    };
  
!   /** \brief UGGrid may not be leafwise conforming
    \ingroup UGGrid
    */
    template<int dim>
    struct isLeafwiseConforming< UGGrid<dim> >
    {
!     static const bool v = false;
    };
  
!   /** \brief UGGrid does support hanging nodes
    \ingroup UGGrid
    */
    template<int dim>
    struct hasHangingNodes< UGGrid<dim> >
    {
!     static const bool v = true;
    };
    
  }
Common subdirectories: grid/utility and ../dune-grid-1.1/grid/utility
Common subdirectories: grid/yaspgrid and ../dune-grid-1.1/grid/yaspgrid
diff -p --exclude=Makefile.am --exclude=Makefile.in grid/yaspgrid.hh ../dune-grid-1.1/grid/yaspgrid.hh
*** grid/yaspgrid.hh	Tue Dec  4 10:52:22 2007
--- ../dune-grid-1.1/grid/yaspgrid.hh	Wed Apr  9 01:01:09 2008
***************
*** 10,18 ****
  #include <dune/grid/yaspgrid/grids.hh>  // the yaspgrid base classes
  #include <dune/common/stack.hh> // the stack class
  #include <dune/grid/common/capabilities.hh> // the capabilities
  #include <dune/common/helpertemplates.hh>
  #include <dune/common/bigunsignedint.hh>
- #include <dune/common/array.hh>
  #include <dune/common/typetraits.hh>
  #include <dune/common/collectivecommunication.hh>
  #include <dune/grid/common/indexidset.hh>
--- 10,18 ----
  #include <dune/grid/yaspgrid/grids.hh>  // the yaspgrid base classes
  #include <dune/common/stack.hh> // the stack class
  #include <dune/grid/common/capabilities.hh> // the capabilities
+ #include <dune/common/misc.hh>
  #include <dune/common/helpertemplates.hh>
  #include <dune/common/bigunsignedint.hh>
  #include <dune/common/typetraits.hh>
  #include <dune/common/collectivecommunication.hh>
  #include <dune/grid/common/indexidset.hh>
*************** public:
*** 107,112 ****
--- 107,115 ----
    YaspSpecialGeometry(const FieldVector<ctype, cdim>& p) :
      Geometry<0, cdim, GridImp, YaspGeometry>(YaspGeometry<0, cdim, GridImp>(p))
      {}
+   YaspSpecialGeometry(const FieldVector<ctype, cdim>& p, const FieldVector<ctype, cdim>& h, int& m) :
+     Geometry<0, cdim, GridImp, YaspGeometry>(YaspGeometry<0, cdim, GridImp>(p))
+     {}
    YaspSpecialGeometry() :
      Geometry<0, cdim, GridImp, YaspGeometry>(YaspGeometry<0, cdim, GridImp>(false))
      {};
*************** public:
*** 168,173 ****
--- 171,178 ----
    //! access to coordinates of corners. Index is the number of the corner
    const FieldVector<ctype, cdim>& operator[] (int i) const
    {
+         assert( i >= 0 && i < (int) coord_.N() ); 
+         FieldVector<ctype, cdim>& c = coord_[i];
          int bit=0;
          for (int k=0; k<cdim; k++) // run over all directions in world
            {
*************** public:
*** 217,230 ****
          return l;
    }
  
    /*! determinant of the jacobian of the mapping
     */
    ctype integrationElement (const FieldVector<ctype, mydim>& local) const
    {
!         ctype volume=1.0;
!         for (int k=0; k<cdim; k++)
!           if (k!=missing) volume *= extension[k];
!         return volume;
    }
  
    //! check whether local is inside reference element
--- 222,241 ----
          return l;
    }
  
+   //! return volume of geometry 
+   ctype volume () const
+   {
+     ctype volume=1.0;
+     for (int k=0; k<cdim; k++)
+       if (k!=missing) volume *= extension[k];
+     return volume;
+   }
+ 
    /*! determinant of the jacobian of the mapping
     */
    ctype integrationElement (const FieldVector<ctype, mydim>& local) const
    {
!     return volume();
    }
  
    //! check whether local is inside reference element
*************** private:
*** 270,276 ****
  
    // In addition we need memory in order to return references.
    // Possibly we should change this in the interface ...
!   mutable FieldVector<ctype, cdim> c;   // a point
  
    const YaspGeometry<mydim,cdim,GridImp>&
    operator = (const YaspGeometry<mydim,cdim,GridImp>& g);
--- 281,287 ----
  
    // In addition we need memory in order to return references.
    // Possibly we should change this in the interface ...
!   mutable FieldMatrix<ctype,  Power_m_p<2,mydim>::power, cdim> coord_;   // the coordinates 
  
    const YaspGeometry<mydim,cdim,GridImp>&
    operator = (const YaspGeometry<mydim,cdim,GridImp>& g);
*************** public:
*** 303,308 ****
--- 314,321 ----
    //! access to coordinates of corners. Index is the number of the corner
    const FieldVector<ctype, mydim>& operator[] (int i) const
    {
+         assert( i >= 0 && i < (int) coord_.N() ); 
+         FieldVector<ctype, mydim>& c = coord_[i];
          for (int k=0; k<mydim; k++)
            if (i&(1<<k))
                  c[k] = midpoint[k]+0.5*extension[k]; // kth bit is 1 in i
*************** private:
*** 394,409 ****
    // In addition we need memory in order to return references.
    // Possibly we should change this in the interface ...
    mutable FieldMatrix<ctype,mydim,mydim> Jinv;   // the jacobian inverse
!   mutable FieldVector<ctype, mydim> c;   // a point
  
    // disable copy
    const YaspGeometry<mydim,mydim,GridImp>&
    operator = (const YaspGeometry<mydim,mydim,GridImp>& g);
  };
  
- 
- 
- 
  //! specialization for dim=0, this is a vertex
  template<int cdim, class GridImp>
  class YaspGeometry<0,cdim,GridImp> : public GeometryDefaultImplementation<0,cdim,GridImp,YaspGeometry>
--- 407,419 ----
    // In addition we need memory in order to return references.
    // Possibly we should change this in the interface ...
    mutable FieldMatrix<ctype,mydim,mydim> Jinv;   // the jacobian inverse
!   mutable FieldMatrix<ctype,  Power_m_p<2,mydim>::power, mydim> coord_;   // the coordinates 
  
    // disable copy
    const YaspGeometry<mydim,mydim,GridImp>&
    operator = (const YaspGeometry<mydim,mydim,GridImp>& g);
  };
  
  //! specialization for dim=0, this is a vertex
  template<int cdim, class GridImp>
  class YaspGeometry<0,cdim,GridImp> : public GeometryDefaultImplementation<0,cdim,GridImp,YaspGeometry>
*************** public:
*** 429,434 ****
--- 439,451 ----
          return position;
    }
  
+   /*! determinant of the jacobian of the mapping
+    */
+   ctype integrationElement (const FieldVector<ctype, 0>& local) const
+   {
+         return 1.0;
+   }
+ 
    //! constructor
    YaspGeometry (const FieldVector<ctype, cdim>& p) : position(p)
    {}
*************** private:
*** 1149,1155 ****
  };
  
  
! // specialization for codim=dim
  template<int dim, class GridImp>
  class YaspEntity<dim,dim,GridImp> 
  : public EntityDefaultImplementation <dim,dim,GridImp,YaspEntity>
--- 1166,1172 ----
  };
  
  
! // specialization for codim=dim (vertex)
  template<int dim, class GridImp>
  class YaspEntity<dim,dim,GridImp> 
  : public EntityDefaultImplementation <dim,dim,GridImp,YaspEntity>
*************** public:
*** 1944,1954 ****
  
    //! get index of an entity
    /*
!     We use the RemoveConst to extract the Type from the mutable class,
      because the const class is not instantiated yet.
    */
    template<int cd>
!   int index (const typename RemoveConst<GridImp>::Type::Traits::template Codim<cd>::Entity& e) const 
    {
      assert(cd==0 || cd==GridImp::dimension);
      return grid.template getRealEntity<cd>(e).compressedLeafIndex(); 
--- 1961,1971 ----
  
    //! get index of an entity
    /*
!     We use the remove_const to extract the Type from the mutable class,
      because the const class is not instantiated yet.
    */
    template<int cd>
!   int index (const typename remove_const<GridImp>::type::Traits::template Codim<cd>::Entity& e) const 
    {
      assert(cd==0 || cd==GridImp::dimension);
      return grid.template getRealEntity<cd>(e).compressedLeafIndex(); 
*************** public:
*** 1956,1966 ****
  
    //! get index of subentity of a codim 0 entity
    /*
!     We use the RemoveConst to extract the Type from the mutable class,
      because the const class is not instantiated yet.
    */
    template<int cc>
!   int subIndex (const typename RemoveConst<GridImp>::Type::Traits::template Codim<0>::Entity& e, int i) const
    {
      return grid.template getRealEntity<0>(e).template subCompressedLeafIndex<cc>(i);
    }
--- 1973,1983 ----
  
    //! get index of subentity of a codim 0 entity
    /*
!     We use the remove_const to extract the Type from the mutable class,
      because the const class is not instantiated yet.
    */
    template<int cc>
!   int subIndex (const typename remove_const<GridImp>::type::Traits::template Codim<0>::Entity& e, int i) const
    {
      return grid.template getRealEntity<0>(e).template subCompressedLeafIndex<cc>(i);
    }
*************** public:
*** 1999,2005 ****
  
  private:
    const GridImp& grid;
!   enum { ncodim = RemoveConst<GridImp>::Type::dimension+1 };
    std::vector<GeometryType> mytypes[ncodim];
  };
  
--- 2016,2022 ----
  
  private:
    const GridImp& grid;
!   enum { ncodim = remove_const<GridImp>::type::dimension+1 };
    std::vector<GeometryType> mytypes[ncodim];
  };
  
*************** private:
*** 2015,2051 ****
  
  template<class GridImp>
  class YaspGlobalIdSet : public IdSetDefaultImplementation<GridImp,YaspGlobalIdSet<GridImp>,
!                                      typename RemoveConst<GridImp>::Type::PersistentIndexType >
  /*
!   We used the RemoveConst to extract the Type from the mutable class,
    because the const class is not instantiated yet.
  */
  {
  public:
    //! define the type used for persisitent indices
!   typedef typename RemoveConst<GridImp>::Type::PersistentIndexType IdType;
  
    //! constructor stores reference to a grid
    YaspGlobalIdSet (const GridImp& g) : grid(g) {}
  
    //! get id of an entity
    /*
!     We use the RemoveConst to extract the Type from the mutable class,
      because the const class is not instantiated yet.
    */
    template<int cd>
!   IdType id (const typename RemoveConst<GridImp>::Type::Traits::template Codim<cd>::Entity& e) const 
    {
      return grid.template getRealEntity<cd>(e).persistentIndex();
    }
  
    //! get id of subentity
    /*
!     We use the RemoveConst to extract the Type from the mutable class,
      because the const class is not instantiated yet.
    */
    template<int cc>
!   IdType subId (const typename RemoveConst<GridImp>::Type::Traits::template Codim<0>::Entity& e, int i) const
    {
      return grid.template getRealEntity<0>(e).template subPersistentIndex<cc>(i);
    }
--- 2032,2068 ----
  
  template<class GridImp>
  class YaspGlobalIdSet : public IdSetDefaultImplementation<GridImp,YaspGlobalIdSet<GridImp>,
!                                      typename remove_const<GridImp>::type::PersistentIndexType >
  /*
!   We used the remove_const to extract the Type from the mutable class,
    because the const class is not instantiated yet.
  */
  {
  public:
    //! define the type used for persisitent indices
!   typedef typename remove_const<GridImp>::type::PersistentIndexType IdType;
  
    //! constructor stores reference to a grid
    YaspGlobalIdSet (const GridImp& g) : grid(g) {}
  
    //! get id of an entity
    /*
!     We use the remove_const to extract the Type from the mutable class,
      because the const class is not instantiated yet.
    */
    template<int cd>
!   IdType id (const typename remove_const<GridImp>::type::Traits::template Codim<cd>::Entity& e) const 
    {
      return grid.template getRealEntity<cd>(e).persistentIndex();
    }
  
    //! get id of subentity
    /*
!     We use the remove_const to extract the Type from the mutable class,
      because the const class is not instantiated yet.
    */
    template<int cc>
!   IdType subId (const typename remove_const<GridImp>::type::Traits::template Codim<0>::Entity& e, int i) const
    {
      return grid.template getRealEntity<0>(e).template subPersistentIndex<cc>(i);
    }
*************** public:
*** 2190,2197 ****
    private:
    // do not copy this class 
    YaspGrid(const YaspGrid&);
!   
    public:
    /*! Return maximum level defined in this grid. Levels are numbered
          0 ... maxlevel with 0 the coarsest level.
    */
--- 2207,2215 ----
    private:
    // do not copy this class 
    YaspGrid(const YaspGrid&);
! 
    public:
+   
    /*! Return maximum level defined in this grid. Levels are numbered
          0 ... maxlevel with 0 the coarsest level.
    */
*************** public:
*** 2743,2748 ****
--- 2761,2767 ----
  
    const typename Traits::LevelIndexSet& levelIndexSet(int level) const
    {
+     if (level<0 || level>maxLevel()) DUNE_THROW(RangeError, "level out of range");
      return *(indexsets[level]);
    }
  
*************** private:
*** 2837,2843 ****
      template<class Y>
      void write (const Y& data)
      {
!       IsTrue< ( SameType<DT,Y>::value ) >::yes();
        a[i++] = data;
      }
      
--- 2856,2862 ----
      template<class Y>
      void write (const Y& data)
      {
!       IsTrue< ( is_same<DT,Y>::value ) >::yes();
        a[i++] = data;
      }
      
*************** private:
*** 2845,2851 ****
      template<class Y>
      void read (Y& data) const 
      {
!       IsTrue< ( SameType<DT,Y>::value ) >::yes();
        data = a[j++];
      }
  
--- 2864,2870 ----
      template<class Y>
      void read (Y& data) const 
      {
!       IsTrue< ( is_same<DT,Y>::value ) >::yes();
        data = a[j++];
      }
  
