nanover.ase.frame_adaptor module
Methods for transmitting a simulation frame from ASE.
- nanover.ase.frame_adaptor.send_ase_frame(ase_atoms: Atoms, frame_publisher: FramePublisher, include_velocities=False, include_forces=False) Callable[[], None]
Hook to transmit the current state of an ASE Atoms as a frame.
- Parameters:
ase_atoms – ASE
Atoms
object from which to extract frame.frame_publisher – The frame publisher on which to send the produced
nanover.trajectory.FrameData
.
When attached to an ASE simulation, such as a
Langevin
dynamics simulation, this method will be called to send the frame on the givenFrameServer
.Example
>>> frame_server = FrameServer(address="localhost", port=54321) >>> atoms = FaceCenteredCubic(directions=[[1, 0, 0], [0, 1, 0], [0, 0, 1]], ... symbol="Cu", size=(2, 2, 2), pbc=True) >>> dynamics = Langevin(atoms, timestep=0.5, temperature_K=300, friction=1.0) >>> dynamics.attach(send_ase_frame(atoms, frame_publisher), interval=2)