From 69b512e9fb315bd987314ec71ff463c6a90afde0 Mon Sep 17 00:00:00 2001 From: Remi Lehe Date: Wed, 25 Sep 2019 13:12:23 -0700 Subject: Replaced Index function --- Source/Particles/Sorting/Partition.cpp | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) (limited to 'Source/Particles/Sorting/Partition.cpp') diff --git a/Source/Particles/Sorting/Partition.cpp b/Source/Particles/Sorting/Partition.cpp index 49d4d25a6..6874e2df6 100644 --- a/Source/Particles/Sorting/Partition.cpp +++ b/Source/Particles/Sorting/Partition.cpp @@ -54,9 +54,20 @@ PhysicalParticleContainer::PartitionParticlesInBuffers( auto& aos = pti.GetArrayOfStructs(); ParticleType * AMREX_RESTRICT pstructs = &(aos[0]); int * inexflag_ptr = inexflag.dataPtr(); - amrex::ParallelFor( pti.numParticles(), + const Geometry& geom = Geom(lev); + const Real prob_lo_x = geom.ProbLo(0); + const Real prob_lo_y = geom.ProbLo(1); + const Real prob_lo_z = geom.ProbLo(2); + const Real inv_dx = geom.InvCellSize(0); + const Real inv_dy = geom.InvCellSize(1); + const Real inv_dz = geom.InvCellSize(2); + const IntVect domain_small_end = geom.Domain().smallEnd(); + amrex::ParallelFor( np, [=] AMREX_GPU_DEVICE (long i) { - const IntVect& iv = Index(pstructs[i], lev); + + const IntVect& iv = findParticleIndex(pstructs[i], + prob_lo_x, prob_lo_y, prob_lo_z, + inv_dx, inv_dy, inv_dz, domain_small_end ); inexflag_ptr[i] = msk(iv); } ); -- cgit v1.2.3