Material of particle changed in the repeated cell
Hi,
I'd like to ask that why the material of particle changed in the repeated cell. I have two types of particles (material 1 and 2, respectively) in a cell, and after I repeated the cell by using cellRepeat function, all the particles in the repeated cells are changed into material 2.
The MWE below may show my question. If you run the MWE, you will see that all the material Ids are 1, but I expect to have two types of materials.
##################
from yade import pack
O.periodic=True
#### define material, two materials are used for 2 type of particles
Mat1 = O.materials.
Mat2 = O.materials.
######## particles with Mat1
sp1=pack.
sp1.makeCloud(
sp1.toSimulatio
######## particles with Mat2
sp2=pack.
sp2.makeCloud(
sp2.toSimulatio
#### store all the ids of particles from sp1 and sp2, they will be deleted after repeat cell.
idIn1stCell=[]
for i in O.bodies:
idIn1stCell.
## repeat cell
sp=pack.
sp.fromSimulation()
sp.cellRepeat((1, 3, 1))
sp.toSimulation
## remove the original particles in the 1st cell
for i in idIn1stCell:
O.bodies.erase(i)
## print the material ids, I found that all the material ids are 1, but I expect to have two types of materials.
for i in O.bodies:
print (i.material.id)
#######
Thanks!
Leonard
Question information
- Language:
- English Edit question
- Status:
- Solved
- For:
- Yade Edit question
- Assignee:
- No assignee Edit question
- Solved by:
- Leonard
- Solved:
- Last query:
- Last reply: