Chemical Data Processing Library C++ API - Version 1.1.1
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
CDPL::GRAIL::AtomDensityGridCalculator::setDensityFunction
void setDensityFunction(const DensityFunction &func)
CDPL::Math::Vector< double >
VectorArray.hpp
Definition of the class CDPL::Math::VectorArray.
CDPL::GRAIL::AtomDensityGridCalculator::AtomDensityGridCalculator
AtomDensityGridCalculator()
CDPL::GRAIL::AtomDensityGridCalculator::calculate
void calculate(const Chem::AtomContainer &atoms, Grid::DSpatialGrid &grid)
CDPL::Math::Vector3D
CVector< double, 3 > Vector3D
A bounded 3 element vector holding floating point values of type double.
Definition: Vector.hpp:1637
CDPL::GRAIL::AtomDensityGridCalculator::AtomDensityGridCalculator
AtomDensityGridCalculator(const AtomDensityGridCalculator &calc)
CDPL::GRAIL::AtomDensityGridCalculator
AtomDensityGridCalculator.
Definition: AtomDensityGridCalculator.hpp:69
CDPL::Chem::Atom
Atom.
Definition: Atom.hpp:52
CDPL::GRAIL::AtomDensityGridCalculator::DensityFunction
std::function< double(const Math::Vector3D &, const Math::Vector3D &, const Chem::Atom &)> DensityFunction
Definition: AtomDensityGridCalculator.hpp:76
SpatialGrid.hpp
Definition of a spatial grid data type.
VectorArray< Vector3D >
CDPL::GRAIL::AtomDensityGridCalculator::setDensityCombinationFunction
void setDensityCombinationFunction(const DensityCombinationFunction &func)
Atom3DCoordinatesFunction.hpp
Type definition of a generic wrapper class for storing user-defined Chem::Atom 3D-coordinates functio...
CDPL::GRAIL::AtomDensityGridCalculator::getDensityCombinationFunction
const DensityCombinationFunction & getDensityCombinationFunction() const
CDPL::Chem::AtomContainer
A common interface for data-structures that support a random access to stored Chem::Atom instances.
Definition: AtomContainer.hpp:55
CDPL::GRAIL::AtomDensityGridCalculator::DensityCombinationFunction
std::function< double(const Math::DVector &)> DensityCombinationFunction
Definition: AtomDensityGridCalculator.hpp:77
double
CDPL::GRAIL::AtomDensityGridCalculator::setDistanceCutoff
void setDistanceCutoff(double dist)
CDPL::GRAIL::AtomDensityGridCalculator::operator=
AtomDensityGridCalculator & operator=(const AtomDensityGridCalculator &calc)
CDPL::Grid::SpatialGrid
SpatialGrid.
Definition: SpatialGrid.hpp:47
CDPL::GRAIL::AtomDensityGridCalculator::getAtom3DCoordinatesFunction
const Chem::Atom3DCoordinatesFunction & getAtom3DCoordinatesFunction() const
APIPrefix.hpp
Definition of the preprocessor macro CDPL_GRAIL_API.
CDPL::Chem::Atom3DCoordinatesFunction
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
CDPL
The namespace of the Chemical Data Processing Library.
CDPL::GRAIL::AtomDensityGridCalculator::AtomDensityGridCalculator
AtomDensityGridCalculator(const DensityFunction &density_func, const DensityCombinationFunction &comb_func)
CDPL::GRAIL::AtomDensityGridCalculator::SharedPointer
std::shared_ptr< AtomDensityGridCalculator > SharedPointer
Definition: AtomDensityGridCalculator.hpp:74
CDPL::GRAIL::AtomDensityGridCalculator::setAtom3DCoordinatesFunction
void setAtom3DCoordinatesFunction(const Chem::Atom3DCoordinatesFunction &func)
Specifies a function for the retrieval of atom 3D-coordinates for grid calculation.
CDPL::GRAIL::AtomDensityGridCalculator::getDensityFunction
const DensityFunction & getDensityFunction() const
CDPL_GRAIL_API
#define CDPL_GRAIL_API
Tells the compiler/linker which classes, functions and variables are part of the library API.
CDPL::GRAIL::AtomDensityGridCalculator::AtomDensityGridCalculator
AtomDensityGridCalculator(const DensityFunction &func)
Vector.hpp
Definition of vector data types.
CDPL::GRAIL::AtomDensityGridCalculator::getDistanceCutoff
double getDistanceCutoff() const