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
Nested ClassesModifier and TypeClassDescriptionstatic enumstatic enumAvailable force fields.static enum -
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionForceField(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.voidaddProperty(String property, String value) Add a property from an external parameter file.voidappend(ForceField patch) Append a 2nd ForceField "patch" to the current ForceField.voidClear all force field types of a given type.voidclearProperty(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.booleangetBoolean(String property) getBooleanbooleangetBoolean(String property, boolean defaultBoolean) getBooleandoublegetDoubledoublegetDoubleintgetForceFieldTypeCountstatic URLgetForceFieldURL(ForceField.ForceFieldName forceField) Get for the URL for the named force field.getImproperType(String key) getImproperTypegetImproperTypeintgetInteger(String property) getIntegerintgetInteger(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.CompositeConfigurationGetter 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) getVDWTypegetVDWTypesbooleanhasProperty(String property) Checks if a property was specified.static booleanisForceFieldType(String keyword) Check if a keyword is a force field type.voidlog()logvoidPrints any force field keyword to Standard.out.voidprint()printvoidprintvoidrenumberForceField(int classOffset, int typeOffset, int bioTypeOffset) Renumber ForceField class, type and biotype values.voidsetAngleFunction(AngleType.AngleFunction angleFunction) The AngleFunction in use by this ForceField.voidsetBondFunction(BondType.BondFunction bondFunction) The BondFunction in use by this ForceField.static StringtoEnumForm(String key) Enums are uppercase with underscores, but property files use lower case with dashes.static StringEnums are uppercase with underscores, but property files use lower case with dashes.toString()Return a String for any Force Field keyword.toStringtoStringBuffervoidtoXML()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- aCompositeConfigurationobject.
-
-
Method Details
-
getForceFieldURL
Get for the URL for the named force field.- Parameters:
forceField- aForceField.ForceFieldNameobject.- Returns:
- a
URLobject.
-
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- aStringobject.- Returns:
- a
AngleTorsionTypeobject.
-
getAngleTorsionTypes
Get AngleTorsionTypes.- Returns:
- The AngleTorsionTypes.
-
getAngleType
getAngleType -
getAngleTypes
Get AngleTypes.- Returns:
- The AngleTypes.
-
getAnglepTypes
-
getAngleType
getAngleType- Parameters:
a1- First AtomType.a2- Second AtomType.a3- Third AtomType.- Returns:
- a
AngleTypeobject.
-
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
Mapobject.
-
getBondType
getBondType -
getBondTypes
Get BondTypes.- Returns:
- the BondTypes.
-
getBondType
getBondType- Parameters:
a1- First AtomType.a2- Second AtomType.- Returns:
- a
BondTypeobject.
-
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.ForceFieldTypeobject.- Returns:
- The number of ForceFieldTypes of the specified type.
-
getImproperType
getImproperType- Parameters:
key- aStringobject.- Returns:
- a
TorsionTypeobject.
-
getImproperTypes
getImproperType- Returns:
- a
TorsionTypeobject.
-
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- aStringobject.- Returns:
- a
MultipoleTypeobject.
-
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
Mapobject.
-
clearForceFieldType
Clear all force field types of a given type.- Parameters:
type- The type of force field type to clear.
-
getOutOfPlaneBendType
getOutOfPlaneBendType- Parameters:
key- aStringobject.- Returns:
- a
OutOfPlaneBendTypeobject.
-
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
OutOfPlaneBendTypeobject.
-
getPiOrbitalTorsionType
getPiOrbitalTorsionType- Parameters:
key- aStringobject.- Returns:
- a
PiOrbitalTorsionTypeobject.
-
getPiOrbitalTorsionTypes
Get PiOrbitalTorsions.- Returns:
- the PiOrbitalTorsions.
-
getPiOrbitalTorsionType
getPiOrbitalTorsionType- Parameters:
a1- AtomType of atom 1.a2- AtomType of atom 2.- Returns:
PiOrbitalTorsionTypeobject.
-
getPolarizeType
getPolarizeType- Parameters:
key- aStringobject.- Returns:
- a
PolarizeTypeobject.
-
getPolarizeTypes
Get PolarizeTypes.- Returns:
- the PolarizeTypes.
-
getProperties
public org.apache.commons.configuration2.CompositeConfiguration getProperties()Getter for the fieldproperties.- Returns:
- a
CompositeConfigurationobject.
-
getRelativeSolvationTypes
Getter for the fieldrelativeSolvationTypes.- Returns:
- a
HashMapobject.
-
getSoluteType
Get a SoluteType.- Parameters:
key- The class of the atom.- Returns:
- The SoluteType if its present.
-
getSoluteTypes
-
getStretchBendType
getStretchBendType- Parameters:
key- aStringobject.- Returns:
- a
StretchBendTypeobject.
-
getStretchBendTypes
Get StretchBendTypes.- Returns:
- the StretchBendTypes.
-
getStretchBendType
getStretchBendType- Parameters:
a1- First AtomType.a2- Second AtomType.a3- Third AtomType.- Returns:
- a
StretchBendTypeobject.
-
getStretchTorsionType
getStretchTorsionType- Parameters:
key- aStringobject.- Returns:
- a
StretchTorsionTypeobject.
-
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- aStringobject.- Returns:
- a
TorsionTorsionTypeobject.
-
getTorsionTorsionTypes
Get TorsionTorsionTypes.- Returns:
- the TorsionTorsionTypes.
-
getTorsionType
getTorsionType- Parameters:
key- aStringobject.- Returns:
- a
TorsionTypeobject.
-
getTorsionTypes
Get TorsionTypes.- Returns:
- the TorsionTypes.
-
getTorsionType
getTorsionType- Parameters:
a0- First AtomType.a1- Second AtomType.a2- Third AtomType.a3- Fourth AtomType.- Returns:
- a
TorsionTypeobject.
-
getUreyBradleyType
getUreyBradleyType- Parameters:
key- aStringobject.- Returns:
- a
UreyBradleyTypeobject.
-
getUreyBradleyTypes
Get UreyBradleyTypes.- Returns:
- the UreyBradleyTypes.
-
getVDW14Type
getVDW14Type -
getVDW14Types
getVDW14Types- Returns:
- a
Mapobject.
-
getVDWType
getVDWType -
getVDWPairType
getVDWPairType- Parameters:
key- aStringobject.- Returns:
- a
VDWPairTypeobject.
-
getVDWTypes
getVDWTypes- Returns:
- a
Mapobject.
-
getVDWPairTypes
getVDWPairTypes- Returns:
- a
Mapobject.
-
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- aStringobject.
-
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
-