Skip to content

RlyehAD/mmic_md_gmx

Repository files navigation

Molecular Dynamics Component

GitHub Actions Build Status codecov Language grade: Python

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

Preparing Input

# 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"

Runing MD Simulation

# Import strategy compoent for runing MD simulation
from mmic_md_gmx.components import MDGMXComponent

# Run MD Simulation
outp = MDGMXComponent.compute(inp)

Extracting Output

# Extract the potential energy 
pot_energy = outp.observables["pot_energy"]
...

Copyright

Copyright (c) 2021, Xu Guo, Andrew Abi-Mansour

Acknowledgements

Project based on the Computational Molecular Science Python Cookiecutter version 0.0.

About

No description, website, or topics provided.

Resources

License

Code of conduct

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published