lettucecfd / lettuce

Computational Fluid Dynamics based on PyTorch and the Lattice Boltzmann Method
MIT License
223 stars 39 forks source link

Boundaries with index-lists instead of masks #176

Open PhiSpel opened 4 months ago

PhiSpel commented 4 months ago

As solids often only take up a fraction of the domain space, index-lists, i.e., sparse matrix representations, should free up a lot of memory and allow the IBB implementation to work better

MaxBille commented 3 months ago

this also works for other (solid) boundaries. Especially Halfway Bounce Back also increases speed and reduces memory consumption by using batch-indices ("index-lists"). I'm thinking about replacing all boundary-masks with batch-indices of node coordinates or node-populations coordinates depending on domain-dimensions... or we could even make this adaptive, count the number of affected nodes or population, calculate it's sparse-storage requirements (with batch-indices) and compare it to a full mask.