wall

Asked by 孙灿

How can I add a wall at the lower end of the simulation, which is along the Y direction and coincides with the Y axis, so as not to let the simulated particles go beyond this area? The code is as follows
from yade import pack,plot
O.bodies.append(geom.facetBox((0, 0.5, 0.5), (0, 0.5, 0.5), wallMask=63))
sp = pack.SpherePack()
sp.makeCloud((0, 0, 0), (0, 1, 1), rMean=.01, rRelFuzz=0)

O.engines=[
    ForceResetter(),
 InsertionSortCollider([Bo1_Sphere_Aabb()]),
    InteractionLoop(
  [Ig2_Sphere_Sphere_ScGeom()],
  [Ip2_FrictMat_FrictMat_FrictPhys()],
  [Law2_ScGeom_FrictPhys_CundallStrack()]
    ),
 NewtonIntegrator(damping=0.1, gravity=(0.,0.,-9.81)),
]
O.dt = .5 * PWaveTimeStep()

# enable energy tracking; any simulation parts supporting it
# can create and update arbitrary energy types, which can be
# accessed as O.energy['energyName'] subsequently
O.trackEnergy = True

# if the unbalanced forces goes below .05, the packing
# is considered stabilized, therefore we stop collected
# data history and stop
def checkUnbalanced():
 if unbalancedForce() < .05:
  O.pause()
  plot.saveDataTxt('bbb.txt.bz2')
  # plot.saveGnuplot('bbb') is also possible

# 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.addData(i=O.iter, unbalanced=unbalancedForce(), **O.energy)

# 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 = {'i': ('unbalanced', None, O.energy.keys)}

plot.plot()

O.saveTmp()

# to see it
from yade import qt
qt.Controller()
qt.View()

Question information

Language:
English Edit question
Status:
Open
For:
Ubuntu 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 孙灿 for more information if necessary.

To post a message you must log in.