Loading...
Searching...
No Matches
entitypointer.hh
// -*- mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*-
// vi: set et ts=2 sw=2 sts=2:
#ifndef DUNE_POLYHEDRALGRID_ENTITYPOINTER_HH
#define DUNE_POLYHEDRALGRID_ENTITYPOINTER_HH
//- dune-grid includes
#include <dune/grid/common/grid.hh>
//- dune-metagrid includes
#include <opm/grid/polyhedralgrid/declaration.hh>
namespace Dune
{
// PolyhedralGridEntityPointer
// -------------------
template< int codim, class Grid >
class PolyhedralGridEntityPointer
{
typedef PolyhedralGridEntityPointer< codim, Grid > This;
protected:
typedef typename Grid::Traits Traits;
public:
static const int dimension = Grid::dimension;
static const int codimension = codim;
typedef typename Traits::template Codim< codimension >::Entity Entity;
protected:
typedef typename Traits::ExtraData ExtraData;
typedef typename Traits::template Codim< codimension > :: EntityImpl EntityImpl;
public:
explicit PolyhedralGridEntityPointer ( ExtraData data )
: entity_( EntityImpl( data ) )
{}
explicit PolyhedralGridEntityPointer ( const EntityImpl &entity )
: entity_( EntityImpl( entity ) )
{}
PolyhedralGridEntityPointer ( const This &other )
: entity_( EntityImpl( other.entityImpl() ) )
{}
const This &operator= ( const This &other )
{
entityImpl() = other.entityImpl();
return *this;
}
bool equals ( const This &other ) const
{
return entityImpl().equals( other.entityImpl() );
}
Entity& dereference () const
{
return entity_;
}
operator const Entity& () const { return entity_; }
operator Entity& () { return entity_; }
int level () const { return entity_.level(); }
protected:
EntityImpl &entityImpl () const
{
return entity_.impl();
}
ExtraData data () const { return entityImpl().data(); }
protected:
mutable Entity entity_;
};
} // namespace Dune
#endif // #ifndef DUNE_POLYHEDRALGRID_ENTITYPOINTER_HH
Dune::PolyhedralGridEntityPointer
Definition entitypointer.hh:19
Dune::PolyhedralGridEntityPointer::equals
bool equals(const This &other) const
check for equality
Definition entitypointer.hh:59
Dune::PolyhedralGridEntityPointer::level
int level() const
obtain level
Definition entitypointer.hh:74
Dune::PolyhedralGridEntityPointer::codimension
static const int codimension
world dimension
Definition entitypointer.hh:29
Dune::PolyhedralGridEntityPointer::dereference
Entity & dereference() const
dereference entity
Definition entitypointer.hh:65
Dune::PolyhedralGridEntityPointer::Entity
Traits::template Codim< codimension >::Entity Entity
type of entity
Definition entitypointer.hh:32
Dune::PolyhedralGridEntityPointer::dimension
static const int dimension
grid dimension
Definition entitypointer.hh:27
Dune
The namespace Dune is the main namespace for all Dune code.
Definition CartesianIndexMapper.hpp:10