Chemical Data Processing Library C++ API - Version 1.4.0
Public Types | Public Member Functions | Static Public Attributes | List of all members
CDPL::GRAIL::AtomDensityGridCalculator Class Reference

Calculator that fills a spatial grid with combined per-atom density contributions. More...

#include <AtomDensityGridCalculator.hpp>

Public Types

typedef std::shared_ptr< AtomDensityGridCalculatorSharedPointer
 A reference-counted smart pointer [SHPTR] for dynamically allocated AtomDensityGridCalculator instances. More...
 
typedef std::function< double(const Math::Vector3D &, const Math::Vector3D &, const Chem::Atom &)> DensityFunction
 Type of the generic functor that evaluates the density contribution of an atom at a query position. More...
 
typedef std::function< double(const Math::DVector &)> DensityCombinationFunction
 Type of the generic functor that combines per-atom density contributions into a single value. More...
 

Public Member Functions

 AtomDensityGridCalculator ()
 Constructs the AtomDensityGridCalculator instance. More...
 
 AtomDensityGridCalculator (const AtomDensityGridCalculator &calc)
 Constructs a copy of the AtomDensityGridCalculator instance calc. More...
 
 AtomDensityGridCalculator (const DensityFunction &func)
 Constructs the AtomDensityGridCalculator instance with the given density function. More...
 
 AtomDensityGridCalculator (const DensityFunction &density_func, const DensityCombinationFunction &comb_func)
 Constructs the AtomDensityGridCalculator instance with the given density and density-combination functions. More...
 
void setDistanceCutoff (double dist)
 Sets the distance cutoff beyond which atoms are not considered. More...
 
double getDistanceCutoff () const
 Returns the currently configured distance cutoff. More...
 
void setDensityFunction (const DensityFunction &func)
 Sets the density function used to evaluate per-atom contributions. More...
 
const DensityFunctiongetDensityFunction () const
 Returns the currently configured density function. More...
 
void setDensityCombinationFunction (const DensityCombinationFunction &func)
 Sets the function used to combine per-atom density contributions. More...
 
const DensityCombinationFunctiongetDensityCombinationFunction () const
 Returns the currently configured density-combination function. More...
 
void setAtom3DCoordinatesFunction (const Chem::Atom3DCoordinatesFunction &func)
 Specifies a function for the retrieval of atom 3D-coordinates for grid calculation. More...
 
const Chem::Atom3DCoordinatesFunctiongetAtom3DCoordinatesFunction () const
 Returns the function used for the retrieval of atom 3D-coordinates. More...
 
void calculate (const Chem::AtomContainer &atoms, Grid::DSpatialGrid &grid)
 Calculates the combined per-atom density at each cell of grid for the given atoms. More...
 
AtomDensityGridCalculatoroperator= (const AtomDensityGridCalculator &calc)
 Copy assignment operator. More...
 

Static Public Attributes

static constexpr double DEF_DISTANCE_CUTOFF = 4.5
 Default cutoff distance beyond which atoms are not considered. More...
 

Detailed Description

Calculator that fills a spatial grid with combined per-atom density contributions.

For each grid cell, the density contributions of all atoms within the configured cutoff distance are evaluated using a user-supplied density function and combined into a single cell value via a user-supplied combination function (defaulting to a sum).

Member Typedef Documentation

◆ SharedPointer

A reference-counted smart pointer [SHPTR] for dynamically allocated AtomDensityGridCalculator instances.

◆ DensityFunction

Type of the generic functor that evaluates the density contribution of an atom at a query position.

◆ DensityCombinationFunction

Type of the generic functor that combines per-atom density contributions into a single value.

Constructor & Destructor Documentation

◆ AtomDensityGridCalculator() [1/4]

CDPL::GRAIL::AtomDensityGridCalculator::AtomDensityGridCalculator ( )

Constructs the AtomDensityGridCalculator instance.

◆ AtomDensityGridCalculator() [2/4]

