[610c11] | 1 | /*
|
---|
| 2 | * ManyBodyPotential_Tersoff.hpp
|
---|
| 3 | *
|
---|
| 4 | * Created on: Sep 26, 2012
|
---|
| 5 | * Author: heber
|
---|
| 6 | */
|
---|
| 7 |
|
---|
| 8 | #ifndef MANYBODYPOTENTIAL_TERSOFF_HPP_
|
---|
| 9 | #define MANYBODYPOTENTIAL_TERSOFF_HPP_
|
---|
| 10 |
|
---|
| 11 | // include config.h
|
---|
| 12 | #ifdef HAVE_CONFIG_H
|
---|
| 13 | #include <config.h>
|
---|
| 14 | #endif
|
---|
| 15 |
|
---|
| 16 | #include <boost/function.hpp>
|
---|
| 17 | #include <cmath>
|
---|
| 18 |
|
---|
[4f82f8] | 19 | #include "Potentials/EmpiricalPotential.hpp"
|
---|
| 20 | #include "FunctionApproximation/FunctionModel.hpp"
|
---|
| 21 |
|
---|
[610c11] | 22 | /** This class is the implementation of the Tersoff potential function.
|
---|
| 23 | *
|
---|
| 24 | * \note The arguments_t argument list is here in the following order:
|
---|
| 25 | * -# first \f$ r_{ij}$ \f$,
|
---|
| 26 | * -# then all \f$ r_{ik}$ \f$ that are within the cutoff, i.e. \f$ r_{ik}$ < R + D\f$
|
---|
| 27 | *
|
---|
| 28 | */
|
---|
[4f82f8] | 29 | class ManyBodyPotential_Tersoff : public EmpiricalPotential, public FunctionModel
|
---|
[610c11] | 30 | {
|
---|
| 31 | private:
|
---|
| 32 | //!> cutoff_offset offset for cutoff parameter
|
---|
| 33 | const double cutoff_offset;
|
---|
| 34 | //!> cutoff_halfwidth half-width for cutoff parameter
|
---|
| 35 | const double cutoff_halfwidth;
|
---|
| 36 | //!> many body prefactor parameter for attractive part
|
---|
| 37 | const double manybodyparameter_A;
|
---|
| 38 | //!> many body prefactor parameter for attractive part
|
---|
| 39 | const double manybodyparameter_B;
|
---|
| 40 | //!> many body scale parameter for attractive part
|
---|
| 41 | const double manybodyparameter_lambda1;
|
---|
| 42 | //!> many body scale parameter for attractive part
|
---|
| 43 | const double manybodyparameter_lambda2;
|
---|
| 44 | //!> length scale for coordination influence
|
---|
| 45 | const double manybodyparameter_lambda3;
|
---|
| 46 | //!> many body parameter for attractive part
|
---|
| 47 | const double manybodyparameter_alpha;
|
---|
| 48 | //!> many body parameter for repulsive part
|
---|
| 49 | const double manybodyparameter_beta;
|
---|
| 50 | //!> many body type-dependent parameter giving the power
|
---|
| 51 | const double manybodyparameter_n;
|
---|
| 52 | //!> many-body type-dependent parameter in angular dependence
|
---|
| 53 | const double manybodyparameter_c;
|
---|
| 54 | //!> many-body type-dependent parameter in angular dependence
|
---|
| 55 | const double manybodyparameter_d;
|
---|
| 56 | //!> many-body type-dependent parameter in angular dependence
|
---|
| 57 | const double manybodyparameter_h;
|
---|
| 58 | public:
|
---|
| 59 | /** Constructor for class ManyBodyPotential_Tersoff.
|
---|
| 60 | *
|
---|
| 61 | * @param _triplefunction function that returns a list of triples (i.e. the
|
---|
| 62 | * two remaining distances) to a given pair of points (contained as
|
---|
| 63 | * indices within the argument)
|
---|
| 64 | */
|
---|
| 65 | ManyBodyPotential_Tersoff(
|
---|
| 66 | const double _cutoff_offset,
|
---|
| 67 | const double _cutoff_halfwidth,
|
---|
| 68 | const double A,
|
---|
| 69 | const double B,
|
---|
| 70 | const double lambda1,
|
---|
| 71 | const double lambda2,
|
---|
| 72 | const double lambda3,
|
---|
| 73 | const double alpha,
|
---|
| 74 | const double beta,
|
---|
| 75 | const double n,
|
---|
| 76 | const double c,
|
---|
| 77 | const double d,
|
---|
| 78 | const double h,
|
---|
| 79 | boost::function< std::vector<arguments_t>(const argument_t &, const double)> &_triplefunction) :
|
---|
| 80 | cutoff_offset(_cutoff_offset),
|
---|
| 81 | cutoff_halfwidth(_cutoff_offset),
|
---|
| 82 | manybodyparameter_A(A),
|
---|
| 83 | manybodyparameter_B(B),
|
---|
| 84 | manybodyparameter_lambda1(lambda1),
|
---|
| 85 | manybodyparameter_lambda2(lambda2),
|
---|
| 86 | manybodyparameter_lambda3(lambda3),
|
---|
| 87 | manybodyparameter_alpha(alpha),
|
---|
| 88 | manybodyparameter_beta(beta),
|
---|
| 89 | manybodyparameter_n(n),
|
---|
| 90 | manybodyparameter_c(d),
|
---|
| 91 | manybodyparameter_d(d),
|
---|
| 92 | manybodyparameter_h(h),
|
---|
| 93 | triplefunction(_triplefunction)
|
---|
| 94 | {}
|
---|
| 95 | /** Destructor of class ManyBodyPotential_Tersoff.
|
---|
| 96 | *
|
---|
| 97 | */
|
---|
| 98 | virtual ~ManyBodyPotential_Tersoff() {}
|
---|
| 99 |
|
---|
| 100 | /** Evaluates the Tersoff potential for the given arguments.
|
---|
| 101 | *
|
---|
| 102 | * @param arguments single distance
|
---|
| 103 | * @return value of the potential function
|
---|
| 104 | */
|
---|
[4f82f8] | 105 | results_t operator()(const arguments_t &arguments) const;
|
---|
[610c11] | 106 |
|
---|
| 107 | /** Evaluates the derivative of the Tersoff potential with respect to the
|
---|
| 108 | * input variables.
|
---|
| 109 | *
|
---|
| 110 | * @param arguments single distance
|
---|
| 111 | * @return vector with components of the derivative
|
---|
| 112 | */
|
---|
| 113 | derivative_components_t derivative(const arguments_t &arguments) const;
|
---|
| 114 |
|
---|
| 115 | private:
|
---|
| 116 | /** This function represents the cutoff \f$ f_C \f$.
|
---|
| 117 | *
|
---|
| 118 | * @param distance variable of the function
|
---|
| 119 | * @return a value in [0,1].
|
---|
| 120 | */
|
---|
| 121 | result_t function_cutoff(
|
---|
| 122 | const double &distance
|
---|
| 123 | ) const;
|
---|
| 124 | /** This function has the exponential feature from the Morse potential.
|
---|
| 125 | *
|
---|
| 126 | * @param distance variable of the function
|
---|
| 127 | * @param prefactor prefactor parameter to exp function
|
---|
| 128 | * @param lambda scale parameter of exp function's argument
|
---|
| 129 | * @return
|
---|
| 130 | */
|
---|
| 131 | result_t function_smoother(
|
---|
| 132 | const double &distance,
|
---|
| 133 | const double &prefactor,
|
---|
| 134 | const double &lambda
|
---|
| 135 | ) const
|
---|
| 136 | {
|
---|
| 137 | return prefactor * exp(-lambda * distance);
|
---|
| 138 | }
|
---|
| 139 |
|
---|
| 140 | /** This function represents \f$ (1 + \alpha^n \eta^n)^{-1/2n} \f$.
|
---|
| 141 | *
|
---|
| 142 | * @param alpha prefactor to eta function
|
---|
| 143 | * @param r_ij distance argument
|
---|
| 144 | * @param etafunction eta or zeta
|
---|
| 145 | * @return \f$ (1 + \alpha^n \eta^n)^{-1/2n} \f$
|
---|
| 146 | */
|
---|
| 147 | result_t function_prefactor(
|
---|
| 148 | const double &alpha,
|
---|
| 149 | boost::function<result_t()> etafunction
|
---|
| 150 | ) const;
|
---|
| 151 |
|
---|
| 152 | result_t
|
---|
| 153 | function_eta(
|
---|
| 154 | const argument_t &r_ij
|
---|
| 155 | ) const;
|
---|
| 156 |
|
---|
| 157 | result_t
|
---|
| 158 | function_zeta(
|
---|
| 159 | const argument_t &r_ij
|
---|
| 160 | ) const;
|
---|
| 161 |
|
---|
| 162 | result_t
|
---|
| 163 | function_angle(
|
---|
| 164 | const double &r_ij,
|
---|
| 165 | const double &r_ik,
|
---|
| 166 | const double &r_jk
|
---|
| 167 | ) const;
|
---|
| 168 |
|
---|
| 169 | private:
|
---|
| 170 | //!> bound function that obtains the triples for the internal coordinationb summation.
|
---|
| 171 | const boost::function< std::vector< arguments_t >(const argument_t &, const double)> &triplefunction;
|
---|
| 172 | };
|
---|
| 173 |
|
---|
| 174 |
|
---|
| 175 | #endif /* MANYBODYPOTENTIAL_TERSOFF_HPP_ */
|
---|