Skip to content

Commit

Permalink
Merge pull request #166 from pyiron/velocities
Browse files Browse the repository at this point in the history
Implement interactive_velocities_getter()
  • Loading branch information
jan-janssen authored Dec 9, 2023
2 parents 76f7289 + 465d6b1 commit a29f5c0
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 a29f5c0

Please sign in to comment.