Changeset bbc422
- Timestamp:
- Jul 8, 2013, 2:22:00 PM (11 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:
- 5f0c60
- Parents:
- e352cb
- git-author:
- Frederik Heber <heber@…> (06/25/13 09:30:44)
- git-committer:
- Frederik Heber <heber@…> (07/08/13 14:22:00)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
src/Potentials/Specifics/PairPotential_Angle.cpp
re352cb rbbc422 109 109 PairPotential_Angle::function_theta( 110 110 const double &r_ij, 111 const double &r_ ik,112 const double &r_ jk111 const double &r_jk, 112 const double &r_ik 113 113 ) const 114 114 { 115 115 // Info info(__func__); 116 const double angle = Helpers::pow(r_ij,2) + Helpers::pow(r_ ik,2) - Helpers::pow(r_jk,2);117 const double divisor = 2.* r_ij * r_ ik;116 const double angle = Helpers::pow(r_ij,2) + Helpers::pow(r_jk,2) - Helpers::pow(r_ik,2); 117 const double divisor = 2.* r_ij * r_jk; 118 118 119 119 // LOG(2, "DEBUG: cos(theta)= " << angle/divisor); … … 131 131 ASSERT( arguments.size() == 3, 132 132 "PairPotential_Angle::operator() - requires exactly three arguments."); 133 ASSERT( ParticleTypeChecker::checkArgumentsAgainstParticleTypes StrictOrdering(133 ASSERT( ParticleTypeChecker::checkArgumentsAgainstParticleTypes( 134 134 arguments, getParticleTypes()), 135 135 "PairPotential_Angle::operator() - types don't match with ones in arguments."); 136 136 const argument_t &r_ij = arguments[0]; // 01 137 const argument_t &r_ ik = arguments[2]; // 12138 const argument_t &r_ jk = arguments[1]; // 02137 const argument_t &r_jk = arguments[2]; // 12 138 const argument_t &r_ik = arguments[1]; // 02 139 139 const result_t result = 140 140 params[spring_constant] 141 * Helpers::pow( function_theta(r_ij.distance, r_ ik.distance, r_jk.distance) - params[equilibrium_distance], 2 )142 141 * Helpers::pow( function_theta(r_ij.distance, r_jk.distance, r_ik.distance) - params[equilibrium_distance], 2 ) 142 + params[energy_offset]; 143 143 return std::vector<result_t>(1, result); 144 144 } … … 151 151 ASSERT( arguments.size() == 3, 152 152 "PairPotential_Angle::operator() - requires exactly three arguments."); 153 ASSERT( ParticleTypeChecker::checkArgumentsAgainstParticleTypes StrictOrdering(153 ASSERT( ParticleTypeChecker::checkArgumentsAgainstParticleTypes( 154 154 arguments, getParticleTypes()), 155 155 "PairPotential_Angle::operator() - types don't match with ones in arguments."); 156 156 derivative_components_t result; 157 157 const argument_t &r_ij = arguments[0]; //01 158 const argument_t &r_ ik = arguments[2]; //12159 const argument_t &r_ jk = arguments[1]; //02160 result.push_back( 2. * params[spring_constant] * ( function_theta(r_ij.distance, r_ ik.distance, r_jk.distance) - params[equilibrium_distance]) );158 const argument_t &r_jk = arguments[2]; //12 159 const argument_t &r_ik = arguments[1]; //02 160 result.push_back( 2. * params[spring_constant] * ( function_theta(r_ij.distance, r_jk.distance, r_ik.distance) - params[equilibrium_distance]) ); 161 161 ASSERT( result.size() == 1, 162 162 "PairPotential_Angle::operator() - we did not create exactly one component."); … … 172 172 ASSERT( arguments.size() == 3, 173 173 "PairPotential_Angle::parameter_derivative() - requires exactly three arguments."); 174 ASSERT( ParticleTypeChecker::checkArgumentsAgainstParticleTypes StrictOrdering(174 ASSERT( ParticleTypeChecker::checkArgumentsAgainstParticleTypes( 175 175 arguments, getParticleTypes()), 176 176 "PairPotential_Angle::operator() - types don't match with ones in arguments."); 177 177 const argument_t &r_ij = arguments[0]; //01 178 const argument_t &r_ ik = arguments[2]; //12179 const argument_t &r_ jk = arguments[1]; //02178 const argument_t &r_jk = arguments[2]; //12 179 const argument_t &r_ik = arguments[1]; //02 180 180 switch (index) { 181 181 case spring_constant: 182 182 { 183 183 const result_t result = 184 Helpers::pow( function_theta(r_ij.distance, r_ ik.distance, r_jk.distance) - params[equilibrium_distance], 2 );184 Helpers::pow( function_theta(r_ij.distance, r_jk.distance, r_ik.distance) - params[equilibrium_distance], 2 ); 185 185 return std::vector<result_t>(1, result); 186 186 break; … … 190 190 const result_t result = 191 191 -2. * params[spring_constant] 192 * ( function_theta(r_ij.distance, r_ ik.distance, r_jk.distance) - params[equilibrium_distance]);192 * ( function_theta(r_ij.distance, r_jk.distance, r_ik.distance) - params[equilibrium_distance]); 193 193 return std::vector<result_t>(1, result); 194 194 break;
Note:
See TracChangeset
for help on using the changeset viewer.