Skip to content

Commit

Permalink
Fix storing of ii1, ii2 to save-file
Browse files Browse the repository at this point in the history
  • Loading branch information
holm10 authored Sep 19, 2023
1 parent ce9ece5 commit 013d23f
Showing 1 changed file with 15 additions and 25 deletions.
40 changes: 15 additions & 25 deletions pyscripts/rundt.py
Original file line number Diff line number Diff line change
Expand Up @@ -395,7 +395,7 @@ def converge(self, dtreal=2e-9, ii1max=5000, ii2max=5, itermx=7, ftol=1e-5,
dt_kill=1e-14, t_stop=100, dt_max=100, ftol_min = 1e-9, incpset=7,
n_stor=0, storedist='lin', numrevjmax=2, numfwdjmax=1, numtotjmax=0,
tstor=(1e-3, 4e-2), ismfnkauto=True, dtmfnk3=5e-4, mult_dt=3.4,
reset=True, initjac=False, rdtphidtr=1e20, deldt_min=0.04, rlx=0.9,
reset=True, initjac=True, rdtphidtr=1e20, deldt_min=0.04, rlx=0.9,

tsnapshot=None, savedir='../solutions', ii2increase=0, savefname=None,
message=None):
Expand Down Expand Up @@ -606,21 +606,17 @@ def calc_fnrm():
if message is not None:
print(message)
# Take timestep and see if abort requested
try:
if self.exmain_isaborted(self):
return
except:
if self.exmain_isaborted():
return
if self.exmain_isaborted():
return
# Increase time
# Verify time-step was successful
if (bbb.iterm != 1):
try:
self.restorevalues(self)
except:
self.restorevalues()
self.message('Error: converge an initial time-step first; then ' + \
're-execute command', seppad='*')
self.message('Error: converge an initial time-step first; '
'then re-execute command', seppad='*')
return
bbb.incpset = incpset
bbb.itermx = itermx
Expand Down Expand Up @@ -696,14 +692,11 @@ def calc_fnrm():
# Take timestep and see if abort requested
if message is not None:
print(message)
try :
if self.exmain_isaborted(self):
return
except:
if self.exmain_isaborted():
return
self.classvars['ii1'].append(ii1)
self.classvars['ii2'].append(ii2)
if self.exmain_isaborted():
return
if bbb.iterm == 1:
self.classvars['ii1'].append(ii1)
self.classvars['ii2'].append(ii2)
if issuccess(self, t_stop, ftol_min, savefname):
return
bbb.icntnunk = 2
Expand All @@ -722,14 +715,11 @@ def calc_fnrm():
separator='')
if message is not None:
print(message)
try:
if self.exmain_isaborted(self):
return
except:
if self.exmain_isaborted():
return
self.classvars['ii1'].append(ii1)
self.classvars['ii2'].append(ii2)
if self.exmain_isaborted():
return
if bbb.iterm == 1:
self.classvars['ii1'].append(ii1)
self.classvars['ii2'].append(ii2)
if issuccess(self, t_stop, ftol_min, savefname):
return
self.message("Total time = {:.4E}; Timestep = {:.4E}".format(\
Expand Down

0 comments on commit 013d23f

Please sign in to comment.