17#ifndef dealii_matrix_free_type_traits_h
18#define dealii_matrix_free_type_traits_h
41 using local_element_t =
decltype(std::declval<T const>().local_element(0));
44 constexpr bool has_local_element = is_supported_operation<local_element_t, T>;
51 using add_local_element_t =
52 decltype(std::declval<T>().add_local_element(0,
typename T::value_type()));
55 constexpr bool has_add_local_element =
56 is_supported_operation<add_local_element_t, T>;
63 using set_local_element_t =
64 decltype(std::declval<T>().set_local_element(0,
typename T::value_type()));
67 constexpr bool has_set_local_element =
68 is_supported_operation<set_local_element_t, T>;
76 using partitioners_are_compatible_t =
77 decltype(std::declval<T const>().partitioners_are_compatible(
78 std::declval<Utilities::MPI::Partitioner>()));
81 constexpr bool has_partitioners_are_compatible =
82 is_supported_operation<partitioners_are_compatible_t, T>;
89 using begin_t =
decltype(std::declval<T const>().begin());
92 constexpr bool has_begin = is_supported_operation<begin_t, T>;
99 using shared_vector_data_t =
100 decltype(std::declval<T const>().shared_vector_data());
102 template <
typename T>
103 constexpr bool has_shared_vector_data =
104 is_supported_operation<shared_vector_data_t, T>;
113 template <
typename T,
typename Number>
114 struct is_vectorizable
116 static const bool value =
118 (has_local_element<T> ||
120 std::is_same<typename T::value_type, Number>::value;
124 template <
typename T,
typename Number>
125 const bool is_vectorizable<T, Number>::value;
139 template <
typename T>
140 using update_ghost_values_start_t =
141 decltype(std::declval<T const>().update_ghost_values_start(0));
143 template <
typename T>
144 constexpr bool has_update_ghost_values_start =
145 is_supported_operation<update_ghost_values_start_t, T>;
151 template <
typename T>
152 using compress_start_t =
155 template <
typename T>
156 constexpr bool has_compress_start =
157 is_supported_operation<compress_start_t, T>;
165 template <
typename T>
166 constexpr bool has_exchange_on_subset =
167 has_begin<T> &&has_local_element<T> &&has_partitioners_are_compatible<T>;
173 template <
typename T>
174 using communication_block_size_t =
decltype(T::communication_block_size);
176 template <
typename T>
177 constexpr bool has_communication_block_size =
178 is_supported_operation<communication_block_size_t, T>;
188 template <
class T,
class IsSerialVectorNotSpecialized =
void>
189 using not_parallel_vector_t =
190 std::integral_constant<bool, is_serial_vector<T>::value>;
197 template <
class VectorType>
204 template <
class VectorType>
205 using is_serial_vector_type =
decltype(
206 typename std::enable_if<is_serial_vector<VectorType>::value,
int>::type());
213 template <
class VectorType>
214 constexpr bool is_not_parallel_vector =
215 (is_supported_operation<is_vector_type, VectorType> ==
false) ||
216 (is_supported_operation<is_serial_vector_type, VectorType> ==
true);
#define DEAL_II_NAMESPACE_OPEN
#define DEAL_II_NAMESPACE_CLOSE