55 Field<double, IdxRangeFdistrib>
const allfdistribu,
56 double const dt)
const override
58 using IdxRangeBatch = ddc::remove_dims_of_t<IdxRangeFdistrib, Species, GridX>;
59 using IdxBatch =
typename IdxRangeBatch::discrete_element_type;
61 Kokkos::Profiling::pushRegion(
"BslAdvectionSpatial");
62 IdxRangeFdistrib
const idx_range = get_idx_range(allfdistribu);
63 IdxRange<GridX>
const x_idx_range = ddc::select<GridX>(idx_range);
64 IdxRange<GridV>
const v_idx_range = ddc::select<GridV>(idx_range);
65 IdxRange<Species>
const sp_idx_range = ddc::select<Species>(idx_range);
68 IdxRangeSpaceVelocity batched_feet_idx_range(idx_range);
69 FieldMem<Coord<DimX>, IdxRangeSpaceVelocity> feet_coords_alloc(batched_feet_idx_range);
70 Field<Coord<DimX>, IdxRangeSpaceVelocity> feet_coords(get_field(feet_coords_alloc));
71 std::unique_ptr<InterpolatorType>
const interpolator_x_ptr = m_interpolator_x.preallocate();
72 InterpolatorType
const& interpolator_x = *interpolator_x_ptr;
74 IdxRangeBatch batch_idx_range(idx_range);
76 for (IdxSp
const isp : sp_idx_range) {
77 double const sqrt_me_on_mspecies = std::sqrt(mass(ielec()) / mass(isp));
78 ddc::parallel_for_each(
79 Kokkos::DefaultExecutionSpace(),
81 KOKKOS_LAMBDA(IdxBatch
const ib) {
84 Coord<DimV>
const coord_iv = ddc::coordinate(iv);
85 double const dx = sqrt_me_on_mspecies * dt * coord_iv;
88 for (IdxX
const ix : x_idx_range) {
89 feet_coords(ix, ib) = Coord<DimX>(ddc::coordinate(ix) - dx);
92 interpolator_x(allfdistribu[isp], get_const_field(feet_coords));
95 Kokkos::Profiling::popRegion();