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

Commit

Permalink
Added energy and momentum tracking to progress bar output. This is a …
Browse files Browse the repository at this point in the history
…stop-gap until a more complete progress display can be made
  • Loading branch information
daminton committed Nov 29, 2022
1 parent 7160274 commit dd2c535
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 144 deletions.
47 changes: 0 additions & 47 deletions examples/Fragmentation/param.disruption_headon.in

This file was deleted.

47 changes: 0 additions & 47 deletions examples/Fragmentation/param.hitandrun.in

This file was deleted.

47 changes: 0 additions & 47 deletions examples/Fragmentation/param.supercatastrophic_off_axis.in

This file was deleted.

10 changes: 7 additions & 3 deletions python/swiftest/swiftest/simulation_class.py
Original file line number Diff line number Diff line change
Expand Up @@ -386,6 +386,8 @@ def _type_scrub(output_data):
post_message = f"npl: {self.data['npl'].values[0]} ntp: {self.data['ntp'].values[0]}"
if "nplm" in self.data:
post_message += f" nplm: {self.data['nplm'].values[0]}"
if self.param['ENERGY']:
post_message += f" dL/L0: {0.0:.5e} dE/|E0|: {0.0:.5e}"
pbar = tqdm(total=noutput, desc=pre_message, postfix=post_message, bar_format='{l_bar}{bar}{postfix}')
try:
with subprocess.Popen(shlex.split(cmd),
Expand All @@ -405,6 +407,10 @@ def _type_scrub(output_data):
post_message = f" npl: {output_data['NPL']} ntp: {output_data['NTP']}"
if "NPLM" in output_data:
post_message += f" nplm: {output_data['NPLM']}"
if "LTOTERR" in output_data:
post_message += f" dL/L0: {output_data['LTOTERR']:.5e}"
if "ETOTERR" in output_data:
post_message += f" dE/|E0|: {output_data['ETOTERR']:.5e}"
interval = output_data['ILOOP'] - iloop
if interval > 0:
pbar.update(interval)
Expand Down Expand Up @@ -745,7 +751,7 @@ def set_parameter(self, verbose: bool = True, **kwargs):
"general_relativity": True,
"fragmentation": False,
"minimum_fragment_mass": None,
"minimum_fragment_gmass": None,
"minimum_fragment_gmass": 0.0,
"rotation": False,
"compute_conservation_values": False,
"extra_force": False,
Expand Down Expand Up @@ -782,8 +788,6 @@ def set_parameter(self, verbose: bool = True, **kwargs):
# Add the verbose flag to the kwargs for passing down to the individual setters
kwargs["verbose"] = verbose



# Setters returning parameter dictionary values
param_dict = {}
param_dict.update(self.set_unit_system(**kwargs))
Expand Down

0 comments on commit dd2c535

Please sign in to comment.