Skip to content

Commit

Permalink
Fix clang-tidy errors
Browse files Browse the repository at this point in the history
  • Loading branch information
EZoni committed Sep 20, 2024
1 parent 98f9670 commit 54bdb71
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 14 deletions.
20 changes: 10 additions & 10 deletions Source/FieldSolver/WarpXPushFieldsEM.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -112,22 +112,22 @@ void WarpX::PSATDForwardTransformEB ()
for (int lev = 0; lev <= finest_level; ++lev)
{
if (m_fields.has_vector(Efield_fp_string, lev)) {
ablastr::fields::VectorField E_fp = m_fields.get_alldirs(Efield_fp_string, lev);
ablastr::fields::VectorField const E_fp = m_fields.get_alldirs(Efield_fp_string, lev);
ForwardTransformVect(lev, *spectral_solver_fp[lev], E_fp, Idx.Ex, Idx.Ey, Idx.Ez);
}
if (m_fields.has_vector(Bfield_fp_string, lev)) {
ablastr::fields::VectorField B_fp = m_fields.get_alldirs(Bfield_fp_string, lev);
ablastr::fields::VectorField const B_fp = m_fields.get_alldirs(Bfield_fp_string, lev);
ForwardTransformVect(lev, *spectral_solver_fp[lev], B_fp, Idx.Bx, Idx.By, Idx.Bz);
}

if (spectral_solver_cp[lev])
{
if (m_fields.has_vector(Efield_cp_string, lev)) {
ablastr::fields::VectorField E_cp = m_fields.get_alldirs(Efield_cp_string, lev);
ablastr::fields::VectorField const E_cp = m_fields.get_alldirs(Efield_cp_string, lev);
ForwardTransformVect(lev, *spectral_solver_cp[lev], E_cp, Idx.Ex, Idx.Ey, Idx.Ez);
}
if (m_fields.has_vector(Bfield_cp_string, lev)) {
ablastr::fields::VectorField B_cp = m_fields.get_alldirs(Bfield_cp_string, lev);
ablastr::fields::VectorField const B_cp = m_fields.get_alldirs(Bfield_cp_string, lev);
ForwardTransformVect(lev, *spectral_solver_cp[lev], B_cp, Idx.Bx, Idx.By, Idx.Bz);
}
}
Expand All @@ -146,25 +146,25 @@ void WarpX::PSATDBackwardTransformEB ()
for (int lev = 0; lev <= finest_level; ++lev)
{
if (m_fields.has_vector(Efield_fp_string, lev)) {
ablastr::fields::VectorField E_fp = m_fields.get_alldirs(Efield_fp_string, lev);
ablastr::fields::VectorField const E_fp = m_fields.get_alldirs(Efield_fp_string, lev);
BackwardTransformVect(lev, *spectral_solver_fp[lev], E_fp,
Idx.Ex, Idx.Ey, Idx.Ez, m_fill_guards_fields);
}
if (m_fields.has_vector(Bfield_fp_string, lev)) {
ablastr::fields::VectorField B_fp = m_fields.get_alldirs(Bfield_fp_string, lev);
ablastr::fields::VectorField const B_fp = m_fields.get_alldirs(Bfield_fp_string, lev);
BackwardTransformVect(lev, *spectral_solver_fp[lev], B_fp,
Idx.Bx, Idx.By, Idx.Bz, m_fill_guards_fields);
}

if (spectral_solver_cp[lev])
{
if (m_fields.has_vector(Efield_cp_string, lev)) {
ablastr::fields::VectorField E_cp = m_fields.get_alldirs(Efield_cp_string, lev);
ablastr::fields::VectorField const E_cp = m_fields.get_alldirs(Efield_cp_string, lev);
BackwardTransformVect(lev, *spectral_solver_cp[lev], E_cp,
Idx.Ex, Idx.Ey, Idx.Ez, m_fill_guards_fields);
}
if (m_fields.has_vector(Bfield_cp_string, lev)) {
ablastr::fields::VectorField B_cp = m_fields.get_alldirs(Bfield_cp_string, lev);
ablastr::fields::VectorField const B_cp = m_fields.get_alldirs(Bfield_cp_string, lev);
BackwardTransformVect(lev, *spectral_solver_cp[lev], B_cp,
Idx.Bx, Idx.By, Idx.Bz, m_fill_guards_fields);
}
Expand All @@ -175,8 +175,8 @@ void WarpX::PSATDBackwardTransformEB ()
for (int lev = 0; lev <= finest_level; ++lev)
{
if (m_fields.has_vector(Efield_fp_string, lev) && m_fields.has_vector(Bfield_fp_string, lev)) {
ablastr::fields::VectorField E_fp = m_fields.get_alldirs(Efield_fp_string, lev);
ablastr::fields::VectorField B_fp = m_fields.get_alldirs(Bfield_fp_string, lev);
ablastr::fields::VectorField const E_fp = m_fields.get_alldirs(Efield_fp_string, lev);
ablastr::fields::VectorField const B_fp = m_fields.get_alldirs(Bfield_fp_string, lev);
DampFieldsInGuards(lev, E_fp, B_fp);
}
}
Expand Down
2 changes: 1 addition & 1 deletion Source/ablastr/fields/MultiFabRegister.H
Original file line number Diff line number Diff line change
Expand Up @@ -291,7 +291,7 @@ namespace ablastr::fields
*/
[[nodiscard]] bool
has_vector (
std::string name,
std::string const & name,
int level
) const;

Expand Down
6 changes: 3 additions & 3 deletions Source/ablastr/fields/MultiFabRegister.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -331,15 +331,15 @@ namespace ablastr::fields

bool
MultiFabRegister::has_vector (
std::string name,
std::string const & name,
int level
) const
{
const std::vector<Direction> all_dirs = {Direction{0}, Direction{1}, Direction{2}};

int count = 0;
unsigned long count = 0;
for (const Direction& dir : all_dirs) {
std::string internal_name = mf_name(name, dir, level);
std::string const internal_name = mf_name(name, dir, level);
count += m_mf_register.count(internal_name);
}

Expand Down

0 comments on commit 54bdb71

Please sign in to comment.