cellmodeller / CellModeller

GPU-accelerated multicellular modelling framework
http://cellmodeller.github.io/CellModeller/
Other
57 stars 48 forks source link

Remove a cell from the simulation #20

Open alexweisberg opened 5 years ago

alexweisberg commented 5 years ago

Thank you for your patience with these questions. I am wondering if it is currently possible to remove a cell completely from a simulation? Essentially to simulate a cell "lysing" or otherwise being removed from an environment? Currently it is easy to set the growth rate to zero and change the cell type to treat a cell as "dead" however it still takes up space in the simulation as debris. Simulator.py has addCell() but there is no equivalent removeCell() or similar that I could find.

danieljones333 commented 3 years ago

Just wondering if anyone has found a good way to do this? This would be very useful for simulating e.g. cell populations growing in microfluidic devices where cells are flushed away as they grow outside of a defined area.

timrudge commented 3 years ago

Hi - I have created a branch with a working version of cell death (ie. remove a cell from sim) here. There is now a flag that can be set on each cell called killFlag. Set it to True to remove the cell. This requires some more testing and conversion of integrators (currently on CLEulerIntegrator is working). I will keep working on it slowly...

gugagog commented 3 years ago

Hello,

I really appreciate your help with installing the software. I was curious if you got a chance to add killFlag init CLCrankNicIntegrator.

Thank you!

timrudge commented 2 years ago

The death branch needs some work to get all the modules working, any help here would be appreciated. The principle is to keep a list of indices of live cells and update this when cells die or are created.

ar-valdez commented 1 year ago

@timrudge Is there a way to "swap" the cell with killFlag to the end of the cell array, and later remove the last cell?I'll try that and let you know my success... (or failure)