Class PotentialsUtils
- All Implemented Interfaces:
PotentialsFunctions
- Direct Known Subclasses:
AlgorithmUtils
- Since:
- 1.0
- Author:
- Jacob M. Litman, Michael J. Schnieders
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
close
(MolecularAssembly assembly) Performs any necessary shutdown operations on a MolecularAssembly, primarily shutting down Parallel Java threads and closing any other open resources.void
closeAll
(MolecularAssembly[] assemblies) Performs any necessary shutdown operations on an array of MolecularAssembly, primarily shutting down Parallel Java threads and closing any other open resources.energy
(MolecularAssembly molecularAssembly) Evaluates the energy of a MolecularAssembly and returns its ForceFieldEnergy object.energy
(MolecularAssembly[] molecularAssemblies) Evaluates the energy of each MolecularAssembly and returns their ForceFieldEnergy instances.Returns the last SystemFilter created by this (can be null).boolean
isLocal()
True if using a local implementation (not in a user interfaces module).Return one MolecularAssembly.open.Opens an array of files and returns all created MolecularAssembly objects, setting any underlying Potential to use a certain number of threads.Opens a file and returns all created MolecularAssembly objects.Opens an array of files and returns the created MolecularAssembly objects.Opens a file and returns all created MolecularAssembly objects, setting any underlying Potential to use a certain number of threads.openQuietly
(String filename) Open one filename string without printing all the header material.openWithMutations
(File file, List<PDBFilter.Mutation> mutations) Mutates file on-the-fly as it is being opened.double
returnEnergy
(MolecularAssembly assembly) Returns the energy of a MolecularAssembly in kcal/mol (as a double) and prints the energy evaluationvoid
save
(MolecularAssembly assembly, File file) Saves the current state of a MolecularAssembly to an XYZ file.void
saveAsPDB
(MolecularAssembly[] assemblies, File file) Saves the current state of an array of MolecularAssembly instances to a PDB file.void
saveAsPDB
(MolecularAssembly assembly, File file) Saves the current state of a MolecularAssembly to a PDB file.void
saveAsPDB
(MolecularAssembly assembly, File file, boolean writeEnd, boolean append) void
saveAsPDBinP1
(MolecularAssembly assembly, File file) Saves the symmetry mates of a MolecularAssembly to PDB files.void
saveAsPDBinP1
(MolecularAssembly assembly, File file, int[] lmn) void
saveAsXYZ
(MolecularAssembly assembly, File file) Saves the current state of a MolecularAssembly to an XYZ file.void
saveAsXYZasReplicates
(MolecularAssembly assembly, File file, int[] lmn) Saves the current state of a MolecularAssembly to an XYZ file as a replicates crystal.void
saveAsXYZinP1
(MolecularAssembly assembly, File file) Saves the current state of a MolecularAssembly to an XYZ file as a P1 crystal.double
time()
Logs time elapsed since last call.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface ffx.potential.utils.PotentialsFunctions
getActiveAssembly, getArguments, versionFile, versionFile
-
Constructor Details
-
PotentialsUtils
public PotentialsUtils()Constructor for PotentialsUtils.
-
-
Method Details
-
close
Performs any necessary shutdown operations on a MolecularAssembly, primarily shutting down Parallel Java threads and closing any other open resources.Shuts down parallel teams in the force field of the provided MolecularAssembly. Kaminsky's ParallelTeamThreads' run() methods are infinite loops, and because running threads are always GC roots, it is necessary to send them a signal to shut down to enable garbage collection.
- Specified by:
close
in interfacePotentialsFunctions
- Parameters:
assembly
- Assembly to close.
-
closeAll
Performs any necessary shutdown operations on an array of MolecularAssembly, primarily shutting down Parallel Java threads and closing any other open resources.Shuts down parallel teams in the force fields of the provided MolecularAssemblys.
- Specified by:
closeAll
in interfacePotentialsFunctions
- Parameters:
assemblies
- Assemblies to close.
-
energy
Evaluates the energy of a MolecularAssembly and returns its ForceFieldEnergy object.Evaluates the energy of a MolecularAssembly and returns its ForceFieldEnergy object.
- Specified by:
energy
in interfacePotentialsFunctions
- Parameters:
molecularAssembly
- To evaluate- Returns:
- assembly's ForceFieldEnergy.
-
energy
Evaluates the energy of each MolecularAssembly and returns their ForceFieldEnergy instances.- Specified by:
energy
in interfacePotentialsFunctions
- Parameters:
molecularAssemblies
- An array of molecularAssembly instances.- Returns:
- An array of ForceFieldEnergy instances.
-
getFilter
Returns the last SystemFilter created by this (can be null).- Specified by:
getFilter
in interfacePotentialsFunctions
- Returns:
- Last SystemFilter
-
isLocal
public boolean isLocal()True if using a local implementation (not in a user interfaces module).Returns true (this is the local implementation).
- Specified by:
isLocal
in interfacePotentialsFunctions
- Returns:
- If a local implementation
-
open
open.- Specified by:
open
in interfacePotentialsFunctions
- Parameters:
filename
- aString
object.- Returns:
- a
MolecularAssembly
object.
-
open
Return one MolecularAssembly.- Parameters:
file
- aFile
object.- Returns:
- a
MolecularAssembly
object.
-
open
Opens an array of files and returns all created MolecularAssembly objects, setting any underlying Potential to use a certain number of threads. Default implementation simply ignores nThreads.Opens an array of files and returns all created MolecularAssembly objects, setting any underlying Potential to use a certain number of threads.
- Specified by:
open
in interfacePotentialsFunctions
- Parameters:
files
- an array ofString
objects.nThreads
- Use non-default num threads- Returns:
- Array of MolecularAssembly.
-
openAll
Opens a file and returns all created MolecularAssembly objects.Opens a file and returns all created MolecularAssembly objects.
- Specified by:
openAll
in interfacePotentialsFunctions
- Parameters:
file
- Filename to open- Returns:
- Array of MolecularAssembly.
-
openAll
Opens an array of files and returns the created MolecularAssembly objects.Opens an array of files and returns the created MolecularAssembly objects.
- Specified by:
openAll
in interfacePotentialsFunctions
- Parameters:
files
- Filenames to open.- Returns:
- Array of MolecularAssembly.
-
openAll
Opens a file and returns all created MolecularAssembly objects, setting any underlying Potential to use a certain number of threads. Default implementation simply ignores nThreads.Opens a file and returns all created MolecularAssembly objects, setting any underlying Potential to use a certain number of threads.
- Specified by:
openAll
in interfacePotentialsFunctions
- Parameters:
file
- Filename to opennThreads
- Use non-default num threads- Returns:
- Array of MolecularAssembly.
-
openQuietly
Open one filename string without printing all the header material.- Parameters:
filename
- aString
object.- Returns:
- a
MolecularAssembly
object.
-
openWithMutations
Mutates file on-the-fly as it is being opened. Used to open files for pHMD in fully-protonated form.- Parameters:
file
- aFile
object.mutations
- aList
object.- Returns:
- a
MolecularAssembly
object.
-
returnEnergy
Returns the energy of a MolecularAssembly in kcal/mol (as a double) and prints the energy evaluationReturns the energy of a MolecularAssembly in kcal/mol (as a double) and prints the energy evaluation
- Specified by:
returnEnergy
in interfacePotentialsFunctions
- Parameters:
assembly
- To evaluate energy of- Returns:
- Potential energy (kcal/mol)
-
save
Saves the current state of a MolecularAssembly to an XYZ file.Saves the current state of a MolecularAssembly to an XYZ file.
- Specified by:
save
in interfacePotentialsFunctions
- Parameters:
assembly
- MolecularAssembly to savefile
- Destination .xyz
-
saveAsXYZinP1
Saves the current state of a MolecularAssembly to an XYZ file as a P1 crystal.Saves the current state of a MolecularAssembly to an XYZ file as a P1 crystal.
- Specified by:
saveAsXYZinP1
in interfacePotentialsFunctions
- Parameters:
assembly
- MolecularAssembly to savefile
- Destination .xyz
-
saveAsXYZasReplicates
Saves the current state of a MolecularAssembly to an XYZ file as a replicates crystal.Saves the current state of a MolecularAssembly to an XYZ file as a replicated crystal.
- Specified by:
saveAsXYZasReplicates
in interfacePotentialsFunctions
- Parameters:
assembly
- MolecularAssembly to savefile
- Destination .xyzlmn
- Dimensions for replicates crystal.
-
saveAsPDB
Saves the current state of a MolecularAssembly to a PDB file.Saves the current state of a MolecularAssembly to a PDB file.
- Specified by:
saveAsPDB
in interfacePotentialsFunctions
- Parameters:
assembly
- MolecularAssembly to savefile
- Destination .pdb
-
saveAsPDB
Saves the current state of a MolecularAssembly to a PDB file.
- Specified by:
saveAsPDB
in interfacePotentialsFunctions
-
saveAsPDB
Saves the current state of an array of MolecularAssembly instances to a PDB file.Saves the current state of an array of MolecularAssemblys to a PDB file.
- Specified by:
saveAsPDB
in interfacePotentialsFunctions
- Parameters:
assemblies
- MolecularAssembly array to savefile
- Destination .pdb
-
saveAsXYZ
Saves the current state of a MolecularAssembly to an XYZ file.Saves the current state of a MolecularAssembly to an XYZ file.
- Specified by:
saveAsXYZ
in interfacePotentialsFunctions
- Parameters:
assembly
- MolecularAssembly to savefile
- Destination .xyz
-
saveAsPDBinP1
Saves the symmetry mates of a MolecularAssembly to PDB files.- Specified by:
saveAsPDBinP1
in interfacePotentialsFunctions
- Parameters:
assembly
- To savefile
- Destination file
-
saveAsPDBinP1
-
time
public double time()Logs time elapsed since last call.Logs time since this interface was created and the last time this method was called.
- Specified by:
time
in interfacePotentialsFunctions
- Returns:
- Time.
-