1 #ifndef DUNE_PDELAB_BACKEND_INTERFACE_HH
2 #define DUNE_PDELAB_BACKEND_INTERFACE_HH
6 #include <dune/common/deprecated.hh>
18 template<
typename Backend,
typename Gr
idFunctionSpace,
typename FieldType>
19 struct BackendVectorSelectorHelper
22 template<
typename Gr
idFunctionSpace,
typename FieldType>
23 struct BackendVectorSelector
26 typedef typename BackendVectorSelectorHelper<Backend, GridFunctionSpace, FieldType>::Type Type;
29 template<
typename Backend,
typename VU,
typename VV,
typename E>
30 struct BackendMatrixSelector
32 typedef typename Backend::template MatrixHelper<VV,VU,E>::type Type;
52 template<
typename NativeContainer>
57 using native_type = NativeContainer;
60 static auto access_native(U&& u) -> decltype(u.native())
70 "u.native() must return a cv-qualified xvalue of type T"
82 template<
typename Gr
idFunctionSpace,
typename FieldType>
83 using BackendVectorSelector DUNE_DEPRECATED_MSG(
"Direct usage of BackendVectorSelector is deprecated and will be disabled after PDELab 2.4, use Dune::PDELab::Backend::Vector instead") = Backend::impl::BackendVectorSelector<GridFunctionSpace,FieldType>;
85 template<
typename Backend_,
typename VU,
typename VV,
typename E>
86 using BackendMatrixSelector DUNE_DEPRECATED_MSG(
"Direct usage of BackendMatrixSelector is deprecated and will be disabled after PDELab 2.4, use Dune::PDELab::Backend::Matrix instead") = Backend::impl::BackendMatrixSelector<Backend_,VU,VV,E>;
111 template<
typename Gr
idFunctionSpace,
typename FieldType>
112 using Vector =
typename impl::BackendVectorSelector<GridFunctionSpace, FieldType>::Type;
132 template<
typename Backend,
typename VU,
typename VV,
typename E>
133 using Matrix =
typename impl::BackendMatrixSelector<Backend, VU, VV, E>::Type;
160 struct lazy_native_type
166 using type =
typename U::native_type;
171 using type =
typename std::conditional<
175 >::type::template evaluate<T>::type;
182 using Native =
typename native_type<T>::type;
194 typename std::enable_if<
200 return impl::Wrapper<Native<T>>::access_native(t);
205 typename std::enable_if<
206 std::is_base_of<impl::WrapperBase,T>::value,
211 return impl::Wrapper<Native<T>>::access_native(t);
216 typename std::enable_if<
217 !std::is_base_of<impl::WrapperBase,typename std::decay<T>::type>
::value,
218 decltype(std::forward<T>(std::declval<T&&>()))
222 return std::forward<T>(t);
231 #endif // DUNE_PDELAB_BACKEND_INTERFACE_HH
B Backend
Definition: gridfunctionspace.hh:66
typename impl::BackendVectorSelector< GridFunctionSpace, FieldType >::Type Vector
alias of the return type of BackendVectorSelector
Definition: backend/interface.hh:112
static const unsigned int value
Definition: gridfunctionspace/tags.hh:175
std::enable_if< std::is_base_of< impl::WrapperBase, T >::value, Native< T > & >::type native(T &t)
Definition: backend/interface.hh:198
Definition: adaptivity.hh:27
typename native_type< T >::type Native
Alias of the native container type associated with T or T itself if it is not a backend wrapper...
Definition: backend/interface.hh:182
typename impl::BackendMatrixSelector< Backend, VU, VV, E >::Type Matrix
alias of the return type of BackendMatrixSelector
Definition: backend/interface.hh:133