diff --git a/mod_config_2d.py b/mod_config_2d.py index e8e423b..4ac7802 100644 --- a/mod_config_2d.py +++ b/mod_config_2d.py @@ -73,7 +73,8 @@ plot_anim=False, # plot animation load_data=False, # load data from a file save_data=True, # save data to a file - data_folder='data/simul', # folder for data files + data_folder='data/simul', # folder for data files + output_file='schrodinger_2d.png', # output file name animation_format='mp4', # animation format (mp4 or gif) verbose=True ) diff --git a/schrodinger_2d.py b/schrodinger_2d.py index 2e982e7..2c4eff3 100644 --- a/schrodinger_2d.py +++ b/schrodinger_2d.py @@ -261,14 +261,15 @@ def compute(self): if perc // 10 > self.perc // 10: self.perc = perc elapsed_time = time.time() - self.start_time + current_time = time.strftime("%H:%M:%S", time.localtime()) if elapsed_time >= 3600: formatted_time = time.strftime( "%H:%M:%S", time.gmtime(elapsed_time)) else: formatted_time = time.strftime( "%M:%S", time.gmtime(elapsed_time)) - print(f"completed {int(perc)}% of the computation, " - f"elapsed {formatted_time}") + print(f"completed {int(perc)}% of the animation, " + f"elapsed {formatted_time} [{current_time}]") def __init_plot(self): plot_psi = self.psi_plot[0] @@ -390,6 +391,7 @@ def __animate_frame(self, frame, is_animation=True): if perc // 10 > self.perc // 10: self.perc = perc elapsed_time = time.time() - self.start_time + current_time = time.strftime("%H:%M:%S", time.localtime()) if elapsed_time >= 3600: formatted_time = time.strftime( "%H:%M:%S", time.gmtime(elapsed_time)) @@ -397,7 +399,7 @@ def __animate_frame(self, frame, is_animation=True): formatted_time = time.strftime( "%M:%S", time.gmtime(elapsed_time)) print(f"completed {int(perc)}% of the animation, " - f"elapsed {formatted_time}") + f"elapsed {formatted_time} [{current_time}]") return self.img, @@ -527,7 +529,7 @@ def main(): tmp_dir = os.path.join(script_dir, 'tmp') if not os.path.exists(tmp_dir): os.makedirs(tmp_dir) - ofile = tmp_dir + "/schrodinger_2d.png" + ofile = tmp_dir + "/" + cfg.output_file make_plot(ofile)