3#include "ddc_alias_inline_functions.hpp"
4#include "ddc_aliases.hpp"
32template <
class Gr
id1D>
42 static_assert(!std::is_same_v<Field, Field>,
"Unrecognised radial profile type");
50template <
class Field,
class Gr
idR>
53 static_assert(!std::is_same_v<Field, Field>,
"Unrecognised poloidal profile type");
65template <
class Gr
id1D,
class IdxRangeFDistrib>
68 if constexpr (is_spoofed_dim_v<Grid1D>) {
69 return IdxRange<Grid1D>(Idx<Grid1D> {0}, IdxStep<Grid1D> {1});
71 return ddc::select<Grid1D>(idx_range);
82template <
class... Grid1D,
class IdxRangeFDistrib>
85 return IdxRange<Grid1D...>(get_1d_idx_range<Grid1D>(idx_range)...);
96template <
class Gr
idR,
class Layout>
98 ConstField<double, IdxRange<
GridR>, Kokkos::DefaultExecutionSpace::memory_space, Layout>>
104template <
class ElementType,
class IdxRange,
class MemSpace,
class Layout>
108 std::is_same_v<ElementType, const double>,
109 "The radial profile should be a double and should not be modifiable. Please use a "
112 std::is_same_v<MemSpace, Kokkos::DefaultExecutionSpace::memory_space>,
113 "The radial profile should be provided on the GPU");
115 (ddc::type_seq_size_v<ddc::to_type_seq_t<IdxRange>>) > 1,
116 "The radial profile should not be defined on more than 1 dimensions.");
127template <
class Gr
idR,
class Layout>
129 ConstField<double, IdxRange<
GridR>, Kokkos::DefaultExecutionSpace::memory_space, Layout>,
136template <
class Gr
idR,
class Gr
idTheta,
class Layout>
141 Kokkos::DefaultExecutionSpace::memory_space,
149template <
class Gr
idR,
class Gr
idTheta,
class Layout>
154 Kokkos::DefaultExecutionSpace::memory_space,
162template <
class Gr
idR,
class ElementType,
class IdxRange,
class MemSpace,
class Layout>
166 std::is_same_v<ElementType, const double>,
167 "The poloidal profile should be a double and should not be modifiable. Please use a "
170 std::is_same_v<MemSpace, Kokkos::DefaultExecutionSpace::memory_space>,
171 "The poloidal profile should be provided on the GPU");
173 (ddc::type_seq_size_v<ddc::to_type_seq_t<IdxRange>>) > 2,
174 "The poloidal profile should not be defined on more than 2 dimensions.");
183template <
class Field>
186 static_assert(!std::is_same_v<Field, Field>,
"Unrecognised poloidal profile type");
193 using type = ddc::detail::TypeSeq<>;
197template <
class IdxRange>
200 using type = ddc::to_type_seq_t<IdxRange>;
215template <
class Gr
id1D,
class OrderedGr
ids>
218 if constexpr (!is_spoofed_dim_v<Grid1D>) {
219 bool success = ddc::type_seq_rank_v<Grid1D, OrderedGrids> == idx;
236template <
class OrderedGrids,
class... ExpectedGrids>
239 int n_real_dims = ((is_spoofed_dim_v<ExpectedGrids> ? 0 : 1) + ...);
240 int idx(ddc::type_seq_size_v<OrderedGrids> - n_real_dims);
241 return ((check_dimension_location<ExpectedGrids, OrderedGrids>(idx)) && ...);
253template <
class OrderedGrids,
class... ExpectedGrids>
257 return ((check_dimension_location<ExpectedGrids, OrderedGrids>(idx)) && ...);
A namespace to collect classes which are necessary to create Fields with the correct number of dimens...
Definition collisions_dimensions.hpp:10
IdxRange< Grid1D > get_1d_idx_range(IdxRangeFDistrib idx_range)
Get the index range for a specific grid from a multi-D index range.
Definition collisions_dimensions.hpp:66
constexpr bool order_of_first_grids()
A helper function to check if the first grids in an ordered set of grids match the order of the provi...
Definition collisions_dimensions.hpp:254
constexpr bool check_dimension_location(int &idx)
A helper function to check if a grid is found at the correct location in a set of ordered grids.
Definition collisions_dimensions.hpp:216
IdxRange< Grid1D... > get_expanded_idx_range(IdxRangeFDistrib idx_range)
Get the index range for specific grid dimensions from a multi-D index range.
Definition collisions_dimensions.hpp:83
constexpr bool order_of_last_grids()
A helper function to check if the final grids in an ordered set of grids match the order of the provi...
Definition collisions_dimensions.hpp:237
constexpr bool is_spoofed_dim_v
Check if a dimension is spoofed but is not present in the actual simulation.
Definition collisions_dimensions.hpp:33
Definition geometry.hpp:116
Definition geometry.hpp:119
Fake radial dimension to be used if there is no radial dimension in the simulation.
Definition collisions_dimensions.hpp:23
Fake poloidal dimension to be used if there is no poloidal dimension in the simulation.
Definition collisions_dimensions.hpp:28
Create dimensions to act as the radial/poloidal/toroidal tag for Koliop even if these dims don't exis...
Definition collisions_dimensions.hpp:18