Skip to content

Commit

Permalink
Implement interactive_velocities_getter()
Browse files Browse the repository at this point in the history
  • Loading branch information
jan-janssen committed Dec 8, 2023
1 parent 76f7289 commit 465d6b1
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions pylammpsmpi/wrapper/ase.py
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand Down

0 comments on commit 465d6b1

Please sign in to comment.