[Dune] [Dune-Commit] dune-grid r7402 - in trunk/dune/grid: geometrygrid io/file/dgfparser utility

Martin Nolte nolte at mathematik.uni-freiburg.de
Thu Feb 10 17:20:59 CET 2011


Hi Oli,

there are a lot of (fast) std::allocators and this way all of them are
supported. If we, for example, hardwire the allocator to PoolAllocator, then
you cannot use a threadsafe pool allocator implementation (which I was told to
exist somewhere in boost).

Somehow, I don't understand your problem, anyway. GeometryGrid can still be
instantiated with only 2 template arguments and I guess the default
(std::allocator) is absolutely ok for you (since you don't care for
performance anyway). Moreover, I would like to keep the SmallObjectAllocator
around in my own code. Hence, if I want to use this one with GeometryGrid, I
need a way to specify this and the simplest choice is a template argument. The
preprocessor is not really an option, is it?

To elaborate the problem with the PoolAllocator a little further: As far as I
understand it, the problem is not the PoolAllocator, but the template
instantiation order. The Geometry gets a template argument Grid, which is yet
incomplete. Under normal circumstances this magically works. For gcc-4.4 and
GeometryGrid with PoolAllocator it does not. Don't ask me why; I never liked
this chicken - egg problem.

Best,

Martin

