MDMC.MD.force_fields package

Submodules

MDMC.MD.force_fields.OPLSAA module

A module for defining the OPLSAA force field. This was generated from the corresponding TINKER file.

class MDMC.MD.force_fields.OPLSAA.OPLSAA[source]

Bases: FileForceField

OPLSAA force field, with defined atoms and interactions

file_name = 'oplsaa.dat'

MDMC.MD.force_fields.SPC module

A module for defining the SPC forcefield

This definition of the SPC forcefield includes bond and bond angle strengths as these are needed for to create the required HarmonicPotentials. As a result, they can be used for simulating a flexible water molecule. However, SPC itself is a rigid model, and in order to replicate this a constraint algorithm should be used for all Bond and BondAngle objects.

Parameters are from:

A molecular dynamics simulation of a water model with intramolecular degrees of freedom O. Teleman, B. Jonsson, S. Engstrom Mol. Phys. 60(1), 193-203 (1987)

Note that different values for bond strengths are given in the OPLSAA data file, namely 2510.4 and 313.8 respectively.

class MDMC.MD.force_fields.SPC.SPC[source]

Bases: WaterModel

SPC force field - LJ, Coulombic, fixed bond lengths and angles

property interaction_dictionary

The dict of interactions that exist within the ForceField

Returns:

{Interaction:Elements} where Elements is an ordered tuple of elemental symbols, and values of InteractionFunction objects.

Return type:

dict

n_body = 3

MDMC.MD.force_fields.SPCE module

A module for defining the SPCE forcefield

This definition of the SPCE forcefield includes bond and bond angle strengths as these are needed for to create the required HarmonicPotentials. As a result, they can be used for simulating a flexible water molecule. However, SPCE itself is a rigid model, and in order to replicate this a constraint algorithm should be used for all Bond and BondAngle objects.

Parameters (excluding bond strengths) are from:

The missing term in effective pair potentials H. J. C. Berendsen, J. R. Grigera, and T. P. Straatsma J. Phys. Chem. 1987, 91, 24, 6269–6271

The strengths provided are the same as those used for SPC, from:

A molecular dynamics simulation of a water model with intramolecular degrees of freedom O. Teleman, B. Jonsson, S. Engstrom Mol. Phys. 60(1), 193-203 (1987)

Note that different values for bond strengths are given in the OPLSAA data file, namely 2510.4 and 313.8 respectively.

class MDMC.MD.force_fields.SPCE.SPCE[source]

Bases: WaterModel

SPCE force field - LJ, Coulombic, fixed bond lengths and angles

property interaction_dictionary

The dict of interactions that exist within the ForceField

Returns:

{Interaction:Elements} where Elements is an ordered tuple of elemental symbols, and values of InteractionFunction objects.

Return type:

dict

n_body = 3

MDMC.MD.force_fields.TIP3P module

A module for defining the TIP3P forcefield

This definition of the TIP3P forcefield includes bond and bond angle strengths as these are needed for to create the required HarmonicPotentials. As a result, they can be used for simulating a flexible water molecule. However, TIP3P itself is a rigid model, and in order to replicate this a constraint algorithm should be used for all Bond and BondAngle objects.

Parameters (excluding bond strengths) are from:

Comparison of simple potential functions for simulating liquid water Jorgensen WL, Chandrasekhar J, Madura JD, Impey RW, Klein ML The Journal of Chemical Physics. 79 (2): 926–935 (1983)

The strengths provided are from:

https://lammps.sandia.gov/doc/Howto_tip3p.html

having converted from their units of kcal to our kJ.

Note that different values for bond strengths are given in the OPLSAA data file, namely 2510.4 and 313.8 respectively.

class MDMC.MD.force_fields.TIP3P.TIP3P[source]

Bases: WaterModel

TIP3P force field - LJ, Coulombic, fixed bond lengths and angles

property interaction_dictionary

The dict of interactions that exist within the ForceField

Returns:

{Interaction:Elements} where Elements is an ordered tuple of elemental symbols, and values of InteractionFunction objects.

Return type:

dict

n_body = 3

MDMC.MD.force_fields.TIP3PFB module

A module for defining the TIP3P-FB forcefield

This definition of the TIP3P-FB forcefield includes bond and bond angle strengths as these are needed for to create the required HarmonicPotentials. As a result, they can be used for simulating a flexible water molecule. However, TIP3P-FB itself is a rigid model, and in order to replicate this a constraint algorithm should be used for all Bond and BondAngle objects.

Parameters (excluding bond strengths) are from:

Building Force Fields: An Automatic, Systematic, and Reproducible Approach Lee-Ping Wang, Todd J. Martinez, and Vijay S. Pande J. Phys. Chem. Lett. 2014, 5, 11, 1885–1891

The strengths provided are the same as those used for TIP3P, from:

https://lammps.sandia.gov/doc/Howto_tip3p.html

