DUNE PDELab (git)

utility.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_PDELAB_BACKEND_ISTL_UTILITY_HH
4#define DUNE_PDELAB_BACKEND_ISTL_UTILITY_HH
5
8
9#include <dune/pdelab/backend/istl/tags.hh>
10
11namespace 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
Definition of the DUNE_NO_DEPRECATED_* macros.
Traits for type conversions and type information.
Dune namespace.
Definition: alignedallocator.hh:13
TMP for figuring out the depth up to which ISTL containers are nested.
Definition: utility.hh:70
Creative Commons License   |  Legal Statements / Impressum  |  Hosted by TU Dresden  |  generated with Hugo v0.111.3 (Nov 12, 23:30, 2024)