This month in rustsim #9 (November 2019 to February 2020)

Welcome to the ninth edition of This month in rustsim! This newsletter will provide you with a summary of important update that occurred within the rustsim community. This includes in particular updates about the nphysics (physics engine), salva (fluid simulation), ncollide (for collision-detection), nalgebra (for linear algebra), and alga (for abstract algebra) crates. This ninth edition will actually contain updates for the past four months.

Join us on discord and on our user forum!

Progress on salva2d and salva3d v0.2

[![salva logo](https://www.salva.rs/img/logo_salva_full.svg)](https://salva.rs)

I am thrilled to announce that the release of massive improvements of salva2d and salva3d v0.2!

Recall that salva is our new project introduced a few months ago dedicated to fluid simulation. The goal of salva is to provide CPU-based, particle-based, 2D and 3D, fluid simulation libraries that can be used for interactive and offline applications like animation. The version 0.2.0 now contains several new features for both pressure resolution as well as nonpressure forces:

With the addition of new traits, it is also possible to define your own pressure resolution scheme as well as your own nonpressure forces. You can see those features in action in the following video:

You can also play with those examples in the 2D WASM version and the 3D WASM version. However, for better performance, you are encouraged to compile and run the examples on the examples2d and examples3d folders while enabling the parallel feature. For example:

git clone https://github.com/rustsim/salva
cd salva/examples3d
cargo run --release --bin all_examples3 --features parallel

In addition to those features it is now possible to:

  • Remove fluids, boundaries, and collider couplings.
  • Add/remove fluid particles after the fluid has been created. This is useful to simulate, e.g., sources of water. You can for example see the faucet demo.
  • Enable the parallel feature to benefit from the parallelism (based on the rayon crate) of most stages of the fluid simulation. This includes parallel collision detection between particles, parallel pressure forces computation, and parallel non-pressure forces computation.

The most important feature that is missing now is a working implementation of adaptive time-stepping. While there is an implementation of the CFL condition, it sometimes breaks the simulation for a reason that has yet to be determined.

What's next for 2020

As mentioned in my previous post about the future of nphysics, the main goal 2020 is to focus on performance. Including (not necessarily in that order):

  • Performing fine-grained performance optimizations, both in term of algorithms (for example rewriting a more efficient broad-phase approach) and in term of implementation (for example writing a SIMD-powered constraints solver).
  • Performance improvements on nalgebra itself (the linear-algebra crate nphysics is based on).
  • Adding parallelism to nphysics and ncollide.

Because I already focused a lot on parallelism on salva, I will start with the third objective: adding parallelism to nphysics and ncollide. This will likely affect the API of low-level components (like the body and collider storages).

Thanks

We would like to thank the whole community and contributors. In particular, thanks to the contributors from the past three months1:

Finally, thanks to all the former, current and new patrons supporting me, sebcrozet, the lead developer of the current crates part of this organization on patreon or GitHub sponsors! This help is greatly appreciated and allows me do spend a significant amount of time developing those crates.


  1. The list of contributors is automatically generated from the past four months' github commit history. Don't hesitate to let us know if your name should have been mentioned here.