Skip to content

Commit

Permalink
Suppress false positive cppcheck warnings (Exawind#638)
Browse files Browse the repository at this point in the history
  • Loading branch information
jrood-nrel authored Jun 21, 2022
1 parent a8c8795 commit 0100478
Show file tree
Hide file tree
Showing 8 changed files with 19 additions and 8 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -303,7 +303,7 @@ jobs:
source ${SPACK_MANAGER}/start.sh && \
ln -s ${GITHUB_WORKSPACE} amr-wind && \
source ${SPACK_MANAGER}/start.sh && \
quick-develop -s amr-wind+hdf5+hypre+masa+netcdf~shared@main && \
quick-develop -s amr-wind+ascent+hdf5+hypre+masa+netcdf~shared@main && \
spack install && \
spack cd -b amr-wind && \
spack build-env amr-wind ctest -j $(nproc) -L unit --output-on-failure \
Expand Down
1 change: 1 addition & 0 deletions amr-wind/equation_systems/icns/icns_diffusion.H
Original file line number Diff line number Diff line change
Expand Up @@ -430,6 +430,7 @@ public:
{
const FieldState fstate = FieldState::New;
auto& repo = m_pdefields.repo;
// cppcheck-suppress constVariable
auto& field = m_pdefields.field;
const auto& density = m_density.state(fstate);
const int nlevels = repo.num_active_levels();
Expand Down
1 change: 1 addition & 0 deletions amr-wind/turbulence/LES/OneEqKsgs.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ namespace amr_wind {
namespace turbulence {

template <typename Transport>
// cppcheck-suppress uninitMemberVar
OneEqKsgs<Transport>::OneEqKsgs(CFDSim& sim)
: TurbModelBase<Transport>(sim)
, m_vel(sim.repo().get_field("velocity"))
Expand Down
1 change: 1 addition & 0 deletions amr-wind/turbulence/LES/Smagorinsky.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ namespace amr_wind {
namespace turbulence {

template <typename Transport>
// cppcheck-suppress uninitMemberVar
Smagorinsky<Transport>::Smagorinsky(CFDSim& sim)
: TurbModelBase<Transport>(sim)
, m_vel(sim.repo().get_field("velocity"))
Expand Down
5 changes: 4 additions & 1 deletion amr-wind/wind_energy/ABLFieldInit.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,10 @@ void ABLFieldInit::operator()(
}

void ABLFieldInit::perturb_temperature(
const int lev, const amrex::Geometry& geom, Field& temperature) const
const int lev,
const amrex::Geometry& geom,
// cppcheck-suppress constParameter
Field& temperature) const
{
/** Perturbations for the temperature field is adapted from the following
* paper:
Expand Down
2 changes: 2 additions & 0 deletions amr-wind/wind_energy/ABLStats.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,9 @@ namespace amr_wind {
namespace {
struct TemperatureGradient
{
// cppcheck-suppress unusedStructMember
double grad_z;
// cppcheck-suppress unusedStructMember
double max_grad_loc;
};
} // namespace
Expand Down
14 changes: 8 additions & 6 deletions amr-wind/wind_energy/actuator/disk/disk_ops.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -257,15 +257,17 @@ std::ostringstream check_for_parse_conflicts(const utils::ActParser& pp)
{
std::ostringstream error_collector;

// clang-format off
collect_parse_conflicts(pp, "disk_normal", "yaw", error_collector);
collect_parse_conflicts(pp, "disk_normal", "tilt", error_collector);
collect_parse_conflicts(pp, "sample_normal", "sample_yaw", error_collector);
collect_parse_conflicts(pp, "sample_normal", "sample_tilt", error_collector);
collect_parse_conflicts(pp, "disk_center", "base_position", error_collector);
collect_parse_conflicts(
pp, "sample_normal", "sample_tilt", error_collector);
collect_parse_conflicts(
pp, "disk_center", "base_position", error_collector);
collect_parse_conflicts(pp, "disk_center", "hub_height", error_collector);
collect_parse_dependencies(pp, "base_position", "hub_height", error_collector);
// clang-format on
collect_parse_dependencies(
pp, "base_position", "hub_height", error_collector);

RealList ct;
pp.getarr("thrust_coeff", ct);
if (ct.size() > 1) {
Expand Down Expand Up @@ -379,4 +381,4 @@ void compute_disk_points(
} // namespace base
} // namespace ops
} // namespace actuator
} // namespace amr_wind
} // namespace amr_wind
1 change: 1 addition & 0 deletions unit_tests/utilities/test_wave_energy.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,7 @@ void init_vof(amr_wind::Field& fld)
class WaveEnergyImpl : public amr_wind::wave_energy::WaveEnergy
{
public:
// cppcheck-suppress passedByValue
WaveEnergyImpl(amr_wind::CFDSim& sim, std::string label)
: amr_wind::wave_energy::WaveEnergy(sim, label)
{}
Expand Down

0 comments on commit 0100478

Please sign in to comment.