Chemical Data Processing Library C++ API - Version 1.2.0
AtomDensityGridCalculator.hpp
Go to the documentation of this file.
1 /*
2  * AtomDensityGridCalculator.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_GRAIL_ATOMDENSITYGRIDCALCULATOR_HPP
30 #define CDPL_GRAIL_ATOMDENSITYGRIDCALCULATOR_HPP
31 
32 #include <vector>
33 #include <cstddef>
34 #include <memory>
35 #include <functional>
36 
37 #include "CDPL/GRAIL/APIPrefix.hpp"
38 #include "CDPL/Math/Vector.hpp"
42 
43 
44 namespace CDPL
45 {
46 
47  // \cond DOC_IMPL_DETAILS
48  namespace Internal
49  {
50 
51  template <typename PT, typename CT, typename ST>
52  class Octree;
53  }
54  // \endcond
55 
56  namespace Chem
57  {
58 
59  class AtomContainer;
60  }
61 
62  namespace GRAIL
63  {
64 
69  {
70 
71  public:
72  static constexpr double DEF_DISTANCE_CUTOFF = 4.5;
73 
74  typedef std::shared_ptr<AtomDensityGridCalculator> SharedPointer;
75 
76  typedef std::function<double(const Math::Vector3D&, const Math::Vector3D&, const Chem::Atom&)> DensityFunction;
77  typedef std::function<double(const Math::DVector&)> DensityCombinationFunction;
78 
80 
82 
84 
86 
87  void setDistanceCutoff(double dist);
88 
89  double getDistanceCutoff() const;
90 
92 
94 
96 
98 
104 
106 
108 
110 
111  private:
112  typedef Internal::Octree<Math::Vector3D, Math::Vector3DArray, double> Octree;
113  typedef std::shared_ptr<Octree> OctreePtr;
114  typedef std::vector<std::size_t> AtomIndexList;
115 
116  Math::DVector partialDensities;
117  DensityFunction densityFunc;
118  DensityCombinationFunction densityCombinationFunc;
120  double distCutoff;
121  OctreePtr octree;
122  Math::Vector3DArray atomCoords;
123  AtomIndexList atomIndices;
124  };
125  } // namespace GRAIL
126 } // namespace CDPL
127 
128 #endif // CDPL_GRAIL_ATOMDENSITYGRIDCALCULATOR_HPP
Type definition of a generic wrapper class for storing user-defined Chem::Atom 3D-coordinates functio...
Definition of the preprocessor macro CDPL_GRAIL_API.
#define CDPL_GRAIL_API
Tells the compiler/linker which classes, functions and variables are part of the library API.
Definition of a spatial grid data type.
Definition of the class CDPL::Math::VectorArray.
Definition of vector data types.
A common interface for data-structures that support a random access to stored Chem::Atom instances.
Definition: AtomContainer.hpp:55
Atom.
Definition: Atom.hpp:52
AtomDensityGridCalculator.
Definition: AtomDensityGridCalculator.hpp:69
void setAtom3DCoordinatesFunction(const Chem::Atom3DCoordinatesFunction &func)
Specifies a function for the retrieval of atom 3D-coordinates for grid calculation.
const Chem::Atom3DCoordinatesFunction & getAtom3DCoordinatesFunction() const
void setDensityCombinationFunction(const DensityCombinationFunction &func)
AtomDensityGridCalculator(const AtomDensityGridCalculator &calc)
std::function< double(const Math::DVector &)> DensityCombinationFunction
Definition: AtomDensityGridCalculator.hpp:77
const DensityCombinationFunction & getDensityCombinationFunction() const
const DensityFunction & getDensityFunction() const
AtomDensityGridCalculator & operator=(const AtomDensityGridCalculator &calc)
void setDensityFunction(const DensityFunction &func)
std::shared_ptr< AtomDensityGridCalculator > SharedPointer
Definition: AtomDensityGridCalculator.hpp:74
void calculate(const Chem::AtomContainer &atoms, Grid::DSpatialGrid &grid)
AtomDensityGridCalculator(const DensityFunction &density_func, const DensityCombinationFunction &comb_func)
std::function< double(const Math::Vector3D &, const Math::Vector3D &, const Chem::Atom &)> DensityFunction
Definition: AtomDensityGridCalculator.hpp:76
AtomDensityGridCalculator(const DensityFunction &func)
SpatialGrid.
Definition: SpatialGrid.hpp:47
std::function< const Math::Vector3D &(const Chem::Atom &)> Atom3DCoordinatesFunction
A generic wrapper class used to store a user-defined Chem::Atom 3D-coordinates function.
Definition: Atom3DCoordinatesFunction.hpp:43
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
The namespace of the Chemical Data Processing Library.