Align openPMD field diagnostic with what pywarpx.picmi.LoadInitialField expects #5668
Labels
component: electrostatic
electrostatic solver
component: Python
Python layer
enhancement
New feature or request
I'm using the PICMI interface. I have a need to freeze the electrostatic fields in a WarpX run, because they aren't changing much and the Poisson solve is too expensive. There are a few ways to do this:
Option 1) output an openPMD field diagnostic, then read it in as an applied field using
pywarpx.picmi.LoadInitialField
Option 2) come up with an analytic fit of the fields, then impose applied fields using
pywarpx.picmi.AnalyticAppliedField
Option 3) ask the electrostatic solver to update rarely
Option 1 is potentially the most convenient, as one could e.g. time-average the fields before reading them in as an applied field. I tried Option 1, but
pywarpx.picmi.LoadInitialField
does not accept the structure of the field diagnostic. E.g. it expects axis labels to be orderedx, y, z
, whereas the field diagnostic is ordered in reverse. I tried to perform surgery on the openPMD file by reshaping the data to align with the expected order, but then another problem occurs (missing 'position' attribute). So it looks like option 1 is quite awkward and error-prone because it seems to require manual surgery of the field diagnostic output.Option 2 is a lengthy process, and thus not suitable if one needs to repeatedly redo this procedure.
Option 3, to my knowledge, is not an available functionality. It would be very easy, but would preclude modifying the field (e.g. by applying a time average).
It seems to me that Option 1 should be the intended usage of
pywarpx.picmi.LoadInitialField
, but it doesn't work. So this feature request is to align the field diagnostic with whatpywarpx.picmi.LoadInitialField
expects.Let me know if I'm missing something.
Thanks!
The text was updated successfully, but these errors were encountered: