unable to export text
Hello,
I'm try to to use the clump as wall to press on the sphere packing. After the clump press the packing I want to export the text of sphere position excluding the clump sphere, but it doesn't work. My question is that whether if it is correct to put the code under def checkunbalanced
>>if body not in idClump:
(argument of type 'int' is not iterable)
-------
import random
import math
from yade import geom, pack, utils, plot, ymport, export
import numpy as np
# Define cylinder with funnel parameters
center = (0, 0, 0)
diameter = 0.102
height = 0.18
# create cylindrical body with radius 0.102 m and height 0.064 m
cylinder = geom.facetCylin
# add cylinder to simulation
O.bodies.
# plate properties
clump_plate = CohFrictMat(density = 7500, label = 'clump_plate')
# add properties
O.materials.
# clumping parameters
bodyList = []
zi = 0.025
radius_clump = 0.00221
clumpLimit = (diameter/2) - 0.005
# layer and offset condition
num_layers = 8
z_offset_increment = 0.00128
# adjust the z-coordinate based on the layer
for layer in range(num_layers):
z_offset = layer * z_offset_increment
# if layer is divisible by to move x and y axis by 2mm
if layer % 2 == 0:
x_offset = 0.002
y_offset = 0.002
color = (1, 1, 1) # white
else:
x_offset = 0
y_offset = 0
color = (0.647, 0.165, 0.165) #brown
for xi in range(-60, 60, 4):
x = xi / 1000 + x_offset
for yi in range(-60, 60, 4):
y = yi / 1000 + y_offset
# Check if the sphere is within the clump limit
if (math.sqrt(x**2 + y**2) + radius_clump) <= clumpLimit:
# Assign material properties to the sphere
# add clump to bodyList
idClump = O.bodies.
# add sphere packing
O.bodies.
# materials Properties
gravel = CohFrictMat(young = 1e7, poisson = 0.25, density = 27000, label = 'gravel')
asphalt_binder = CohFrictMat(young = 1e7, poisson = 0.25, density = 10600, label = 'asphalt_binder')
# add properties
O.materials.
O.materials.
# give color and properties to shpere
for body in O.bodies:
if not isinstance(
continue
if body.shape.radius == 0.01575/2 :
if body.shape.radius == 0.011/2:
if body.shape.radius == 0.007125/2:
if body.shape.radius == 0.003555/2:
if body.shape.radius == 0.00160/2 :
if body.shape.radius == 0.0008/2 :
O.engines = [
# handle sphere+sphere and facet+sphere collisions
),
# call the checkUnbalanced function (defined below) every 2 seconds
]
O.dt = PWaveTimeStep()
# if the unbalanced forces goes below .05, the packing
# is considered stabilized, therefore we stop collected
# data history and stop
def checkUnbalanced():
if unbalancedForce() < 0.05:
for body in O.bodies:
# Exclude the clumped spheres
if body not in idClump:
if isinstance(
O.pause()
Question information
- Language:
- English Edit question
- Status:
- Answered
- For:
- Yade 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 Huan for more information if necessary.