/* * PairPotential_Harmonic.hpp * * Created on: Sep 26, 2012 * Author: heber */ #ifndef PAIRPOTENTIAL_HARMONIC_HPP_ #define PAIRPOTENTIAL_HARMONIC_HPP_ // include config.h #ifdef HAVE_CONFIG_H #include #endif #include "Potentials/EmpiricalPotential.hpp" #include "FunctionApproximation/FunctionModel.hpp" /** This is the implementation of a harmonic pair potential. * * This evaluates \f$ k \cdot (r -r_0)^2 \f$. * */ class PairPotential_Harmonic : public EmpiricalPotential, public FunctionModel { public: PairPotential_Harmonic(); PairPotential_Harmonic( const double _spring_constant, const double _equilibrium_distance) : spring_constant(_spring_constant), equilibrium_distance(_equilibrium_distance) {} virtual ~PairPotential_Harmonic() {} /** Setter for parameters as required by FunctionModel interface. * * \param _params given set of parameters */ void setParameters(const parameters_t &_params); /** Getter for parameters as required by FunctionModel interface. * * \return set of parameters */ parameters_t getParameters() const; /** Getter for the number of parameters of this model function. * * \return number of parameters */ size_t getParameterDimension() const { return 2; } /** Evaluates the harmonic potential function for the given arguments. * * @param arguments single distance * @return value of the potential function */ results_t operator()(const arguments_t &arguments) const; /** Evaluates the derivative of the potential function. * * @param arguments single distance * @return vector with derivative with respect to the input degrees of freedom */ derivative_components_t derivative(const arguments_t &arguments) const; private: //!> the spring constant for the harmonic potential double spring_constant; //!> the equilibrium distance indicating the potential minimum double equilibrium_distance; }; #endif /* PAIRPOTENTIAL_HARMONIC_HPP_ */