- 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:
- f904d5
- Parents:
- 990a62
- git-author:
- Frederik Heber <heber@…> (10/05/12 20:27:13)
- git-committer:
- Frederik Heber <heber@…> (12/19/12 15:25:54)
- Location:
- src/Potentials/Specifics
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
src/Potentials/Specifics/ManyBodyPotential_Tersoff.cpp
r990a62 r752dc7 51 51 ) : 52 52 params(parameters_t(MAXPARAMS, 0.)), 53 R(3.2), 54 S(3.5), 53 55 lambda3(0.), 54 56 alpha(0.), … … 76 78 boost::function< std::vector<arguments_t>(const argument_t &, const double)> &_triplefunction) : 77 79 params(parameters_t(MAXPARAMS, 0.)), 80 R(_R), 81 S(_S), 78 82 lambda3(_lambda3), 79 83 alpha(_alpha), … … 83 87 { 84 88 // Info info(__func__); 85 params[R]= _R;86 params[S]= _S;89 // R = _R; 90 // S = _S; 87 91 params[A] = _A; 88 92 params[B] = _B; … … 151 155 const argument_t &r_ij = arguments[0]; 152 156 switch (index) { 153 case R:154 {155 const double result = 0.;156 return results_t(1, result);157 break;158 }159 case S:160 {161 const double result = 0.;162 return results_t(1, result);163 break;164 }157 // case R: 158 // { 159 // const double result = 0.; 160 // return results_t(1, result); 161 // break; 162 // } 163 // case S: 164 // { 165 // const double result = 0.; 166 // return results_t(1, result); 167 // break; 168 // } 165 169 case A: 166 170 { … … 311 315 // Info info(__func__); 312 316 double result = 0.; 313 if (distance < params[R])317 if (distance < R) 314 318 result = 1.; 315 else if (distance > params[S])319 else if (distance > S) 316 320 result = 0.; 317 321 else { 318 result = (0.5 + 0.5 * cos( M_PI * (distance - params[R])/(params[S]-params[R])));322 result = (0.5 + 0.5 * cos( M_PI * (distance - R)/(S-R))); 319 323 } 320 324 // LOG(2, "DEBUG: function_cutoff(" << distance << ") = " << result); … … 358 362 359 363 // get all triples within the cutoff 360 std::vector<arguments_t> triples = triplefunction(r_ij, params[S]);364 std::vector<arguments_t> triples = triplefunction(r_ij, S); 361 365 for (std::vector<arguments_t>::const_iterator iter = triples.begin(); 362 366 iter != triples.end(); ++iter) { … … 381 385 382 386 // get all triples within the cutoff 383 std::vector<arguments_t> triples = triplefunction(r_ij, params[S]);387 std::vector<arguments_t> triples = triplefunction(r_ij, S); 384 388 for (std::vector<arguments_t>::const_iterator iter = triples.begin(); 385 389 iter != triples.end(); ++iter) { -
src/Potentials/Specifics/ManyBodyPotential_Tersoff.hpp
r990a62 r752dc7 180 180 private: 181 181 enum parameter_enum_t { 182 R=0,183 S=1,184 A=2,185 B=3,186 lambda=4,187 mu=5,188 beta=6,189 n=7,190 c=8,191 d=9,192 h=10,193 // lambda3 =11,194 // alpha =12,195 // chi =13,196 // omega =14,182 A, 183 B, 184 lambda, 185 mu, 186 beta, 187 n, 188 c, 189 d, 190 h, 191 // R, 192 // S, 193 // lambda3, 194 // alpha, 195 // chi, 196 // omega, 197 197 MAXPARAMS 198 198 }; … … 200 200 parameters_t params; 201 201 202 public: 202 203 // some internal parameters which are fixed 204 const double R; 205 const double S; 203 206 const double lambda3; 204 207 const double alpha; -
src/Potentials/Specifics/unittests/ManyBodyPotential_TersoffUnitTest.cpp
r990a62 r752dc7 128 128 // [Tersoff, '89] 129 129 params.resize(ManyBodyPotential_Tersoff::MAXPARAMS,0.); 130 params[ManyBodyPotential_Tersoff::R] = 1.800000e+00;131 params[ManyBodyPotential_Tersoff::S] = 2.100000e+00;130 // params[ManyBodyPotential_Tersoff::R] = 1.800000e+00; 131 // params[ManyBodyPotential_Tersoff::S] = 2.100000e+00; 132 132 params[ManyBodyPotential_Tersoff::A] = 1.393600e+03; 133 133 params[ManyBodyPotential_Tersoff::B] = 3.467000e+02; … … 289 289 ManyBodyPotential_Tersoff tersoff(fct); 290 290 tersoff.setParameters(params); 291 const_cast<double &>(tersoff.R) = 1.8; 292 const_cast<double &>(tersoff.S) = 2.1; 291 293 for (size_t index = 0; index < configurations.size(); ++index) { 292 294 CurrentConfiguration = &(configurations[index]); … … 307 309 // of the first and second position for the second configuration is easy to 308 310 // see as 1.119779. However, tremolo obtains 1.1197792 for unknown reasons. 309 // Maybe, there is some float floating around in the code ... 311 // Maybe, there is some float floating around in the code ... see strtod() bugs 312 // LOG(2, "Comparing " << output[index] << " and " << .5*temp); 310 313 CPPUNIT_ASSERT( 311 314 Helpers::isEqual(
Note:
See TracChangeset
for help on using the changeset viewer.