gravity deposition of clumps
Hi,
I am trying to use gravity (based on the gravity deposition example) to fill a volume with clumps and have them fall. I have several issues at the moment however. When I use makeClumpCloud to add clumps to the simulation only a few clumps are added. Sometimes only 1 clump other times 20 or so, even though the volume is quite large (error: Exceeded 200 attempts to place non-overlapping clump. Only 22 clumps were added, although you requested 1000)
Then once the clumps have been added to the simulation I try to run the gravity deposition but end up with error
UserWarning: No labelled objects found. Use label='...' kwarg on individual plots.
This error also appears when running the gravity_deposition example from https:/
many thanks in advance
Jesse
code is pasted below
#######
# A script for creating a dense packing of clumps
#
# Each aggragate is a dense packing, but macroscopically the packing
# is loose
#######
def getClumpInfo():
c = []
for b in O.bodies:
#print(b.isClump)
if b.isClump:
c.append(b)
#print(b.shape)
print('Clump ',b.id,' has following members:')
keys = b.shape.
for ii in range(0,len(keys)):
print('- Body ',keys[ii])
#print(c)
return c
def setClumpInfo(
c = []
aggNum = -1
for b in O.bodies:
#print(b.isClump)
if b.isClump:
aggNum+=1
c.append(b)
#print(b.shape)
if disp: print('Clump ',b.id,' has following members:')
keys = b.shape.
for ii in range(0,len(keys)):
if disp: print('- Body ',keys[ii])
#O.
O.bodies[
print(str(len(c))+ ' ' + str(aggNum))
return len(c) #number of clumps
def gravityDepositi
# gravity deposition in box, showing how to plot and save history of data,
# and how to control the simulation while it is running by calling
# python functions from within the simulation loop
# import yade modules that we will use below
from yade import pack, plot
# create rectangular box from facets
O.bodies.
O.engines=[
ForceResett
InsertionSo
Interaction
# handle sphere+sphere and facet+sphere collisions
[Ig2_
[Ip2_
[Law2_
),
NewtonInteg
# call the checkUnbalanced function (defined below) every 2 seconds
# PyRunner(
# call the addPlotData function every 200 steps
# PyRunner(
]
O.dt=.
# enable energy tracking; any simulation parts supporting it
# can create and update arbitrary energy types, which can be
# accessed as O.energy[
O.trackEnergy=True
O.run(500,True)
raw_input('test')
# if the unbalanced forces goes below .05, the packing
# is considered stabilized, therefore we stop collected
# data history and stop
def checkUnbalanced():
if unbalancedForce
O.pause()
plot.
# plot.saveGnuplo
# collect history of data which will be plotted
def addPlotData():
# each item is given a names, by which it can be the unsed in plot.plots
# the **O.energy converts dictionary-like O.energy to plot.addData arguments
plot.
# define how to plot data: 'i' (step number) on the x-axis, unbalanced force
# on the left y-axis, all energies on the right y-axis
# (O.energy.keys is function which will be called to get all defined energies)
# None separates left and right y-axis
plot.plots=
# show the plot on the screen, and update while the simulation runs
plot.plot()
from yade import pack,export,ymport
import random
random.seed(1) # to make colors always the same
numClumps = 2
minCorner = (0,0,0)
maxCorner = (7e-7,7e-7,7e-7)
#O.periodic=True
sp = pack.SpherePack()
# load clumps
ymport.
c0 = pack.SpherePack()
c0.fromSimulation()
ymport.
#c1 = getClumpInfo()
c1 = pack.SpherePack()
c1.fromSimulation()
O.switchScene(); O.resetThisScene() #####!!!!!!!
print('Creating Clump Cloud')
test = sp.makeClumpClo
print(test)
sp.toSimulation()
dim=utils.
dim=utils.
xinf=dim[0][0]
xsup=dim[1][0]
xdim = xsup-xinf
X=xinf+(xdim)/2.
yinf=dim[0][1]
ysup=dim[1][1]
ydim = ysup-yinf
Y=yinf+(ydim)/2.
zinf=dim[0][2]
zsup=dim[1][2]
zdim = zsup-zinf
Z=zinf+(zdim)/2.
center = Vector3(X,Y,Z) #center of the packing
extend = Vector3(
raw_input('Before gravity')
gravityDeposition()
raw_input('After gravity')
quit()
setClumpInfo()
#print(
# save the result, including information of agglomerates which the particle belongs to
export.
print('Number of particles = ' , len(O.bodies))
try:
from yade import qt
qt.View()
except:
pass
Question information
- Language:
- English Edit question
- Status:
- Answered
- For:
- Yade Edit question
- Assignee:
- No assignee Edit question
- Last query:
- Last reply:
Can you help with this problem?
Provide an answer of your own, or ask rhaven for more information if necessary.