yade-users team mailing list archive
-
yade-users team
-
Mailing list archive
-
Message #16972
Re: [Question #665569]: export the sphere in specific position with VTK format
Question #665569 on Yade changed:
https://answers.launchpad.net/yade/+question/665569
Status: Answered => Open
zhao dejin is still having a problem:
Hi ,Jérôme
I think it's difficult to make it true through this method , I plan to export the txt format ,here is my code , but it's failed, can you guide me ? thanks a lot .
###########code ##############
# !/usr/bin/python
# -*- coding: utf-8 -*-
###########################
# IMPORT MODULES
###########################
from yade import export
from yade import pack
from yade import qt
###########################
# DEFINE MATERIALS
###########################
steel=FrictMat(young=2.2e11,poisson=0.3,density=7800,frictionAngle=0.3,label='steel')
O.materials.append(steel)
###########################
###########################
plank1=O.bodies.append(geom.facetBox(center=(0.00075,0.00025,-0.00005),extents=(0.00075,0.00025,0.00005),wire=True))
plank2=O.bodies.append(geom.facetBox(center=(0.00075,0.0006,0.00005),extents=(0.00075,0.0001,0.00005),wire=False))
plank2=O.bodies.append(geom.facetBox(center=(0.00075,-0.0001,0.00005),extents=(0.00075,0.0001,0.00005),wire=False))
sp=pack.SpherePack()
sp.makeCloud((-0.0005,-0.0002,0.0001),(0,0.0007,0.0006),psdSizes=[0.000017, 0.000025, 0.000032,0.000038, 0.000044, 0.000053],psdCumm=[0, 0.4, 0.56,0.65, 0.85, 1])
ids=sp.toSimulation(color=(0.8,0.8,0.8),material='steel')
......(omit)
###########################
# ENGINES
###########################
O.engines=[
ForceResetter(),
InsertionSortCollider([Bo1_Sphere_Aabb(),Bo1_Facet_Aabb(),Bo1_Box_Aabb()]),
InteractionLoop(
[Ig2_Sphere_Sphere_ScGeom(),Ig2_Facet_Sphere_ScGeom(),Ig2_Box_Sphere_ScGeom()],
[Ip2_FrictMat_FrictMat_FrictPhys()],
[Law2_ScGeom_FrictPhys_CundallStrack()]
),
GlobalStiffnessTimeStepper(active=1,timeStepUpdateInterval=5,timestepSafetyCoefficient=0.8,defaultDt=PWaveTimeStep()),
NewtonIntegrator(gravity=(0,0,-9.81),damping=0.5),
PyRunner(command="exportSelectedSpheres()",iterPeriod=5000),
]
###########################
# DEFINE FUNCATIONS
###########################
def exportSelectedSpheres():
xCor = O.bodies[i].state.pos[0]
yCor = O.bodies[i].state.pos[1]
zCor = O.bodies[i].state.pos[2]
for i in sp:
if (0 <= xCor <= 0.000150) & (0 <= yCor <= 0.00050) & (-0.00003 <= zCor <= 0.00007):
export.text('zdj.txt')
###########################
#set an optimal timestep
O.dt=utils.PWaveTimeStep()
O.usesTimeStepper=True
qt.View()
qt.Controller()
--
You received this question notification because your team yade-users is
an answer contact for Yade.