nanover.app.imd_app module

Module providing an implementation of an NanoVer iMD application, for publishing simulations and trajectories for consumption by clients that can be interacted with in real-time through biasing potentials.

class nanover.app.imd_app.NanoverImdApplication(server: NanoverServer, discovery: DiscoveryServer | None = None, name: str | None = None)

Bases: NanoverFrameApplication

Application-level class for implementing a NanoVer iMD server, something that publishes FrameData that can be consumed, e.g. simulation trajectories, and can received interactive forces in real-time, allowing the simulation to be biased.

>>> with NanoverImdApplication.basic_server() as app: # fire up interactive molecular dynamics
...     with NanoverImdClient() as client:
...         client.interactions # print any active interactions (in this case, none).
{}
DEFAULT_SERVER_NAME: str = 'NanoVer iMD Server'
classmethod basic_server(name: str | None = None, address: str | None = None, port: int | None = None, *, ssl: SSLContext | None = None)

Initialises a basic NanoVer application server with default settings, with a default unencrypted server and ESSD discovery server for finding it on a local area network.

Parameters:
  • name – Name of the server for the purposes of discovery.

  • address – The address at which to bind the server to. If none given, the default address of

  • port – Optional port on which to run the NanoVer server. If none given, default port will be used.

Returns:

An instantiation of a basic NanoVer server, registered with an ESSD discovery server.

close()

Close the application server and all services.

property imd: ImdStateWrapper

The iMD service attached to this application. Use it to access interactive forces sent by clients, so they can be applied to a simulation.

Returns:

An ImdStateWrapper for tracking interactions.

serve_websocket(*, insecure=True, ssl: SSLContext | None = None)