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