17#ifndef dealii_matrix_free_type_traits_h
18#define dealii_matrix_free_type_traits_h
41 struct has_local_element
54 static decltype(std::declval<U const>().local_element(0))
61 static const bool value =
62 !std::is_same<void, decltype(detect(std::declval<T>()))>::value;
67 const bool has_local_element<T>::value;
74 struct has_add_local_element
82 std::declval<U>().add_local_element(0,
typename T::value_type()))
86 static const bool value =
87 !std::is_same<int, decltype(detect(std::declval<T>()))>::value;
92 const bool has_add_local_element<T>::value;
99 struct has_set_local_element
105 template <
typename U>
107 std::declval<U>().set_local_element(0,
typename T::value_type()))
111 static const bool value =
112 !std::is_same<int, decltype(detect(std::declval<T>()))>::value;
116 template <
typename T>
117 const bool has_set_local_element<T>::value;
124 template <
typename T>
125 struct has_partitioners_are_compatible
131 template <
typename U>
132 static decltype(std::declval<U const>().partitioners_are_compatible(
133 std::declval<Utilities::MPI::Partitioner>()))
137 static const bool value =
138 std::is_same<bool, decltype(detect(std::declval<T>()))>::value;
142 template <
typename T>
143 const bool has_partitioners_are_compatible<T>::value;
148 template <
typename T>
155 template <
typename U>
156 static decltype(std::declval<U const>().begin())
160 static const bool value =
161 !std::is_same<void, decltype(detect(std::declval<T>()))>::value;
165 template <
typename T>
166 const bool has_begin<T>::value;
171 template <
typename T>
172 struct has_shared_vector_data
178 template <
typename U>
179 static decltype(std::declval<U const>().shared_vector_data())
183 static const bool value =
184 !std::is_same<void, decltype(detect(std::declval<T>()))>::value;
188 template <
typename T>
189 const bool has_shared_vector_data<T>::value;
197 template <
typename T,
typename Number>
198 struct is_vectorizable
200 static const bool value =
201 has_begin<T>::value &&
203 std::is_same<typename T::value_type, Number>::value;
207 template <
typename T,
typename Number>
208 const bool is_vectorizable<T, Number>::value;
222 template <
typename T>
223 struct has_update_ghost_values_start
229 template <
typename U>
230 static decltype(std::declval<U const>().update_ghost_values_start(0))
234 static const bool value =
235 !std::is_same<bool, decltype(detect(std::declval<T>()))>::value;
239 template <
typename T>
240 const bool has_update_ghost_values_start<T>::value;
246 template <
typename T>
247 struct has_compress_start
253 template <
typename U>
258 static const bool value =
259 !std::is_same<bool, decltype(detect(std::declval<T>()))>::value;
263 template <
typename T>
264 const bool has_compress_start<T>::value;
272 template <
typename T>
273 struct has_exchange_on_subset
275 static const bool value =
276 has_begin<T>::value && has_local_element<T>::value;
280 template <
typename T>
281 const bool has_exchange_on_subset<T>::value;
287 template <
typename T>
288 struct has_communication_block_size
294 template <
typename U>
295 static decltype(U::communication_block_size)
299 static const bool value =
300 !std::is_same<void, decltype(detect(std::declval<T>()))>::value;
304 template <
typename T>
305 const bool has_communication_block_size<T>::value;
315 template <
typename T>
316 struct is_serial_or_dummy
326 typename std::enable_if<is_serial_vector<U>::value,
U>::type * =
nullptr>
333 typename std::enable_if<!is_serial_vector<U>::value,
U>::type * =
nullptr>
338 static const bool value =
339 std::is_same<void, decltype(detect(std::declval<T>()))>::value;
343 template <
typename T>
344 const bool is_serial_or_dummy<T>::value;
#define DEAL_II_NAMESPACE_OPEN
#define DEAL_II_NAMESPACE_CLOSE