source: src/Potentials/Specifics/ManyBodyPotential_Tersoff.hpp@ 4f82f8

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 4f82f8 was 4f82f8, checked in by Frederik Heber <heber@…>, 12 years ago

Rewrote EmpiricalPotentials and the specific implementations such that they are usable as FunctionModel's.

  • Property mode set to 100644
File size: 5.2 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 : public EmpiricalPotential, public FunctionModel
30{
31private:
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;
58public:
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 */
105 results_t operator()(const arguments_t &arguments) const;
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
115private:
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
169private:
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_ */
Note: See TracBrowser for help on using the repository browser.