diff options
Diffstat (limited to '')
-rw-r--r-- | Source/Python/WarpXWrappers.cpp | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/Source/Python/WarpXWrappers.cpp b/Source/Python/WarpXWrappers.cpp index 8d3be68be..02cee52e0 100644 --- a/Source/Python/WarpXWrappers.cpp +++ b/Source/Python/WarpXWrappers.cpp @@ -773,6 +773,21 @@ namespace warpx.m_poisson_boundary_handler.setPotentialEB(potential); } + void warpx_setPlasmaLensStrength (const int i_lens, const amrex::Real strength_E, const amrex::Real strength_B ) { + auto & mypc = WarpX::GetInstance().GetPartContainer(); + WARPX_ALWAYS_ASSERT_WITH_MESSAGE( i_lens >= mypc.h_repeated_plasma_lens_strengths_E.size(), + "i_lens is larger than the number of plasma lenses."); + mypc.h_repeated_plasma_lens_strengths_E[i_lens] = strength_E; + mypc.h_repeated_plasma_lens_strengths_B[i_lens] = strength_B; + amrex::Gpu::copyAsync(amrex::Gpu::hostToDevice, + mypc.h_repeated_plasma_lens_strengths_E.begin(), mypc.h_repeated_plasma_lens_strengths_E.end(), + mypc.d_repeated_plasma_lens_strengths_E.begin()); + amrex::Gpu::copyAsync(amrex::Gpu::hostToDevice, + mypc.h_repeated_plasma_lens_strengths_B.begin(), mypc.h_repeated_plasma_lens_strengths_B.end(), + mypc.d_repeated_plasma_lens_strengths_B.begin()); + amrex::Gpu::synchronize(); + } + void mypc_Redistribute () { auto & mypc = WarpX::GetInstance().GetPartContainer(); mypc.Redistribute(); |