New question #268646 on Yade:
https://answers.launchpad.net/yade/+question/268646

Dear yade developers/users,

I have problem with VTK recorder. 

VTKRecorder(fileName='vtk/3d-vtk-',recorders=['all'],skipFacetIntr=False,iterPeriod=1000),

When I run the yade, it gives segmentation fault (core dumped) at 
iteration=1000. At iteration=0 it could generate vtkfiles.
Couple weeks back I did not have this problem, I tried to look for something 
that I missed in the script, I did not find any.
Anybody could help me with this.

Here is my script

from yade import export,pack,qt,plot

soilfric = 30
wallfric = 30
mn,mx=Vector3(0,0,0),Vector3(1,0.5,17) # corners of the initial packing

O.materials.append(FrictMat(density=2700,young=3e10,poisson=0.3,frictionAngle=radians(wallfric),label='walls'))
#O.bodies.append(utils.geom.facetBox((0.5,0.5,5.0),(0.5,0.5,5.0),wallMask=31,material='walls'))
O.bodies.append(utils.geom.facetBox((0.5,0.25,5.0),(0.5,0.25,5.0),wallMask=1,material='walls'))#-x
 left
O.bodies.append(utils.geom.facetBox((0.5,0.25,5.0),(0.5,0.25,5.0),wallMask=2,material='walls'))#+x
 right
O.bodies.append(utils.geom.facetBox((0.5,0.25,5.0),(0.5,0.25,5.0),wallMask=4,material='walls'))#-y
 front
O.bodies.append(utils.geom.facetBox((0.5,0.25,5.0),(0.5,0.25,5.0),wallMask=8,material='walls'))#+y
 back
O.bodies.append(utils.geom.facetBox((0.5,0.25,5.0),(0.5,0.25,5.0),wallMask=16,material='walls'))#-z
 back
O.materials.append(FrictMat(density=1800,young=3e8,poisson=0.2,frictionAngle=radians(soilfric),label="spheres"))

#O.materials.append(FrictMat(young=young,poisson=0.5,frictionAngle=radians(compFricDegree),density=1600,label='spheres'))#density
 is 1600 due to buoyancy, ie 2600-1000
#walls=aabbWalls([mn,mx],thickness=0,oversizeFactor=1.1,material='walls')
#walls=aabbWalls([mn,mx],thickness=0,material='walls')
#wallIds=O.bodies.append(walls)


#wall ids is from 0 to 9
sp=pack.SpherePack()
sp.makeCloud(mn,mx,rMean=.05,rRelFuzz=.0,seed=1)
sp.toSimulation(material='spheres')

O.engines=[
   ForceResetter(),
   InsertionSortCollider([Bo1_Sphere_Aabb(),Bo1_Facet_Aabb()]),
   InteractionLoop(
      [Ig2_Sphere_Sphere_L3Geom(),Ig2_Facet_Sphere_L3Geom()],
      [Ip2_FrictMat_FrictMat_FrictPhys()],
      [Law2_L3Geom_FrictPhys_ElPerfPl()]
   ),
   GravityEngine(gravity=(0,0,-9.81)),
   NewtonIntegrator(damping=0.1),
   
VTKRecorder(fileName='vtk/3d-vtk-',recorders=['all'],skipFacetIntr=False,iterPeriod=1000),
   PyRunner(command='checkUnbalanced()',iterPeriod=100),
   PyRunner(command='addPlotData()',iterPeriod=100)
]

#O.dt=.5*utils.PWaveTimeStep()
O.dt=1e-4
O.trackEnergy=True

#weightot = 0
#bid = 0
#for b in O.bodies:
  #if b.id<10:
    #rad = 0
  #else:
    #rad = b.shape.radius
    #bid = bid+1
  #vol = (1.3333333333333333333333333333333333333)*(rad*rad*rad)*(pi)
  #weight = 2e3 * vol*9.81
  #weightot =weight+weightot
  #print "bid = ",b.id," rad = ",rad, " vol = ",vol," mass = ",weight," 
weightot = ",weightot#," pos = ",O.bodies[b.id].state.pos

#def checkUnbalanced():
   #if utils.unbalancedForce()<.0001:
    #f = open("Output.txt", "w")
    #for b in O.bodies:
      #if b.id>9:
        #x = O.bodies[b.id].state.pos[0]
        #y = O.bodies[b.id].state.pos[1]
        #z = O.bodies[b.id].state.pos[2]
        #fx = O.forces.f(b.id)[0]
        #fy = O.forces.f(b.id)[1]
        #fz = O.forces.f(b.id)[2]
        #intr = O.bodies[b.id].intrs[2]  
        ##print "b.id =",b.id," xyz = ", O.bodies[b.id].state.pos, " fxyz = 
",O.forces.f(b.id)
        #print "b.id =",b.id," intr = ",intr
        #f.write('%i %f %f %f %f %f %f\n' %(b.id,x,y,z,fx,fy,fz))
    #f.close()
    #O.pause()

def checkUnbalanced():
  if utils.unbalancedForce()<.0001:
    f = open("Output.txt", "w")
    for i in O.interactions:
      if not i.isReal: continue
      cpx = i.geom.contactPoint[0]
      cpy = i.geom.contactPoint[1]
      cpz = i.geom.contactPoint[2]
      fnx = i.phys.normalForce[0]
      fny = i.phys.normalForce[1]
      fnz = i.phys.normalForce[2]
      fsx = i.phys.shearForce[0]
      fsy = i.phys.shearForce[1]
      fsz = i.phys.shearForce[2]
      #print "cpx = ",cpx,"cpy = ",cpy,"cpz = ",cpz," fnx = ",fnx," fny = 
",fny," fnz = ",fnz," fsx = ",fsx," fsy = ",fsy," fsz = ",fsz
      f.write('%f %f %f %f %f %f %f %f %f\n' 
%(cpx,cpy,cpz,fnx,fny,fnz,fsx,fsy,fsz))
    f.close()  
    O.save("simulation.xml.bz2")
    plot.saveDataTxt('history.txt')
    O.pause()

def addPlotData():
    Fbasez = O.forces.f(8)[2]+O.forces.f(9)[2]
    plot.addData(i=O.iter,unbalanced=utils.unbalancedForce(),Fbasez=Fbasez)
      
yade.qt.View();
plot.plots={'i':('Fbasez')}
plot.plot()
O.saveTmp()


Thank you so much
Best regards,

Alsidqi

-- 
You received this question notification because you are a member of
yade-users, which is an answer contact for Yade.

_______________________________________________
Mailing list: https://launchpad.net/~yade-users
Post to     : yade-users@lists.launchpad.net
Unsubscribe : https://launchpad.net/~yade-users
More help   : https://help.launchpad.net/ListHelp

Reply via email to