Skip to content

Commit

Permalink
Merge branch 'ebourne-367-timesteppers-on-multipatch-objects' into 'm…
Browse files Browse the repository at this point in the history
…ain'

Add explicit timesteppers on multipatch objects

Closes #378 and #367

See merge request gysela-developpers/gyselalibxx!732

--------------------------------------------
  • Loading branch information
EmilyBourne committed Oct 28, 2024
1 parent 93170c3 commit 28b2eff
Show file tree
Hide file tree
Showing 9 changed files with 20 additions and 25 deletions.
3 changes: 1 addition & 2 deletions simulations/geometryXVx/bump_on_tail/bumpontail_fft.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -137,8 +137,7 @@ int main(int argc, char** argv)

DFieldMemVx const quadrature_coeffs(neumann_spline_quadrature_coefficients<
Kokkos::DefaultExecutionSpace>(mesh_vx, builder_vx));
FFTPoissonSolver<IdxRangeX, IdxRangeX, Kokkos::DefaultExecutionSpace> fft_poisson_solver(
mesh_x);
FFTPoissonSolver<IdxRangeX> fft_poisson_solver(mesh_x);
ChargeDensityCalculator rhs(get_field(quadrature_coeffs));
QNSolver const poisson(fft_poisson_solver, rhs);

Expand Down
3 changes: 1 addition & 2 deletions simulations/geometryXVx/landau/landau_fft.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -130,8 +130,7 @@ int main(int argc, char** argv)
Kokkos::DefaultExecutionSpace>(mesh_vx, builder_vx));

ChargeDensityCalculator rhs(get_field(quadrature_coeffs));
FFTPoissonSolver<IdxRangeX, IdxRangeX, Kokkos::DefaultExecutionSpace> fft_poisson_solver(
mesh_x);
FFTPoissonSolver<IdxRangeX> fft_poisson_solver(mesh_x);
QNSolver const poisson(fft_poisson_solver, rhs);

PredCorr const predcorr(vlasov, poisson);
Expand Down
2 changes: 1 addition & 1 deletion simulations/geometryXVx/neutrals/neutrals.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -260,7 +260,7 @@ int main(int argc, char** argv)
Kokkos::DefaultExecutionSpace>(mesh_vx, builder_vx));
ChargeDensityCalculator rhs(get_const_field(quadrature_coeffs_alloc));
#if defined(PERIODIC_RDIMX) && !defined(INPUT_MESH)
FFTPoissonSolver<IdxRangeX, IdxRangeX, Kokkos::DefaultExecutionSpace> poisson_solver(mesh_x);
FFTPoissonSolver<IdxRangeX> poisson_solver(mesh_x);
#else
FEM1DPoissonSolver poisson_solver(builder_x_poisson, spline_x_evaluator_poisson);
#endif
Expand Down
2 changes: 1 addition & 1 deletion simulations/geometryXVx/sheath/sheath.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -233,7 +233,7 @@ int main(int argc, char** argv)

ChargeDensityCalculator rhs(get_const_field(quadrature_coeffs));
#if defined(PERIODIC_RDIMX) && !defined(INPUT_MESH)
FFTPoissonSolver<IdxRangeX, IdxRangeX, Kokkos::DefaultExecutionSpace> poisson_solver(mesh_x);
FFTPoissonSolver<IdxRangeX> poisson_solver(mesh_x);
#else
FEM1DPoissonSolver poisson_solver(builder_x_poisson, spline_x_evaluator_poisson);
#endif
Expand Down
3 changes: 1 addition & 2 deletions simulations/geometryXY/guiding_center/guiding_center.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -100,8 +100,7 @@ int main(int argc, char** argv)
PreallocatableSplineInterpolator const spline_y_interpolator(builder_y, spline_y_evaluator);

// Create Poisson solver ---
FFTPoissonSolver<IdxRangeXY, IdxRangeXY, Kokkos::DefaultExecutionSpace> const poisson_solver(
meshXY);
FFTPoissonSolver<IdxRangeXY> const poisson_solver(meshXY);

