Skip to content

Commit

Permalink
Merge pull request #137 from RevathiJambunathan/HarrisSheetAddInitMax…
Browse files Browse the repository at this point in the history
…LevforPerturbationInit

Add max level for perbutaiton init and managed memory assertion
  • Loading branch information
RevathiJambunathan authored Jan 25, 2024
2 parents f4be661 + c8fa916 commit ab2e359
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion Source/Initialization/WarpXInitData.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -882,8 +882,16 @@ WarpX::InitLevelData (int lev, Real /*time*/)
}
int IncludeBfieldPerturbation = 0;
pp_warpx.query("IncludeBfieldPerturbation",IncludeBfieldPerturbation);
if (IncludeBfieldPerturbation == 1) {
if ( (IncludeBfieldPerturbation == 1) && (lev <= maxlevel_extEMfield_init) ) {
#ifndef WARPX_DIM_RZ
amrex::ParmParse pp_amrex("amrex");
int arena_is_managed = 0;
pp_amrex.query("the_arena_is_managed",arena_is_managed);
#ifdef AMREX_USE_GPU
WARPX_ALWAYS_ASSERT_WITH_MESSAGE(arena_is_managed == 1,
"For reconnection simulations with perturbation, managed memory should be used with amrex.the_arena_is_managed=1\n");

#endif
Reconnection_Perturbation::AddBfieldPerturbation (Bfield_fp[lev][0].get(),
Bfield_fp[lev][1].get(),
Bfield_fp[lev][2].get(),
Expand Down

0 comments on commit ab2e359

Please sign in to comment.