Extract grains by their neighboring phase

24 views
Skip to first unread message

Sören T

unread,
Jul 8, 2019, 10:26:02 AM7/8/19
to MTEX
Good day

this question is rather simple but somehow I can't get mtex to do what it is supposed to.

My aim: I want to get a variable which includes all grains from phase A (Forsterite) which share a boundary with a specific phase B (Enstatite).

Something like that.



AB_grains = grains(grains.boundary('A','B'));


I guess it's quite easy to answer but ....I would be very glad for suggestions.

Thanks in advance!
Sören

ruediger Kilian

unread,
Jul 8, 2019, 12:22:17 PM7/8/19
to mtex...@googlegroups.com
Hi Sören,
easy answer: grains(unique(grains.boundary('A','B').grainId(:)))

Cheers,
Rüdiger

Sören T

unread,
Jul 9, 2019, 8:23:38 AM7/9/19
to MTEX
Thanks a lot! Works fine!

One comment: If specific grains are deleted in advance i.e. outer boundary grains it's not working. 
Reply all
Reply to author
Forward
0 new messages