diff options
author | 2021-10-08 11:25:47 -0700 | |
---|---|---|
committer | 2021-10-08 11:25:47 -0700 | |
commit | 0c73e9baaefd26ef599e716966e492f115ff6415 (patch) | |
tree | 7eaa2a32a0b26fbce25c0ec1ccb3cda6b18a7698 /Python/pywarpx/picmi.py | |
parent | a822c928e215a83243b8da25f7e6f1b342c96179 (diff) | |
download | WarpX-0c73e9baaefd26ef599e716966e492f115ff6415.tar.gz WarpX-0c73e9baaefd26ef599e716966e492f115ff6415.tar.zst WarpX-0c73e9baaefd26ef599e716966e492f115ff6415.zip |
Fix checkpoint with runtime components through the Python interface. (#2332)
* add component names to checkpoint
* read in particle components and add the missing ones on restart
* do not add components if one by the name already exists
* sign error
* Better warning messages
* Update Source/Diagnostics/ParticleIO.cpp
Co-authored-by: Axel Huebl <axel.huebl@plasma.ninja>
* add CI test for restarting particles with runtime-added attributes
* remove unused module
Co-authored-by: Axel Huebl <axel.huebl@plasma.ninja>
Diffstat (limited to 'Python/pywarpx/picmi.py')
-rw-r--r-- | Python/pywarpx/picmi.py | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/Python/pywarpx/picmi.py b/Python/pywarpx/picmi.py index e4f0b8651..374cbc962 100644 --- a/Python/pywarpx/picmi.py +++ b/Python/pywarpx/picmi.py @@ -1064,6 +1064,7 @@ class Checkpoint(picmistandard.base._ClassWithInit): self.period = period self.write_dir = write_dir + self.file_prefix = kw.pop('warpx_file_prefix', None) self.name = name if self.name is None: @@ -1083,6 +1084,10 @@ class Checkpoint(picmistandard.base._ClassWithInit): self.diagnostic.diag_type = 'Full' self.diagnostic.format = 'checkpoint' + if self.write_dir is not None or self.file_prefix is not None: + write_dir = (self.write_dir or 'diags') + file_prefix = (self.file_prefix or self.name) + self.diagnostic.file_prefix = write_dir + '/' + file_prefix class ParticleDiagnostic(picmistandard.PICMI_ParticleDiagnostic): def init(self, kw): |