Package ffx.openmm
Class Platform
java.lang.Object
ffx.openmm.Platform
A Platform defines an implementation of all the kernels needed to perform some calculation.
More precisely, a Platform object acts as a registry for a set of KernelFactory
objects which together implement the kernels. The Platform class, in turn, provides a
static registry of all available Platform objects.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoid
destroy()
Destroy the OpenMM Platform instance.static Platform
findPlatform
(StringArray kernelNames) Find a platform that supports a specified set of kernels.static String
Get the default directory from which to load plugins.getName()
Get the name of the OpenMM Platform.static int
Get the number of OpenMM Platforms.static String
Get the OpenMM version.static Platform
getPlatform
(int index) Get a registered platform by index.static Platform
getPlatform_1
(String name) Get a registered platform by name.static StringArray
Get the plugin load failures.com.sun.jna.ptr.PointerByReference
Get the OpenMM Platform pointer.getPropertyDefaultValue
(String property) Get the default value of a platform property.Get the names of all platform properties.getPropertyValue
(Context context, String property) Get the value of a context-specific platform property.double
getSpeed()
Get an estimate of how fast this Platform class is.static void
loadPluginLibrary
(String file) Load a dynamic library that contains a plugin.static StringArray
loadPluginsFromDirectory
(String directory) Load plugins from a directory.static void
registerPlatform
(Platform platform) Register a new platform.void
setPropertyDefaultValue
(String property, String value) Set the default value of a platform property.void
setPropertyValue
(Context context, String property, String value) Set the value of a context-specific platform property.boolean
Determine whether this Platform supports double precision arithmetic.boolean
supportsKernels
(StringArray kernelNames) Determine whether this Platform supports a specified set of kernels.
-
Constructor Details
-
Platform
public Platform(com.sun.jna.ptr.PointerByReference pointer) OpenMM Platform constructor.- Parameters:
pointer
- The OpenMM Platform pointer.
-
Platform
OpenMM Platform constructor.- Parameters:
platformName
- The name of the OpenMM Platform.
-
Platform
public Platform()Default constructor.
-
-
Method Details
-
destroy
public void destroy()Destroy the OpenMM Platform instance. -
findPlatform
Find a platform that supports a specified set of kernels.- Parameters:
kernelNames
- The set of kernels that must be supported.- Returns:
- A platform that supports the specified kernels.
-
getDefaultPluginsDirectory
Get the default directory from which to load plugins.- Returns:
- The default directory from which to load plugins.
-
getName
Get the name of the OpenMM Platform.- Returns:
- The name of the OpenMM Platform.
-
getNumPlatforms
public static int getNumPlatforms()Get the number of OpenMM Platforms.- Returns:
- The number of OpenMM Platforms.
-
getOpenMMVersion
Get the OpenMM version.- Returns:
- The version of OpenMM.
-
getPointer
public com.sun.jna.ptr.PointerByReference getPointer()Get the OpenMM Platform pointer.- Returns:
- The OpenMM Platform pointer.
-
getPlatform
Get a registered platform by index.- Parameters:
index
- The index of the platform to get.- Returns:
- The platform with the specified index.
-
getPlatform_1
Get a registered platform by name.- Parameters:
name
- The name of the platform to get.- Returns:
- The platform with the specified name.
-
getPluginLoadFailures
Get the plugin load failures.- Returns:
- The OpenMMStringArray of plugin load failures.
-
getPropertyDefaultValue
Get the default value of a platform property.- Parameters:
property
- The name of the property to get.- Returns:
- The default value of the property.
-
getPropertyNames
Get the names of all platform properties.- Returns:
- A StringArray containing the names of all platform properties.
-
getPropertyValue
Get the value of a context-specific platform property.- Parameters:
context
- The context for which to get the property value.property
- The name of the property to get.- Returns:
- The value of the property.
-
getSpeed
public double getSpeed()Get an estimate of how fast this Platform class is.- Returns:
- The speed of the OpenMM Platform.
-
loadPluginsFromDirectory
Load plugins from a directory.- Parameters:
directory
- The directory to load plugins from.- Returns:
- The OpenMMStringArray of plugins loaded.
-
loadPluginLibrary
Load a dynamic library that contains a plugin.- Parameters:
file
- The path to the dynamic library file.
-
registerPlatform
Register a new platform.- Parameters:
platform
- The platform to register.
-
setPropertyDefaultValue
Set the default value of a platform property.- Parameters:
property
- The name of the property to set.value
- The new default value for the property.
-
setPropertyValue
Set the value of a context-specific platform property.- Parameters:
context
- The context for which to set the property value.property
- The name of the property to set.value
- The new value for the property.
-
supportsDoublePrecision
public boolean supportsDoublePrecision()Determine whether this Platform supports double precision arithmetic.- Returns:
- true if the Platform supports double precision, false otherwise.
-
supportsKernels
Determine whether this Platform supports a specified set of kernels.- Parameters:
kernelNames
- The set of kernels to test for support.- Returns:
- true if the Platform supports all of the specified kernels, false otherwise.
-