16#ifndef dealii_matrix_free_type_traits_h
17#define dealii_matrix_free_type_traits_h
41 using local_element_t =
decltype(std::declval<const T>().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>;
75 using partitioners_are_compatible_t =
76 decltype(std::declval<const T>().partitioners_are_compatible(
77 std::declval<Utilities::MPI::Partitioner>()));
80 constexpr bool has_partitioners_are_compatible =
81 is_supported_operation<partitioners_are_compatible_t, T>;
88 using begin_t =
decltype(std::declval<const T>().begin());
91 constexpr bool has_begin = is_supported_operation<begin_t, T>;
98 using shared_vector_data_t =
99 decltype(std::declval<const T>().shared_vector_data());
101 template <
typename T>
102 constexpr bool has_shared_vector_data =
103 is_supported_operation<shared_vector_data_t, T>;
117 template <
typename T>
118 using update_ghost_values_start_t =
119 decltype(std::declval<const T>().update_ghost_values_start(0));
121 template <
typename T>
122 constexpr bool has_update_ghost_values_start =
123 is_supported_operation<update_ghost_values_start_t, T>;
129 template <
typename T>
130 using compress_start_t =
133 template <
typename T>
134 constexpr bool has_compress_start =
135 is_supported_operation<compress_start_t, T>;
143 template <
typename T>
144 constexpr bool has_exchange_on_subset =
145 has_begin<T> && has_local_element<T> && has_partitioners_are_compatible<T>;
151 template <
typename T>
152 using communication_block_size_t =
decltype(T::communication_block_size);
154 template <
typename T>
155 constexpr bool has_communication_block_size =
156 is_supported_operation<communication_block_size_t, T>;
163 template <
typename VectorType>
170 template <
typename VectorType>
171 using is_serial_vector_type =
172 decltype(std::enable_if_t<is_serial_vector<VectorType>::value,
int>());
179 template <
typename VectorType>
180 constexpr bool is_not_parallel_vector =
181 (is_supported_operation<is_vector_type, VectorType> ==
false) ||
182 (is_supported_operation<is_serial_vector_type, VectorType> ==
true);
190 template <
typename VectorType>
191 struct is_serial_vector_or_array
193 static const bool value =
194 is_supported_operation<is_serial_vector_type, VectorType>;
201 template <
typename Number>
202 struct is_serial_vector_or_array<::
ArrayView<Number>>
204 static const bool value =
true;
208 template <
typename VectorType>
209 const bool is_serial_vector_or_array<VectorType>::value;
218 template <
typename T,
typename Number>
219 struct is_vectorizable
221 static const bool value =
223 (has_local_element<T> || is_serial_vector_or_array<T>::value) &&
224 std::is_same_v<typename T::value_type, Number>;
228 template <
typename T,
typename Number>
229 const bool is_vectorizable<T, Number>::value;
#define DEAL_II_NAMESPACE_OPEN
#define DEAL_II_NAMESPACE_CLOSE