Calculations
Date: 2019-10-22

org.jmol.minimize.forcefield

## Class Calculations

- java.lang.Object
- - org.jmol.minimize.forcefield.Calculations

- Direct Known Subclasses:
    CalculationsMMFF, CalculationsUFF

      abstract class Calculations
      extends java.lang.Object

- - ### Field Summary

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `(package private) int` | `ac`
    `(package private) int` | `angleCount`
    `(package private) int` | `bondCount`
    `(package private) static int` | `CALC_ANGLE`
    `(package private) static int` | `CALC_DISTANCE`
    `(package private) static int` | `CALC_ES`
    `(package private) static int` | `CALC_MAX`
    `(package private) static int` | `CALC_OOP`
    `(package private) static int` | `CALC_STRETCH_BEND`
    `(package private) static int` | `CALC_TORSION`
    `(package private) static int` | `CALC_VDW`
    `(package private) javajs.util.Lst<java.lang.Object[]>[]` | `calculations`
    `private MMConstraint[][]` | `constraintsByType`
    `(package private) javajs.util.V3d` | `da`
    `(package private) javajs.util.V3d` | `db`
    `(package private) javajs.util.V3d` | `dc`
    `(package private) javajs.util.V3d` | `dd`
    `static double` | `DEG_TO_RAD`
    `(package private) ForceField` | `ff`
    `(package private) java.util.Map<java.lang.Object,java.lang.Object>` | `ffParams`
    `(package private) boolean` | `gradients`
    `private boolean` | `haveConstraints`
    `(package private) int` | `ia`
    `(package private) int` | `ib`
    `(package private) int` | `ic`
    `(package private) int` | `id`
    `(package private) boolean` | `isPreliminary`
    `(package private) static double` | `KCAL_TO_KJ`
    `(package private) javajs.util.SB` | `logData`
    `(package private) boolean` | `logging`
    `(package private) boolean` | `loggingEnabled`
    `(package private) MinAngle[]` | `minAngles`
    `(package private) MinAtom[]` | `minAtoms`
    `(package private) MinBond[]` | `minBonds`
    `private MinPosition[]` | `minPositions`
    `(package private) MinTorsion[]` | `minTorsions`
    `(package private) FFParam` | `parA`
    `(package private) FFParam` | `parB`
    `(package private) FFParam` | `parC`
    `private static double` | `PI_OVER_2`
    `static double` | `RAD_TO_DEG`
    `(package private) boolean` | `silent`
    `(package private) int` | `torsionCount`
    `private static double` | `TWO_PI`
    `(package private) javajs.util.V3d` | `v1`
    `(package private) javajs.util.V3d` | `v2`
    `(package private) javajs.util.V3d` | `v3`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `Calculations(ForceField ff, MinAtom[] minAtoms, MinBond[] minBonds, MinAngle[] minAngles, MinTorsion[] minTorsions, MinPosition[] minPositions, javajs.util.Lst<MMConstraint> constraints)`

  - ### Method Summary

    All Methods Instance Methods Abstract Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `(package private) void` | `addForce(javajs.util.V3d v, int i, double dE)`
    `(package private) void` | `addForces(Calculation c, int n)`
    `(package private) void` | `appendLogData(java.lang.String s)`
    `private double` | `calc(int iType, boolean gradients, boolean canConstrain)`
    `(package private) abstract double` | `compute(int iType, java.lang.Object[] dataIn)`
    `private double` | `constrainQuadratic(double value, double targetValue, double k, int iType)`
    `private double` | `constraintEnergy(int iType)`
    `(package private) double` | `energyAngle(boolean gradients)`
    `(package private) double` | `energyBond(boolean gradients)`
    `(package private) double` | `energyES(boolean gradients)`
    `(package private) double` | `energyOOP(boolean gradients)`
    `(package private) double` | `energyStrBnd(boolean gradients)`
    `(package private) double` | `energyStretchBend(boolean gradients)`
    `(package private) double` | `energyTorsion(boolean gradients)`
    `(package private) double` | `energyVDW(boolean gradients)`
    `(package private) java.lang.String` | `getAtomList(java.lang.String title)`
    `(package private) void` | `getConstraintList()`
    `(package private) java.lang.String` | `getDebugFooter(int iType, double energy)`
    `(package private) abstract java.lang.String` | `getDebugHeader(int iType)`
    `protected java.lang.String` | `getDebugHeader2(int iType)`
    `(package private) java.lang.String` | `getDebugLine(int iType, Calculation c)`
    `protected java.lang.String` | `getDebugLineC(int iType, Calculation c)`
    `java.lang.String` | `getLogData()`
    `(package private) java.lang.Object` | `getParameter(java.lang.Object o)`
    `(package private) abstract java.lang.Object` | `getParameterObj(MinObject o)`
    `(package private) abstract java.lang.String` | `getUnits()`
    `(package private) boolean` | `isLinear(int i)`
    `protected void` | `pairSearch(javajs.util.Lst<java.lang.Object[]> calc1, Calculation pc1, javajs.util.Lst<java.lang.Object[]> calc2, Calculation pc2)`
    `(package private) void` | `setAngleVariables(Calculation c)`
    `void` | `setConstraints(javajs.util.Lst<MMConstraint> constraints)`
    `(package private) void` | `setCoords(Calculation c, int n)`
    `(package private) void` | `setLoggingEnabled(boolean TF)`
    `(package private) void` | `setOopVariables(Calculation c, boolean fixTheta)`
    `(package private) void` | `setPairVariables(Calculation c)`
    `(package private) void` | `setPreliminary(boolean TF)`
    `void` | `setSilent(boolean TF)`
    `(package private) void` | `setTorsionVariables(Calculation c)`
    `(package private) abstract boolean` | `setupCalculations()`

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Field Detail

    - #### RAD_TO_DEG

          public static final double RAD_TO_DEG

      See Also:
        Constant Field Values

    - #### DEG_TO_RAD

          public static final double DEG_TO_RAD

      See Also:
        Constant Field Values

    - #### KCAL_TO_KJ

          static final double KCAL_TO_KJ

      See Also:
        Constant Field Values

    - #### CALC_DISTANCE

          static final int CALC_DISTANCE

      See Also:
        Constant Field Values

    - #### CALC_ANGLE

          static final int CALC_ANGLE

      See Also:
        Constant Field Values

    - #### CALC_TORSION

          static final int CALC_TORSION

      See Also:
        Constant Field Values

    - #### CALC_STRETCH_BEND

          static final int CALC_STRETCH_BEND

      See Also:
        Constant Field Values

    - #### CALC_OOP

          static final int CALC_OOP

      See Also:
        Constant Field Values

    - #### CALC_VDW

          static final int CALC_VDW

      See Also:
        Constant Field Values

    - #### CALC_ES

          static final int CALC_ES

      See Also:
        Constant Field Values

    - #### CALC_MAX

          static final int CALC_MAX

      See Also:
        Constant Field Values

    - #### parA

          FFParam parA

    - #### parB

          FFParam parB

    - #### parC

          FFParam parC

    - #### ff

          ForceField ff

    - #### calculations

          javajs.util.Lst<java.lang.Object[]>[] calculations

    - #### ffParams

          java.util.Map<java.lang.Object,java.lang.Object> ffParams

    - #### ac

          int ac

    - #### bondCount

          int bondCount

    - #### angleCount

          int angleCount

    - #### torsionCount

          int torsionCount

    - #### minAtoms

          MinAtom[] minAtoms

    - #### minBonds

          MinBond[] minBonds

    - #### minAngles

          MinAngle[] minAngles

    - #### minTorsions

          MinTorsion[] minTorsions

    - #### minPositions

          private MinPosition[] minPositions

    - #### constraintsByType

          private MMConstraint[][] constraintsByType

    - #### haveConstraints

          private boolean haveConstraints

    - #### isPreliminary

          boolean isPreliminary

    - #### gradients

          boolean gradients

    - #### silent

          boolean silent

    - #### logData

          javajs.util.SB logData

    - #### logging

          boolean logging

    - #### loggingEnabled

          boolean loggingEnabled

    - #### da

          final javajs.util.V3d da

    - #### db

          final javajs.util.V3d db

    - #### dc

          final javajs.util.V3d dc

    - #### dd

          final javajs.util.V3d dd

    - #### ia

          int ia

    - #### ib

          int ib

    - #### ic

          int ic

    - #### id

          int id

    - #### v1

          final javajs.util.V3d v1

    - #### v2

          final javajs.util.V3d v2

    - #### v3

          final javajs.util.V3d v3

    - #### PI_OVER_2

          private static final double PI_OVER_2

      See Also:
        Constant Field Values

    - #### TWO_PI

          private static final double TWO_PI

      See Also:
        Constant Field Values

  - ### Constructor Detail

    - #### Calculations

          Calculations(ForceField ff,
                       MinAtom[] minAtoms,
                       MinBond[] minBonds,
                       MinAngle[] minAngles,
                       MinTorsion[] minTorsions,
                       MinPosition[] minPositions,
                       javajs.util.Lst<MMConstraint> constraints)

  - ### Method Detail

    - #### getParameterObj

          abstract java.lang.Object getParameterObj(MinObject o)

    - #### getParameter

          java.lang.Object getParameter(java.lang.Object o)

    - #### setupCalculations

          abstract boolean setupCalculations()

    - #### getUnits

          abstract java.lang.String getUnits()

    - #### compute

          abstract double compute(int iType,
                                  java.lang.Object[] dataIn)

    - #### setConstraints

          public void setConstraints(javajs.util.Lst<MMConstraint> constraints)

    - #### addForce

          void addForce(javajs.util.V3d v,
                        int i,
                        double dE)

    - #### setSilent

          public void setSilent(boolean TF)

    - #### getLogData

          public java.lang.String getLogData()

    - #### appendLogData

          void appendLogData(java.lang.String s)

    - #### setLoggingEnabled

          void setLoggingEnabled(boolean TF)

    - #### setPreliminary

          void setPreliminary(boolean TF)

    - #### pairSearch

          protected void pairSearch(javajs.util.Lst<java.lang.Object[]> calc1,
                                    Calculation pc1,
                                    javajs.util.Lst<java.lang.Object[]> calc2,
                                    Calculation pc2)

    - #### calc

          private double calc(int iType,
                              boolean gradients,
                              boolean canConstrain)

    - #### energyStrBnd

          double energyStrBnd(boolean gradients)

    - #### energyBond

          double energyBond(boolean gradients)

    - #### energyAngle

          double energyAngle(boolean gradients)

    - #### energyTorsion

          double energyTorsion(boolean gradients)

    - #### energyStretchBend

          double energyStretchBend(boolean gradients)

    - #### energyOOP

          double energyOOP(boolean gradients)

    - #### energyVDW

          double energyVDW(boolean gradients)

    - #### energyES

          double energyES(boolean gradients)

    - #### constraintEnergy

          private double constraintEnergy(int iType)

    - #### constrainQuadratic

          private double constrainQuadratic(double value,
                                            double targetValue,
                                            double k,
                                            int iType)

    - #### getConstraintList

          void getConstraintList()

    - #### getAtomList

          java.lang.String getAtomList(java.lang.String title)

    - #### getDebugHeader

          abstract java.lang.String getDebugHeader(int iType)

    - #### getDebugHeader2

          protected java.lang.String getDebugHeader2(int iType)

    - #### getDebugLine

          java.lang.String getDebugLine(int iType,
                                        Calculation c)

    - #### getDebugLineC

          protected java.lang.String getDebugLineC(int iType,
                                                   Calculation c)

    - #### getDebugFooter

          java.lang.String getDebugFooter(int iType,
                                          double energy)

    - #### setPairVariables

          void setPairVariables(Calculation c)

    - #### setAngleVariables

          void setAngleVariables(Calculation c)

    - #### setOopVariables

          void setOopVariables(Calculation c,
                               boolean fixTheta)

    - #### setTorsionVariables

          void setTorsionVariables(Calculation c)

    - #### setCoords

          void setCoords(Calculation c,
                         int n)

    - #### addForces

          void addForces(Calculation c,
                         int n)

    - #### isLinear

          boolean isLinear(int i)

      Parameters:
        `i` -
      Returns:
        T/F