import os from yade import pack dSnorm = 5000.0 #norm of the stress increment nbProbes = 36 #number of stress directions tested rampIte = 20 #nb iterations to increase the stress state until the final desired stress value stabIte = 5000 #nb iterations to stabilize sample after reaching the final stress value key='_probing_envelope_' stabilityThreshold=0.001 # leave it too low can have a super stable state, but will eat onion for waiting so long triax=TriaxialStressController() stickLoad=triax.strain[1] REC=TriaxialStateRecorder() # an array for saving stress increments and strain responses; arrays are in "numpy" extension import numpy probings=numpy.zeros((3,nbProbes)) def increment(dsr=0,dsa=1): # rampIte = 20 for ite in range(rampIte):# progressivaly increase of stress state O.run(20, True) #incrementation of stress state triax.goal2 = initSa+dsa/rampIte*ite triax.goal1 = triax.goal3 = initSr+dsr/rampIte*ite print triax.goal1, triax.goal2, '(stress value)' # fix the stress value for stabilization at the final state #REC.file=('WallStresses'+key2) triax.goal2 = initSa+dsa triax.goal1 = triax.goal3 = initSr+dsr while 1: O.run(100, True) unb=unbalancedForce() print 'unbalanced force:',unb,' strain: ',triax.strain O.save('checkpoint.xml') # reload this file to check if we see mistakes if unb