Class RDFCalculator

java.lang.Object
org.openscience.cdk.geometry.RDFCalculator

public class RDFCalculator extends Object
Calculator of radial distribution functions. The RDF has bins defined around a point, i.e. the first bin starts at 0 Å and ends at 0.5*resolution Å, and the second bins ends at 1.5*resolution Å.

By default, the RDF is unweighted. By implementing and registering a RDFWeightFunction, the RDF can become weighted. For example, to weight according to partial charge interaction, this code could be used:

 RDFCalculator calculator = new RDFCalculator(0.0, 5.0, 0.1, 0.0,
     new RDFWeightFunction() {
         public double calculate(Atom atom, Atom atom2) {
             return atom.getCharge()*atom2.getCharge();
         }
     }
 );
 
Author:
Egon Willighagen
See Also:
Source code:
main
Belongs to CDK module:
extra
Keywords:
radial distribution function, RDF
Created on:
2005-01-10
  • Constructor Summary

    Constructors
    Constructor
    Description
    RDFCalculator(double startCutoff, double cutoff, double resolution, double peakWidth)
    Constructs a RDF calculator that calculates a unweighted, digitized RDF function.
    RDFCalculator(double startCutoff, double cutoff, double resolution, double peakWidth, IRDFWeightFunction weightFunction)
    Constructs a RDF calculator that calculates a digitized RDF function.
  • Method Summary

    Modifier and Type
    Method
    Description
    double[]
    calculate(IAtomContainer container, IAtom atom)
    Calculates a RDF for Atom atom in the environment of the atoms in the AtomContainer.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • RDFCalculator

      public RDFCalculator(double startCutoff, double cutoff, double resolution, double peakWidth)
      Constructs a RDF calculator that calculates a unweighted, digitized RDF function.
      Parameters:
      startCutoff - radial length in Ångstrom at which the RDF starts
      cutoff - radial length in Ångstrom at which the RDF stops
      resolution - width of the bins
      peakWidth - width of the gaussian applied to the peaks in Ångstrom
    • RDFCalculator

      public RDFCalculator(double startCutoff, double cutoff, double resolution, double peakWidth, IRDFWeightFunction weightFunction)
      Constructs a RDF calculator that calculates a digitized RDF function.
      Parameters:
      startCutoff - radial length in Ångstrom at which the RDF starts
      cutoff - radial length in Ångstrom at which the RDF stops
      resolution - width of the bins
      peakWidth - width of the gaussian applied to the peaks in Ångstrom
      weightFunction - the weight function. If null, then an unweighted RDF is calculated
  • Method Details

    • calculate

      public double[] calculate(IAtomContainer container, IAtom atom)
      Calculates a RDF for Atom atom in the environment of the atoms in the AtomContainer.