OK after fixing the thrust::reduce_by_key() usage, I went back to look into getting rid of it entirely.
The situation is definitely more complex than in the rigid body case: in this case, what was developed is a bridge between #SPH and #FEM / #FEA : the SPH particles compute the forces acting on them, and then distribute these forces to the associated FEA nodes. Each particle has up to 4 FEA node associated, and a FEA node can have several SPH particles contributing to it. The mapping is therefore more intricate than in the rigid body case, BUT we can sacrifice some memory to build a “reverse map” that instead of listing, for each SPH particle, which FEA nodes are associated with it, lists for each FEA node where to find the associated SPH particles' contributions.
We can do this because these mappings are fixed in a given execution: precomputing this map wastes a little time at the beginning (presently it's not even done in parallel, although it could be parallelized), and a little memory, for ENORMOUS gains in performance: again, a quick&dirty implementation, with no particular optimization, is 5x faster (median 0.04ms vs 0.19+ms in this test case).
Definitely worth it, especially considering that, as in the rigid body case, (1) it can be further optimized and (2) we can add compensated summation if we need the additional accuracy. Plus, it helps eliminate this dependency on Thrust.