aboutsummaryrefslogtreecommitdiff
path: root/Source/FieldSolver/SpectralSolver/SpectralFieldDataRZ.cpp
diff options
context:
space:
mode:
authorGravatar David Grote <grote1@llnl.gov> 2020-08-13 07:38:34 -0700
committerGravatar GitHub <noreply@github.com> 2020-08-13 07:38:34 -0700
commit61b4c2d4beb178f1156c6091be7b9eb6e79ef534 (patch)
tree6d52d1fb5119a9d0efaa9e5a6c77b27c9ba1580c /Source/FieldSolver/SpectralSolver/SpectralFieldDataRZ.cpp
parent54dc9abd8f7e59ebf375ed7c898e36a1122eec29 (diff)
downloadWarpX-61b4c2d4beb178f1156c6091be7b9eb6e79ef534.tar.gz
WarpX-61b4c2d4beb178f1156c6091be7b9eb6e79ef534.tar.zst
WarpX-61b4c2d4beb178f1156c6091be7b9eb6e79ef534.zip
Fix RZ PSATD backward transform for icomp > 0 (#1246)
Diffstat (limited to 'Source/FieldSolver/SpectralSolver/SpectralFieldDataRZ.cpp')
-rw-r--r--Source/FieldSolver/SpectralSolver/SpectralFieldDataRZ.cpp7
1 files changed, 3 insertions, 4 deletions
diff --git a/Source/FieldSolver/SpectralSolver/SpectralFieldDataRZ.cpp b/Source/FieldSolver/SpectralSolver/SpectralFieldDataRZ.cpp
index 21f84fce7..9a55254bc 100644
--- a/Source/FieldSolver/SpectralSolver/SpectralFieldDataRZ.cpp
+++ b/Source/FieldSolver/SpectralSolver/SpectralFieldDataRZ.cpp
@@ -378,7 +378,7 @@ SpectralFieldDataRZ::BackwardTransform (amrex::MultiFab& field_mf, int const fie
// 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);
+ amrex::MultiFab field_mf_copy(tempHTransformed.boxArray(), tempHTransformed.DistributionMap(), 2*n_rz_azimuthal_modes-1, 0);
// Loop over boxes.
for (amrex::MFIter mfi(field_mf); mfi.isValid(); ++mfi){
@@ -389,9 +389,8 @@ 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_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);
+ multi_spectral_hankel_transformer[mfi].SpectralToPhysical_Scalar(realspace_bx, tempHTransformedSplit[mfi], field_mf_copy[mfi]);
+ field_mf[mfi].copy(field_mf_copy[mfi], 0, i_comp*ncomp, ncomp);
}
}