mode='compression' O.save('/tmp/uniax-tension.woo.gz') print "Saved /tmp/uniax-tension.woo.gz (for use with interaction-histogram.py and uniax-post.py)" print "Damaged, switching to compression... "; O.pause() # important! initTest must be launched in a separate thread; # otherwise O.load would wait for the iteration to finish, # but it would wait for initTest to return and deadlock would result import thread; thread.start_new_thread(initTest,()) return else: print "Damaged, stopping." ft,fc=max(sigma),min(sigma) print 'Strengths fc=%g, ft=%g, |fc/ft|=%g'%(fc,ft,abs(fc/ft)) title=O.tags['description'] if 'description' in O.tags.keys() else O.tags['params'] print 'gnuplot',plot.saveGnuplot(O.tags['id'],title=title) print 'Bye.' #O.pause() sys.exit(0) def addPlotData(): woo.plot.addData({'t':O.time,'i':O.iter,'eps':strainer.strain,'sigma':strainer.avgStress+isoPrestress, 'sigma.25':utils.forcesOnCoordPlane(coord_25,axis)[axis]/area_25+isoPrestress, 'sigma.50':utils.forcesOnCoordPlane(coord_50,axis)[axis]/area_50+isoPrestress, 'sigma.75':utils.forcesOnCoordPlane(coord_75,axis)[axis]/area_75+isoPrestress, }) plot.plot() O.run() initTest() utils.waitIfBatch()
import thread thread.start_new_thread(initTest, ()) return else: print "Damaged, stopping." ft, fc = max(sigma), min(sigma) print 'Strengths fc=%g, ft=%g, |fc/ft|=%g' % (fc, ft, abs(fc / ft)) title = O.tags['description'] if 'description' in O.tags.keys( ) else O.tags['params'] print 'gnuplot', plot.saveGnuplot(O.tags['id'], title=title) print 'Bye.' # O.pause() sys.exit(0) def addPlotData(): woo.plot.addData(t=O.time, i=O.iter, eps=strainer.strain[axis], eps_=strainer.strain[axis], sigma=strainer.stress[axis] + isoPrestress, eps1=strainer.strain[ax1], eps2=strainer.strain[ax2], sig1=strainer.stress[ax1], sig2=strainer.stress[ax2], relResid=updater.avgRelResidual) initTest() utils.waitIfBatch()