Packing and predicate dimension

Asked by Luis Barbosa

Hello everyone,

In my script I'm using a gts surface to create a random dense pack.

However, the dimensions of the pack are different from gts surface, as described by these two warnings:

UserWarning: Packing's dimension (Vector3(1.7155834296905184,0.9247992240716244,1.7113872666787984)) doesn't fully contain dimension of the predicate (Vector3(2,1,2)).
  if dimP[0]>dimS[0] or dimP[1]>dimS[1] or dimP[2]>dimS[2]: warnings.warn("Packing's dimension (%s) doesn't fully contain dimension of the predicate (%s)."%(dimS,dimP))

Follows the image of the pack. The blue line is gts surface.

https://drive.google.com/open?id=0B9LhrwAf_vasWTd5cG5MektKOXc

How can I create a pack of spheres with the same predicate of gts?

Thanks,
Luis

Question information

Language:
English Edit question
Status:
Solved
For:
Yade Edit question
Assignee:
No assignee Edit question
Solved by:
Jérôme Duriez
Solved:
Last query:
Last reply:
Revision history for this message
Jan Stránský (honzik) said :
#1

Hi Luis,
could you please provide a python script?
thanks
Jan

2016-04-18 3:13 GMT+02:00 Luis Barbosa <<email address hidden>
>:

> New question #291326 on Yade:
> https://answers.launchpad.net/yade/+question/291326
>
> Hello everyone,
>
> In my script I'm using a gts surface to create a random dense pack.
>
> However, the dimensions of the pack are different from gts surface, as
> described by these two warnings:
>
> UserWarning: Packing's dimension
> (Vector3(1.7155834296905184,0.9247992240716244,1.7113872666787984)) doesn't
> fully contain dimension of the predicate (Vector3(2,1,2)).
> if dimP[0]>dimS[0] or dimP[1]>dimS[1] or dimP[2]>dimS[2]:
> warnings.warn("Packing's dimension (%s) doesn't fully contain dimension of
> the predicate (%s)."%(dimS,dimP))
>
> Follows the image of the pack. The blue line is gts surface.
>
> https://drive.google.com/open?id=0B9LhrwAf_vasWTd5cG5MektKOXc
>
> How can I create a pack of spheres with the same predicate of gts?
>
> Thanks,
> Luis
>
> --
> You received this question notification because your team yade-users is
> an answer contact for Yade.
>
> _______________________________________________
> Mailing list: https://launchpad.net/~yade-users
> Post to : <email address hidden>
> Unsubscribe : https://launchpad.net/~yade-users
> More help : https://help.launchpad.net/ListHelp
>

Revision history for this message
Luis Barbosa (luis-pires-b) said :
#2

Hi Jan,

Sure I can.

#!/usr/bin/python
# -*- coding: utf-8 -*-
#======================================
from yade import pack
import gts
from yade import utils
surf=gts.read(open('tetrahedron.gts'))
pred=pack.inGtsSurface(surf)
vol = surf.volume()
#======================================
# Spheres
O.materials.append(JCFpmMat(type=1,young=1e8,poisson=0.3,frictionAngle=radians(30),density=3000,tensileStrength=1e6,cohesion=1e6,jointNormalStiffness=1e7,jointShearStiffness=1e7,jointCohesion=1e6,jointFrictionAngle=radians(20),jointDilationAngle=0.0,label='sphereso'))
#======================================
O.bodies.append(pack.gtsSurface2Facets(surf,color=(0,0,1)))
sp = pack.randomDensePack(pred,radius=0.08,rRelFuzz=0.01, material = 'sphereo',useOBB=False,returnSpherePack=True)
sp.toSimulation(color=(0.9,0.8,0.6))
#======================================
O.engines=[
 ForceResetter(),
 InsertionSortCollider([Bo1_Sphere_Aabb(),Bo1_Facet_Aabb()]),
 InteractionLoop(
  [Ig2_Sphere_Sphere_ScGeom(),Ig2_Facet_Sphere_ScGeom()],
  [Ip2_JCFpmMat_JCFpmMat_JCFpmPhys(cohesiveTresholdIteration=1)],
  [Law2_ScGeom_JCFpmPhys_JointedCohesiveFrictionalPM(smoothJoint=False)]
 ),
  GlobalStiffnessTimeStepper(active=1,timeStepUpdateInterval=100,timestepSafetyCoefficient=0.2),
  NewtonIntegrator(damping=0.9,gravity=[0,0,-9.81]),
]
ve=utils.getSpheresVolume()
print vol,ve
#=======================================
from yade import qt
qt.View()
qt.Controller()
#########################################################

And here follows the gts surface...
https://drive.google.com/open?id=0B9LhrwAf_vasanZ4bVc4b0FHVUE

Thanks,
Luis

Revision history for this message
Jan Stránský (honzik) said :
#3

Hi Luis,

thanks for the files. For some reason, the "smooth" surface, created by a
wall in triaxial compression, is placed wrongly. There are several
solutions, all parameters of randomDensePack, see docs [1]:

spheresInCell=500 (or another number). It does internally periodic triaxial
compression, overcoming the problem with fixed wall position
cropLayers=3, it simply enlarge the compressed volume
dim, according to the documentation, it could also help

my suggestion is 1), since it also reduces time needed for preparation.

