4 #include "ddc_alias_inline_functions.hpp"
5 #include "ddc_aliases.hpp"
9 inline constexpr
bool enable_multipatch_type =
false;
12 inline constexpr
bool is_multipatch_type_v
13 = enable_multipatch_type<std::remove_const_t<std::remove_reference_t<T>>>;
30 template <
template <
typename P>
typename T,
class... Patches>
47 template <
template <
typename P>
typename OT,
class... OPatches>
64 :
m_tuple(std::make_tuple(std::move(args)...))
82 template <
template <
typename P>
typename OT,
class... OPatches>
84 :
m_tuple(std::make_tuple(other.template
get<Patches>()...))
87 ddc::type_seq_contains_v<
PatchOrdering, ddc::detail::TypeSeq<OPatches...>>,
88 "The type being copied does not contain all the required patches");
90 std::is_same_v<std::tuple<
T<Patches>...>, std::tuple<OT<Patches>...>>,
91 "MultipatchTypes are not equivalent");
100 template <
template <
typename P>
typename OT,
class... OPatches>
102 :
m_tuple(std::make_tuple(std::move(other.template
get<Patches>())...))
105 std::is_same_v<ddc::detail::TypeSeq<Patches...>, ddc::detail::TypeSeq<OPatches...>>,
106 "Cannot create a MultipatchType from a temporary MultipatchType with a different "
109 std::is_same_v<std::tuple<
T<Patches>...>, std::tuple<OT<OPatches>...>>,
110 "MultipatchTypes are not equivalent");
121 template <
class Patch, std::enable_if_t<!has_data_access_methods_v<T<Patch>>,
bool> = true>
124 return std::get<T<Patch>>(
m_tuple);
131 static constexpr std::size_t
size()
133 return sizeof...(Patches);
141 KOKKOS_FUNCTION std::tuple<T<Patches>...>
const&
get_tuple()
const
147 template <
template <
typename P>
typename T,
class... Patches>
148 inline constexpr
bool enable_multipatch_type<
MultipatchType<
T, Patches...>> =
true;
A class to store several objects that are of a type which is templated by the patch.
Definition: multipatch_type.hpp:32
KOKKOS_FUNCTION T< Patch > get() const
Retrieve an object from the patch that it is defined on.
Definition: multipatch_type.hpp:122
KOKKOS_FUNCTION MultipatchType(T< Patches >... args)
Instantiate the MultipatchType class from an arbitrary number of objects.
Definition: multipatch_type.hpp:63
static constexpr std::size_t size()
Get the number of objects stored inside the class.
Definition: multipatch_type.hpp:131
KOKKOS_FUNCTION std::tuple< T< Patches >... > const & get_tuple() const
Get a constant reference to the tuple of objects stored inside this MultipatchType.
Definition: multipatch_type.hpp:141
KOKKOS_FUNCTION MultipatchType(MultipatchType< OT, OPatches... > const &other)
Create a MultipatchType class by copying an instance of another compatible MultipatchType.
Definition: multipatch_type.hpp:83
ddc::detail::TypeSeq< Patches... > PatchOrdering
A tag storing the order of Patches in this MultipatchType.
Definition: multipatch_type.hpp:35
MultipatchType(MultipatchType< OT, OPatches... > &&other)
Create a MultipatchType class from an r-value (temporary) instance of another MultipatchType which us...
Definition: multipatch_type.hpp:101
KOKKOS_FUNCTION MultipatchType(std::tuple< T< Patches >... > &&tuple)
A constructor for sub-classes which can build the necessary tuple directly following their own rules.
Definition: multipatch_type.hpp:55
std::tuple< T< Patches >... > m_tuple
The internal tuple containing the data.
Definition: multipatch_type.hpp:45
A class which describes the real space in the temporal direction.
Definition: geometry.hpp:45