// Create advection operators ---
Euler<FieldMemXY<CoordX>, DFieldMemXY> euler_x(meshXY);
Expand Down
3 changes: 1 addition & 2 deletions simulations/geometryXYVxVy/landau/landau4d_fft.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -139,8 +139,7 @@ int main(int argc, char** argv)
neumann_spline_quadrature_coefficients<
Kokkos::DefaultExecutionSpace>(mesh_vxvy, builder_vx, builder_vy));

FFTPoissonSolver<IdxRangeXY, IdxRangeXY, Kokkos::DefaultExecutionSpace> fft_poisson_solver(
mesh_xy);
FFTPoissonSolver<IdxRangeXY> fft_poisson_solver(mesh_xy);
ChargeDensityCalculator const rhs(get_const_field(quadrature_coeffs));
QNSolver const poisson(fft_poisson_solver, rhs);

Expand Down
4 changes: 2 additions & 2 deletions src/pde_solvers/fft_poisson_solver.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@
*/
template <
class IdxRangeLaplacian,
class IdxRangeFull,
class ExecSpace,
class IdxRangeFull = IdxRangeLaplacian,
class ExecSpace = Kokkos::DefaultExecutionSpace,
class LayoutSpace = std::experimental::layout_right>
class FFTPoissonSolver;

Expand Down
15 changes: 7 additions & 8 deletions tests/geometryXVx/geometryMX/kineticfluidcoupling.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,7 @@ static void TestKineticFluidCoupling()

// Initialization of kinetic species distribution function
DFieldMemSpXVx allfdistribu_alloc(IdxRangeSpXVx(idx_range_kinsp, meshX, meshVx));
auto allfdistribu = get_field(allfdistribu_alloc);
DFieldSpXVx allfdistribu = get_field(allfdistribu_alloc);

host_t<DFieldMemSp> kinsp_density_eq(idx_range_kinsp);
host_t<DFieldMemSp> kinsp_velocity_eq(idx_range_kinsp);
Expand All @@ -144,7 +144,7 @@ static void TestKineticFluidCoupling()
ddc::parallel_fill(kinsp_temperature_eq, 1.);

