gts import and predicates

Asked by behzad

https://www.dropbox.com/s/x0169fplp4eyii7/bed2.gts?dl=0

Hi guys,

I'm importing a gts surface created by Abaqus to YADE. Loading the file and filling it like the example given in dicumentation works well, as expected.
I also define all the imported facets as one single clump, which this one also works with no peoblem.

However, I'd like to fill a cubic space (preferably by makecloud). The cube includes the imported gts surface. Generated spheres are supposed to be outside the gts surface (in contrary to the given example). This thing, seems to be problematic!

I'm using the following script. You can also access the gts file here:

https://www.dropbox.com/s/x0169fplp4eyii7/bed2.gts?dl=0

There're two problems:
1- There're still many spheres inside the gts surface.
2- Is there any way to to this with random packing?

Thanks for sharing ideas and experience.

cheers,
Behzad

O.reset()
from yade import utils, plot
from yade import pack, qt

O.engines=[
ForceResetter(),
InsertionSortCollider([Bo1_Sphere_Aabb(),Bo1_Facet_Aabb(),Bo1_Box_Aabb()]),
InteractionLoop(
[Ig2_Sphere_Sphere_ScGeom(),Ig2_Facet_Sphere_ScGeom(),Ig2_Box_Sphere_ScGeom()],
[Ip2_FrictMat_FrictMat_FrictPhys()],
[Law2_ScGeom_FrictPhys_CundallStrack()]
),
NewtonIntegrator(damping=0.7,gravity=[0,0,-10.0])
]

O.dt=1e-7
#===============Materials Declaration=========================

O.materials.append(FrictMat(young=1e7,poisson=0.3,density=1377,frictionAngle=50, label='wall'))

#=========================================================

walls=aabbWalls([(-0.002,-0.002,-0.001),(0.002,0.002,0.003)],thickness=0.0001,oversizeFactor=1.0,material='wall')
wallIds=O.bodies.append(walls)

bed=gts.read(open('bed2.gts'))

O.bodies.append(pack.gtsSurface2Facets(bed,wire=True))

for x in range(len(O.bodies)):
 if (O.bodies[x]):
  if isinstance(O.bodies[x].shape,Facet):
   O.bodies[x].state.mass=1e-4
   O.bodies[x].state.inertia=(1,1,1)

myList1=[]

for x in range(len(O.bodies)):
 if (O.bodies[x]):
  if isinstance(O.bodies[x].shape,Facet):
   myList1.append(x)

for x in myList1:
 O.bodies[x].shape.color=(0.0,0.1,0.8)

idClump1=O.bodies.clump(myList1)

for x in range(len(O.bodies)):
 if (O.bodies[x]):
  if O.bodies[x].isClump:
   clId=x

O.bodies[clId].dynamic=False

#========Generating the binder=========

bedPred1=pack.inGtsSurface(bed)

mainPred=pack.inAlignedBox((-0.0018,-0.0018,-0.0018),(0.0018,0.0018,0.0018))

pred=mainPred-bedPred1

O.bodies.append(pack.regularOrtho(pred,radius=4e-5,gap=0.0, material='wall'))

Question information

Language:
English Edit question
Status:
Answered
For:
Yade Edit question
Assignee:
No assignee Edit question
Last query:
Last reply:
Revision history for this message
Jan Stránský (honzik) said :
#1

Hi Behzad,

1) the first problem here is the inversion of inGtsSurface. Normally, a
particle which is just a little over the border (even most of the volume is
inside) such particle is not included. If you use - bedPred1, it is
opposite. I.e. if the particle is almost completely inside the predicate,
but just a little is over the border, it is not deleted. Ideal case would
be to create such gtsSurface to use it as is, without mainPred -
bedPred1... Plus more precise computation, see bellow.

2) with current approach, with bedPred1=pack.inGtsSurface(bed,noPad=True) I
could get a bit better results (see [1] for noPad).

3) Still particles on the surface was not perfect, but it is probably
result of not exact computation. From the doumentation [1]: "Note: padding
checks inclusion of 6 points along +- cardinal directions in the pad
distance from given point, which is not exact."
A solution could be to improve the computation, for the sake of simplicity
just in py/pack/pack.py, class inGtsSurface_py, function __call__, the last
two lines. It should be easy to check not just 6 direction but parametrize
the computation for more directions. If efficiency is the key point, then
you have to improve inGtsSurface in py/pack/_packPredicates.cpp

4) make a bit larger gts surface such that as a result the particles are
deleted correctly

So I would go 1 (+ 3), i.e. creating such gts surface to be the predicate
itself. Possibly improving the computation. If you use 1), than **do not**
use noPad=True (2)

