def addPlotData(): plot.addData(unbalanced=utils.unbalancedForce(),i=O.iter, sxx=triax.stress[0],syy=triax.stress[1],szz=triax.stress[2], exx=triax.strain[0],eyy=triax.strain[1],ezz=triax.strain[2], # save all available energy data Etot=O.energy.total(),**O.energy )
def myAddPlotData(): i = O.interactions[0, 1] ## store some numbers under some labels plot.addData(fn=i.phys.normalForce[0], step=O.iter, un=2 * s0.shape.radius - s1.state.pos[0] + s0.state.pos[0], kn=i.phys.kn)
def plotAddData(): plot.addData( iter=O.iter,iter_=O.iter, sx=p3d.stress[0],sy=p3d.stress[1],sz=p3d.stress[2], syz=p3d.stress[3],szx=p3d.stress[4],sxy=p3d.stress[5], ex=p3d.strain[0],ey=p3d.strain[1],ez=p3d.strain[2], eyz=p3d.strain[3],ezx=p3d.strain[4],exy=p3d.strain[5], )
def addPlotData(): try: i=O.interactions[FixedSphere.id,MovingSphere.id] plot.addData( Fn=i.phys.normalForce.norm(), un=(O.bodies[1].state.pos[1]-O.bodies[0].state.pos[1])-a ) #plot.saveGnuplot('net-2part-strain') except: print("No interaction!") O.pause()
def addPlotData(): try: i=O.interactions[FixedSphere.id,MovingSphere.id] plot.addData( Fn=i.phys.normalForce.norm(), un=(O.bodies[1].state.pos[1]-O.bodies[0].state.pos[1])-a ) #plot.saveGnuplot('net-2part-strain') except: print "No interaction!" O.pause()
def plotAddData(): plot.addData( progress=p3d.progress,progress_=p3d.progress, sx=p3d.stress[0],sy=p3d.stress[1],sz=p3d.stress[2], syz=p3d.stress[3],szx=p3d.stress[4],sxy=p3d.stress[5], ex=p3d.strain[0],ey=p3d.strain[1],ez=p3d.strain[2], eyz=p3d.strain[3],ezx=p3d.strain[4],exy=p3d.strain[5], )
def addPlotData(): i=O.interactions[0,1] plot.addData( un=tester.uTest[0],us1=tester.uTest[1],us2=tester.uTest[2], ung=tester.uGeom[0],us1g=tester.uGeom[1],us2g=tester.uGeom[2], phiX=tester.uTest[3],phiY=tester.uTest[4],phiZ=tester.uTest[5], phiXg=tester.uGeom[3],phiYg=tester.uGeom[4],phiZg=tester.uGeom[5], i=O.iter,Fs=i.phys.shearForce.norm(),Fn=i.phys.normalForce.norm(),Tx=O.forces.t(0)[0],Tyz=sqrt(O.forces.t(0)[1]**2+O.forces.t(0)[2]**2) )
def addData(): # get the stress tensor (as 3x3 matrix) stress=sum(utils.normalShearStressTensors(),Matrix3.Zero) # give names to values we are interested in and save them plot.addData(exz=O.cell.trsf[0,2],szz=stress[2,2],sxz=stress[0,2],tanPhi=stress[0,2]/stress[2,2],i=O.iter) # color particles based on rotation amount for b in O.bodies: # rot() gives rotation vector between reference and current position b.shape.color=utils.scalarOnColorScale(b.state.rot().norm(),0,pi/2.)
def addPlotData(): if O.iter < 1: plot.addData( Fn=0., un=0. ) #plot.saveGnuplot('net-2part-displ-unloading') else: try: i=O.interactions[FixedSphere.id,MovingSphere.id] plot.addData( Fn=i.phys.normalForce.norm(), un=(O.bodies[1].state.pos[1]-O.bodies[0].state.pos[1])-a ) #plot.saveGnuplot('net-2part-displ-unloading') except: print("No interaction!") O.pause()
def addPlotData(): if O.iter < 1: plot.addData(Fn=0., un=0.) #plot.saveGnuplot('net-2part-displ-unloading') else: try: i = O.interactions[FixedSphere.id, MovingSphere.id] plot.addData( Fn=i.phys.normalForce.norm(), un=(O.bodies[1].state.pos[1] - O.bodies[0].state.pos[1]) - a) #plot.saveGnuplot('net-2part-displ-unloading') except: print("No interaction!") O.pause()
def plotData(): allData={} # gather same data for both configurations, suffix their labels with -DD/-Sc for i,key,sphere in zip([i1,i2],['-DD','-Sc'],[1,3]): data=dict( zRot=O.bodies[sphere].state.ori.toAxisAngle()[1], zShift=O.bodies[sphere].state.pos[2], epsT=i.phys.epsT.norm() if key=='-Sc' else i.geom.strainT().norm(), Ft=i.phys.shearForce.norm(), epsN=i.phys.epsN, epsPlSum=i.phys.epsPlSum, relResStr=i.phys.relResidualStrength, dist=(O.bodies[i.id1].state.pos-O.bodies[i.id2].state.pos).norm(), sigmaT=i.phys.sigmaT.norm() ) for k in data: allData[k+key]=data[k] plot.addData(allData)
def plotAddData(): plot.addData( progress=p3d.progress, progress_=p3d.progress, sx=p3d.stress[0], sy=p3d.stress[1], sz=p3d.stress[2], syz=p3d.stress[3], szx=p3d.stress[4], sxy=p3d.stress[5], ex=p3d.strain[0], ey=p3d.strain[1], ez=p3d.strain[2], eyz=p3d.strain[3], ezx=p3d.strain[4], exy=p3d.strain[5], )
def addPlotData(): if not isinstance(O.bodies[-1].shape,Wall): plot.addData(); return Fz=O.forces.f(plate.id)[2] plot.addData(Fz=Fz,w=plate.state.pos[2]-plate.state.refPos[2],unbalanced=utils.unbalancedForce(),i=O.iter)
def addPlotData(): # each item is given a names, by which it can be the unsed in plot.plots # the **O.energy converts dictionary-like O.energy to plot.addData arguments plot.addData(i=O.iter,unbalanced=utils.unbalancedForce(),**O.energy)
def history(): plot.addData(pos1=O.bodies[0].state.pos[1], vel1=O.bodies[0].state.vel[1], t=O.time) # potential elastic energy
def myAddPlotData(): yp.addData(t=O.time, F_applied=forcer.force[2], supportReaction=O.forces.f(0)[2])
def myAddPlotData(): yp.addData(t=O.time,F_applied=forcer.force[2],supportReaction=O.forces.f(0)[2])
def addPlotData(): plot.addData(sx=triax.stress[0],sy=triax.stress[1],sz=triax.stress[2],ex=triax.strain[0],ey=triax.strain[1],ez=triax.strain[2], i=O.iter,unbalanced=utils.unbalancedForce(), totalEnergy=O.energy.total(),**O.energy # plot all energies )
O.engines=[ ForceResetter(), InsertionSortCollider([Bo1_Sphere_Aabb(),Bo1_Wall_Aabb()]), ContactLoop( [Cg2_Sphere_Sphere_L6Geom(),Cg2_Wall_Sphere_L3Geom], [Cp2_FrictMat_FrictPhys(frictAngle=table.frictAngle)], [Law2_L6Geom_ElPerfPl()] ), IntraForce( GravityEngine(gravity=(0,0,-9.81)), NewtonIntegrator(damping=table.nonviscDamp,kinSplit=True), PyRunner(iterPeriod=1,command='addPlotData()'), ] O.dt=.1*utils.PWaveTimeStep() def addPlotData(): Ek,maxId=utils.kineticEnergy(findMaxId=True) plot.addData(i=O.iter,total=O.energy.total(),maxId=maxId,**O.energy) # turn on energy tracking O.trackEnergy=True O.saveTmp() # the callable should return list of strings, plots will be updated automatically plot.plots={'i':[O.energy.keys,None,'total']} #from woo import timing #O.timingEnabled=True #timing.stats() plot.plot(subPlots=True)
def history(): plot.addData( pos1=O.bodies[0].state.pos[1], # potential elastic energy vel1=O.bodies[0].state.vel[1], t=O.time)
def myAddPlotData(): i=O.interactions[0,1] ## store some numbers under some labels plot.addData(fn=i.phys.normalForce[0],step=O.iter,un=2*s0.shape.radius-s1.state.pos[0]+s0.state.pos[0],kn=i.phys.kn)