Skip to content

Commit

Permalink
fix-clang-tidy issues
Browse files Browse the repository at this point in the history
  • Loading branch information
lucafedeli88 committed Sep 18, 2024
1 parent d4ea23b commit 5976c62
Show file tree
Hide file tree
Showing 17 changed files with 30 additions and 30 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@ void RelativisticExplicitES::AddSpaceChargeField (
}

// Apply filter, perform MPI exchange, interpolate across levels
Vector<std::unique_ptr<MultiFab>> rho_buf(num_levels);
const Vector<std::unique_ptr<MultiFab>> rho_buf(num_levels);
warpx.SyncRho(
amrex::GetVecOfPtrs(rho),
amrex::GetVecOfPtrs(rho_coarse),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -90,23 +90,23 @@ public:
ablastr::fields::MultiLevelVectorField const& Bfield,
ablastr::fields::MultiLevelScalarField const& rhofield,
ablastr::fields::MultiLevelVectorField const& edge_lengths,
bool solve_for_Faraday);
bool solve_for_Faraday) const;

void HybridPICSolveE (
ablastr::fields::VectorField const& Efield,
ablastr::fields::VectorField const& Jfield,
ablastr::fields::VectorField const& Bfield,
amrex::MultiFab const& rhofield,
ablastr::fields::VectorField const& edge_lengths,
int lev, bool solve_for_Faraday);
int lev, bool solve_for_Faraday) const;

void HybridPICSolveE (
ablastr::fields::VectorField const& Efield,
ablastr::fields::VectorField const& Jfield,
ablastr::fields::VectorField const& Bfield,
amrex::MultiFab const& rhofield,
ablastr::fields::VectorField const& edge_lengths,
int lev, PatchType patch_type, bool solve_for_Faraday);
int lev, PatchType patch_type, bool solve_for_Faraday) const;

void BfieldEvolveRK (
ablastr::fields::MultiLevelVectorField const& Bfield,
Expand Down Expand Up @@ -140,8 +140,8 @@ public:
* Function to calculate the electron pressure using the simulation charge
* density. Used in the Ohm's law solver (kinetic-fluid hybrid model).
*/
void CalculateElectronPressure ();
void CalculateElectronPressure (int lev);
void CalculateElectronPressure () const;
void CalculateElectronPressure (int lev) const;

/**
* \brief Fill the electron pressure multifab given the kinetic particle
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -421,7 +421,7 @@ void HybridPICModel::HybridPICSolveE (
ablastr::fields::MultiLevelVectorField const& Bfield,
ablastr::fields::MultiLevelScalarField const& rhofield,
ablastr::fields::MultiLevelVectorField const& edge_lengths,
const bool solve_for_Faraday)
const bool solve_for_Faraday) const
{
auto& warpx = WarpX::GetInstance();
for (int lev = 0; lev <= warpx.finestLevel(); ++lev)
Expand All @@ -439,7 +439,7 @@ void HybridPICModel::HybridPICSolveE (
ablastr::fields::VectorField const& Bfield,
amrex::MultiFab const& rhofield,
ablastr::fields::VectorField const& edge_lengths,
const int lev, const bool solve_for_Faraday)
const int lev, const bool solve_for_Faraday) const
{
WARPX_PROFILE("WarpX::HybridPICSolveE()");

Expand All @@ -461,7 +461,7 @@ void HybridPICModel::HybridPICSolveE (
amrex::MultiFab const& rhofield,
ablastr::fields::VectorField const& edge_lengths,
const int lev, PatchType patch_type,
const bool solve_for_Faraday)
const bool solve_for_Faraday) const
{
using ablastr::fields::va2vm;

Expand All @@ -481,7 +481,7 @@ void HybridPICModel::HybridPICSolveE (
warpx.ApplyEfieldBoundary(lev, patch_type);
}

void HybridPICModel::CalculateElectronPressure()
void HybridPICModel::CalculateElectronPressure() const
{
auto& warpx = WarpX::GetInstance();
for (int lev = 0; lev <= warpx.finestLevel(); ++lev)
Expand All @@ -490,7 +490,7 @@ void HybridPICModel::CalculateElectronPressure()
}
}

void HybridPICModel::CalculateElectronPressure(const int lev)
void HybridPICModel::CalculateElectronPressure(const int lev) const
{
WARPX_PROFILE("WarpX::CalculateElectronPressure()");

Expand Down
4 changes: 2 additions & 2 deletions Source/Fluids/WarpXFluidContainer.H
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ public:
WarpXFluidContainer(WarpXFluidContainer&& ) = default;
WarpXFluidContainer& operator=(WarpXFluidContainer&& ) = default;

void AllocateLevelMFs (ablastr::fields::MultiFabRegister& m_fields, const amrex::BoxArray& ba, const amrex::DistributionMapping& dm, int lev);
void AllocateLevelMFs (ablastr::fields::MultiFabRegister& m_fields, const amrex::BoxArray& ba, const amrex::DistributionMapping& dm, int lev) const;

void InitData (ablastr::fields::MultiFabRegister& m_fields, amrex::Box init_box, amrex::Real cur_time, int lev);

Expand All @@ -49,7 +49,7 @@ public:
*/
void Evolve (ablastr::fields::MultiFabRegister& fields,
int lev,
std::string current_fp_string,
const std::string& current_fp_string,
amrex::Real cur_time,
bool skip_deposition=false);

Expand Down
4 changes: 2 additions & 2 deletions Source/Fluids/WarpXFluidContainer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,7 @@ void WarpXFluidContainer::ReadParameters()
}
}

