Skip to content

Commit

Permalink
Added Auto Run timer
Browse files Browse the repository at this point in the history
  • Loading branch information
andrewlhicks committed Dec 15, 2023
1 parent 0238c8c commit a4ba76d
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 1 deletion.
2 changes: 1 addition & 1 deletion q3d/misc.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ def elastic_constants(c : FromDict):
""" Taks constants FromDict object c, and checks if the constants
satisfy the proper inequalities to be deemed 'physical' """
if 0>=c.L1 or -c.L1>=c.L3 or c.L3>=2*c.L1 or -3/5*c.L1-1/10*c.L3>=c.L2:
pr.warning('L1, L2, and L3 do not satisfy the proper inequalities')
pr.warning('L1, L2, and L3 do not satisfy the proper inequalities', spaced=True)
def energy_decrease(times,energies):
for i in range(len(energies)-1):
change_in_energy = energies[i+1]-energies[i]
Expand Down
8 changes: 8 additions & 0 deletions scripts/qtensor3d
Original file line number Diff line number Diff line change
Expand Up @@ -180,6 +180,11 @@ def run(path, *, overwrite=False, supersessions={}):
def auto_run(path, *, overwrite=False, supersessions):
check_if_valid_save(path)

pr.info('Starting AUTO RUN', spaced=True)

timer_autorun = Timer()
timer_autorun.start()

# default supersessions given here, may be overriden on command line
supersessions['dt'] = supersessions.get('dt', 0.001)
supersessions['num-steps'] = supersessions.get('num-steps', 50)
Expand All @@ -202,6 +207,9 @@ def auto_run(path, *, overwrite=False, supersessions):
if completed == 'direct-solve': break
# turn off overwrite mode after iteration i == 0 is completed
overwrite = False

timer_autorun.stop()
pr.info(f'AUTO RUN completed in {timer_autorun.str_time}')

def main():
sys_argv = sys.argv[1:]
Expand Down

0 comments on commit a4ba76d

Please sign in to comment.