cheers
Jan

[1] https://yade-dem.org/doc/yade.pack.html#yade.pack.randomDensePack

2016-04-19 2:17 GMT+02:00 Luis Barbosa <<email address hidden>
>:

> Question #291326 on Yade changed:
> https://answers.launchpad.net/yade/+question/291326
>
> Status: Answered => Open
>
> Luis Barbosa is still having a problem:
> Hi Jan,
>
> Sure I can.
>
> #!/usr/bin/python
> # -*- coding: utf-8 -*-
> #======================================
> from yade import pack
> import gts
> from yade import utils
> surf=gts.read(open('tetrahedron.gts'))
> pred=pack.inGtsSurface(surf)
> vol = surf.volume()
> #======================================
> # Spheres
>
> O.materials.append(JCFpmMat(type=1,young=1e8,poisson=0.3,frictionAngle=radians(30),density=3000,tensileStrength=1e6,cohesion=1e6,jointNormalStiffness=1e7,jointShearStiffness=1e7,jointCohesion=1e6,jointFrictionAngle=radians(20),jointDilationAngle=0.0,label='sphereso'))
> #======================================
> O.bodies.append(pack.gtsSurface2Facets(surf,color=(0,0,1)))
> sp = pack.randomDensePack(pred,radius=0.08,rRelFuzz=0.01, material =
> 'sphereo',useOBB=False,returnSpherePack=True)
> sp.toSimulation(color=(0.9,0.8,0.6))
> #======================================
> O.engines=[
> ForceResetter(),
> InsertionSortCollider([Bo1_Sphere_Aabb(),Bo1_Facet_Aabb()]),
> InteractionLoop(
> [Ig2_Sphere_Sphere_ScGeom(),Ig2_Facet_Sphere_ScGeom()],
>
> [Ip2_JCFpmMat_JCFpmMat_JCFpmPhys(cohesiveTresholdIteration=1)],
>
> [Law2_ScGeom_JCFpmPhys_JointedCohesiveFrictionalPM(smoothJoint=False)]
> ),
>
> GlobalStiffnessTimeStepper(active=1,timeStepUpdateInterval=100,timestepSafetyCoefficient=0.2),
> NewtonIntegrator(damping=0.9,gravity=[0,0,-9.81]),
> ]
> ve=utils.getSpheresVolume()
> print vol,ve
> #=======================================
> from yade import qt
> qt.View()
> qt.Controller()
> #########################################################
>
> And here follows the gts surface...
> https://drive.google.com/open?id=0B9LhrwAf_vasanZ4bVc4b0FHVUE
>
> Thanks,
> Luis
>
> --
> You received this question notification because your team yade-users is
> an answer contact for Yade.
>
> _______________________________________________
> Mailing list: https://launchpad.net/~yade-users
> Post to : <email address hidden>
> Unsubscribe : https://launchpad.net/~yade-users
> More help : https://help.launchpad.net/ListHelp
>

