12#include <Kokkos_Assert.hpp>
13#include <Kokkos_Macros.hpp>
15#include "detail/type_seq.hpp"
25template <
class... DDims>
33template <
class... Tags>
44template <
class... Tags>
47 using type = TypeSeq<Tags...>;
50template <
class T,
class U>
53template <
class... DDims,
class... ODDims>
61template <
class... ODDims>
66 return DiscreteVector<ODDims...>((get<ODDims>(lhs) * get<ODDims>(rhs))...);
69template <
class... DDims>
76 type_seq_is_unique_v<detail::TypeSeq<DDims...>>,
77 "The dimensions of a StridedDiscreteDomain must be unique");
80 using discrete_element_type = DiscreteElement<DDims...>;
85 DiscreteElement<DDims...> m_element_begin;
92 static KOKKOS_FUNCTION
constexpr std::size_t
rank()
94 return sizeof...(DDims);
102 class = std::enable_if_t<(is_strided_discrete_domain_v<DDoms> && ...)>>
104 : m_element_begin(domains.front()...)
105 , m_extents(domains.extents()...)
106 , m_strides(domains.strides()...)
111
112
113
114
116 discrete_element_type
const& element_begin,
117 discrete_vector_type
const& extents,
118 discrete_vector_type
const& strides)
119 : m_element_begin(element_begin)
136 template <
class... ODims>
139 if (
empty() && other.empty()) {
142 return m_element_begin == other.m_element_begin && m_extents == other.m_extents
143 && m_strides == other.m_strides;
146#if !defined(__cpp_impl_three_way_comparison
) || __cpp_impl_three_way_comparison
< 201902L
148 template <
class...
ODims>
151 return !(*
this ==
other);
155 KOKKOS_FUNCTION
constexpr std::size_t
size()
const
157 return (1UL * ... * get<DDims>(m_extents));
160 KOKKOS_FUNCTION
constexpr discrete_vector_type
extents()
const noexcept
165 KOKKOS_FUNCTION
constexpr discrete_vector_type
strides()
const noexcept
170 template <
class QueryDDim>
176 KOKKOS_FUNCTION
constexpr discrete_element_type
front()
const noexcept
178 return m_element_begin;
181 KOKKOS_FUNCTION
constexpr discrete_element_type
back()
const noexcept
183 return discrete_element_type(
184 (DiscreteElement<DDims>(m_element_begin)
185 + (get<DDims>(m_extents) - 1) * get<DDims>(m_strides))...);
209 discrete_vector_type n1,
210 discrete_vector_type n2)
const
215 KOKKOS_FUNCTION
constexpr DiscreteElement<DDims...>
operator()(
218 return m_element_begin + prod(dvect, m_strides);
221 template <
class... DElems>
222 KOKKOS_FUNCTION
bool contains(DElems
const&... delems)
const noexcept
225 sizeof...(DDims) == (0 + ... + DElems::size()),
226 "Invalid number of dimensions");
227 static_assert((is_discrete_element_v<DElems> && ...),
"Expected DiscreteElements");
228 auto const contains_1d = [](DiscreteElementType
const i,
229 DiscreteElementType
const b,
230 DiscreteVectorElement
const n,
231 DiscreteVectorElement
const s) {
232 return (i >= b) && (i < (b + (n - 1) * s + 1)) && ((i - b) % s == 0);
234 DiscreteElement<DDims...>
const delem(delems...);
235 for (std::size_t i = 0; i <
rank(); ++i) {
237 detail::array(delem)[i],
238 detail::array(m_element_begin)[i],
239 detail::array(m_extents)[i],
240 detail::array(m_strides)[i])) {
247 template <
class... DElems>
249 DElems
const&... delems)
const noexcept
252 sizeof...(DDims) == (0 + ... + DElems::size()),
253 "Invalid number of dimensions");
254 static_assert((is_discrete_element_v<DElems> && ...),
"Expected DiscreteElements");
255 KOKKOS_ASSERT(contains(delems...))
257 ((DiscreteElement<DDims>(take<DDims>(delems...))
258 - DiscreteElement<DDims>(m_element_begin))
262 KOKKOS_FUNCTION
constexpr bool empty()
const noexcept
267 KOKKOS_FUNCTION
constexpr explicit operator bool()
273 std::size_t N =
sizeof...(DDims),
274 class DDim0 = std::enable_if_t<N == 1, std::tuple_element_t<0, std::tuple<DDims...>>>>
275 KOKKOS_FUNCTION
auto begin()
const
281 std::size_t N =
sizeof...(DDims),
282 class DDim0 = std::enable_if_t<N == 1, std::tuple_element_t<0, std::tuple<DDims...>>>>
283 KOKKOS_FUNCTION
auto end()
const
286 DDim0>(m_element_begin + m_extents * m_strides, m_strides);
290 std::size_t N =
sizeof...(DDims),
291 class DDim0 = std::enable_if_t<N == 1, std::tuple_element_t<0, std::tuple<DDims...>>>>
292 KOKKOS_FUNCTION
auto cbegin()
const
298 std::size_t N =
sizeof...(DDims),
299 class DDim0 = std::enable_if_t<N == 1, std::tuple_element_t<0, std::tuple<DDims...>>>>
300 KOKKOS_FUNCTION
auto cend()
const
303 DDim0>(m_element_begin + m_extents * m_strides, m_strides);
307 std::size_t N =
sizeof...(DDims),
308 class = std::enable_if_t<N == 1, std::tuple_element_t<0, std::tuple<DDims...>>>>
309 KOKKOS_FUNCTION
constexpr decltype(
auto)
operator[](std::size_t n)
315 std::size_t N =
sizeof...(DDims),
316 class = std::enable_if_t<N == 1, std::tuple_element_t<0, std::tuple<DDims...>>>>
317 KOKKOS_FUNCTION
constexpr decltype(
auto)
operator[](std::size_t n)
const
330 using discrete_element_type = DiscreteElement<>;
334 static KOKKOS_FUNCTION
constexpr std::size_t
rank()
342 template <
class... ODDims>
349
350
351
352
354 [[
maybe_unused]] discrete_element_type
const& element_begin,
377#if !defined(__cpp_impl_three_way_comparison
) || __cpp_impl_three_way_comparison
< 201902L
381 return !(*
this ==
other);
385 static KOKKOS_FUNCTION
constexpr std::size_t
size()
390 static KOKKOS_FUNCTION
constexpr discrete_vector_type
extents()
noexcept
395 static KOKKOS_FUNCTION
constexpr discrete_element_type
front()
noexcept
400 static KOKKOS_FUNCTION
constexpr discrete_element_type
back()
noexcept
426 discrete_vector_type ,
427 discrete_vector_type )
const
432 KOKKOS_FUNCTION
constexpr DiscreteElement<>
operator()(
438 static KOKKOS_FUNCTION
bool contains()
noexcept
443 static KOKKOS_FUNCTION
bool contains(DiscreteElement<>)
noexcept
458 static KOKKOS_FUNCTION
constexpr bool empty()
noexcept
463 KOKKOS_FUNCTION
constexpr explicit operator bool()
469template <
class... QueryDDims,
class... DDims>
479struct ConvertTypeSeqToStridedDiscreteDomain;
481template <
class... DDims>
482struct ConvertTypeSeqToStridedDiscreteDomain<detail::TypeSeq<DDims...>>
488using convert_type_seq_to_strided_discrete_domain_t =
489 typename ConvertTypeSeqToStridedDiscreteDomain<T>::type;
494template <
class... DDimsA,
class... DDimsB>
499 using TagSeqA = detail::TypeSeq<DDimsA...>;
500 using TagSeqB = detail::TypeSeq<DDimsB...>;
502 using type_seq_r = type_seq_remove_t<TagSeqA, TagSeqB>;
503 return detail::convert_type_seq_to_strided_discrete_domain_t<type_seq_r>(DDom_a);
509template <
class... DDimsB,
class... DDimsA>
513 using TagSeqA = detail::TypeSeq<DDimsA...>;
514 using TagSeqB = detail::TypeSeq<DDimsB...>;
516 using type_seq_r = type_seq_remove_t<TagSeqA, TagSeqB>;
517 return detail::convert_type_seq_to_strided_discrete_domain_t<type_seq_r>(DDom_a);
523template <
typename DDim1,
typename DDim2,
typename DDimA,
typename... DDimsB>
524KOKKOS_FUNCTION
constexpr std::conditional_t<
525 std::is_same_v<DDimA, DDim1>,
532 if constexpr (std::is_same_v<DDimA, DDim1>) {
542template <
typename DDim1,
typename DDim2,
typename... DDimsA,
typename... DDimsB>
548 using TagSeqA = detail::TypeSeq<DDimsA...>;
549 using TagSeqB = detail::TypeSeq<DDim1>;
550 using TagSeqC = detail::TypeSeq<DDim2>;
552 using type_seq_r =
ddc::type_seq_replace_t<TagSeqA, TagSeqB, TagSeqC>;
553 return ddc::detail::convert_type_seq_to_strided_discrete_domain_t<type_seq_r>(
554 detail::replace_dim_of_1d<
561template <
class... QueryDDims,
class... DDims>
568template <
class... QueryDDims,
class... DDims>
569KOKKOS_FUNCTION
constexpr DiscreteElement<QueryDDims...>
front(
575template <
class... QueryDDims,
class... DDims>
576KOKKOS_FUNCTION
constexpr DiscreteElement<QueryDDims...>
back(
586 DiscreteElement<DDim> m_value = DiscreteElement<DDim>();
591 using iterator_category = std::random_access_iterator_tag;
593 using value_type = DiscreteElement<DDim>;
595 using difference_type = std::ptrdiff_t;
600 DiscreteElement<DDim> value,
607 KOKKOS_FUNCTION
constexpr DiscreteElement<DDim>
operator*()
const noexcept
640 if (n >=
static_cast<difference_type>(0)) {
641 m_value +=
static_cast<DiscreteElementType>(n) * m_stride;
643 m_value -=
static_cast<DiscreteElementType>(-n) * m_stride;
650 if (n >=
static_cast<difference_type>(0)) {
651 m_value -=
static_cast<DiscreteElementType>(n) * m_stride;
653 m_value +=
static_cast<DiscreteElementType>(-n) * m_stride;
658 KOKKOS_FUNCTION
constexpr DiscreteElement<DDim>
operator[](difference_type n)
const
660 return m_value + n * m_stride;
663 friend KOKKOS_FUNCTION
constexpr bool operator==(
667 return xx.m_value == yy.m_value;
670#if !defined(__cpp_impl_three_way_comparison
) || __cpp_impl_three_way_comparison
< 201902L
680 friend KOKKOS_FUNCTION
constexpr bool operator<(
684 return xx.m_value < yy.m_value;
687 friend KOKKOS_FUNCTION
constexpr bool operator>(
694 friend KOKKOS_FUNCTION
constexpr bool operator<=(
701 friend KOKKOS_FUNCTION
constexpr bool operator>=(
729 friend KOKKOS_FUNCTION
constexpr difference_type
operator-(
733 return (yy.m_value > xx.m_value) ? (-
static_cast<difference_type>(yy.m_value - xx.m_value))
734 : (xx.m_value - yy.m_value);
friend class DiscreteDomain
KOKKOS_DEFAULTED_FUNCTION constexpr DiscreteElement()=default
KOKKOS_FUNCTION constexpr bool operator!=(DiscreteVector< OTags... > const &rhs) const noexcept
KOKKOS_DEFAULTED_FUNCTION constexpr DiscreteVector()=default
Impl & operator=(Impl &&x)=default
KOKKOS_FUNCTION Coordinate< CDim > origin() const noexcept
Lower bound index of the mesh.
KOKKOS_FUNCTION discrete_element_type front() const noexcept
Lower bound index of the mesh.
KOKKOS_FUNCTION Coordinate< CDim > coordinate(discrete_element_type const &icoord) const noexcept
Convert a mesh index into a position in CDim
Impl(Impl const &)=delete
KOKKOS_FUNCTION std::size_t n_period() const
Number of steps in a period.
Impl(Impl< DDim, OriginMemorySpace > const &impl)
Impl(Coordinate< CDim > origin, Real step, std::size_t n_period)
Construct a Impl from a point and a spacing step.
KOKKOS_FUNCTION Real step() const
Spacing step of the mesh.
Impl & operator=(Impl const &x)=delete
PeriodicSampling models a periodic discretization of the provided continuous dimension.
static std::tuple< typename DDim::template Impl< DDim, Kokkos::HostSpace >, DiscreteDomain< DDim > > init(Coordinate< CDim > a, Coordinate< CDim > b, DiscreteVector< DDim > n, DiscreteVector< DDim > n_period)
Construct a Impl<Kokkos::HostSpace> and associated discrete_domain_type from a segment and a number ...
std::tuple< Impl< DDim, Kokkos::HostSpace >, DiscreteDomain< DDim >, DiscreteDomain< DDim >, DiscreteDomain< DDim >, DiscreteDomain< DDim > > init_ghosted(Coordinate< CDim > a, Coordinate< CDim > b, DiscreteVector< DDim > n, DiscreteVector< DDim > n_period, DiscreteVector< DDim > n_ghosts_before, DiscreteVector< DDim > n_ghosts_after)
Construct a periodic DiscreteDomain from a segment and a number of points n.
std::tuple< Impl< DDim, Kokkos::HostSpace >, DiscreteDomain< DDim >, DiscreteDomain< DDim >, DiscreteDomain< DDim >, DiscreteDomain< DDim > > init_ghosted(Coordinate< CDim > a, Coordinate< CDim > b, DiscreteVector< DDim > n, DiscreteVector< DDim > n_period, DiscreteVector< DDim > n_ghosts)
Construct a periodic DiscreteDomain from a segment and a number of points n.
ScopeGuard & operator=(ScopeGuard const &x)=delete
ScopeGuard(ScopeGuard &&x) noexcept=delete
ScopeGuard & operator=(ScopeGuard &&x) noexcept=delete
ScopeGuard(int, char **&)
ScopeGuard(ScopeGuard const &x)=delete
static KOKKOS_FUNCTION bool contains(DiscreteElement<>) noexcept
KOKKOS_FUNCTION constexpr SparseDiscreteDomain remove(discrete_vector_type, discrete_vector_type) const
KOKKOS_FUNCTION constexpr SparseDiscreteDomain take_first(discrete_vector_type) const
static KOKKOS_FUNCTION constexpr std::size_t rank()
KOKKOS_DEFAULTED_FUNCTION constexpr SparseDiscreteDomain()=default
KOKKOS_FUNCTION constexpr DiscreteElement operator()(DiscreteVector<> const &) const noexcept
KOKKOS_FUNCTION constexpr SparseDiscreteDomain remove_last(discrete_vector_type) const
static KOKKOS_FUNCTION DiscreteVector distance_from_front() noexcept
static KOKKOS_FUNCTION constexpr std::size_t size()
static KOKKOS_FUNCTION constexpr bool empty() noexcept
static KOKKOS_FUNCTION DiscreteVector distance_from_front(DiscreteElement<>) noexcept
KOKKOS_FUNCTION constexpr bool operator==(SparseDiscreteDomain const &) const
static KOKKOS_FUNCTION constexpr discrete_element_type back() noexcept
static KOKKOS_FUNCTION bool contains() noexcept
KOKKOS_FUNCTION constexpr SparseDiscreteDomain take_last(discrete_vector_type) const
KOKKOS_FUNCTION constexpr operator bool()
KOKKOS_DEFAULTED_FUNCTION SparseDiscreteDomain & operator=(SparseDiscreteDomain const &x)=default
KOKKOS_DEFAULTED_FUNCTION SparseDiscreteDomain & operator=(SparseDiscreteDomain &&x)=default
KOKKOS_FUNCTION constexpr SparseDiscreteDomain remove_first(discrete_vector_type) const
KOKKOS_DEFAULTED_FUNCTION SparseDiscreteDomain(SparseDiscreteDomain const &x)=default
KOKKOS_DEFAULTED_FUNCTION ~SparseDiscreteDomain()=default
static KOKKOS_FUNCTION constexpr discrete_element_type front() noexcept
KOKKOS_FUNCTION constexpr SparseDiscreteDomain(SparseDiscreteDomain< ODDims... > const &)
static KOKKOS_FUNCTION constexpr discrete_vector_type extents() noexcept
KOKKOS_DEFAULTED_FUNCTION SparseDiscreteDomain(SparseDiscreteDomain &&x)=default
KOKKOS_FUNCTION constexpr discrete_element_type back() const noexcept
KOKKOS_FUNCTION constexpr SparseDiscreteDomain remove_first(discrete_vector_type n) const
static KOKKOS_FUNCTION constexpr std::size_t rank()
KOKKOS_FUNCTION constexpr decltype(auto) operator[](std::size_t n) const
KOKKOS_DEFAULTED_FUNCTION SparseDiscreteDomain & operator=(SparseDiscreteDomain const &x)=default
KOKKOS_FUNCTION constexpr SparseDiscreteDomain take_last(discrete_vector_type n) const
KOKKOS_FUNCTION DiscreteVector< DDims... > distance_from_front(DElems const &... delems) const noexcept
KOKKOS_FUNCTION constexpr auto discrete_elements() const noexcept
KOKKOS_FUNCTION constexpr SparseDiscreteDomain remove(discrete_vector_type n1, discrete_vector_type n2) const
KOKKOS_FUNCTION constexpr SparseDiscreteDomain(DDoms const &... domains)
Construct a SparseDiscreteDomain by copies and merge of domains.
SparseDiscreteDomain(Kokkos::View< DiscreteElement< DDims > *, Kokkos::SharedSpace > const &... views)
Construct a SparseDiscreteDomain with Kokkos::View explicitly listing the discrete elements.
KOKKOS_FUNCTION auto cbegin() const
KOKKOS_FUNCTION constexpr decltype(auto) operator[](std::size_t n)
KOKKOS_DEFAULTED_FUNCTION SparseDiscreteDomain & operator=(SparseDiscreteDomain &&x)=default
KOKKOS_FUNCTION constexpr std::size_t size() const
KOKKOS_FUNCTION constexpr bool operator==(SparseDiscreteDomain< ODims... > const &other) const
KOKKOS_FUNCTION bool contains(DElems const &... delems) const noexcept
KOKKOS_FUNCTION constexpr SparseDiscreteDomain take_first(discrete_vector_type n) const
KOKKOS_DEFAULTED_FUNCTION SparseDiscreteDomain()=default
KOKKOS_DEFAULTED_FUNCTION SparseDiscreteDomain(SparseDiscreteDomain &&x)=default
KOKKOS_FUNCTION constexpr discrete_element_type front() const noexcept
KOKKOS_FUNCTION constexpr operator bool()
KOKKOS_FUNCTION constexpr bool empty() const noexcept
KOKKOS_FUNCTION constexpr DiscreteElement< DDims... > operator()(DiscreteVector< DDims... > const &dvect) const noexcept
KOKKOS_DEFAULTED_FUNCTION SparseDiscreteDomain(SparseDiscreteDomain const &x)=default
KOKKOS_FUNCTION constexpr SparseDiscreteDomain remove_last(discrete_vector_type n) const
KOKKOS_FUNCTION auto end() const
KOKKOS_FUNCTION auto cend() const
friend class SparseDiscreteDomain
KOKKOS_FUNCTION auto begin() const
KOKKOS_FUNCTION constexpr discrete_vector_type extents() const noexcept
KOKKOS_FUNCTION constexpr DiscreteVector< QueryDDim > extent() const noexcept
KOKKOS_DEFAULTED_FUNCTION ~SparseDiscreteDomain()=default
static KOKKOS_FUNCTION DiscreteVector distance_from_front() noexcept
KOKKOS_DEFAULTED_FUNCTION StridedDiscreteDomain & operator=(StridedDiscreteDomain &&x)=default
KOKKOS_FUNCTION constexpr StridedDiscreteDomain take_first(discrete_vector_type) const
static KOKKOS_FUNCTION constexpr std::size_t size()
KOKKOS_FUNCTION constexpr StridedDiscreteDomain(discrete_element_type const &element_begin, discrete_vector_type const &size, discrete_vector_type const &strides)
Construct a StridedDiscreteDomain starting from element_begin with size points.
KOKKOS_FUNCTION constexpr StridedDiscreteDomain remove(discrete_vector_type, discrete_vector_type) const
static KOKKOS_FUNCTION bool contains(DiscreteElement<>) noexcept
static KOKKOS_FUNCTION constexpr discrete_element_type front() noexcept
KOKKOS_FUNCTION constexpr StridedDiscreteDomain take_last(discrete_vector_type) const
KOKKOS_FUNCTION constexpr bool operator==(StridedDiscreteDomain const &) const
KOKKOS_FUNCTION constexpr StridedDiscreteDomain remove_first(discrete_vector_type) const
static KOKKOS_FUNCTION bool contains() noexcept
KOKKOS_FUNCTION constexpr StridedDiscreteDomain remove_last(discrete_vector_type) const
static KOKKOS_FUNCTION constexpr discrete_vector_type extents() noexcept
static KOKKOS_FUNCTION constexpr std::size_t rank()
KOKKOS_DEFAULTED_FUNCTION StridedDiscreteDomain(StridedDiscreteDomain &&x)=default
static KOKKOS_FUNCTION DiscreteVector distance_from_front(DiscreteElement<>) noexcept
KOKKOS_DEFAULTED_FUNCTION constexpr StridedDiscreteDomain()=default
KOKKOS_FUNCTION constexpr operator bool()
static KOKKOS_FUNCTION constexpr bool empty() noexcept
KOKKOS_DEFAULTED_FUNCTION StridedDiscreteDomain(StridedDiscreteDomain const &x)=default
KOKKOS_FUNCTION constexpr DiscreteElement operator()(DiscreteVector<> const &) const noexcept
static KOKKOS_FUNCTION constexpr discrete_element_type back() noexcept
KOKKOS_FUNCTION constexpr StridedDiscreteDomain(StridedDiscreteDomain< ODDims... > const &)
KOKKOS_DEFAULTED_FUNCTION ~StridedDiscreteDomain()=default
KOKKOS_DEFAULTED_FUNCTION StridedDiscreteDomain & operator=(StridedDiscreteDomain const &x)=default
KOKKOS_DEFAULTED_FUNCTION StridedDiscreteDomain & operator=(StridedDiscreteDomain const &x)=default
KOKKOS_FUNCTION constexpr discrete_vector_type extents() const noexcept
KOKKOS_FUNCTION constexpr operator bool()
KOKKOS_FUNCTION constexpr StridedDiscreteDomain take_first(discrete_vector_type n) const
KOKKOS_FUNCTION constexpr DiscreteVector< QueryDDim > extent() const noexcept
KOKKOS_FUNCTION constexpr discrete_element_type front() const noexcept
KOKKOS_FUNCTION bool contains(DElems const &... delems) const noexcept
KOKKOS_FUNCTION constexpr std::size_t size() const
KOKKOS_FUNCTION auto cend() const
KOKKOS_FUNCTION constexpr StridedDiscreteDomain(DDoms const &... domains)
Construct a StridedDiscreteDomain by copies and merge of domains.
KOKKOS_FUNCTION DiscreteVector< DDims... > distance_from_front(DElems const &... delems) const noexcept
KOKKOS_DEFAULTED_FUNCTION StridedDiscreteDomain(StridedDiscreteDomain &&x)=default
KOKKOS_FUNCTION constexpr discrete_vector_type strides() const noexcept
KOKKOS_DEFAULTED_FUNCTION StridedDiscreteDomain & operator=(StridedDiscreteDomain &&x)=default
KOKKOS_FUNCTION constexpr StridedDiscreteDomain remove(discrete_vector_type n1, discrete_vector_type n2) const
KOKKOS_FUNCTION constexpr StridedDiscreteDomain remove_first(discrete_vector_type n) const
KOKKOS_FUNCTION constexpr discrete_element_type back() const noexcept
KOKKOS_DEFAULTED_FUNCTION StridedDiscreteDomain()=default
KOKKOS_FUNCTION constexpr DiscreteElement< DDims... > operator()(DiscreteVector< DDims... > const &dvect) const noexcept
friend class StridedDiscreteDomain
KOKKOS_FUNCTION auto begin() const
KOKKOS_FUNCTION auto end() const
KOKKOS_FUNCTION constexpr StridedDiscreteDomain remove_last(discrete_vector_type n) const
KOKKOS_FUNCTION constexpr StridedDiscreteDomain take_last(discrete_vector_type n) const
KOKKOS_DEFAULTED_FUNCTION ~StridedDiscreteDomain()=default
KOKKOS_DEFAULTED_FUNCTION StridedDiscreteDomain(StridedDiscreteDomain const &x)=default
KOKKOS_FUNCTION constexpr bool operator==(StridedDiscreteDomain< ODims... > const &other) const
KOKKOS_FUNCTION constexpr decltype(auto) operator[](std::size_t n)
static KOKKOS_FUNCTION constexpr std::size_t rank()
KOKKOS_FUNCTION auto cbegin() const
KOKKOS_FUNCTION constexpr bool empty() const noexcept
KOKKOS_FUNCTION constexpr decltype(auto) operator[](std::size_t n) const
KOKKOS_FUNCTION constexpr StridedDiscreteDomain(discrete_element_type const &element_begin, discrete_vector_type const &extents, discrete_vector_type const &strides)
Construct a StridedDiscreteDomain starting from element_begin with size points.
The top-level namespace of DDC.
KOKKOS_FUNCTION std::enable_if_t< is_periodic_sampling_v< DDim >, Real > step() noexcept
Spacing step of the mesh.
KOKKOS_FUNCTION std::enable_if_t< is_periodic_sampling_v< DDim >, Coordinate< typename DDim::continuous_dimension_type > > origin() noexcept
Lower bound index of the mesh.
constexpr bool is_non_uniform_point_sampling_v
KOKKOS_FUNCTION Coordinate< typename DDim::continuous_dimension_type > rmax(DiscreteDomain< DDim > const &d)
KOKKOS_FUNCTION constexpr DiscreteElement< QueryDDims... > back(SparseDiscreteDomain< DDims... > const &domain) noexcept
KOKKOS_FUNCTION constexpr DiscreteElement< QueryDDims... > front(StridedDiscreteDomain< DDims... > const &domain) noexcept
bool is_discrete_space_initialized() noexcept
KOKKOS_FUNCTION constexpr SparseDiscreteDomain< QueryDDims... > select(SparseDiscreteDomain< DDims... > const &domain)
KOKKOS_FUNCTION constexpr DiscreteVector< QueryDDims... > extents(StridedDiscreteDomain< DDims... > const &domain) noexcept
KOKKOS_FUNCTION constexpr DiscreteElement< QueryDDims... > back(StridedDiscreteDomain< DDims... > const &domain) noexcept
KOKKOS_FUNCTION constexpr StridedDiscreteDomain< QueryDDims... > select(StridedDiscreteDomain< DDims... > const &domain)
KOKKOS_FUNCTION constexpr auto remove_dims_of(StridedDiscreteDomain< DDimsA... > const &DDom_a) noexcept
Remove the dimensions DDimsB from DDom_a.
void init_discrete_space(Args &&... args)
Initialize (emplace) a global singleton discrete space.
KOKKOS_FUNCTION constexpr auto remove_dims_of(StridedDiscreteDomain< DDimsA... > const &DDom_a, StridedDiscreteDomain< DDimsB... > const &) noexcept
KOKKOS_FUNCTION constexpr auto remove_dims_of(SparseDiscreteDomain< DDimsA... > const &DDom_a, SparseDiscreteDomain< DDimsB... > const &) noexcept
detail::ddim_impl_t< DDim, Kokkos::HostSpace > const & host_discrete_space()
KOKKOS_FUNCTION constexpr DiscreteVector< QueryDDims... > extents(SparseDiscreteDomain< DDims... > const &domain) noexcept
KOKKOS_FUNCTION constexpr auto replace_dim_of(SparseDiscreteDomain< DDimsA... > const &DDom_a, SparseDiscreteDomain< DDimsB... > const &DDom_b) noexcept
KOKKOS_FUNCTION constexpr DiscreteElement< QueryDDims... > front(SparseDiscreteDomain< DDims... > const &domain) noexcept
KOKKOS_FUNCTION Coordinate< typename DDim::continuous_dimension_type > rlength(DiscreteDomain< DDim > const &d)
KOKKOS_FUNCTION Coordinate< typename DDim::continuous_dimension_type > distance_at_left(DiscreteElement< DDim > i)
constexpr bool is_strided_discrete_domain_v
KOKKOS_FUNCTION Coordinate< typename DDim::continuous_dimension_type > rmin(DiscreteDomain< DDim > const &d)
KOKKOS_FUNCTION DiscreteVector< ODDims... > prod(DiscreteVector< ODDims... > const &lhs, DiscreteVector< ODDims... > const &rhs) noexcept
constexpr bool is_periodic_sampling_v
KOKKOS_FUNCTION constexpr auto replace_dim_of(StridedDiscreteDomain< DDimsA... > const &DDom_a, StridedDiscreteDomain< DDimsB... > const &DDom_b) noexcept
KOKKOS_FUNCTION Coordinate< typename DDim::continuous_dimension_type > coordinate(DiscreteElement< DDim > const &c)
KOKKOS_FUNCTION std::enable_if_t< is_periodic_sampling_v< DDim >, DiscreteElement< DDim > > front() noexcept
Lower bound index of the mesh.
constexpr bool is_sparse_discrete_domain_v
KOKKOS_FUNCTION constexpr auto remove_dims_of(SparseDiscreteDomain< DDimsA... > const &DDom_a) noexcept
Remove the dimensions DDimsB from DDom_a.
KOKKOS_FUNCTION detail::ddim_impl_t< DDim, MemorySpace > const & discrete_space()
Arg0 init_discrete_space(std::tuple< DDimImpl, Arg0 > &&a)
Move construct a global singleton discrete space and pass through the other argument.
KOKKOS_FUNCTION Coordinate< typename DDim::continuous_dimension_type > distance_at_right(DiscreteElement< DDim > i)
std::tuple< Arg0, Arg1, Args... > init_discrete_space(std::tuple< DDimImpl, Arg0, Arg1, Args... > &&a)
Move construct a global singleton discrete space and pass through remaining arguments.
friend KOKKOS_FUNCTION constexpr StridedDiscreteDomainIterator operator-(StridedDiscreteDomainIterator i, difference_type n)
KOKKOS_FUNCTION constexpr DiscreteElement< DDim > operator*() const noexcept
KOKKOS_FUNCTION constexpr StridedDiscreteDomainIterator & operator++()
friend KOKKOS_FUNCTION constexpr StridedDiscreteDomainIterator operator+(difference_type n, StridedDiscreteDomainIterator i)
KOKKOS_FUNCTION constexpr StridedDiscreteDomainIterator & operator-=(difference_type n)
KOKKOS_FUNCTION constexpr StridedDiscreteDomainIterator operator++(int)
friend KOKKOS_FUNCTION constexpr bool operator<(StridedDiscreteDomainIterator const &xx, StridedDiscreteDomainIterator const &yy)
KOKKOS_DEFAULTED_FUNCTION StridedDiscreteDomainIterator()=default
KOKKOS_FUNCTION constexpr StridedDiscreteDomainIterator operator--(int)
friend KOKKOS_FUNCTION constexpr bool operator==(StridedDiscreteDomainIterator const &xx, StridedDiscreteDomainIterator const &yy)
KOKKOS_FUNCTION constexpr StridedDiscreteDomainIterator(DiscreteElement< DDim > value, DiscreteVector< DDim > stride)
KOKKOS_FUNCTION constexpr StridedDiscreteDomainIterator & operator+=(difference_type n)
KOKKOS_FUNCTION constexpr DiscreteElement< DDim > operator[](difference_type n) const
friend KOKKOS_FUNCTION constexpr difference_type operator-(StridedDiscreteDomainIterator const &xx, StridedDiscreteDomainIterator const &yy)
KOKKOS_FUNCTION constexpr StridedDiscreteDomainIterator & operator--()
friend KOKKOS_FUNCTION constexpr bool operator>=(StridedDiscreteDomainIterator const &xx, StridedDiscreteDomainIterator const &yy)
friend KOKKOS_FUNCTION constexpr StridedDiscreteDomainIterator operator+(StridedDiscreteDomainIterator i, difference_type n)
friend KOKKOS_FUNCTION constexpr bool operator>(StridedDiscreteDomainIterator const &xx, StridedDiscreteDomainIterator const &yy)
friend KOKKOS_FUNCTION constexpr bool operator!=(StridedDiscreteDomainIterator const &xx, StridedDiscreteDomainIterator const &yy)
friend KOKKOS_FUNCTION constexpr bool operator<=(StridedDiscreteDomainIterator const &xx, StridedDiscreteDomainIterator const &yy)