Dune Core Modules (2.9.0)

gridviewentityset.hh
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_FUNCTIONS_GRIDFUNCTIONS_GRIDVIEWENTITYSET_HH
4 #define DUNE_FUNCTIONS_GRIDFUNCTIONS_GRIDVIEWENTITYSET_HH
5 
6 #include <memory>
7 
8 
9 namespace Dune {
10 
11 namespace Functions {
12 
13 
21 template<class GV, int cd>
23 {
24 public:
25 
26  typedef GV GridView;
27  enum {
28  codim = cd
29  };
30 
32  typedef typename GridView::template Codim<codim>::Entity Element;
33 
35  typedef typename Element::Geometry::LocalCoordinate LocalCoordinate;
36  typedef typename Element::Geometry::GlobalCoordinate GlobalCoordinate;
37 
38  typedef Element value_type;
39 
41  typedef typename GridView::template Codim<codim>::Iterator const_iterator;
42 
45 
47  GridViewEntitySet(const GridView& gv) :
48  gv_(gv)
49  {}
50 
52  bool contains(const Element& e) const
53  {
54  return gv_.contains(e);
55  }
56 
58  size_t size() const
59  {
60  return gv_.size(codim);
61  }
62 
65  {
66  return gv_.template begin<codim>();
67  }
68 
71  {
72  return gv_.template end<codim>();
73  }
74 
76  const GridView& gridView() const
77  {
78  return gv_;
79  }
80 
81 private:
82  GridView gv_;
83 };
84 
85 
86 } // end of namespace Dune::Functions
87 } // end of namespace Dune
88 
89 #endif // DUNE_FUNCTIONS_GRIDFUNCTIONS_GRIDVIEWENTITYSET_HH
An entity set for all entities of given codim in a grid view.
Definition: gridviewentityset.hh:23
GridViewEntitySet(const GridView &gv)
Construct GridViewEntitySet for a GridView.
Definition: gridviewentityset.hh:47
GridView::template Codim< codim >::Entity Element
Type of Elements contained in this EntitySet.
Definition: gridviewentityset.hh:32
const_iterator end() const
Create an end iterator.
Definition: gridviewentityset.hh:70
const_iterator begin() const
Create a begin iterator.
Definition: gridviewentityset.hh:64
GridView::template Codim< codim >::Iterator const_iterator
A forward iterator.
Definition: gridviewentityset.hh:41
Element::Geometry::LocalCoordinate LocalCoordinate
Type of local coordinates with respect to the Element.
Definition: gridviewentityset.hh:35
size_t size() const
Return number of Elements visited by an iterator.
Definition: gridviewentityset.hh:58
const GridView & gridView() const
Return the associated GridView.
Definition: gridviewentityset.hh:76
bool contains(const Element &e) const
Return true if e is contained in the EntitySet.
Definition: gridviewentityset.hh:52
const_iterator iterator
Same as const_iterator.
Definition: gridviewentityset.hh:44
Grid view abstract base class.
Definition: gridview.hh:66
Dune namespace.
Definition: alignedallocator.hh:13
Static tag representing a codimension.
Definition: dimension.hh:24
Creative Commons License   |  Legal Statements / Impressum  |  Hosted by TU Dresden  |  generated with Hugo v0.80.0 (Apr 18, 22:30, 2024)