dune-pdelab  2.5-dev
backend/istl/utility.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_PDELAB_BACKEND_ISTL_UTILITY_HH
4 #define DUNE_PDELAB_BACKEND_ISTL_UTILITY_HH
5 
6 // this is here for backwards compatibility and deprecation warnings, remove after 2.5.0
7 #include "ensureistlinclude.hh"
8 
9 #include <dune/common/typetraits.hh>
10 #include <dune/common/deprecated.hh>
11 
13 
14 namespace Dune {
15 
16  namespace PDELab {
17 
18  namespace ISTL {
19 
20 #ifndef DOXYGEN
21 
22  // ********************************************************************************
23  // Helpers for the nesting_depth TMP
24  // ********************************************************************************
25 
26  namespace impl {
27 
28  template<typename T, std::size_t depth, typename Tag>
29  struct nesting_depth;
30 
31  template<typename T, std::size_t depth>
32  struct nesting_depth<T,depth,tags::block_vector>
33  : public nesting_depth<typename T::block_type,depth+1,typename tags::container<typename T::block_type>::type::base_tag>
34  {};
35 
36  template<typename T, std::size_t depth>
37  struct nesting_depth<T,depth,tags::dynamic_vector>
38  : public std::integral_constant<std::size_t,depth+1>
39  {};
40 
41  template<typename T, std::size_t depth>
42  struct nesting_depth<T,depth,tags::field_vector>
43  : public std::integral_constant<std::size_t,depth+1>
44  {};
45 
46  template<typename T, std::size_t depth>
47  struct nesting_depth<T,depth,tags::bcrs_matrix>
48  : public nesting_depth<typename T::block_type,depth+1,typename tags::container<typename T::block_type>::type::base_tag>
49  {};
50 
51  template<typename T, std::size_t depth>
52  struct nesting_depth<T,depth,tags::dynamic_matrix>
53  : public std::integral_constant<std::size_t,depth+1>
54  {};
55 
56  template<typename T, std::size_t depth>
57  struct nesting_depth<T,depth,tags::field_matrix>
58  : public std::integral_constant<std::size_t,depth+1>
59  {};
60 
61  }
62 
63 #endif // DOXYGEN
64 
66 
70  template<typename T>
72  : public impl::nesting_depth<T,0,typename tags::container<T>::type::base_tag>
73  {};
74 
75  } // namespace ISTL
76  } // namespace PDELab
77 } // namespace Dune
78 
79 #endif // DUNE_PDELAB_BACKEND_ISTL_UTILITY_HH
TMP for figuring out the depth up to which ISTL containers are nested.
Definition: backend/istl/utility.hh:71
For backward compatibility – Do not use this!
Definition: adaptivity.hh:27