Chemical Data Processing Library Python API - Version 1.4.0
Public Member Functions | Static Public Attributes | Properties | 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...

+ Inheritance diagram for CDPL.Shape.GaussianShapeFunction:

Public Member Functions

None __init__ ()
 Constructs the GaussianShapeFunction instance without an associated shape.
 
None __init__ (GaussianShape shape)
 Constructs the GaussianShapeFunction instance associated with shape. More...
 
None __init__ (GaussianShapeFunction func)
 Constructs a copy of the GaussianShapeFunction instance func. More...
 
int getObjectID ()
 Returns the numeric identifier (ID) of the wrapped C++ class instance. More...
 
GaussianShapeFunction assign (GaussianShapeFunction func)
 Copy assignment operator. More...
 
None setShape (GaussianShape shape)
 Associates the function with the Gaussian shape shape. More...
 
GaussianShape getShape ()
 Returns a reference to the associated Gaussian shape (or nullptr if none is associated). More...
 
None setMaxOrder (int max_order)
 Sets the maximum order of the Gaussian-product expansion. More...
 
int getMaxOrder ()
 Returns the currently configured maximum order of the Gaussian-product expansion. More...
 
None setDistanceCutoff (float cutoff)
 Sets the distance cutoff for pruning negligible Gaussian-product contributions. More...
 
float getDistanceCutoff ()
 Returns the currently configured distance cutoff. More...
 
None reset ()
 Resets the function by discarding the cached Gaussian-product expansion.
 
None transform (Math.Matrix4D xform)
 Applies an affine transformation to the element positions of the associated shape. More...
 
None getElementPositions (Math.Vector3DArray coords)
 Returns the 3D positions of all elements of the associated shape. More...
 
Math.Vector3D getElementPosition (int idx)
 Returns the 3D position of the element at index idx. More...
 
float calcVolume ()
 Calculates the total volume enclosed by the Gaussian shape. More...
 
float calcDensity (Math.Vector3D pos)
 Evaluates the Gaussian density of the shape at the 3D position pos. More...
 
float calcSurfaceArea ()
 Calculates the total surface area of the Gaussian shape. More...
 
float calcSurfaceArea (int elem_idx)
 Calculates the surface area contribution of the single element at index elem_idx. More...
 
None calcCentroid (Math.Vector3D ctr)
 Calculates the centroid of the Gaussian shape. More...
 
None calcQuadrupoleTensor (Math.Vector3D ctr, Math.Matrix3D quad_tensor)
 Calculates the quadrupole tensor of the Gaussian shape with respect to the reference point ctr. More...
 

Static Public Attributes

int DEF_MAX_PRODUCT_ORDER = 6
 Default maximum order of the Gaussian-product expansion.
 
float DEF_DISTANCE_CUTOFF = 0.0
 Default distance cutoff for pruning negligible Gaussian-product contributions.
 

Properties

 objectID = property(getObjectID)
 
 shape = property(getShape, setShape)
 
 volume = property(calcVolume)
 
 surfaceArea = property(calcSurfaceArea)
 
 maxOrder = property(getMaxOrder, setMaxOrder)
 
 distCutoff = property(getDistanceCutoff, setDistanceCutoff)
 

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).

Constructor & Destructor Documentation

◆ __init__() [1/2]

None CDPL.Shape.GaussianShapeFunction.__init__ ( GaussianShape  shape)

Constructs the GaussianShapeFunction instance associated with shape.

Parameters
shapeThe Gaussian shape.

◆ __init__() [2/2]

None CDPL.Shape.GaussianShapeFunction.__init__ ( GaussianShapeFunction  func)

Constructs a copy of the GaussianShapeFunction instance func.

Parameters
funcThe GaussianShapeFunction to copy.

Member Function Documentation

◆ getObjectID()

int CDPL.Shape.GaussianShapeFunction.getObjectID ( )

Returns the numeric identifier (ID) of the wrapped C++ class instance.

Different Python GaussianShapeFunction instances may reference the same underlying C++ class instance. The commonly used Python expression a is not b thus cannot tell reliably whether the two GaussianShapeFunction instances a and b reference different C++ objects. The numeric identifier returned by this method allows to correctly implement such an identity test via the simple expression a.getObjectID() != b.getObjectID().

Returns
The numeric ID of the internally referenced C++ class instance.

◆ assign()

GaussianShapeFunction CDPL.Shape.GaussianShapeFunction.assign ( GaussianShapeFunction  func)

Copy assignment operator.

Parameters
funcThe other GaussianShapeFunction instance.
Returns
self

◆ setShape()

None CDPL.Shape.GaussianShapeFunction.setShape ( GaussianShape  shape)

Associates the function with the Gaussian shape shape.

Parameters
shapeThe Gaussian shape.

◆ getShape()

GaussianShape CDPL.Shape.GaussianShapeFunction.getShape ( )

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

Returns
A reference to the associated Gaussian shape.

◆ setMaxOrder()

None CDPL.Shape.GaussianShapeFunction.setMaxOrder ( int  max_order)

Sets the maximum order of the Gaussian-product expansion.

Parameters
max_orderThe maximum order.

◆ getMaxOrder()

int CDPL.Shape.GaussianShapeFunction.getMaxOrder ( )

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

Returns
The configured maximum order.

◆ setDistanceCutoff()

None CDPL.Shape.GaussianShapeFunction.setDistanceCutoff ( float  cutoff)

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

Parameters
cutoffThe cutoff distance.

◆ getDistanceCutoff()

float CDPL.Shape.GaussianShapeFunction.getDistanceCutoff ( )

Returns the currently configured distance cutoff.

Returns
The configured distance cutoff.

◆ transform()

None CDPL.Shape.GaussianShapeFunction.transform ( Math.Matrix4D  xform)

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

Parameters
xformThe 4x4 transformation matrix.

◆ getElementPositions()

None CDPL.Shape.GaussianShapeFunction.getElementPositions ( Math.Vector3DArray  coords)

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

Parameters
coordsThe output array of 3D positions.

◆ getElementPosition()

Math.Vector3D CDPL.Shape.GaussianShapeFunction.getElementPosition ( int  idx)

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

Parameters
idxThe element index.
Returns
A 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].

◆ calcVolume()

float CDPL.Shape.GaussianShapeFunction.calcVolume ( )

Calculates the total volume enclosed by the Gaussian shape.

Returns
The volume.

◆ calcDensity()

float CDPL.Shape.GaussianShapeFunction.calcDensity ( Math.Vector3D  pos)

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

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

◆ calcSurfaceArea() [1/2]

float CDPL.Shape.GaussianShapeFunction.calcSurfaceArea ( )

Calculates the total surface area of the Gaussian shape.

Returns
The total surface area.

◆ calcSurfaceArea() [2/2]

float CDPL.Shape.GaussianShapeFunction.calcSurfaceArea ( int  elem_idx)

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

Parameters
elem_idxThe element index.
Returns
The element surface area.

◆ calcCentroid()

None CDPL.Shape.GaussianShapeFunction.calcCentroid ( Math.Vector3D  ctr)

Calculates the centroid of the Gaussian shape.

Parameters
ctrThe output centroid position.

◆ calcQuadrupoleTensor()

None CDPL.Shape.GaussianShapeFunction.calcQuadrupoleTensor ( Math.Vector3D  ctr,
Math.Matrix3D  quad_tensor 
)

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.