diff --git a/Diagnostics/DustCollapse/main.cpp b/Diagnostics/DustCollapse/main.cpp index 7e2a0763de..9ac8619009 100644 --- a/Diagnostics/DustCollapse/main.cpp +++ b/Diagnostics/DustCollapse/main.cpp @@ -102,18 +102,18 @@ int main(int argc, char* argv[]) #if (AMREX_SPACEDIM == 1) int nbins = domain.length(0); #elif (AMREX_SPACEDIM == 2) - auto x_maxdist = fmax(fabs(problo[0]), fabs(probhi[0])); - auto y_maxdist = fmax(fabs(problo[1] - yctr), fabs(probhi[1] - yctr)); + auto x_maxdist = std::max(std::abs(problo[0]), std::abs(probhi[0])); + auto y_maxdist = std::max(std::abs(problo[1] - yctr), std::abs(probhi[1] - yctr)); - auto max_dist = sqrt(x_maxdist*x_maxdist + y_maxdist*y_maxdist); + auto max_dist = std::sqrt(x_maxdist*x_maxdist + y_maxdist*y_maxdist); int nbins = int(max_dist / dx_fine); #else - auto x_maxdist = fmax(fabs(problo[0] - xctr), fabs(probhi[0] - xctr)); - auto y_maxdist = fmax(fabs(problo[1] - yctr), fabs(probhi[1] - yctr)); - auto z_maxdist = fmax(fabs(problo[2] - zctr), fabs(probhi[2] - zctr)); + auto x_maxdist = std::max(std::abs(problo[0] - xctr), std::abs(probhi[0] - xctr)); + auto y_maxdist = std::max(std::abs(problo[1] - yctr), std::abs(probhi[1] - yctr)); + auto z_maxdist = std::max(std::abs(problo[2] - zctr), std::abs(probhi[2] - zctr)); - auto max_dist = sqrt(x_maxdist*x_maxdist + y_maxdist*y_maxdist + + auto max_dist = std::sqrt(x_maxdist*x_maxdist + y_maxdist*y_maxdist + z_maxdist*z_maxdist); int nbins = int(max_dist / dx_fine); @@ -147,7 +147,7 @@ int main(int argc, char* argv[]) // over levels, we will compare to the finest level index space to // determine if we've already output here int mask_size = domain.length().max(); - Vector imask(pow(mask_size, AMREX_SPACEDIM), 1); + Vector imask(std::pow(mask_size, AMREX_SPACEDIM), 1); // counter int cnt = 0; @@ -210,21 +210,21 @@ int main(int argc, char* argv[]) // analytic expression for the radius as a function of time t = 0.00 Real max_dens = 1.e9; - if (fabs(data.Time()) <= 1.e-8) + if (std::abs(data.Time()) <= 1.e-8) max_dens = 1.e9; - else if (fabs(data.Time() - 0.01) <= 1.e-8) + else if (std::abs(data.Time() - 0.01) <= 1.e-8) max_dens = 1.043345e9; - else if (fabs(data.Time() - 0.02) <= 1.e-8) + else if (std::abs(data.Time() - 0.02) <= 1.e-8) max_dens = 1.192524e9; - else if (fabs(data.Time() - 0.03) <= 1.e-8) + else if (std::abs(data.Time() - 0.03) <= 1.e-8) max_dens = 1.527201e9; - else if (fabs(data.Time() - 0.04) <= 1.e-8) + else if (std::abs(data.Time() - 0.04) <= 1.e-8) max_dens = 2.312884e9; - else if (fabs(data.Time() - 0.05) <= 1.e-8) + else if (std::abs(data.Time() - 0.05) <= 1.e-8) max_dens = 4.779133e9; - else if (fabs(data.Time() - 0.06) <= 1.e-8) + else if (std::abs(data.Time() - 0.06) <= 1.e-8) max_dens = 24.472425e9; - else if (fabs(data.Time() - 0.065) <= 1.e-8) + else if (std::abs(data.Time() - 0.065) <= 1.e-8) max_dens = 423.447291e9; else { Print() << "Dont know the maximum density at this time: " << data.Time() < r, slicefile << std::setw(w) << r[i]; for (auto it=vars.begin(); it!=vars.end(); ++it) { - if(fabs((*it)[i]) < SMALL) (*it)[i] = 0.0; + if(std::abs((*it)[i]) < SMALL) (*it)[i] = 0.0; slicefile << std::setw(w) << (*it)[i]; } diff --git a/Diagnostics/Radiation/gaussian_pulse.cpp b/Diagnostics/Radiation/gaussian_pulse.cpp index b04020a567..570b0f637b 100644 --- a/Diagnostics/Radiation/gaussian_pulse.cpp +++ b/Diagnostics/Radiation/gaussian_pulse.cpp @@ -64,9 +64,9 @@ int main(int argc, char* argv[]) // compute the size of the radially-binned array -- we'll do it to // the furtherest corner of the domain - double x_maxdist = max(fabs(probhi[0] - xctr), fabs(problo[0] - xctr)); - double y_maxdist = max(fabs(probhi[1] - yctr), fabs(problo[1] - yctr)); - double maxdist = sqrt(x_maxdist*x_maxdist + y_maxdist*y_maxdist); + double x_maxdist = std::max(std::abs(probhi[0] - xctr), std::abs(problo[0] - xctr)); + double y_maxdist = std::max(std::abs(probhi[1] - yctr), std::abs(problo[1] - yctr)); + double maxdist = std::sqrt(x_maxdist*x_maxdist + y_maxdist*y_maxdist); double dx_fine = *(std::min_element(dx.begin(), dx.end())); @@ -102,7 +102,7 @@ int main(int argc, char* argv[]) // over levels, we will compare to the finest level index space to // determine if we've already output here int mask_size = domain.length().max(); - Vector imask(pow(mask_size, AMREX_SPACEDIM), 1); + Vector imask(std::pow(mask_size, AMREX_SPACEDIM), 1); // loop over the data, starting at the finest grid, and if we haven't // already stored data in that grid location (according to imask), diff --git a/Diagnostics/Radiation/lgt_frnt1d.cpp b/Diagnostics/Radiation/lgt_frnt1d.cpp index 55f61a5ffe..9b1743b3b4 100644 --- a/Diagnostics/Radiation/lgt_frnt1d.cpp +++ b/Diagnostics/Radiation/lgt_frnt1d.cpp @@ -53,7 +53,7 @@ int main(int argc, char* argv[]) // compute the size of the radially-binned array -- we'll do it to // the furtherest corner of the domain - double maxdist = fabs(probhi[0] - problo[0]); + double maxdist = std::abs(probhi[0] - problo[0]); double dx_fine = *(std::min_element(dx.begin(), dx.end())); int nbins = int(maxdist / dx_fine); @@ -93,7 +93,7 @@ int main(int argc, char* argv[]) // over levels, we will compare to the finest level index space to // determine if we've already output here int mask_size = domain.length().max(); - Vector imask(pow(mask_size, AMREX_SPACEDIM), 1); + Vector imask(std::pow(mask_size, AMREX_SPACEDIM), 1); // loop over the data, starting at the finest grid, and if we haven't // already stored data in that grid location (according to imask), diff --git a/Diagnostics/Radiation/rad_shock.cpp b/Diagnostics/Radiation/rad_shock.cpp index 43176c4e27..3fbfcab5d8 100644 --- a/Diagnostics/Radiation/rad_shock.cpp +++ b/Diagnostics/Radiation/rad_shock.cpp @@ -106,7 +106,7 @@ int main(int argc, char* argv[]) // over levels, we will compare to the finest level index space to // determine if we've already output here int mask_size = domain.length().max(); - Vector imask(pow(mask_size, AMREX_SPACEDIM), 1); + Vector imask(std::pow(mask_size, AMREX_SPACEDIM), 1); // counter auto cnt = 0; @@ -214,7 +214,7 @@ int main(int argc, char* argv[]) slicefile << std::setw(w) << vars_bin[isv[i]+((*it)+1)*nbins]; auto it = comps.end()-1; - slicefile << std::setw(w) << pow(vars_bin[isv[i]+((*it)+1)*nbins] / arad, 0.25); + slicefile << std::setw(w) << std::pow(vars_bin[isv[i]+((*it)+1)*nbins] / arad, 0.25); slicefile << std::endl; } diff --git a/Diagnostics/Radiation/rad_sphere.cpp b/Diagnostics/Radiation/rad_sphere.cpp index 8eda551489..55bc63695d 100644 --- a/Diagnostics/Radiation/rad_sphere.cpp +++ b/Diagnostics/Radiation/rad_sphere.cpp @@ -142,7 +142,7 @@ int main(int argc, char* argv[]) // over levels, we will compare to the finest level index space to // determine if we've already output here int mask_size = domain.length()[0]; - Vector imask(pow(mask_size, AMREX_SPACEDIM), 1); + Vector imask(std::pow(mask_size, AMREX_SPACEDIM), 1); // counter int cnt = 0; diff --git a/Diagnostics/Sedov/main.cpp b/Diagnostics/Sedov/main.cpp index f6153d6bc0..4a32f24b6b 100644 --- a/Diagnostics/Sedov/main.cpp +++ b/Diagnostics/Sedov/main.cpp @@ -148,7 +148,7 @@ int main(int argc, char* argv[]) #else double x_maxdist = amrex::max(std::abs(probhi[0] - xctr), - std::fabs(problo[0] - xctr)); + std::abs(problo[0] - xctr)); double y_maxdist = amrex::max(std::abs(probhi[1] - yctr), std::abs(problo[1] - yctr)); double z_maxdist = amrex::max(std::abs(probhi[2] - zctr), @@ -342,10 +342,10 @@ int main(int argc, char* argv[]) // write the data in columns const auto SMALL = 1.e-20; for (auto i = 0; i < nbins; i++) { - if (fabs(dens_bin[i]) < SMALL) dens_bin[i] = 0.0; - if (fabs( vel_bin[i]) < SMALL) vel_bin[i] = 0.0; - if (fabs(pres_bin[i]) < SMALL) pres_bin[i] = 0.0; - if (fabs( e_bin[i]) < SMALL) e_bin[i] = 0.0; + if (std::abs(dens_bin[i]) < SMALL) dens_bin[i] = 0.0; + if (std::abs( vel_bin[i]) < SMALL) vel_bin[i] = 0.0; + if (std::abs(pres_bin[i]) < SMALL) pres_bin[i] = 0.0; + if (std::abs( e_bin[i]) < SMALL) e_bin[i] = 0.0; slicefile << std::setw(w) << r[i] << std::setw(w) << dens_bin[i] << std::setw(w) << vel_bin[i] << std::setw(w) << pres_bin[i] << std::setw(w) << e_bin[i] << std::endl; } diff --git a/Exec/gravity_tests/DustCollapse/problem_bc_fill.H b/Exec/gravity_tests/DustCollapse/problem_bc_fill.H index 2a8df96b84..5c9225eb40 100644 --- a/Exec/gravity_tests/DustCollapse/problem_bc_fill.H +++ b/Exec/gravity_tests/DustCollapse/problem_bc_fill.H @@ -5,8 +5,8 @@ AMREX_GPU_HOST_DEVICE AMREX_INLINE void problem_bc_fill(int i, int j, int k, Array4 const& state, Real time, - Array1D bcs, - GeometryData geomdata) + const Array1D& bcs, + const GeometryData& geomdata) { #if AMREX_SPACEDIM == 3 const Real* dx = geomdata.CellSize(); diff --git a/Exec/gravity_tests/hydrostatic_adjust/problem_bc_fill.H b/Exec/gravity_tests/hydrostatic_adjust/problem_bc_fill.H index 96ab44b365..428c8d16ba 100644 --- a/Exec/gravity_tests/hydrostatic_adjust/problem_bc_fill.H +++ b/Exec/gravity_tests/hydrostatic_adjust/problem_bc_fill.H @@ -5,8 +5,8 @@ AMREX_GPU_HOST_DEVICE AMREX_INLINE void problem_bc_fill(int i, int j, int k, Array4 const& state, Real time, - Array1D bcs, - GeometryData geomdata) + const Array1D& bcs, + const GeometryData& geomdata) { // Set the velocity to zero at the top physical boundary. diff --git a/Exec/hydro_tests/Noh/problem_bc_fill.H b/Exec/hydro_tests/Noh/problem_bc_fill.H index 3c79eb0741..3a6470744f 100644 --- a/Exec/hydro_tests/Noh/problem_bc_fill.H +++ b/Exec/hydro_tests/Noh/problem_bc_fill.H @@ -8,8 +8,8 @@ AMREX_GPU_HOST_DEVICE AMREX_INLINE void problem_bc_fill(int i, int j, int k, Array4 const& state, Real time, - Array1D bcs, - GeometryData geomdata) + const Array1D& bcs, + const GeometryData& geomdata) { const Real pres_init = 1.0e-6_rt; const Real rho_init = 1.0e0_rt; diff --git a/Exec/hydro_tests/double_mach_reflection/problem_bc_fill.H b/Exec/hydro_tests/double_mach_reflection/problem_bc_fill.H index c1edfe36c7..ba28f4a2f8 100644 --- a/Exec/hydro_tests/double_mach_reflection/problem_bc_fill.H +++ b/Exec/hydro_tests/double_mach_reflection/problem_bc_fill.H @@ -5,8 +5,8 @@ AMREX_GPU_HOST_DEVICE AMREX_INLINE void problem_bc_fill(int i, int j, int k, Array4 const& state, Real time, - Array1D bcs, - GeometryData geomdata) + const Array1D& bcs, + const GeometryData& geomdata) { const int* domlo = geomdata.Domain().loVect(); const int* domhi = geomdata.Domain().hiVect(); diff --git a/Exec/radiation_tests/Rad2Tshock/problem_bc_fill.H b/Exec/radiation_tests/Rad2Tshock/problem_bc_fill.H index bb2f45ce6d..4a7a301b69 100644 --- a/Exec/radiation_tests/Rad2Tshock/problem_bc_fill.H +++ b/Exec/radiation_tests/Rad2Tshock/problem_bc_fill.H @@ -5,8 +5,8 @@ AMREX_GPU_HOST_DEVICE AMREX_INLINE void problem_bc_fill(int i, int j, int k, Array4 const& state, Real time, - Array1D bcs, - GeometryData geomdata) + const Array1D& bcs, + const GeometryData& geomdata) { // The strategy here is to set Dirichlet condition for inflow and // outflow boundaries, and let the Riemann solver sort out the diff --git a/Exec/science/Detonation/problem_bc_fill.H b/Exec/science/Detonation/problem_bc_fill.H index 1692b7df09..9070d5fe4d 100644 --- a/Exec/science/Detonation/problem_bc_fill.H +++ b/Exec/science/Detonation/problem_bc_fill.H @@ -45,8 +45,8 @@ AMREX_GPU_HOST_DEVICE AMREX_INLINE void problem_bc_fill(int i, int j, int k, Array4 const& state, Real time, - Array1D bcs, - GeometryData geomdata) + const Array1D& bcs, + const GeometryData& geomdata) { // Override the generic routine at the physical boundaries by // setting the material to the ambient state. Note that we diff --git a/Exec/science/nova/problem_initialize_state_data.H b/Exec/science/nova/problem_initialize_state_data.H index 37a7bb3894..4dea3d43eb 100644 --- a/Exec/science/nova/problem_initialize_state_data.H +++ b/Exec/science/nova/problem_initialize_state_data.H @@ -121,10 +121,10 @@ void problem_initialize_state_data (int i, int j, int k, if (problem::num_vortices % 2 == 0){ temp_pert = delta * (1.0_rt + std::sin(static_cast(problem::num_vortices)*M_PI*x/problem::L) )* - delta*exp(-pow(ydist / problem::width, 2)); + delta*std::exp(-pow(ydist / problem::width, 2)); } else { temp_pert = delta * (1.0_rt + std::cos(static_cast(problem::num_vortices)*M_PI*x/problem::L) )* - delta*exp(-pow(ydist / problem::width, 2)); + delta*std::exp(-pow(ydist / problem::width, 2)); } state(i,j,k,UTEMP) = state(i,j,k, UTEMP)*(1.0_rt + temp_pert); diff --git a/Exec/science/planet/HotJupiter.cpp b/Exec/science/planet/HotJupiter.cpp index 108db17923..059b255df5 100644 --- a/Exec/science/planet/HotJupiter.cpp +++ b/Exec/science/planet/HotJupiter.cpp @@ -19,10 +19,10 @@ long double Temp(long double P1,long double Pc,long double P_char,long double T_ long double Temp; if(Pc>P1){ - Temp = Td * pow(1.0e0 + (Lad / (Lin - Lad))*pow((P1/Pc),exp1),exp2); + Temp = Td * std::pow(1.0e0 + (Lad / (Lin - Lad)) * std::pow((P1/Pc),exp1),exp2); } else{ - Temp = T_char * pow(P1/P_char,Lad); + Temp = T_char * std::pow(P1/P_char,Lad); } return Temp; } @@ -95,9 +95,9 @@ int main(){ //Defining the properties of the planet atmosphere // the density limit at the top of the atmosphere P_top=den_top*R*Td ; // the pressure limit at the density limit - Tc = Td * pow(Lin/(Lin-Lad),exp2); //the temperature at the radiative-convective boundary (RCB) - Pc = P_char * pow(Tc/T_char,1.0/Lad); //the pressure at the RCB - Pd = pow((Lin-Lad)/(2.0*Lin-Lad),1.0/exp1)*Pc; //the characteristic pressure defining the radiative zone + Tc = Td * std::pow(Lin/(Lin-Lad),exp2); //the temperature at the radiative-convective boundary (RCB) + Pc = P_char * std::pow(Tc/T_char,1.0/Lad); //the pressure at the RCB + Pd = std::pow((Lin-Lad)/(2.0*Lin-Lad),1.0/exp1)*Pc; //the characteristic pressure defining the radiative zone @@ -112,7 +112,7 @@ int main(){ } buffer_height=z_top*2.25/4.0; // the height at which the buffer and the top of the atmosphere meet (not continuous at RCB).-> needs sponge - optical_depth_buffer=6.35e-3*T_buffer*pow(den_buffer,2.0)*(z_top-buffer_height);// the optical depth in the buffer region [dimensionless] + optical_depth_buffer=6.35e-3*T_buffer*std::pow(den_buffer,2.0)*(z_top-buffer_height);// the optical depth in the buffer region [dimensionless] @@ -157,14 +157,14 @@ int main(){ den2 = density(P2, T2, R); T3 = T1; den3 = den1; - dz2 = abs ((-P1+P2)* (1.0/grav)/((1.0/2.0)*(den1+den2))); - dz3 = abs ((-P1+P3)* (1.0/grav)/((1.0/2.0)*(den1+den3))); + dz2 = std::abs ((-P1+P2)* (1.0/grav)/((1.0/2.0)*(den1+den2))); + dz3 = std::abs ((-P1+P3)* (1.0/grav)/((1.0/2.0)*(den1+den3))); a: if(difference(dz2, delta_z)*difference(dz3, delta_z)<0.0){ P_sol = (P2+P3)/2.0; T_sol = Temp(P_sol, Pc, P_char, T_char, Td, Lin, Lad, exp1, exp2); den_sol = density(P_sol,T_sol, R); - dz_sol = abs ((-P1+P_sol)* (1.0/grav)/((1.0/2.0)*(den1+den_sol))); + dz_sol = std::abs ((-P1+P_sol)* (1.0/grav)/((1.0/2.0)*(den1+den_sol))); count2++; } else{ @@ -172,13 +172,13 @@ int main(){ P3 = P3 - P3/dP_factor/1.0; T3 = Temp(P3, Pc, P_char, T_char, Td, Lin, Lad, exp1, exp2); den3 = density(P3, T3, R); - dz3 = abs ((-P1+P3)* (1.0/grav)/((1.0/2.0)*(den1+den3))); + dz3 = std::abs ((-P1+P3)* (1.0/grav)/((1.0/2.0)*(den1+den3))); } else if(difference(dz2, delta_z)<0.0){ P2 = P2 + P2/dP_factor/1.0; T2 = Temp(P2, Pc, P_char, T_char, Td, Lin, Lad, exp1, exp2); den2 = density(P2,T2,R); - dz2 = abs ((-P1+P2)* (1.0/grav)/((1.0/2.0)*(den1+den2))); + dz2 = std::abs ((-P1+P2)* (1.0/grav)/((1.0/2.0)*(den1+den2))); } goto a; } @@ -192,11 +192,11 @@ int main(){ if(count2>100000){ goto b; } - if(abs(difference(dz_sol, delta_z)) >= error_expected){ + if(std::abs(difference(dz_sol, delta_z)) >= error_expected){ goto a; } - b: cout< SMALL*dx[0]) || (fabs(dx[0] - dx[2]) > SMALL*dx[0]) ) + if ( (std::abs(dx[0] - dx[1]) > SMALL*dx[0]) || (std::abs(dx[0] - dx[2]) > SMALL*dx[0]) ) { amrex::Abort("We don't support dx != dy != dz"); } @@ -4215,12 +4215,12 @@ Castro::get_numpts () #elif (AMREX_SPACEDIM == 2) long ny = bx.size()[1]; Real ndiagsq = Real(nx*nx + ny*ny); - numpts_1d = int(sqrt(ndiagsq))+2*NUM_GROW; + numpts_1d = int(std::sqrt(ndiagsq))+2*NUM_GROW; #elif (AMREX_SPACEDIM == 3) long ny = bx.size()[1]; long nz = bx.size()[2]; Real ndiagsq = Real(nx*nx + ny*ny + nz*nz); - numpts_1d = int(sqrt(ndiagsq))+2*NUM_GROW; + numpts_1d = int(std::sqrt(ndiagsq))+2*NUM_GROW; #endif if (verbose && ParallelDescriptor::IOProcessor()) { diff --git a/Source/driver/_cpp_parameters b/Source/driver/_cpp_parameters index 8325fc86b6..f6f85ed59c 100644 --- a/Source/driver/_cpp_parameters +++ b/Source/driver/_cpp_parameters @@ -616,12 +616,12 @@ max_tagging_radius real 10.0e0 (v, verbose) int 0 # do we dump the old state into the checkpoint files too? -dump_old bool false +dump_old int 0 # do we assume the domain is plane parallel when computing some of the derived # quantities (e.g. radial velocity). Note: this will always assume that the # last spatial dimension is vertical -domain_is_plane_parallel bool false +domain_is_plane_parallel int 0 # display information about updates to the state (how much mass, momentum, energy added) print_update_diagnostics int (0, 1) diff --git a/Source/driver/sum_integrated_quantities.cpp b/Source/driver/sum_integrated_quantities.cpp index 6dc1be4004..2398480765 100644 --- a/Source/driver/sum_integrated_quantities.cpp +++ b/Source/driver/sum_integrated_quantities.cpp @@ -131,7 +131,7 @@ Castro::sum_integrated_quantities () auto R = R_new[mfi].array(); #endif - auto level_mask = mask_available ? mask_mf[mfi].array() : Array4{}; + const auto & level_mask = mask_available ? mask_mf[mfi].array() : Array4{}; reduce_op.eval(bx, reduce_data, [=] AMREX_GPU_DEVICE (int i, int j, int k) -> ReduceTuple diff --git a/Source/driver/sum_utils.cpp b/Source/driver/sum_utils.cpp index f0fa10e35e..438c744f0f 100644 --- a/Source/driver/sum_utils.cpp +++ b/Source/driver/sum_utils.cpp @@ -517,7 +517,7 @@ Castro::gwstrain (Real time, // Standard Kronecker delta. - Real delta[3][3] = {0.0}; + Real delta[3][3] = {{0.0}}; for (int i = 0; i < 3; ++i) { delta[i][i] = 1.0; @@ -539,7 +539,7 @@ Castro::gwstrain (Real time, // Projection operator onto the unit vector n. - Real proj[3][3][3][3] = {0.0}; + Real proj[3][3][3][3] = {{0.0}}; for (int l = 0; l < 3; ++l) { for (int k = 0; k < 3; ++k) { @@ -554,7 +554,7 @@ Castro::gwstrain (Real time, // Now we can calculate the strain tensor. - Real h[3][3] = {0.0}; + Real h[3][3] = {{0.0}}; for (int l = 0; l < 3; ++l) { for (int k = 0; k < 3; ++k) { diff --git a/Source/gravity/Castro_gravity.cpp b/Source/gravity/Castro_gravity.cpp index 46eccda99f..7b300310ec 100644 --- a/Source/gravity/Castro_gravity.cpp +++ b/Source/gravity/Castro_gravity.cpp @@ -386,7 +386,7 @@ void Castro::construct_old_gravity_source(MultiFab& source, MultiFab& state_in, } #endif - Real SrE; + Real SrE{}; if (castro::grav_source_type == 1 || castro::grav_source_type == 2) { @@ -584,7 +584,7 @@ void Castro::construct_new_gravity_source(MultiFab& source, MultiFab& state_old, // Correct energy - Real SrEcorr; + Real SrEcorr{}; if (castro::grav_source_type == 1) { diff --git a/Source/gravity/Gravity.H b/Source/gravity/Gravity.H index c2c4ca8ebf..af7ff177fa 100644 --- a/Source/gravity/Gravity.H +++ b/Source/gravity/Gravity.H @@ -449,7 +449,6 @@ public: amrex::Vector area; int Density; - int finest_level; int finest_level_allocated; amrex::BCRec* phys_bc; diff --git a/Source/gravity/Gravity.cpp b/Source/gravity/Gravity.cpp index 6665b0ef38..d67087d469 100644 --- a/Source/gravity/Gravity.cpp +++ b/Source/gravity/Gravity.cpp @@ -97,6 +97,7 @@ Gravity::Gravity(Amr* Parent, int _finest_level, BCRec* _phys_bc, int _density) init_multipole_grav(); } max_rhs = 0.0; + numpts_at_level = -1; } Gravity::~Gravity() = default; @@ -1569,7 +1570,7 @@ Gravity::compute_radial_mass(const Box& bx, r = std::sqrt(xxsq + yysq + zzsq); index = static_cast(r * drinv); - Real vol_frac; + Real vol_frac{}; if (coord_type == 0) { diff --git a/Source/hydro/Castro_hydro.H b/Source/hydro/Castro_hydro.H index bbf0db8fa3..2dd90a4eb0 100644 --- a/Source/hydro/Castro_hydro.H +++ b/Source/hydro/Castro_hydro.H @@ -819,7 +819,7 @@ void do_enforce_minimum_density(const amrex::Box& bx, amrex::Array4 const& state_arr, - const int verbose); + const int verbose_warnings); #ifdef HYBRID_MOMENTUM diff --git a/Source/hydro/advection_util.cpp b/Source/hydro/advection_util.cpp index b40f8ee8af..0723c29983 100644 --- a/Source/hydro/advection_util.cpp +++ b/Source/hydro/advection_util.cpp @@ -588,13 +588,13 @@ Castro::limit_hydro_fluxes_on_small_dens(const Box& bx, void // NOLINTNEXTLINE(readability-convert-member-functions-to-static) Castro::do_enforce_minimum_density(const Box& bx, Array4 const& state_arr, - const int verbose) { + const int verbose_warnings) { #ifdef HYBRID_MOMENTUM GeometryData geomdata = geom.data(); #endif - amrex::ignore_unused(verbose); + amrex::ignore_unused(verbose_warnings); amrex::ParallelFor(bx, [=] AMREX_GPU_DEVICE (int i, int j, int k) noexcept @@ -603,8 +603,8 @@ Castro::do_enforce_minimum_density(const Box& bx, if (state_arr(i,j,k,URHO) < small_dens) { #ifndef AMREX_USE_GPU - if (verbose > 1 || - (verbose > 0 && state_arr(i,j,k,URHO) > castro::retry_small_density_cutoff)) { + if (verbose_warnings > 1 || + (verbose_warnings > 0 && state_arr(i,j,k,URHO) > castro::retry_small_density_cutoff)) { std::cout << " " << std::endl; if (state_arr(i,j,k,URHO) < 0.0_rt) { std::cout << ">>> RESETTING NEG. DENSITY AT " << i << ", " << j << ", " << k << std::endl; diff --git a/Source/problems/problem_bc_fill.H b/Source/problems/problem_bc_fill.H index 29c6815b46..1eeb1589a4 100644 --- a/Source/problems/problem_bc_fill.H +++ b/Source/problems/problem_bc_fill.H @@ -15,8 +15,8 @@ AMREX_GPU_HOST_DEVICE AMREX_INLINE void problem_bc_fill(int i, int j, int k, Array4 const& state, - Real time, Array1D bcs, - GeometryData geomdata) { + Real time, const Array1D& bcs, + const GeometryData& geomdata) { amrex::ignore_unused(i); amrex::ignore_unused(j); diff --git a/Source/radiation/HypreABec.cpp b/Source/radiation/HypreABec.cpp index 638d4715bb..6461c2ff2f 100644 --- a/Source/radiation/HypreABec.cpp +++ b/Source/radiation/HypreABec.cpp @@ -1779,7 +1779,7 @@ void HypreABec::solve(MultiFab& dest, int icomp, MultiFab& rhs, BC_Mode inhom) Real bnorm; bnorm = hypre_StructInnerProd((hypre_StructVector *) b, (hypre_StructVector *) b); - bnorm = sqrt(bnorm); + bnorm = std::sqrt(bnorm); const BoxArray& grids = acoefs->boxArray(); Real volume = 0.0; @@ -1788,7 +1788,7 @@ void HypreABec::solve(MultiFab& dest, int icomp, MultiFab& rhs, BC_Mode inhom) } Real reltol_new = (bnorm > 0.0 - ? abstol / bnorm * sqrt(volume) + ? abstol / bnorm * std::sqrt(volume) : reltol); if (reltol_new > reltol) { @@ -1898,7 +1898,7 @@ Real HypreABec::getAbsoluteResidual() Real bnorm; bnorm = hypre_StructInnerProd((hypre_StructVector *) b, (hypre_StructVector *) b); - bnorm = sqrt(bnorm); + bnorm = std::sqrt(bnorm); Real res; if (solver_flag == 0) { @@ -1925,5 +1925,5 @@ Real HypreABec::getAbsoluteResidual() volume += grids[i].numPts(); } - return bnorm * res / sqrt(volume); + return bnorm * res / std::sqrt(volume); } diff --git a/Source/radiation/HypreMultiABec.cpp b/Source/radiation/HypreMultiABec.cpp index 311c78c0a4..5f5e749255 100644 --- a/Source/radiation/HypreMultiABec.cpp +++ b/Source/radiation/HypreMultiABec.cpp @@ -3476,7 +3476,7 @@ void HypreMultiABec::solve() hypre_SStructInnerProd((hypre_SStructVector *) b, (hypre_SStructVector *) b, &bnorm); - bnorm = sqrt(bnorm); + bnorm = std::sqrt(bnorm); Real volume = 0.0; for (int level = crse_level; level <= fine_level; level++) { @@ -3486,7 +3486,7 @@ void HypreMultiABec::solve() } Real reltol_new = (bnorm > 0.0 - ? abstol / bnorm * sqrt(volume) + ? abstol / bnorm * std::sqrt(volume) : reltol); if (reltol_new > reltol) { @@ -3830,7 +3830,7 @@ Real HypreMultiABec::getAbsoluteResidual() hypre_SStructInnerProd((hypre_SStructVector *) b, (hypre_SStructVector *) b, &bnorm); - bnorm = sqrt(bnorm); + bnorm = std::sqrt(bnorm); Real res; if (solver_flag == 100) { @@ -3891,7 +3891,7 @@ Real HypreMultiABec::getAbsoluteResidual() } } - return bnorm * res / sqrt(volume); + return bnorm * res / std::sqrt(volume); } void HypreMultiABec::boundaryFlux(int level, diff --git a/Source/radiation/RadMultiGroup.cpp b/Source/radiation/RadMultiGroup.cpp index 83a1811ffc..4a8e682d78 100644 --- a/Source/radiation/RadMultiGroup.cpp +++ b/Source/radiation/RadMultiGroup.cpp @@ -43,37 +43,37 @@ void Radiation::get_groups(int verbose) if (lowest == 0.0) { nugroup[0] = 0.5*dnugroup[0]; - dlognugroup[0] = 2.0 * (log(xnu[1]) - log(nugroup[0])); + dlognugroup[0] = 2.0 * (std::log(xnu[1]) - std::log(nugroup[0])); } else { - nugroup[0] = sqrt(xnu[0]*xnu[1]); - dlognugroup[0] = log(xnu[1]) - log(xnu[0]); + nugroup[0] = std::sqrt(xnu[0]*xnu[1]); + dlognugroup[0] = std::log(xnu[1]) - std::log(xnu[0]); } for (int i=1; i tmplen) { + if (std::pow(mxlen,(float)AMREX_SPACEDIM-1) > tmplen) { delete [] derives; #if (AMREX_SPACEDIM == 1) derives = new Real[1]; diff --git a/Source/reactions/Castro_react.cpp b/Source/reactions/Castro_react.cpp index e050e2008f..9a53e398d3 100644 --- a/Source/reactions/Castro_react.cpp +++ b/Source/reactions/Castro_react.cpp @@ -201,7 +201,7 @@ Castro::react_state(MultiFab& s, MultiFab& r, Real time, Real dt, const int stra auto U = s.array(mfi); auto reactions = r.array(mfi); auto weights = store_burn_weights ? burn_weights.array(mfi) : Array4{}; - auto mask = mask_covered_zones ? mask_mf.array(mfi) : Array4{}; + const auto mask = mask_covered_zones ? mask_mf.array(mfi) : Array4{}; const auto dx = geom.CellSizeArray(); #ifdef MODEL_PARSER @@ -535,7 +535,7 @@ Castro::react_state(Real time, Real dt) auto I = SDC_react.array(mfi); auto react_src = reactions.array(mfi); auto weights = store_burn_weights ? burn_weights.array(mfi) : Array4{}; - auto mask = mask_covered_zones ? mask_mf.array(mfi) : Array4{}; + const auto mask = mask_covered_zones ? mask_mf.array(mfi) : Array4{}; int lsdc_iteration = sdc_iteration; diff --git a/Source/scf/scf_relax.cpp b/Source/scf/scf_relax.cpp index 1add2074e3..ec55704406 100644 --- a/Source/scf/scf_relax.cpp +++ b/Source/scf/scf_relax.cpp @@ -338,7 +338,7 @@ Castro::do_hscf_solve() amrex::Error(); } - Real omega = sqrt(omegasq); + Real omega = std::sqrt(omegasq); // Rotational period is 2 pi / omega. // Let's also be sure not to let the period