| 395 | |
| 396 | template <typename PC> |
| 397 | void testTransform (const PC& pc) |
| 398 | { |
| 399 | using PType = typename PC::SuperParticleType; |
| 400 | |
| 401 | PC pc2(pc.Geom(0), pc.ParticleDistributionMap(0), pc.ParticleBoxArray(0)); |
| 402 | pc2.copyParticles(pc); |
| 403 | |
| 404 | auto np_old = pc2.TotalNumberOfParticles(); |
| 405 | |
| 406 | auto mx1 = amrex::ReduceMax(pc2, [=] AMREX_GPU_HOST_DEVICE (const PType& p) -> int { return p.idata(NSI+1); }); |
| 407 | |
| 408 | transformParticles(pc2, Transformer(2)); |
| 409 | |
| 410 | auto mx2 = amrex::ReduceMax(pc2, [=] AMREX_GPU_HOST_DEVICE (const PType& p) -> int { return p.idata(NSI+1); }); |
| 411 | |
| 412 | AMREX_ALWAYS_ASSERT(2*mx1 == mx2); |
| 413 | |
| 414 | auto np_new = pc2.TotalNumberOfParticles(); |
| 415 | |
| 416 | AMREX_ALWAYS_ASSERT(np_old == np_new); |
| 417 | |
| 418 | pc2.clearParticles(); |
| 419 | pc2.copyParticles(pc); |
| 420 | transformParticles(pc2, Transformer(3)); |
| 421 | |
| 422 | auto mx3 = amrex::ReduceMax(pc2, [=] AMREX_GPU_HOST_DEVICE (const PType& p) -> int { return p.idata(NSI+1); }); |
| 423 | |
| 424 | AMREX_ALWAYS_ASSERT(mx3 == 3*mx1); |
| 425 | } |
| 426 | |
| 427 | template <typename PC> |
| 428 | void testFilter (const PC& pc) |
no test coverage detected