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

    Status: Open => Answered

Jan Stránský proposed the following answer:
Hi Leonard,

after findBodiesToBeDel, some bodies BodiesToBeDel multiple times (each body 
may be associated with multiple interactions).
Then in findBodiesToBeDel, you erase some bodies, but then you try to erase the 
same ID (which would be OK), but you try to get the id as "i.id", but "i" was 
already erased and (probably, did not investigated it more) was deleted in C++, 
ending in segmentation fault.

Try it with set using ids, something like:
###
IdsToBeDel = set()
def findBodiesToBeDel():
    for i in Ids:
        for j in Ids:
            if i>=j:
                continue
            else:
                if O.interactions.has(i,j):
                    IdsToBeDel.add(i)
                    IdsToBeDel.add(j)
findBodiesToBeDel()
def eraseOverlapBodies():
    for i in IdsToBeDel:
        O.bodies.erase(i)
eraseOverlapBodies()
###

cheers
Jan

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

Reply via email to