~ubuntu-branches/ubuntu/trusty/yade/trusty

« back to all changes in this revision

Viewing changes to examples/concrete/uniax.py

  • Committer: Package Import Robot
  • Author(s): Anton Gladky, cf3f8d9
  • Date: 2013-10-30 20:56:33 UTC
  • mfrom: (20.1.9 sid)
  • Revision ID: package-import@ubuntu.com-20131030205633-1f01r7hjce17d723
Tags: 1.05.0-2
[cf3f8d9] Pass -ftrack-macro-expansion=0 only if gcc>=4.8. (Closes: #726009)

Show diffs side-by-side

added added

removed removed

Lines of Context:
74
74
# using spheres 7mm of diameter
75
75
concreteId=O.materials.append(CpmMat(young=young,frictionAngle=frictionAngle,poisson=poisson,density=4800,sigmaT=sigmaT,relDuctility=relDuctility,epsCrackOnset=epsCrackOnset,isoPrestress=isoPrestress))
76
76
 
77
 
spheres=pack.randomDensePack(pack.inHyperboloid((0,0,-.5*specimenLength),(0,0,.5*specimenLength),.25*specimenLength,.17*specimenLength),spheresInCell=2000,radius=sphereRadius,memoizeDb='/tmp/triaxPackCache.sqlite',material=concreteId)
78
 
#spheres=pack.randomDensePack(pack.inAlignedBox((-.25*specimenLength,-.25*specimenLength,-.5*specimenLength),(.25*specimenLength,.25*specimenLength,.5*specimenLength)),spheresInCell=2000,radius=sphereRadius,memoizeDb='/tmp/triaxPackCache.sqlite')
79
 
O.bodies.append(spheres)
 
77
sps=SpherePack()
 
78
sp=pack.randomDensePack(pack.inHyperboloid((0,0,-.5*specimenLength),(0,0,.5*specimenLength),.25*specimenLength,.17*specimenLength),spheresInCell=2000,radius=sphereRadius,memoizeDb='/tmp/triaxPackCache.sqlite',returnSpherePack=True)
 
79
#sp=pack.randomDensePack(pack.inAlignedBox((-.25*specimenLength,-.25*specimenLength,-.5*specimenLength),(.25*specimenLength,.25*specimenLength,.5*specimenLength)),spheresInCell=2000,radius=sphereRadius,memoizeDb='/tmp/triaxPackCache.sqlite',returnSpherePack=True)
 
80
sp.toSimulation(material=concreteId)
80
81
bb=uniaxialTestFeatures()
81
82
negIds,posIds,axis,crossSectionArea=bb['negIds'],bb['posIds'],bb['axis'],bb['area']
82
83
O.dt=dtSafety*PWaveTimeStep()
130
131
        O.step(); # to create initial contacts
131
132
        # now reset the interaction radius and go ahead
132
133
        ss2sc.interactionDetectionFactor=1.
133
 
        is2aabb.aabbEnlargeFactor=-1.
 
134
        is2aabb.aabbEnlargeFactor=1.
134
135
 
135
136
        O.run()
136
137
 
143
144
        if extremum==0: return
144
145
        # uncomment to get graph for the very first time stopIfDamaged() is called
145
146
        #eudoxos.estimatePoissonYoung(principalAxis=axis,stress=strainer.avgStress,plot=True,cutoff=0.3)
146
 
        print O.tags['id'],mode,strainer.strain,sigma[-1]
147
147
        import sys;     sys.stdout.flush()
148
148
        if abs(sigma[-1]/extremum)<minMaxRatio or abs(strainer.strain)>(5e-3 if isoPrestress==0 else 5e-2):
149
149
                if mode=='tension' and doModes & 2: # only if compression is enabled
163
163
                        title=O.tags['description'] if 'description' in O.tags.keys() else O.tags['params']
164
164
                        print 'gnuplot',plot.saveGnuplot(O.tags['id'],title=title)
165
165
                        print 'Bye.'
166
 
                        #O.pause()
167
 
                        sys.exit(0)
 
166
                        O.pause()
 
167
                        #sys.exit(0) # results in some threading exception
168
168
                
169
169
def addPlotData():
170
170
        yade.plot.addData({'t':O.time,'i':O.iter,'eps':strainer.strain,'sigma':strainer.avgStress+isoPrestress,