CDPL::GRAIL::AtomDensityGridCalculator::AtomDensityGridCalculator ( const AtomDensityGridCalculator calc)

Constructs a copy of the AtomDensityGridCalculator instance calc.

Parameters
calcThe AtomDensityGridCalculator to copy.

◆ AtomDensityGridCalculator() [3/4]

CDPL::GRAIL::AtomDensityGridCalculator::AtomDensityGridCalculator ( const DensityFunction func)

Constructs the AtomDensityGridCalculator instance with the given density function.

Parameters
funcThe density function.

◆ AtomDensityGridCalculator() [4/4]

CDPL::GRAIL::AtomDensityGridCalculator::AtomDensityGridCalculator ( const DensityFunction density_func,
const DensityCombinationFunction comb_func 
)

Constructs the AtomDensityGridCalculator instance with the given density and density-combination functions.

Parameters
density_funcThe density function.
comb_funcThe function used to combine per-atom density contributions.

Member Function Documentation

◆ setDistanceCutoff()

void CDPL::GRAIL::AtomDensityGridCalculator::setDistanceCutoff ( double  dist)

Sets the distance cutoff beyond which atoms are not considered.

Parameters
distThe cutoff distance.

◆ getDistanceCutoff()

double CDPL::GRAIL::AtomDensityGridCalculator::getDistanceCutoff ( ) const

Returns the currently configured distance cutoff.

Returns
The configured cutoff distance.

◆ setDensityFunction()

void CDPL::GRAIL::AtomDensityGridCalculator::setDensityFunction ( const DensityFunction func)

Sets the density function used to evaluate per-atom contributions.

Parameters
funcThe density function.

◆ getDensityFunction()

const DensityFunction& CDPL::GRAIL::AtomDensityGridCalculator::getDensityFunction ( ) const

Returns the currently configured density function.

Returns
The configured density function.

◆ setDensityCombinationFunction()

void CDPL::GRAIL::AtomDensityGridCalculator::setDensityCombinationFunction ( const DensityCombinationFunction func)

Sets the function used to combine per-atom density contributions.

Parameters
funcThe density-combination function.

◆ getDensityCombinationFunction()

const DensityCombinationFunction& CDPL::GRAIL::AtomDensityGridCalculator::getDensityCombinationFunction ( ) const

Returns the currently configured density-combination function.

Returns
The configured density-combination function.

◆ setAtom3DCoordinatesFunction()

void CDPL::GRAIL::AtomDensityGridCalculator::setAtom3DCoordinatesFunction ( const Chem::Atom3DCoordinatesFunction func)

Specifies a function for the retrieval of atom 3D-coordinates for grid calculation.

Parameters
funcThe atom 3D-coordinates function.

◆ getAtom3DCoordinatesFunction()

const Chem::Atom3DCoordinatesFunction& CDPL::GRAIL::AtomDensityGridCalculator::getAtom3DCoordinatesFunction ( ) const

Returns the function used for the retrieval of atom 3D-coordinates.

Returns
The configured atom 3D-coordinates function.

◆ calculate()

void CDPL::GRAIL::AtomDensityGridCalculator::calculate ( const Chem::AtomContainer atoms,
Grid::DSpatialGrid grid 
)

Calculates the combined per-atom density at each cell of grid for the given atoms.

Parameters
atomsThe atoms contributing to the density.
gridThe output grid populated with per-cell density values.

◆ operator=()

AtomDensityGridCalculator& CDPL::GRAIL::AtomDensityGridCalculator::operator= ( const AtomDensityGridCalculator calc)

Copy assignment operator.

Parameters
calcThe other AtomDensityGridCalculator instance.
Returns
A reference to itself.

Member Data Documentation

◆ DEF_DISTANCE_CUTOFF

constexpr double CDPL::GRAIL::AtomDensityGridCalculator::DEF_DISTANCE_CUTOFF = 4.5
staticconstexpr

Default cutoff distance beyond which atoms are not considered.


The documentation for this class was generated from the following file: