diff --git a/src/embedded_boundaries/eb_annulus.cpp b/src/embedded_boundaries/eb_annulus.cpp index f8c96a83..b7eed715 100644 --- a/src/embedded_boundaries/eb_annulus.cpp +++ b/src/embedded_boundaries/eb_annulus.cpp @@ -39,7 +39,7 @@ void incflo::make_eb_annulus() // Compute distance between cylinder centres Real offset = 0.0; for(int i = 0; i < AMREX_SPACEDIM; i++) - offset += std::pow(outer_center[i] - inner_center[i], 2); + offset += amrex::Math::powi<2>(outer_center[i] - inner_center[i]); offset = std::sqrt(offset); // Check that the inner cylinder is fully contained in the outer one diff --git a/src/embedded_boundaries/eb_box.cpp b/src/embedded_boundaries/eb_box.cpp index 3c361e1d..9a372ae0 100644 --- a/src/embedded_boundaries/eb_box.cpp +++ b/src/embedded_boundaries/eb_box.cpp @@ -32,7 +32,11 @@ void incflo::make_eb_box() ************************************************************************/ Vector boxLo(AMREX_SPACEDIM), boxHi(AMREX_SPACEDIM); - Real offset = 1.0e-15; +#ifdef AMREX_USE_FLOAT + Real offset = Real(1e-8); +#else + Real offset = Real(1e-15); +#endif bool inside = true; for(int i = 0; i < AMREX_SPACEDIM; i++) @@ -54,8 +58,8 @@ void incflo::make_eb_box() // putting them one domain width away if(geom[0].isPeriodic(0)) { - xlo = 2.0 * geom[0].ProbLo(0) - geom[0].ProbHi(0); - xhi = 2.0 * geom[0].ProbHi(0) - geom[0].ProbLo(0); + xlo = Real(2) * geom[0].ProbLo(0) - geom[0].ProbHi(0); + xhi = Real(2) * geom[0].ProbHi(0) - geom[0].ProbLo(0); } Real ylo = boxLo[1] + offset; @@ -65,8 +69,8 @@ void incflo::make_eb_box() // putting them one domain width away if(geom[0].isPeriodic(1)) { - ylo = 2.0 * geom[0].ProbLo(1) - geom[0].ProbHi(1); - yhi = 2.0 * geom[0].ProbHi(1) - geom[0].ProbLo(1); + ylo = Real(2) * geom[0].ProbLo(1) - geom[0].ProbHi(1); + yhi = Real(2) * geom[0].ProbHi(1) - geom[0].ProbLo(1); } #if (AMREX_SPACEDIM > 2) @@ -77,8 +81,8 @@ void incflo::make_eb_box() // putting them one domain width away if(geom[0].isPeriodic(2)) { - zlo = 2.0 * geom[0].ProbLo(2) - geom[0].ProbHi(2); - zhi = 2.0 * geom[0].ProbHi(2) - geom[0].ProbLo(2); + zlo = Real(2) * geom[0].ProbLo(2) - geom[0].ProbHi(2); + zhi = Real(2) * geom[0].ProbHi(2) - geom[0].ProbLo(2); } #endif diff --git a/src/embedded_boundaries/eb_cylinder.cpp b/src/embedded_boundaries/eb_cylinder.cpp index 02afa981..0c1eff0e 100644 --- a/src/embedded_boundaries/eb_cylinder.cpp +++ b/src/embedded_boundaries/eb_cylinder.cpp @@ -33,7 +33,7 @@ void incflo::make_eb_cylinder() pp.getarr("center", centervec, 0, 3); Array center = {AMREX_D_DECL(centervec[0], centervec[1], centervec[2])}; - rotation = (rotation/180.)*M_PI; + rotation = (rotation/Real(180))*Real(M_PI); // Print info about cylinder amrex::Print() << " " << "\n"; diff --git a/src/embedded_boundaries/eb_sphere.cpp b/src/embedded_boundaries/eb_sphere.cpp index cdf735e0..09ef3563 100644 --- a/src/embedded_boundaries/eb_sphere.cpp +++ b/src/embedded_boundaries/eb_sphere.cpp @@ -16,7 +16,7 @@ void incflo::make_eb_sphere() { // Initialise sphere parameters bool inside = true; - Real radius = 0.0002; + Real radius = Real(0.0002); Vector centervec(3); // Get sphere information from inputs file. * diff --git a/src/setup/init.cpp b/src/setup/init.cpp index 2a3db070..db725966 100644 --- a/src/setup/init.cpp +++ b/src/setup/init.cpp @@ -222,7 +222,7 @@ void incflo::ReadParameters () amrex::Real tol_deg(0.); pp_eb_flow.query("normal_tol", tol_deg); - m_eb_flow.normal_tol = tol_deg*M_PI/amrex::Real(180.); + m_eb_flow.normal_tol = tol_deg*amrex::Real(M_PI)/amrex::Real(180); } if (m_advect_tracer && m_eb_flow.enabled && m_eb_flow.tracer.empty()) { diff --git a/src/utilities/io.cpp b/src/utilities/io.cpp index 801011e1..4f3096bb 100644 --- a/src/utilities/io.cpp +++ b/src/utilities/io.cpp @@ -175,7 +175,7 @@ void incflo::ReadCheckpointFile() int i = 0; while(lis >> word) { - prob_lo[i++] = std::stod(word); // NOLINT(clang-analyzer-security.ArrayBound) + prob_lo[i++] = amrex::Real(std::stod(word)); // NOLINT(clang-analyzer-security.ArrayBound) } } @@ -186,7 +186,7 @@ void incflo::ReadCheckpointFile() int i = 0; while(lis >> word) { - prob_hi[i++] = std::stod(word); // NOLINT(clang-analyzer-security.ArrayBound) + prob_hi[i++] = amrex::Real(std::stod(word)); // NOLINT(clang-analyzer-security.ArrayBound) } }