cheers
Jan

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

PS: predicates may be a bit tricky, so don't give up immediately :-)

2016-01-07 23:12 GMT+01:00 behzad <email address hidden>:

> New question #280730 on Yade:
> https://answers.launchpad.net/yade/+question/280730
>
> https://www.dropbox.com/s/x0169fplp4eyii7/bed2.gts?dl=0
>
>
> Hi guys,
>
> I'm importing a gts surface created by Abaqus to YADE. Loading the file
> and filling it like the example given in dicumentation works well, as
> expected.
> I also define all the imported facets as one single clump, which this one
> also works with no peoblem.
>
> However, I'd like to fill a cubic space (preferably by makecloud). The
> cube includes the imported gts surface. Generated spheres are supposed to
> be outside the gts surface (in contrary to the given example). This thing,
> seems to be problematic!
>
> I'm using the following script. You can also access the gts file here:
>
> https://www.dropbox.com/s/x0169fplp4eyii7/bed2.gts?dl=0
>
> There're two problems:
> 1- There're still many spheres inside the gts surface.
> 2- Is there any way to to this with random packing?
>
> Thanks for sharing ideas and experience.
>
> cheers,
> Behzad
>
>
> O.reset()
> from yade import utils, plot
> from yade import pack, qt
>
>
> O.engines=[
> ForceResetter(),
> InsertionSortCollider([Bo1_Sphere_Aabb(),Bo1_Facet_Aabb(),Bo1_Box_Aabb()]),
> InteractionLoop(
>
> [Ig2_Sphere_Sphere_ScGeom(),Ig2_Facet_Sphere_ScGeom(),Ig2_Box_Sphere_ScGeom()],
> [Ip2_FrictMat_FrictMat_FrictPhys()],
> [Law2_ScGeom_FrictPhys_CundallStrack()]
> ),
> NewtonIntegrator(damping=0.7,gravity=[0,0,-10.0])
> ]
>
> O.dt=1e-7
> #===============Materials Declaration=========================
>
> O.materials.append(FrictMat(young=1e7,poisson=0.3,density=1377,frictionAngle=50,
> label='wall'))
>
> #=========================================================
>
>
>
> walls=aabbWalls([(-0.002,-0.002,-0.001),(0.002,0.002,0.003)],thickness=0.0001,oversizeFactor=1.0,material='wall')
> wallIds=O.bodies.append(walls)
>
>
> bed=gts.read(open('bed2.gts'))
>
>
> O.bodies.append(pack.gtsSurface2Facets(bed,wire=True))
>
>
> for x in range(len(O.bodies)):
> if (O.bodies[x]):
> if isinstance(O.bodies[x].shape,Facet):
> O.bodies[x].state.mass=1e-4
> O.bodies[x].state.inertia=(1,1,1)
>
>
> myList1=[]
>
> for x in range(len(O.bodies)):
> if (O.bodies[x]):
> if isinstance(O.bodies[x].shape,Facet):
> myList1.append(x)
>
> for x in myList1:
> O.bodies[x].shape.color=(0.0,0.1,0.8)
>
> idClump1=O.bodies.clump(myList1)
>
> for x in range(len(O.bodies)):
> if (O.bodies[x]):
> if O.bodies[x].isClump:
> clId=x
>
> O.bodies[clId].dynamic=False
>
>
> #========Generating the binder=========
>
>
>
> bedPred1=pack.inGtsSurface(bed)
>
>
> mainPred=pack.inAlignedBox((-0.0018,-0.0018,-0.0018),(0.0018,0.0018,0.0018))
>
> pred=mainPred-bedPred1
>
> O.bodies.append(pack.regularOrtho(pred,radius=4e-5,gap=0.0,
> material='wall'))
>
>
>
>
>
> --
> 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
behzad (behzad-majidi) said :
#2

hmm, I see. But, what about doing the same methods, with random packing? i.e. makecloud?

Thanks for your comments,
Behzad

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

From this problem point of view, there is no difference between random,
regular, dense, loose... packings. Simply some particles, that should not
be present, will be actually there.. For makeCloud with less probability,
since there will be less particles, but the problem would remain..
Jan

2016-01-08 22:27 GMT+01:00 behzad <email address hidden>:

> Question #280730 on Yade changed:
> https://answers.launchpad.net/yade/+question/280730
>
> behzad posted a new comment:
> hmm, I see. But, what about doing the same methods, with random
> packing? i.e. makecloud?
>
> Thanks for your comments,
> Behzad
>
> --
> 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
>

Can you help with this problem?

Provide an answer of your own, or ask behzad for more information if necessary.

To post a message you must log in.