Skip to content
This repository was archived by the owner on Aug 28, 2024. It is now read-only.

Commit

Permalink
Browse files Browse the repository at this point in the history
Added helpful messages when using initial_conditions_from_bin method
  • Loading branch information
daminton committed Sep 8, 2022
1 parent 09a700e commit cce040f
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions python/swiftest/swiftest/simulation_class.py
Original file line number Diff line number Diff line change
Expand Up @@ -263,6 +263,7 @@ def initial_conditions_from_bin(self, framenum=-1, new_param=None, new_param_fil
new_param['BIN_OUT'] = os.path.basename(self.param['BIN_OUT'])
else:
if restart:
print(f"Restart run with new output file. Copying {self.param['BIN_OUT']} to {new_bin_out_file}")
shutil.copy2(self.param['BIN_OUT'],new_bin_out_file)
new_param['BIN_OUT'] = new_bin_out_file
new_param['IN_FORM'] = 'XV'
Expand All @@ -273,7 +274,9 @@ def initial_conditions_from_bin(self, framenum=-1, new_param=None, new_param_fil
new_param.pop('PL_IN', None)
new_param.pop('TP_IN', None)
new_param.pop('CB_IN', None)
print(f"Extracting data from dataset at time frame number {framenum} and saving it to {new_param['NC_IN']}")
io.swiftest_xr2infile(self.ds, new_param)
print(f"Saving parameter configuration file to {new_param_file}")
self.write_param(new_param_file, param=new_param)

return

0 comments on commit cce040f

Please sign in to comment.