← Back to team overview

yade-users team mailing list archive

[Question #667946]: Why use ymport.textPolyhedra command make the simulation to slow?

 

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

I first prepare some polyhedra particle in my model and used 'export.textPolyhedra' to export the polyhedra layer into .txt file. When I use 'ymport.textPolyhedra' in a new input file to import the .txt file and run the model, it seems the simulation become to slow(much slower than the previous particle preparation step simulation)... What's the situation here? Thanks.

######################################################################
# INPUTS
######################################################################
gravity = 100

# box dimensions
widthl = 1.3
widthr = 1.3
widthc = 1.3
height = 1
thick = 3
deep = -.2

# size of grains
sizeMin = 40e-3
sizeMax = 95e-3

frictionAngle = .5
young = 45e9 # stiffness
density = 16000 #kg/m^3

dt = 1e-4 # time step

# how much larger the initial make box should be
fillBoxHFactor = 1
######################################################################
from yade import polyhedra_utils, export, ymport

width = widthl+widthc+widthr

# mat, engines, ...
mat = PolyhedraMat(young=young,poisson=.25,density=density,frictionAngle=frictionAngle)
O.materials.append(mat)

O.engines=[
   ForceResetter(),
   InsertionSortCollider([Bo1_Polyhedra_Aabb(),Bo1_Wall_Aabb(),Bo1_Facet_Aabb()]),
   InteractionLoop(
      [Ig2_Wall_Polyhedra_PolyhedraGeom(), Ig2_Polyhedra_Polyhedra_PolyhedraGeom(), Ig2_Facet_Polyhedra_PolyhedraGeom()], 
      [Ip2_PolyhedraMat_PolyhedraMat_PolyhedraPhys()], # collision "physics"
      [Law2_PolyhedraGeom_PolyhedraPhys_Volumetric()]   # contact law -- apply forces
   ),
   NewtonIntegrator(damping=0.3,gravity=(0,0,-100)),

]

O.dt = dt

# box
p000 = Vector3(0,0,0)
p100 = Vector3(widthl,0,0)
p200 = Vector3(widthl+widthc,0,0)
p300 = Vector3(widthl+widthc+widthr,0,0)
pxs = (p000,p100,p200,p300)
p001,p101,p201,p301 = [p+Vector3(0,0,height) for p in pxs]
p010,p110,p210,p310 = [p+Vector3(0,thick,0) for p in pxs]
p011,p111,p211,p311 = [p+Vector3(0,thick,height) for p in pxs]
p00b,p10b,p20b,p30b = [p+Vector3(0,0,deep) for p in pxs]
p01b,p11b,p21b,p31b = [p+Vector3(0,thick,deep) for p in pxs]
def rect(vs,**kw):
 v1,v2,v3,v4 = vs
 return [
  facet((v1,v2,v3),**kw),
  facet((v1,v3,v4),**kw),
 ]
rects = (
 (p000,p300,p310,p010), # bottom 
 (p000,p010,p011,p001), # left
 (p300,p310,p311,p301), # right
 (p000,p300,p301,p001), # front
 (p010,p310,p311,p011), # back
)
rects = sum((rect(r) for r in rects),[])
O.bodies.append(rects)


O.bodies.append(yade.ymport.textPolyhedra('try_new_layer1.txt', mat,shift=Vector3(0, 0, 0), scale=1.0, orientation=Quaternion((1, 0, 0), 0)))

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