Skip to content

Commit

Permalink
Bump clang format to 18 (#1189)
Browse files Browse the repository at this point in the history
  • Loading branch information
marchdf authored Aug 8, 2024
1 parent 84d0638 commit ecc81cb
Show file tree
Hide file tree
Showing 15 changed files with 34 additions and 43 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,12 +17,12 @@ jobs:
- name: Clone
uses: actions/checkout@v4
- name: Check formatting
uses: DoozyX/clang-format-lint-action@v0.17
uses: DoozyX/clang-format-lint-action@v0.18
with:
source: './amr-wind ./unit_tests ./tools/utilities'
exclude: '.'
extensions: 'H,h,cpp'
clangFormatVersion: 17
clangFormatVersion: 18
CPU:
needs: Formatting
runs-on: ${{matrix.os}}
Expand Down
2 changes: 1 addition & 1 deletion amr-wind/physics/BurggrafFlow.H
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ public:

void post_regrid_actions() override {}

void pre_advance_work() override{};
void pre_advance_work() override {};

void post_advance_work() override;

Expand Down
2 changes: 1 addition & 1 deletion amr-wind/turbulence/LES/AMD.H
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ public:
void parse_model_coeffs() override;

//! No post advance work for this model
void post_advance_work() override{};
void post_advance_work() override {};

private:
//! Poincare coefficient (default value set for 2nd order AMR-wind
Expand Down
2 changes: 1 addition & 1 deletion amr-wind/turbulence/LES/AMDNoTherm.H
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ public:
void parse_model_coeffs() override;

//! No post advance work for this model
void post_advance_work() override{};
void post_advance_work() override {};

private:
//! Poincare coefficient (default value set for 2nd order AMR-wind
Expand Down
2 changes: 1 addition & 1 deletion amr-wind/utilities/sampling/DTUSpinnerSampler.H
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ public:
*/
void update_sampling_locations() override;

void post_sample_actions() override{};
void post_sample_actions() override {};

long num_points() const override { return (m_beam_points * m_ntotal); }

Expand Down
9 changes: 4 additions & 5 deletions amr-wind/utilities/sampling/DTUSpinnerSampler.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -318,11 +318,10 @@ void DTUSpinnerSampler::update_sampling_locations()
int n_totalsize = AMREX_SPACEDIM * (m_ntotal);

if (m_hub_debug) {
amrex::Print() << "ts_diff: " << ts_diff << "\t"
<< "m_ns: " << m_ns << "\t"
<< "Spin Time: " << m_time_sampling << "\t"
<< "AMR Time: " << time << "\t"
<< "n_size: " << n_size << std::endl;
amrex::Print() << "ts_diff: " << ts_diff << "\tm_ns: " << m_ns
<< "\tSpin Time: " << m_time_sampling
<< "\tAMR Time: " << time << "\tn_size: " << n_size
<< std::endl;
}

// Resize these variables so they can store all the locations
Expand Down
3 changes: 1 addition & 2 deletions amr-wind/utilities/sampling/FieldNorms.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -132,8 +132,7 @@ void FieldNorms::prepare_ascii_file()

if (amrex::ParallelDescriptor::IOProcessor()) {
std::ofstream f(m_out_fname.c_str());
f << "time_step "
<< "time";
f << "time_step time";
for (const auto& m_var_name : m_var_names) {
f << ' ' << m_var_name;
}
Expand Down
2 changes: 1 addition & 1 deletion amr-wind/utilities/sampling/LidarSampler.H
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ public:
*/
void update_sampling_locations() override;

void post_sample_actions() override{};
void post_sample_actions() override {};

void
define_netcdf_metadata(const ncutils::NCGroup& /*unused*/) const override;
Expand Down
19 changes: 8 additions & 11 deletions amr-wind/utilities/sampling/RadarSampler.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -212,11 +212,10 @@ void RadarSampler::update_sampling_locations()

if (m_debug_print) {
amrex::Print() << "-------------------------" << std::endl
<< "ts_diff: " << ts_diff << "\t"
<< "m_ns: " << m_ns << "\t"
<< "m_ntotal: " << m_ntotal << "\t"
<< "Radar Time: " << m_radar_time << "\t"
<< "AMR Time: " << time << std::endl
<< "ts_diff: " << ts_diff << "\tm_ns: " << m_ns
<< "\tm_ntotal: " << m_ntotal
<< "\tRadar Time: " << m_radar_time
<< "\tAMR Time: " << time << std::endl
<< "-------------------------" << std::endl;
}

Expand Down Expand Up @@ -341,12 +340,10 @@ void RadarSampler::new_cone()

if (m_debug_print) {
amrex::Print() << "-------------------------" << std::endl
<< "Beam Length: " << m_beam_length << "\t"
<< "nquad: " << nquad << "\t"
<< "dx[2]: " << dx[2] << "\t"
<< "m_npts: " << m_npts << "\t"
<< "ntheta: " << m_ntheta << "\t"
<< "nphi: " << m_nphi << std::endl
<< "Beam Length: " << m_beam_length
<< "\tnquad: " << nquad << "\tdx[2]: " << dx[2]
<< "\tm_npts: " << m_npts << "\tntheta: " << m_ntheta
<< "\tnphi: " << m_nphi << std::endl
<< "-------------------------" << std::endl;
}

Expand Down
6 changes: 3 additions & 3 deletions amr-wind/wind_energy/ABLMesoscaleForcing.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -249,9 +249,9 @@ void ABLMesoscaleForcing::constant_forcing_transition(
hLevelBlendMax = m_nht - 1;
}

amrex::Print() << "Forcing transition to constant"
<< " from " << m_zht[hLevelBlend1] << " to "
<< m_zht[hLevelBlendMax] << std::endl;
amrex::Print() << "Forcing transition to constant from "
<< m_zht[hLevelBlend1] << " to " << m_zht[hLevelBlendMax]
<< std::endl;

// calculate initial slope
amrex::Real slope0 = (error[hLevelBlend1] - error[hLevelBlend0]) /
Expand Down
10 changes: 5 additions & 5 deletions amr-wind/wind_energy/MOData.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -79,11 +79,11 @@ void MOData::update_fluxes(int max_iters)
if (iter >= max_iters) {
amrex::Print()
<< "MOData::update_fluxes: Convergence criteria not met after "
<< max_iters << " iterations"
<< "\nObuhov length = " << obukhov_len << " zeta = " << zeta
<< "\npsi_m = " << psi_m << " psi_h = " << psi_h
<< "\nutau = " << utau << " Tsurf = " << surf_temp
<< " q = " << surf_temp_flux << std::endl;
<< max_iters << " iterations\nObuhov length = " << obukhov_len
<< " zeta = " << zeta << "\npsi_m = " << psi_m
<< " psi_h = " << psi_h << "\nutau = " << utau
<< " Tsurf = " << surf_temp << " q = " << surf_temp_flux
<< std::endl;
}
}

Expand Down
6 changes: 2 additions & 4 deletions tools/utilities/CheckpointToCSV/CheckpointToCSV.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -118,9 +118,7 @@ void main_main()
output_stream.open(output_file);

// Create Headers
output_stream << "x,"
<< "y,"
<< "z";
output_stream << "x,y,z";
int num_vars = 0;
for (auto const& name : var_names) {
output_stream << "," << name;
Expand Down Expand Up @@ -183,4 +181,4 @@ int main(int argc, char* argv[])
https://amrex-codes.github.io/amrex/doxygen/classamrex_1_1BoxArray.html
3. Documentation on Box object:
- https://amrex-codes.github.io/amrex/doxygen/classamrex_1_1Box.html
*/
*/
6 changes: 2 additions & 4 deletions tools/utilities/PlotfileToCSV/PlotfileToCSV.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -111,9 +111,7 @@ void main_main()
output_stream.open(output_file);

// Create Headers
output_stream << "x,"
<< "y,"
<< "z";
output_stream << "x,y,z";
int num_vars = 0;
for (auto const& name : var_names) {
output_stream << "," << name;
Expand Down Expand Up @@ -176,4 +174,4 @@ int main(int argc, char* argv[])
https://amrex-codes.github.io/amrex/doxygen/classamrex_1_1BoxArray.html
3. Documentation on Box object:
- https://amrex-codes.github.io/amrex/doxygen/classamrex_1_1Box.html
*/
*/
Original file line number Diff line number Diff line change
Expand Up @@ -236,7 +236,7 @@ struct ProcessOutputsOp<::amr_wind_tests::FixedWing, ActSrcLine>
void operator()(::amr_wind_tests::FixedWing::DataType& /*data*/) {}
void read_io_options(const utils::ActParser& /**/) {}
void prepare_outputs(const std::string& /**/) {}
void write_outputs(){};
void write_outputs() {};
};

} // namespace ops
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -168,7 +168,7 @@ struct ProcessOutputsOp<::amr_wind_tests::Joukowsky, ActSrcDisk>
void operator()(::amr_wind_tests::Joukowsky::DataType& /*data*/) {}
void read_io_options(const utils::ActParser& /**/) {}
void prepare_outputs(const std::string& /**/) {}
void write_outputs(){};
void write_outputs() {};
};

} // namespace ops
Expand Down

0 comments on commit ecc81cb

Please sign in to comment.