yade-users team mailing list archive
-
yade-users team
-
Mailing list archive
-
Message #11104
Re: [Question #265223]: Unrealistic result of the “TesselationWrapper”
Question #265223 on Yade changed:
https://answers.launchpad.net/yade/+question/265223
Status: Answered => Open
Shenyang Cai is still having a problem:
Hi Bruno,
I believe that I have misinterpreted the usage of "TesselationWrapper"
in the user's manual. I have posted my script If you are still
interested in helping me out.
from yade import pack
import math
#setting frict materials -----
fyoung = 8e9
fpoisson = 0.25
frictAng = math.atan(0.6)
fden = 2500
#setting rock materials -----
ryoung = 2e7
rpoisson = 0.25
rfrictAng = math.atan(0.6)
reps = 0.06
rden = 2500
frict = O.materials.append(FrictMat(young = fyoung,
poisson = fpoisson,
frictionAngle = frictAng,
density = fden))
rock = O.materials.append(CpmMat(young = ryoung,
poisson = rpoisson,
frictionAngle = rfrictAng,
epsCrackOnset = reps,
density = rden,
relDuctility = 0))
#building boxes -----
box_length = 200.0
box_height = 80.0
box_depth = 4.8
box = geom.facetBox((box_length/2, box_depth/2, box_height/2),
(box_length/2, box_depth/2, box_height/2),
wallMask = 30,
material = frict)
wall = utils.wall((0, box_depth/2, box_height/2), axis = 0, material = frict)
O.bodies.append(box)
O.bodies.append(wall)
#adding deposit -----
pred = pack.inAlignedBox((0,0,0),(box_length, box_depth, 20))
spheres = pack.regularOrtho(pred, radius = 0.75, gap = 0)
s = O.bodies.append(spheres)
for i in s:
O.bodies[i].material = O.materials[rock]
#defining engines -----
checkPeriod = 100
savePeriod = 5000 # save files for every iterPeriod steps
thres = 500 #start simulation after this iter
O.engines = [
ForceResetter(),
InsertionSortCollider([Bo1_Sphere_Aabb(), Bo1_Facet_Aabb(), Bo1_Wall_Aabb()], verletDist = 0),
InteractionLoop(
[Ig2_Sphere_Sphere_ScGeom(), Ig2_Facet_Sphere_ScGeom(), Ig2_Wall_Sphere_ScGeom()],
[Ip2_CpmMat_CpmMat_CpmPhys(cohesiveThresholdIter = thres), Ip2_FrictMat_CpmMat_FrictPhys()],
[Law2_ScGeom_FrictPhys_CundallStrack(), Law2_ScGeom_CpmPhys_Cpm()],
),
NewtonIntegrator(damping = 0.3, gravity = (0, 0, -9.81)),
PyRunner(command = 'startPushing()', iterPeriod = checkPeriod, label = 'controller'),
]
O.dt = 0.2 *utils.PWaveTimeStep()
TW = TesselationWrapper()
TW.triangulate()
TW.computeVolumes()
#pushing stage -----
v = 0.2
def startPushing():
if O.iter < thres: # if the step has not reached "thres", we do nothing
return
TW.setState(0) # set initial configuration for the definition of displacement increments
wall.state.vel = Vector3(v, 0, 0)
controller.command = 'stopSimulation()'
def stopSimulation():
l = wall.state.pos[0]
if (O.iter- thres) % savePeriod == 0: #for every "savePeriod" steps we write an file of strain
TW.setState(1)
TW.defToVtk( "%.2f%%.vtk" % ((l/box_length)*100) ) #write the percentage of shortening in file names
if l > 0.5 * box_length:
O.pause()
I don't know if I put the "TesselationWrapper" in the right way and my paraview(4.0.1, 64bit for Linux) always crushes when trying to open those VTK files.
Thanks!
--
You received this question notification because you are a member of
yade-users, which is an answer contact for Yade.