Skip to content

Commit

Permalink
[pre-commit.ci] auto fixes from pre-commit.com hooks
Browse files Browse the repository at this point in the history
for more information, see https://pre-commit.ci
  • Loading branch information
pre-commit-ci[bot] committed Sep 25, 2024
1 parent 344a3dd commit 18ae509
Show file tree
Hide file tree
Showing 5 changed files with 16 additions and 12 deletions.
2 changes: 2 additions & 0 deletions Python/pywarpx/fields.py
Original file line number Diff line number Diff line change
Expand Up @@ -703,6 +703,7 @@ def BzFPExternalWrapper(level=0, include_ghosts=False):
mf_name="Bfield_fp_external", idir=2, level=level, include_ghosts=include_ghosts
)


def ExHybridExternalWrapper(level=0, include_ghosts=False):
return _MultiFABWrapper(
mf_name="Efield_hyb_external[x]", level=level, include_ghosts=include_ghosts
Expand Down Expand Up @@ -738,6 +739,7 @@ def BzHybridExternalWrapper(level=0, include_ghosts=False):
mf_name="Bfield_hyb_external[z]", level=level, include_ghosts=include_ghosts
)


def JxFPWrapper(level=0, include_ghosts=False):
return _MultiFABWrapper(
mf_name="current_fp", idir=0, level=level, include_ghosts=include_ghosts
Expand Down
6 changes: 4 additions & 2 deletions Python/pywarpx/picmi.py
Original file line number Diff line number Diff line change
Expand Up @@ -1834,12 +1834,14 @@ def __init__(
self.By_external_function = By_expression
self.Bz_external_function = Bz_expression

if (Ex_expression is not None
if (
Ex_expression is not None
or Ey_expression is not None
or Ez_expression is not None
or Bx_expression is not None
or By_expression is not None
or Bz_expression is not None):
or Bz_expression is not None
):
self.add_external_fields = True

# Handle keyword arguments used in expressions
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
*
* Authors: Remi Lehe (LBNL)
* S. Eric Clark (Helion Energy)
*
*
* License: BSD-3-Clause-LBNL
*/

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ public:
const int ncomps,
const amrex::IntVect& ngJ,
const amrex::IntVect& ngRho,
const amrex::IntVect& ngE,
const amrex::IntVect& ngE,
const amrex::IntVect& ngB,
const amrex::IntVect& jx_nodal_flag,
const amrex::IntVect& jy_nodal_flag,
Expand Down Expand Up @@ -83,7 +83,7 @@ public:
warpx::fields::FieldType field_type,
std::array< amrex::ParserExecutor<4>, 3> const& expression,
int lev);

void GetExternalFieldFromExpression (
warpx::fields::FieldType field_type,
std::array< amrex::ParserExecutor<4>, 3> const& expression,
Expand Down
14 changes: 7 additions & 7 deletions Source/FieldSolver/WarpXPushFieldsHybridPIC.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ void WarpX::HybridPICEvolveFields ()

// Get requested number of substeps to use
const int sub_steps = m_hybrid_pic_model->m_substeps;

amrex::Real t_eval = gett_old(0);
amrex::Real sub_dt = 0.5_rt*dt[0]/sub_steps;

Expand All @@ -83,8 +83,8 @@ void WarpX::HybridPICEvolveFields ()
for (int idim = 0; idim < 3; ++idim) {
MultiFab::Subtract(
*m_fields.get(FieldType::Bfield_fp, Direction{idim}, lev),
*m_fields.get(FieldType::hybrid_B_fp_external, Direction{idim}, lev),
0, 0, 1,
*m_fields.get(FieldType::hybrid_B_fp_external, Direction{idim}, lev),
0, 0, 1,
m_fields.get(FieldType::hybrid_B_fp_external, Direction{idim}, lev)->nGrowVect());
}
}
Expand Down Expand Up @@ -217,13 +217,13 @@ void WarpX::HybridPICEvolveFields ()
for (int idim = 0; idim < 3; ++idim) {
MultiFab::Add(
*m_fields.get(FieldType::Bfield_fp, Direction{idim}, lev),
*m_fields.get(FieldType::hybrid_B_fp_external, Direction{idim}, lev),
0, 0, 1,
*m_fields.get(FieldType::hybrid_B_fp_external, Direction{idim}, lev),
0, 0, 1,
m_fields.get(FieldType::hybrid_B_fp_external, Direction{idim}, lev)->nGrowVect());
MultiFab::Add(
*m_fields.get(FieldType::Efield_fp, Direction{idim}, lev),
*m_fields.get(FieldType::hybrid_E_fp_external, Direction{idim}, lev),
0, 0, 1,
*m_fields.get(FieldType::hybrid_E_fp_external, Direction{idim}, lev),
0, 0, 1,
m_fields.get(FieldType::hybrid_E_fp_external, Direction{idim}, lev)->nGrowVect());
}
}
Expand Down

0 comments on commit 18ae509

Please sign in to comment.