All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Groups Pages
entityseed.hh
1 // -*- mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*-
2 // vi: set et ts=2 sw=2 sts=2:
3 #ifndef DUNE_POLYHEDRALGRID_ENTITYSEED_HH
4 #define DUNE_POLYHEDRALGRID_ENTITYSEED_HH
5 
6 #include <dune/common/version.hh>
7 #include <dune/common/typetraits.hh>
8 
9 #if DUNE_VERSION_NEWER(DUNE_GRID,2,3)
10 #include <dune/grid/common/entityseed.hh>
11 #endif
12 
13 namespace Dune
14 {
15 
16  template< int codim, class Grd >
18  {
19  typedef typename std::remove_const< Grd >::type::Traits Traits;
20 
21  public:
22  static const int codimension = codim;
23  static const int dimension = Traits::dimension;
24  static const int mydimension = dimension - codimension;
25  static const int dimensionworld = Traits::dimensionworld;
26 
27 
28  typedef typename Traits::Grid Grid;
29  typedef typename Traits::template Codim< codim >::Entity Entity;
30  typedef typename Traits :: Index Index ;
31 
32  static const Index defaultIndex = -1;
33 
34  explicit PolyhedralGridEntitySeed ( const Index& index )
35  : index_( index )
36  {}
37 
39  : index_( defaultIndex )
40  {}
41 
42  int index () const { return index_ ; }
43 
44  bool isValid() const { return index_ != defaultIndex; }
45 
46  bool equals(const PolyhedralGridEntitySeed& other) const
47  { return index_ == other.index_; }
48 
49  protected:
50  Index index_;
51  };
52 
53 } // namespace Dune
54 
55 #endif // #ifndef DUNE_POLYHEDRALGRID_ENTITYSEED_HH
Definition: entityseed.hh:17