Revision history for this message
Luis Barbosa (luis-pires-b) said :
#4

Hi,

Inserting spheresInCell I got this message:

"No suitable packing in database found, running PERIODIC compression"

And the pack is not dense, but is similar to a "cloud".

Thanks,
Luis

Revision history for this message
Jan Stránský (honzik) said :
#5

Hi Luis,

> "No suitable packing in database found, running PERIODIC compression"
>
>
this is just information for the user, it is OK.

> And the pack is not dense, but is similar to a "cloud".
>

this is strange. Could you please post a final picture? In my case it
worked as expected.

cheers
Jan

Revision history for this message
Luis Barbosa (luis-pires-b) said :
#6

Hi Jan,

https://drive.google.com/open?id=0B9LhrwAf_vasN1RvNW9Qa3liZUE

As you can see the spheres are not overlaping, in some case not even touch.

Thanks,
Luis

Revision history for this message
Jan Stránský (honzik) said :
#7

Hi Luis,
you can also improve the result with setting noPad=True to
pack.inGtsSurface. Computing the volume fraction of spheres, I got 57%.
randomDensePack in periodic (optimal) conditions has usually around 62% of
volume fraction (with monodisperse packing), so the packing is OK. Could
you try it and (dis)confirm that it works or not?
Thanks
Jan

2016-04-21 14:47 GMT+02:00 Luis Barbosa <
<email address hidden>>:

> Question #291326 on Yade changed:
> https://answers.launchpad.net/yade/+question/291326
>
> Status: Answered => Open
>
> Luis Barbosa is still having a problem:
> Hi Jan,
>
> https://drive.google.com/open?id=0B9LhrwAf_vasN1RvNW9Qa3liZUE
>
> As you can see the spheres are not overlaping, in some case not even
> touch.
>
> Thanks,
> Luis
>
> --
> You received this question notification because your team yade-users is
> an answer contact for Yade.
>
> _______________________________________________
> Mailing list: https://launchpad.net/~yade-users
> Post to : <email address hidden>
> Unsubscribe : https://launchpad.net/~yade-users
> More help : https://help.launchpad.net/ListHelp
>

Revision history for this message
Luis Barbosa (luis-pires-b) said :
#8

Hi Jan,
I didn't know if I got the idea,
but my volume of spheres is near 39%, and again, is not dense.
Could you share what you have done?

Here is what I'm using to calc volume of sphere,creating Gts and dense pack, respectively:

utils.getSpheresVolume()

pred=pack.inGtsSurface(surf,noPad=True)

pack.randomDensePack(pred,spheresInCell=500,radius=0.08,rRelFuzz=0.01, material = 'sphereo',useOBB=False,returnSpherePack=True)

Thanks
Luis

Revision history for this message
Jan Stránský (honzik) said :
#9

Hi Luis,

I used slightly modified script from #2. The result is 57%.
cheers
Jan

picture result:
https://www.dropbox.com/s/93j2bfhujhcimd7/Screenshot%20from%202016-04-22%2022%3A46%3A19.png?dl=0

