Skip to content

Commit

Permalink
fix bug
Browse files Browse the repository at this point in the history
  • Loading branch information
RevathiJambunathan committed Oct 5, 2023
1 parent 0a230d7 commit 58cbfbe
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions Source/Initialization/WarpXInitData.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -785,7 +785,7 @@ WarpX::InitLevelData (int lev, Real /*time*/)

// Externally imposed fields are only initialized until the user-defined maxlevel_extEMfield_init.
// The default maxlevel_extEMfield_init value is the total number of levels in the simulation
if ( ( B_ext_grid_s == "constant" && (lev > maxlevel_extEMfield_init) )
if ( ( B_ext_grid_s == "constant" && (lev <= maxlevel_extEMfield_init) )
|| B_ext_grid_s == "default")
{
Bfield_fp[lev][i]->setVal(B_external_grid[i]);
Expand All @@ -803,7 +803,7 @@ WarpX::InitLevelData (int lev, Real /*time*/)
}
// Externally imposed fields are only initialized until the user-defined maxlevel_extEMfield_init.
// The default maxlevel_extEMfield_init value is the total number of levels in the simulation
if ( ( E_ext_grid_s == "constant" && (lev > maxlevel_extEMfield_init) )
if ( ( E_ext_grid_s == "constant" && (lev <= maxlevel_extEMfield_init) )
|| E_ext_grid_s == "default")
{
Efield_fp[lev][i]->setVal(E_external_grid[i]);
Expand All @@ -830,7 +830,7 @@ WarpX::InitLevelData (int lev, Real /*time*/)
// provided in the input file.
// Externally imposed fields are only initialized until the user-defined maxlevel_extEMfield_init.
// The default maxlevel_extEMfield_init value is the total number of levels in the simulation
if (B_ext_grid_s == "parse_b_ext_grid_function" && (lev > maxlevel_extEMfield_init)) {
if (B_ext_grid_s == "parse_b_ext_grid_function" && (lev <= maxlevel_extEMfield_init)) {

#ifdef WARPX_DIM_RZ
WARPX_ABORT_WITH_MESSAGE(
Expand Down Expand Up @@ -896,7 +896,7 @@ WarpX::InitLevelData (int lev, Real /*time*/)
// provided in the input file.
// Externally imposed fields are only initialized until the user-defined maxlevel_extEMfield_init.
// The default maxlevel_extEMfield_init value is the total number of levels in the simulation
if (E_ext_grid_s == "parse_e_ext_grid_function" && (lev > maxlevel_extEMfield_init)) {
if (E_ext_grid_s == "parse_e_ext_grid_function" && (lev <= maxlevel_extEMfield_init)) {

#ifdef WARPX_DIM_RZ
WARPX_ABORT_WITH_MESSAGE(
Expand Down

0 comments on commit 58cbfbe

Please sign in to comment.