Skip to content

Commit

Permalink
add external fields after initial E solve
Browse files Browse the repository at this point in the history
Signed-off-by: roelof-groenewald <[email protected]>
  • Loading branch information
roelof-groenewald committed Aug 21, 2024
1 parent c58aa13 commit e9f518a
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions Source/Initialization/WarpXInitData.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -578,6 +578,11 @@ WarpX::InitData ()
if (electrostatic_solver_id == ElectrostaticSolverAlgo::LabFrameElectroMagnetostatic) {
ComputeMagnetostaticField();
}
// Add external fields to the fine patch fields. This makes it so that the
// net fields are the sum of the field solutions and any external fields.
for (int lev = 0; lev <= max_level; ++lev) {
AddExternalFields(lev);
}
}

if (restart_chkfile.empty() || write_diagnostics_on_restart) {
Expand Down Expand Up @@ -1013,8 +1018,6 @@ WarpX::InitLevelData (int lev, Real /*time*/)

// load external grid fields into E/Bfield_fp_external multifabs
LoadExternalFields(lev);
// add the external fields to the fine patch fields as initial conditions for the fields
AddExternalFields(lev);

if (costs[lev]) {
const auto iarr = costs[lev]->IndexArray();
Expand Down

0 comments on commit e9f518a

Please sign in to comment.