dune-fem  2.4.1-rc
rangegenerators.hh
Go to the documentation of this file.
1 #ifndef DUNE_FEM_RANGEGENERATORS_HH
2 #define DUNE_FEM_RANGEGENERATORS_HH
3 
4 #include <dune/common/iteratorrange.hh>
5 
6 namespace Dune
7 {
8  namespace Fem
9  {
10  // only make the implementations available on new compilers
11  #if HAVE_RANGE_BASED_FOR
12 
47 
58  template<typename DF>
59  inline IteratorRange<typename DF::DiscreteFunctionSpaceType::IteratorType> entities(const DF& df)
60  {
61  typedef IteratorRange<typename DF::DiscreteFunctionSpaceType::IteratorType> ReturnType;
62  return ReturnType(df.space().begin(),df.space().end());
63  }
65 
67 
77  template<typename DF>
78  inline IteratorRange<typename DF::DofIteratorType> dofs(DF& df)
79  {
80  typedef IteratorRange<typename DF::DofIteratorType> ReturnType;
81  return ReturnType(df.dbegin(),df.dend());
82  }
84 
86 
96  template<typename DF>
97  inline IteratorRange<typename DF::ConstDofIteratorType> dofs(const DF& df)
98  {
99  typedef IteratorRange<typename DF::ConstDofIteratorType> ReturnType;
100  return ReturnType(df.dbegin(),df.dend());
101  }
103 
104 
105  #endif // HAVE_RANGE_BASED_FOR
106 
107  } // end namespace Fem
108 
109 } // end namespace Dune
110 
111 #endif // DUNE_FEM_RANGEGENERATORS_HH
Definition: coordinate.hh:4