From 2c00044641882f35c70528b913a8d9efbb0a5336 Mon Sep 17 00:00:00 2001 From: Yinjian Zhao Date: Fri, 18 Nov 2022 10:54:54 -0700 Subject: Adding an if statement for the last step diagnostic (#3436) * modified * Include max_step and stop_time as input parameters * Add comments * update * update * Fix CI test: apply suggestion from @ax3l * Do not force consistency between `max_step` and `stop_time` Co-authored-by: Dave Grote Co-authored-by: Edoardo Zoni --- Python/pywarpx/picmi.py | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) (limited to 'Python/pywarpx/picmi.py') diff --git a/Python/pywarpx/picmi.py b/Python/pywarpx/picmi.py index 0d6eebf63..9399fd926 100644 --- a/Python/pywarpx/picmi.py +++ b/Python/pywarpx/picmi.py @@ -1586,16 +1586,11 @@ class Simulation(picmistandard.PICMI_Simulation): return self.warpx_initialized = True - pywarpx.warpx.init(mpi_comm) + pywarpx.warpx.init(mpi_comm, max_step=self.max_steps, stop_time=self.max_time) def write_input_file(self, file_name='inputs'): self.initialize_inputs() - kw = {} - if self.max_steps is not None: - kw['max_step'] = self.max_steps - if self.max_time is not None: - kw['stop_time'] = self.max_time - pywarpx.warpx.write_inputs(file_name, **kw) + pywarpx.warpx.write_inputs(file_name, max_step=self.max_steps, stop_time=self.max_time) def step(self, nsteps=None, mpi_comm=None): self.initialize_inputs() -- cgit v1.2.3