Package ffx.potential.parameters
Class ForceField
java.lang.Object
ffx.potential.parameters.ForceField
@FFXProperty(name="forcefield",
clazz=java.lang.String.class,
propertyGroup=PotentialFunctionParameter,
description="[name]\nProvides a name for the force field to be used in the current calculation.\nIts value is usually set in the master force field parameter file for the calculation\n(see the PARAMETERS keyword) instead of in the property file.\n")
public class ForceField
extends Object
The ForceField class organizes parameters for a molecular mechanics force field.
- Since:
- 1.0
- Author:
- Michael J. Schnieders
-
Nested Class Summary
Modifier and TypeClassDescriptionstatic enum
static enum
Available force fields.static enum
-
Field Summary
-
Constructor Summary
ConstructorDescriptionForceField
(org.apache.commons.configuration2.CompositeConfiguration properties) ForceField Constructor. -
Method Summary
Modifier and TypeMethodDescription<T extends BaseType>
voidaddForceFieldType
(T type) Add an instance of a force field type.void
addProperty
(String property, String value) Add a property from an external parameter file.void
append
(ForceField patch) Append a 2nd ForceField "patch" to the current ForceField.void
Clear all force field types of a given type.void
clearProperty
(String property) Clear a property from the force field instance.getAngleTorsionTypeGet AngleTorsionTypes.getAngleType
(AtomType a1, AtomType a2, AtomType a3) getAngleTypegetAngleType
(String key) getAngleTypeGet AngleTypes.getAtomType
(String key) getAtomTypegetAtomType
(String moleculeName, String atomName) getAtomTypeGet AtomTypes.getAtomTypes
(String moleculeName) Getter for the fieldatomTypes
.getBioType
(String key) getBioTypegetBioType
(String moleculeName, String atomName) getBioType.getBioTypeMap.String[]
getBondsgetBondType
(AtomType a1, AtomType a2) getBondTypegetBondType
(String key) getBondTypeGet BondTypes.boolean
getBoolean
(String property) getBooleanboolean
getBoolean
(String property, boolean defaultBoolean) getBooleandouble
getDoubledouble
getDoubleint
getForceFieldTypeCountstatic URL
getForceFieldURL
(ForceField.ForceFieldName forceField) Get for the URL for the named force field.getImproperType
(String key) getImproperTypegetImproperTypeint
getInteger
(String property) getIntegerint
getInteger
(String property, Integer defaultInteger) getIntegergetMultipoleType
(String key) getMultipoleTypeFind the MultipoleType whose key begins with the supplied String.Get MultipoleTypes.getMultipoleTypes
(String key) Find each MultipoleType whose key begins with the supplied String.getOutOfPlaneBendType
(AtomType a4, AtomType a0, AtomType a1, AtomType a2) getOutOfPlaneBendTypegetOutOfPlaneBendTypeGet OutOfPlaneBendTypes.getPiOrbitalTorsionType
(AtomType a1, AtomType a2) getPiOrbitalTorsionTypegetPiOrbitalTorsionTypeGet PiOrbitalTorsions.getPolarizeType
(String key) getPolarizeTypeGet PolarizeTypes.org.apache.commons.configuration2.CompositeConfiguration
Getter for the fieldproperties
.Getter for the fieldrelativeSolvationTypes
.getSimilarAtomTypes
(AtomType atomType) Getter for the fieldatomTypes
.getSoluteType
(String key) Get a SoluteType.getStretchBendType
(AtomType a1, AtomType a2, AtomType a3) getStretchBendTypegetStretchBendType
(String key) getStretchBendTypeGet StretchBendTypes.getStretchTorsionTypeGet StretchTorsionTypes.getBooleangetBooleangetTorsionTorsionTypeGet TorsionTorsionTypes.getTorsionType
(AtomType a0, AtomType a1, AtomType a2, AtomType a3) getTorsionTypegetTorsionType
(String key) getTorsionTypeGet TorsionTypes.Return all force field types of a given type.getUreyBradleyType
(String key) getUreyBradleyTypeGet UreyBradleyTypes.getVDW14Type
(String key) getVDW14TypegetVDW14TypesgetVDWPairType
(String key) getVDWPairTypegetVDWPairTypesgetVDWType
(String key) getVDWTypegetVDWTypesboolean
hasProperty
(String property) Checks if a property was specified.static boolean
isForceFieldType
(String keyword) Check if a keyword is a force field type.void
log()
logvoid
Prints any force field keyword to Standard.out.void
print()
printvoid
printvoid
renumberForceField
(int classOffset, int typeOffset, int bioTypeOffset) Renumber ForceField class, type and biotype values.void
setAngleFunction
(AngleType.AngleFunction angleFunction) The AngleFunction in use by this ForceField.void
setBondFunction
(BondType.BondFunction bondFunction) The BondFunction in use by this ForceField.static String
toEnumForm
(String key) Enums are uppercase with underscores, but property files use lower case with dashes.static String
Enums are uppercase with underscores, but property files use lower case with dashes.toString()
Return a String for any Force Field keyword.toStringtoStringBuffervoid
toXML()
Uses OpenMMXmlFilter to create an XML file of the force field usable by OpenMM.
-
Field Details
-
forceFieldURL
URL to the force field parameter file.
-
-
Constructor Details
-
ForceField
public ForceField(org.apache.commons.configuration2.CompositeConfiguration properties) ForceField Constructor.- Parameters:
properties
- aCompositeConfiguration
object.
-
-
Method Details
-
getForceFieldURL
Get for the URL for the named force field.- Parameters:
forceField
- aForceField.ForceFieldName
object.- Returns:
- a
URL
object.
-
isForceFieldType
Check if a keyword is a force field type.- Parameters:
keyword
- The keyword to check.- Returns:
- True if the keyword is a force field type.
-
toEnumForm
Enums are uppercase with underscores, but property files use lower case with dashes.- Parameters:
key
- an input keyword- Returns:
- the keyword in Enum form.
-
toPropertyForm
Enums are uppercase with underscores, but property files use lower case with dashes.- Parameters:
s
- an input Enum string- Returns:
- the normalized keyword
-
addForceFieldType
Add an instance of a force field type. Force Field types are more complicated than simple Strings or doubles, in that they have multiple fields and may occur multiple times.- Type Parameters:
T
- ForceFieldType to add that extends BaseType- Parameters:
type
- The ForceFieldType to add.
-
addProperty
Add a property from an external parameter file.- Parameters:
property
- Property string.value
- double
-
clearProperty
Clear a property from the force field instance.- Parameters:
property
- Property to clear.
-
append
Append a 2nd ForceField "patch" to the current ForceField. Note that only the force field types are appended; properties are ignored.- Parameters:
patch
- The force field patch to append.
-
getAngleTorsionType
getAngleTorsionType- Parameters:
key
- aString
object.- Returns:
- a
AngleTorsionType
object.
-
getAngleTorsionTypes
Get AngleTorsionTypes.- Returns:
- The AngleTorsionTypes.
-
getAngleType
getAngleType -
getAngleTypes
Get AngleTypes.- Returns:
- The AngleTypes.
-
getAngleType
getAngleType- Parameters:
a1
- First AtomType.a2
- Second AtomType.a3
- Third AtomType.- Returns:
- a
AngleType
object.
-
getAtomType
getAtomType -
getAtomTypes
Get AtomTypes.- Returns:
- the AtomTypes.
-
getAtomType
getAtomType -
getSimilarAtomTypes
Getter for the fieldatomTypes
.- Parameters:
atomType
- AtomType to find similar examples of.- Returns:
- Similar atom types.
-
getAtomTypes
Getter for the fieldatomTypes
. -
getBioType
getBioType. -
getBioType
getBioType -
getBioTypeMap
getBioTypeMap.- Returns:
- a
Map
object.
-
getBondType
getBondType -
getBondTypes
Get BondTypes.- Returns:
- the BondTypes.
-
getBondType
getBondType- Parameters:
a1
- First AtomType.a2
- Second AtomType.- Returns:
- a
BondType
object.
-
getBonds
getBonds -
getBoolean
getBoolean- Parameters:
property
- The property to return.- Returns:
- a boolean.
- Throws:
Exception
- if any.
-
getBoolean
getBoolean- Parameters:
property
- The property to return.defaultBoolean
- The default to return.- Returns:
- a boolean.
-
getDouble
getDouble- Parameters:
property
- The property to return.- Returns:
- The value of the property.
- Throws:
Exception
- if any.
-
getDouble
getDouble- Parameters:
property
- The property to return.defaultDouble
- The default to return.- Returns:
- The value of the property.
-
getForceFieldTypeCount
getForceFieldTypeCount- Parameters:
type
- aForceField.ForceFieldType
object.- Returns:
- The number of ForceFieldTypes of the specified type.
-
getImproperType
getImproperType- Parameters:
key
- aString
object.- Returns:
- a
TorsionType
object.
-
getImproperTypes
getImproperType- Returns:
- a
TorsionType
object.
-
getInteger
getInteger- Parameters:
property
- The property to return.- Returns:
- an int.
- Throws:
Exception
- if any.
-
getInteger
getInteger- Parameters:
property
- The property to return.defaultInteger
- The default to return.- Returns:
- an int.
-
getMultipoleType
getMultipoleType- Parameters:
key
- aString
object.- Returns:
- a
MultipoleType
object.
-
getMultipoleTypeBeginsWith
Find the MultipoleType whose key begins with the supplied String. If there are more than one MultipoleType that begins with the key, null is returned.- Parameters:
key
- The key to search for.- Returns:
- The MultipoleType if one and only one match is found.
-
getMultipoleTypes
Find each MultipoleType whose key begins with the supplied String.- Parameters:
key
- The key to search for.- Returns:
- The MultipoleTypes found.
-
getMultipoleTypes
Get MultipoleTypes.- Returns:
- the MultipoleTypes.
-
getTypes
Return all force field types of a given type.- Parameters:
type
- The type of force field type to clear.- Returns:
- a
Map
object.
-
clearForceFieldType
Clear all force field types of a given type.- Parameters:
type
- The type of force field type to clear.
-
getOutOfPlaneBendType
getOutOfPlaneBendType- Parameters:
key
- aString
object.- Returns:
- a
OutOfPlaneBendType
object.
-
getOutOfPlaneBendTypes
Get OutOfPlaneBendTypes.- Returns:
- the OutOfPlaneBendTypes.
-
getOutOfPlaneBendType
getOutOfPlaneBendType- Parameters:
a4
- AtomType of fourth atom.a0
- AtomType of atom 0 of the angle.a1
- AtomType of atom 1 of the angle (the trigonal atom).a2
- AtomType of atom 2 of the angle.- Returns:
- a
OutOfPlaneBendType
object.
-
getPiOrbitalTorsionType
getPiOrbitalTorsionType- Parameters:
key
- aString
object.- Returns:
- a
PiOrbitalTorsionType
object.
-
getPiOrbitalTorsionTypes
Get PiOrbitalTorsions.- Returns:
- the PiOrbitalTorsions.
-
getPiOrbitalTorsionType
getPiOrbitalTorsionType- Parameters:
a1
- AtomType of atom 1.a2
- AtomType of atom 2.- Returns:
PiOrbitalTorsionType
object.
-
getPolarizeType
getPolarizeType- Parameters:
key
- aString
object.- Returns:
- a
PolarizeType
object.
-
getPolarizeTypes
Get PolarizeTypes.- Returns:
- the PolarizeTypes.
-
getProperties
public org.apache.commons.configuration2.CompositeConfiguration getProperties()Getter for the fieldproperties
.- Returns:
- a
CompositeConfiguration
object.
-
getRelativeSolvationTypes
Getter for the fieldrelativeSolvationTypes
.- Returns:
- a
HashMap
object.
-
getSoluteType
Get a SoluteType.- Parameters:
key
- The class of the atom.- Returns:
- The SoluteType if its present.
-
getSoluteTypes
-
getStretchBendType
getStretchBendType- Parameters:
key
- aString
object.- Returns:
- a
StretchBendType
object.
-
getStretchBendTypes
Get StretchBendTypes.- Returns:
- the StretchBendTypes.
-
getStretchBendType
getStretchBendType- Parameters:
a1
- First AtomType.a2
- Second AtomType.a3
- Third AtomType.- Returns:
- a
StretchBendType
object.
-
getStretchTorsionType
getStretchTorsionType- Parameters:
key
- aString
object.- Returns:
- a
StretchTorsionType
object.
-
getStretchTorsionTypes
Get StretchTorsionTypes.- Returns:
- the StretchTorsionTypes.
-
getString
getBoolean- Parameters:
property
- The property to return.- Returns:
- a String.
- Throws:
Exception
- if any.
-
getString
getBoolean- Parameters:
property
- The property to return.defaultString
- The default to return.- Returns:
- a boolean.
-
getTorsionTorsionType
getTorsionTorsionType- Parameters:
key
- aString
object.- Returns:
- a
TorsionTorsionType
object.
-
getTorsionTorsionTypes
Get TorsionTorsionTypes.- Returns:
- the TorsionTorsionTypes.
-
getTorsionType
getTorsionType- Parameters:
key
- aString
object.- Returns:
- a
TorsionType
object.
-
getTorsionTypes
Get TorsionTypes.- Returns:
- the TorsionTypes.
-
getTorsionType
getTorsionType- Parameters:
a0
- First AtomType.a1
- Second AtomType.a2
- Third AtomType.a3
- Fourth AtomType.- Returns:
- a
TorsionType
object.
-
getUreyBradleyType
getUreyBradleyType- Parameters:
key
- aString
object.- Returns:
- a
UreyBradleyType
object.
-
getUreyBradleyTypes
Get UreyBradleyTypes.- Returns:
- the UreyBradleyTypes.
-
getVDW14Type
getVDW14Type -
getVDW14Types
getVDW14Types- Returns:
- a
Map
object.
-
getVDWType
getVDWType -
getVDWPairType
getVDWPairType- Parameters:
key
- aString
object.- Returns:
- a
VDWPairType
object.
-
getVDWTypes
getVDWTypes- Returns:
- a
Map
object.
-
getVDWPairTypes
getVDWPairTypes- Returns:
- a
Map
object.
-
hasProperty
Checks if a property was specified.- Parameters:
property
- String to check.- Returns:
- Returns true if the property has been specified.
-
log
public void log()log -
log
Prints any force field keyword to Standard.out.- Parameters:
key
- String
-
print
public void print()print -
print
print- Parameters:
key
- aString
object.
-
renumberForceField
public void renumberForceField(int classOffset, int typeOffset, int bioTypeOffset) Renumber ForceField class, type and biotype values.- Parameters:
classOffset
- The class offset.typeOffset
- The type offset.bioTypeOffset
- The biotype offset.
-
setAngleFunction
The AngleFunction in use by this ForceField.- Parameters:
angleFunction
- The AngleFunction to use.
-
setBondFunction
The BondFunction in use by this ForceField.- Parameters:
bondFunction
- The BondFunction to use.
-
toString
Return a String for any Force Field keyword.- Parameters:
type
- ForceFieldType- Returns:
- String
-
toString
-
toString
toString -
toStringBuffer
toStringBuffer- Returns:
- Returns a StringBuffer representation of the ForceField.
-
toXML
Uses OpenMMXmlFilter to create an XML file of the force field usable by OpenMM.- Throws:
Exception
-