Skip to content

Commit

Permalink
fix some clang-tidy issues with flame_wave (#2840)
Browse files Browse the repository at this point in the history
and silence some new clang-tidy 18 warnings for now
  • Loading branch information
zingale authored May 6, 2024
1 parent 398ae25 commit e8805bf
Show file tree
Hide file tree
Showing 6 changed files with 16 additions and 15 deletions.
3 changes: 3 additions & 0 deletions .clang-tidy
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ Checks: >
-modernize-use-trailing-return-type,
performance-*,
-performance-avoid-endl,
-performance-enum-size,
portability-*,
readability-*,
-readability-avoid-const-params-in-decls,
Expand All @@ -38,6 +39,8 @@ Checks: >
-readability-isolate-declaration,
-readability-magic-numbers,
-readability-named-parameter,
-readability-redundant-inline-specifier,
-readability-redundant-member-init,
-readability-simplify-boolean-expr,
-readability-static-accessed-through-instance,
mpi-*,
Expand Down
4 changes: 2 additions & 2 deletions Source/diffusion/Castro_diffusion.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -88,8 +88,8 @@ Castro::add_temp_diffusion_to_source (MultiFab& ext_src, MultiFab& state_in, Mul
}

if (diffuse_temp == 1) {
MultiFab::Saxpy(ext_src,mult_factor,DiffTerm,0,UEDEN,1,0);
MultiFab::Saxpy(ext_src,mult_factor,DiffTerm,0,UEINT,1,0);
MultiFab::Saxpy(ext_src,mult_factor,DiffTerm,0,UEDEN,1,0); // NOLINT(readability-suspicious-call-argument)
MultiFab::Saxpy(ext_src,mult_factor,DiffTerm,0,UEINT,1,0); // NOLINT(readability-suspicious-call-argument)
}
}

Expand Down
2 changes: 1 addition & 1 deletion Source/diffusion/Diffusion.H
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ public:
///
/// @param jobInfoFile
///
void output_job_info_params(std::ostream& jobInfoFile);
static void output_job_info_params(std::ostream& jobInfoFile);


///
Expand Down
2 changes: 0 additions & 2 deletions Source/driver/Castro_io.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -842,8 +842,6 @@ void
Castro::writeBuildInfo ()
{
std::string PrettyLine = std::string(78, '=') + "\n";
std::string OtherLine = std::string(78, '-') + "\n";
std::string SkipSpace = std::string(8, ' ');

// build information
std::cout << PrettyLine;
Expand Down
18 changes: 9 additions & 9 deletions Source/rotation/rotation_sources.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -49,8 +49,8 @@ Castro::rsrc(const Box& bx,
bool coriolis = true;
rotational_acceleration(loc, v, coriolis, Sr);

for (int n = 0; n < 3; n++) {
Sr[n] = rho * Sr[n];
for (auto& e : Sr) {
e *= rho;
}

src[UMX] = Sr[0];
Expand Down Expand Up @@ -85,7 +85,7 @@ Castro::rsrc(const Box& bx,

Real SrE;

if (rot_source_type == 1 || rot_source_type == 2) {
if (rot_source_type == 1 || rot_source_type == 2) { // NOLINT(bugprone-branch-clone)

SrE = uold(i,j,k,UMX) * rhoInv * Sr[0] +
uold(i,j,k,UMY) * rhoInv * Sr[1] +
Expand Down Expand Up @@ -196,8 +196,8 @@ Castro::corrrsrc(const Box& bx,

} else {

for (int idir = 0; idir < 3; idir++) {
dt_omega[idir] = 0.0_rt;
for (auto& e : dt_omega) {
e = 0.0_rt;
}

}
Expand Down Expand Up @@ -269,8 +269,8 @@ Castro::corrrsrc(const Box& bx,
bool coriolis = true;
rotational_acceleration(loc, vold, coriolis, Sr_old);

for (int n = 0; n < 3; n++) {
Sr_old[n] = rhoo * Sr_old[n];
for (auto& e : Sr_old) {
e *= rhoo;
}

Real SrE_old = vold[0] * Sr_old[0] + vold[1] * Sr_old[1] + vold[2] * Sr_old[2];
Expand All @@ -286,8 +286,8 @@ Castro::corrrsrc(const Box& bx,

rotational_acceleration(loc, vnew, coriolis, Sr_new);

for (int n = 0; n < 3; n++) {
Sr_new[n] = rhon * Sr_new[n];
for (auto& e : Sr_new) {
e *= rhon;
}

Real SrE_new = vnew[0] * Sr_new[0] + vnew[1] * Sr_new[1] + vnew[2] * Sr_new[2];
Expand Down
2 changes: 1 addition & 1 deletion Source/scf/scf_relax.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -639,7 +639,7 @@ Castro::do_hscf_solve()
{
Real dM = 0.0, dK = 0.0, dU = 0.0, dE = 0.0;

auto problo = geomdata.ProbLo();
const auto* problo = geomdata.ProbLo();

GpuArray<Real, 3> r = {0.0};

Expand Down

0 comments on commit e8805bf

Please sign in to comment.