The invisible boundary problem: sizing a GROMACS box with care

A molecular system can look perfectly reasonable in the viewer and still be poorly prepared for simulation. One common source of trouble is the periodic box: simulation software treats the box as repeating in every direction, so a molecule near one edge has periodic copies nearby. If the box is too small, the system may interact with those copies in unintended ways, affecting calculated forces.

The practical goal is not simply to draw a box around the structure. It is to choose a box shape and size that include the system and provide enough space for the periodic boundary conditions and the simulation’s cutoff scheme.

Start with the full system

In GROMACS Wizard’s Prepare step, select the molecular system in SAMSON’s Document view—or leave the selection empty if the whole document is the system you intend to prepare. Then define the periodic box. Supported unit cells include cubic, orthorhombic, triclinic, rhombic dodecahedron, and truncated octahedron.

One important check: the box must include every structure selected for preparation. This matters especially when working with multiple structural models or a batch of conformations. A box fitted around just one structure may not contain the rest.

Choose how the box is fitted

GROMACS Wizard offers two approaches:

  • Solute-box distance: specify the distance between the system (the solute) and the box. The documentation recommends at least 1 nm to help satisfy the minimum image convention. For batch preparation, each conformation or trajectory frame can have a different box size.
  • Box lengths: specify the dimensions yourself. The fitted box initially fits tightly around the system, so increase its size to add the needed space. For a batch project, this option determines the initial box size using all conformations or the full trajectory path, which can be useful when you need one box size for the batch.

The key distinction is whether you want a specified margin around each structure or a fixed set of box dimensions. Choose based on your workflow, not just on which option is quickest to click.

Choosing the unit cell type in GROMACS Wizard
Select a unit-cell shape before fitting the box.

A practical starting workflow

  1. Select the intended system in the Document view.
  2. Choose a unit-cell type. In the tutorial workflow, the example uses an orthorhombic cell.
  3. Click Compute fitted box.
  4. Choose Solute-box distance and set an appropriate margin; the tutorial recommends at least 1 nm.
  5. Inspect the result and confirm that all selected structures are inside the box.
A fitted periodic box around the molecular system
The fitted box is determined from the dimensions of the selected system.

If you use Box lengths, remember that the tight fit is only a starting point: increase the dimensions to provide sufficient clearance. The documentation recommends at least 1.0 nm between the system and box edges. In practical terms, that corresponds to at least 2.0 nm between periodic images of a protein or other non-solvent molecules. A molecule may adopt different conformations during simulation, so consider whether the initial structure represents the full range of motion you need to accommodate.

Check the box before adding solvent

Once the box is defined, GROMACS Wizard can add explicit solvent and, if requested, ions. Ions replace water molecules, so adding solvent is required if you want to add ions. This makes the order of checks useful: first confirm the box and its margin, then review the solvent and ion settings before running preparation.

A final reminder: the right margin depends on the simulation setup. The 1 nm recommendation is a useful starting point, but the documentation advises checking the relevant force-field publication when using a custom force field. If uncertain, verify that the box is compatible with the cutoff scheme you plan to use.

For details on periodic boundary conditions, see the GROMACS Wizard periodic boundary conditions tutorial. To see the full preparation workflow, including force fields, solvent, ions, and running preparation, visit the GROMACS Wizard: Step 1 — Prepare documentation.

Note: SAMSON and all SAMSON Extensions are free for non-commercial use. Get SAMSON.

Comments are closed.