-
Notifications
You must be signed in to change notification settings - Fork 182
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[WIP] Add ability to load external particle fields from file #4981
Conversation
a8cf667
to
fd28932
Compare
// TODO reuse WarpX::AddExternalFields | ||
// TODO replace fp_external with simply external | ||
for (int lev = 0; lev <= finest_level; ++lev) { | ||
// FIXME: RZ multimode has more than one component for all these |
Check notice
Code scanning / CodeQL
FIXME comment Note
const amrex::IntVect& ng_src = guard_cells.ng_FieldGather; | ||
|
||
// Level 0: Copy from fine to aux | ||
// TODO Check if aux and fp are aliases of each other. If so, we can skip the copy. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not needed anymore after this PR is merged:
AMReX-Codes/amrex#3986
MultiFab::Copy(*Efield_aux[0][2], *Efield_fp[0][2], 0, 0, Efield_aux[0][2]->nComp(), ng_src); | ||
MultiFab::Copy(*Bfield_aux[0][0], *Bfield_fp[0][0], 0, 0, Bfield_aux[0][0]->nComp(), ng_src); | ||
MultiFab::Copy(*Bfield_aux[0][1], *Bfield_fp[0][1], 0, 0, Bfield_aux[0][1]->nComp(), ng_src); | ||
MultiFab::Copy(*Bfield_aux[0][2], *Bfield_fp[0][2], 0, 0, Bfield_aux[0][2]->nComp(), ng_src); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Here, we need to check whether WarpX::fft_do_time_averaging
is true. If yes,
MultiFab::Copy(*Bfield_aux[0][0], *Bfield_avg_fp[0][0], 0, 0, Bfield_aux[0][0]->nComp(), ng_src);
and otherwise, keep this code
Super-seeded by #4997 |
We currently have the ability to load an external grid field from a file (thanks to #3584).
This PR provide a similar ability for the external particle fields.
The external grid and particle fields differ e.g. in the case of the EM solver:
t=0
and serve as initial condition to the Maxwell solver.TODO:
aux
. This means that this will automatically work with all other modules that gather the fields: particle push, ionization routine, etc.