← Back to team overview

yade-users team mailing list archive

[Question #661448]: randomdensepack exclusion from walls

 

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

Good evening,
Previously, i had asked how to create a group of particles and exclude those that are inside the walls.
This was the solution

		pred = inGtsSurface(s)
		sp=pack.SpherePack()
		sp.makeCloud((10,40,3),(30,60,12),rMean=0.5)
		
		# remove spheres completely inside walls
		for c,r in sp:
		   if pred(c,0):
		      continue
		   O.bodies.append(sphere(c,r))

		# remove spheres partially inside walls
		O.dt = 0
		O.step() # interactions are created afterwards
		toErase = set()
		for i in O.interactions:
		   b1,b2 = [O.bodies[i] for i in (i.id1,i.id2)]
		   if any(isinstance(b.shape,Facet) for b in (b1,b2)): # if facet is involved, delete
		      toErase.add(b1)
		      toErase.add(b2)
		toErase = [b for b in toErase if isinstance(b.shape,Sphere)] # delete just spheres
		for b in toErase: # delete the spheres
		O.bodies.erase(b.id)
		O.engines=[

However, a much denser particle cloud is needed
To that effect i subsituted 


		sp=pack.SpherePack()
		sp.makeCloud((10,40,3),(30,60,12),rMean=0.5)


with 

		sp=pack.randomDensePack(pack.inAlignedBox((-10,40,3),(20,50,10)),spheresInCell=1000,radius=.05,memoizeDb='/tmp/triaxPackCache.sqlite')


ln: failed to create symbolic link 'yadeimport.py': File exists
False
True
Found suitable packing in /tmp/triaxPackCache.sqlite (radius=0.05±0,N=1000,dim=2.2861×0.762034×0.533423,periodic,scale=1), created Wed Dec  6 15:34:07 2017
/usr/lib/x86_64-linux-gnu/yade/py/yade/pack.py:296: FutureWarning: The default behavior will change; specify returnSpherePack=True for the new behavior, and False to get rid of this warning (your code will break in the future, however). The returned SpherePack object can be added to the simulation using SpherePack.toSimulation()
  warnings.warn('The default behavior will change; specify returnSpherePack=True for the new behavior, and False to get rid of this warning (your code will break in the future, however). The returned SpherePack object can be added to the simulation using SpherePack.toSimulation()',category=FutureWarning)
Killed


Any help is appreciated
Thank you for your time
John





-- 
You received this question notification because your team yade-users is
an answer contact for Yade.