Skip to content

Commit

Permalink
Add warning for velocity set on init
Browse files Browse the repository at this point in the history
  • Loading branch information
ElliottKasoar committed Dec 13, 2024
1 parent 00b9726 commit 583455b
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion janus_core/calculations/md.py
Original file line number Diff line number Diff line change
Expand Up @@ -1569,7 +1569,11 @@ def __init__(
(ensemble_kwargs,) = none_to_dict(ensemble_kwargs)

# Velocity distribution must be non-zero before dynamics is set
self._set_velocity_distribution()
if np.isclose(self.struct.get_kinetic_energy(), 0.0, rtol=0, atol=1e-12):
if self.logger:
self.logger.warning("Velocities modified during Bussi initialisation")
self._set_velocity_distribution()

self.dyn = Bussi(
self.struct,
timestep=self.timestep,
Expand Down

0 comments on commit 583455b

Please sign in to comment.