aboutsummaryrefslogtreecommitdiff
path: root/Source/Utils/WarpXMovingWindow.cpp
diff options
context:
space:
mode:
authorGravatar David Grote <grote1@llnl.gov> 2022-02-04 17:12:55 -0800
committerGravatar GitHub <noreply@github.com> 2022-02-05 01:12:55 +0000
commit5692067b01252146b8d0a90137a1bd952644c8ca (patch)
treebfb704a14588a54207b883254264a8c474d65a14 /Source/Utils/WarpXMovingWindow.cpp
parent9263e6a9832f7ec69a8cc54fda3f6f1de51caaf1 (diff)
downloadWarpX-5692067b01252146b8d0a90137a1bd952644c8ca.tar.gz
WarpX-5692067b01252146b8d0a90137a1bd952644c8ca.tar.zst
WarpX-5692067b01252146b8d0a90137a1bd952644c8ca.zip
Fixes removing implicit double to float conversions (#2687)
* Fixes removing implicit double to float conversions * Minor fix in Evolve * Removed comments * Reverted amrex::second to original version. This change will be made in a separate PR * More fixes * Performance: pow2 & pow3 * One more pow2 * Cleaning: auto where types are repetitive std::pow(float, int): see comments and https://stackoverflow.com/a/5627278/2719194
Diffstat (limited to 'Source/Utils/WarpXMovingWindow.cpp')
-rw-r--r--Source/Utils/WarpXMovingWindow.cpp17
1 files changed, 9 insertions, 8 deletions
diff --git a/Source/Utils/WarpXMovingWindow.cpp b/Source/Utils/WarpXMovingWindow.cpp
index 34087ab27..d73aa8b1c 100644
--- a/Source/Utils/WarpXMovingWindow.cpp
+++ b/Source/Utils/WarpXMovingWindow.cpp
@@ -296,6 +296,7 @@ WarpX::shiftMF (amrex::MultiFab& mf, const amrex::Geometry& geom, int num_shift,
amrex::Real external_field, bool useparser,
amrex::ParserExecutor<3> const& field_parser)
{
+ using namespace amrex::literals;
WARPX_PROFILE("WarpX::shiftMF()");
const amrex::BoxArray& ba = mf.boxArray();
const amrex::DistributionMapping& dm = mf.DistributionMap();
@@ -382,22 +383,22 @@ WarpX::shiftMF (amrex::MultiFab& mf, const amrex::Geometry& geom, int num_shift,
{
// Compute x,y,z co-ordinates based on index type of mf
#if defined(WARPX_DIM_1D_Z)
- amrex::Real x = 0.0;
- amrex::Real y = 0.0;
- amrex::Real fac_z = (1.0 - mf_type[0]) * dx[0]*0.5;
+ amrex::Real x = 0.0_rt;
+ amrex::Real y = 0.0_rt;
+ amrex::Real fac_z = (1.0_rt - mf_type[0]) * dx[0]*0.5_rt;
amrex::Real z = i*dx[0] + real_box.lo(0) + fac_z;
#elif defined(WARPX_DIM_XZ) || defined(WARPX_DIM_RZ)
- amrex::Real fac_x = (1.0 - mf_type[0]) * dx[0]*0.5;
+ amrex::Real fac_x = (1.0_rt - mf_type[0]) * dx[0]*0.5_rt;
amrex::Real x = i*dx[0] + real_box.lo(0) + fac_x;
amrex::Real y = 0.0;
- amrex::Real fac_z = (1.0 - mf_type[1]) * dx[1]*0.5;
+ amrex::Real fac_z = (1.0_rt - mf_type[1]) * dx[1]*0.5_rt;
amrex::Real z = j*dx[1] + real_box.lo(1) + fac_z;
#else
- amrex::Real fac_x = (1.0 - mf_type[0]) * dx[0]*0.5;
+ amrex::Real fac_x = (1.0_rt - mf_type[0]) * dx[0]*0.5_rt;
amrex::Real x = i*dx[0] + real_box.lo(0) + fac_x;
- amrex::Real fac_y = (1.0 - mf_type[1]) * dx[1]*0.5;
+ amrex::Real fac_y = (1.0_rt - mf_type[1]) * dx[1]*0.5_rt;
amrex::Real y = j*dx[1] + real_box.lo(1) + fac_y;
- amrex::Real fac_z = (1.0 - mf_type[2]) * dx[2]*0.5;
+ amrex::Real fac_z = (1.0_rt - mf_type[2]) * dx[2]*0.5_rt;
amrex::Real z = k*dx[2] + real_box.lo(2) + fac_z;
#endif
srcfab(i,j,k,n) = field_parser(x,y,z);