4#ifndef DUNE_PDELAB_BACKEND_ISTL_MATRIXFREE_CHECKLOPINTERFACE_HH
5#define DUNE_PDELAB_BACKEND_ISTL_MATRIXFREE_CHECKLOPINTERFACE_HH
36 template <
typename A>
constexpr auto test(
int)
37 ->
decltype(std::declval<T>()(std::declval<A>()), std::true_type())
39 return std::true_type();
41 template <
typename A>
constexpr std::false_type test(...)
43 return std::false_type();
47 template <
typename A>
constexpr auto operator()(
const A& p)
49 return test<A>(
int());
53 template <
typename T>
constexpr auto lambdaToTemplate(
const T& t)
67 auto hasNewJacobianApplyVolume =
68 lambdaToTemplate([](
auto&& lop) ->
decltype(lop.jacobian_apply_volume(std::declval<bool>(),
70 std::declval<double>(),
71 std::declval<short int>(),
72 std::declval<long int>(),
73 std::declval<long long int&>()
75 auto hasNewJacobianApplyVolumePostSkeleton =
76 lambdaToTemplate([](
auto&& lop) ->
decltype(lop.jacobian_apply_volume_post_skeleton(std::declval<bool>(),
78 std::declval<double>(),
79 std::declval<short int>(),
80 std::declval<long int>(),
81 std::declval<long long int&>()
83 auto hasNewJacobianApplySkeleton =
84 lambdaToTemplate([](
auto&& lop) ->
decltype(lop.jacobian_apply_skeleton(std::declval<bool>(),
86 std::declval<double>(),
87 std::declval<short int>(),
88 std::declval<long int>(),
90 std::declval<double>(),
91 std::declval<short int>(),
92 std::declval<long int>(),
93 std::declval<long long int&>(),
94 std::declval<long long int&>()
96 auto hasNewJacobianApplyBoundary =
97 lambdaToTemplate([](
auto&& lop) ->
decltype(lop.jacobian_apply_boundary(std::declval<bool>(),
99 std::declval<double>(),
100 std::declval<short int>(),
101 std::declval<long int>(),
102 std::declval<long long int&>()
110 auto hasOldOrNewJacobianApplyVolume =
111 lambdaToTemplate([](
auto&& lop) ->
decltype(lop.jacobian_apply_volume(std::declval<bool>(),
113 std::declval<double>(),
114 std::declval<double>(),
115 std::declval<long int>(),
116 std::declval<long long int&>()
118 auto hasOldOrNewJacobianApplyVolumePostSkeleton =
119 lambdaToTemplate([](
auto&& lop) ->
decltype(lop.jacobian_apply_volume_post_skeleton(std::declval<bool>(),
121 std::declval<double>(),
122 std::declval<double>(),
123 std::declval<long int>(),
124 std::declval<long long int&>()
126 auto hasOldOrNewJacobianApplySkeleton =
127 lambdaToTemplate([](
auto&& lop) ->
decltype(lop.jacobian_apply_skeleton(std::declval<bool>(),
129 std::declval<double>(),
130 std::declval<double>(),
131 std::declval<long int>(),
133 std::declval<double>(),
134 std::declval<double>(),
135 std::declval<long int>(),
136 std::declval<long long int&>(),
137 std::declval<long long int&>()
139 auto hasOldOrNewJacobianApplyBoundary =
140 lambdaToTemplate([](
auto&& lop) ->
decltype(lop.jacobian_apply_boundary(std::declval<bool>(),
142 std::declval<double>(),
143 std::declval<double>(),
144 std::declval<long int>(),
145 std::declval<long long int&>()
152 template <
typename T>
153 constexpr auto hasOldLOPInterface(T& t) ->
typename std::enable_if<
154 (
decltype(hasOldOrNewJacobianApplyVolume(t))::value && !
decltype(hasNewJacobianApplyVolume(t))::value)
155 || (
decltype(hasOldOrNewJacobianApplyVolumePostSkeleton(t))::value && !
decltype(hasNewJacobianApplyVolumePostSkeleton(t))::value)
156 || (
decltype(hasOldOrNewJacobianApplySkeleton(t))::value && !
decltype(hasNewJacobianApplySkeleton(t))::value)
157 || (
decltype(hasOldOrNewJacobianApplyBoundary(t))::value && !
decltype(hasNewJacobianApplyBoundary(t))::value),
158 std::true_type>::type
160 return std::true_type();
162 template <
typename T>
163 constexpr auto hasOldLOPInterface(T& t) ->
typename std::enable_if<
164 !((
decltype(hasOldOrNewJacobianApplyVolume(t))::value && !
decltype(hasNewJacobianApplyVolume(t))::value)
165 || (
decltype(hasOldOrNewJacobianApplyVolumePostSkeleton(t))::value && !
decltype(hasNewJacobianApplyVolumePostSkeleton(t))::value)
166 || (
decltype(hasOldOrNewJacobianApplySkeleton(t))::value && !
decltype(hasNewJacobianApplySkeleton(t))::value)
167 || (
decltype(hasOldOrNewJacobianApplyBoundary(t))::value && !
decltype(hasNewJacobianApplyBoundary(t))::value)),
168 std::false_type>::type
170 return std::false_type();
Dune namespace.
Definition: alignedallocator.hh:11