8#include <similie/misc/permutation_parity.hpp>
9#include <similie/tensor/tensor_impl.hpp>
16template <TensorNatIndex... TensorIndex>
27 ddc::DiscreteElement<
TensorIndex...>(ddc::DiscreteElement<TensorIndex>(0)...),
29 ddc::DiscreteVector<TensorIndex>(TensorIndex::size())...));
32 static constexpr std::size_t
rank()
34 return (TensorIndex::rank() + ...);
37 static_assert(((TensorIndex::size() ==
rank()) && ...));
39 static constexpr std::size_t
size()
41 return (TensorIndex::size() * ...);
54 KOKKOS_FUNCTION
static constexpr std::size_t
mem_id(
55 std::array<std::size_t,
sizeof...(
TensorIndex)>
const& natural_ids)
57 return std::numeric_limits<std::size_t>::max();
60 KOKKOS_FUNCTION
static constexpr std::size_t
access_id(
61 std::array<std::size_t,
sizeof...(
TensorIndex)>
const& natural_ids)
63 if constexpr (
rank() == 1) {
69 }
else if (parity == 1) {
80 return std::numeric_limits<std::size_t>::max();
83 template <
class Tensor,
class Elem,
class Id,
class FunctorType>
85 const FunctorType& access,
89 if (elem.template uid<Id>() == 0) {
91 }
else if (elem.template uid<Id>() == 1) {
92 return access(tensor, elem);
94 return -access(tensor, elem);
98 KOKKOS_FUNCTION
static constexpr std::array<std::size_t,
rank()>
102 std::array<std::size_t,
rank()> ids;
103 for (
auto i = ids.begin(); i < ids.end(); ++i) {
111 TensorIndexConcept<TensorLeviCivitaIndex<TensorNaturalIndex<detail::DimensionConcept>>>);
KOKKOS_FUNCTION constexpr int permutation_parity(std::array< std::size_t, N > const &lst)
The top-level namespace of SimiLie.
static KOKKOS_FUNCTION constexpr std::size_t mem_id(std::array< std::size_t, sizeof...(TensorIndex)> const &natural_ids)
static KOKKOS_FUNCTION constexpr subindices_domain_t subindices_domain()
static constexpr std::size_t access_size()
static KOKKOS_FUNCTION constexpr std::size_t access_id_to_mem_id(std::size_t access_id)
static constexpr std::size_t mem_size()
static KOKKOS_FUNCTION constexpr Tensor::element_type process_access(const FunctorType &access, Tensor const &tensor, Elem const &elem)
static constexpr std::size_t rank()
static KOKKOS_FUNCTION constexpr std::size_t access_id(std::array< std::size_t, sizeof...(TensorIndex)> const &natural_ids)
static constexpr std::size_t size()
static constexpr bool is_explicitely_stored_tensor
ddc::DiscreteDomain< TensorIndex... > subindices_domain_t
static KOKKOS_FUNCTION constexpr std::array< std::size_t, rank()> mem_id_to_canonical_natural_ids(std::size_t mem_id)
static constexpr bool is_tensor_index