← Back to team overview

yade-users team mailing list archive

Re: [Question #242887]: Load/Save issue with periodic boundaries

 

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

Description changed to:
Hi,

I am currently trying to set up a simulation for a periodic hopper.
I have encountered something strange when saving and loading the simulation to file.
After loading the system some of the particles start passing through the facets of the hopper and the box below it.

Some notes:
 - I've tried two types of material, FrictMat and ViscElMat, both exhibit this behaviour.
- Time step size doesn't seem to affect this.
- This only occurs when the system is periodic.
- I'm using Yade trunk from 22 Jan [b32e7e5bd8b410a00f7fd2891bdd0cb75fe121fb]

Example code follows: [see also
https://www.dropbox.com/s/qa78q19owrt16ai/load-save-periodic.py]

###############################################################################
from yade import pack,export,qt
		
sphRad=0.01; 
gravity = 10
w=20.*2.*sphRad; b=8.*2.*sphRad; h=20.*2.*sphRad; g=sphRad*2.*6.;
x0=0.; y0=w; z0=h; 

		
hopperheight = h		
hopperTopPts = [Vector3(x0,y0-w/2.,z0),
				Vector3(x0+b,y0-w/2.,z0),
				Vector3(x0+b,y0+w+w/2.,z0),
				Vector3(x0,y0+w+w/2.,z0),
				Vector3(x0,y0-w/2.,z0)]
hopperBottomPts = [Vector3(x0,y0+w/2.-g,4*z0/10.),
				   Vector3(x0+b,y0+w/2.-g,4*z0/10.),
				   Vector3(x0+b,y0+w-(w/2.-g),4*z0/10.),
				   Vector3(x0,y0+w-(w/2.-g),4*z0/10.),
				   Vector3(x0,y0+w/2.-g,4*z0/10.)]

hopper = pack.sweptPolylines2gtsSurface([hopperBottomPts,hopperTopPts,[p+Vector3(0.0,0.0,h) for p in hopperTopPts]],capStart=False,capEnd=False)
hopperIds = O.bodies.append(pack.gtsSurface2Facets(hopper,color=(0,0,1)))

lowBox = box( center=(b/2.,3*w/2.,0.01), extents=(b,3*w,0.01) ,fixed=True,wire=True)
O.bodies.append(lowBox)

sp=pack.SpherePack()
sp.makeCloud(Vector3(x0,y0-w/2.,z0),Vector3(x0+b,y0+3*w/2.,z0+h),sphRad,0.0,400,False)
O.bodies.append([sphere(s[0],s[1]) for s in sp])			

O.engines=[
	ForceResetter(),
	InsertionSortCollider([Bo1_Box_Aabb(),Bo1_Sphere_Aabb(),Bo1_Facet_Aabb()],allowBiggerThanPeriod=True),
	InteractionLoop(
		[Ig2_Sphere_Sphere_ScGeom(),Ig2_Facet_Sphere_ScGeom(),Ig2_Box_Sphere_ScGeom()],
		[Ip2_FrictMat_FrictMat_FrictPhys()],
		[Law2_ScGeom_FrictPhys_CundallStrack()],
	),
	NewtonIntegrator(damping=.6, gravity=[0,0,-gravity]),
]
O.dt=0.5*PWaveTimeStep()
from yade import qt
v=qt.View();v.eyePosition=(2.43,0.6,0.6); v.viewDir=(-1,0,0); v.upVector=(0,0,1); v.axes=False; v.sceneRadius=0.9

Scenario='B'
if (Scenario=='A'):
	### Scenario A:
	### Periodic
	### Run for 15000 steps
	### --> Everything normal
	O.periodic=True
	O.cell.setBox(b,3*w,3*h)
	O.saveTmp()
	O.run(15000)
elif (Scenario=='B'):
	### Scenario B:
	### Periodic
	### Run for 10000 steps, save, load, and then run for 5000 steps
	### --> Whut?
	O.periodic=True
	O.cell.setBox(b,3*w,3*h)
	O.saveTmp()
	O.run(10000)
	O.wait()
	O.save("saved_state.xml")
	O.load("saved_state.xml")
	O.run(5000)
elif (Scenario=='C'):
	### Scenario C:
	### NOT Periodic
	### Run for 15000 steps
	### --> Everything normal
	O.saveTmp()
	O.run(15000)
elif (Scenario=='D'):
	### Scenario D:
	### NOT Periodic
	### Run for 10000 steps, save, load, and then run for 5000 steps
	### --> Everything normal
	O.saveTmp()
	O.run(10000)
	O.wait()
	O.save("saved_state.xml")
	O.load("saved_state.xml")
	O.run(5000)

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