← Back to team overview

yade-users team mailing list archive

Re: [Question #694288]: Crop a specific range of the imported packing and distribute it to a specific position

 

Question #694288 on Yade changed:
https://answers.launchpad.net/yade/+question/694288

    Status: Needs information => Open

Chien-Cheng Hung gave more information on the question:
> Also, what is "particles", "a pack", ...?

Sorry, it should be just "a packing"..

> A MWE [1] would be great

Here's the MWE showing how I follow what you suggested previously

#########################
from yade import pack, ymport

a=5
b=5
c=5
RADIUS_dimension=0.00025

length=a*(2*RADIUS_dimension)
height=b*(2*RADIUS_dimension)
width=c*(2*RADIUS_dimension)
thickness=RADIUS_dimension

O.periodic=True

O.cell.hSize=Matrix3(length,0,0,0,3*height,0,0,0,width)

### load whole packing
packing = ymport.text("mypacking.spheresisoCompression")

### filter only desired particles
for i in range(0,len(packing)):
    if packing[i].state.pos[1] > height and packing[i].state.pos[1] < 2*height: 
        ### distribute it to desired position        <-- not sure how to do this part
        packing[i].state.pos[0] = packing[i].state.pos[0] + 5*thickness
        packing[i].state.pos[1] = packing[i].state.pos[1] + 5*thickness
        packing[i].state.pos[2] = packing[i].state.pos[2] + 5*thickness
        O.bodies.append(packing[i])
#########################

I can obtain the desired packing but they still remain at the same
position. So my question is how to distribute (or move) the desired
particles to a desired position. I hope this is clear to you. I will ask
more specifically next time!

Cheers,
Chien-Cheng

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