Asked by Rong Zhao on 2019-11-06

The version of Yade I installed is the 2018.02b version. I'd like to generate the initial packing of the cloud of clumps in a rectangular box whose length is 2 in the x-direction, height is 4 in the y-direction and width is 2 in the z-direction. But it seems to don't work once the O.periodic=True is uncommented in the following codes because the box is a square box in 3d view.

Here are the codes:
# O.periodic=True
sp=pack.SpherePack()
c1=pack.SpherePack([((0,0,0),.03333),((.03,0,0),.017),((0,.03,0),.017)])
sp.makeClumpCloud((0,0,0),(2,4,2),[c1],periodic=True,num=500)
sp.toSimulation()

Thank you.

## Question information

Language:
English Edit question
Status:
Solved
For:
Assignee:
No assignee Edit question
Solved by:
Robert Caulk
Solved:
2019-11-08
Last query:
2019-11-08
2019-11-07
 Robert Caulk (rcaulk) said on 2019-11-06: #1

Hello,

>But it seems to don't work once the O.periodic=True is uncommented in the following codes because the box is a square box in 3d view.

Could you be more specific about what the problem/symptom is?

I would also like to kindly ask you to read through our How To Ask guide [1].

Cheers,

Robert

 Rong Zhao (zhaorong) said on 2019-11-06: #2

I'd like to generate the initial packing of the cloud of clumps in a rectangular box whose length is 2 in the x-direction, height is 4 in the y-direction and width is 2 in the z-direction using the following codes.

*******************
O.periodic=True
sp=pack.SpherePack()
c1=pack.SpherePack([((0,0,0),.03333),((.03,0,0),.017),((0,.03,0),.017)])
sp.makeClumpCloud((0,0,0),(2,4,2),[c1],periodic=True,num=500)
sp.toSimulation()

*******************

But the problem I met is that the packing is not in a rectangular box, it is in a square box whose length is 2 in all three directions when I view it in GUI.

 Robert Caulk (rcaulk) said on 2019-11-06: #3

I tried your code and it generates a parallelpiped measuring 2 x 4 x 2.

 Rong Zhao (zhaorong) said on 2019-11-07: #4

But the parallelepiped box I saw in the GUI of the Yade is a square box, how can I determine it is a parallelepiped measuring 2 x 4 x 2?

 Robert Caulk (rcaulk) said on 2019-11-07: #5

utils.aabbExtrema() is one way.

 Rong Zhao (zhaorong) said on 2019-11-07: #6

Thanks, Robert Caulk. I try the method or function you provide for me. Here are the codes:

*******************
O.periodic=True
sp=pack.SpherePack()
c1=pack.SpherePack([((0,0,0),.03333),((.03,0,0),.017),((0,.03,0),.017)])
sp.makeClumpCloud((0,0,0),(2,4,2),[c1],periodic=True,num=500)
sp.toSimulation()
print(utils.aabbExtrema()[-1] - utils.aabbExtrema()[0]) # upper corner coordinates -
# lower corner coordinates
*******************

When I run the above codes serval times, it returns the different values of the difference between upper corner coordinates and lower corner coordinates each time.
For example, (1.63..., 3.95..., 1.80...), (1.44..., 3.39..., 1.75...) etc.. It is not equal to (2, 4, 2).

I want to know why the strange behavior occurs.

 Robert Caulk (rcaulk) said on 2019-11-07: #7

When I run your code on Yade 2018.02b it returns the correct dimensions.

 Rong Zhao (zhaorong) said on 2019-11-07: #8

Thanks, Robert Caulk. May I view the packing in Paraview through the post-process?

 Rong Zhao (zhaorong) said on 2019-11-08: #9

Thanks Robert Caulk, that solved my question.