DFieldMemSpVx allfequilibrium_alloc(IdxRangeSpVx(idx_range_kinsp, meshVx));
auto allfequilibrium = get_field(allfequilibrium_alloc);
DFieldSpVx allfequilibrium = get_field(allfequilibrium_alloc);
MaxwellianEquilibrium const init_fequilibrium(
std::move(kinsp_density_eq),
std::move(kinsp_temperature_eq),
Expand All @@ -167,7 +167,7 @@ static void TestKineticFluidCoupling()

// Initialization of fluid species moments
DFieldMemSpMomX fluid_moments_alloc(IdxRangeSpMomX(idx_range_fluidsp, meshM, meshX));
auto fluid_moments = get_field(fluid_moments_alloc);
DFieldSpMomX fluid_moments = get_field(fluid_moments_alloc);

host_t<DFieldMemSpMom> moments_init(IdxRangeSpMom(idx_range_fluidsp, meshM));
ddc::parallel_fill(moments_init, 0.);
Expand Down Expand Up @@ -209,7 +209,7 @@ static void TestKineticFluidCoupling()

ChargeDensityCalculator rhs(get_const_field(quadrature_coeffs));
#ifdef PERIODIC_RDIMX
FFTPoissonSolver<IdxRangeX, IdxRangeX, Kokkos::DefaultExecutionSpace> poisson_solver(meshX);
FFTPoissonSolver<IdxRangeX> poisson_solver(meshX);
#else
FEM1DPoissonSolver const poisson_solver(builder_x_poisson, spline_x_evaluator_poisson);
#endif
Expand Down Expand Up @@ -272,9 +272,9 @@ static void TestKineticFluidCoupling()
= N * (recombination_rate - ionization_rate) / (recombination_rate + ionization_rate);

DFieldMemSpMomX X_alloc(IdxRangeSpMomX(idx_range_fluidsp, meshM, meshX));
auto X = get_field(X_alloc);
DFieldSpMomX X = get_field(X_alloc);
DFieldMemSpMomX analytical_nN_alloc(IdxRangeSpMomX(idx_range_fluidsp, meshM, meshX));
auto analytical_nN = get_field(analytical_nN_alloc);
DFieldSpMomX analytical_nN = get_field(analytical_nN_alloc);
double const t_diag = nb_iter * deltat;

ddc::parallel_for_each(
Expand All @@ -283,8 +283,7 @@ static void TestKineticFluidCoupling()
KOKKOS_LAMBDA(IdxSpMomX const ispmx) {
X(ispmx) = Kokkos::exp(alpha * t_diag)
* Kokkos::
pow((beta / alpha) * (Kokkos::exp(alpha * t_diag) - 1)
+ C,
pow((beta / alpha) * Kokkos::expm1(alpha * t_diag) + C,
-1)
+ X_1;
analytical_nN(ispmx) = (X(ispmx) + N) / 2.;
Expand Down
10 changes: 5 additions & 5 deletions tests/geometryXVx/geometryMX/predcorr_hybrid.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,7 @@ TEST(GeometryXM, PredCorrHybrid)

// Initialization of kinetic species distribution function
DFieldMemSpXVx allfdistribu_alloc(IdxRangeSpXVx(idx_range_kinsp, meshX, meshVx));
auto allfdistribu = get_field(allfdistribu_alloc);
DFieldSpXVx allfdistribu = get_field(allfdistribu_alloc);

host_t<DFieldMemSp> kinsp_density_eq(idx_range_kinsp);
host_t<DFieldMemSp> kinsp_velocity_eq(idx_range_kinsp);
Expand All @@ -143,7 +143,7 @@ TEST(GeometryXM, PredCorrHybrid)
ddc::parallel_fill(kinsp_temperature_eq, 1.);

DFieldMemSpVx allfequilibrium_alloc(IdxRangeSpVx(idx_range_kinsp, meshVx));
auto allfequilibrium = get_field(allfequilibrium_alloc);
DFieldSpVx allfequilibrium = get_field(allfequilibrium_alloc);
MaxwellianEquilibrium const init_fequilibrium(
std::move(kinsp_density_eq),
std::move(kinsp_temperature_eq),
Expand All @@ -170,7 +170,7 @@ TEST(GeometryXM, PredCorrHybrid)

// Initialization of fluid species moments
DFieldMemSpMomX fluid_moments_alloc(IdxRangeSpMomX(idx_range_fluidsp, meshM, meshX));
auto fluid_moments = get_field(fluid_moments_alloc);
DFieldSpMomX fluid_moments = get_field(fluid_moments_alloc);

host_t<DFieldMemSpMom> moments_init(IdxRangeSpMom(idx_range_fluidsp, meshM));
ddc::parallel_fill(moments_init[idensity], 1.);
Expand Down Expand Up @@ -215,7 +215,7 @@ TEST(GeometryXM, PredCorrHybrid)

ChargeDensityCalculator rhs(get_const_field(quadrature_coeffs));
#ifdef PERIODIC_RDIMX
FFTPoissonSolver<IdxRangeX, IdxRangeX, Kokkos::DefaultExecutionSpace> poisson_solver(meshX);
FFTPoissonSolver<IdxRangeX> poisson_solver(meshX);
#else
FEM1DPoissonSolver const poisson_solver(builder_x_poisson, spline_x_evaluator_poisson);
#endif
Expand All @@ -241,7 +241,7 @@ TEST(GeometryXM, PredCorrHybrid)

// distribution function to be evolved by predcorr without fluid species
DFieldMemSpXVx allfdistribu_predcorr_alloc(get_idx_range(allfdistribu));
auto allfdistribu_predcorr = get_field(allfdistribu_predcorr_alloc);
DFieldSpXVx allfdistribu_predcorr = get_field(allfdistribu_predcorr_alloc);
ddc::parallel_deepcopy(allfdistribu_predcorr, allfdistribu);

double const time_start(0.);
Expand Down

0 comments on commit 28b2eff

Please sign in to comment.