Package ffx.potential.utils
Class StructureMetrics
java.lang.Object
ffx.potential.utils.StructureMetrics
Structure Metrics contains functionality to calculate characteristics of coordinate systems.
This includes: Gyrate computes the radius of gyration of a molecular system from its atomic coordinates.
Inertia computes the principal moments of inertia for the system, and optionally translates the center of mass to the origin and rotates the principal axes onto the global axes. Reference: Herbert Goldstein, "Classical Mechanics, 2nd Edition", Addison-Wesley, Reading, MA, 1980; see the Euler angle xyz convention in Appendix B
- Since:
- 1.0
- Author:
- Michael J. Schnieders, Aaron J. Nessler
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic double[][]
momentsOfInertia
(double[] xyz, double[] mass, boolean moved, boolean print, boolean pma) Compute the moments of inertia.static double[][]
momentsOfInertia
(double[] x, double[] y, double[] z, double[] mass, boolean moved, boolean print, boolean pma) Compute the moments of inertiastatic double[][]
momentsOfInertia
(Atom[] atoms, boolean moved, boolean print, boolean pma) Compute the moments of inertia for all atoms in the supplied array.static double
radiusOfGyration
(double[] xyz, double[] mass) Compute the average radius of gyration.static double
radiusOfGyration
(double[] x, double[] y, double[] z, double[] mass) Compute the average radius of gyration.static double
radiusOfGyration
(Atom[] atoms) Compute the radius of gyration for all atoms in the supplied array.static double[]
radiusOfGyrationComponents
(double[] xyz, double[] mass, boolean pmp) Compute the components that make up the radius of gyration about yz-, xz-, xy-planes.static double[]
radiusOfGyrationComponents
(double[] x, double[] y, double[] z, double[] mass, boolean pmp) Compute the components that make up the radius of gyration tensor about yz-, xz-, xy-planes.static double[]
radiusOfGyrationComponents
(Atom[] atoms) Compute the radius of gyration for all atoms in the supplied array.
-
Constructor Details
-
StructureMetrics
public StructureMetrics()
-
-
Method Details
-
radiusOfGyration
Compute the radius of gyration for all atoms in the supplied array.- Parameters:
atoms
- Atom array.- Returns:
- The radius of gyration.
-
radiusOfGyration
public static double radiusOfGyration(double[] x, double[] y, double[] z, double[] mass) Compute the average radius of gyration.- Parameters:
x
- Array of atomic X-coordinates.y
- Array of atomic X-coordinates.z
- Array of atomic X-coordinates.- Returns:
- The radius of gyration.
-
radiusOfGyration
public static double radiusOfGyration(double[] xyz, double[] mass) Compute the average radius of gyration.- Parameters:
xyz
- Array of atomic coordinates (xyz = [X0, Y0, Z0, X1, Y1, Z1, ...].- Returns:
- The radius of gyration.
-
radiusOfGyrationComponents
Compute the radius of gyration for all atoms in the supplied array.- Parameters:
atoms
- Atom array.- Returns:
- The radius of gyration.
-
radiusOfGyrationComponents
public static double[] radiusOfGyrationComponents(double[] xyz, double[] mass, boolean pmp) Compute the components that make up the radius of gyration about yz-, xz-, xy-planes.- Parameters:
xyz
- Coordinates for calculation- Returns:
- radius of gyration along axes
-
radiusOfGyrationComponents
public static double[] radiusOfGyrationComponents(double[] x, double[] y, double[] z, double[] mass, boolean pmp) Compute the components that make up the radius of gyration tensor about yz-, xz-, xy-planes.- Parameters:
x
- Coordinates for calculationy
- Coordinates for calculationz
- Coordinates for calculationpmp
- Principal moment plane- Returns:
- radius of gyration about planes (yz, xz, xy).
-
momentsOfInertia
Compute the moments of inertia for all atoms in the supplied array.- Parameters:
atoms
- Atom array.moved
- Move coordinatesprint
- Display values to userpma
- Use principal moment axes.- Returns:
- The moments of inertia.
-
momentsOfInertia
public static double[][] momentsOfInertia(double[] xyz, double[] mass, boolean moved, boolean print, boolean pma) Compute the moments of inertia.- Parameters:
xyz
- Array of atomic coordinates (xyz = [X0, Y0, Z0, X1, Y1, Z1, ...].mass
- Mass of atomsmoved
- Move from original coordinates to selectionprint
- Display values to userpma
- Use principal moment axes.- Returns:
- The radius of gyration.
-
momentsOfInertia
public static double[][] momentsOfInertia(double[] x, double[] y, double[] z, double[] mass, boolean moved, boolean print, boolean pma) Compute the moments of inertia- Parameters:
x
- Array of atomic X-coordinates.y
- Array of atomic X-coordinates.z
- Array of atomic X-coordinates.mass
- mass of atomsmoved
- Move coordinates to principal axesprint
- Print out values to screenpma
- Report moments of inertia to principal axes.- Returns:
- The moment of inertia.
-