ff

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]

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]

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]

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