Relative path

../fullrmc/Examples/bondsConstraint/

Description

A water molecule is used to demonstrate how a bond constraint can be used to constraint bonds. This example was used to generate the bond constraint video example as seen in the online documentation. When running this example a trajectory file will be generated. If VMD. is installed, the trajectory of all moves will be automatically visualized.

Files

  1. system.pdb: The water molecule pdb file
  2. run.py: The script file used to run the simulation

run.py explained

IMPORTING USEFUL DEFINITIONS:

All useful packages, modules and definitions are imported.

SHUT DOWN LOGGING:

Set logger minimum level to maximum possible integer value. This will mute all non-error logging.

CREATE ENGINE:

Create the engine and the needed bonds and bond-angles constraints.

DIFFERENT RUNS:

Define functions to run fitting engine. All of the following functions finish running the engine using Engine.run method. A trajectory of all moves is saved to the disk by setting XYZPath argument not to None.

  1. run_normal: Constraint O-H1 and O-H2 bonds to be between \(0.8\AA\) and \(1.1\AA\)
  2. run_distort_1: Constraint O-H1 to be between \(0.2\AA\) and \(0.5\AA\) and O-H2 to be between \(2.2\AA\) and \(2.5\AA\)
  3. run_distort_2: Constraint O-H1 to be between \(2.2\AA\) and \(2.5\AA\) and O-H2 to be between \(0.2\AA\) and \(0.5\AA\)

RUN SIMULATION:

Run in order all of ‘run_normal’, ‘run_distort_1’, ‘run_distort_2’ and finally ‘run_normal’ again.

VISUALIZE SIMULATION:

Reset initial pdb to engine instance. Visualize engine along with the saved trajectory “trajectory.xyz”.

Table of Contents