24#ifndef DUMUX_COMMON_PARTIAL_HH
25#define DUMUX_COMMON_PARTIAL_HH
30#include <dune/istl/multitypeblockvector.hh>
39template<
class ...Args, std::size_t ...i>
40auto partial(Dune::MultiTypeBlockVector<Args...>& v, Dune::index_constant<i>... indices)
42 return Dune::MultiTypeBlockVector<std::add_lvalue_reference_t<std::decay_t<std::tuple_element_t<indices, std::tuple<Args...>>>>...>(v[indices]...);
50template<
class ...Args, std::size_t ...i>
51auto partial(
const Dune::MultiTypeBlockVector<Args...>& v, Dune::index_constant<i>... indices)
53 return Dune::MultiTypeBlockVector<std::add_lvalue_reference_t<
const std::decay_t<std::tuple_element_t<indices, std::tuple<Args...>>>>...>(v[indices]...);
61template<
class ...Args, std::size_t ...i>
62auto partial(std::tuple<Args...>& v, Dune::index_constant<i>... indices)
64 return std::tuple<std::add_lvalue_reference_t<std::decay_t<std::tuple_element_t<indices, std::tuple<Args...>>>>...>(std::get<indices>(v)...);
72template<
class ...Args, std::size_t ...i>
73auto partial(
const std::tuple<Args...>& v, Dune::index_constant<i>... indices)
75 return std::tuple<std::add_lvalue_reference_t<
const std::decay_t<std::tuple_element_t<indices, std::tuple<Args...>>>>...>(std::get<indices>(v)...);
83template<
class T, std::size_t ...i>
84auto partial(T& t, std::tuple<Dune::index_constant<i>...> indices)
86 return partial(t, Dune::index_constant<i>{}...);
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:40