← Back to team overview

yade-users team mailing list archive

Re: [Question #685055]: can we set a mask for a particular particle

 

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

    Status: Open => Answered

Jan Stránský proposed the following answer:
Hello,

I meant that default is b.mask=1[1].
Setting it again to 1 in a for loop has no effect in your script.

> the binary expression for 1 is 00000001, if we want the output to be
1, the only choice is to set b.mask is also 00000001. so I need to set
b.mask = 1??? Is my understanding right?

this I do not understand.. perhaps a short test could make it clear:
###
from yade import export
s1 = sphere((1,0,0),1,mask=1) # 1 = 0b01
s2 = sphere((2,0,0),1,mask=2) # 2 = 0b10
s3 = sphere((3,0,0),1,mask=3) # 3 = 0b11
O.bodies.append((s1,s2,s3))
export.text("maskDefault.txt")
export.text("mask1.txt",mask=1)
export.text("mask2.txt",mask=2)
export.text("mask3.txt",mask=3)
###

> but it seems this command just export all particle' information. not
just ball_list1.

back to OP, all particles are exported just because you used
export.text(...,mask=1) and b.mask of all bodies is 1 (by default).

Also note that apart from exporting, more importantly the b.mask value
determines which particles may interact and which not (!!)

cheers
Jan

[1] https://yade-
dem.org/doc/yade.wrapper.html#yade.wrapper.Body.groupMask

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