source: src/Potentials/Specifics/ManyBodyPotential_Tersoff.hpp@ 155cc2

Action_Thermostats Add_AtomRandomPerturbation Add_FitFragmentPartialChargesAction Add_RotateAroundBondAction Add_SelectAtomByNameAction Added_ParseSaveFragmentResults AddingActions_SaveParseParticleParameters Adding_Graph_to_ChangeBondActions Adding_MD_integration_tests Adding_ParticleName_to_Atom Adding_StructOpt_integration_tests AtomFragments Automaking_mpqc_open AutomationFragmentation_failures Candidate_v1.5.4 Candidate_v1.6.0 Candidate_v1.6.1 ChangeBugEmailaddress ChangingTestPorts ChemicalSpaceEvaluator CombiningParticlePotentialParsing Combining_Subpackages Debian_Package_split Debian_package_split_molecuildergui_only Disabling_MemDebug Docu_Python_wait EmpiricalPotential_contain_HomologyGraph EmpiricalPotential_contain_HomologyGraph_documentation Enable_parallel_make_install Enhance_userguide Enhanced_StructuralOptimization Enhanced_StructuralOptimization_continued Example_ManyWaysToTranslateAtom Exclude_Hydrogens_annealWithBondGraph FitPartialCharges_GlobalError Fix_BoundInBox_CenterInBox_MoleculeActions Fix_ChargeSampling_PBC Fix_ChronosMutex Fix_FitPartialCharges Fix_FitPotential_needs_atomicnumbers Fix_ForceAnnealing Fix_IndependentFragmentGrids Fix_ParseParticles Fix_ParseParticles_split_forward_backward_Actions Fix_PopActions Fix_QtFragmentList_sorted_selection Fix_Restrictedkeyset_FragmentMolecule Fix_StatusMsg Fix_StepWorldTime_single_argument Fix_Verbose_Codepatterns Fix_fitting_potentials Fixes ForceAnnealing_goodresults ForceAnnealing_oldresults ForceAnnealing_tocheck ForceAnnealing_with_BondGraph ForceAnnealing_with_BondGraph_continued ForceAnnealing_with_BondGraph_continued_betteresults ForceAnnealing_with_BondGraph_contraction-expansion FragmentAction_writes_AtomFragments FragmentMolecule_checks_bonddegrees GeometryObjects Gui_Fixes Gui_displays_atomic_force_velocity ImplicitCharges IndependentFragmentGrids IndependentFragmentGrids_IndividualZeroInstances IndependentFragmentGrids_IntegrationTest IndependentFragmentGrids_Sole_NN_Calculation JobMarket_RobustOnKillsSegFaults JobMarket_StableWorkerPool JobMarket_unresolvable_hostname_fix MoreRobust_FragmentAutomation ODR_violation_mpqc_open PartialCharges_OrthogonalSummation PdbParser_setsAtomName PythonUI_with_named_parameters QtGui_reactivate_TimeChanged_changes Recreated_GuiChecks Rewrite_FitPartialCharges RotateToPrincipalAxisSystem_UndoRedo SaturateAtoms_findBestMatching SaturateAtoms_singleDegree StoppableMakroAction Subpackage_CodePatterns Subpackage_JobMarket Subpackage_LinearAlgebra Subpackage_levmar Subpackage_mpqc_open Subpackage_vmg Switchable_LogView ThirdParty_MPQC_rebuilt_buildsystem TrajectoryDependenant_MaxOrder TremoloParser_IncreasedPrecision TremoloParser_MultipleTimesteps TremoloParser_setsAtomName Ubuntu_1604_changes stable
Last change on this file since 155cc2 was 3ccea3, checked in by Frederik Heber <heber@…>, 12 years ago

EmpiricalPotential and FunctionModel are now inherited virtually, have overlapping function definitions.

  • EmpiricalPotential and FunctionModel differ only in the way of the derivative. The simple function evaluation is the same. EmpiricalPotential however desires the derivative with respect to the arguments, while FunctionModel requires the derivative with respect to the parameters.
  • therefore, we shifted some of the function definitions in between the two and had to some typedefs in PairPotential_Harmonic and ManyBodyPotential_Tersoff to clarify ambiguities.
  • Property mode set to 100644
