← Back to team overview

yade-users team mailing list archive

Re: [Question #247174]: How to exclude sphere-facet interaction data

 

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

    Status: Open => Answered

jduriez proposed the following answer:
Hello,

This is in fact quite easy with python tests about the shape of the two
interacting bodies, using python function isinstance() to know if they
are Facet.

For ex :
for i in O.interactions: # then i.id1 and i.id2 are the IDs of the 2 interacting bodies

   if not (isinstance(O.bodies[i.id1].shape,Facet) or isinstance(O.bodies[i.id2].shape,Facet) ): #isinstance(Object,Class) is true when the "Object" is an instance of the "Class", i.e. here if the shape of body i.id1 or i.id2 is a Facet
         # do your task with the output file


Jérôme

-- 
You received this question notification because you are a member of
yade-users, which is an answer contact for Yade.