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 #include <dune/common/typetraits.hh>
7 #include <dune/common/deprecated.hh>
8 
10 
11 namespace Dune {
12 
13  namespace PDELab {
14 
15  namespace ISTL {
16 
17 #ifndef DOXYGEN
18 
19  // ********************************************************************************
20  // Helpers for the nesting_depth TMP
21  // ********************************************************************************
22 
23  namespace impl {
24 
25  template<typename T, std::size_t depth, typename Tag>
26  struct nesting_depth;
27 
28  template<typename T, std::size_t depth>
29  struct nesting_depth<T,depth,tags::block_vector>
30  : public nesting_depth<typename T::block_type,depth+1,typename tags::container<typename T::block_type>::type::base_tag>
31  {};
32 
33  template<typename T, std::size_t depth>
34  struct nesting_depth<T,depth,tags::dynamic_vector>
35  : public std::integral_constant<std::size_t,depth+1>
36  {};
37 
38  template<typename T, std::size_t depth>
39  struct nesting_depth<T,depth,tags::field_vector>
40  : public std::integral_constant<std::size_t,depth+1>
41  {};
42 
43  template<typename T, std::size_t depth>
44  struct nesting_depth<T,depth,tags::bcrs_matrix>
45  : public nesting_depth<typename T::block_type,depth+1,typename tags::container<typename T::block_type>::type::base_tag>
46  {};
47 
48  template<typename T, std::size_t depth>
49  struct nesting_depth<T,depth,tags::dynamic_matrix>
50  : public std::integral_constant<std::size_t,depth+1>
51  {};
52 
53  template<typename T, std::size_t depth>
54  struct nesting_depth<T,depth,tags::field_matrix>
55  : public std::integral_constant<std::size_t,depth+1>
56  {};
57 
58  }
59 
60 #endif // DOXYGEN
61 
63 
67  template<typename T>
69  : public impl::nesting_depth<T,0,typename tags::container<T>::type::base_tag>
70  {};
71 
72  } // namespace ISTL
73  } // namespace PDELab
74 } // namespace Dune
75 
76 #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:68
For backward compatibility – Do not use this!
Definition: adaptivity.hh:28