# energy

Calculate simple bond, angle, dihedral, and non-bonded energy terms (no PME).

`energy [<name>] [<mask1>] [out <filename>] [bond] [angle] [dihedral] [nb14] {[nonbond] | [elec] [vdw]} [ etype {simple | directsum [npoints <N>] | ewald [cut <cutoff>] [dsumtol  <dtol>] [rsumtol <rtol>] [ewcoeff <coeff>] [skinnb <skinnb>] [mlimits <X>,<Y>,<Z>]} ]`

`[<name>`] Data set name.
`[<mask1>]` Mask of atoms to calculate energy for.
`[out <filename>]` File to write results to.
`[bond]` Calculate bond energy.
`[angle]` Calculate angle energy.
`[dihedral]` Calculate dihedral energy.
`[nb14]` Calculate nonbonded 1-4 energy.
`[nonbond]` Calculate nonbonded energy (electrostatics and van der Waals).
`[elec]` Calculate electrostatic energy.
`[vdw]` Calculate van der Waals energy.
`[etype <type>]` Calculate electrostatics via specified type.
`[simple]` Use simple Coulomb term for electrostatics, no cutoff.
`[directsum]` Use direct summation method for electrostatics.
`[npoints <N>]` Number of cells in each direction to calculate the direct sum.
`[ewald]` Use Ewald summation for electrostatics.
`cut <cutoff>` Direct space cutoff in Angstroms (default 8.0).
`dsumtol <dtol>` Direct sum tolerance (default 0.00001). Used to determine Ewald coefficient.
`rsumtol <rtol>` Reciprocal sum tolerance (default 0.00005). Used to determine number of reciprocal space vectors.
`ewcoeff <coeff>` Ewald coefficient in 1/Ang.
`skinnb` Used to determine pairlist atoms (added to cut, so pairlist cutoff is cut + skinnb); included in order to maintain consistency with results from sander.
`mlimits <X>,<Y>,<Z>` Explicitly set the number of reciprocal space vectors in each dimension.

DataSet Aspects:
`[bond]` Bond energy.
`[angle]` Angle energy.
`[dih]` Dihedral energy.
`[vdw14]` 1-4 van der Waals energy.
`[elec14]` 1-4 electrostatic energy.
`[vdw]` van der Waals energy.
`[elec]` Electrostatic energy.
`[total]` Total energy.

Calculate the energy for atoms in <mask>. If no terms are specified, all terms are calculated. Note that the nonbonded energy terms for ’simple’ do not take into account periodicity and there is no distance cut-off. Electrostatics can also be determined via the direct sum, Ewald, or particle-mesh Ewald summation procedures. The particle
mesh Ewald functionality requires that CPPTRAJ be compiled with FFTW and a C++11 compliant compiler.

Calculation of energy terms requires that the associated topology file have parameters for any of the calculated terms, so for example angle calculations are not possible when using a PDB file as a topology, etc. All nonbonded calculations methods other than simple require unit cell parameters.

For example, to calculate all energy terms and write to a Grace-format file:

```parm DPDP.parm7
trajin DPDP.nc
energy DPDP out ene.agr```