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

Function representation of a Gaussian shape, used to evaluate the shape's density, volume, surface area and related quantities at arbitrary 3D positions. More...

#include <GaussianShapeFunction.hpp>

Public Types

typedef std::shared_ptr< GaussianShapeFunctionSharedPointer
 A reference-counted smart pointer [SHPTR] for dynamically allocated GaussianShapeFunction instances. More...
 

Public Member Functions

 GaussianShapeFunction ()
 Constructs the GaussianShapeFunction instance without an associated shape. More...
 
 GaussianShapeFunction (const GaussianShapeFunction &func)
 Constructs a copy of the GaussianShapeFunction instance func. More...
 
 GaussianShapeFunction (const GaussianShape &shape)
 Constructs the GaussianShapeFunction instance associated with shape. More...
 
 ~GaussianShapeFunction ()
 Destructor. More...
 
void setMaxOrder (std::size_t max_order)
 Sets the maximum order of the Gaussian-product expansion. More...
 
std::size_t getMaxOrder () const
 Returns the currently configured maximum order of the Gaussian-product expansion. More...
 
void setDistanceCutoff (double cutoff)
 Sets the distance cutoff for pruning negligible Gaussian-product contributions. More...
 
double getDistanceCutoff () const
 Returns the currently configured distance cutoff. More...
 
void setShape (const GaussianShape &shape)
 Associates the function with the Gaussian shape shape. More...
 
const GaussianShapegetShape () const
 Returns a pointer to the associated Gaussian shape (or nullptr if none is associated). More...
 
void reset ()
 Resets the function by discarding the cached Gaussian-product expansion. More...
 
void transform (const Math::Matrix4D &xform)
 Applies an affine transformation to the element positions of the associated shape. More...
 
const Math::Vector3DgetElementPosition (std::size_t idx) const
 Returns the 3D position of the element at index idx. More...
 
void getElementPositions (Math::Vector3DArray &coords) const
 Returns the 3D positions of all elements of the associated shape. More...
 
double calcDensity (const Math::Vector3D &pos) const
 Evaluates the Gaussian density of the shape at the 3D position pos. More...
 
double calcVolume () const
 Calculates the total volume enclosed by the Gaussian shape. More...
 
double calcSurfaceArea () const
 Calculates the total surface area of the Gaussian shape. More...
 
double calcSurfaceArea (std::size_t elem_idx) const
 Calculates the surface area contribution of the single element at index elem_idx. More...
 
void calcCentroid (Math::Vector3D &ctr) const
 Calculates the centroid of the Gaussian shape. More...
 
void calcQuadrupoleTensor (const Math::Vector3D &ctr, Math::Matrix3D &quad_tensor) const
 Calculates the quadrupole tensor of the Gaussian shape with respect to the reference point ctr. More...
 
GaussianShapeFunctionoperator= (const GaussianShapeFunction &func)
 Copy assignment operator. More...
 

Static Public Attributes

static constexpr std::size_t DEF_MAX_PRODUCT_ORDER = 6
 Default maximum order of the Gaussian-product expansion. More...
 
static constexpr double DEF_DISTANCE_CUTOFF = 0.0
 Default distance cutoff for pruning negligible Gaussian-product contributions. More...
 

Friends

class FastGaussianShapeOverlapFunction
 
class ExactGaussianShapeOverlapFunction
 

Detailed Description

Function representation of a Gaussian shape, used to evaluate the shape's density, volume, surface area and related quantities at arbitrary 3D positions.

Internally the function maintains a list of Gaussian products (up to a configurable order) derived from the underlying Shape::GaussianShape. The list is built when the shape is supplied via setShape() (or one of the corresponding constructors).

Member Typedef Documentation

◆ SharedPointer

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

Constructor & Destructor Documentation

◆ GaussianShapeFunction() [1/3]

CDPL::Shape::GaussianShapeFunction::GaussianShapeFunction ( )

Constructs the GaussianShapeFunction instance without an associated shape.

◆ GaussianShapeFunction() [2/3]

CDPL::Shape::GaussianShapeFunction::GaussianShapeFunction ( const GaussianShapeFunction func)

Constructs a copy of the GaussianShapeFunction instance func.

Parameters
funcThe GaussianShapeFunction to copy.

◆ GaussianShapeFunction() [3/3]

CDPL::Shape::GaussianShapeFunction::GaussianShapeFunction ( const GaussianShape shape)

Constructs the GaussianShapeFunction instance associated with shape.

Parameters
shapeThe Gaussian shape.

◆ ~GaussianShapeFunction()

CDPL::Shape::GaussianShapeFunction::~GaussianShapeFunction ( )

Destructor.

Member Function Documentation

◆ setMaxOrder()

void CDPL::Shape::GaussianShapeFunction::setMaxOrder ( std::size_t  max_order)

Sets the maximum order of the Gaussian-product expansion.

