3#ifndef DUNE_PERSISTENTCONTAINERWRAPPER_HH
4#define DUNE_PERSISTENTCONTAINERWRAPPER_HH
6#include <dune/grid/utility/hostgridaccess.hh>
7#include <dune/grid/utility/persistentcontainer.hh>
15 template<
class G,
class T >
16 class PersistentContainerWrapper
18 typedef PersistentContainerWrapper< G, T > This;
22 typedef typename HostGridAccess::HostGrid HostGrid;
28 typedef typename PersistentContainer< HostGrid, T >::Value Value;
29 typedef typename PersistentContainer< HostGrid, T >::Size Size;
31 typedef typename PersistentContainer< HostGrid, T >::Iterator Iterator;
32 typedef typename PersistentContainer< HostGrid, T >::ConstIterator ConstIterator;
34 PersistentContainerWrapper (
const Grid &grid,
int codim,
const Value &value = Value() )
35 : hostContainer_( HostGridAccess::hostGrid( grid ), codim, value )
38 template<
class Entity >
39 const Value &operator[] (
const Entity &entity )
const
41 return hostContainer_[ HostGridAccess::hostEntity( entity ) ];
44 template<
class Entity >
45 Value &operator[] (
const Entity &entity )
47 return hostContainer_[ HostGridAccess::hostEntity( entity ) ];
50 template<
class Entity >
51 const Value &operator() (
const Entity &entity,
int subEntity )
const
53 return hostContainer_( HostGridAccess::hostEntity( entity ), subEntity );
56 template<
class Entity >
57 Value &operator() (
const Entity &entity,
int subEntity )
59 return hostContainer_( HostGridAccess::hostEntity( entity ), subEntity );
62 Size size ()
const {
return hostContainer_.size(); }
64 void resize (
const Value &value = Value() ) { hostContainer_.resize( value ); }
65 void shrinkToFit () {
return hostContainer_.shrinkToFit(); }
67 void fill (
const Value &value = Value() ) { hostContainer_.fill( value ); }
69 void swap ( This &other ) { hostContainer_.swap( other ); }
71 ConstIterator begin ()
const {
return hostContainer_.begin(); }
72 Iterator begin () {
return hostContainer_.begin(); }
74 ConstIterator end ()
const {
return hostContainer_.end(); }
75 Iterator end () {
return hostContainer_.end(); }
77 int codimension ()
const {
return hostContainer_.codimension(); }
Dune namespace.
Definition: alignment.hh:10
provides access to host grid objects from GeometryGrid
Definition: identitygrid.hh:37