aboutsummaryrefslogtreecommitdiff
path: root/Source/BoundaryConditions/PML.cpp
diff options
context:
space:
mode:
authorGravatar Luca Fedeli <luca.fedeli@cea.fr> 2020-12-01 18:27:07 +0100
committerGravatar GitHub <noreply@github.com> 2020-12-01 09:27:07 -0800
commit68f4dd87d2814058ac34ca08061c7c27f42fda7e (patch)
tree5238358ea40976c0b9cde53b4af8a438a03dd483 /Source/BoundaryConditions/PML.cpp
parentae89e95c1636f28e2d88a93620c20f4c4acfbfeb (diff)
downloadWarpX-68f4dd87d2814058ac34ca08061c7c27f42fda7e.tar.gz
WarpX-68f4dd87d2814058ac34ca08061c7c27f42fda7e.tar.zst
WarpX-68f4dd87d2814058ac34ca08061c7c27f42fda7e.zip
Fix some warnings related to double to float conversions (#1533)
* fixed several warnings related to double to float conversions Co-authored-by: Axel Huebl <axel.huebl@plasma.ninja>
Diffstat (limited to 'Source/BoundaryConditions/PML.cpp')
-rw-r--r--Source/BoundaryConditions/PML.cpp14
1 files changed, 7 insertions, 7 deletions
diff --git a/Source/BoundaryConditions/PML.cpp b/Source/BoundaryConditions/PML.cpp
index 04545c1be..528dcb6cd 100644
--- a/Source/BoundaryConditions/PML.cpp
+++ b/Source/BoundaryConditions/PML.cpp
@@ -48,12 +48,12 @@ namespace
Real offset = static_cast<Real>(glo-i);
p_sigma[i-slo] = fac*(offset*offset);
// sigma_cumsum is the analytical integral of sigma function at same points than sigma
- p_sigma_cumsum[i-slo] = (fac*(offset*offset*offset)/3.)/PhysConst::c;
+ p_sigma_cumsum[i-slo] = (fac*(offset*offset*offset)/3._rt)/PhysConst::c;
if (i <= ohi+1) {
- offset = static_cast<Real>(glo-i) - 0.5;
+ offset = static_cast<Real>(glo-i) - 0.5_rt;
p_sigma_star[i-sslo] = fac*(offset*offset);
// sigma_star_cumsum is the analytical integral of sigma function at same points than sigma_star
- p_sigma_star_cumsum[i-sslo] = (fac*(offset*offset*offset)/3.)/PhysConst::c;
+ p_sigma_star_cumsum[i-sslo] = (fac*(offset*offset*offset)/3._rt)/PhysConst::c;
}
});
}
@@ -78,11 +78,11 @@ namespace
i += olo;
Real offset = static_cast<Real>(i-ghi-1);
p_sigma[i-slo] = fac*(offset*offset);
- p_sigma_cumsum[i-slo] = (fac*(offset*offset*offset)/3.)/PhysConst::c;
+ p_sigma_cumsum[i-slo] = (fac*(offset*offset*offset)/3._rt)/PhysConst::c;
if (i <= ohi+1) {
- offset = static_cast<Real>(i-ghi) - 0.5;
+ offset = static_cast<Real>(i-ghi) - 0.5_rt;
p_sigma_star[i-sslo] = fac*(offset*offset);
- p_sigma_star_cumsum[i-sslo] = (fac*(offset*offset*offset)/3.)/PhysConst::c;
+ p_sigma_star_cumsum[i-sslo] = (fac*(offset*offset*offset)/3._rt)/PhysConst::c;
}
});
}
@@ -153,7 +153,7 @@ SigmaBox::SigmaBox (const Box& box, const BoxArray& grids, const Real* dx, int n
Array<Real,AMREX_SPACEDIM> fac;
for (int idim = 0; idim < AMREX_SPACEDIM; ++idim) {
- fac[idim] = 4.0*PhysConst::c/(dx[idim]*static_cast<Real>(delta*delta));
+ fac[idim] = 4.0_rt*PhysConst::c/(dx[idim]*static_cast<Real>(delta*delta));
}
const std::vector<std::pair<int,Box> >& isects = grids.intersections(box, false, ncell);