diff options
author | 2022-05-24 17:57:51 -0700 | |
---|---|---|
committer | 2022-05-24 17:57:51 -0700 | |
commit | 0344c42e27c61b286e885889028c7f77725e7f74 (patch) | |
tree | ec116dbe570b342c7df3da3e6d620cbdd4032db5 /Source/Diagnostics/ComputeDiagFunctors/ParticleReductionFunctor.cpp | |
parent | a681d1994aa5748d4faceb658199c1a61d418a79 (diff) | |
download | WarpX-0344c42e27c61b286e885889028c7f77725e7f74.tar.gz WarpX-0344c42e27c61b286e885889028c7f77725e7f74.tar.zst WarpX-0344c42e27c61b286e885889028c7f77725e7f74.zip |
Specify particle precision (#3065)
* Add precision to printed PIC parameters
* Added WarpX_PARTICLE_PRECISION as a build option
* Update types to ParticleReal
* Updated libwarpx to inject particles with correct ParticleReal type
* Fix syntax error
* Add logic to avoid duplicate definitions
* Use correct ParticleReal type in add_particles
* Cleaned up code, addressed comments
* Update Python/pywarpx/_libwarpx.py
Co-authored-by: Peter Scherpelz <31747262+peterscherpelz@users.noreply.github.com>
* Removed redundant functions, fixed some typing
* Modified template functions
* Cast d_w to Real
* Fixed failing tests
* Cast types to be consistent
* removed in-tree-build from pip command
* Added GPU device macros to PDim3 methods
* rerun tests
* Removed unecessary casting, update calls to use PDim3 instead of XDim3
* Refactored comments
* Added mcc fields double precision, particles single precision test
* Updated casting and formatting
* Removed cast, updated declaration
Co-authored-by: Peter Scherpelz <peter.scherpelz@modernelectron.com>
Co-authored-by: Peter Scherpelz <31747262+peterscherpelz@users.noreply.github.com>
Diffstat (limited to 'Source/Diagnostics/ComputeDiagFunctors/ParticleReductionFunctor.cpp')
-rw-r--r-- | Source/Diagnostics/ComputeDiagFunctors/ParticleReductionFunctor.cpp | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/Source/Diagnostics/ComputeDiagFunctors/ParticleReductionFunctor.cpp b/Source/Diagnostics/ComputeDiagFunctors/ParticleReductionFunctor.cpp index c0ecd5934..0b50e2d79 100644 --- a/Source/Diagnostics/ComputeDiagFunctors/ParticleReductionFunctor.cpp +++ b/Source/Diagnostics/ComputeDiagFunctors/ParticleReductionFunctor.cpp @@ -92,7 +92,7 @@ ParticleReductionFunctor::operator() (amrex::MultiFab& mf_dst, const int dcomp, amrex::Real value; if ((do_filter) && (!filter_fn(xw, yw, zw, ux, uy, uz))) value = 0._rt; else value = map_fn(xw, yw, zw, ux, uy, uz); - amrex::Gpu::Atomic::AddNoRet(&out_array(ii, jj, kk, 0), p.rdata(PIdx::w) * value); + amrex::Gpu::Atomic::AddNoRet(&out_array(ii, jj, kk, 0), (amrex::Real)(p.rdata(PIdx::w) * value)); }); if (m_do_average) { amrex::MultiFab ppc_mf(warpx.boxArray(m_lev), warpx.DistributionMap(m_lev), 1, ng); @@ -134,7 +134,7 @@ ParticleReductionFunctor::operator() (amrex::MultiFab& mf_dst, const int dcomp, amrex::Real filter; if ((do_filter) && (!filter_fn(xw, yw, zw, ux, uy, uz))) filter = 0._rt; else filter = 1._rt; - amrex::Gpu::Atomic::AddNoRet(&out_array(ii, jj, kk, 0), p.rdata(PIdx::w) * filter); + amrex::Gpu::Atomic::AddNoRet(&out_array(ii, jj, kk, 0), (amrex::Real)(p.rdata(PIdx::w) * filter)); }); // Divide value by number of particles for average. Set average to zero if there are no particles for (amrex::MFIter mfi(red_mf, amrex::TilingIfNotGPU()); mfi.isValid(); ++mfi) |