Package ffx.openmm

Class Platform

java.lang.Object
ffx.openmm.Platform

public class Platform extends Object
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 Details

    • Platform

      public Platform(com.sun.jna.ptr.PointerByReference pointer)
      OpenMM Platform constructor.
      Parameters:
      pointer - The OpenMM Platform pointer.
    • Platform

      public Platform(String platformName)
      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

      public static Platform findPlatform(StringArray kernelNames)
      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

      public static String getDefaultPluginsDirectory()
      Get the default directory from which to load plugins.
      Returns:
      The default directory from which to load plugins.
    • getName

      public String 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

      public static String 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

      public static Platform getPlatform(int index)
      Get a registered platform by index.
      Parameters:
      index - The index of the platform to get.
      Returns:
      The platform with the specified index.
    • getPlatform_1

      public static Platform getPlatform_1(String name)
      Get a registered platform by name.
      Parameters:
      name - The name of the platform to get.
      Returns:
      The platform with the specified name.
    • getPluginLoadFailures

      public static StringArray getPluginLoadFailures()
      Get the plugin load failures.
      Returns:
      The OpenMMStringArray of plugin load failures.
    • getPropertyDefaultValue

      public String getPropertyDefaultValue(String property)
      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

      public StringArray getPropertyNames()
      Get the names of all platform properties.
      Returns:
      A StringArray containing the names of all platform properties.
    • getPropertyValue

      public String getPropertyValue(Context context, String property)
      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

      public static StringArray loadPluginsFromDirectory(String directory)
      Load plugins from a directory.
      Parameters:
      directory - The directory to load plugins from.
      Returns:
      The OpenMMStringArray of plugins loaded.
    • loadPluginLibrary

      public static void loadPluginLibrary(String file)
      Load a dynamic library that contains a plugin.
      Parameters:
      file - The path to the dynamic library file.
    • registerPlatform

      public static void registerPlatform(Platform platform)
      Register a new platform.
      Parameters:
      platform - The platform to register.
    • setPropertyDefaultValue

      public void setPropertyDefaultValue(String property, String value)
      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

      public void setPropertyValue(Context context, String property, String value)
      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

      public boolean supportsKernels(StringArray kernelNames)
      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.