Changeset bbc422


Ignore:
Timestamp:
Jul 8, 2013, 2:22:00 PM (11 years ago)
Author:
Frederik Heber <heber@…>
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)
Message:

FIX: Renamed arguments in PairPotential_Angle to make proper sense.

  • this does/should not change functionality in any way.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/Potentials/Specifics/PairPotential_Angle.cpp

    re352cb rbbc422  
    109109PairPotential_Angle::function_theta(
    110110    const double &r_ij,
    111     const double &r_ik,
    112     const double &r_jk
     111    const double &r_jk,
     112    const double &r_ik
    113113  ) const
    114114{
    115115//  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;
    118118
    119119//  LOG(2, "DEBUG: cos(theta)= " << angle/divisor);
     
    131131  ASSERT( arguments.size() == 3,
    132132      "PairPotential_Angle::operator() - requires exactly three arguments.");
    133   ASSERT( ParticleTypeChecker::checkArgumentsAgainstParticleTypesStrictOrdering(
     133  ASSERT( ParticleTypeChecker::checkArgumentsAgainstParticleTypes(
    134134      arguments, getParticleTypes()),
    135135      "PairPotential_Angle::operator() - types don't match with ones in arguments.");
    136136  const argument_t &r_ij = arguments[0]; // 01
    137   const argument_t &r_ik = arguments[2]; // 12
    138   const argument_t &r_jk = arguments[1]; // 02
     137  const argument_t &r_jk = arguments[2]; // 12
     138  const argument_t &r_ik = arguments[1]; // 02
    139139  const result_t result =
    140140      params[spring_constant]
    141              * Helpers::pow( function_theta(r_ij.distance, r_ik.distance, r_jk.distance) - params[equilibrium_distance], 2 )
    142             + params[energy_offset];
     141             * Helpers::pow( function_theta(r_ij.distance, r_jk.distance, r_ik.distance) - params[equilibrium_distance], 2 )
     142      + params[energy_offset];
    143143  return std::vector<result_t>(1, result);
    144144}
     
    151151  ASSERT( arguments.size() == 3,
    152152      "PairPotential_Angle::operator() - requires exactly three arguments.");
    153   ASSERT( ParticleTypeChecker::checkArgumentsAgainstParticleTypesStrictOrdering(
     153  ASSERT( ParticleTypeChecker::checkArgumentsAgainstParticleTypes(
    154154      arguments, getParticleTypes()),
    155155      "PairPotential_Angle::operator() - types don't match with ones in arguments.");
    156156  derivative_components_t result;
    157157  const argument_t &r_ij = arguments[0]; //01
    158   const argument_t &r_ik = arguments[2]; //12
    159   const argument_t &r_jk = arguments[1]; //02
    160   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]) );
    161161  ASSERT( result.size() == 1,
    162162      "PairPotential_Angle::operator() - we did not create exactly one component.");
     
    172172  ASSERT( arguments.size() == 3,
    173173      "PairPotential_Angle::parameter_derivative() - requires exactly three arguments.");
    174   ASSERT( ParticleTypeChecker::checkArgumentsAgainstParticleTypesStrictOrdering(
     174  ASSERT( ParticleTypeChecker::checkArgumentsAgainstParticleTypes(
    175175      arguments, getParticleTypes()),
    176176      "PairPotential_Angle::operator() - types don't match with ones in arguments.");
    177177  const argument_t &r_ij = arguments[0]; //01
    178   const argument_t &r_ik = arguments[2]; //12
    179   const argument_t &r_jk = arguments[1]; //02
     178  const argument_t &r_jk = arguments[2]; //12
     179  const argument_t &r_ik = arguments[1]; //02
    180180  switch (index) {
    181181    case spring_constant:
    182182    {
    183183      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 );
    185185      return std::vector<result_t>(1, result);
    186186      break;
     
    190190      const result_t result =
    191191          -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]);
    193193      return std::vector<result_t>(1, result);
    194194      break;
Note: See TracChangeset for help on using the changeset viewer.