Chemical Data Processing Library C++ API - Version 1.2.0
GaussianShapeFunction.hpp
Go to the documentation of this file.
1 /*
2  * GaussianShapeFunction.hpp
3  *
4  * This file is part of the Chemical Data Processing Toolkit
5  *
6  * Copyright (C) 2003 Thomas Seidel <thomas.seidel@univie.ac.at>
7  *
8  * This library is free software; you can redistribute it and/or
9  * modify it under the terms of the GNU Lesser General Public
10  * License as published by the Free Software Foundation; either
11  * version 2 of the License, or (at your option) any later version.
12  *
13  * This library is distributed in the hope that it will be useful,
14  * but WITHOUT ANY WARRANTY; without even the implied warranty of
15  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
16  * Lesser General Public License for more details.
17  *
18  * You should have received a copy of the GNU Lesser General Public License
19  * along with this library; see the file COPYING. If not, write to
20  * the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
21  * Boston, MA 02111-1307, USA.
22  */
23 
29 #ifndef CDPL_SHAPE_GAUSSIANSHAPEFUNCTION_HPP
30 #define CDPL_SHAPE_GAUSSIANSHAPEFUNCTION_HPP
31 
32 #include <cstddef>
33 #include <memory>
34 
35 #include "CDPL/Shape/APIPrefix.hpp"
36 #include "CDPL/Math/Vector.hpp"
37 #include "CDPL/Math/Matrix.hpp"
39 
40 
41 namespace CDPL
42 {
43 
44  namespace Shape
45  {
46 
47  class GaussianShape;
48  class GaussianProductList;
49  class ExactGaussianShapeOverlapFunction;
50  class FastGaussianShapeOverlapFunction;
51 
53  {
54 
55  public:
56  static constexpr std::size_t DEF_MAX_PRODUCT_ORDER = 6;
57  static constexpr double DEF_DISTANCE_CUTOFF = 0.0;
58 
59  typedef std::shared_ptr<GaussianShapeFunction> SharedPointer;
60 
62 
64 
66 
68 
69  void setMaxOrder(std::size_t max_order);
70 
71  std::size_t getMaxOrder() const;
72 
73  void setDistanceCutoff(double cutoff);
74 
75  double getDistanceCutoff() const;
76 
77  void setShape(const GaussianShape& shape);
78 
79  const GaussianShape* getShape() const;
80 
81  void reset();
82 
83  void transform(const Math::Matrix4D& xform);
84 
85  const Math::Vector3D& getElementPosition(std::size_t idx) const;
86 
88 
89  double calcDensity(const Math::Vector3D& pos) const;
90 
91  double calcVolume() const;
92 
93  double calcSurfaceArea() const;
94 
95  double calcSurfaceArea(std::size_t elem_idx) const;
96 
97  void calcCentroid(Math::Vector3D& ctr) const;
98 
99  void calcQuadrupoleTensor(const Math::Vector3D& ctr, Math::Matrix3D& quad_tensor) const;
100 
102 
103  private:
106 
107  const GaussianProductList* getProductList() const;
108 
109  typedef std::unique_ptr<GaussianProductList> ProductListPtr;
110 
111  const GaussianShape* shape;
112  double volume;
113  ProductListPtr prodList;
114  };
115  } // namespace Shape
116 } // namespace CDPL
117 
118 #endif // CDPL_SHAPE_GAUSSIANSHAPEFUNCTION_HPP
Definition of matrix data types.
Definition of the preprocessor macro CDPL_SHAPE_API.
#define CDPL_SHAPE_API
Tells the compiler/linker which classes, functions and variables are part of the library API.
Definition of the class CDPL::Math::VectorArray.
Definition of vector data types.
Definition: ExactGaussianShapeOverlapFunction.hpp:47
Definition: FastGaussianShapeOverlapFunction.hpp:47
Definition: GaussianShapeFunction.hpp:53
void getElementPositions(Math::Vector3DArray &coords) const
void setShape(const GaussianShape &shape)
void transform(const Math::Matrix4D &xform)
GaussianShapeFunction(const GaussianShape &shape)
const Math::Vector3D & getElementPosition(std::size_t idx) const
GaussianShapeFunction(const GaussianShapeFunction &func)
GaussianShapeFunction & operator=(const GaussianShapeFunction &func)
void setMaxOrder(std::size_t max_order)
double calcDensity(const Math::Vector3D &pos) const
const GaussianShape * getShape() const
std::shared_ptr< GaussianShapeFunction > SharedPointer
Definition: GaussianShapeFunction.hpp:59
void setDistanceCutoff(double cutoff)
void calcCentroid(Math::Vector3D &ctr) const
double calcSurfaceArea(std::size_t elem_idx) const
void calcQuadrupoleTensor(const Math::Vector3D &ctr, Math::Matrix3D &quad_tensor) const
A data type for the descripton of arbitrary shapes composed of spheres approximated by gaussian funct...
Definition: GaussianShape.hpp:51
VectorArray< Vector3D > Vector3DArray
An array of Math::Vector3D objects.
Definition: VectorArray.hpp:84
CVector< double, 3 > Vector3D
A bounded 3 element vector holding floating point values of type double.
Definition: Vector.hpp:1637
CMatrix< double, 3, 3 > Matrix3D
A bounded 3x3 matrix holding floating point values of type double.
Definition: Matrix.hpp:1849
The namespace of the Chemical Data Processing Library.