-
Notifications
You must be signed in to change notification settings - Fork 202
Add LabFrameParticleDiagnostic to picmi #4148
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
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change | ||||||||
---|---|---|---|---|---|---|---|---|---|---|
|
@@ -2188,7 +2188,10 @@ def initialize_inputs(self): | |||||||||
class LabFrameFieldDiagnostic(picmistandard.PICMI_LabFrameFieldDiagnostic, | ||||||||||
WarpXDiagnosticBase): | ||||||||||
""" | ||||||||||
See `Input Parameters <https://warpx.readthedocs.io/en/latest/usage/parameters.html>`_ for more information. | ||||||||||
See `Input Parameters <https://warpx.readthedocs.io/en/latest/usage/parameters.html#backtransformed-diagnostics>`_ | ||||||||||
for more information. | ||||||||||
|
||||||||||
This will by default write out both field and particle data. This can be changed by setting warpx_write_species. | ||||||||||
|
||||||||||
Parameters | ||||||||||
---------- | ||||||||||
|
@@ -2212,16 +2215,19 @@ class LabFrameFieldDiagnostic(picmistandard.PICMI_LabFrameFieldDiagnostic, | |||||||||
|
||||||||||
warpx_upper_bound: vector of floats, optional | ||||||||||
Passed to <diagnostic name>.upper_bound | ||||||||||
|
||||||||||
warpx_write_species: bool, optional, default=True | ||||||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. In PICMI, I think it makes more sense to turn them off by default...
Suggested change
|
||||||||||
Whether the species will also be written out. | ||||||||||
""" | ||||||||||
def init(self, kw): | ||||||||||
# The user is using the new BTD | ||||||||||
self.format = kw.pop('warpx_format', None) | ||||||||||
self.openpmd_backend = kw.pop('warpx_openpmd_backend', None) | ||||||||||
self.file_prefix = kw.pop('warpx_file_prefix', None) | ||||||||||
self.file_min_digits = kw.pop('warpx_file_min_digits', None) | ||||||||||
self.buffer_size = kw.pop('warpx_buffer_size', None) | ||||||||||
self.lower_bound = kw.pop('warpx_lower_bound', None) | ||||||||||
self.upper_bound = kw.pop('warpx_upper_bound', None) | ||||||||||
self.write_species = kw.pop('warpx_write_species', None) | ||||||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||||||
|
||||||||||
def initialize_inputs(self): | ||||||||||
|
||||||||||
|
@@ -2239,6 +2245,8 @@ def initialize_inputs(self): | |||||||||
self.diagnostic.dt_snapshots_lab = self.dt_snapshots | ||||||||||
self.diagnostic.buffer_size = self.buffer_size | ||||||||||
|
||||||||||
self.diagnostics.do_back_transformed_particles = self.write_species | ||||||||||
|
||||||||||
# --- Use a set to ensure that fields don't get repeated. | ||||||||||
fields_to_plot = set() | ||||||||||
|
||||||||||
|
@@ -2279,6 +2287,62 @@ def initialize_inputs(self): | |||||||||
|
||||||||||
self.set_write_dir() | ||||||||||
|
||||||||||
|
||||||||||
class LabFrameParticleDiagnostic(picmistandard.PICMI_LabFrameParticleDiagnostic, | ||||||||||
WarpXDiagnosticBase): | ||||||||||
""" | ||||||||||
See `Input Parameters <https://warpx.readthedocs.io/en/latest/usage/parameters.html#backtransformed-diagnostics>`_ | ||||||||||
for more information. | ||||||||||
|
||||||||||
This will by default write out both field and particle data. This can be changed by setting warpx_write_fields. | ||||||||||
Comment on lines
+2295
to
+2297
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||||||
|
||||||||||
Parameters | ||||||||||
---------- | ||||||||||
warpx_format: string, optional | ||||||||||
Passed to <diagnostic name>.format | ||||||||||
|
||||||||||
warpx_openpmd_backend: string, optional | ||||||||||
Passed to <diagnostic name>.openpmd_backend | ||||||||||
|
||||||||||
warpx_file_prefix: string, optional | ||||||||||
Passed to <diagnostic name>.file_prefix | ||||||||||
|
||||||||||
warpx_file_min_digits: integer, optional | ||||||||||
Passed to <diagnostic name>.file_min_digits | ||||||||||
|
||||||||||
warpx_buffer_size: integer, optional | ||||||||||
Passed to <diagnostic name>.buffer_size | ||||||||||
|
||||||||||
warpx_write_fields: bool, optional, default=True | ||||||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||||||
Whether the fields will also be written out. | ||||||||||
""" | ||||||||||
def init(self, kw): | ||||||||||
self.format = kw.pop('warpx_format', None) | ||||||||||
self.openpmd_backend = kw.pop('warpx_openpmd_backend', None) | ||||||||||
self.file_prefix = kw.pop('warpx_file_prefix', None) | ||||||||||
self.file_min_digits = kw.pop('warpx_file_min_digits', None) | ||||||||||
self.buffer_size = kw.pop('warpx_buffer_size', None) | ||||||||||
self.write_fields = kw.pop('warpx_write_fields', None) | ||||||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||||||
|
||||||||||
def initialize_inputs(self): | ||||||||||
|
||||||||||
self.add_diagnostic() | ||||||||||
|
||||||||||
self.diagnostic.diag_type = 'BackTransformed' | ||||||||||
self.diagnostic.format = self.format | ||||||||||
self.diagnostic.openpmd_backend = self.openpmd_backend | ||||||||||
self.diagnostic.file_min_digits = self.file_min_digits | ||||||||||
|
||||||||||
self.diagnostic.do_back_transformed_particles = 1 | ||||||||||
self.diagnostic.num_snapshots_lab = self.num_snapshots | ||||||||||
self.diagnostic.dt_snapshots_lab = self.dt_snapshots | ||||||||||
self.diagnostic.buffer_size = self.buffer_size | ||||||||||
|
||||||||||
self.diagnostics.do_back_transformed_fields = self.write_fields | ||||||||||
|
||||||||||
self.set_write_dir() | ||||||||||
|
||||||||||
|
||||||||||
class ReducedDiagnostic(picmistandard.base._ClassWithInit, WarpXDiagnosticBase): | ||||||||||
""" | ||||||||||
Sets up a reduced diagnostic in the simulation. | ||||||||||
|
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.