diff --git a/Python/pywarpx/fields.py b/Python/pywarpx/fields.py index 31dde3d8a4c..33b6329c9ca 100644 --- a/Python/pywarpx/fields.py +++ b/Python/pywarpx/fields.py @@ -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 @@ -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 diff --git a/Python/pywarpx/picmi.py b/Python/pywarpx/picmi.py index 390523cfd1e..fb9662510ce 100644 --- a/Python/pywarpx/picmi.py +++ b/Python/pywarpx/picmi.py @@ -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 diff --git a/Source/FieldSolver/FiniteDifferenceSolver/FiniteDifferenceSolver.H b/Source/FieldSolver/FiniteDifferenceSolver/FiniteDifferenceSolver.H index 488c73d84a0..11abeedf90a 100644 --- a/Source/FieldSolver/FiniteDifferenceSolver/FiniteDifferenceSolver.H +++ b/Source/FieldSolver/FiniteDifferenceSolver/FiniteDifferenceSolver.H @@ -4,7 +4,7 @@ * * Authors: Remi Lehe (LBNL) * S. Eric Clark (Helion Energy) - * + * * License: BSD-3-Clause-LBNL */ diff --git a/Source/FieldSolver/FiniteDifferenceSolver/HybridPICModel/HybridPICModel.H b/Source/FieldSolver/FiniteDifferenceSolver/HybridPICModel/HybridPICModel.H index 1b5ccd1bb74..3d8f1448612 100644 --- a/Source/FieldSolver/FiniteDifferenceSolver/HybridPICModel/HybridPICModel.H +++ b/Source/FieldSolver/FiniteDifferenceSolver/HybridPICModel/HybridPICModel.H @@ -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, @@ -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, diff --git a/Source/FieldSolver/WarpXPushFieldsHybridPIC.cpp b/Source/FieldSolver/WarpXPushFieldsHybridPIC.cpp index 15f94c30f81..29d8bebda40 100644 --- a/Source/FieldSolver/WarpXPushFieldsHybridPIC.cpp +++ b/Source/FieldSolver/WarpXPushFieldsHybridPIC.cpp @@ -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; @@ -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()); } } @@ -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()); } }