Skip to content

Commit

Permalink
Generalised the check damage for creep and tensile drivers
Browse files Browse the repository at this point in the history
  • Loading branch information
janzenchoi authored and reverendbedford committed Aug 18, 2023
1 parent 34a29b2 commit 4ae97ea
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions neml/drivers.py
Original file line number Diff line number Diff line change
Expand Up @@ -414,7 +414,8 @@ def uniaxial_test(model, erate, T = 300.0, emax = 0.05, nsteps = 250,
einc_guess = einc, ainc_guess = ainc)
except:
break
if driver.stored_int[-1][-2] > dtol:
damage = model.get_damage(driver.stored_int[-1])
if damage > dtol:
if check_dmg:
raise Exception("Damage check exceeded")
break
Expand Down Expand Up @@ -1329,7 +1330,8 @@ def creep(model, smax, srate, hold, T = 300.0, nsteps = 250,
break

if check_dmg:
if driver.stored_int[-1][0] > dtol:
damage = model.get_damage(driver.stored_int[-1])
if damage > dtol:
print("Damage exceeded limit...")
failed = True
break
Expand Down

0 comments on commit 4ae97ea

Please sign in to comment.