dune-grid  2.6-git
hostcorners.hh
Go to the documentation of this file.
1 // -*- tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*-
2 // vi: set et ts=4 sw=2 sts=2:
3 #ifndef DUNE_GEOGRID_HOSTCORNERS_HH
4 #define DUNE_GEOGRID_HOSTCORNERS_HH
5 
6 #include <dune/geometry/type.hh>
7 
9 
10 namespace Dune
11 {
12  namespace GeoGrid
13  {
14 
15  // HostCorners
16  // -----------
17 
18  template< class HostEntity >
20  {
21  typedef typename HostEntity::Geometry HostGeometry;
22 
23  public:
24  typedef typename HostGeometry::GlobalCoordinate Coordinate;
25 
26  explicit HostCorners ( const HostEntity &hostEntity )
27  : hostGeometry_( hostEntity.geometry() )
28  {}
29 
30  GeometryType type () const
31  {
32  return hostGeometry_.type();
33  }
34 
35  Coordinate operator[] ( int i ) const
36  {
37  return hostGeometry_.corner( i );
38  }
39 
40  std::size_t size () const
41  {
42  return hostGeometry_.corners();
43  }
44 
45  private:
46  HostGeometry hostGeometry_;
47  };
48 
49  } // namespace GeoGrid
50 
51 } // namespace Dune
52 
53 #endif // #ifndef DUNE_GEOGRID_HOSTCORNERS_HH
Dune::VTK::GeometryType
GeometryType
Type representing VTK's entity geometry types.
Definition: common.hh:178
Dune::GeoGrid::HostCorners::type
GeometryType type() const
Definition: hostcorners.hh:30
Dune::GeoGrid::HostCorners::size
std::size_t size() const
Definition: hostcorners.hh:40
Dune::GeoGrid::HostCorners
Definition: hostcorners.hh:19
Dune::GeoGrid::HostCorners::operator[]
Coordinate operator[](int i) const
Definition: hostcorners.hh:35
Dune::GeoGrid::HostCorners::Coordinate
HostGeometry::GlobalCoordinate Coordinate
Definition: hostcorners.hh:24
entity.hh
Dune::GeoGrid::HostCorners::HostCorners
HostCorners(const HostEntity &hostEntity)
Definition: hostcorners.hh:26
Dune
Include standard header files.
Definition: agrid.hh:58