m3g / CellListMap.jl

Flexible implementation of cell lists to map the calculations of particle-pair dependent functions, such as forces, energies, neighbor lists, etc.
https://m3g.github.io/CellListMap.jl/
MIT License
87 stars 4 forks source link

Suggestion: In a transient simulation, based on the first time step, can I define a "box of interest"? #77

Closed AhmedSalih3d closed 1 year ago

AhmedSalih3d commented 1 year ago

Hello!

In my simulations I often need to define a "box of interest", i.e. any particle which ends up outside this box will be removed from the simulation. I was wondering if there was a way to specify this using this package?

For example for a dam break simulation:

image

I would like any particle leaving the red box to leave the simulation.

I could properly do this using a package to find the bounding box, then a manual check each time step if any particles has left the domain.

I thought it might be of use for others as well, so that is why I suggest it :)

Kind regards

lmiq commented 1 year ago

I would suggest implementing that internally in your package, for example creating a property for each particle that carries that information and skipping computations among particles that are outside the box in the mapped function.

AhmedSalih3d commented 1 year ago

Thank you for the feedback! 😊