Sample of pre-defined shaped particles

Asked by bruna

Hello everybody!

I would like to create a sample formed by particles that are sphere agglomerates with a determined shape (u-shaped).
I was thinking that I could create the particle (that is a pattern) in a scritpt and them import it in another script as many times as necessary rotating and translating the copied particles.
I don't know if it is possible or if it is an inteligente manner to do this.

Does anybody knows a function that could help me or a better way to do this?

Thanks a lot for your help and patience.

Bruna.

Question information

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

Hello,
yes, it is possible, something like

######################################################################
from yade import pack

def createAgglomerate(pos=Vector3.Zero,ori=Quaternion.Identity,**kw):
   pos = Vector3(pos)
   ori = Quaternion(ori)
   pred = pack.inAlignedBox((-5,-5,-5),(5,5,5))
   # pred could be any shape, see user's manual,
   # section "Constructive Solid Geometry"
   sphs = pack.regularHexa(pred,1,0,**kw)
   for sp in sphs:
  sp.state.pos = pos + ori*sp.state.pos
   return sphs

a1 = createAgglomerate(color=(1,0,0))
a2 = createAgglomerate((15,0,0),Quaternion((1,2,3),4),color=(0,1,0))
a3 = createAgglomerate((10,10,10),Quaternion((3,2,1),1),color=(0,0,1))
# ...
for a in (a1,a2,a3):
   O.bodies.append(a)
######################################################################

cheers
Jan

2016-11-09 1:32 GMT+01:00 bruna <email address hidden>:

> New question #403901 on Yade:
> https://answers.launchpad.net/yade/+question/403901
>
> Hello everybody!
>
> I would like to create a sample formed by particles that are sphere
> agglomerates with a determined shape (u-shaped).
> I was thinking that I could create the particle (that is a pattern) in a
> scritpt and them import it in another script as many times as necessary
> rotating and translating the copied particles.
> I don't know if it is possible or if it is an inteligente manner to do
> this.
>
> Does anybody knows a function that could help me or a better way to do
> this?
>
> Thanks a lot for your help and patience.
>
> Bruna.
>
> --
> 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
bruna (brunamot) said :
#2

Hello, Jan.

Thanks a lot for your answer.

I have one question about this code. Is it possible that in instead of the regularHexa I use a pack formed by particles that are formed by spheres (the particle of my sample is going to be an agglomerate of spheres). In other words, I want to create a sample that is formed by particles made from spheres (the spheres that form one particle interact by means of CohFrictMat interactions) and these spheres are responsable to give a determined shape to my particles. I am trying to simulate breakage of particles that has an specific shape.

Once more thanks for all the help!

Bruna.

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

Hi Bruna,
I am a bit confused now.. as I understand it, the script from my previous
message does exactly what you described here: "a pack formed by particles
that are formed by
spheres".. Have you tried it?
Of course, the script is minimal, so the shape of agglomerate is a cube
(could be any shape), but each made of spheres (there are only 3
agglomerates, but it is easy to make arbitrary amount of them)..
If I misunderstand something, could you please try it explain somehow
differently? :-) maybe using a 2D sketch..
Thanks
Jan

2016-11-09 14:03 GMT+01:00 bruna <email address hidden>:

> Question #403901 on Yade changed:
> https://answers.launchpad.net/yade/+question/403901
>
> Status: Answered => Open
>
> bruna is still having a problem:
> Hello, Jan.
>
> Thanks a lot for your answer.
>
> I have one question about this code. Is it possible that in instead of
> the regularHexa I use a pack formed by particles that are formed by
> spheres (the particle of my sample is going to be an agglomerate of
> spheres). In other words, I want to create a sample that is formed by
> particles made from spheres (the spheres that form one particle interact
> by means of CohFrictMat interactions) and these spheres are responsable
> to give a determined shape to my particles. I am trying to simulate
> breakage of particles that has an specific shape.
>
> Once more thanks for all the help!
>
> Bruna.
>
> --
> 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
Bruno Chareyre (bruno-chareyre) said :
#4

Hi Bruna,
Alternatively, it is possible is to place the particles one by one https://github.com/yade/trunk/blob/master/examples/triax-tutorial/script-session1.py#L67 to form clump templates, then they can be generated with random position/orientation using clumpCloud [1]. Not sure it is what you need though, to me the answer of Jan is also right.

Bruno

[1] https://github.com/yade/trunk/blob/master/examples/triax-tutorial/script-session1.py#L67

Revision history for this message
bruna (brunamot) said :
#5

Hi Jan!

Now I see what I wasn't understanding. Your script definitely helped me.
Thanks a lot!

Bruna.

Revision history for this message
bruna (brunamot) said :
#6

Thanks Jan Stránský, that solved my question.