Skip to content

Commit 15896d0

Browse files
authored
Clang-tidy readability identifier naming for functions (#1148)
1 parent fe73b70 commit 15896d0

File tree

68 files changed

+225
-223
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

68 files changed

+225
-223
lines changed

.clang-tidy

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ CheckOptions:
7171
- { key: readability-identifier-naming.VariableCase, value: lower_case }
7272
- { key: readability-identifier-naming.GlobalConstantCase, value: UPPER_CASE }
7373
- { key: readability-identifier-naming.ClassIgnoredRegexp, value: "incflo"}
74-
- { key: readability-identifier-naming.FunctionIgnoredRegexp, value: "^.*"}
74+
- { key: readability-identifier-naming.FunctionIgnoredRegexp, value: "(Godunov_|setVal|ComputeDt|ComputePrescribeDt|ApplyPredictor|ApplyCorrector|ApplyPrescribeStep|ApplyProjection|UpdateGradP|ReadCheckpointFile|Factory|ReadParameters|InitialProjection|InitialIterations|PrintMax|CheckForNans|InitData|Evolve|buildInfoGet|FAST_).*"}
7575
- { key: readability-identifier-naming.GlobalConstantIgnoredRegexp, value: "^.*"}
7676
- { key: readability-identifier-naming.NamespaceIgnoredRegexp, value: "Hydro"}
7777
- { key: readability-identifier-naming.StructIgnoredRegexp, value: "(SC_DX|OpFM).*"}

amr-wind/core/Field.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -387,7 +387,7 @@ void Field::to_uniform_space() noexcept
387387
}
388388

389389
const auto& mesh_fac = m_repo.get_mesh_mapping_field(m_info->m_floc);
390-
const auto& mesh_detJ = m_repo.get_mesh_mapping_detJ(m_info->m_floc);
390+
const auto& mesh_detJ = m_repo.get_mesh_mapping_det_j(m_info->m_floc);
391391

392392
// scale velocity to accommodate for mesh mapping -> U^bar = U * J/fac
393393
for (int lev = 0; lev < m_repo.num_active_levels(); ++lev) {
@@ -417,7 +417,7 @@ void Field::to_stretched_space() noexcept
417417
}
418418

419419
const auto& mesh_fac = m_repo.get_mesh_mapping_field(m_info->m_floc);
420-
const auto& mesh_detJ = m_repo.get_mesh_mapping_detJ(m_info->m_floc);
420+
const auto& mesh_detJ = m_repo.get_mesh_mapping_det_j(m_info->m_floc);
421421

422422
// scale field back to stretched mesh -> U = U^bar * fac/J
423423
for (int lev = 0; lev < m_repo.num_active_levels(); ++lev) {

amr-wind/core/FieldRepo.H

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -255,7 +255,7 @@ public:
255255

256256
/** Return a previously created mesh mapping detJ using field location
257257
*/
258-
Field& get_mesh_mapping_detJ(FieldLoc floc) const;
258+
Field& get_mesh_mapping_det_j(FieldLoc floc) const;
259259

260260
//! Query if field uniquely identified by name and time state exists in
261261
//! repository

amr-wind/core/FieldRepo.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -187,7 +187,7 @@ Field& FieldRepo::get_mesh_mapping_field(FieldLoc floc) const
187187
return *fac;
188188
}
189189