On 02/10/2011 03:27 PM, Oliver Sander wrote:
> Hi Martin!
> I wonder whether it is necessary to make the allocator a parameter
> of GeometryGrid.  I would imagine that there is a single way to
> optimally implement the memory management of GeometryGrid,
> and that you will never have to change it.  Or am I wrong?  Do you
> have a use case where exchanging the memory management in
> GeometryGrid makes sense?
> 
> If the pool allocator doesn't work with this, but std::allocator does,
> then supposedly it's a bug in the poolallocator?  Have you tried
> the poolallocator from boost?
> 
> best,
> Oliver
> 
> Am 10.02.2011 11:38, schrieb mnolte at dune-project.org:
>> Author: mnolte
>> Date: 2011-02-10 11:38:14 +0100 (Thu, 10 Feb 2011)
>> New Revision: 7402
>>
>> Modified:
>>     trunk/dune/grid/geometrygrid/cachedcoordfunction.hh
>>     trunk/dune/grid/geometrygrid/capabilities.hh
>>     trunk/dune/grid/geometrygrid/entity.hh
>>     trunk/dune/grid/geometrygrid/entitypointer.hh
>>     trunk/dune/grid/geometrygrid/grid.hh
>>     trunk/dune/grid/geometrygrid/indexsets.hh
>>     trunk/dune/grid/geometrygrid/intersection.hh
>>     trunk/dune/grid/geometrygrid/iterator.hh
>>     trunk/dune/grid/geometrygrid/persistentcontainer.hh
>>     trunk/dune/grid/io/file/dgfparser/dgfgeogrid.hh
>>     trunk/dune/grid/utility/hostgridaccess.hh
>> Log:
>> use a std::allocator to allocate memory for the entity.
>>
>> Somehow this does not work with the pool allocator due to GeometryGrid being
>> an incomplete type in the entity.
>> It works with std::allocator and SmallObjectAllocator, though.
>>
>>
>> Modified: trunk/dune/grid/geometrygrid/cachedcoordfunction.hh
>> ===================================================================
>> --- trunk/dune/grid/geometrygrid/cachedcoordfunction.hh    2011-02-10
>> 09:19:50 UTC (rev 7401)
>> +++ trunk/dune/grid/geometrygrid/cachedcoordfunction.hh    2011-02-10
>> 10:38:14 UTC (rev 7402)
>> @@ -20,6 +20,8 @@
>>     template<  class HostGrid, class CoordFunction>
>>     class CachedCoordFunction;
>>
>> +
>> +
>>     // GeoGrid::CoordCache
>>     // -------------------
>>
>>
>> Modified: trunk/dune/grid/geometrygrid/capabilities.hh
>> ===================================================================
>> --- trunk/dune/grid/geometrygrid/capabilities.hh    2011-02-10 09:19:50 UTC
>> (rev 7401)
>> +++ trunk/dune/grid/geometrygrid/capabilities.hh    2011-02-10 10:38:14 UTC
>> (rev 7402)
>> @@ -13,7 +13,7 @@
>>     // External Forward Declarations
>>     // -----------------------------
>>
>> -  template<  class HostGrid, class CoordFunction>
>> +  template<  class HostGrid, class CoordFunction, class Allocator>
>>     class GeometryGrid;
>>
>>
>> @@ -27,61 +27,61 @@
>>       // Capabilities from dune-grid
>>       // ---------------------------
>>
>> -    template<  class HostGrid, class CoordFunction>
>> -    struct hasSingleGeometryType<  GeometryGrid<  HostGrid, CoordFunction>  >
>> +    template<  class HostGrid, class CoordFunction, class Allocator>
>> +    struct hasSingleGeometryType<  GeometryGrid<  HostGrid, CoordFunction,
>> Allocator>  >
>>       {
>>         static const bool v = hasSingleGeometryType<  HostGrid>  :: v;
>>         static const unsigned int topologyId = hasSingleGeometryType< 
>> HostGrid>  :: topologyId;
>>       };
>>
>>
>> -    template<  class HostGrid, class CoordFunction, int codim>
>> -    struct hasEntity<  GeometryGrid<  HostGrid, CoordFunction>, codim>
>> +    template<  class HostGrid, class CoordFunction, class Allocator, int
>> codim>
>> +    struct hasEntity<  GeometryGrid<  HostGrid, CoordFunction, Allocator>,
>> codim>
>>       {
>>         static const bool v = true;
>>       };
>>
>>
>> -    template<  class HostGrid, class CoordFunction>
>> -    struct isParallel<  GeometryGrid<  HostGrid, CoordFunction>  >
>> +    template<  class HostGrid, class CoordFunction, class Allocator>
>> +    struct isParallel<  GeometryGrid<  HostGrid, CoordFunction, Allocator>  >
>>       {
>>         static const bool v = isParallel<  HostGrid>::v;
>>       };
>>
>>
>> -    template<  class HostGrid, class CoordFunction, int codim>
>> -    struct canCommunicate<  GeometryGrid<  HostGrid, CoordFunction>, codim>
>> +    template<  class HostGrid, class CoordFunction, class Allocator, int
>> codim>
>> +    struct canCommunicate<  GeometryGrid<  HostGrid, CoordFunction,
>> Allocator>, codim>
>>       {
>>         static const bool v = canCommunicate<  HostGrid, codim>::v;
>>       };
>>
>>
>> -    template<  class HostGrid, class CoordFunction>
>> -    struct hasBackupRestoreFacilities<  GeometryGrid<  HostGrid,
>> CoordFunction>  >
>> +    template<  class HostGrid, class CoordFunction, class Allocator>
>> +    struct hasBackupRestoreFacilities<  GeometryGrid<  HostGrid,
>> CoordFunction, Allocator>  >
>>       {
>>         static const bool v = hasBackupRestoreFacilities<  HostGrid>::v;
>>       };
>>
>> -    template<  class HostGrid, class CoordFunction>
>> -    struct isLevelwiseConforming<  GeometryGrid<  HostGrid, CoordFunction>  >
>> +    template<  class HostGrid, class CoordFunction, class Allocator>
>> +    struct isLevelwiseConforming<  GeometryGrid<  HostGrid, CoordFunction,
>> Allocator>  >
>>       {
>>         static const bool v = isLevelwiseConforming<  HostGrid>::v;
>>       };
>>
>> -    template<  class HostGrid, class CoordFunction>
>> -    struct isLeafwiseConforming<  GeometryGrid<  HostGrid, CoordFunction>  >
>> +    template<  class HostGrid, class CoordFunction, class Allocator>
>> +    struct isLeafwiseConforming<  GeometryGrid<  HostGrid, CoordFunction,
>> Allocator>  >
>>       {
>>         static const bool v = isLeafwiseConforming<  HostGrid>::v;
>>       };
>>
>> -    template<  class HostGrid, class CoordFunction>
>> -    struct threadSafe<  GeometryGrid<  HostGrid, CoordFunction>  >
>> +    template<  class HostGrid, class CoordFunction, class Allocator>
>> +    struct threadSafe<  GeometryGrid<  HostGrid, CoordFunction, Allocator>  >
>>       {
>>         static const bool v = false;
>>       };
>>
>> -    template<  class HostGrid, class CoordFunction>
>> -    struct viewThreadSafe<  GeometryGrid<  HostGrid, CoordFunction>  >
>> +    template<  class HostGrid, class CoordFunction, class Allocator>
>> +    struct viewThreadSafe<  GeometryGrid<  HostGrid, CoordFunction,
>> Allocator>  >
>>       {
>>         static const bool v = false;
>>       };
>> @@ -101,8 +101,8 @@
>>         static const bool v = hasHostEntity<  Grid, codim>::v;
>>       };
>>
>> -    template<  class HostGrid, class CoordFunction, int codim>
>> -    struct hasHostEntity<  GeometryGrid<  HostGrid, CoordFunction>, codim>
>> +    template<  class HostGrid, class CoordFunction, class Allocator, int
>> codim>
>> +    struct hasHostEntity<  GeometryGrid<  HostGrid, CoordFunction,
>> Allocator>, codim>
>>       {
>>         static const bool v = hasEntity<  HostGrid, codim>::v;
>>       };
>>
>> Modified: trunk/dune/grid/geometrygrid/entity.hh
>> ===================================================================
>> --- trunk/dune/grid/geometrygrid/entity.hh    2011-02-10 09:19:50 UTC (rev
>> 7401)
>> +++ trunk/dune/grid/geometrygrid/entity.hh    2011-02-10 10:38:14 UTC (rev
>> 7402)
>> @@ -117,7 +117,7 @@
>>         typedef typename HostGrid::template Codim< 
>> codimension>::EntityPointer HostEntityPointer;
>>
>>         //! type of corresponding entity seed
>> -      typedef typename Grid::template Codim<  codimension>::EntitySeed 
>> EntitySeed;
>> +      typedef typename Traits::template Codim<  codimension>::EntitySeed
>> EntitySeed;
>>
>>         //! type of host elements, i.e., of host entities of codimension 0
>>         typedef typename HostGrid::template Codim<  0>::Entity HostElement;
>> @@ -355,7 +355,7 @@
>>         typedef typename HostGrid::template Codim< 
>> codimension>::EntityPointer HostEntityPointer;
>>
>>         //! type of corresponding entity seed
>> -      typedef typename Grid::template Codim<  codimension>::EntitySeed 
>> EntitySeed;
>> +      typedef typename Traits::template Codim<  codimension>::EntitySeed
>> EntitySeed;
>>
>>         //! type of host elements, i.e., of host entities of codimension 0
>>         typedef typename HostGrid::template Codim<  0>::Entity HostElement;
>>
>> Modified: trunk/dune/grid/geometrygrid/entitypointer.hh
>> ===================================================================
>> --- trunk/dune/grid/geometrygrid/entitypointer.hh    2011-02-10 09:19:50 UTC
>> (rev 7401)
>> +++ trunk/dune/grid/geometrygrid/entitypointer.hh    2011-02-10 10:38:14 UTC
>> (rev 7402)
>> @@ -12,7 +12,7 @@
>>     // External Forward Declarations
>>     // -----------------------------
>>
>> -  template<  class HostGrid, class CordFunction>
>> +  template<  class HostGrid, class CoordFunction, class Allocator>
>>     class GeometryGrid;
>>
>>
>> @@ -56,11 +56,11 @@
>>       {};
>>       /** \endcond */
>>
>> -    template<  int codim, class HostGrid, class CoordFunction>
>> -    struct EntityPointerTraits<  codim, GeometryGrid<  HostGrid,
>> CoordFunction>  >
>> +    template<  int codim, class HostGrid, class CoordFunction, class
>> Allocator>
>> +    struct EntityPointerTraits<  codim, GeometryGrid<  HostGrid,
>> CoordFunction, Allocator>  >
>>       : public ExportParams<  HostGrid, CoordFunction>
>>       {
>> -      typedef Dune::GeometryGrid<  HostGrid, CoordFunction>  Grid;
>> +      typedef Dune::GeometryGrid<  HostGrid, CoordFunction, Allocator>  Grid;
>>
>>         static const bool fake = !Capabilities::hasHostEntity<  Grid,
>> codim>::v;
>>
>> @@ -157,7 +157,7 @@
>>         ~EntityPointer ()
>>         {
>>           if( entity_ )
>> -          delete( entity_ );
>> +          entityAllocator().deallocate( entity_ );
>>         }
>>
>>         This&operator= ( const This&other )
>> @@ -181,8 +181,8 @@
>>
>>         Entity&dereference () const
>>         {
>> -        if( entity_ == 0 )
>> -          entity_ = new  MakeableEntity( EntityImpl( grid(),
>> *hostIterator() ) ) ;
>> +        if( !entity_ )
>> +          entity_ = entityAllocator().allocate( EntityImpl( grid(),
>> *hostIterator() ) );
>>           return *entity_;
>>         }
>>
>> @@ -212,11 +212,17 @@
>>         {
>>           if( entity_ )
>>           {
>> -          delete entity_ ;
>> +          entityAllocator().deallocate( entity_ );
>>             entity_ = 0;
>>           }
>>         }
>>
>> +      typename Grid::Traits::template EntityAllocator<  codimension>  &
>> +      entityAllocator () const
>> +      {
>> +        return grid().template entityAllocator<  codimension>();
>> +      }
>> +
>>       private:
>>         const Grid *grid_;
>>         mutable MakeableEntity *entity_;
>> @@ -262,8 +268,7 @@
>>         typedef typename MakeableEntity::ImplementationType EntityImpl;
>>
>>       public:
>> -      EntityPointer ( const Grid&grid,
>> -                      const HostElementIterator&hostElementIterator, int
>> subEntity )
>> +      EntityPointer ( const Grid&grid, const
>> HostElementIterator&hostElementIterator, int subEntity )
>>         : grid_(&grid ),
>>           entity_( 0 ),
>>           subEntity_( subEntity ),
>> @@ -309,7 +314,7 @@
>>         ~EntityPointer ()
>>         {
>>           if( entity_ )
>> -          delete entity_;
>> +          entityAllocator().deallocate( entity_ );
>>         }
>>
>>         This&operator= ( const This&other )
>> @@ -358,8 +363,8 @@
>>
>>         Entity&dereference () const
>>         {
>> -        if( entity_ == 0 )
>> -          entity_ = new MakeableEntity( EntityImpl( grid(),
>> *hostElementIterator(), subEntity_ ) );
>> +        if( !entity_ )
>> +          entity_ = entityAllocator().allocate( EntityImpl( grid(),
>> *hostElementIterator(), subEntity_ ) );
>>           return *entity_;
>>         }
>>
>> @@ -384,7 +389,7 @@
>>         {
>>           if( entity_ )
>>           {
>> -          delete entity_;
>> +          entityAllocator().deallocate( entity_ );
>>             entity_ = 0;
>>           }
>>         }
>> @@ -394,6 +399,12 @@
>>           return hostElementIterator_;
>>         }
>>
>> +      typename Grid::Traits::template EntityAllocator<  codimension>  &
>> +      entityAllocator () const
>> +      {
>> +        return grid().template entityAllocator<  codimension>();
>> +      }
>> +
>>       private:
>>         const Grid *grid_;
>>         mutable MakeableEntity *entity_;
>>
>> Modified: trunk/dune/grid/geometrygrid/grid.hh
>> ===================================================================
>> --- trunk/dune/grid/geometrygrid/grid.hh    2011-02-10 09:19:50 UTC (rev 7401)
>> +++ trunk/dune/grid/geometrygrid/grid.hh    2011-02-10 10:38:14 UTC (rev 7402)
>> @@ -7,6 +7,8 @@
>>
>>   #include<dune/grid/common/grid.hh>
>>
>> +#include<dune/grid/genericgeometry/codimtable.hh>
>> +
>>   #include<dune/grid/geometrygrid/capabilities.hh>
>>   #include<dune/grid/geometrygrid/entity.hh>
>>   #include<dune/grid/geometrygrid/entityseed.hh>
>> @@ -29,7 +31,7 @@
>>     template<  class HostGrid>
>>     class DefaultCoordFunction;
>>
>> -  template<  class HostGrid, class CoordFunction = DefaultCoordFunction< 
>> HostGrid>  >
>> +  template<  class HostGrid, class CoordFunction = DefaultCoordFunction< 
>> HostGrid>, class Allocator = std::allocator<  void>  >
>>     class GeometryGrid;
>>
>>
>> @@ -50,11 +52,11 @@
>>     namespace GenericGeometry
>>     {
>>
>> -    template<  class HostGrid, class CoordFunction>
>> -    struct GlobalGeometryTraits<  GeometryGrid<  HostGrid, CoordFunction>  >
>> +    template<  class HostGrid, class CoordFunction, class Allocator>
>> +    struct GlobalGeometryTraits<  GeometryGrid<  HostGrid, CoordFunction,
>> Allocator>  >
>>       : public DefaultGeometryTraits<  typename HostGrid::ctype,
>> HostGrid::dimension, CoordFunction::dimRange>
>>       {
>> -      typedef GeometryGrid<  HostGrid, CoordFunction>  Grid;
>> +      typedef GeometryGrid<  HostGrid, CoordFunction, Allocator>  Grid;
>>
>>         typedef DuneCoordTraits<  typename HostGrid::ctype>  CoordTraits;
>>
>> @@ -88,10 +90,9 @@
>>           static const EvaluationType evaluateIntegrationElement =
>> ComputeOnDemand;
>>           static const EvaluationType evaluateNormal = ComputeOnDemand;
>>         };
>> -
>>       };
>>
>> -  }
>> +  } // namespace GenericGeometry
>>
>>
>>
>> @@ -117,16 +118,44 @@
>>
>>
>>
>> +    // EntityAllocator
>> +    // ---------------
>> +
>> +    template<  class Entity, class Allocator>
>> +    struct EntityAllocator
>> +    {
>> +      typedef MakeableInterfaceObject<  Entity>  MakeableEntity;
>> +
>> +      template<  class EntityImpl>
>> +      MakeableEntity *allocate ( const EntityImpl&entityImpl )
>> +      {
>> +        MakeableEntity *entity = allocator_.allocate( 1 );
>> +        allocator_.construct( entity, MakeableEntity( entityImpl ) );
>> +        return entity;
>> +      }
>> +
>> +      void deallocate ( MakeableEntity *entity )
>> +      {
>> +        allocator_.destroy( entity );
>> +        allocator_.deallocate( entity, 1 );
>> +      }
>> +
>> +    private:
>> +      typename Allocator::template rebind<  MakeableEntity>::other allocator_;
>> +    };
>> +
>> +
>> +
>>       // GridFamily
>>       // ----------
>>
>> -    template<  class HostGrid, class CoordFunction>
>> +    template<  class HostGrid, class CoordFunction, class Allocator>
>>       struct GridFamily
>>       {
>>         struct Traits
>>         : public ExportParams<  HostGrid, CoordFunction>
>>         {
>> -        typedef GeometryGrid<  HostGrid, CoordFunction>  Grid;
>> +        typedef GeometryGrid<  HostGrid, CoordFunction, Allocator>  Grid;
>>
>>           typedef typename HostGrid::ctype ctype;
>>
>> @@ -194,10 +223,17 @@
>>             typedef Dune::GridView<  DefaultLevelGridViewTraits<  const
>> Grid, pitype>  >
>>               LevelGridView;
>>           };
>> +
>> +        template<  int codim>
>> +        struct EntityAllocator
>> +        : public GeoGrid::EntityAllocator<  typename Codim< 
>> codim>::Entity, Allocator>
>> +        {};
>> +
>> +        typedef GenericGeometry::CodimTable<  EntityAllocator, dimension> 
>> EntityAllocatorTable;
>>         };
>>       };
>>
>> -  }
>> +  } // namespace GeoGrid
>>
>>
>>
>> @@ -244,21 +280,21 @@
>>      *
>>      *  \nosubgrouping
>>      */
>> -  template<  class HostGrid, class CoordFunction>
>> +  template<  class HostGrid, class CoordFunction, class Allocator>
>>     class GeometryGrid
>>     /** \cond */
>>     : public GridDefaultImplementation
>>         <  HostGrid::dimension, CoordFunction::dimRange, typename
>> HostGrid::ctype,
>> -        GeoGrid::GridFamily<  HostGrid, CoordFunction>  >,
>> +        GeoGrid::GridFamily<  HostGrid, CoordFunction, Allocator>  >,
>>       public GeoGrid::ExportParams<  HostGrid, CoordFunction>,
>> -    public GeoGrid::BackupRestoreFacilities<  GeometryGrid<  HostGrid,
>> CoordFunction>  >
>> +    public GeoGrid::BackupRestoreFacilities<  GeometryGrid<  HostGrid,
>> CoordFunction, Allocator>  >
>>     /** \endcond */
>>     {
>> -    typedef GeometryGrid<  HostGrid, CoordFunction>  Grid;
>> +    typedef GeometryGrid<  HostGrid, CoordFunction, Allocator>  Grid;
>>
>>       typedef GridDefaultImplementation
>>         <  HostGrid::dimension, CoordFunction::dimRange, typename
>> HostGrid::ctype,
>> -        GeoGrid::GridFamily<  HostGrid, CoordFunction>  >
>> +        GeoGrid::GridFamily<  HostGrid, CoordFunction, Allocator>  >
>>         Base;
>>
>>       friend class GeoGrid::HierarchicIterator<  const Grid>;
>> @@ -276,11 +312,11 @@
>>       template<  int, PartitionIteratorType, class>  friend class
>> GeoGrid::LevelIteratorTraits;
>>       template<  int, PartitionIteratorType, class>  friend class
>> GeoGrid::LeafIteratorTraits;
>>
>> -    template<  class, class, class>  friend class PersistentContainer;
>> +    template<  class, class, class>  friend class PersistentContainer;
>>
>>     public:
>>       /** \cond */
>> -    typedef GeoGrid::GridFamily<  HostGrid, CoordFunction>  GridFamily;
>> +    typedef GeoGrid::GridFamily<  HostGrid, CoordFunction, Allocator> 
>> GridFamily;
>>       /** \endcond */
>>
>>       /** \name Traits
>> @@ -860,6 +896,13 @@
>>         return getRealImplementation( entity ).hostEntity();
>>       }
>>
>> +    template<  int codim>
>> +    typename Traits::template EntityAllocator<  codim>  &entityAllocator()
>> const
>> +    {
>> +      integral_constant<  int, codim>  codimVariable;
>> +      return entityAllocators_[ codimVariable ];
>> +    }
>> +
>>     private:
>>       HostGrid *const hostGrid_;
>>       CoordFunction&coordFunction_;
>> @@ -867,6 +910,7 @@
>>       mutable LeafIndexSet *leafIndexSet_;
>>       mutable GlobalIdSet *globalIdSet_;
>>       mutable LocalIdSet *localIdSet_;
>> +    mutable typename Traits::EntityAllocatorTable entityAllocators_;
>>     };
>>
>>
>> @@ -874,9 +918,9 @@
>>     // GeometryGrid::Codim
>>     // -------------------
>>
>> -  template<  class HostGrid, class CoordFunction>
>> +  template<  class HostGrid, class CoordFunction, class Allocator>
>>     template<  int codim>
>> -  struct GeometryGrid<  HostGrid, CoordFunction>::Codim
>> +  struct GeometryGrid<  HostGrid, CoordFunction, Allocator>::Codim
>>     : public Base::template Codim<  codim>
>>     {
>>       /** \name Entity and Entity Pointer Types
>>
>> Modified: trunk/dune/grid/geometrygrid/indexsets.hh
>> ===================================================================
>> --- trunk/dune/grid/geometrygrid/indexsets.hh    2011-02-10 09:19:50 UTC
>> (rev 7401)
>> +++ trunk/dune/grid/geometrygrid/indexsets.hh    2011-02-10 10:38:14 UTC
>> (rev 7402)
>> @@ -16,7 +16,7 @@
>>     // External Forward Declarations
>>     // -----------------------------
>>
>> -  template<  class HostGrid, class CoordFunction>
>> +  template<  class HostGrid, class CoordFunction, class Allocator>
>>     class GeometryGrid;
>>
>>
>>
>> Modified: trunk/dune/grid/geometrygrid/intersection.hh
>> ===================================================================
>> --- trunk/dune/grid/geometrygrid/intersection.hh    2011-02-10 09:19:50 UTC
>> (rev 7401)
>> +++ trunk/dune/grid/geometrygrid/intersection.hh    2011-02-10 10:38:14 UTC
>> (rev 7402)
>> @@ -10,7 +10,7 @@
>>     // External Forward Declataions
>>     // ----------------------------
>>
>> -  template<  class HostGrid, class CoordFunction>
>> +  template<  class HostGrid, class CoordFunction, class Allocator>
>>     class GeometryGrid;
>>
>>
>> @@ -224,13 +224,13 @@
>>       // LeafIntersection
>>       // ----------------
>>
>> -    template<  class HostGrid, class CoordFunction>
>> -    class LeafIntersection<  const GeometryGrid<  HostGrid, CoordFunction>  >
>> +    template<  class HostGrid, class CoordFunction, class Allocator>
>> +    class LeafIntersection<  const GeometryGrid<  HostGrid, CoordFunction,
>> Allocator>  >
>>       : public Intersection
>> -<  const GeometryGrid<  HostGrid, CoordFunction>,
>> +<  const GeometryGrid<  HostGrid, CoordFunction, Allocator>,
>>            typename HostGrid::Traits::LeafIntersection>
>>       {
>> -      typedef GeometryGrid<  HostGrid, CoordFunction>  Grid;
>> +      typedef GeometryGrid<  HostGrid, CoordFunction, Allocator>  Grid;
>>         typedef typename HostGrid::Traits::LeafIntersection HostIntersection;
>>
>>         typedef Intersection<  const Grid, HostIntersection>  Base;
>> @@ -248,13 +248,13 @@
>>       // LevelIntersection
>>       // -----------------
>>
>> -    template<  class HostGrid, class CoordFunction>
>> -    class LevelIntersection<  const GeometryGrid<  HostGrid, CoordFunction>  >
>> +    template<  class HostGrid, class CoordFunction, class Allocator>
>> +    class LevelIntersection<  const GeometryGrid<  HostGrid, CoordFunction,
>> Allocator>  >
>>       : public Intersection
>> -<  const GeometryGrid<  HostGrid, CoordFunction>,
>> +<  const GeometryGrid<  HostGrid, CoordFunction, Allocator>,
>>           typename HostGrid::Traits::LevelIntersection>
>>       {
>> -      typedef GeometryGrid<  HostGrid, CoordFunction>  Grid;
>> +      typedef GeometryGrid<  HostGrid, CoordFunction, Allocator>  Grid;
>>         typedef typename HostGrid::Traits::LevelIntersection HostIntersection;
>>
>>         typedef Intersection<  const Grid, HostIntersection>  Base;
>>
>> Modified: trunk/dune/grid/geometrygrid/iterator.hh
>> ===================================================================
>> --- trunk/dune/grid/geometrygrid/iterator.hh    2011-02-10 09:19:50 UTC (rev
>> 7401)
>> +++ trunk/dune/grid/geometrygrid/iterator.hh    2011-02-10 10:38:14 UTC (rev
>> 7402)
>> @@ -11,7 +11,7 @@
>>     // External Forward Declarations
>>     // -----------------------------
>>
>> -  template<  class HostGrid, class CoordFunction>
>> +  template<  class HostGrid, class CoordFunction, class Allocator>
>>     class GeometryGrid;
>>
>>
>>
>> Modified: trunk/dune/grid/geometrygrid/persistentcontainer.hh
>> ===================================================================
>> --- trunk/dune/grid/geometrygrid/persistentcontainer.hh    2011-02-10
>> 09:19:50 UTC (rev 7401)
>> +++ trunk/dune/grid/geometrygrid/persistentcontainer.hh    2011-02-10
>> 10:38:14 UTC (rev 7402)
>> @@ -11,13 +11,13 @@
>>     // ------------------------------------
>>
>>     template<  class HostGrid, class CoordFunction, class Data, class
>> Allocator>
>> -  class PersistentContainer<  GeometryGrid<  HostGrid, CoordFunction>,
>> Data, Allocator>
>> +  class PersistentContainer<  GeometryGrid<  HostGrid, CoordFunction,
>> Allocator>, Data, Allocator>
>>     : public PersistentContainer<  HostGrid, Data, Allocator>
>>     {
>>       typedef PersistentContainer<  HostGrid, Data, Allocator>  Base;
>>
>>     public:
>> -    typedef GeometryGrid<  HostGrid, CoordFunction>  GridType;
>> +    typedef GeometryGrid<  HostGrid, CoordFunction, Allocator>  GridType;
>>
>>       typedef typename GridType::template Codim<  0>::Entity ElementType;
>>
>>
>> Modified: trunk/dune/grid/io/file/dgfparser/dgfgeogrid.hh
>> ===================================================================
>> --- trunk/dune/grid/io/file/dgfparser/dgfgeogrid.hh    2011-02-10 09:19:50
>> UTC (rev 7401)
>> +++ trunk/dune/grid/io/file/dgfparser/dgfgeogrid.hh    2011-02-10 10:38:14
>> UTC (rev 7402)
>> @@ -107,10 +107,10 @@
>>     // DGFGridFactory for GeometryGrid
>>     // -------------------------------
>>
>> -  template<  class HostGrid, class CoordFunction>
>> -  struct DGFGridFactory<  GeometryGrid<  HostGrid, CoordFunction>  >
>> +  template<  class HostGrid, class CoordFunction, class Allocator>
>> +  struct DGFGridFactory<  GeometryGrid<  HostGrid, CoordFunction,
>> Allocator>  >
>>     {
>> -    typedef GeometryGrid<  HostGrid, CoordFunction>  Grid;
>> +    typedef GeometryGrid<  HostGrid, CoordFunction, Allocator>  Grid;
>>
>>       const static int dimension = Grid::dimension;
>>       typedef MPIHelper::MPICommunicator MPICommunicator;
>> @@ -181,8 +181,8 @@
>>     // DGFGridInfo for GeometryGrid
>>     // ----------------------------
>>
>> -  template<  class HostGrid, class CoordFunction>
>> -  struct DGFGridInfo<  GeometryGrid<  HostGrid, CoordFunction>  >
>> +  template<  class HostGrid, class CoordFunction, class Allocator>
>> +  struct DGFGridInfo<  GeometryGrid<  HostGrid, CoordFunction, Allocator>  >
>>     {
>>       static int refineStepsForHalf ()
>>       {
>>
>> Modified: trunk/dune/grid/utility/hostgridaccess.hh
>> ===================================================================
>> --- trunk/dune/grid/utility/hostgridaccess.hh    2011-02-10 09:19:50 UTC
>> (rev 7401)
>> +++ trunk/dune/grid/utility/hostgridaccess.hh    2011-02-10 10:38:14 UTC
>> (rev 7402)
>> @@ -9,7 +9,7 @@
>>     // External Forward Declarations
>>     // -----------------------------
>>
>> -  template<  class HostGrid, class CoordFunction>
>> +  template<  class HostGrid, class CoordFunction, class Allocator>
>>     class GeometryGrid;
>>
>>
>> @@ -29,13 +29,13 @@
>>      *
>>      *  \nosubgrouping
>>      */
>> -  template<  class HG, class CoordFunction>
>> -  struct HostGridAccess<  GeometryGrid<  HG, CoordFunction>  >
>> +  template<  class HG, class CoordFunction, class Allocator>
>> +  struct HostGridAccess<  GeometryGrid<  HG, CoordFunction, Allocator>  >
>>     {
>>       /** \name Exported Types
>>        * \{ */
>>
>> -    typedef GeometryGrid<  HG, CoordFunction>  Grid;
>> +    typedef GeometryGrid<  HG, CoordFunction, Allocator>  Grid;
>>
>>       //! type of HostGrid
>>       typedef typename Grid::HostGrid HostGrid;
>>
>>
>> _______________________________________________
>> Dune-Commit mailing list
>> Dune-Commit at dune-project.org
>> http://lists.dune-project.org/mailman/listinfo/dune-commit
>>    
> 
> 
> _______________________________________________
> Dune mailing list
> Dune at dune-project.org
> http://lists.dune-project.org/mailman/listinfo/dune

-- 
Martin Nolte <nolte at mathematik.uni-freiburg.de>

Universität Freiburg                                   phone: +49-761-203-5630
Abteilung für angewandte Mathematik                    fax:   +49-761-203-5632
Hermann-Herder-Straße 10
79104 Freiburg, Germany




More information about the Dune mailing list