Question #680662 on Yade changed:
https://answers.launchpad.net/yade/+question/680662

gaoxuesong posted a new comment:
Hi, Jan. Yes, you are right. I have tried the above code and no segment fault 
occurred. Then I add some lines which i thought were unimportant in the past 
and the problems happened at about 341300 iteration. As you suggested, i leave 
the snap and VTK code out. Also, to make the crash easy to happen, i amplify 
the density by a small factor as 1e3. 
The following is the code, 

from yade import geom,pack
import math
from yade import qt
import os 

#os.system('rm -rf plt;mkdir ./plt/')
#os.system('rm -rf out;mkdir ./out/')

# PhysicalParameters
muS = 0.57735   # Friction coefficient (30 degree)
muLB = 0.0001   # Friction coefficient
muF = 0.17632   # Friction coefficient (10 degree)
FricAngleS = math.atan(muS)
FricAngleLB = math.atan(muLB)
FricAngleF = math.atan(muF)

### mass amplification factor ### 
masscof = 1e3       


# PhysicalParameters
matSph = CohFrictMat(
 density = 7990*masscof,
 young = 193e9,
 poisson = 0.3,
 frictionAngle = FricAngleS,
 momentRotationLaw = True)
SMat = O.materials.append(matSph)


# create empty sphere packing
sp = pack.SpherePack()
# generate spheres1 with a certain diameter distribution
sp.makeCloud((0,0,0.35e-3), (1.0e-3,1.0e-3,1.4e-3), 
psdSizes=[0.012e-3,0.0186e-3,0.0312e-3,0.0484e-3,0.053e-3], 
psdCumm=[0,0.1,0.5,0.9,1.0])
# add the sphere pack to the simulation
sp.toSimulation(material=SMat)

# create rectangular box1(Left) from facets
O.bodies.append(geom.facetBox((0.5e-3,0.5e-3,0.5e-3),(0.5e-3,0.5e-3,0.5e-3), 
wallMask=31, material=SMat))
Cylinder1IDs=O.bodies.append(geom.facetBox((0.5e-3,0.5e-3,0.15e-3),(0.5e-3,0.5e-3,0.2e-3),
 wallMask=63, color=(0,1,0), wire=False, material=SMat))

################## add these lines, problem happens #####################
################## add these lines, problem happens #####################

def changeValues():

#  Standstill for stabilization
   if O.time < 0.2:
       O.engines = O.engines + [
               TranslationEngine(dead=False, translationAxis= [0,0,1], 
velocity=0.0, ids=Cylinder1IDs)
   ]
       #  Vibrate Piston1
   elif 0.2 <= O.time < 0.4:
       O.engines = O.engines + [
               HarmonicMotionEngine(A=(0.0,0.0,1.5e-5), f=(0.0,0.0,3600/60.0), 
ids=Cylinder1IDs)
   ]
#  Vibrate Stop
   elif 0.4 <= O.time < 0.5129:
       O.engines = O.engines + [
               HarmonicMotionEngine(A=(0.0,0.0,0.0), f=(0.0,0.0,0.0), 
ids=Cylinder1IDs)
   ]
     
   O.dt = 0.85*utils.PWaveTimeStep()    

################## add these lines, problem happens #####################
################## add these lines, problem happens #####################


def print_ite():
    print("ite is %d" % O.iter)
         
O.engines=[
        ForceResetter(),
        InsertionSortCollider([Bo1_Sphere_Aabb(),Bo1_Facet_Aabb()]),
        InteractionLoop(
        # handle sphere+sphere and facet+sphere collisions
           [Ig2_Sphere_Sphere_ScGeom6D(),Ig2_Facet_Sphere_ScGeom6D()],
           [Ip2_CohFrictMat_CohFrictMat_CohFrictPhys()],
           [Law2_ScGeom6D_CohFrictPhys_CohesionMoment()]
        ),
        NewtonIntegrator(damping=0.75, exactAsphericalRot=True, 
gravity=(0,0,-9.81)),
     PyRunner(iterPeriod=100,command='changeValues()'),
    PyRunner(iterPeriod=100,command='print_ite()'),
#    qt.SnapshotEngine(fileBase="./plt/",iterPeriod=200,label='snapshot'),
#       VTKRecorder(iterPeriod=200, recorders=['spheres','colors'], 
fileName='./out/'),
]

#show geometry:
qtr = qt.Renderer()
qtr.bgColor = [1,1,1]
qt.Controller()
v = qt.View() 
#v.center() 
v.axes=False
v.viewDir=Vector3(0,1,0)
v.eyePosition=Vector3(1.8e-3,-5.2e-3,1.0e-3)

O.run()

-- 
You received this question notification because your team yade-users 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