From abaaf443f76bfc034a7e2db15c9c6b571b26878f Mon Sep 17 00:00:00 2001 From: Andrew Myers Date: Wed, 29 Nov 2023 15:07:44 -0800 Subject: [PATCH] When checking for periodic outs on GPU, copy full particle data (#3646) Fixes a bug in mapped coordinates when GPUs are enabled. The proposed changes: - [x] fix a bug or incorrect behavior in AMReX - [ ] add new capabilities to AMReX - [ ] changes answers in the test suite to more than roundoff level - [ ] are likely to significantly affect the results of downstream AMReX users - [ ] include documentation in the code and/or rst files, if appropriate --- Src/Particle/AMReX_ParticleUtil.H | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/Src/Particle/AMReX_ParticleUtil.H b/Src/Particle/AMReX_ParticleUtil.H index d4b13030c04..5430cd34037 100644 --- a/Src/Particle/AMReX_ParticleUtil.H +++ b/Src/Particle/AMReX_ParticleUtil.H @@ -487,11 +487,7 @@ partitionParticlesByDest (PTile& ptile, const PLocator& ploc, CellAssignor&& ass } else { - amrex::Particle<0> p_prime; - AMREX_D_TERM(p_prime.pos(0) = src_data.pos(0, i+this_offset);, - p_prime.pos(1) = src_data.pos(1, i+this_offset);, - p_prime.pos(2) = src_data.pos(2, i+this_offset);); - + auto p_prime = src_data.getSuperParticle(i+this_offset); enforcePeriodic(p_prime, plo, phi, rlo, rhi, is_per); auto tup_prime = ploc(p_prime, lev_min, lev_max, nGrow, assignor); assigned_grid = amrex::get<0>(tup_prime);