New question #204526 on Yade: https://answers.launchpad.net/yade/+question/204526
Hi, I need to delete some particles inside my model and I dont know what is the best and physical/numerical correct way to do this. If I say O.bodies.erase(id) it erases the body and the interactions will be erased in the next time step by InteractionLoop. But when I have capillary law active, I have to use neverErase flag as True to avoid a segmentation fault. So there are three options how to do this and I want to know what is the best option: OPTION 1: only erase bodies Because neverErase flag is True, interaction will still be active and can influence results, right? So if I later simulate increasing water level by deleting liquid bridges this remaining interactions from non-existant bodies can lead to instability, right? O.bodies.erase(id) OPTION 2: erase interactions manually first and erase bodies afterwards To avoid the influence of interactions from non-existant bodies, one can erase the interactions before erasing the associated bodies. This normally leads to a segmentation fault. One can del with the segmantation fault by simply run 1 step after every erased body. for i in O.bodies[id].intrs(): O.interactions.erase(i.id1,i.id2) O.bodies.erase(id) O.run(1,True) OPTION 3: deactivate capillary law, set neverErase=False, erase all interactions, delete bodies, set neverErase=True, activate capillary law again I did not test this option, so I dont know if it works. Law2_ScGeom_CapillaryPhys_Capillarity.dead=True Law2_ScGeom_MindlinPhys_Mindlin.neverErase=False O.interactions.clear() O.bodies.erase(id) Law2_ScGeom_MindlinPhys_Mindlin.neverErase=True Law2_ScGeom_CapillaryPhys_Capillarity.dead=False So what do you think is the best option in this case? Christian -- You received this question notification because you are a member of yade-users, which is an answer contact for Yade. _______________________________________________ Mailing list: https://launchpad.net/~yade-users Post to : [email protected] Unsubscribe : https://launchpad.net/~yade-users More help : https://help.launchpad.net/ListHelp

