16#ifndef dealii_matrix_free_type_traits_h
17#define dealii_matrix_free_type_traits_h
40 using local_element_t =
decltype(std::declval<const T>().local_element(0));
43 constexpr bool has_local_element = is_supported_operation<local_element_t, T>;
50 using add_local_element_t =
51 decltype(std::declval<T>().add_local_element(0,
typename T::value_type()));
54 constexpr bool has_add_local_element =
55 is_supported_operation<add_local_element_t, T>;
62 using set_local_element_t =
63 decltype(std::declval<T>().set_local_element(0,
typename T::value_type()));
66 constexpr bool has_set_local_element =
67 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>;
112 template <
typename T,
typename Number>
113 struct is_vectorizable
115 static const bool value =
117 (has_local_element<T> ||
119 std::is_same_v<typename T::value_type, Number>;
123 template <
typename T,
typename Number>
124 const bool is_vectorizable<T, Number>::value;
138 template <
typename T>
139 using update_ghost_values_start_t =
140 decltype(std::declval<const T>().update_ghost_values_start(0));
142 template <
typename T>
143 constexpr bool has_update_ghost_values_start =
144 is_supported_operation<update_ghost_values_start_t, T>;
150 template <
typename T>
151 using compress_start_t =
154 template <
typename T>
155 constexpr bool has_compress_start =
156 is_supported_operation<compress_start_t, T>;
164 template <
typename T>
165 constexpr bool has_exchange_on_subset =
166 has_begin<T> && has_local_element<T> && has_partitioners_are_compatible<T>;
172 template <
typename T>
173 using communication_block_size_t =
decltype(T::communication_block_size);
175 template <
typename T>
176 constexpr bool has_communication_block_size =
177 is_supported_operation<communication_block_size_t, T>;
187 template <
class T,
class IsSerialVectorNotSpecialized =
void>
188 using not_parallel_vector_t = std::bool_constant<is_serial_vector<T>::value>;
195 template <
typename VectorType>
202 template <
typename VectorType>
203 using is_serial_vector_type =
204 decltype(std::enable_if_t<is_serial_vector<VectorType>::value,
int>());
211 template <
typename VectorType>
212 constexpr bool is_not_parallel_vector =
213 (is_supported_operation<is_vector_type, VectorType> ==
false) ||
214 (is_supported_operation<is_serial_vector_type, VectorType> ==
true);
#define DEAL_II_NAMESPACE_OPEN
#define DEAL_II_NAMESPACE_CLOSE