IRL2 / nanover-rs

Other
0 stars 0 forks source link

Send user forces in the FrameData #182

Closed jbarnoud closed 9 months ago

jbarnoud commented 9 months ago

To compute the work associated with an interaction, we need access to the force it applies. This pull request adds this force to the FrameData as a sparse array. The force is split in two arrays in the FrameData: force.user.index contains the indices of the atoms that have a force associated with them, force.user.sparse contains the flattened array of forces for each of these indices.

The pull request also introduces some refactoring in the bookkeeping of the simulation thread which avoids having an inconsistent state.