12#ifndef DUMUX_COMMON_PARTIAL_HH
13#define DUMUX_COMMON_PARTIAL_HH
18#include <dune/istl/multitypeblockvector.hh>
27template<
class ...Args, std::size_t ...i>
30 return Dune::MultiTypeBlockVector<std::add_lvalue_reference_t<std::decay_t<std::tuple_element_t<indices, std::tuple<Args...>>>>...>(v[indices]...);
38template<
class ...Args, std::size_t ...i>
41 return Dune::MultiTypeBlockVector<std::add_lvalue_reference_t<
const std::decay_t<std::tuple_element_t<indices, std::tuple<Args...>>>>...>(v[indices]...);
49template<
class ...Args, std::size_t ...i>
50auto partial(std::tuple<Args...>& v, Dune::index_constant<i>... indices)
52 return std::tuple<std::add_lvalue_reference_t<std::decay_t<std::tuple_element_t<indices, std::tuple<Args...>>>>...>(std::get<indices>(v)...);
60template<
class ...Args, std::size_t ...i>
61auto partial(
const std::tuple<Args...>& v, Dune::index_constant<i>... indices)
63 return std::tuple<std::add_lvalue_reference_t<
const std::decay_t<std::tuple_element_t<indices, std::tuple<Args...>>>>...>(std::get<indices>(v)...);
71template<
class T, std::size_t ...i>
72auto partial(T& t, std::tuple<Dune::index_constant<i>...> indices)
74 return partial(t, Dune::index_constant<i>{}...);
Definition: variablesbackend.hh:31
auto partial(Dune::MultiTypeBlockVector< Args... > &v, Dune::index_constant< i >... indices)
a function to get a MultiTypeBlockVector with references to some entries of another MultiTypeBlockVec...
Definition: partial.hh:28