Class 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:
    IRDFWeightFunction
    Source code:
    main
    Belongs to CDK module:
    extra
    Keywords:
    radial distribution function, RDF
    Created on:
    2005-01-10
    • Constructor Detail

      • 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 Detail

      • calculate

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