diff options
Diffstat (limited to 'Source/FieldSolver/SpectralSolver')
-rw-r--r-- | Source/FieldSolver/SpectralSolver/SpectralFieldDataRZ.cpp | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/Source/FieldSolver/SpectralSolver/SpectralFieldDataRZ.cpp b/Source/FieldSolver/SpectralSolver/SpectralFieldDataRZ.cpp index 4a66d924a..65d121cd3 100644 --- a/Source/FieldSolver/SpectralSolver/SpectralFieldDataRZ.cpp +++ b/Source/FieldSolver/SpectralSolver/SpectralFieldDataRZ.cpp @@ -376,6 +376,10 @@ SpectralFieldDataRZ::BackwardTransform (amrex::MultiFab& field_mf, int const fie // A full multifab is created so that each GPU stream has its own temp space. amrex::MultiFab tempHTransformedSplit(tempHTransformed.boxArray(), tempHTransformed.DistributionMap(), 2*n_rz_azimuthal_modes, 0); + // Create a temporary to hold the inverse Hankel transform field. + // This allows the final result to have a different shape than the transformed field. + amrex::MultiFab field_mf_copy(tempHTransformed.boxArray(), tempHTransformed.DistributionMap(), 2*n_rz_azimuthal_modes, 0); + // Loop over boxes. for (amrex::MFIter mfi(field_mf); mfi.isValid(); ++mfi){ @@ -385,8 +389,9 @@ SpectralFieldDataRZ::BackwardTransform (amrex::MultiFab& field_mf, int const fie // tempHTransformedSplit includes the imaginary component of mode 0. // field_mf does not. amrex::Box const& realspace_bx = tempHTransformed[mfi].box(); - amrex::FArrayBox field_comp(field_mf[mfi], amrex::make_alias, i_comp*ncomp, ncomp); + amrex::FArrayBox field_comp(field_mf_copy[mfi], amrex::make_alias, i_comp*ncomp, ncomp); multi_spectral_hankel_transformer[mfi].SpectralToPhysical_Scalar(realspace_bx, tempHTransformedSplit[mfi], field_comp); + field_mf[mfi].copy(field_comp, 0, i_comp*ncomp, ncomp); } } |