/* * SphericalPointDistribution.hpp * * Created on: May 29, 2014 * Author: heber */ #ifndef SPHERICALPOINTDISTRIBUTION_HPP_ #define SPHERICALPOINTDISTRIBUTION_HPP_ // include config.h #ifdef HAVE_CONFIG_H #include #endif #include "CodePatterns/Assert.hpp" #include #include #include "LinearAlgebra/Vector.hpp" /** contains getters for the VSEPR model for specific number of electrons. * * This struct contains specialized functions returning a list of Vectors * (points in space) to match the VSEPR model for the given number of electrons. * * This is implemented via template specialization of the function get(). * * These specializations are taken from the python script \b CreateVspeShapes.py * by Christian Neuen, 07th May 2009. */ struct SphericalPointDistribution { /** Cstor for SphericalPointDistribution, allows setting radius of sphere * * \param _BondLength desired radius of sphere */ SphericalPointDistribution(const double _Bondlength = 1.) : Bondlength(_Bondlength) {} //!> typedef for the list of points typedef std::list Polygon_t; /** General getter function for the distribution of points on the surface. * * \warn this function needs to be specialized! * * \return Polygon_t with points on the surface centered at (0,0,0) */ template Polygon_t get() const { ASSERT(0, "SphericalPointDistribution::get() - not specialized for "+toString(N)+"."); } /** Initializes the polygon with the given \a _NumberOfPoints. * * \param _NumberOfPoints number of points */ Polygon_t getSimplePolygon(const int _NumberOfPoints) const; /** Matches a given spherical distribution with another containing more * points. * * This is a helper to determine points where to best insert saturation * hydrogens. * * \param _polygon current occupied positions * \param _newpolygon ideal distribution to match best with current occupied * positions * \return remaining vacant positions relative to \a _polygon */ static Polygon_t matchSphericalPointDistributions( const Polygon_t &_polygon, const Polygon_t &_newpolygon ); //!> default radius of the spherical distribution const double Bondlength; //!> precalculated value for root of 3 static const double SQRT_3; }; // declare specializations template <> SphericalPointDistribution::Polygon_t SphericalPointDistribution::get<0>() const; template <> SphericalPointDistribution::Polygon_t SphericalPointDistribution::get<1>() const; template <> SphericalPointDistribution::Polygon_t SphericalPointDistribution::get<2>() const; template <> SphericalPointDistribution::Polygon_t SphericalPointDistribution::get<3>() const; template <> SphericalPointDistribution::Polygon_t SphericalPointDistribution::get<4>() const; template <> SphericalPointDistribution::Polygon_t SphericalPointDistribution::get<5>() const; template <> SphericalPointDistribution::Polygon_t SphericalPointDistribution::get<6>() const; template <> SphericalPointDistribution::Polygon_t SphericalPointDistribution::get<7>() const; template <> SphericalPointDistribution::Polygon_t SphericalPointDistribution::get<8>() const; template <> SphericalPointDistribution::Polygon_t SphericalPointDistribution::get<9>() const; template <> SphericalPointDistribution::Polygon_t SphericalPointDistribution::get<10>() const; template <> SphericalPointDistribution::Polygon_t SphericalPointDistribution::get<11>() const; template <> SphericalPointDistribution::Polygon_t SphericalPointDistribution::get<12>() const; template <> SphericalPointDistribution::Polygon_t SphericalPointDistribution::get<14>() const; #endif /* SPHERICALPOINTDISTRIBUTION_HPP_ */