Changeset 2e9486
- Timestamp:
- Dec 19, 2012, 3:25:54 PM (12 years ago)
- Branches:
- 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
- Children:
- 56c5de4
- Parents:
- ca8d82
- git-author:
- Frederik Heber <heber@…> (10/08/12 21:30:38)
- git-committer:
- Frederik Heber <heber@…> (12/19/12 15:25:54)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
src/Potentials/Specifics/ManyBodyPotential_Tersoff.cpp
rca8d82 r2e9486 111 111 { 112 112 // Info info(__func__); 113 const argument_t &r_ij = arguments[0]; 114 const double cutoff = function_cutoff(r_ij.distance); 115 const double result = (cutoff == 0.) ? 116 0. : 117 cutoff * ( 118 function_prefactor( 119 alpha, 120 function_eta(r_ij)) 121 * function_smoother( 122 params[A], 123 params[lambda], 124 r_ij.distance) 125 + 126 function_prefactor( 127 params[beta], 128 function_zeta(r_ij)) 129 * function_smoother( 130 -params[B], 131 params[mu], 132 r_ij.distance) 133 ); 113 double result = 0.; 114 for(arguments_t::const_iterator argiter = arguments.begin(); 115 argiter != arguments.end(); 116 ++argiter) { 117 const argument_t &r_ij = *argiter; 118 const double cutoff = function_cutoff(r_ij.distance); 119 const double temp = (cutoff == 0.) ? 120 0. : 121 cutoff * ( 122 function_prefactor( 123 alpha, 124 function_eta(r_ij)) 125 * function_smoother( 126 params[A], 127 params[lambda], 128 r_ij.distance) 129 + 130 function_prefactor( 131 params[beta], 132 function_zeta(r_ij)) 133 * function_smoother( 134 -params[B], 135 params[mu], 136 r_ij.distance) 137 ); 138 result += temp; 139 } 134 140 // LOG(2, "DEBUG: operator()(" << r_ij.distance << ") = " << result); 135 141 return std::vector<result_t>(1, result); … … 153 159 // Info info(__func__); 154 160 // ASSERT( arguments.size() == 1, 155 // "PairPotential_Harmonic::parameter_derivative() - requires exactly one argument."); 156 const argument_t &r_ij = arguments[0]; 161 // "ManyBodyPotential_Tersoff::parameter_derivative() - requires exactly one argument."); 162 double result = 0.; 163 for(arguments_t::const_iterator argiter = arguments.begin(); 164 argiter != arguments.end(); 165 ++argiter) { 166 const argument_t &r_ij = *argiter; 157 167 switch (index) { 158 168 // case R: 159 169 // { 160 // const double result = 0.; 161 // return results_t(1, result); 170 // result += 0.; 162 171 // break; 163 172 // } 164 173 // case S: 165 174 // { 166 // const double result = 0.; 167 // return results_t(1, result); 175 // result += 0.; 168 176 // break; 169 177 // } … … 171 179 { 172 180 const double cutoff = function_cutoff(r_ij.distance); 173 const double result= (cutoff == 0.) ?181 result += (cutoff == 0.) ? 174 182 0. : 175 183 cutoff * … … 188 196 // params[mu], 189 197 // r_ij.distance); 190 return results_t(1, result);191 198 break; 192 199 } … … 194 201 { 195 202 const double cutoff = function_cutoff(r_ij.distance); 196 const double result= (cutoff == 0.) ?203 result += (cutoff == 0.) ? 197 204 0. : 198 205 cutoff * function_prefactor( … … 210 217 // params[mu], 211 218 // r_ij.distance)/params[B]; 212 return results_t(1, result);213 219 break; 214 220 } … … 216 222 { 217 223 const double cutoff = function_cutoff(r_ij.distance); 218 const double result= (cutoff == 0.) ?224 result += (cutoff == 0.) ? 219 225 0. : 220 226 -r_ij.distance * cutoff * … … 226 232 params[lambda], 227 233 r_ij.distance); 228 return results_t(1, result);229 234 break; 230 235 } … … 232 237 { 233 238 const double cutoff = function_cutoff(r_ij.distance); 234 const double result= (cutoff == 0.) ?239 result += (cutoff == 0.) ? 235 240 0. : 236 241 -r_ij.distance * cutoff *( … … 243 248 r_ij.distance) 244 249 ); 245 return results_t(1, result);246 250 break; 247 251 } 248 252 // case lambda3: 249 253 // { 250 // const double result = 0.; 251 // return results_t(1, result); 254 // result += 0.; 252 255 // break; 253 256 // } … … 257 260 // pow(alpha*function_eta(r_ij), params[n]); 258 261 // const double cutoff = function_cutoff(r_ij.distance); 259 // const double result= (cutoff == 0.) || (alpha == 0. )?262 // result += (cutoff == 0.) || (alpha == 0. )? 260 263 // 0. : 261 264 // function_smoother( … … 266 269 // / (1. + temp) 267 270 // ; 268 // return results_t(1, result);269 271 // break; 270 272 // } 271 273 // case chi: 272 274 // { 273 // const double result = 0.; 274 // return results_t(1, result); 275 // result += 0.; 275 276 // break; 276 277 // } 277 278 // case omega: 278 279 // { 279 // const double result = 0.; 280 // return results_t(1, result); 280 // result += 0.; 281 281 // break; 282 282 // } … … 286 286 pow(params[beta]*function_zeta(r_ij), params[n]); 287 287 const double cutoff = function_cutoff(r_ij.distance); 288 const double result= (cutoff == 0.) || (params[beta] == 0. )?288 result += (cutoff == 0.) || (params[beta] == 0. )? 289 289 0. : cutoff * 290 290 function_smoother( … … 299 299 / (1. + temp) 300 300 ; 301 return results_t(1, result);302 301 break; 303 302 } … … 307 306 pow(params[beta]*function_zeta(r_ij), params[n]); 308 307 const double cutoff = function_cutoff(r_ij.distance); 309 const double result= (cutoff == 0.) ?308 result += (cutoff == 0.) ? 310 309 0. : .5 * cutoff * 311 310 function_smoother( … … 320 319 /(params[n]*(1.+temp))) 321 320 ; 322 return results_t(1, result);323 321 break; 324 322 } … … 331 329 pow(zeta, params[n]-1.) * pow(params[beta],params[n]); 332 330 const double cutoff = function_cutoff(r_ij.distance); 333 const double result= (cutoff == 0.) ?331 const double tempres = (cutoff == 0.) ? 334 332 0. : cutoff * 335 333 function_smoother( … … 342 340 * (-1.) * temp / (1.+temp*zeta); 343 341 double factor = function_derivative_c(r_ij); 344 re turn results_t(1, result*factor);342 result += tempres*factor; 345 343 break; 346 344 } … … 351 349 pow(zeta, params[n]-1.) * pow(params[beta],params[n]); 352 350 const double cutoff = function_cutoff(r_ij.distance); 353 const double result= (cutoff == 0.) ?351 const double tempres = (cutoff == 0.) ? 354 352 0. : cutoff * 355 353 function_smoother( … … 362 360 * (-1.) * temp / (1.+temp*zeta); 363 361 double factor = function_derivative_d(r_ij); 364 re turn results_t(1, result*factor);362 result += tempres*factor; 365 363 break; 366 364 } … … 371 369 pow(zeta, params[n]-1.) * pow(params[beta],params[n]); 372 370 const double cutoff = function_cutoff(r_ij.distance); 373 const double result= (cutoff == 0.) ?371 const double tempres = (cutoff == 0.) ? 374 372 0. : cutoff * 375 373 function_smoother( … … 382 380 * (-1.) * temp / (1.+temp*zeta); 383 381 double factor = function_derivative_h(r_ij); 384 re turn results_t(1, result*factor);382 result += tempres*factor; 385 383 break; 386 384 } … … 388 386 break; 389 387 } 390 return results_t(1, 0.); 388 } 389 return results_t(1,-result); 391 390 } 392 391
Note:
See TracChangeset
for help on using the changeset viewer.