aboutsummaryrefslogtreecommitdiff
path: root/Python/pywarpx/picmi.py
diff options
context:
space:
mode:
authorGravatar Yinjian Zhao <yinjianzhao@lbl.gov> 2022-11-18 10:54:54 -0700
committerGravatar GitHub <noreply@github.com> 2022-11-18 09:54:54 -0800
commit2c00044641882f35c70528b913a8d9efbb0a5336 (patch)
treeea983955d3021f2796a90dfd6d6b18c367ca00dd /Python/pywarpx/picmi.py
parent4e9245e0e95fa268a4aa14ad9e2bbf2c59c24643 (diff)
downloadWarpX-2c00044641882f35c70528b913a8d9efbb0a5336.tar.gz
WarpX-2c00044641882f35c70528b913a8d9efbb0a5336.tar.zst
WarpX-2c00044641882f35c70528b913a8d9efbb0a5336.zip
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 <grote1@llnl.gov> Co-authored-by: Edoardo Zoni <ezoni@lbl.gov>
Diffstat (limited to 'Python/pywarpx/picmi.py')
-rw-r--r--Python/pywarpx/picmi.py9
1 files changed, 2 insertions, 7 deletions
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()