Skip to content

Commit a29f5c0

Browse files
authored
Merge pull request #166 from pyiron/velocities
Implement interactive_velocities_getter()
2 parents 76f7289 + 465d6b1 commit a29f5c0

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

pylammpsmpi/wrapper/ase.py

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -342,6 +342,15 @@ def interactive_stress_getter(self, enable_stress_computation=True):
342342
ss = np.einsum("nij,kj->nik", ss, self._prism.R)
343343
return ss
344344

345+
def interactive_velocities_getter(self):
346+
velocity = np.reshape(
347+
np.array(self._interactive_library.gather_atoms("v", 1, 3)),
348+
(len(self._structure), 3),
349+
)
350+
if _check_ortho_prism(prism=self._prism):
351+
velocity = np.matmul(velocity, self._prism.R.T)
352+
return velocity
353+
345354
def close(self):
346355
if self._interactive_library is not None:
347356
self._interactive_library.close()

0 commit comments

Comments
 (0)