void WarpXFluidContainer::AllocateLevelMFs(ablastr::fields::MultiFabRegister& fields, const BoxArray &ba, const DistributionMapping &dm, int lev)
void WarpXFluidContainer::AllocateLevelMFs(ablastr::fields::MultiFabRegister& fields, const BoxArray &ba, const DistributionMapping &dm, int lev) const
{
using ablastr::fields::Direction;
const int ncomps = 1;
Expand Down Expand Up @@ -254,7 +254,7 @@ void WarpXFluidContainer::InitData(ablastr::fields::MultiFabRegister& fields, am
void WarpXFluidContainer::Evolve(
ablastr::fields::MultiFabRegister& fields,
int lev,
std::string current_fp_string,
const std::string& current_fp_string,
amrex::Real cur_time,
bool skip_deposition)
{
Expand Down
2 changes: 1 addition & 1 deletion Source/Initialization/WarpXInitData.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ namespace
*/
void CheckGuardCells (
ablastr::fields::MultiFabRegister& fields,
std::string mf_name,
const std::string& mf_name,
int lev
)
{
Expand Down
8 changes: 4 additions & 4 deletions Source/Parallelization/WarpXComm.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1067,7 +1067,7 @@ WarpX::FillBoundaryAux (int lev, IntVect ng)
}

void
WarpX::SyncCurrent (std::string current_fp_string)
WarpX::SyncCurrent (const std::string& current_fp_string)
{
using ablastr::fields::Direction;

Expand Down Expand Up @@ -1237,13 +1237,13 @@ WarpX::SyncCurrent (std::string current_fp_string)

void
WarpX::SyncRho () {
ablastr::fields::MultiLevelScalarField rho_fp = m_fields.has("rho_fp", 0) ?
const ablastr::fields::MultiLevelScalarField rho_fp = m_fields.has("rho_fp", 0) ?
m_fields.get_mr_levels("rho_fp", finest_level) :
ablastr::fields::MultiLevelScalarField{static_cast<size_t>(finest_level+1)};
ablastr::fields::MultiLevelScalarField rho_cp = m_fields.has("rho_cp", 1) ?
const ablastr::fields::MultiLevelScalarField rho_cp = m_fields.has("rho_cp", 1) ?
m_fields.get_mr_levels("rho_cp", finest_level) :
ablastr::fields::MultiLevelScalarField{static_cast<size_t>(finest_level+1)};
ablastr::fields::MultiLevelScalarField rho_buf = m_fields.has("rho_buf", 1) ?
const ablastr::fields::MultiLevelScalarField rho_buf = m_fields.has("rho_buf", 1) ?
m_fields.get_mr_levels("rho_buf", finest_level) :
ablastr::fields::MultiLevelScalarField{static_cast<size_t>(finest_level+1)};

Expand Down
2 changes: 1 addition & 1 deletion Source/Particles/LaserParticleContainer.H
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ public:

void Evolve (ablastr::fields::MultiFabRegister& fields,
int lev,
std::string current_fp_string,
const std::string& current_fp_string,
amrex::Real t, amrex::Real dt, DtType a_dt_type=DtType::Full,
bool skip_deposition=false, PushType push_type=PushType::Explicit) final;

Expand Down
2 changes: 1 addition & 1 deletion Source/Particles/LaserParticleContainer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -558,7 +558,7 @@ LaserParticleContainer::InitData (int lev)
void
LaserParticleContainer::Evolve (ablastr::fields::MultiFabRegister& fields,
int lev,
std::string current_fp_string,
const std::string& current_fp_string,
Real t, Real dt, DtType /*a_dt_type*/, bool skip_deposition, PushType push_type)
{
using ablastr::fields::Direction;
Expand Down
2 changes: 1 addition & 1 deletion Source/Particles/PhotonParticleContainer.H
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ public:

void Evolve (ablastr::fields::MultiFabRegister& fields,
int lev,
std::string current_fp_string,
const std::string& current_fp_string,
amrex::Real t,
amrex::Real dt,
DtType a_dt_type=DtType::Full,
Expand Down
2 changes: 1 addition & 1 deletion Source/Particles/PhotonParticleContainer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -231,7 +231,7 @@ PhotonParticleContainer::PushPX (WarpXParIter& pti,
void
PhotonParticleContainer::Evolve (ablastr::fields::MultiFabRegister& fields,
int lev,
std::string current_fp_string,
const std::string& current_fp_string,
Real t, Real dt, DtType a_dt_type, bool skip_deposition,
PushType push_type)
{
Expand Down
2 changes: 1 addition & 1 deletion Source/Particles/PhysicalParticleContainer.H
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ public:
*/
void Evolve (ablastr::fields::MultiFabRegister& fields,
int lev,
std::string current_fp_string,
const std::string& current_fp_string,
amrex::Real t,
amrex::Real dt,
DtType a_dt_type=DtType::Full,
Expand Down
2 changes: 1 addition & 1 deletion Source/Particles/PhysicalParticleContainer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1746,7 +1746,7 @@ PhysicalParticleContainer::AddPlasmaFlux (PlasmaInjector const& plasma_injector,
void
PhysicalParticleContainer::Evolve (ablastr::fields::MultiFabRegister& fields,
int lev,
std::string current_fp_string,
const std::string& current_fp_string,
Real /*t*/, Real dt, DtType a_dt_type, bool skip_deposition,
PushType push_type)
{
Expand Down
2 changes: 1 addition & 1 deletion Source/Particles/RigidInjectedParticleContainer.H
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ public:

void Evolve (ablastr::fields::MultiFabRegister& fields,
int lev,
std::string current_fp_string,
const std::string& current_fp_string,
amrex::Real t,
amrex::Real dt,
DtType a_dt_type=DtType::Full,
Expand Down
2 changes: 1 addition & 1 deletion Source/Particles/RigidInjectedParticleContainer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -293,7 +293,7 @@ RigidInjectedParticleContainer::PushPX (WarpXParIter& pti,
void
RigidInjectedParticleContainer::Evolve (ablastr::fields::MultiFabRegister& fields,
int lev,
std::string current_fp_string,
const std::string& current_fp_string,
Real t, Real dt, DtType a_dt_type, bool skip_deposition,
PushType push_type)
{
Expand Down
2 changes: 1 addition & 1 deletion Source/Particles/WarpXParticleContainer.H
Original file line number Diff line number Diff line change
Expand Up @@ -149,7 +149,7 @@ public:
*/
virtual void Evolve (ablastr::fields::MultiFabRegister& fields,
int lev,
std::string current_fp_string,
const std::string& current_fp_string,
amrex::Real t, amrex::Real dt, DtType a_dt_type=DtType::Full, bool skip_deposition=false,
PushType push_type=PushType::Explicit) = 0;

Expand Down
2 changes: 1 addition & 1 deletion Source/WarpX.H
Original file line number Diff line number Diff line change
Expand Up @@ -805,7 +805,7 @@ public:
*
* \param[in] current_fp_string the coarse of fine patch to use for current
*/
void SyncCurrent (std::string current_fp_string);
void SyncCurrent (const std::string& current_fp_string);

void SyncRho ();

Expand Down

0 comments on commit 5976c62

Please sign in to comment.