diff --git a/Source/BaseStateGeometry.cpp b/Source/BaseStateGeometry.cpp index fb96d738c..151452c69 100644 --- a/Source/BaseStateGeometry.cpp +++ b/Source/BaseStateGeometry.cpp @@ -91,12 +91,12 @@ void BaseStateGeometry::Init(const int max_radial_level_in, const Real* dx_fine = geom[max_level].CellSize(); // nr_fine = nr_irreg + 1 for (auto i = 0; i < nr_fine; ++i) { - r_cc_loc(0, i) = sqrt(0.75 + 2.0 * Real(i)) * dx_fine[0]; + r_cc_loc(0, i) = std::sqrt(0.75 + 2.0 * Real(i)) * dx_fine[0]; } r_edge_loc(0) = 0.0; for (auto i = 0; i < nr_fine; ++i) { r_edge_loc(0, i + 1) = - sqrt(0.75 + 2.0 * (Real(i) + 0.5)) * dx_fine[0]; + std::sqrt(0.75 + 2.0 * (Real(i) + 0.5)) * dx_fine[0]; } } else { for (auto i = 0; i < nr_fine; ++i) { diff --git a/Source/MaestroAverage.cpp b/Source/MaestroAverage.cpp index c6b88e5cc..dbd49e1c2 100644 --- a/Source/MaestroAverage.cpp +++ b/Source/MaestroAverage.cpp @@ -257,7 +257,7 @@ void Maestro::Average(const Vector& phi, BaseState& phibar, if (cell_valid) { // compute distance to center - Real radius = sqrt(x * x + y * y + z * z); + Real radius = std::sqrt(x * x + y * y + z * z); // figure out which radii index this point maps into auto index = (int)amrex::Math::round( @@ -444,7 +444,7 @@ void Maestro::Average(const Vector& phi, BaseState& phibar, amrex::min(stencil_coord, max_rcoord(which_lev(r)) - 1); bool limit = - (r <= nrf - 1 - drdxfac_loc * pow(2.0, (fine_lev - 2))); + (r <= nrf - 1 - drdxfac_loc * std::pow(2.0, (fine_lev - 2))); phibar_arr(0, r) = QuadInterp(radius, radii(which_lev(r), stencil_coord), diff --git a/Source/MaestroBurner.cpp b/Source/MaestroBurner.cpp index e085c079e..5b405d5b6 100644 --- a/Source/MaestroBurner.cpp +++ b/Source/MaestroBurner.cpp @@ -184,11 +184,11 @@ void Maestro::Burner(const Vector& s_in, Vector& s_out, // check if sum{X_k} = 1 Real sumX = 0.0; - for (int n = 0; n < NumSpec; ++n) { - sumX += x_out[n]; + for (auto X : x_out) { + sumX += X; } - if (fabs(sumX - 1.0) > reaction_sum_tol) { + if (std::abs(sumX - 1.0) > reaction_sum_tol) { #ifndef AMREX_USE_GPU amrex::Print() << "ERROR: abundances do not sum to 1"; #endif diff --git a/Source/MaestroDiag.cpp b/Source/MaestroDiag.cpp index ba4b36d9a..7e925bf93 100644 --- a/Source/MaestroDiag.cpp +++ b/Source/MaestroDiag.cpp @@ -146,7 +146,7 @@ void Maestro::DiagFile(const int step, const Real t_in, // weight is the factor by which the volume of a cell at the current level // relates to the volume of a cell at the coarsest level of refinement. const auto weight = - AMREX_SPACEDIM == 2 ? 1.0 / pow(4.0, lev) : 1.0 / pow(8.0, lev); + AMREX_SPACEDIM == 2 ? 1.0 / std::pow(4.0, lev) : 1.0 / std::pow(8.0, lev); #if (AMREX_SPACEDIM == 3) // for non-spherical we have to set these to be a valid array as diff --git a/Source/MaestroEnforceHSE.cpp b/Source/MaestroEnforceHSE.cpp index 7693b2e07..c6e0b20d8 100644 --- a/Source/MaestroEnforceHSE.cpp +++ b/Source/MaestroEnforceHSE.cpp @@ -183,7 +183,7 @@ void Maestro::EnforceHSE(const BaseState& rho0_s, BaseState& p0_s, if (r_end_coord(n, i) != base_geom.nr(n) - 1) { for (auto l = n - 1; l >= 0; --l) { for (auto r = (int)amrex::Math::round( - (r_end_coord(n, i) + 1) / pow(2, n - l)); + (r_end_coord(n, i) + 1) / std::pow(2, n - l)); r <= base_geom.nr(l) - 1; ++r) { p0(l, r) -= offset; } diff --git a/Source/MaestroFill3dData.cpp b/Source/MaestroFill3dData.cpp index 8687af7ef..e2b4556e9 100644 --- a/Source/MaestroFill3dData.cpp +++ b/Source/MaestroFill3dData.cpp @@ -108,7 +108,7 @@ void Maestro::Put1dArrayOnCart(const int lev, const BaseState& s0, Real z = prob_lo[2] + (Real(k) + 0.5) * dx[2] - center_p[2]; - Real radius = sqrt(x * x + y * y + z * z); + Real radius = std::sqrt(x * x + y * y + z * z); int index = cc_to_r(i, j, k); Real rfac; @@ -175,7 +175,7 @@ void Maestro::Put1dArrayOnCart(const int lev, const BaseState& s0, Real z = prob_lo[2] + (Real(k) + 0.5) * dx[2] - center_p[2]; - Real radius = sqrt(x * x + y * y + z * z); + Real radius = std::sqrt(x * x + y * y + z * z); int index = cc_to_r(i, j, k); Real s0_cart_val = s0_arr(0, index); @@ -210,7 +210,7 @@ void Maestro::Put1dArrayOnCart(const int lev, const BaseState& s0, Real z = prob_lo[2] + (Real(k) + 0.5) * dx[2] - center_p[2]; - Real radius = sqrt(x * x + y * y + z * z); + Real radius = std::sqrt(x * x + y * y + z * z); auto index = int(radius / drf); Real rfac = (radius - Real(index) * drf) / drf; @@ -272,7 +272,7 @@ void Maestro::Put1dArrayOnCart(const int lev, const BaseState& s0, Real z = prob_lo[2] + (Real(k) + 0.5) * dx[2] - center_p[2]; - Real radius = sqrt(x * x + y * y + z * z); + Real radius = std::sqrt(x * x + y * y + z * z); auto index = int(radius / drf); Real s0_cart_val = 0.0; @@ -513,7 +513,7 @@ void Maestro::MakeW0mac(Vector >& w0mac) { Real y = prob_lo[1] + Real(j) * dx[1] - center_p[1]; Real z = prob_lo[2] + Real(k) * dx[2] - center_p[2]; - Real radius = sqrt(x * x + y * y + z * z); + Real radius = std::sqrt(x * x + y * y + z * z); auto index = int(radius / drf); Real rfac = (radius - Real(index) * drf) / drf; @@ -574,7 +574,7 @@ void Maestro::MakeW0mac(Vector >& w0mac) { Real y = prob_lo[1] + (Real(j) + 0.5) * dx[1] - center_p[1]; Real z = prob_lo[2] + (Real(k) + 0.5) * dx[2] - center_p[2]; - Real radius = sqrt(x * x + y * y + z * z); + Real radius = std::sqrt(x * x + y * y + z * z); auto index = int(radius / drf); Real w0_cart_val; @@ -612,7 +612,7 @@ void Maestro::MakeW0mac(Vector >& w0mac) { Real y = prob_lo[1] + Real(j) * dx[1] - center_p[1]; Real z = prob_lo[2] + (Real(k) + 0.5) * dx[2] - center_p[2]; - Real radius = sqrt(x * x + y * y + z * z); + Real radius = std::sqrt(x * x + y * y + z * z); auto index = int(radius / drf); Real w0_cart_val; @@ -650,7 +650,7 @@ void Maestro::MakeW0mac(Vector >& w0mac) { Real y = prob_lo[1] + (Real(j) + 0.5) * dx[1] - center_p[1]; Real z = prob_lo[2] + Real(k) * dx[2] - center_p[2]; - Real radius = sqrt(x * x + y * y + z * z); + Real radius = std::sqrt(x * x + y * y + z * z); auto index = int(radius / drf); Real w0_cart_val; @@ -789,7 +789,7 @@ void Maestro::MakeS0mac(const BaseState& s0, Real z = prob_lo[2] + (Real(k) + 0.5) * dx[2] - center_p[2]; - Real radius = sqrt(x * x + y * y + z * z); + Real radius = std::sqrt(x * x + y * y + z * z); auto index = (int)amrex::Math::round( radius * radius / (dx[0] * dx[0]) - 0.375); // closest radial index to edge-centered point @@ -831,7 +831,7 @@ void Maestro::MakeS0mac(const BaseState& s0, Real z = prob_lo[2] + (Real(k) + 0.5) * dx[2] - center_p[2]; - Real radius = sqrt(x * x + y * y + z * z); + Real radius = std::sqrt(x * x + y * y + z * z); auto index = (int)amrex::Math::round( radius * radius / (dx[1] * dx[1]) - 0.375); // closest radial index to edge-centered point @@ -873,7 +873,7 @@ void Maestro::MakeS0mac(const BaseState& s0, prob_lo[1] + (Real(j) + 0.5) * dx[1] - center_p[1]; Real z = prob_lo[2] + Real(k) * dx[2] - center_p[2]; - Real radius = sqrt(x * x + y * y + z * z); + Real radius = std::sqrt(x * x + y * y + z * z); auto index = (int)amrex::Math::round( radius * radius / (dx[2] * dx[2]) - 0.375); // closest radial index to edge-centered point @@ -916,7 +916,7 @@ void Maestro::MakeS0mac(const BaseState& s0, Real z = prob_lo[2] + (Real(k) + 0.5) * dx[2] - center_p[2]; - Real radius = sqrt(x * x + y * y + z * z); + Real radius = std::sqrt(x * x + y * y + z * z); auto index = (int)amrex::Math::round( radius * radius / (dx[0] * dx[0]) - 0.375); // closest radial index to edge-centered point @@ -942,7 +942,7 @@ void Maestro::MakeS0mac(const BaseState& s0, Real z = prob_lo[2] + (Real(k) + 0.5) * dx[2] - center_p[2]; - Real radius = sqrt(x * x + y * y + z * z); + Real radius = std::sqrt(x * x + y * y + z * z); auto index = (int)amrex::Math::round( radius * radius / (dx[1] * dx[1]) - 0.375); // closest radial index to edge-centered point @@ -968,7 +968,7 @@ void Maestro::MakeS0mac(const BaseState& s0, prob_lo[1] + (Real(j) + 0.5) * dx[1] - center_p[1]; Real z = prob_lo[2] + Real(k) * dx[2] - center_p[2]; - Real radius = sqrt(x * x + y * y + z * z); + Real radius = std::sqrt(x * x + y * y + z * z); auto index = (int)amrex::Math::round( radius * radius / (dx[2] * dx[2]) - 0.375); // closest radial index to edge-centered point @@ -1014,7 +1014,7 @@ void Maestro::MakeS0mac(const BaseState& s0, Real z = prob_lo[2] + (Real(k) + 0.5) * dx[2] - center_p[2]; - Real radius = sqrt(x * x + y * y + z * z); + Real radius = std::sqrt(x * x + y * y + z * z); auto index = int(radius / drf); if (radius >= r_cc_loc(0, index)) { @@ -1050,7 +1050,7 @@ void Maestro::MakeS0mac(const BaseState& s0, Real z = prob_lo[2] + (Real(k) + 0.5) * dx[2] - center_p[2]; - Real radius = sqrt(x * x + y * y + z * z); + Real radius = std::sqrt(x * x + y * y + z * z); auto index = int(radius / drf); if (radius >= r_cc_loc(0, index)) { @@ -1086,7 +1086,7 @@ void Maestro::MakeS0mac(const BaseState& s0, prob_lo[1] + (Real(j) + 0.5) * dx[1] - center_p[1]; Real z = prob_lo[2] + Real(k) * dx[2] - center_p[2]; - Real radius = sqrt(x * x + y * y + z * z); + Real radius = std::sqrt(x * x + y * y + z * z); auto index = int(radius / drf); if (radius >= r_cc_loc(0, index)) { @@ -1123,7 +1123,7 @@ void Maestro::MakeS0mac(const BaseState& s0, Real z = prob_lo[2] + (Real(k) + 0.5) * dx[2] - center_p[2]; - Real radius = sqrt(x * x + y * y + z * z); + Real radius = std::sqrt(x * x + y * y + z * z); auto index = int(radius / drf); if (index == 0) { @@ -1145,7 +1145,7 @@ void Maestro::MakeS0mac(const BaseState& s0, Real z = prob_lo[2] + (Real(k) + 0.5) * dx[2] - center_p[2]; - Real radius = sqrt(x * x + y * y + z * z); + Real radius = std::sqrt(x * x + y * y + z * z); auto index = int(radius / drf); if (index == 0) { @@ -1167,7 +1167,7 @@ void Maestro::MakeS0mac(const BaseState& s0, prob_lo[1] + (Real(j) + 0.5) * dx[1] - center_p[1]; Real z = prob_lo[2] + Real(k) * dx[2] - center_p[2]; - Real radius = sqrt(x * x + y * y + z * z); + Real radius = std::sqrt(x * x + y * y + z * z); auto index = int(radius / drf); if (index == 0) { @@ -1220,7 +1220,7 @@ void Maestro::MakeNormal() { Real y = prob_lo[1] + (Real(j) + 0.5) * dx[1] - center_p[1]; Real z = prob_lo[2] + (Real(k) + 0.5) * dx[2] - center_p[2]; - Real inv_radius = 1.0 / sqrt(x * x + y * y + z * z); + Real inv_radius = 1.0 / std::sqrt(x * x + y * y + z * z); normal_arr(i, j, k, 0) = x * inv_radius; normal_arr(i, j, k, 1) = y * inv_radius; diff --git a/Source/MaestroMakeBeta0.cpp b/Source/MaestroMakeBeta0.cpp index 45b5f938f..d5e24a2e9 100644 --- a/Source/MaestroMakeBeta0.cpp +++ b/Source/MaestroMakeBeta0.cpp @@ -190,13 +190,12 @@ void Maestro::MakeBeta0(BaseState& beta0_s, const BaseState& rho0_s, Real coeff3 = kappa * lambda / (mu * nu); integral = - coeff1 * log((gamma1bar(n, r) + - 0.5 * mu * dr(n)) / - (gamma1bar(n, r) - - 0.5 * mu * dr(n))) + - coeff2 * - log((p0(n, r) + 0.5 * nu * dr(n)) / - (p0(n, r) - 0.5 * nu * dr(n))) - + coeff1 * std::log((gamma1bar(n, r) + + 0.5 * mu * dr(n)) / + (gamma1bar(n, r) - + 0.5 * mu * dr(n))) + + coeff2 * std::log((p0(n, r) + 0.5 * nu * dr(n)) / + (p0(n, r) - 0.5 * nu * dr(n))) - coeff3 * dr(n); } else { @@ -211,12 +210,12 @@ void Maestro::MakeBeta0(BaseState& beta0_s, const BaseState& rho0_s, integral = (amrex::Math::abs(grav_cell(n, r)) / denom) * - (coeff1 * log((gamma1bar(n, r) + - 0.5 * mu * drp) / - (gamma1bar(n, r) - - 0.5 * mu * drm)) - - coeff2 * log((p0(n, r) + 0.5 * nu * drp) / - (p0(n, r) - 0.5 * nu * drm))); + (coeff1 * std::log((gamma1bar(n, r) + + 0.5 * mu * drp) / + (gamma1bar(n, r) - + 0.5 * mu * drm)) - + coeff2 * std::log((p0(n, r) + 0.5 * nu * drp) / + (p0(n, r) - 0.5 * nu * drm))); } } @@ -247,7 +246,7 @@ void Maestro::MakeBeta0(BaseState& beta0_s, const BaseState& rho0_s, (base_geom.r_end_coord(n, j) + 1) / 2); for (int i = n - 1; i >= 0; --i) { - auto refrat = (int)amrex::Math::round(pow(2, n - i)); + auto refrat = (int)amrex::Math::round(std::pow(2, n - i)); // Offset the centered beta on level i above this point so the total // integral is consistent diff --git a/Source/MaestroMakeEdgeState.cpp b/Source/MaestroMakeEdgeState.cpp index 50fc57b96..5102b4216 100644 --- a/Source/MaestroMakeEdgeState.cpp +++ b/Source/MaestroMakeEdgeState.cpp @@ -315,7 +315,7 @@ void Maestro::MakeEdgeState1dSphr(BaseState& s_state, if (sgn * (delam - alpham) >= 1.e-10) { alphap = (-2.0 * delam - 2.0 * sgn * - sqrt(delam * delam - delam * alpham)); + std::sqrt(delam * delam - delam * alpham)); } else { alphap = -2.0 * alpham; } @@ -329,7 +329,7 @@ void Maestro::MakeEdgeState1dSphr(BaseState& s_state, if (sgn * (delap - alphap) >= 1.e-10) { alpham = (-2.0 * delap - 2.0 * sgn * - sqrt(delap * delap - delap * alphap)); + std::sqrt(delap * delap - delap * alphap)); } else { alpham = -2.0 * alphap; } @@ -861,8 +861,8 @@ void Maestro::MakeEdgeState1dPlanar(BaseState& s_state, if (sgn * (delam - alpham) >= 1.e-10) { alphap = (-2.0 * delam - 2.0 * sgn * - sqrt(delam * delam - - delam * alpham)); + std::sqrt(delam * delam - + delam * alpham)); } else { alphap = -2.0 * alpham; } @@ -877,8 +877,8 @@ void Maestro::MakeEdgeState1dPlanar(BaseState& s_state, if (sgn * (delap - alphap) >= 1.e-10) { alpham = (-2.0 * delap - 2.0 * sgn * - sqrt(delap * delap - - delap * alphap)); + std::sqrt(delap * delap - + delap * alphap)); } else { alpham = -2.0 * alphap; } diff --git a/Source/MaestroMakew0.cpp b/Source/MaestroMakew0.cpp index b728c9779..3f9e86fc7 100644 --- a/Source/MaestroMakew0.cpp +++ b/Source/MaestroMakew0.cpp @@ -190,7 +190,7 @@ void Maestro::Makew0Planar( w0_arr(n - 1, (base_geom.r_end_coord(n, j) + 1) / 2); for (auto i = n - 1; i >= 0; --i) { - auto refrat = (int)amrex::Math::round(pow(2, n - i)); + auto refrat = (int)amrex::Math::round(std::pow(2, n - i)); // Restrict w0 from level n to level i for (auto r = base_geom.r_start_coord(n, j); diff --git a/Source/MaestroNodalProj.cpp b/Source/MaestroNodalProj.cpp index df2d6bddf..b86ffe738 100644 --- a/Source/MaestroNodalProj.cpp +++ b/Source/MaestroNodalProj.cpp @@ -261,29 +261,29 @@ void Maestro::NodalProj(int proj_type, Vector& rhcc, } else if (istep_divu_iter == init_divu_iter - 1) { rel_tol = eps_divu_sph * divu_iter_factor; } else if (istep_divu_iter <= init_divu_iter - 2) { - rel_tol = eps_divu_sph * pow(divu_iter_factor, 2); + rel_tol = eps_divu_sph * std::pow(divu_iter_factor, 2); } } else { if (istep_divu_iter == init_divu_iter) { rel_tol = amrex::min( - eps_divu_cart * pow(divu_level_factor, finest_level), - eps_divu_cart * pow(divu_level_factor, 2)); + eps_divu_cart * std::pow(divu_level_factor, finest_level), + eps_divu_cart * std::pow(divu_level_factor, 2)); } else if (istep_divu_iter == init_divu_iter - 1) { rel_tol = amrex::min(eps_divu_cart * divu_iter_factor * - pow(divu_level_factor, finest_level), + std::pow(divu_level_factor, finest_level), eps_divu_cart * divu_iter_factor * - pow(divu_level_factor, 2)); + std::pow(divu_level_factor, 2)); } else if (istep_divu_iter <= init_divu_iter - 2) { - rel_tol = amrex::min(eps_divu_cart * pow(divu_iter_factor, 2) * - pow(divu_level_factor, finest_level), - eps_divu_cart * pow(divu_iter_factor, 2) * - pow(divu_level_factor, 2)); + rel_tol = amrex::min(eps_divu_cart * std::pow(divu_iter_factor, 2) * + std::pow(divu_level_factor, finest_level), + eps_divu_cart * std::pow(divu_iter_factor, 2) * + std::pow(divu_level_factor, 2)); } } } else if (proj_type == pressure_iters_comp || proj_type == regular_timestep_comp) { rel_tol = - amrex::min(eps_hg_max, eps_hg * pow(hg_level_factor, finest_level)); + amrex::min(eps_hg_max, eps_hg * std::pow(hg_level_factor, finest_level)); } // solve for phi diff --git a/Source/MaestroPPM.cpp b/Source/MaestroPPM.cpp index 8f83cb617..b99deb5b4 100644 --- a/Source/MaestroPPM.cpp +++ b/Source/MaestroPPM.cpp @@ -415,7 +415,7 @@ void Maestro::PPM(const Box& bx, Array4 const s, if (sgn * (delam - alpham) >= 1.e-10) { alphap = -2.0 * delam - 2.0 * sgn * - sqrt(delam * delam - delam * alpham); + std::sqrt(delam * delam - delam * alpham); } else { alphap = -2.0 * alpham; } @@ -429,7 +429,7 @@ void Maestro::PPM(const Box& bx, Array4 const s, if (sgn * (delap - alphap) >= 1.e-10) { alpham = (-2.0 * delap - 2.0 * sgn * - sqrt(delap * delap - delap * alphap)); + std::sqrt(delap * delap - delap * alphap)); } else { alpham = -2.0 * alphap; } @@ -550,8 +550,8 @@ void Maestro::PPM(const Box& bx, Array4 const s, if (sgn * (delam - alpham) >= 1.e-10) { alphap = (-2.0 * delam - 2.0 * sgn * - sqrt(delam * delam - - delam * alpham)); + std::sqrt(delam * delam - + delam * alpham)); } else { alphap = -2.0 * alpham; } @@ -566,8 +566,8 @@ void Maestro::PPM(const Box& bx, Array4 const s, if (sgn * (delap - alphap) >= 1.e10) { alpham = (-2.0 * delap - 2.0 * sgn * - sqrt(delap * delap - - delap * alphap)); + std::sqrt(delap * delap - + delap * alphap)); } else { alpham = -2.0 * alphap; } @@ -688,8 +688,8 @@ void Maestro::PPM(const Box& bx, Array4 const s, if (sgn * (delam - alpham) >= 1.e-10) { alphap = (-2.0 * delam - 2.0 * sgn * - sqrt(delam * delam - - delam * alpham)); + std::sqrt(delam * delam - + delam * alpham)); } else { alphap = -2.0 * alpham; } @@ -704,8 +704,8 @@ void Maestro::PPM(const Box& bx, Array4 const s, if (sgn * (delap - alphap) >= 1.e-10) { alpham = (-2.0 * delap - 2.0 * sgn * - sqrt(delap * delap - - delap * alphap)); + std::sqrt(delap * delap - + delap * alphap)); } else { alpham = -2.0 * alphap; } @@ -1159,7 +1159,7 @@ void Maestro::PPM(const Box& bx, Array4 const s, if (sgn * (delam - alpham) >= 1.e-10) { alphap = (-2.0 * delam - 2.0 * sgn * - sqrt(delam * delam - delam * alpham)); + std::sqrt(delam * delam - delam * alpham)); } else { alphap = -2.0 * alpham; } @@ -1173,7 +1173,7 @@ void Maestro::PPM(const Box& bx, Array4 const s, if (sgn * (delap - alphap) >= 1.e-10) { alpham = (-2.0 * delap - 2.0 * sgn * - sqrt(delap * delap - delap * alphap)); + std::sqrt(delap * delap - delap * alphap)); } else { alpham = -2.0 * alphap; } @@ -1294,8 +1294,8 @@ void Maestro::PPM(const Box& bx, Array4 const s, if (sgn * (delam - alpham) >= 1.e-10) { alphap = (-2.0 * delam - 2.0 * sgn * - sqrt(delam * delam - - delam * alpham)); + std::sqrt(delam * delam - + delam * alpham)); } else { alphap = -2.0 * alpham; } @@ -1310,8 +1310,8 @@ void Maestro::PPM(const Box& bx, Array4 const s, if (sgn * (delap - alphap) >= 1.e-10) { alpham = (-2.0 * delap - 2.0 * sgn * - sqrt(delap * delap - - delap * alphap)); + std::sqrt(delap * delap - + delap * alphap)); } else { alpham = -2.0 * alphap; } @@ -1434,8 +1434,8 @@ void Maestro::PPM(const Box& bx, Array4 const s, if (sgn * (delam - alpham) >= 1.e-10) { alphap = (-2.0 * delam - 2.0 * sgn * - sqrt(delam * delam - - delam * alpham)); + std::sqrt(delam * delam - + delam * alpham)); } else { alphap = -2.0 * alpham; } @@ -1450,8 +1450,8 @@ void Maestro::PPM(const Box& bx, Array4 const s, if (sgn * (delap - alphap) >= 1.e-10) { alpham = (-2.0 * delap - 2.0 * sgn * - sqrt(delap * delap - - delap * alphap)); + std::sqrt(delap * delap - + delap * alphap)); } else { alpham = -2.0 * alphap; } @@ -1904,7 +1904,7 @@ void Maestro::PPM(const Box& bx, Array4 const s, if (sgn * (delam - alpham) >= 1.e-10) { alphap = (-2.0 * delam - 2.0 * sgn * - sqrt(delam * delam - delam * alpham)); + std::sqrt(delam * delam - delam * alpham)); } else { alphap = -2.0 * alpham; } @@ -1918,7 +1918,7 @@ void Maestro::PPM(const Box& bx, Array4 const s, if (sgn * (delap - alphap) >= 1.e-10) { alpham = (-2.0 * delap - 2.0 * sgn * - sqrt(delap * delap - delap * alphap)); + std::sqrt(delap * delap - delap * alphap)); } else { alpham = -2.0 * alphap; } @@ -2038,8 +2038,8 @@ void Maestro::PPM(const Box& bx, Array4 const s, if (sgn * (delam - alpham) >= 1.e-10) { alphap = (-2.0 * delam - 2.0 * sgn * - sqrt(delam * delam - - delam * alpham)); + std::sqrt(delam * delam - + delam * alpham)); } else { alphap = -2.0 * alpham; } @@ -2054,8 +2054,8 @@ void Maestro::PPM(const Box& bx, Array4 const s, if (sgn * (delap - alphap) >= 1.e-10) { alpham = (-2.0 * delap - 2.0 * sgn * - sqrt(delap * delap - - delap * alphap)); + std::sqrt(delap * delap - + delap * alphap)); } else { alpham = -2.0 * alphap; } @@ -2178,8 +2178,8 @@ void Maestro::PPM(const Box& bx, Array4 const s, if (sgn * (delam - alpham) >= 1.e-10) { alphap = (-2.0 * delam - 2.0 * sgn * - sqrt(delam * delam - - delam * alpham)); + std::sqrt(delam * delam - + delam * alpham)); } else { alphap = -2.0 * alpham; } @@ -2194,8 +2194,8 @@ void Maestro::PPM(const Box& bx, Array4 const s, if (sgn * (delap - alphap) >= 1.e-10) { alpham = (-2.0 * delap - 2.0 * sgn * - sqrt(delap * delap - - delap * alphap)); + std::sqrt(delap * delap - + delap * alphap)); } else { alpham = -2.0 * alphap; } diff --git a/Source/MaestroPlot.cpp b/Source/MaestroPlot.cpp index d48971071..e12aaa08c 100644 --- a/Source/MaestroPlot.cpp +++ b/Source/MaestroPlot.cpp @@ -1334,16 +1334,16 @@ void Maestro::MakeMagvel( 0.5 * (w0_arr(i, j, k, 1) + w0_arr(i, j + 1, k, 1)); } magvel_arr(i, j, k) = - sqrt(vel_arr(i, j, k, 0) * vel_arr(i, j, k, 0) + - v_total * v_total); + std::sqrt(vel_arr(i, j, k, 0) * vel_arr(i, j, k, 0) + + v_total * v_total); #else Real w_total = vel_arr(i,j,k,2); if (!average_base_state) { w_total += 0.5 * (w0_arr(i,j,k,2) + w0_arr(i,j,k+1,2)); } - magvel_arr(i,j,k) = sqrt(vel_arr(i,j,k,0)*vel_arr(i,j,k,0) + - vel_arr(i,j,k,1)*vel_arr(i,j,k,1) + - w_total*w_total); + magvel_arr(i,j,k) = std::sqrt(vel_arr(i,j,k,0)*vel_arr(i,j,k,0) + + vel_arr(i,j,k,1)*vel_arr(i,j,k,1) + + w_total*w_total); #endif }); } @@ -1373,8 +1373,8 @@ void Maestro::MakeMagvel( vel_arr(i, j, k, 2) + 0.5 * (w0macz(i, j, k) + w0macz(i, j, k + 1)); magvel_arr(i, j, k) = - sqrt(u_total * u_total + v_total * v_total + - w_total * w_total); + std::sqrt(u_total * u_total + v_total * v_total + + w_total * w_total); }); } #endif @@ -1422,7 +1422,7 @@ void Maestro::MakeVelrc(const Vector& vel, circvel_arr(i, j, k) += circ_comp * circ_comp; } - circvel_arr(i, j, k) = sqrt(circvel_arr(i, j, k)); + circvel_arr(i, j, k) = std::sqrt(circvel_arr(i, j, k)); // add base state vel to get full radial velocity radvel_arr(i, j, k) += w0rcart_arr(i, j, k); @@ -2154,8 +2154,8 @@ void Maestro::MakeVorticity(const Vector& vel, } vort(i, j, k) = - sqrt((wy - vz) * (wy - vz) + (uz - wx) * (uz - wx) + - (vx - uy) * (vx - uy)); + std::sqrt((wy - vz) * (wy - vz) + (uz - wx) * (uz - wx) + + (vx - uy) * (vx - uy)); }); #endif } diff --git a/Source/MaestroRhoHT.cpp b/Source/MaestroRhoHT.cpp index c56c1b4b0..8c5021bf5 100644 --- a/Source/MaestroRhoHT.cpp +++ b/Source/MaestroRhoHT.cpp @@ -246,11 +246,11 @@ void Maestro::MachfromRhoH(const Vector& scal, // vel is the magnitude of the velocity, including w0 #if (AMREX_SPACEDIM == 2) - Real velocity = sqrt(u(i, j, k, 0) * u(i, j, k, 0) + - (u(i, j, k, 1) + w0_arr(i, j, k)) * - (u(i, j, k, 1) + w0_arr(i, j, k))); + Real velocity = std::sqrt(u(i, j, k, 0) * u(i, j, k, 0) + + (u(i, j, k, 1) + w0_arr(i, j, k)) * + (u(i, j, k, 1) + w0_arr(i, j, k))); #else - Real velocity = sqrt(u(i,j,k,0)*u(i,j,k,0) + + Real velocity = std::sqrt(u(i,j,k,0)*u(i,j,k,0) + u(i,j,k,1)*u(i,j,k,1) + (u(i,j,k,2) + w0_arr(i,j,k))*(u(i,j,k,2) + w0_arr(i,j,k))); #endif diff --git a/Source/MaestroSetup.cpp b/Source/MaestroSetup.cpp index 8530e9252..892053d20 100644 --- a/Source/MaestroSetup.cpp +++ b/Source/MaestroSetup.cpp @@ -91,7 +91,7 @@ void Maestro::Setup() { leny = 0.5 * (probHi[1] - probLo[1]); lenz = 0.5 * (probHi[2] - probLo[2]); } - max_dist = sqrt(lenx * lenx + leny * leny + lenz * lenz); + max_dist = std::sqrt(lenx * lenx + leny * leny + lenz * lenz); base_geom.nr_fine = int(max_dist / base_geom.dr_fine) + 1; } #endif