← Back to team overview

yade-users team mailing list archive

Re: [Question #280730]: gts import and predicates

 

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

    Status: Open => Answered

Jan Stránský proposed the following answer:
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 <question280730@xxxxxxxxxxxxxxxxxxxxx>:

> 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     : yade-users@xxxxxxxxxxxxxxxxxxx
> Unsubscribe : https://launchpad.net/~yade-users
> More help   : https://help.launchpad.net/ListHelp
>

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