nanover.openmm.converter module

Module providing conversion methods between NanoVer and OpenMM.

nanover.openmm.converter.add_openmm_state_to_frame_data(data: FrameData, state: State, include_positions=True, include_energies=True, include_velocities=False, include_forces=False, state_excludes_imd=False) None

Adds the OpenMM state information to the given FrameData, including positions and periodic box vectors.

Parameters:
  • data – NanoVer FrameData to add state information to.

  • state – OpenMM State from which to extract state information.

  • include_positions – If True, the particle positions are read from the state and included in the frame.

  • include_energies – If True, the kinetic and potential energies are read from the state and included in the frame.

  • include_velocities – If True, the particle velocities are read from the state and included in the frame.

  • include_forces – If True, the particle forces are read from the state and included in the frame.

  • state_excludes_imd – Should be True if the state excludes the IMD force contribution.

nanover.openmm.converter.add_openmm_topology_to_frame_data(data: FrameData, topology: Topology) None

Adds the OpenMM topology information to the given FrameData, including residue, chain, atomic and bond information.

Parameters:
  • dataFrameData to add topology information to.

  • topology – OpenMM Topology from which to extract information.

nanover.openmm.converter.openmm_to_frame_data(*, state: State | None = None, topology: Topology | None = None, include_positions=True, include_energies=True, include_velocities=False, include_forces=False, state_excludes_imd=False) FrameData

Converts the given OpenMM state and topology objects into a NanoVer FrameData.

Both fields are optional. For performance reasons, it is best to construct a NanoVer FrameData once with topology information, and from then on just update the state, as that will result in less data being transmitted.

Parameters:
  • state – An optional OpenMM State from which to extract state data.

  • topology – An optional OpenMM Topology from which to extract topological information.

  • include_positions – If True, the particle positions are read from the state and included in the frame.

  • include_energies – If True, the kinetic and potential energies are read from the state and included in the frame.

  • include_velocities – If True, the particle velocities are read from the state and included in the frame.

  • include_forces – If True, the particle forces are read from the state and included in the frame.

Returns:

A FrameData with the state and topology information provided added to it.