script:
#########################################################
#!/usr/bin/python
# -*- coding: utf-8 -*-
#======================================
from yade import pack
import gts
from yade import utils
surf=gts.read(open('tetrahedron.gts'))
pred=pack.inGtsSurface(surf,noPad=True)
vol = surf.volume()
#======================================
# Spheres
O.materials.append(JCFpmMat(type=1,young=1e8,poisson=0.3,frictionAngle=radians(30),density=3000,tensileStrength=1e6,cohesion=1e6,jointNormalStiffness=1e7,jointShearStiffness=1e7,jointCohesion=1e6,jointFrictionAngle=radians(20),jointDilationAngle=0.0,label='sphereso'))
#======================================
O.bodies.append(pack.gtsSurface2Facets(surf,color=(0,0,1)))
sp = pack.randomDensePack(pred,radius=0.08,rRelFuzz=0.01, material =
'sphereo',useOBB=False,returnSpherePack=True,spheresInCell=300)
sp.toSimulation(color=(0.9,0.8,0.6))
#======================================
O.engines=[
ForceResetter(),
InsertionSortCollider([Bo1_Sphere_Aabb(),Bo1_Facet_Aabb()]),
InteractionLoop(
[Ig2_Sphere_Sphere_ScGeom(),Ig2_Facet_Sphere_ScGeom()],
[Ip2_JCFpmMat_JCFpmMat_JCFpmPhys(cohesiveTresholdIteration=1)],
[Law2_ScGeom_JCFpmPhys_JointedCohesiveFrictionalPM(smoothJoint=False)]
),
GlobalStiffnessTimeStepper(active=1,timeStepUpdateInterval=100,timestepSafetyCoefficient=0.2),
NewtonIntegrator(damping=0.9,gravity=[0,0,-9.81]),
]
ve=utils.getSpheresVolume()
print vol,ve,ve/vol
#=======================================
from yade import qt
qt.View()
qt.Controller()
#########################################################

tetrahedron.gts:
4 6 4
-1.63299 -0.942809 -0.666667
0 1.88562 -0.666667
1.63299 -0.942809 -0.666667
0 0 2
2 1
3 2
2 4
1 3
4 1
3 4
1 2 4
5 3 1
3 6 2
6 5 4

2016-04-21 19:13 GMT+02:00 Luis Barbosa <
<email address hidden>>:

> Question #291326 on Yade changed:
> https://answers.launchpad.net/yade/+question/291326
>
> Status: Answered => Open
>
> Luis Barbosa is still having a problem:
> Hi Jan,
> I didn't know if I got the idea,
> but my volume of spheres is near 39%, and again, is not dense.
> Could you share what you have done?
>
> Here is what I'm using to calc volume of sphere,creating Gts and dense
> pack, respectively:
>
> utils.getSpheresVolume()
>
> pred=pack.inGtsSurface(surf,noPad=True)
>
> pack.randomDensePack(pred,spheresInCell=500,radius=0.08,rRelFuzz=0.01,
> material = 'sphereo',useOBB=False,returnSpherePack=True)
>
> Thanks
> Luis
>
> --
> You received this question notification because your team yade-users is
> an answer contact for Yade.
>
> _______________________________________________
> Mailing list: https://launchpad.net/~yade-users
> Post to : <email address hidden>
> Unsubscribe : https://launchpad.net/~yade-users
> More help : https://help.launchpad.net/ListHelp
>

Revision history for this message
Luis Barbosa (luis-pires-b) said :
#10

Hi Jan,

Thanks for the script, and now I have ve/vol=52%.
And again is not a dense pack as obtained using randomdensepack aperiodic.

Can you tell me where find documentation to go deeper in this randomdensepack using TriaxialTest?
I think be necessary to me understand better this function.

Thanks for everything.
Luis

Revision history for this message
Best Jérôme Duriez (jduriez) said :
#11

In case the documentation [1] itself is not enough, you have no other choice than looking into the source code in py/pack.py [2]...

[1] https://yade-dem.org/doc/yade.pack.html?highlight=randomdensepack#yade.pack.randomDensePack
[2] https://github.com/yade/trunk/blob/6d4a0d1689c6bad2dbdd6e27d1653418f7fc6498/py/pack/pack.py#L382

Jerome

Revision history for this message
Luis Barbosa (luis-pires-b) said :
#12

Thanks Jérôme Duriez, that solved my question.