4 #include "multipatch_field.hpp"
5 #include "multipatch_type.hpp"
8 inline constexpr
bool enable_multipatch_field_mem =
false;
11 inline constexpr
bool is_multipatch_field_mem_v
12 = enable_multipatch_field_mem<std::remove_const_t<std::remove_reference_t<T>>>;
28 template <
template <
typename P>
typename T,
class... Patches>
32 (has_data_access_methods_v<
T<Patches>> && ...),
33 "The MultipatchFieldMem type should only contain instances of objects that can be "
34 "manipulated like fields.");
37 "The MultipatchFieldMem type should only contain instances of objects that allocate "
48 template <
class Patch>
52 template <
class Patch>
56 template <
class Patch>
59 template <
template <
typename P>
typename OT,
class... OPatches>
70 using memory_space =
typename base_type::example_element::memory_space;
72 using element_type =
typename base_type::example_element::element_type;
92 template <
class MultipatchObj>
94 :
base_type(std::move(
T<Patches>(other.template
get<Patches>()))...)
96 static_assert(is_multipatch_type_v<MultipatchObj>);
105 template <
template <
typename P>
typename OT,
class... OPatches>
109 std::is_same_v<ddc::detail::TypeSeq<Patches...>, ddc::detail::TypeSeq<OPatches...>>,
110 "Cannot create a MultipatchFieldMem from a temporary MultipatchFieldMem with a "
114 std::is_same_v<std::tuple<
T<Patches>...>, std::tuple<OT<OPatches>...>>,
115 "MultipatchFieldMems are not equivalent");
126 template <
class Patch>
138 template <
class Patch>
200 template <
template <
typename P>
typename T,
class... Patches>
203 template <
template <
typename P>
typename T,
class... Patches>
204 inline constexpr
bool enable_multipatch_field_mem<
MultipatchFieldMem<
T, Patches...>> =
true;
206 template <
template <
typename P>
typename T,
class... Patches>
209 template <
template <
typename P>
typename T,
class... Patches>
210 inline constexpr
bool enable_data_access_methods<
MultipatchFieldMem<
T, Patches...>> =
true;
A class to store field memory block objects on patches.
Definition: multipatch_field_mem.hpp:30
typename T< Patch >::span_type InternalFieldOnPatch
An internal type alias that is only instantiated if the get_const_field method is called.
Definition: multipatch_field_mem.hpp:53
auto get_const_field() const
Get a MultipatchConstField containing constant fields so the values cannot be modified.
Definition: multipatch_field_mem.hpp:182
auto idx_range() const
Get a MultipatchType containing the index ranges on which the fields are defined.
Definition: multipatch_field_mem.hpp:149
MultipatchFieldMem(MultipatchObj &other)
Create a MultipatchFieldMem class by copying an instance of another compatible MultipatchFieldMem.
Definition: multipatch_field_mem.hpp:93
typename T< Patch >::view_type InternalConstFieldOnPatch
An internal type alias that is only instantiated if the get_const_field method is called.
Definition: multipatch_field_mem.hpp:57
MultipatchFieldMem(T< Patches >... args)
Instantiate the MultipatchFieldMem class from an arbitrary number of objects.
Definition: multipatch_field_mem.hpp:80
auto get() const
Retrieve an object from the patch that it is defined on.
Definition: multipatch_field_mem.hpp:127
MultipatchFieldMem(MultipatchFieldMem< OT, OPatches... > &&other)
Create a MultipatchFieldMem class from an r-value (temporary) instance of another MultipatchFieldMem ...
Definition: multipatch_field_mem.hpp:106
auto get()
Retrieve an object from the patch that it is defined on.
Definition: multipatch_field_mem.hpp:139
typename base_type::example_element::element_type element_type
The type of the elements inside the field.
Definition: multipatch_field_mem.hpp:72
auto span_view()
Get a MultipatchField containing modifiable fields.
Definition: multipatch_field_mem.hpp:172
auto get_field()
Get a MultipatchField containing modifiable fields.
Definition: multipatch_field_mem.hpp:160
typename base_type::example_element::memory_space memory_space
The memory space (CPU/GPU) where the data is saved.
Definition: multipatch_field_mem.hpp:70
auto span_cview() const
Get a MultipatchField containing constant fields so the values cannot be modified.
Definition: multipatch_field_mem.hpp:194
typename T< Patch >::discrete_domain_type InternalIdxRangeOnPatch
An internal type alias that is only instantiated if the idx_range method is called.
Definition: multipatch_field_mem.hpp:49
A class to store field objects on patches.
Definition: multipatch_field.hpp:30
A class to store several objects that are of a type which is templated by the patch.
Definition: multipatch_type.hpp:32
ddc::detail::TypeSeq< Patches... > PatchOrdering
A tag storing the order of Patches in this MultipatchType.
Definition: multipatch_type.hpp:35
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