From 0c73e9baaefd26ef599e716966e492f115ff6415 Mon Sep 17 00:00:00 2001 From: Andrew Myers Date: Fri, 8 Oct 2021 11:25:47 -0700 Subject: 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 * add CI test for restarting particles with runtime-added attributes * remove unused module Co-authored-by: Axel Huebl --- Python/pywarpx/picmi.py | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'Python/pywarpx/picmi.py') 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): -- cgit v1.2.3