190-
Field& FieldRepo::get_mesh_mapping_detJ(FieldLoc floc) const
190+
Field& FieldRepo::get_mesh_mapping_det_j(FieldLoc floc) const
191191
{
192192
Field* detJ = nullptr;
193193
switch (floc) {

amr-wind/core/SimTime.H

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -81,22 +81,22 @@ public:
8181
void set_restart_time(int tidx, amrex::Real time);
8282

8383
AMREX_FORCE_INLINE
84-
amrex::Real deltaT() const { return m_dt[0]; }
84+
amrex::Real delta_t() const { return m_dt[0]; }
8585

8686
AMREX_FORCE_INLINE
87-
amrex::Real& deltaT() { return m_dt[0]; }
87+
amrex::Real& delta_t() { return m_dt[0]; }
8888

8989
AMREX_FORCE_INLINE
90-
amrex::Real deltaTNm1() const { return m_dt[1]; }
90+
amrex::Real delta_t_nm1() const { return m_dt[1]; }
9191

9292
AMREX_FORCE_INLINE
93-
amrex::Real deltaTNm2() const { return m_dt[2]; }
93+
amrex::Real delta_t_nm2() const { return m_dt[2]; }
9494

9595
AMREX_FORCE_INLINE
96-
amrex::Real& deltaTNm1() { return m_dt[1]; }
96+
amrex::Real& delta_t_nm1() { return m_dt[1]; }
9797

9898
AMREX_FORCE_INLINE
99-
amrex::Real& deltaTNm2() { return m_dt[2]; }
99+
amrex::Real& delta_t_nm2() { return m_dt[2]; }
100100

101101
AMREX_FORCE_INLINE
102102
amrex::Real current_time() const { return m_cur_time; }
@@ -163,10 +163,10 @@ private:
163163
//! Maximum CFL constraint
164164
amrex::Real m_max_cfl{0.5};
165165

166-
//! Fixed deltaT indicated by user
166+
//! Fixed delta_t indicated by user
167167
amrex::Real m_fixed_dt{-1.0};
168168

169-
//! Initial deltaT indicated by user
169+
//! Initial delta_t indicated by user
170170
amrex::Real m_initial_dt{-1.0};
171171

172172
//! Current CFL

amr-wind/core/SimTime.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ namespace amr_wind {
77

88
void SimTime::parse_parameters()
99
{
10-
// Initialize deltaT to negative values
10+
// Initialize delta_t to negative values
1111
for (amrex::Real& i : m_dt) {
1212
i = -1.0;
1313
}
@@ -213,7 +213,7 @@ void SimTime::set_current_cfl(
213213

214214
} else {
215215
// If user has specified fixed DT then issue a warning if the timestep
216-
// is larger than the deltaT determined from max. CFL considerations.
216+
// is larger than the delta_t determined from max. CFL considerations.
217217
// Only issue warnings when the error is greater than 1% of the timestep
218218
// specified
219219
if ((1.0 - (dt_new / m_fixed_dt)) > 0.01) {

amr-wind/core/vs/tensor.H

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ struct TensorT
6262
}
6363

6464
AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE static constexpr TensorT<T>
65-
I() noexcept
65+
identity() noexcept
6666
{
6767
return TensorT{Traits::one(), Traits::zero(), Traits::zero(),
6868
Traits::zero(), Traits::one(), Traits::zero(),

amr-wind/diffusion/incflo_diffusion.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -214,11 +214,11 @@ void viscosity_to_uniform_space(
214214
const auto& mesh_fac_zf =
215215
repo.get_mesh_mapping_field(amr_wind::FieldLoc::ZFACE);
216216
const auto& mesh_detJ_xf =
217-
repo.get_mesh_mapping_detJ(amr_wind::FieldLoc::XFACE);
217+
repo.get_mesh_mapping_det_j(amr_wind::FieldLoc::XFACE);
218218
const auto& mesh_detJ_yf =
219-
repo.get_mesh_mapping_detJ(amr_wind::FieldLoc::YFACE);
219+
repo.get_mesh_mapping_det_j(amr_wind::FieldLoc::YFACE);
220220
const auto& mesh_detJ_zf =
221-
repo.get_mesh_mapping_detJ(amr_wind::FieldLoc::ZFACE);
221+
repo.get_mesh_mapping_det_j(amr_wind::FieldLoc::ZFACE);
222222

223223
// beta accounted for mesh mapping (x-face) = J/fac^2 * mu
224224
for (amrex::MFIter mfi(b[0]); mfi.isValid(); ++mfi) {

amr-wind/equation_systems/CompRHSOps.H

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ struct ComputeRHSOp
7171
auto& conv_term = fields.conv_term.state(fstate);
7272
auto& mask_cell = fields.repo.get_int_field("mask_cell");
7373
Field const* mesh_detJ =
74-
mesh_mapping ? &(fields.repo.get_mesh_mapping_detJ(FieldLoc::CELL))
74+
mesh_mapping ? &(fields.repo.get_mesh_mapping_det_j(FieldLoc::CELL))
7575
: nullptr;
7676

7777
for (int lev = 0; lev < nlevels; ++lev) {
@@ -190,7 +190,7 @@ struct ComputeRHSOp
190190
auto& conv_term_old = fields.conv_term.state(FieldState::Old);
191191
auto& mask_cell = fields.repo.get_int_field("mask_cell");
192192
Field const* mesh_detJ =
193-
mesh_mapping ? &(fields.repo.get_mesh_mapping_detJ(FieldLoc::CELL))
193+
mesh_mapping ? &(fields.repo.get_mesh_mapping_det_j(FieldLoc::CELL))
194194
: nullptr;
195195

196196
for (int lev = 0; lev < nlevels; ++lev) {

amr-wind/equation_systems/DiffusionOps.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -76,9 +76,9 @@ void DiffSolverIface<LinOp>::set_acoeffs(LinOp& linop, const FieldState fstate)
7676
auto& repo = m_pdefields.repo;
7777
const int nlevels = repo.num_active_levels();
7878
const auto& density = m_density.state(fstate);
79-
Field const* mesh_detJ = m_mesh_mapping
80-
? &(repo.get_mesh_mapping_detJ(FieldLoc::CELL))
81-
: nullptr;
79+
Field const* mesh_detJ =
80+
m_mesh_mapping ? &(repo.get_mesh_mapping_det_j(FieldLoc::CELL))
81+
: nullptr;
8282
std::unique_ptr<ScratchField> rho_times_detJ =
8383
m_mesh_mapping ? repo.create_scratch_field(
8484
1, m_density.num_grow()[0], FieldLoc::CELL)

amr-wind/equation_systems/PDE.H

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -130,30 +130,30 @@ public:
130130
{
131131
BL_PROFILE(
132132
"amr-wind::" + this->identifier() + "::compute_advection_term");
133-
(*m_adv_op)(fstate, m_time.deltaT());
133+
(*m_adv_op)(fstate, m_time.delta_t());
134134
}
135135

136136
void pre_advection_actions(const FieldState fstate) override
137137
{
138138
BL_PROFILE(
139139
"amr-wind::" + this->identifier() + "::pre_advection_actions");
140-
m_adv_op->preadvect(fstate, m_time.deltaT(), m_time.current_time());
140+
m_adv_op->preadvect(fstate, m_time.delta_t(), m_time.current_time());
141141
}
142142

143143
void compute_predictor_rhs(const DiffusionType difftype) override
144144
{
145145
BL_PROFILE(
146146
"amr-wind::" + this->identifier() + "::compute_predictor_rhs");
147147
m_rhs_op.predictor_rhs(
148-
difftype, m_time.deltaT(), m_sim.has_mesh_mapping());
148+
difftype, m_time.delta_t(), m_sim.has_mesh_mapping());
149149
}
150150

151151
void compute_corrector_rhs(const DiffusionType difftype) override
152152
{
153153
BL_PROFILE(
154154
"amr-wind::" + this->identifier() + "::compute_corrector_rhs");
155155
m_rhs_op.corrector_rhs(
156-
difftype, m_time.deltaT(), m_sim.has_mesh_mapping());
156+
difftype, m_time.delta_t(), m_sim.has_mesh_mapping());
157157
}
158158

159159
void solve(const amrex::Real dt) override

amr-wind/equation_systems/icns/icns_advection.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -282,11 +282,11 @@ void MacProjOp::mac_proj_to_uniform_space(
282282
const auto& mesh_fac_zf =
283283
repo.get_mesh_mapping_field(amr_wind::FieldLoc::ZFACE);
284284
const auto& mesh_detJ_xf =
285-
repo.get_mesh_mapping_detJ(amr_wind::FieldLoc::XFACE);
285+
repo.get_mesh_mapping_det_j(amr_wind::FieldLoc::XFACE);
286286
const auto& mesh_detJ_yf =
287-
repo.get_mesh_mapping_detJ(amr_wind::FieldLoc::YFACE);
287+
repo.get_mesh_mapping_det_j(amr_wind::FieldLoc::YFACE);
288288
const auto& mesh_detJ_zf =
289-
repo.get_mesh_mapping_detJ(amr_wind::FieldLoc::ZFACE);
289+
repo.get_mesh_mapping_det_j(amr_wind::FieldLoc::ZFACE);
290290

291291
// scale U^mac to accommodate for mesh mapping -> U^bar = J/fac *
292292
// U^mac beta accounted for mesh mapping = J/fac^2 * 1/rho construct

amr-wind/equation_systems/icns/icns_diffusion.H

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -127,7 +127,7 @@ public:
127127
const auto& density = m_density.state(fstate);
128128
const auto& viscosity = m_pdefields.mueff;
129129
Field const* mesh_detJ =
130-
m_mesh_mapping ? &(repo.get_mesh_mapping_detJ(FieldLoc::CELL))
130+
m_mesh_mapping ? &(repo.get_mesh_mapping_det_j(FieldLoc::CELL))
131131
: nullptr;
132132
std::unique_ptr<ScratchField> rho_times_detJ =
133133
m_mesh_mapping ? repo.create_scratch_field(
@@ -199,7 +199,7 @@ public:
199199
auto rhs_ptr = repo.create_scratch_field("rhs", field.num_comp(), 0);
200200
const auto& viscosity = m_pdefields.mueff;
201201
Field const* mesh_detJ =
202-
m_mesh_mapping ? &(repo.get_mesh_mapping_detJ(FieldLoc::CELL))
202+
m_mesh_mapping ? &(repo.get_mesh_mapping_det_j(FieldLoc::CELL))
203203
: nullptr;
204204
std::unique_ptr<ScratchField> rho_times_detJ =
205205
m_mesh_mapping ? repo.create_scratch_field(
@@ -344,7 +344,7 @@ public:
344344
const auto& density = m_density.state(fstate);
345345
const auto& viscosity = m_pdefields.mueff;
346346
Field const* mesh_detJ =
347-
m_mesh_mapping ? &(repo.get_mesh_mapping_detJ(FieldLoc::CELL))
347+
m_mesh_mapping ? &(repo.get_mesh_mapping_det_j(FieldLoc::CELL))
348348
: nullptr;
349349
std::unique_ptr<ScratchField> rho_times_detJ =
350350
m_mesh_mapping ? repo.create_scratch_field(
@@ -432,7 +432,7 @@ public:
432432
const auto& geom = repo.mesh().Geom();
433433

434434
Field const* mesh_detJ =
435-
m_mesh_mapping ? &(repo.get_mesh_mapping_detJ(FieldLoc::CELL))
435+
m_mesh_mapping ? &(repo.get_mesh_mapping_det_j(FieldLoc::CELL))
436436
: nullptr;
437437
std::unique_ptr<ScratchField> rho_times_detJ =
438438
m_mesh_mapping ? repo.create_scratch_field(

amr-wind/equation_systems/icns/source_terms/ABLForcing.H

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ public:
4343
const auto& current_time = m_time.current_time();
4444
const auto& new_time = m_time.new_time();
4545
const auto& nph_time = 0.5 * (current_time + new_time);
46-
const auto& dt = m_time.deltaT();
46+
const auto& dt = m_time.delta_t();
4747
const auto& t_step = m_time.time_index();
4848

4949
if (!m_vel_timetable.empty()) {

amr-wind/equation_systems/icns/source_terms/ABLMesoForcingMom.cpp

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ ABLMesoForcingMom::ABLMesoForcingMom(const CFDSim& sim)
2828

2929
if ((amrex::toLower(m_forcing_scheme) == "indirect") &&
3030
!m_update_transition_height) {
31-
indirectForcingInit(); // do this once
31+
indirect_forcing_init(); // do this once
3232
}
3333
}
3434

@@ -228,8 +228,8 @@ void ABLMesoForcingMom::mean_velocity_heights(
228228
amrex::Print() << "current transition height = "
229229
<< m_transition_height << std::endl;
230230

231-
setTransitionWeighting();
232-
indirectForcingInit();
231+
set_transition_weighting();
232+
indirect_forcing_init();
233233
}
234234

235235
amrex::Array<amrex::Real, 4> ezP_U;
@@ -287,8 +287,8 @@ void ABLMesoForcingMom::mean_velocity_heights(
287287
}
288288

289289
if (amrex::toLower(m_forcing_transition) == "indirecttodirect") {
290-
blendForcings(error_U, error_U_direct, error_U);
291-
blendForcings(error_V, error_V_direct, error_V);
290+
blend_forcings(error_U, error_U_direct, error_U);
291+
blend_forcings(error_V, error_V_direct, error_V);
292292

293293
if (m_debug) {
294294
for (size_t ih = 0; ih < n_levels; ih++) {
@@ -299,9 +299,9 @@ void ABLMesoForcingMom::mean_velocity_heights(
299299
}
300300
}
301301

302-
if (forcingToConstant()) {
303-
constantForcingTransition(error_U);
304-
constantForcingTransition(error_V);
302+
if (forcing_to_constant()) {
303+
constant_forcing_transition(error_U);
304+
constant_forcing_transition(error_V);
305305

306306
if (m_debug) {
307307
for (size_t ih = 0; ih < n_levels; ih++) {
@@ -336,7 +336,7 @@ void ABLMesoForcingMom::operator()(
336336
return;
337337
}
338338

339-
const auto& dt = m_time.deltaT();
339+
const auto& dt = m_time.delta_t();
340340
const auto& problo = m_mesh.Geom(lev).ProbLoArray();
341341
const auto& dx = m_mesh.Geom(lev).CellSizeArray();
342342

amr-wind/equation_systems/temperature/source_terms/ABLMesoForcingTemp.cpp

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ ABLMesoForcingTemp::ABLMesoForcingTemp(const CFDSim& sim)
2828

2929
if ((amrex::toLower(m_forcing_scheme) == "indirect") &&
3030
!m_update_transition_height) {
31-
indirectForcingInit(); // do this once
31+
indirect_forcing_init(); // do this once
3232
}
3333
}
3434

@@ -202,8 +202,8 @@ amrex::Real ABLMesoForcingTemp::mean_temperature_heights(
202202
amrex::Print() << "current transition height = "
203203
<< m_transition_height << std::endl;
204204

205-
setTransitionWeighting();
206-
indirectForcingInit();
205+
set_transition_weighting();
206+
indirect_forcing_init();
207207
}
208208

209209
amrex::Array<amrex::Real, 4> ezP_T;
@@ -247,7 +247,7 @@ amrex::Real ABLMesoForcingTemp::mean_temperature_heights(
247247
}
248248

249249
if (amrex::toLower(m_forcing_transition) == "indirecttodirect") {
250-
blendForcings(error_T, error_T_direct, error_T);
250+
blend_forcings(error_T, error_T_direct, error_T);
251251

252252
if (m_debug) {
253253
for (size_t ih = 0; ih < n_levels; ih++) {
@@ -258,8 +258,8 @@ amrex::Real ABLMesoForcingTemp::mean_temperature_heights(
258258
}
259259
}
260260

261-
if (forcingToConstant()) {
262-
constantForcingTransition(error_T);
261+
if (forcing_to_constant()) {
262+
constant_forcing_transition(error_T);
263263

264264
if (m_debug) {
265265
for (size_t ih = 0; ih < n_levels; ih++) {
@@ -290,7 +290,7 @@ void ABLMesoForcingTemp::operator()(
290290
return;
291291
}
292292

293-
const auto& dt = m_time.deltaT();
293+
const auto& dt = m_time.delta_t();
294294
const auto& problo = m_mesh.Geom(lev).ProbLoArray();
295295
const auto& dx = m_mesh.Geom(lev).CellSizeArray();
296296

0 commit comments

Comments
 (0)