Parameters
max_orderThe maximum order.

◆ getMaxOrder()

std::size_t CDPL::Shape::GaussianShapeFunction::getMaxOrder ( ) const

Returns the currently configured maximum order of the Gaussian-product expansion.

Returns
The configured maximum order.

◆ setDistanceCutoff()

void CDPL::Shape::GaussianShapeFunction::setDistanceCutoff ( double  cutoff)

Sets the distance cutoff for pruning negligible Gaussian-product contributions.

Parameters
cutoffThe cutoff distance.

◆ getDistanceCutoff()

double CDPL::Shape::GaussianShapeFunction::getDistanceCutoff ( ) const

Returns the currently configured distance cutoff.

Returns
The configured distance cutoff.

◆ setShape()

void CDPL::Shape::GaussianShapeFunction::setShape ( const GaussianShape shape)

Associates the function with the Gaussian shape shape.

Parameters
shapeThe Gaussian shape.

◆ getShape()

const GaussianShape* CDPL::Shape::GaussianShapeFunction::getShape ( ) const

Returns a pointer to the associated Gaussian shape (or nullptr if none is associated).

Returns
A pointer to the associated Gaussian shape.

◆ reset()

void CDPL::Shape::GaussianShapeFunction::reset ( )

Resets the function by discarding the cached Gaussian-product expansion.

◆ transform()

void CDPL::Shape::GaussianShapeFunction::transform ( const Math::Matrix4D xform)

Applies an affine transformation to the element positions of the associated shape.

Parameters
xformThe 4x4 transformation matrix.

◆ getElementPosition()

const Math::Vector3D& CDPL::Shape::GaussianShapeFunction::getElementPosition ( std::size_t  idx) const

Returns the 3D position of the element at index idx.

Parameters
idxThe element index.
Returns
A const reference to the element 3D position.
Exceptions
Base::IndexErrorif no shape is associated with this function or idx is not in the range [0, getShape()->getNumElements() - 1].

◆ getElementPositions()

void CDPL::Shape::GaussianShapeFunction::getElementPositions ( Math::Vector3DArray coords) const

Returns the 3D positions of all elements of the associated shape.

Parameters
coordsThe output array of 3D positions.

◆ calcDensity()

double CDPL::Shape::GaussianShapeFunction::calcDensity ( const Math::Vector3D pos) const

Evaluates the Gaussian density of the shape at the 3D position pos.

Parameters
posThe 3D position.
Returns
The Gaussian density value.

◆ calcVolume()

double CDPL::Shape::GaussianShapeFunction::calcVolume ( ) const

Calculates the total volume enclosed by the Gaussian shape.

Returns
The volume.

◆ calcSurfaceArea() [1/2]

double CDPL::Shape::GaussianShapeFunction::calcSurfaceArea ( ) const

Calculates the total surface area of the Gaussian shape.

Returns
The total surface area.

◆ calcSurfaceArea() [2/2]

double CDPL::Shape::GaussianShapeFunction::calcSurfaceArea ( std::size_t  elem_idx) const

Calculates the surface area contribution of the single element at index elem_idx.

Parameters
elem_idxThe element index.
Returns
The element surface area.

◆ calcCentroid()

void CDPL::Shape::GaussianShapeFunction::calcCentroid ( Math::Vector3D ctr) const

Calculates the centroid of the Gaussian shape.

Parameters
ctrThe output centroid position.

◆ calcQuadrupoleTensor()

void CDPL::Shape::GaussianShapeFunction::calcQuadrupoleTensor ( const Math::Vector3D ctr,
Math::Matrix3D quad_tensor 
) const

Calculates the quadrupole tensor of the Gaussian shape with respect to the reference point ctr.

Parameters
ctrThe reference point (typically the shape centroid).
quad_tensorThe output 3x3 quadrupole tensor.

◆ operator=()

GaussianShapeFunction& CDPL::Shape::GaussianShapeFunction::operator= ( const GaussianShapeFunction func)

Copy assignment operator.

Parameters
funcThe other GaussianShapeFunction instance.
Returns
A reference to itself.

Friends And Related Function Documentation

◆ FastGaussianShapeOverlapFunction

friend class FastGaussianShapeOverlapFunction
friend

◆ ExactGaussianShapeOverlapFunction

friend class ExactGaussianShapeOverlapFunction
friend

Member Data Documentation

◆ DEF_MAX_PRODUCT_ORDER

constexpr std::size_t CDPL::Shape::GaussianShapeFunction::DEF_MAX_PRODUCT_ORDER = 6
staticconstexpr

Default maximum order of the Gaussian-product expansion.

◆ DEF_DISTANCE_CUTOFF

constexpr double CDPL::Shape::GaussianShapeFunction::DEF_DISTANCE_CUTOFF = 0.0
staticconstexpr

Default distance cutoff for pruning negligible Gaussian-product contributions.


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