How to export and import a irregular shape particles model.
Hi all,
I am a new user of yade. I tried polyhedra particles falling down into a box. I am wondering how can I export this model after it finishes this falling process and how to import it and down the next simulation? For example, generate a beam on this aggregates.
I used this code and yade.export.
#######
# INPUTS
#######
gravity = 100
# box dimensions
widthl = .3
widthr = .3
widthc = .3
height = .3
thick = .5
deep = -.2
# size of grains
sizeMin = 40e-3
sizeMax = 60e-3
frictionAngle = .5
young = 1e8 # stiffness
dt = 1e-3 # time step
nGravityDeposition = 250 # how long to run initial gravity deposition
nCycles = 3 # how many jumps to run afterwards
nStepsBetweenCycles = 200 # number of time steps between jumps
dspl = 20e-3
# how much larger the initial make box should be
fillBoxHFactor = 3
#######
from yade import polyhedra_utils, export
width = widthl+
# mat, engines, ...
mat = PolyhedraMat(
O.materials.
O.engines=[
ForceResetter(),
InsertionSor
InteractionLoop(
[
[
[
),
NewtonIntegr
PyRunner(
]
O.dt = dt
def checker():
for i in range(nCycles):
ii = nGravityDeposit
if O.iter == ii:
moveBottom()
if O.iter == ii+1:
stopBottom()
if O.iter == nGravityDeposit
O.pause()
def moveBottom():
v = dspl / O.dt
for b in movables:
b.state.vel = (0,0,-v)
def stopBottom():
for b in movables:
b.state.vel = (0,0,0)
# box
p000 = Vector3(0,0,0)
p100 = Vector3(widthl,0,0)
p200 = Vector3(
p300 = Vector3(
pxs = (p000,p100,
p001,p101,p201,p301 = [p+Vector3(
p010,p110,p210,p310 = [p+Vector3(
p011,p111,p211,p311 = [p+Vector3(
p00b,p10b,p20b,p30b = [p+Vector3(
p01b,p11b,p21b,p31b = [p+Vector3(
def rect(vs,**kw):
v1,v2,v3,v4 = vs
return [
facet(
facet(
]
movables = rect((p100,
rects = (
(p000,
(p200,
(p000,
(p300,
(p000,
(p100,
(p200,
(p010,
(p110,
(p210,
(p100,
(p110,
(p100,
(p200,
)
rects = movables + sum((rect(r) for r in rects),[])
O.bodies.
# gravel
polyhedra_
yade.export.
#######
Thanks.
Question information
- Language:
- English Edit question
- Status:
- Solved
- For:
- Yade Edit question
- Assignee:
- No assignee Edit question
- Solved by:
- Jan Stránský
- Solved:
- Last query:
- Last reply: