Skip to content

Commit

Permalink
Reintroduce readability-make-member-function-const check. (Exawind#537)
Browse files Browse the repository at this point in the history
  • Loading branch information
jrood-nrel authored Dec 30, 2021
1 parent a443188 commit 46cca70
Show file tree
Hide file tree
Showing 7 changed files with 21 additions and 21 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-make-member-function-const,-modernize-pass-by-value,-clang-analyzer-optin.cplusplus.VirtualCall,-clang-analyzer-core.NonNullParamChecker'
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,-modernize-pass-by-value,-clang-analyzer-optin.cplusplus.VirtualCall,-clang-analyzer-core.NonNullParamChecker'
WarningsAsErrors: ''
HeaderFilterRegex: '^((?!/amrex/Src/|/googletest/).)*$'
AnalyzeTemporaryDtors: false
Expand Down
12 changes: 6 additions & 6 deletions amr-wind/core/SimTime.H
Original file line number Diff line number Diff line change
Expand Up @@ -27,27 +27,27 @@ public:

/** Return true if simulation should continue
*/
bool continue_simulation();
bool continue_simulation() const;

/** Return true if mesh refinement should be performed at this timestep
*/
bool do_regrid();
bool do_regrid() const;

/** Return true if plot files should be written at this timestep
*/
bool write_plot_file();
bool write_plot_file() const;

/** Return true if checkpoint files should be written at this timestep
*/
bool write_checkpoint();
bool write_checkpoint() const;

/** Return true if plot files should be written at this timestep
*/
bool write_last_plot_file();
bool write_last_plot_file() const;

/** Return true if checkpoint files should be written at this timestep
*/
bool write_last_checkpoint();
bool write_last_checkpoint() const;

/** Set current CFL and update timestep based on CFL components
*
Expand Down
12 changes: 6 additions & 6 deletions amr-wind/core/SimTime.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -147,7 +147,7 @@ void SimTime::set_current_cfl(
<< "; dt_inp: " << m_fixed_dt << std::endl;
}

bool SimTime::continue_simulation()
bool SimTime::continue_simulation() const
{
constexpr double eps = 1.0e-12;
bool stop_simulation = false;
Expand All @@ -163,36 +163,36 @@ bool SimTime::continue_simulation()
return !(stop_simulation);
}

bool SimTime::do_regrid()
bool SimTime::do_regrid() const
{
return (
(m_regrid_interval > 0) &&
((m_time_index - m_regrid_start_index) > 0) &&
((m_time_index - m_regrid_start_index) % m_regrid_interval == 0));
}

bool SimTime::write_plot_file()
bool SimTime::write_plot_file() const
{
return (
(m_plt_interval > 0) &&
((m_time_index - m_plt_start_index) % m_plt_interval == 0));
}

bool SimTime::write_checkpoint()
bool SimTime::write_checkpoint() const
{
return (
(m_chkpt_interval > 0) &&
((m_time_index - m_chkpt_start_index) % m_chkpt_interval == 0));
}

bool SimTime::write_last_plot_file()
bool SimTime::write_last_plot_file() const
{
return (
(m_plt_interval > 0) &&
((m_time_index - m_plt_start_index) % m_plt_interval != 0));
}

bool SimTime::write_last_checkpoint()
bool SimTime::write_last_checkpoint() const
{
return (
(m_chkpt_interval > 0) &&
Expand Down
6 changes: 3 additions & 3 deletions amr-wind/incflo.H
Original file line number Diff line number Diff line change
Expand Up @@ -211,9 +211,9 @@ private:
//
///////////////////////////////////////////////////////////////////////////
void PrintMaxValues(const std::string& header);
void PrintMaxVel(int lev);
void PrintMaxGp(int lev);
void CheckForNans(int lev);
void PrintMaxVel(int lev) const;
void PrintMaxGp(int lev) const;
void CheckForNans(int lev) const;
};

#endif
6 changes: 3 additions & 3 deletions amr-wind/utilities/diagnostics.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ void incflo::PrintMaxValues(const std::string& header)
//
// Print the maximum values of the velocity components and velocity divergence
//
void incflo::PrintMaxVel(int lev)
void incflo::PrintMaxVel(int lev) const
{
BL_PROFILE("amr-wind::incflo::PrintMaxVel");
amrex::Print() << "max(abs(u/v/w)) = " << velocity()(lev).norm0(0) << " "
Expand All @@ -59,7 +59,7 @@ void incflo::PrintMaxVel(int lev)
//
// Print the maximum values of the pressure gradient components and pressure
//
void incflo::PrintMaxGp(int lev)
void incflo::PrintMaxGp(int lev) const
{
BL_PROFILE("amr-wind::incflo::PrintMaxGp");
amrex::Print() << "max(abs(gpx/gpy/gpz/p)) = " << grad_p()(lev).norm0(0)
Expand All @@ -68,7 +68,7 @@ void incflo::PrintMaxGp(int lev)
<< " " << std::endl;
}

void incflo::CheckForNans(int lev)
void incflo::CheckForNans(int lev) const
{
BL_PROFILE("amr-wind::incflo::CheckForNans");
bool ro_has_nans = density()(lev).contains_nan(false);
Expand Down
2 changes: 1 addition & 1 deletion amr-wind/wind_energy/ABLFieldInit.H
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ public:
* pushes the field to device.
*/
void perturb_temperature(
const int lev, const amrex::Geometry& geom, Field& temperature);
const int lev, const amrex::Geometry& geom, Field& temperature) const;

//! Flag indicating whether temperature field needs perturbations
bool add_temperature_perturbations() const { return m_perturb_theta; }
Expand Down
2 changes: 1 addition & 1 deletion amr-wind/wind_energy/ABLFieldInit.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@ void ABLFieldInit::operator()(
}

void ABLFieldInit::perturb_temperature(
const int lev, const amrex::Geometry& geom, Field& temperature)
const int lev, const amrex::Geometry& geom, Field& temperature) const
{
/** Perturbations for the temperature field is adapted from the following
* paper:
Expand Down

0 comments on commit 46cca70

Please sign in to comment.