### Verify OpenMM Installation Command to verify the successful installation of OpenMM. This utility checks for the presence of OpenMM, confirms GPU acceleration capabilities (CUDA, OpenCL, HIP platforms), and validates the consistency of results across different platforms. ```Shell python -m openmm.testInstallation ``` -------------------------------- ### Install OpenMM using Pip Instructions for installing the OpenMM molecular simulation library using the Pip package manager. This covers the base installation with CPU/OpenCL/Reference platforms, and extending it to include CUDA for NVIDIA GPUs or HIP for AMD GPUs, ensuring optimal performance on various hardware. ```Shell pip install openmm ``` ```Shell pip install openmm[cuda12] ``` ```Shell pip install openmm[hip6] ``` -------------------------------- ### Verify OpenMM Installation Command to verify that OpenMM is correctly installed. This check confirms installation, assesses GPU acceleration availability (CUDA, OpenCL, HIP), and validates platform consistency. ```Bash python -m openmm.testInstallation ``` -------------------------------- ### Install OpenMM using Conda Instructions for installing the OpenMM molecular simulation library using the Conda package manager. This includes general installation and targeting specific CUDA versions for GPU acceleration, ensuring compatibility with different NVIDIA GPU setups. ```Shell conda install -c conda-forge openmm ``` ```Shell conda install -c conda-forge openmm cuda-version=12 ``` -------------------------------- ### Install OpenMM-Setup via Conda This command installs the OpenMM-Setup graphical application using the Conda package manager from the conda-forge channel. It is a prerequisite for launching the application. ```Shell conda install -c conda-forge openmm-setup ``` -------------------------------- ### Navigate to OpenMM Examples Directory in Terminal This command demonstrates how to change the current directory to the OpenMM examples folder in a terminal or command prompt. Typical directory paths are provided for Linux/Mac and Windows systems. ```Bash cd ``` -------------------------------- ### Launch OpenMM-Setup Application This command launches the OpenMM-Setup graphical user interface. Upon execution, it automatically opens a window in the default web browser for interaction. ```Shell openmm-setup ``` -------------------------------- ### Build OpenMM Documentation using Make Example command to build the OpenMM User Guide and Developer Guide in HTML format on Linux or Mac using the `make` utility and the `sphinxhtml` target. ```shell make sphinxhtml ``` -------------------------------- ### Complete Molecular Dynamics Simulation with AMBER Files in OpenMM This comprehensive Python script demonstrates a full molecular dynamics simulation workflow using OpenMM, starting from AMBER `prmtop` and `inpcrd` files. It includes loading the system, creating an OpenMM `System` object, setting up a Langevin integrator, minimizing energy, and running a simulation with PDB and state data reporters. ```python from openmm.app import * from openmm import * from openmm.unit import * from sys import stdout inpcrd = AmberInpcrdFile('input.inpcrd') prmtop = AmberPrmtopFile('input.prmtop', periodicBoxVectors=inpcrd.boxVectors) system = prmtop.createSystem(nonbondedMethod=PME, nonbondedCutoff=1*nanometer, constraints=HBonds) integrator = LangevinMiddleIntegrator(300*kelvin, 1/picosecond, 0.004*picoseconds) simulation = Simulation(prmtop.topology, system, integrator) simulation.context.setPositions(inpcrd.positions) simulation.minimizeEnergy() simulation.reporters.append(PDBReporter('output.pdb', 1000)) simulation.reporters.append(StateDataReporter(stdout, 1000, step=True, potentialEnergy=True, temperature=True)) simulation.step(10000) ``` -------------------------------- ### Install OpenMM using Conda Commands to install OpenMM via the Conda package manager, including options for specific CUDA versions. This method is recommended for general use and specific CUDA versions. Miniconda is required. ```Bash conda install -c conda-forge openmm conda install -c conda-forge openmm cuda-version=12 ``` -------------------------------- ### Loading CHARMM36 Force Field Files in OpenMM Demonstrates how to initialize a ForceField object in OpenMM by specifying the main 'charmm36.xml' file along with a chosen water model file, such as 'charmm36/water.xml', which includes the default CHARMM water and ions. ```Python forcefield = ForceField('charmm36.xml', 'charmm36/water.xml') ``` -------------------------------- ### Simulate Molecular Dynamics with OpenMM using CHARMM Files This Python example illustrates how to perform a molecular dynamics simulation in OpenMM by loading system data from CHARMM .psf and .pdb files. It demonstrates the use of CharmmParameterSet to load multiple force field definition files, which are then passed to createSystem for system construction. The simulation proceeds with energy minimization and Langevin dynamics, reporting state data and PDB output. ```Python from openmm.app import * from openmm import * from openmm.unit import * from sys import stdout, exit, stderr psf = CharmmPsfFile('input.psf') pdb = PDBFile('input.pdb') params = CharmmParameterSet('charmm22.rtf', 'charmm22.prm') system = psf.createSystem(params, nonbondedMethod=NoCutoff, nonbondedCutoff=1*nanometer, constraints=HBonds) integrator = LangevinMiddleIntegrator(300*kelvin, 1/picosecond, 0.004*picoseconds) simulation = Simulation(psf.topology, system, integrator) simulation.context.setPositions(pdb.positions) simulation.minimizeEnergy() simulation.reporters.append(PDBReporter('output.pdb', 1000)) simulation.reporters.append(StateDataReporter(stdout, 1000, step=True, potentialEnergy=True, temperature=True)) simulation.step(10000) ``` -------------------------------- ### Manage Force Fields with OpenMM SystemGenerator This example illustrates the use of `SystemGenerator` from `openmmforcefields` to simplify force field management. It shows how to initialize `SystemGenerator` with specified biopolymer and small molecule force fields, including custom `ForceField` keyword arguments, and how to create an OpenMM `System` from a `Topology` object, optionally with additional `Molecule` objects for small molecule parameterization. ```python # Define the keyword arguments to feed to ForceField from openmm import unit, app forcefield_kwargs = { 'constraints' : app.HBonds, 'rigidWater' : True, 'removeCMMotion' : False, 'hydrogenMass' : 4*unit.amu } # Initialize a SystemGenerator using GAFF from openmmforcefields.generators import SystemGenerator system_generator = SystemGenerator(forcefields=['amber/ff14SB.xml', 'amber/tip3p_standard.xml'], small_molecule_forcefield='gaff-2.11', forcefield_kwargs=forcefield_kwargs, cache='db.json') # Create an OpenMM System from an OpenMM Topology object system = system_generator.create_system(openmm_topology) # Alternatively, create an OpenMM System from an OpenMM Topology object and a list of OpenFF Molecule objects molecules = Molecule.from_file('molecules.sdf', file_format='sdf') system = system_generator.create_system(openmm_topology, molecules=molecules) ``` -------------------------------- ### Initialize ForceField with Amber14 All and TIP3P-FB Water This snippet demonstrates how to initialize an OpenMM `ForceField` object using the `amber14-all.xml` shortcut, which conveniently includes parameters for proteins, DNA, RNA, and lipids. It also specifies the `amber14/tip3pfb.xml` file for the TIP3P-FB water model and compatible ions, a common setup for many molecular dynamics simulations. ```Python forcefield = ForceField('amber14-all.xml', 'amber14/tip3pfb.xml') ``` -------------------------------- ### OpenMM createSystem Nonbonded Interaction Parameters Detailed API documentation for parameters controlling nonbonded interactions within the `createSystem` method in OpenMM, including available methods, cutoff distances, error tolerances, and switching functions. ```APIDOC Method: createSystem Parameters for Nonbonded Interactions: nonbondedMethod: Enum Description: Specifies the method for treating nonbonded interactions. Valid Values: - NoCutoff: No cutoff is applied. - CutoffNonPeriodic: Reaction field method with cutoff. Not valid for AMOEBA. - CutoffPeriodic: Reaction field method with cutoff and periodic boundary conditions. Not valid for AMOEBA. - Ewald: Ewald summation for long-range Coulomb interactions with periodic boundary conditions. Rarely used due to PME's speed. Not valid for AMOEBA. - PME: Particle Mesh Ewald method for long-range Coulomb interactions with periodic boundary conditions. - LJPME: PME method for both Coulomb and Lennard-Jones long-range interactions with periodic boundary conditions. Constraints: - For AMOEBA force field, only `NoCutoff` and `PME` are valid. - For implicit solvent runs with AMOEBA, only `NoCutoff` is available. nonbondedCutoff: Distance (e.g., 1*nanometer, 12*angstroms) Description: The cutoff distance for nonbonded interactions. Required when `nonbondedMethod` is not `NoCutoff`. Units must be specified (e.g., `1*nanometer`). ewaldErrorTolerance: float Description: Optional. Error tolerance for the force computation when using `Ewald`, `PME`, or `LJPME`. Roughly equals the fractional error in forces due to Ewald summation truncation. Default Value: 0.0005 (if not specified). switchDistance: Distance (e.g., 0.9*nanometer) Description: Optional. Specifies a distance at which Lennard-Jones interactions begin to smoothly go to zero. This causes interactions to be smoothly truncated rather than sharply at `nonbondedCutoff`, improving energy conservation. Only applicable when a cutoff is used. vdwCutoff: Distance (e.g., 1.2*nanometer) Description: (AMOEBA specific) Optional. A cutoff value for Lennard-Jones interactions that is independent of `nonbondedCutoff`. If not specified for AMOEBA, the value of `nonbondedCutoff` is used for Lennard-Jones interactions. ``` -------------------------------- ### Initialize OpenMM Plugins, System, and Forces This C++ snippet demonstrates the initial setup of an OpenMM simulation. It loads all available OpenMM plugins, allocates a `MyOpenMMData` handle, creates an OpenMM `System`, and initializes `NonbondedForce` and `GBSAOBCForce` objects, setting their respective dielectric constants. ```C++ // Load all available OpenMM plugins from their default location. OpenMM::Platform::loadPluginsFromDirectory (OpenMM::Platform::getDefaultPluginsDirectory()); // Allocate space to hold OpenMM objects while we're using them. MyOpenMMData* omm = new MyOpenMMData(); // Create a System and Force objects within the System. Retain a reference // to each force object so we can fill in the forces. Note: the OpenMM // System takes ownership of the force objects;don't delete them yourself. omm->system = new OpenMM::System(); OpenMM::NonbondedForce* nonbond = new OpenMM::NonbondedForce(); OpenMM::GBSAOBCForce* gbsa = new OpenMM::GBSAOBCForce(); omm->system->addForce(nonbond); omm->system->addForce(gbsa); // Specify dielectrics for GBSA implicit solvation. gbsa->setSolventDielectric(solventDielectric); gbsa->setSoluteDielectric(soluteDielectric); ``` -------------------------------- ### myInitializeOpenMM Function API Reference Comprehensive API documentation for the `myInitializeOpenMM` function, detailing its purpose, input parameters, and return values for setting up OpenMM simulations. It explains how the function takes existing MD code parameters and returns an OpenMM handle and the platform used. ```APIDOC myInitializeOpenMM( atoms[]: const MyAtomInfo[] - Description: Array of atom information from the existing MD code, including PDB, mass, charge, VDW radius/energy, and GBSA radius/scale factor. temperature: double - Description: The simulation temperature in Kelvin. frictionInPs: double - Description: The friction coefficient for the integrator, in picoseconds. solventDielectric: double - Description: The dielectric constant for the solvent, used in GBSA implicit solvation. soluteDielectric: double - Description: The dielectric constant for the solute, used in GBSA implicit solvation. stepSizeInFs: double - Description: The simulation step size in femtoseconds. platformName: std::string& - Description: An output parameter that will be populated with the name of the OpenMM platform used for computation (e.g., CUDA, OpenCL, Reference). ) Returns: MyOpenMMData* - Description: A pointer to a `MyOpenMMData` structure, which acts as a handle containing initialized OpenMM objects (System, Context, Integrator) for efficient computations. ``` -------------------------------- ### Initialize OpenMM System and Forces This snippet demonstrates the initial setup of an OpenMM simulation. It involves loading OpenMM plugins, allocating a custom data structure to hold OpenMM objects, and creating core components like the OpenMM System, NonbondedForce, and GBSAOBCForce. It also shows how to add these forces to the System and configure dielectric properties for implicit solvation, noting that the System takes ownership of the force objects. ```C OpenMM::Platform::loadPluginsFromDirectory (OpenMM::Platform::getDefaultPluginsDirectory()); // Allocate space to hold OpenMM objects while we're using them. MyOpenMMData* omm = new MyOpenMMData(); // Create a System and Force objects within the System. Retain a reference // to each force object so we can fill in the forces. Note: the OpenMM // System takes ownership of the force objects;don't delete them yourself. omm->system = new OpenMM::System(); OpenMM::NonbondedForce* nonbond = new OpenMM::NonbondedForce(); OpenMM::GBSAOBCForce* gbsa = new OpenMM::GBSAOBCForce(); omm->system->addForce(nonbond); omm->system->addForce(gbsa); // Specify dielectrics for GBSA implicit solvation. gbsa->setSolventDielectric(solventDielectric); gbsa->setSoluteDielectric(soluteDielectric); ``` -------------------------------- ### OpenMM C++: Setting Up and Running an Argon Simulation This comprehensive example demonstrates the fundamental steps to set up and run a short molecular dynamics simulation of three argon atoms using the OpenMM C++ API. It covers creating a `System` with non-bonded forces, adding particles with their masses and Lennard-Jones parameters, defining a `VerletIntegrator` for time evolution, and finally initializing the `Context` to manage the simulation state and select the optimal platform. ```cpp // Create a system with nonbonded forces. OpenMM::System system; OpenMM::NonbondedForce* nonbond = new OpenMM::NonbondedForce(); system.addForce(nonbond); ``` ```cpp // Create three atoms. std::vector initPosInNm(3); for (int a = 0; a < 3; ++a) { initPosInNm[a] = OpenMM::Vec3(0.5*a,0,0); // location, nm system.addParticle(39.95); // mass of Ar, grams per mole // charge, L-J sigma (nm), well depth (kJ) nonbond->addParticle(0.0, 0.3350, 0.996); // vdWRad(Ar)=.188 nm } ``` ```cpp OpenMM::VerletIntegrator integrator(0.004); // step size in ps ``` ```cpp // Let OpenMM Context choose best platform. OpenMM::Context context(system, integrator); ``` -------------------------------- ### Install OpenMM Force Fields via Conda Installs the `openmmforcefields` package, which provides residue template generators for small molecules, using the conda package manager from the `conda-forge` channel. This package is a prerequisite for using SMIRNOFF or GAFF template generators. ```Shell conda install -c conda-forge openmmforcefields ``` -------------------------------- ### Install OpenMM using Pip Commands to install OpenMM via the Pip package manager, including options to add CUDA or HIP platform support. This method is recommended for AMD GPU users to include the HIP platform. A Python distribution is required. ```Bash pip install openmm pip install openmm[cuda12] pip install openmm[hip6] ``` -------------------------------- ### Set Initial Atom Positions for Simulation This line sets the starting coordinates for all atoms in the simulation. It typically uses positions loaded from an external file, such as a PDB (Protein Data Bank) file, ensuring the simulation begins from a defined molecular configuration. ```Python simulation.context.setPositions(pdb.positions) ``` -------------------------------- ### Perform Energy Minimization in OpenMM This command instructs OpenMM to perform a local energy minimization. This step is crucial at the beginning of a simulation, especially when starting from experimental structures (like PDB files), as it helps relax any unfavorable atomic contacts or high-energy configurations that could lead to instability or large forces. ```Python simulation.minimizeEnergy() ``` -------------------------------- ### OpenMM C++ Simulation Setup and Execution This C++ code snippet demonstrates the typical workflow for setting up and running a molecular dynamics simulation using OpenMM. It illustrates how to create a System, add particles, define various force field terms like harmonic bonds and angles, initialize an Integrator and Context, set initial conditions, and finally advance the simulation for a specified number of time steps. ```cpp System system; for (int i = 0; i < numParticles; ++i) system.addParticle(particle[i].mass); HarmonicBondForce* bonds = new HarmonicBondForce(); system.addForce(bonds); for (int i = 0; i < numBonds; ++i) bonds->addBond(bond[i].particle1, bond[i].particle2, bond[i].length, bond[i].k); HarmonicAngleForce* angles = new HarmonicAngleForce(); system.addForce(angles); for (int i = 0; i < numAngles; ++i) angles->addAngle(angle[i].particle1, angle[i].particle2, angle[i].particle3, angle[i].angle, angle[i].k); // ...create and initialize other force field terms in the same way LangevinMiddleIntegrator integrator(temperature, friction, stepSize); Context context(system, integrator); context.setPositions(initialPositions); context.setVelocities(initialVelocities); integrator.step(10000); ``` -------------------------------- ### CHARMM36 Force Field XML Files and Parameters A comprehensive list of XML files provided with the CHARMM36 force field, detailing the molecular components and parameters each file contains. This includes the main force field file and various water models with compatible ions. ```APIDOC File: charmm36.xml Parameters: Protein, DNA, RNA, lipids, carbohydrates, and small molecules File: charmm36/water.xml Parameters: Default CHARMM water model (a modified version of TIP3P) and ions File: charmm36/spce.xml Parameters: SPC/E water model and ions File: charmm36/tip3p-pme-b.xml Parameters: TIP3P-PME-B water model and ions File: charmm36/tip3p-pme-f.xml Parameters: TIP3P-PME-F water model and ions File: charmm36/tip4pew.xml Parameters: TIP4P-Ew water model and ions File: charmm36/tip4p2005.xml Parameters: TIP4P-2005 water model and ions File: charmm36/tip5p.xml Parameters: TIP5P water model and ions File: charmm36/tip5pew.xml Parameters: TIP5P-Ew water model and ions ``` -------------------------------- ### OpenMM prmtop.createSystem Method API Reference Comprehensive API documentation for the `prmtop.createSystem` method in OpenMM, used to create a system from a prmtop file. This method allows for extensive configuration of implicit solvent models and related parameters, including dielectric constants and salt concentration effects. ```APIDOC prmtop.createSystem(implicitSolvent=None, soluteDielectric=1.0, solventDielectric=78.5, implicitSolventKappa=0.0) - Creates an OpenMM System object from a prmtop file, allowing configuration of AMBER implicit solvent models and related parameters. - Parameters: - implicitSolvent: Specifies the implicit solvent model to use. Allowed values: - None: No implicit solvent is used. - HCT: Hawkins-Cramer-Truhlar GBSA model (corresponds to igb=1 in AMBER). - OBC1: Onufriev-Bashford-Case GBSA model using GBOBCI parameters (corresponds to igb=2 in AMBER). - OBC2: Onufriev-Bashford-Case GBSA model using GBOBCII parameters (corresponds to igb=5 in AMBER). This is the same model used by the GBSA-OBC files. - GBn: GBn solvation model (corresponds to igb=7 in AMBER). - GBn2: GBn2 solvation model (corresponds to igb=8 in AMBER). - soluteDielectric: float, optional. The dielectric constant to use for the solute. Defaults to 1.0. - solventDielectric: float, optional. The dielectric constant to use for the solvent. Defaults to 78.5 (or 78.3 when building from a force field). - implicitSolventKappa: float, optional. The Debye-Huckel screening parameter to model non-zero salt concentration. Defaults to 0.0. - Returns: A System object. ``` -------------------------------- ### Initialize OpenMM Brownian Integrator This example shows the initialization of an OpenMM `BrownianIntegrator` for performing Brownian (diffusive) dynamics. Similar to Langevin dynamics, it requires specifying the simulation temperature, the friction coefficient, and the integration step size. ```Python integrator = BrownianIntegrator(300*kelvin, 1/picosecond, 0.002*picoseconds) ``` -------------------------------- ### Configure AMOEBA Nonbonded Interactions with VDW Cutoff in OpenMM Example of creating an OpenMM system specifically for the AMOEBA force field. It demonstrates the use of `vdwCutoff` to specify an independent cutoff distance for Lennard-Jones interactions, separate from the electrostatic `nonbondedCutoff`. ```python system = forcefield.createSystem(nonbondedMethod=PME, nonbondedCutoff=1*nanometer, ewaldErrorTolerance=0.00001, vdwCutoff=1.2*nanometer) ``` -------------------------------- ### Choose OpenMM Integrator and Context This C++ snippet initiates the process of selecting an OpenMM `Integrator` for time advancement and creating a `Context` to link the `System` with the `Integrator` for simulation setup. It highlights the importance of unit consistency when passing arguments to these OpenMM objects. ```C++ // Choose an Integrator for advancing time, and a Context connecting the // System with the Integrator for simulation. Let the Context choose the ``` -------------------------------- ### Initialize OpenMM Langevin Middle Integrator This example shows how to instantiate a `LangevinMiddleIntegrator` in OpenMM. It requires specifying the simulation temperature, friction coefficient, and step size, all with appropriate units. This integrator is a leapfrog type, commonly preferred for accurate configurational sampling. ```Python integrator = LangevinMiddleIntegrator(300*kelvin, 1/picosecond, 0.004*picoseconds) ``` -------------------------------- ### Applying Anisotropic Monte Carlo Barostat with Axis-Specific Pressure Shows how to use the MonteCarloAnisotropicBarostat to allow independent scaling of each periodic box axis. This example applies different pressures along the X, Y, and Z axes, enabling the box to change shape anisotropically. ```python system.addForce(MonteCarloAnisotropicBarostat((1, 1, 2)*bar, 300*kelvin)) ``` -------------------------------- ### Initializing OpenMM Simulation with AMBER Topology and Positions This snippet shows how to initialize an OpenMM `Simulation` object using the topology derived from the `prmtop` file and atom positions from the `inpcrd` file. This approach reflects how AMBER stores topology and positions in separate files, contrasting with PDB files that combine both. ```python simulation = Simulation(prmtop.topology, system, integrator) simulation.context.setPositions(inpcrd.positions) ``` -------------------------------- ### Initialize OpenMM ForceField with Implicit Solvent Model Demonstrates how to initialize an OpenMM ForceField object by including an additional XML file to specify a Generalized Born implicit solvent model. This example uses the 'gbn2.xml' model, which corresponds to the GBn2 solvation model. ```python forcefield = ForceField('amber14-all.xml', 'implicit/gbn2.xml') ``` -------------------------------- ### Load PDB File with OpenMM in Python This Python code loads a biomolecular system from a PDB file into an OpenMM 'PDBFile' object. It reads the molecular topology and atom positions, making them available for simulation setup. The file name can be customized, and 'PDBxFile' can be used for PDBx/mmCIF format. ```Python pdb = PDBFile('input.pdb') ``` -------------------------------- ### Example OpenMM Program Output with PDB Data This snippet provides an example of the detailed output generated by an OpenMM simulation, specifically the 'HelloArgon' program. It includes the platform used and a series of PDB-formatted lines showing atomic coordinates over different simulation models. ```Log/Output REMARK Using OpenMM platform Reference MODEL 1 ATOM 1 AR AR 1 0.000 0.000 0.000 1.00 0.00 ATOM 2 AR AR 1 5.000 0.000 0.000 1.00 0.00 ATOM 3 AR AR 1 10.000 0.000 0.000 1.00 0.00 ENDMDL ... MODEL 250 ATOM 1 AR AR 1 0.233 0.000 0.000 1.00 0.00 ATOM 2 AR AR 1 5.068 0.000 0.000 1.00 0.00 ATOM 3 AR AR 1 9.678 0.000 0.000 1.00 0.00 ENDMDL MODEL 251 ATOM 1 AR AR 1 0.198 0.000 0.000 1.00 0.00 ATOM 2 AR AR 1 5.082 0.000 0.000 1.00 0.00 ATOM 3 AR AR 1 9.698 0.000 0.000 1.00 0.00 ENDMDL MODEL 252 ATOM 1 AR AR 1 0.165 0.000 0.000 1.00 0.00 ATOM 2 AR AR 1 5.097 0.000 0.000 1.00 0.00 ATOM 3 AR AR 1 9.717 0.000 0.000 1.00 0.00 ENDMDL ``` -------------------------------- ### Configure OpenMM Implicit Solvent and Dielectrics for AMOEBA This snippet illustrates how to initialize a force field for implicit solvent simulations with AMOEBA by including the 'amoeba2009_gk.xml' file. It also shows how to specify custom solute and solvent dielectric values for the system, noting that 'NoCutoff' is the only available nonbonded method for this setup. ```Python forcefield = ForceField('amoeba2009.xml', 'amoeba2009_gk.xml') ``` ```Python system=forcefield.createSystem(nonbondedMethod=NoCutoff, soluteDielectric=2.0, solventDielectric=80.0) ``` -------------------------------- ### Initialize OpenMM System and Force Objects This snippet demonstrates the initialization of an OpenMM System and various Force objects, including NonbondedForce, HarmonicBondForce, HarmonicAngleForce, and PeriodicTorsionForce. It shows how to create these objects and add them to the System, emphasizing that the System manages their memory. ```C++ OpenMM::System& system = *(omm->system = new OpenMM::System()); OpenMM::NonbondedForce& nonbond = *new OpenMM::NonbondedForce(); OpenMM::HarmonicBondForce& bondStretch = *new OpenMM::HarmonicBondForce(); OpenMM::HarmonicAngleForce& bondBend = *new OpenMM::HarmonicAngleForce(); OpenMM::PeriodicTorsionForce& bondTorsion = *new OpenMM::PeriodicTorsionForce(); system.addForce(&nonbond); system.addForce(&bondStretch); system.addForce(&bondBend); system.addForce(&bondTorsion); ``` -------------------------------- ### Initialize ForceField with Amber14 All, TIP3P-FB, and GLYCAM This example shows how to initialize an OpenMM `ForceField` object for systems containing carbohydrates. It builds upon the standard `amber14-all.xml` and `amber14/tip3pfb.xml` by additionally including `amber14/GLYCAM_06j-1.xml`, which provides specific parameters for carbohydrates. Users should be aware that GLYCAM uses its own naming conventions for residues. ```Python forcefield = ForceField('amber14-all.xml', 'amber14/tip3pfb.xml', 'amber14/GLYCAM_06j-1.xml') ``` -------------------------------- ### Compiling OpenMM Examples with Makefile on Mac/Linux Executes the `make` command to compile the OpenMM example programs using the provided Makefile. This is the standard method for building on Unix-like systems, ensuring all dependencies are correctly linked. ```Shell make ```