File size: 5.9 KB
Line 
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
19#include "Potentials/EmpiricalPotential.hpp"
20#include "FunctionApproximation/FunctionModel.hpp"
21
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 */
29class ManyBodyPotential_Tersoff : virtual public EmpiricalPotential, virtual public FunctionModel
30{
31 // some repeated typedefs to avoid ambiguities
32 typedef FunctionModel::arguments_t arguments_t;
33 typedef FunctionModel::result_t result_t;
34 typedef FunctionModel::results_t results_t;
35 typedef EmpiricalPotential::derivative_components_t derivative_components_t;
36private:
37 //!> cutoff_offset offset for cutoff parameter
38 const double cutoff_offset;
39 //!> cutoff_halfwidth half-width for cutoff parameter
40 const double cutoff_halfwidth;
41 //!> many body prefactor parameter for attractive part
42 const double manybodyparameter_A;
43 //!> many body prefactor parameter for attractive part
44 const double manybodyparameter_B;
45 //!> many body scale parameter for attractive part
46 const double manybodyparameter_lambda1;
47 //!> many body scale parameter for attractive part
48 const double manybodyparameter_lambda2;
49 //!> length scale for coordination influence
50 const double manybodyparameter_lambda3;
51 //!> many body parameter for attractive part
52 const double manybodyparameter_alpha;
53 //!> many body parameter for repulsive part
54 const double manybodyparameter_beta;
55 //!> many body type-dependent parameter giving the power
56 const double manybodyparameter_n;
57 //!> many-body type-dependent parameter in angular dependence
58 const double manybodyparameter_c;
59 //!> many-body type-dependent parameter in angular dependence
60 const double manybodyparameter_d;
61 //!> many-body type-dependent parameter in angular dependence
62 const double manybodyparameter_h;
63public:
64 /** Constructor for class ManyBodyPotential_Tersoff.
65 *
66 * @param _triplefunction function that returns a list of triples (i.e. the
67 * two remaining distances) to a given pair of points (contained as
68 * indices within the argument)
69 */
70 ManyBodyPotential_Tersoff(
71 const double _cutoff_offset,
72 const double _cutoff_halfwidth,
73 const double A,
74 const double B,
75 const double lambda1,
76 const double lambda2,
77 const double lambda3,
78 const double alpha,
79 const double beta,
80 const double n,
81 const double c,
82 const double d,
83 const double h,
84 boost::function< std::vector<arguments_t>(const argument_t &, const double)> &_triplefunction) :
85 cutoff_offset(_cutoff_offset),
86 cutoff_halfwidth(_cutoff_offset),
87 manybodyparameter_A(A),
88 manybodyparameter_B(B),
89 manybodyparameter_lambda1(lambda1),
90 manybodyparameter_lambda2(lambda2),
91 manybodyparameter_lambda3(lambda3),
92 manybodyparameter_alpha(alpha),
93 manybodyparameter_beta(beta),
94 manybodyparameter_n(n),
95 manybodyparameter_c(d),
96 manybodyparameter_d(d),
97 manybodyparameter_h(h),
98 triplefunction(_triplefunction)
99 {}
100 /** Destructor of class ManyBodyPotential_Tersoff.
101 *
102 */
103 virtual ~ManyBodyPotential_Tersoff() {}
104
105 /** Evaluates the Tersoff potential for the given arguments.
106 *
107 * @param arguments single distance
108 * @return value of the potential function
109 */
110 results_t operator()(const arguments_t &arguments) const;
111
112 /** Evaluates the derivative of the Tersoff potential with respect to the
113 * input variables.
114 *
115 * @param arguments single distance
116 * @return vector with components of the derivative
117 */
118 derivative_components_t derivative(const arguments_t &arguments) const;
119
120 /** Evaluates the derivative of the function with the given \a arguments
121 * with respect to a specific parameter indicated by \a index.
122 *
123 * \param arguments set of arguments as input variables to the function
124 * \param index derivative of which parameter
125 * \return result vector containing the derivative with respect to the given
126 * input
127 */
128 virtual results_t paramter_derivative(const arguments_t &arguments, const size_t index) const=0;
129
130private:
131 /** This function represents the cutoff \f$ f_C \f$.
132 *
133 * @param distance variable of the function
134 * @return a value in [0,1].
135 */
136 result_t function_cutoff(
137 const double &distance
138 ) const;
139 /** This function has the exponential feature from the Morse potential.
140 *
141 * @param distance variable of the function
142 * @param prefactor prefactor parameter to exp function
143 * @param lambda scale parameter of exp function's argument
144 * @return
145 */
146 result_t function_smoother(
147 const double &distance,
148 const double &prefactor,
149 const double &lambda
150 ) const
151 {
152 return prefactor * exp(-lambda * distance);
153 }
154
155 /** This function represents \f$ (1 + \alpha^n \eta^n)^{-1/2n} \f$.
156 *
157 * @param alpha prefactor to eta function
158 * @param r_ij distance argument
159 * @param etafunction eta or zeta
160 * @return \f$ (1 + \alpha^n \eta^n)^{-1/2n} \f$
161 */
162 result_t function_prefactor(
163 const double &alpha,
164 boost::function<result_t()> etafunction
165 ) const;
166
167 result_t
168 function_eta(
169 const argument_t &r_ij
170 ) const;
171
172 result_t
173 function_zeta(
174 const argument_t &r_ij
175 ) const;
176
177 result_t
178 function_angle(
179 const double &r_ij,
180 const double &r_ik,
181 const double &r_jk
182 ) const;
183
184private:
185 //!> bound function that obtains the triples for the internal coordinationb summation.
186 const boost::function< std::vector< arguments_t >(const argument_t &, const double)> &triplefunction;
187};
188
189
190#endif /* MANYBODYPOTENTIAL_TERSOFF_HPP_ */
Note: See TracBrowser for help on using the repository browser.