Skip to content

Commit 547bfbb

Browse files
authored
Clang-tidy CI test: bump version from 15 to 16 (#5592)
This PR bumps the version used for `clang-tidy` CI tests from 15 to 16. It also addresses all the issues found with the upgraded tool. Most of the issues are related to this newly introduced check: - [cppcoreguidelines-avoid-const-or-ref-data-members](https://releases.llvm.org/16.0.0/tools/clang/tools/extra/docs/clang-tidy/checks/cppcoreguidelines/avoid-const-or-ref-data-members.html) The check enforces [CppCoreGuidelines about constant and reference data members]( https://github.com/isocpp/CppCoreGuidelines/blob/master/CppCoreGuidelines.md#c12-dont-make-data-members-const-or-references) . In general, I understand the argument against using constant or reference data members. ~~There is however one case in which I am not fully convinced by the suggestion of the tool: in [PML.H](https://github.com/ECP-WarpX/WarpX/pull/5592/files#diff-f1e020ebe3cd2222f399d50ff05769d0c70482f0e12bbe29b498e9ab2d0f4a53) `const amrex::BoxArray& m_grids;` becomes `amrex::BoxArray m_grids;` and I am wondering if this can be an issue for performances. Maybe we could consider using a (possibly smart) pointer to the `BoxArray`, instead of making a copy.~~ (we are now using a pointer for `amrex::BoxArray m_grids;`). Few issues were instead related to these checks: - [modernize-loop-convert](https://releases.llvm.org/16.0.0/tools/clang/tools/extra/docs/clang-tidy/checks/modernize/loop-convert.html) This check was already enabled, but `clang-tidy-16` broadens its scope with respect to previous versions. - [modernize-use-auto](https://releases.llvm.org/16.0.0/tools/clang/tools/extra/docs/clang-tidy/checks/modernize/use-auto.html) Only one case. I am a bit confused because this should have been found also by version 15 of the tool. - [misc-use-anonymous-namespace](https://releases.llvm.org/16.0.0/tools/clang/tools/extra/docs/clang-tidy/checks/misc/use-anonymous-namespace.html) This is a new check. Actually, the issues found with this check were false positives, but they disappeared when I properly set `misc-use-anonymous-namespace.HeaderFileExtensions` in the `.clang-tidy` configuration file to recognize `.H` files as headers. - [misc-misplaced-const](https://releases.llvm.org/16.0.0/tools/clang/tools/extra/docs/clang-tidy/checks/misc/misplaced-const.html) Only one case. I am a bit confused because this should have been found also by version 15 of the tool. - [readability-misleading-indentation](https://releases.llvm.org/16.0.0/tools/clang/tools/extra/docs/clang-tidy/checks/readability/misleading-indentation.html) [**NOW DISABLED DUE TO FALSE POSITIVES**] This check was already enabled. However, with this newer version of the tool, it seems to me that it generates some false positives. Therefore, I would like to propose to **disable** it. We may try to re-enable it when we will bump the version from 16 to 17.
1 parent 0e1df84 commit 547bfbb

35 files changed

+104
-103
lines changed

.clang-tidy

+3
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,7 @@ Checks: '
4444
-readability-implicit-bool-conversion,
4545
-readability-isolate-declaration,
4646
-readability-magic-numbers,
47+
-readability-misleading-indentation,
4748
-readability-named-parameter,
4849
-readability-uppercase-literal-suffix
4950
'
@@ -55,6 +56,8 @@ CheckOptions:
5556
value: "H,"
5657
- key: modernize-pass-by-value.ValuesOnly
5758
value: "true"
59+
- key: misc-use-anonymous-namespace.HeaderFileExtensions
60+
value: "H,"
5861

5962

6063
HeaderFilterRegex: 'Source[a-z_A-Z0-9\/]+\.H$'

.github/workflows/clang_tidy.yml

+4-4
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ jobs:
2626
- uses: actions/checkout@v4
2727
- name: install dependencies
2828
run: |
29-
.github/workflows/dependencies/clang.sh 15
29+
.github/workflows/dependencies/clang.sh 16
3030
- name: set up cache
3131
uses: actions/cache@v4
3232
with:
@@ -43,8 +43,8 @@ jobs:
4343
export CCACHE_LOGFILE=${{ github.workspace }}/ccache.log.txt
4444
ccache -z
4545
46-
export CXX=$(which clang++-15)
47-
export CC=$(which clang-15)
46+
export CXX=$(which clang++-16)
47+
export CC=$(which clang-16)
4848
4949
cmake -S . -B build_clang_tidy \
5050
-DCMAKE_VERBOSE_MAKEFILE=ON \
@@ -62,7 +62,7 @@ jobs:
6262
6363
${{github.workspace}}/.github/workflows/source/makeMakefileForClangTidy.py --input ${{github.workspace}}/ccache.log.txt
6464
make -j4 --keep-going -f clang-tidy-ccache-misses.mak \
65-
CLANG_TIDY=clang-tidy-15 \
65+
CLANG_TIDY=clang-tidy-16 \
6666
CLANG_TIDY_ARGS="--config-file=${{github.workspace}}/.clang-tidy --warnings-as-errors=*"
6767
6868
ccache -s

Source/BoundaryConditions/PML.H

+7-7
Original file line numberDiff line numberDiff line change
@@ -81,10 +81,10 @@ class SigmaBoxFactory
8181
: public amrex::FabFactory<SigmaBox>
8282
{
8383
public:
84-
SigmaBoxFactory (const amrex::BoxArray& grid_ba, const amrex::Real* dx,
84+
SigmaBoxFactory (const amrex::BoxArray* grid_ba, const amrex::Real* dx,
8585
const amrex::IntVect& ncell, const amrex::IntVect& delta,
8686
const amrex::Box& regular_domain, const amrex::Real v_sigma_sb)
87-
: m_grids(grid_ba), m_dx(dx), m_ncell(ncell), m_delta(delta), m_regdomain(regular_domain), m_v_sigma_sb(v_sigma_sb) {}
87+
: m_grids{grid_ba}, m_dx(dx), m_ncell(ncell), m_delta(delta), m_regdomain(regular_domain), m_v_sigma_sb(v_sigma_sb) {}
8888
~SigmaBoxFactory () override = default;
8989

9090
SigmaBoxFactory (const SigmaBoxFactory&) = default;
@@ -97,7 +97,7 @@ public:
9797
[[nodiscard]] SigmaBox* create (const amrex::Box& box, int /*ncomps*/,
9898
const amrex::FabInfo& /*info*/, int /*box_index*/) const final
9999
{
100-
return new SigmaBox(box, m_grids, m_dx, m_ncell, m_delta, m_regdomain, m_v_sigma_sb);
100+
return new SigmaBox(box, *m_grids, m_dx, m_ncell, m_delta, m_regdomain, m_v_sigma_sb);
101101
}
102102

103103
void destroy (SigmaBox* fab) const final
@@ -112,7 +112,7 @@ public:
112112
}
113113

114114
private:
115-
const amrex::BoxArray& m_grids;
115+
const amrex::BoxArray* m_grids;
116116
const amrex::Real* m_dx;
117117
amrex::IntVect m_ncell;
118118
amrex::IntVect m_delta;
@@ -125,7 +125,7 @@ class MultiSigmaBox
125125
{
126126
public:
127127
MultiSigmaBox(const amrex::BoxArray& ba, const amrex::DistributionMapping& dm,
128-
const amrex::BoxArray& grid_ba, const amrex::Real* dx,
128+
const amrex::BoxArray* grid_ba, const amrex::Real* dx,
129129
const amrex::IntVect& ncell, const amrex::IntVect& delta,
130130
const amrex::Box& regular_domain, amrex::Real v_sigma_sb);
131131
void ComputePMLFactorsB (const amrex::Real* dx, amrex::Real dt);
@@ -204,8 +204,8 @@ private:
204204
bool m_dive_cleaning;
205205
bool m_divb_cleaning;
206206

207-
const amrex::IntVect m_fill_guards_fields;
208-
const amrex::IntVect m_fill_guards_current;
207+
amrex::IntVect m_fill_guards_fields;
208+
amrex::IntVect m_fill_guards_current;
209209

210210
const amrex::Geometry* m_geom;
211211
const amrex::Geometry* m_cgeom;

Source/BoundaryConditions/PML.cpp

+3-3
Original file line numberDiff line numberDiff line change
@@ -506,7 +506,7 @@ SigmaBox::ComputePMLFactorsE (const Real* a_dx, Real dt)
506506
}
507507

508508
MultiSigmaBox::MultiSigmaBox (const BoxArray& ba, const DistributionMapping& dm,
509-
const BoxArray& grid_ba, const Real* dx,
509+
const BoxArray* grid_ba, const Real* dx,
510510
const IntVect& ncell, const IntVect& delta,
511511
const amrex::Box& regular_domain, const amrex::Real v_sigma_sb)
512512
: FabArray<SigmaBox>(ba,dm,1,0,MFInfo(),
@@ -764,7 +764,7 @@ PML::PML (const int lev, const BoxArray& grid_ba,
764764

765765
Box single_domain_box = is_single_box_domain ? domain0 : Box();
766766
// Empty box (i.e., Box()) means it's not a single box domain.
767-
sigba_fp = std::make_unique<MultiSigmaBox>(ba, dm, grid_ba_reduced, geom->CellSize(),
767+
sigba_fp = std::make_unique<MultiSigmaBox>(ba, dm, &grid_ba_reduced, geom->CellSize(),
768768
IntVect(ncell), IntVect(delta), single_domain_box, v_sigma_sb);
769769

770770
if (WarpX::electromagnetic_solver_id == ElectromagneticSolverAlgo::PSATD) {
@@ -879,7 +879,7 @@ PML::PML (const int lev, const BoxArray& grid_ba,
879879
warpx.m_fields.alloc_init(FieldType::pml_j_cp, Direction{2}, lev, cba_jz, cdm, 1, ngb, 0.0_rt, false, false);
880880

881881
single_domain_box = is_single_box_domain ? cdomain : Box();
882-
sigba_cp = std::make_unique<MultiSigmaBox>(cba, cdm, grid_cba_reduced, cgeom->CellSize(),
882+
sigba_cp = std::make_unique<MultiSigmaBox>(cba, cdm, &grid_cba_reduced, cgeom->CellSize(),
883883
cncells, cdelta, single_domain_box, v_sigma_sb);
884884

885885
if (WarpX::electromagnetic_solver_id == ElectromagneticSolverAlgo::PSATD) {

Source/BoundaryConditions/PML_RZ.H

+2-2
Original file line numberDiff line numberDiff line change
@@ -53,8 +53,8 @@ public:
5353

5454
private:
5555

56-
const int m_ncell;
57-
const int m_do_pml_in_domain;
56+
int m_ncell;
57+
int m_do_pml_in_domain;
5858
const amrex::Geometry* m_geom;
5959

6060
// The MultiFabs pml_E_fp and pml_B_fp are setup using the registry.

Source/Diagnostics/BTDiagnostics.H

+1-1
Original file line numberDiff line numberDiff line change
@@ -242,7 +242,7 @@ private:
242242
* will be used by all snapshots to obtain lab-frame data at the respective
243243
* z slice location.
244244
*/
245-
std::string const m_cell_centered_data_name;
245+
std::string m_cell_centered_data_name;
246246
/** Vector of pointers to compute cell-centered data, per level, per component
247247
* using the coarsening-ratio provided by the user.
248248
*/

Source/Diagnostics/ComputeDiagFunctors/BackTransformFunctor.H

+3-3
Original file line numberDiff line numberDiff line change
@@ -100,11 +100,11 @@ public:
100100
amrex::Real beta_boost) const;
101101
private:
102102
/** pointer to source multifab (cell-centered multi-component multifab) */
103-
amrex::MultiFab const * const m_mf_src = nullptr;
103+
const amrex::MultiFab* m_mf_src = nullptr;
104104
/** level at which m_mf_src is defined */
105-
int const m_lev;
105+
int m_lev;
106106
/** Number of buffers or snapshots */
107-
int const m_num_buffers;
107+
int m_num_buffers;
108108
/** Vector of amrex::Box with index-space in the lab-frame */
109109
amrex::Vector<amrex::Box> m_buffer_box;
110110
/** Vector of current z co-ordinate in the boosted-frame for each buffer */

Source/Diagnostics/ComputeDiagFunctors/CellCenterFunctor.H

+1-1
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ public:
3636
void operator()(amrex::MultiFab& mf_dst, int dcomp, int /*i_buffer=0*/) const override;
3737
private:
3838
/** pointer to source multifab (can be multi-component) */
39-
amrex::MultiFab const * const m_mf_src = nullptr;
39+
const amrex::MultiFab* m_mf_src = nullptr;
4040
int m_lev; /**< level on which mf_src is defined (used in cylindrical) */
4141
/**< (for cylindrical) whether to average all modes into 1 comp */
4242
bool m_convertRZmodes2cartesian;

Source/Diagnostics/ComputeDiagFunctors/DivBFunctor.H

+1-1
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ public:
4242
private:
4343
/** Vector of pointer to source multifab Bx, By, Bz */
4444
ablastr::fields::VectorField m_arr_mf_src;
45-
int const m_lev; /**< level on which mf_src is defined (used in cylindrical) */
45+
int m_lev; /**< level on which mf_src is defined (used in cylindrical) */
4646
/**< (for cylindrical) whether to average all modes into 1 comp */
4747
bool m_convertRZmodes2cartesian;
4848
};

Source/Diagnostics/ComputeDiagFunctors/DivEFunctor.H

+1-1
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ public:
4141
private:
4242
/** Vector of pointer to source multifab Bx, By, Bz */
4343
ablastr::fields::VectorField m_arr_mf_src;
44-
int const m_lev; /**< level on which mf_src is defined (used in cylindrical) */
44+
int m_lev; /**< level on which mf_src is defined (used in cylindrical) */
4545
/**< (for cylindrical) whether to average all modes into 1 comp */
4646
bool m_convertRZmodes2cartesian;
4747
};

Source/Diagnostics/ComputeDiagFunctors/JFunctor.H

+1-1
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ public:
3939
void operator()(amrex::MultiFab& mf_dst, int dcomp, int /*i_buffer=0*/) const override;
4040
private:
4141
/** direction of the current density to save */
42-
const int m_dir;
42+
int m_dir;
4343
/** level on which mf_src is defined */
4444
int m_lev;
4545
/** (for cylindrical) whether to average all modes into 1 comp */

Source/Diagnostics/ComputeDiagFunctors/PartPerCellFunctor.H

+1-1
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ public:
3030
*/
3131
void operator()(amrex::MultiFab& mf_dst, int dcomp, int /*i_buffer=0*/) const override;
3232
private:
33-
int const m_lev; /**< level on which mf_src is defined */
33+
int m_lev; /**< level on which mf_src is defined */
3434
};
3535

3636
#endif // WARPX_PARTPERCELLFUNCTOR_H_

Source/Diagnostics/ComputeDiagFunctors/PartPerGridFunctor.H

+1-1
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ public:
3030
*/
3131
void operator()(amrex::MultiFab& mf_dst, int dcomp, int /*i_buffer=0*/) const override;
3232
private:
33-
int const m_lev; /**< level on which mf_src is defined */
33+
int m_lev; /**< level on which mf_src is defined */
3434
};
3535

3636
#endif // WARPX_PARTPERGRIDFUNCTOR_H_

Source/Diagnostics/ComputeDiagFunctors/ParticleReductionFunctor.H

+4-4
Original file line numberDiff line numberDiff line change
@@ -43,10 +43,10 @@ public:
4343
*/
4444
void operator()(amrex::MultiFab& mf_dst, int dcomp, int /*i_buffer=0*/) const override;
4545
private:
46-
int const m_lev; /**< level on which mf_src is defined */
47-
int const m_ispec; /**< index of species to average over */
48-
bool const m_do_average; /**< Whether to calculate the average of the data */
49-
bool const m_do_filter; /**< whether to apply #m_filter_fn */
46+
int m_lev; /**< level on which mf_src is defined */
47+
int m_ispec; /**< index of species to average over */
48+
bool m_do_average; /**< Whether to calculate the average of the data */
49+
bool m_do_filter; /**< whether to apply #m_filter_fn */
5050
/** Parser function to be averaged by the functor. Arguments: x, y, z, ux, uy, uz */
5151
std::unique_ptr<amrex::Parser> m_map_fn_parser;
5252
/** Parser function to filter particles before pass to map. Arguments: x, y, z, ux, uy, uz */

Source/Diagnostics/ComputeDiagFunctors/RhoFunctor.H

+2-2
Original file line numberDiff line numberDiff line change
@@ -43,13 +43,13 @@ public:
4343
private:
4444

4545
// Level on which source MultiFab mf_src is defined in RZ geometry
46-
int const m_lev;
46+
int m_lev;
4747

4848
// Whether to apply k-space filtering of charge density in the diagnostics output in RZ PSATD
4949
bool m_apply_rz_psatd_filter;
5050

5151
// Species index to dump rho per species
52-
const int m_species_index;
52+
int m_species_index;
5353

5454
// Whether to average all modes into one component in RZ geometry
5555
bool m_convertRZmodes2cartesian;

Source/Diagnostics/ComputeDiagFunctors/TemperatureFunctor.H

+2-2
Original file line numberDiff line numberDiff line change
@@ -28,8 +28,8 @@ public:
2828
*/
2929
void operator()(amrex::MultiFab& mf_dst, int dcomp, int /*i_buffer=0*/) const override;
3030
private:
31-
int const m_lev; /**< level on which mf_src is defined */
32-
int const m_ispec; /**< index of species to average over */
31+
int m_lev; /**< level on which mf_src is defined */
32+
int m_ispec; /**< index of species to average over */
3333
};
3434

3535
#endif // WARPX_TEMPERATUREFUNCTOR_H_

Source/Diagnostics/FlushFormats/FlushFormatInSitu.cpp

+3-3
Original file line numberDiff line numberDiff line change
@@ -27,14 +27,14 @@ FlushFormatInSitu::WriteParticles(const amrex::Vector<ParticleDiag>& particle_di
2727
// we prefix the fields with "particle_{species_name}" b/c we
2828
// want to to uniquely name all the fields that can be plotted
2929

30-
for (unsigned i = 0, n = particle_diags.size(); i < n; ++i) {
30+
for (const auto & particle_diag : particle_diags) {
3131
Vector<std::string> particle_varnames;
3232
Vector<std::string> particle_int_varnames;
33-
std::string prefix = "particle_" + particle_diags[i].getSpeciesName();
33+
std::string prefix = "particle_" + particle_diag.getSpeciesName();
3434

3535
// Get pc for species
3636
// auto& pc = mypc->GetParticleContainer(i);
37-
WarpXParticleContainer* pc = particle_diags[i].getParticleContainer();
37+
WarpXParticleContainer* pc = particle_diag.getParticleContainer();
3838

3939
// get names of real comps
4040
std::map<std::string, int> real_comps_map = pc->getParticleComps();

Source/Diagnostics/FullDiagnostics.cpp

+4-6
Original file line numberDiff line numberDiff line change
@@ -565,12 +565,10 @@ FullDiagnostics::AddRZModesToDiags (int lev)
565565

566566
// Check if divE is requested
567567
// If so, all components will be written out
568-
bool divE_requested = false;
569-
for (int comp = 0; comp < m_varnames.size(); comp++) {
570-
if ( m_varnames[comp] == "divE" ) {
571-
divE_requested = true;
572-
}
573-
}
568+
const bool divE_requested = std::any_of(
569+
std::begin(m_varnames),
570+
std::end(m_varnames),
571+
[](const auto& varname) { return varname == "divE"; });
574572

575573
// If rho is requested, all components will be written out
576574
const bool rho_requested = utils::algorithms::is_in( m_varnames, "rho" );

Source/Diagnostics/ReducedDiags/LoadBalanceCosts.H

+2-2
Original file line numberDiff line numberDiff line change
@@ -40,9 +40,9 @@ public:
4040
* (cost, processor, level, i_low, j_low, k_low, gpu_ID [if GPU run], num_cells, num_macro_particles
4141
* note: the hostname per box is stored separately (in m_data_string) */
4242
#ifdef AMREX_USE_GPU
43-
const int m_nDataFields = 9;
43+
static const int m_nDataFields = 9;
4444
#else
45-
const int m_nDataFields = 8;
45+
static const int m_nDataFields = 8;
4646
#endif
4747

4848
/** used to keep track of max number of boxes over all timesteps; this allows

Source/Diagnostics/WarpXOpenPMD.cpp

+14-14
Original file line numberDiff line numberDiff line change
@@ -531,10 +531,10 @@ WarpXOpenPMDPlot::WriteOpenPMDParticles (const amrex::Vector<ParticleDiag>& part
531531
{
532532
WARPX_PROFILE("WarpXOpenPMDPlot::WriteOpenPMDParticles()");
533533

534-
for (unsigned i = 0, n = particle_diags.size(); i < n; ++i) {
534+
for (const auto & particle_diag : particle_diags) {
535535

536-
WarpXParticleContainer* pc = particle_diags[i].getParticleContainer();
537-
PinnedMemoryParticleContainer* pinned_pc = particle_diags[i].getPinnedParticleContainer();
536+
WarpXParticleContainer* pc = particle_diag.getParticleContainer();
537+
PinnedMemoryParticleContainer* pinned_pc = particle_diag.getPinnedParticleContainer();
538538
if (isBTD || use_pinned_pc) {
539539
if (!pinned_pc->isDefined()) {
540540
continue; // Skip to the next particle container
@@ -546,17 +546,17 @@ for (unsigned i = 0, n = particle_diags.size(); i < n; ++i) {
546546
pc->make_alike<amrex::PinnedArenaAllocator>();
547547

548548
const auto mass = pc->AmIA<PhysicalSpecies::photon>() ? PhysConst::m_e : pc->getMass();
549-
RandomFilter const random_filter(particle_diags[i].m_do_random_filter,
550-
particle_diags[i].m_random_fraction);
551-
UniformFilter const uniform_filter(particle_diags[i].m_do_uniform_filter,
552-
particle_diags[i].m_uniform_stride);
553-
ParserFilter parser_filter(particle_diags[i].m_do_parser_filter,
549+
RandomFilter const random_filter(particle_diag.m_do_random_filter,
550+
particle_diag.m_random_fraction);
551+
UniformFilter const uniform_filter(particle_diag.m_do_uniform_filter,
552+
particle_diag.m_uniform_stride);
553+
ParserFilter parser_filter(particle_diag.m_do_parser_filter,
554554
utils::parser::compileParser<ParticleDiag::m_nvars>
555-
(particle_diags[i].m_particle_filter_parser.get()),
555+
(particle_diag.m_particle_filter_parser.get()),
556556
pc->getMass(), time);
557557
parser_filter.m_units = InputUnits::SI;
558-
GeometryFilter const geometry_filter(particle_diags[i].m_do_geom_filter,
559-
particle_diags[i].m_diag_domain);
558+
GeometryFilter const geometry_filter(particle_diag.m_do_geom_filter,
559+
particle_diag.m_diag_domain);
560560

561561
if (isBTD || use_pinned_pc) {
562562
particlesConvertUnits(ConvertDirection::WarpX_to_SI, pinned_pc, mass);
@@ -587,7 +587,7 @@ for (unsigned i = 0, n = particle_diags.size(); i < n; ++i) {
587587
}
588588

589589
// Gather the electrostatic potential (phi) on the macroparticles
590-
if ( particle_diags[i].m_plot_phi ) {
590+
if ( particle_diag.m_plot_phi ) {
591591
storePhiOnParticles( tmp, WarpX::electrostatic_solver_id, !use_pinned_pc );
592592
}
593593

@@ -619,7 +619,7 @@ for (unsigned i = 0, n = particle_diags.size(); i < n; ++i) {
619619
real_names[x.second+PIdx::nattribs] = detail::snakeToCamel(x.first);
620620
}
621621
// plot any "extra" fields by default
622-
real_flags = particle_diags[i].m_plot_flags;
622+
real_flags = particle_diag.m_plot_flags;
623623
real_flags.resize(tmp.NumRealComps(), 1);
624624
// and the names
625625
int_names.resize(tmp.NumIntComps());
@@ -634,7 +634,7 @@ for (unsigned i = 0, n = particle_diags.size(); i < n; ++i) {
634634
// real_names contains a list of all real particle attributes.
635635
// real_flags is 1 or 0, whether quantity is dumped or not.
636636
DumpToFile(&tmp,
637-
particle_diags.at(i).getSpeciesName(),
637+
particle_diag.getSpeciesName(),
638638
m_CurrentStep,
639639
real_flags,
640640
int_flags,

Source/FieldSolver/FiniteDifferenceSolver/FiniteDifferenceAlgorithms/FieldAccessorFunctors.H

+2-2
Original file line numberDiff line numberDiff line change
@@ -42,9 +42,9 @@ struct FieldAccessorMacroscopic
4242
}
4343
private:
4444
/** Array4 of the source field to be scaled and returned by the operator() */
45-
amrex::Array4<amrex::Real const> const m_field;
45+
amrex::Array4<amrex::Real const> m_field;
4646
/** Array4 of the macroscopic parameter used to divide m_field in the operator() */
47-
amrex::Array4<amrex::Real const> const m_parameter;
47+
amrex::Array4<amrex::Real const> m_parameter;
4848
};
4949

5050

Source/FieldSolver/FiniteDifferenceSolver/HybridPICModel/HybridPICModel.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -339,7 +339,7 @@ void HybridPICModel::HybridPICSolveE (
339339
auto& warpx = WarpX::GetInstance();
340340

341341
ablastr::fields::VectorField current_fp_plasma = warpx.m_fields.get_alldirs(FieldType::hybrid_current_fp_plasma, lev);
342-
const ablastr::fields::ScalarField electron_pressure_fp = warpx.m_fields.get(FieldType::hybrid_electron_pressure_fp, lev);
342+
auto* const electron_pressure_fp = warpx.m_fields.get(FieldType::hybrid_electron_pressure_fp, lev);
343343

344344
// Solve E field in regular cells
345345
warpx.get_pointer_fdtd_solver_fp(lev)->HybridPICSolveE(

0 commit comments

Comments
 (0)