Package org.openscience.cdk.geometry
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:
IRDFWeightFunction
- 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
All Methods Instance Methods Concrete Methods Modifier and Type Method Description double[]
calculate(IAtomContainer container, IAtom atom)
Calculates a RDF forAtom
atom in the environment of the atoms in theAtomContainer
.
-
-
-
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 startscutoff
- radial length in Ångstrom at which the RDF stopsresolution
- width of the binspeakWidth
- 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 startscutoff
- radial length in Ångstrom at which the RDF stopsresolution
- width of the binspeakWidth
- width of the gaussian applied to the peaks in ÅngstromweightFunction
- the weight function. If null, then an unweighted RDF is calculated
-
-
Method Detail
-
calculate
public double[] calculate(IAtomContainer container, IAtom atom)
Calculates a RDF forAtom
atom in the environment of the atoms in theAtomContainer
.
-
-