dune-grid 3.0-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
10namespace 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
Include standard header files.
Definition agrid.hh:60
Definition hostcorners.hh:20
GeometryType type() const
Definition hostcorners.hh:30
Coordinate operator[](int i) const
Definition hostcorners.hh:35
HostCorners(const HostEntity &hostEntity)
Definition hostcorners.hh:26
HostGeometry::GlobalCoordinate Coordinate
Definition hostcorners.hh:24
std::size_t size() const
Definition hostcorners.hh:40