diff --git a/pylammpsmpi/wrapper/ase.py b/pylammpsmpi/wrapper/ase.py index 960ea74..4bfa68b 100644 --- a/pylammpsmpi/wrapper/ase.py +++ b/pylammpsmpi/wrapper/ase.py @@ -342,6 +342,15 @@ def interactive_stress_getter(self, enable_stress_computation=True): ss = np.einsum("nij,kj->nik", ss, self._prism.R) return ss + def interactive_velocities_getter(self): + velocity = np.reshape( + np.array(self._interactive_library.gather_atoms("v", 1, 3)), + (len(self._structure), 3), + ) + if _check_ortho_prism(prism=self._prism): + velocity = np.matmul(velocity, self._prism.R.T) + return velocity + def close(self): if self._interactive_library is not None: self._interactive_library.close()