having converted from their units of kcal to our kJ.

Note that different values for bond strengths are given in the OPLSAA data file, namely 2510.4 and 313.8 respectively.

class MDMC.MD.force_fields.TIP3PFB.TIP3PFB[source]

Bases: WaterModel

TIP3P-FB force field - LJ, Coulombic, fixed bond lengths and angles

property interaction_dictionary

The dict of interactions that exist within the ForceField

Returns:

{Interaction:Elements} where Elements is an ordered tuple of elemental symbols, and values of InteractionFunction objects.

Return type:

dict

n_body = 3

MDMC.MD.force_fields.ff module

A module for defining force fields that can be applied to a universe

Each force field consists of a combination of interaction functions, and also the values of the parameters within these functions. In this instance water models (such as SPCE and TIP3P) are also defined as force fields, even though the parameter sets are restricted to describing water. Each force field module is self contained, although adding a new force field may require changes to the MD engine facades, so that a correspondence is established between the MDMC force field and the MD engine equivalent.

class MDMC.MD.force_fields.ff.FileForceField[source]

Bases: ForceField

Abstract class for force fields that are read from files

property absolute_path

Get the absolute path of the data

Returns:

The absolute path (including file name) of the force field data file

Return type:

str

property atoms

Get file parameters for the atoms defined within the force field

May includes the normal number of bonds that this atom type should possess, which is not currently used but could be an additional check on the validity of the topology

Returns:

A DataFrame with the force field atom type, atom group, element, mass, charge, and name

Return type:

pandas.DataFrame

property bond_angles

Get file parameters for the bond angles of the force field

Returns:

A DataFrame with all bond angles, atom groups, and the parameters of the bond angle

Return type:

pandas.DataFrame

property bonds

Get file parameters for the bonds of the force field

Returns:

A DataFrame with all bonds, atom groups, and the parameters of the bonds

Return type:

pandas.DataFrame

property dispersions

Get file parameters for the dispersion interactions of the force field

Returns:

A DataFrame with all dispersion interactions, atom types, and the parameters of the dispersion interaction

Return type:

pandas.DataFrame

abstract property file_name

Get the file name of the data

filter_element(element)[source]

Filters the atoms in the FileForceField by element

Parameters:

element (str) – The element by which the atoms in the FileForceField will be filtered

Returns:

A filtered DataFrame where each row is an atom type that has an element specified by element

Return type:

pandas.DataFrame

property impropers

Get file parameters for the improper dihedrals of the force field

Returns:

A DataFrame with all improper dihedrals, atom groups, and the parameters of the improper dihedral

Return type:

pandas.DataFrame

property interaction_dictionary

The dict of interactions that exist within the ForceField

Returns:

{Interaction:Elements} where Elements is an ordered tuple of elemental symbols, and values of InteractionFunction objects.

Return type:

dict

property propers

Get file parameters for the proper dihedrals of the force field

Returns:

A DataFrame with all proper dihedrals, atom groups, and the parameters of the proper dihedral

Return type:

pandas.DataFrame

set_atom_mass(atom)[source]

Sets Atom.mass to the mass defined in the force field for that atom type

Parameters:

atom (Atom) – The Atom for which the mass will be set

class MDMC.MD.force_fields.ff.ForceField[source]

Bases: ABC

Abstract class defining a force field

For each interaction type that it uses (non-bonded, bonds, bond angles etc), a force field must define the interaction function (LJ, harmonic etc). It must also define the parameters for each of these functions.

abstract property interaction_dictionary

The dict of interactions that exist within the ForceField

Returns:

{Interaction:Elements} where Elements is an ordered tuple of elemental symbols, and values of InteractionFunction objects.

Return type:

dict

parameterize_interactions(interactions)[source]

Parameterizes the interactions with the parameters speicifed in the interaction dict

Parameters:

interactions (list) – A list of Interaction objects to be parameterized

class MDMC.MD.force_fields.ff.WaterModel[source]

Bases: ForceField

Abstract class for force fields that describe a water model

abstract property n_body

This is the number of bodies in the water model.

Note

THIS MUST BE IMPLEMENTED USING A STATIC VARIABLE, INSTEAD OF A PROPERTY.

Returns:

The number of bodies (atoms) in the water model.

Return type:

int

MDMC.MD.force_fields.force_field_factory module

Factory class for generating force fields

class MDMC.MD.force_fields.force_field_factory.ForceFieldFactory[source]

Bases: object

Provides a factory for creating a ForceField. Any force field within the force fields folder can be created with a string of the class name, as long as it is a subclass of ForceField.

static create_force_field(module_name)[source]
Returns:

A ForceField specified by module_name

Return type:

ForceField

static get_force_field_names()[source]

Get the names of available force fields

Requires all ForceField derived classes to be in modules of the same name

Returns:

A list of str with the names of the available ForceField objects

Return type:

list

Module contents

A module for force field classes.