From 0344c42e27c61b286e885889028c7f77725e7f74 Mon Sep 17 00:00:00 2001 From: "Kevin Z. Zhu" <86268612+KZhu-ME@users.noreply.github.com> Date: Tue, 24 May 2022 17:57:51 -0700 Subject: 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 Co-authored-by: Peter Scherpelz <31747262+peterscherpelz@users.noreply.github.com> --- Source/Initialization/WarpXInitData.cpp | 14 ++++++++++++++ 1 file changed, 14 insertions(+) (limited to 'Source/Initialization/WarpXInitData.cpp') diff --git a/Source/Initialization/WarpXInitData.cpp b/Source/Initialization/WarpXInitData.cpp index b980e9403..41e11ea63 100644 --- a/Source/Initialization/WarpXInitData.cpp +++ b/Source/Initialization/WarpXInitData.cpp @@ -119,6 +119,20 @@ WarpX::PrintMainPICparameters () amrex::Print() << "--------------------------- MAIN EM PIC PARAMETERS ----------------------------\n"; amrex::Print() << "-------------------------------------------------------------------------------\n"; + // print warpx build information + if constexpr (std::is_same::value) { + amrex::Print() << "Precision: | SINGLE" << "\n"; + } + else { + amrex::Print() << "Precision: | DOUBLE" << "\n"; + } + if constexpr (std::is_same::value) { + amrex::Print() << "Particle precision: | SINGLE" << "\n"; + } + else { + amrex::Print() << "Particle precision: | DOUBLE" << "\n"; + } + // Print geometry dimensionality amrex::ParmParse pp_geometry("geometry"); std::string dims; -- cgit v1.2.3