56 Field<double, IdxRangeFdistribu>
const allfdistribu,
57 Field<const double, IdxRangeSpatial>
const electric_field,
58 double const dt)
const override
60 using IdxRangeBatch = ddc::remove_dims_of_t<IdxRangeFdistribu, Species, GridV>;
61 using IdxBatch =
typename IdxRangeBatch::discrete_element_type;
64 Kokkos::Profiling::pushRegion(
"BslAdvectionVelocity");
65 IdxRangeFdistribu
const idx_range = get_idx_range(allfdistribu);
66 IdxRange<GridV>
const idx_range_v = ddc::select<GridV>(idx_range);
67 IdxRange<Species>
const idx_range_sp = ddc::select<Species>(idx_range);
69 FieldMem<double, typename InterpolatorType::batched_derivs_idx_range_type> derivs_min(
70 m_interpolator_v.batched_derivs_idx_range_xmin(
71 ddc::remove_dims_of<Species>(idx_range)));
72 FieldMem<double, typename InterpolatorType::batched_derivs_idx_range_type> derivs_max(
73 m_interpolator_v.batched_derivs_idx_range_xmax(
74 ddc::remove_dims_of<Species>(idx_range)));
75 ddc::parallel_fill(derivs_min, 0.);
76 ddc::parallel_fill(derivs_max, 0.);
79 IdxRangeSpaceVelocity batched_feet_idx_range(idx_range);
80 FieldMem<Coord<DimV>, IdxRangeSpaceVelocity> feet_coords_alloc(batched_feet_idx_range);
81 Field<Coord<DimV>, IdxRangeSpaceVelocity> feet_coords(get_field(feet_coords_alloc));
82 std::unique_ptr<InterpolatorType>
const interpolator_v_ptr = m_interpolator_v.preallocate();
83 InterpolatorType
const& interpolator_v = *interpolator_v_ptr;
85 IdxRangeSpatial
const idx_range_spatial(get_idx_range(allfdistribu));
87 IdxRangeBatch batch_idx_range(idx_range);
89 ddc::for_each(idx_range_sp, [&](IdxSp
const isp) {
90 double const charge_proxy
92 double const sqrt_me_on_mspecies = std::sqrt(mass(ielec()) / mass(isp));
93 ddc::parallel_for_each(
94 Kokkos::DefaultExecutionSpace(),
96 KOKKOS_LAMBDA(IdxBatch
const ib) {
97 IdxSpatial
const ix(ib);
100 = charge_proxy * sqrt_me_on_mspecies * dt * electric_field(ix);
103 for (IdxV
const iv : idx_range_v) {
104 feet_coords(iv, ib) = Coord<DimV>(ddc::coordinate(iv) - dvx);
109 get_const_field(feet_coords),
110 get_const_field(derivs_min),
111 get_const_field(derivs_max));
114 Kokkos::Profiling::popRegion();