Skip to content

Commit

Permalink
Reintroduce readability-else-after-return check and fix. (Exawind#529)
Browse files Browse the repository at this point in the history
  • Loading branch information
jrood-nrel authored Dec 29, 2021
1 parent 3900831 commit 39db9af
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 10 deletions.
2 changes: 1 addition & 1 deletion .clang-tidy
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
---
Checks: 'clang-diagnostic-*,clang-analyzer-*,corecppguidelines-*,modernize-*,readability-*,-readability-magic-numbers,-readability-identifier-naming,-modernize-avoid-c-arrays,-modernize-use-trailing-return-type,-readability-named-parameter,-readability-implicit-bool-conversion,-readability-isolate-declaration,-readability-braces-around-statements,-readability-inconsistent-declaration-parameter-name,-modernize-use-emplace,-readability-qualified-auto,-readability-static-accessed-through-instance,-readability-container-size-empty,-readability-make-member-function-const,-readability-uppercase-literal-suffix,-readability-convert-member-functions-to-static,-readability-redundant-member-init,-modernize-use-bool-literals,-readability-const-return-type,-readability-avoid-const-params-in-decls,-modernize-pass-by-value,-modernize-loop-convert,-readability-else-after-return,-readability-simplify-boolean-expr,-clang-analyzer-optin.cplusplus.VirtualCall'
Checks: 'clang-diagnostic-*,clang-analyzer-*,corecppguidelines-*,modernize-*,readability-*,-readability-magic-numbers,-readability-identifier-naming,-modernize-avoid-c-arrays,-modernize-use-trailing-return-type,-readability-named-parameter,-readability-implicit-bool-conversion,-readability-isolate-declaration,-readability-braces-around-statements,-readability-inconsistent-declaration-parameter-name,-modernize-use-emplace,-readability-qualified-auto,-readability-static-accessed-through-instance,-readability-container-size-empty,-readability-make-member-function-const,-readability-uppercase-literal-suffix,-readability-convert-member-functions-to-static,-readability-redundant-member-init,-modernize-use-bool-literals,-readability-const-return-type,-readability-avoid-const-params-in-decls,-modernize-pass-by-value,-modernize-loop-convert,-readability-simplify-boolean-expr,-clang-analyzer-optin.cplusplus.VirtualCall'
WarningsAsErrors: ''
HeaderFilterRegex: '^((?!/amrex/Src/|/googletest/).)*$'
AnalyzeTemporaryDtors: false
Expand Down
3 changes: 1 addition & 2 deletions amr-wind/physics/VortexRing.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -27,9 +27,8 @@ AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE amrex::Real FatCore::operator()(
const amrex::Real ssq = std::pow(z, 2) + std::pow(r - R, 2);
if (ssq <= Rsq) {
return 0.54857674 * Gamma / Rsq * std::exp(-4 * ssq / (Rsq - ssq));
} else {
return 0.0;
}
return 0.0;
}

AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE amrex::Real CollidingRings::operator()(
Expand Down
12 changes: 5 additions & 7 deletions amr-wind/wind_energy/MOData.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -18,21 +18,19 @@ amrex::Real MOData::calc_psi_m(amrex::Real zeta) const
{
if (zeta > 0) {
return -gamma_m * zeta;
} else {
amrex::Real x = std::sqrt(std::sqrt(1 - beta_m * zeta));
return 2.0 * std::log(0.5 * (1.0 + x)) + log(0.5 * (1 + x * x)) -
2.0 * std::atan(x) + utils::half_pi();
}
amrex::Real x = std::sqrt(std::sqrt(1 - beta_m * zeta));
return 2.0 * std::log(0.5 * (1.0 + x)) + log(0.5 * (1 + x * x)) -
2.0 * std::atan(x) + utils::half_pi();
}

amrex::Real MOData::calc_psi_h(amrex::Real zeta) const
{
if (zeta > 0) {
return -gamma_h * zeta;
} else {
amrex::Real x = std::sqrt(1 - beta_h * zeta);
return 2.0 * std::log(0.5 * (1 + x));
}
amrex::Real x = std::sqrt(1 - beta_h * zeta);
return 2.0 * std::log(0.5 * (1 + x));
}

void MOData::update_fluxes(int max_iters)
Expand Down

0 comments on commit 39db9af

Please sign in to comment.