This is part of the MolSSI Molecular Mechanics Interoperable Components (MMIC) project. This package provides a Tactic component for mmic_md using the Gromacs software suite
# Import moleucule and forcefield models
from mmelemental.models import Molecule, ForceField
# Import Strategy MD component
import mmic_md
# Import Tactic MD component
import mmic_md_gmx
# Construct molecule and forcefield objects
# If a specific translator is impoted, it can be used with
# mol = Molecule.from_file(path_to_file, TRANSLATOR_NAME)
mol = Molecule.from_file(path_to_file)
ff = ForceField.from_file(path_to_file)
# Construct input data model from molecule and forcefield objects
inp = mmic_md.InputMD(
engine="gmx", # Engine must be gmx and must be specified
schema_name=SCHEMA_NAME,
schema_version=SCHEMA_VERSION,
system={mol: ff},
boundary=(
"periodic",
"periodic",
"periodic",
"periodic",
"periodic",
"periodic",
),
max_steps=TOTAL_STEP_NUMBER,
step_size=STEP_SIZE,
method="md",
freq_write={"nstxout": 5, "nstvout": 5, "nstenergy": 5, "nstlog": 5},
long_forces={"method": METHOD_FOR_LONGRANGE_INTERACTION},
short_forces={"method": METHOD_FOR_SHORT_INTERACTION},
temp_couple={"method": T_COUPLE_METHOD, "ref_t": REFERENCE_T},
press_couple={"method": P_COUPLE_METHOD},
)
Examples for the Parameters:
METHOD_FOR_LONGRANGE_INTERACTION "PME"
METHOD_FOR_SHORT_INTERACTION "cut-off"
T_COUPLE_METHOD "Berendsen"
P_COUPLE_METHOD "Parrinello-Rahman"
# Import strategy compoent for runing MD simulation
from mmic_md_gmx.components import MDGMXComponent
# Run MD Simulation
outp = MDGMXComponent.compute(inp)
# Extract the potential energy
pot_energy = outp.observables["pot_energy"]
...
Copyright (c) 2021, Xu Guo, Andrew Abi-Mansour
Project based on the Computational Molecular Science Python Cookiecutter version 0.0.