diff options
author | 2019-09-25 13:12:23 -0700 | |
---|---|---|
committer | 2019-10-01 16:32:38 -0700 | |
commit | 69b512e9fb315bd987314ec71ff463c6a90afde0 (patch) | |
tree | 7522b6b19f2de59d95c07e28af62876459d5af24 /Source/Particles/Sorting/Partition.cpp | |
parent | feac8d56e5cc84f63f6e7be7e1668113558c9e47 (diff) | |
download | WarpX-69b512e9fb315bd987314ec71ff463c6a90afde0.tar.gz WarpX-69b512e9fb315bd987314ec71ff463c6a90afde0.tar.zst WarpX-69b512e9fb315bd987314ec71ff463c6a90afde0.zip |
Replaced Index function
Diffstat (limited to 'Source/Particles/Sorting/Partition.cpp')
-rw-r--r-- | Source/Particles/Sorting/Partition.cpp | 15 |
1 files changed, 13 insertions, 2 deletions
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); } ); |