Package ffx.potential.cli
Class TopologyOptions
java.lang.Object
ffx.potential.cli.TopologyOptions
Represents command line options for scripts that utilize multiple physical topologies.
- Since:
- 1.0
- Author:
- Michael J. Schnieders, Jacob M. Litman
-
Field Summary
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionassemblePotential
(MolecularAssembly[] assemblies, int threadsAvail, StringBuilder sb) Performs the bulk of the work of setting up a multi-topology system.--ac2 or --alchemicalAtoms2 Specify alchemical atoms [ALL, NONE, Range(s): 1-3,6-N].-sf or --switchingFunctionint
getNPar()
-np or --nParallel sets the number of topologies to evaluate in parallel; currently 1, 2, or 4.int
getNumParallel
(int nThreads, int nTopologies) The number of topologies to run in parallel.Return the switching function between topology energies.getTopology
(MolecularAssembly[] topologies, UnivariateSwitchingFunction sf, List<Integer> uniqueA, List<Integer> uniqueB, int numParallel, StringBuilder sb) Configure a Dual-, Quad- or Oct- Topology.--uc2 or --unchargedAtoms2 Specify atoms without electrostatics [ALL, NONE, Range(s): 1-3,6-N].getUniqueAtoms
(MolecularAssembly assembly, String label, String unshared) Collect unique atoms for a dual-topology.getUniqueAtomsA
(MolecularAssembly topology) Collect unique atoms for the A dual-topology.getUniqueAtomsB
(MolecularAssembly topology) Collect unique atoms for the B dual-topology.--uaA or --unsharedA sets atoms unique to the A dual-topology, as period-separated hyphenated ranges or singletons.--uaB or --unsharedB sets atoms unique to the A dual-topology, as period-separated hyphenated ranges or singletons.boolean
If any softcore Atoms have been detected.void
setSecondSystemAlchemistry
(MolecularAssembly topology) Set the alchemical atoms for this topology.void
Set uncharged atoms for this topology.
-
Field Details
-
logger
The logger for this class.
-
-
Constructor Details
-
TopologyOptions
public TopologyOptions()
-
-
Method Details
-
getAlchemicalAtoms2
--ac2 or --alchemicalAtoms2 Specify alchemical atoms [ALL, NONE, Range(s): 1-3,6-N].- Returns:
- Returns alchemical atoms for the 2nd topology.
-
getUnchargedAtoms2
--uc2 or --unchargedAtoms2 Specify atoms without electrostatics [ALL, NONE, Range(s): 1-3,6-N].- Returns:
- Returns atoms without electrostatics for the 2nd topology.
-
getNPar
public int getNPar()-np or --nParallel sets the number of topologies to evaluate in parallel; currently 1, 2, or 4.- Returns:
- Returns Number of topologies to evaluate in parallel.
-
getLambdaFunction
-sf or --switchingFunctionSets the switching function to be used by dual topologies.
- TRIG produces the function sin^2(pi/2*lambda)*E1(lambda) + cos^2(pi/2*lambda)*E2(1-lambda)
- MULT uses a 5th-order polynomial switching function with zero first and second derivatives at the end (same function as used for van der Waals switch)
- A number uses the original function, of l^beta*E1(lambda) + (1-lambda)^beta*E2(1-lambda).
All of these are generalizations of
Udt = f(l)*E1(l) + f(1-l)*E2(1-lambda)
, where f(l) is a continuous switching function such that f(0) = 0, f(1) = 1, and 0 <= f(l) <= 1 for lambda 0-1. The trigonometric switch can be restated thusly, since cos^2(pi/2*lambda) is identical to sin^2(pi/2*(1-lambda)), f(1-l).- Returns:
- Returns the lambda function.
-
getNumParallel
public int getNumParallel(int nThreads, int nTopologies) The number of topologies to run in parallel.- Parameters:
nThreads
- The number of threads available.nTopologies
- The number of topologies to run in parallel.- Returns:
- Number of topologies to run in parallel.
-
assemblePotential
public Potential assemblePotential(MolecularAssembly[] assemblies, int threadsAvail, StringBuilder sb) Performs the bulk of the work of setting up a multi-topology system.The sb StringBuilder is often something like "Timing energy and gradients for". The method will append the exact type of Potential being assembled.
- Parameters:
assemblies
- Opened MolecularAssembly(s).threadsAvail
- Number of available threads.sb
- A StringBuilder describing what is to be done.- Returns:
- a
Potential
object.
-
getSwitchingFunction
Return the switching function between topology energies.- Returns:
- the switching function.
-
getUniqueAtomsA
Collect unique atoms for the A dual-topology.- Parameters:
topology
- A MolecularAssembly from dual-topology A.- Returns:
- A List of Integers.
-
getTopology
public Potential getTopology(MolecularAssembly[] topologies, UnivariateSwitchingFunction sf, List<Integer> uniqueA, List<Integer> uniqueB, int numParallel, StringBuilder sb) Configure a Dual-, Quad- or Oct- Topology.- Parameters:
topologies
- The topologies.sf
- The Potential switching function.uniqueA
- The unique atoms of topology A.uniqueB
- The unique atoms of topology B.numParallel
- The number of energies to evaluate in parallel.sb
- A StringBuilder for logging.- Returns:
- The Potential for the Topology.
-
getUniqueAtoms
public static List<Integer> getUniqueAtoms(MolecularAssembly assembly, String label, String unshared) Collect unique atoms for a dual-topology. List MUST be sorted at the end.- Parameters:
assembly
- A MolecularAssembly from the dual topology.label
- Either 'A' or 'B'.unshared
- Atoms this dual topology isn't sharing.- Returns:
- A sorted List of Integers.
-
getUniqueAtomsB
Collect unique atoms for the B dual-topology.- Parameters:
topology
- A MolecularAssembly from dual-topology B.- Returns:
- A List of Integers.
-
hasSoftcore
public boolean hasSoftcore()If any softcore Atoms have been detected.- Returns:
- Presence of softcore Atoms.
-
setSecondSystemAlchemistry
Set the alchemical atoms for this topology.- Parameters:
topology
- aMolecularAssembly
object.
-
setSecondSystemUnchargedAtoms
Set uncharged atoms for this topology.- Parameters:
topology
- aMolecularAssembly
object.
-