Fork me on GitHub

Java Wrappers for the OpenMM C API

Force Field X makes use of OpenMM via Java wrappers for the OpenMM C API.

The wrappers are automatically generated using Jnaerator and are available on Github in case they may be useful to others:

Java Wrappers for the OpenMM C API

Including the Library in a Maven project.

                    
                <dependency>
                    <groupId>edu.uiowa.jopenmm</groupId>
                    <artifactId>jopenmm-fat</artifactId>
                    <version>7.3.0</version>
                </dependency>
                

How the Library Works

To use the Java OpenMM Wrappers within Java, please first initialize the library using the provided OpenMMUtils class:

OpenMMUtils.init();

This will extract the OpenMM binary libraries from the openmm-fat.jar file to a temporary directory and configure JNA to find them. OpenMM plugins can be loaded from the directory OpenMMUtils.OPENMM_PLUGIN_DIR as follows:

PointerByReference plugins =
                    OpenMM_Platform_loadPluginsFromDirectory(OpenMMUtils.OPENMM_PLUGIN_DIR);