Skip to content

Commit

Permalink
fix clang-tidy warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
Piyush Sharda authored and Piyush Sharda committed Feb 4, 2024
1 parent c2ccaea commit 38963af
Showing 1 changed file with 5 additions and 9 deletions.
14 changes: 5 additions & 9 deletions src/PopIII/popiii.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -343,10 +343,6 @@ template <> void RadhydroSimulation<PopIII>::ErrorEst(int lev, amrex::TagBoxArra
auto const &prob_lo = geom[lev].ProbLoArray();
auto const &prob_hi = geom[lev].ProbHiArray();

amrex::Real const x0 = prob_lo[0] + 0.5 * (prob_hi[0] - prob_lo[0]);
amrex::Real const y0 = prob_lo[1] + 0.5 * (prob_hi[1] - prob_lo[1]);
amrex::Real const z0 = prob_lo[2] + 0.5 * (prob_hi[2] - prob_lo[2]);

for (amrex::MFIter mfi(state_new_cc_[lev]); mfi.isValid(); ++mfi) {
const amrex::Box &box = mfi.validbox();
const auto state = state_new_cc_[lev].const_array(mfi);
Expand All @@ -362,7 +358,7 @@ template <> void RadhydroSimulation<PopIII>::ErrorEst(int lev, amrex::TagBoxArra
Real const pressure = HydroSystem<PopIII>::ComputePressure(state, i, j, k);
amrex::GpuArray<Real, Physics_Traits<PopIII>::numMassScalars> massScalars = RadSystem<PopIII>::ComputeMassScalars(state, i, j, k);

amrex::Real cs = quokka::EOS<PopIII>::ComputeSoundSpeed(rho, pressure, massScalars);
amrex::Real const cs = quokka::EOS<PopIII>::ComputeSoundSpeed(rho, pressure, massScalars);

const amrex::Real l_Jeans = cs * std::sqrt(M_PI / (G * rho));
if (l_Jeans < (N_cells * dx) && rho > 2e-20) {
Expand All @@ -382,7 +378,7 @@ template <> void RadhydroSimulation<PopIII>::ComputeDerivedVar(int lev, std::str

amrex::ParallelFor(mf, [=] AMREX_GPU_DEVICE(int bx, int i, int j, int k) noexcept {
Real const rho = state[bx](i, j, k, HydroSystem<PopIII>::density_index);
amrex::Real Eint = state[bx](i, j, k, HydroSystem<PopIII>::internalEnergy_index);
amrex::Real const Eint = state[bx](i, j, k, HydroSystem<PopIII>::internalEnergy_index);

amrex::GpuArray<Real, Physics_Traits<PopIII>::numMassScalars> massScalars = RadSystem<PopIII>::ComputeMassScalars(state[bx], i, j, k);

Expand All @@ -397,7 +393,7 @@ template <> void RadhydroSimulation<PopIII>::ComputeDerivedVar(int lev, std::str
auto output = mf.arrays();

amrex::ParallelFor(mf, [=] AMREX_GPU_DEVICE(int bx, int i, int j, int k) noexcept {
amrex::Real Pgas = HydroSystem<PopIII>::ComputePressure(state[bx], i, j, k);
amrex::Real const Pgas = HydroSystem<PopIII>::ComputePressure(state[bx], i, j, k);
output[bx](i, j, k, ncomp) = Pgas;
});
}
Expand All @@ -423,10 +419,10 @@ template <> void RadhydroSimulation<PopIII>::ComputeDerivedVar(int lev, std::str

amrex::ParallelFor(mf, [=] AMREX_GPU_DEVICE(int bx, int i, int j, int k) noexcept {
Real const rho = state[bx](i, j, k, HydroSystem<PopIII>::density_index);
Real pressure = HydroSystem<PopIII>::ComputePressure(state[bx], i, j, k);
Real const pressure = HydroSystem<PopIII>::ComputePressure(state[bx], i, j, k);
amrex::GpuArray<Real, Physics_Traits<PopIII>::numMassScalars> massScalars = RadSystem<PopIII>::ComputeMassScalars(state[bx], i, j, k);

amrex::Real cs = quokka::EOS<PopIII>::ComputeSoundSpeed(rho, pressure, massScalars);
amrex::Real const cs = quokka::EOS<PopIII>::ComputeSoundSpeed(rho, pressure, massScalars);
output[bx](i, j, k, ncomp) = cs;
});
}
Expand Down

0 comments on commit 38963af

Please sign in to comment.