Force Fields and Modeling
Use this sub-skill when a task is about preparing a molecular model or parameterizing it before a simulation in OpenMM.
Route Here For
- Selecting bundled OpenMM
ForceFieldXML files, compatible water/ion files, implicit solvent files, or polarizable force fields. - Calling
ForceField.createSystem()with correctnonbondedMethod, cutoff, constraints,rigidWater,hydrogenMass, residue template, and external-bond options. - Editing structures with
Modeller: add missing hydrogens, solvent, ions, membranes, extra particles, or remove incompatible water. - Diagnosing
No template found for residueand related residue-template, terminal variant, water-model, bond, or extra-particle mismatches. - Loading parameterized inputs from AMBER, CHARMM, GROMACS, or Tinker instead of using
ForceFieldXML directly. - Authoring or validating practical OpenMM force-field XML (
ffxml) files and residue template generators.
Start With These References
references/forcefield-api-and-data.mdforForceField, bundled XML families,createSystem()options, and AMBER/CHARMM/GROMACS/Tinker input routes.references/model-building-recipes.mdforModellerworkflows: hydrogens, solvent, ions, water conversion, membranes, and extra particles.references/forcefield-xml-authoring.mdfor ffxml structure, residue templates, patches, standard force tags, custom force wiring, and template generators.references/troubleshooting.mdfor template mismatch diagnosis, water/ion compatibility, periodic-box and include-path problems.
Practical Workflow
- Identify whether the inputs are coordinates plus topology needing a
ForceField, or already-parameterized files such as AMBERprmtop, CHARMMpsf, GROMACStop, or Tinkerxyz/key/prm. - Choose force-field XML files as a compatible set: main biopolymer file plus the matching water/ion or implicit-solvent file when needed.
- Use
ModellerbeforecreateSystem()when the topology lacks hydrogens, solvent, membranes, or force-field-required extra particles. - Run
forcefield.getUnmatchedResidues(topology)orforcefield.getMatchingTemplates(topology)before debugging a full simulation when template matching is uncertain. - Build the
SystemwithcreateSystem()using nonbonded settings that match the topology: periodic boxes generally pair withPME/cutoffs; implicit solvent supports only non-periodic or limited cutoff choices. - Keep production dynamics, integrator choice, reporter setup, and platform precision decisions in sibling sub-skills unless they directly affect model parameterization.
Bundled Script
Use scripts/forcefield_modeling_check.py as a lightweight smoke check for an OpenMM installation and a minimal force-field/model-building path. It builds a tiny in-memory water topology, verifies template matching, creates a System, and prints a JSON summary without requiring source checkout files.
python scripts/forcefield_modeling_check.py
Boundaries
- For running or restarting complete simulations, use
simulation-workflows. - For custom mathematical force expressions or custom integrator algorithms beyond ffxml wiring, use
custom-forces-integrators. - For CUDA/OpenCL/HIP/CPU platform selection, precision, and performance tuning, use
platforms-performance. - For modifying OpenMM internals, plugins, C++ extension development, or tests, use
development-extensions.