Changeset 1e242a
- Timestamp:
- Jul 8, 2013, 2:22:02 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:
- b15ae7
- Parents:
- 065a16
- git-author:
- Frederik Heber <heber@…> (05/09/13 13:46:01)
- git-committer:
- Frederik Heber <heber@…> (07/08/13 14:22:02)
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
src/Potentials/Specifics/PairPotential_Angle.cpp
r065a16 r1e242a 59 59 ("spring_constant") 60 60 ("equilibrium_distance") 61 ("") //energy_offset62 61 ; 63 62 const std::string PairPotential_Angle::potential_token("harmonic_angle"); … … 72 71 params[spring_constant] = 1.; 73 72 params[equilibrium_distance] = 0.1; 74 params[energy_offset] = 0.1;75 73 } 76 74 … … 78 76 const ParticleTypes_t &_ParticleTypes, 79 77 const double _spring_constant, 80 const double _equilibrium_distance, 81 const double _energy_offset) : 78 const double _equilibrium_distance) : 82 79 EmpiricalPotential(_ParticleTypes), 83 80 params(parameters_t(MAXPARAMS, 0.)) … … 85 82 params[spring_constant] = _spring_constant; 86 83 params[equilibrium_distance] = _equilibrium_distance; 87 params[energy_offset] = _energy_offset;88 84 } 89 85 … … 139 135 const result_t result = 140 136 params[spring_constant] 141 * Helpers::pow( function_theta(r_ij.distance, r_jk.distance, r_ik.distance) - params[equilibrium_distance], 2 ) 142 + params[energy_offset]; 137 * Helpers::pow( function_theta(r_ij.distance, r_jk.distance, r_ik.distance) - params[equilibrium_distance], 2 ); 143 138 return std::vector<result_t>(1, result); 144 139 } … … 194 189 break; 195 190 } 196 case energy_offset:197 {198 const result_t result = +1.;199 return std::vector<result_t>(1, result);200 break;201 }202 191 default: 203 return PairPotential_Angle::results_t(1, 0.);192 ASSERT(0, "PairPotential_Angle::parameter_derivative() - derivative to unknown parameter desired."); 204 193 break; 205 194 } … … 226 215 const TrainingData &data) 227 216 { 228 params[PairPotential_Angle::energy_offset] =229 data.getTrainingOutputAverage()[0];// -1.;230 217 params[PairPotential_Angle::spring_constant] = 1e+0*rand()/(double)RAND_MAX;// 0.2; 231 218 params[PairPotential_Angle::equilibrium_distance] = -0.3;//2e+0*rand()/(double)RAND_MAX - 1.;// 1.; -
src/Potentials/Specifics/PairPotential_Angle.hpp
r065a16 r1e242a 42 42 const ParticleTypes_t &_ParticleTypes, 43 43 const double _spring_constant, 44 const double _equilibrium_distance, 45 const double _energy_offset); 44 const double _equilibrium_distance); 46 45 virtual ~PairPotential_Angle() {} 47 46 … … 73 72 size_t getParameterDimension() const 74 73 { 75 return 3;74 return MAXPARAMS; 76 75 } 77 76 … … 157 156 spring_constant=0, 158 157 equilibrium_distance=1, 159 energy_offset=2,160 158 MAXPARAMS 161 159 }; -
src/Potentials/Specifics/unittests/PairPotential_AngleUnitTest.cpp
r065a16 r1e242a 61 61 62 62 const double spring_constant = .5; 63 const double offset = .1;64 63 65 64 void PairPotential_AngleTest::setUp() … … 81 80 } 82 81 output += 83 spring_constant*0.25 +offset,84 spring_constant*0.16 +offset,85 spring_constant*0.09 +offset,86 spring_constant*0.04 +offset,87 spring_constant*0.01 +offset,88 spring_constant*0. +offset,89 spring_constant*0.01 +offset,90 spring_constant*0.04 +offset,91 spring_constant*0.09 +offset,92 spring_constant*0.16 +offset,93 spring_constant*0.25 +offset;82 spring_constant*0.25, 83 spring_constant*0.16, 84 spring_constant*0.09, 85 spring_constant*0.04, 86 spring_constant*0.01, 87 spring_constant*0., 88 spring_constant*0.01, 89 spring_constant*0.04, 90 spring_constant*0.09, 91 spring_constant*0.16, 92 spring_constant*0.25; 94 93 95 94 CPPUNIT_ASSERT_EQUAL( input.size(), output.size() ); … … 109 108 (0)(1)(1) 110 109 ; 111 PairPotential_Angle angle(types, spring_constant,0. ,offset);110 PairPotential_Angle angle(types, spring_constant,0.); 112 111 for (size_t index = 0; index < input.size(); ++index) { 113 112 const PairPotential_Angle::results_t result = … … 130 129 (0)(1)(1) 131 130 ; 132 PairPotential_Angle angle(types, spring_constant,0. ,offset);131 PairPotential_Angle angle(types, spring_constant,0.); 133 132 CPPUNIT_ASSERT( 134 133 Helpers::isEqual( … … 151 150 (0)(1)(1) 152 151 ; 153 PairPotential_Angle angle(types, spring_constant,0. ,offset);152 PairPotential_Angle angle(types, spring_constant,0.); 154 153 CPPUNIT_ASSERT( 155 154 Helpers::isEqual( … … 172 171 ) 173 172 ); 174 CPPUNIT_ASSERT(175 Helpers::isEqual(176 1.,177 angle.parameter_derivative(178 input[5],179 2180 )[0],181 10.182 )183 );184 173 } -
tests/regression/Fragmentation/FitPotential/testsuite-fragmentation-fit-potential.at
r065a16 r1e242a 37 37 AT_SETUP([Fragmentation - Fit harmonic_angle potential to water]) 38 38 AT_KEYWORDS([fragmentation fit-potential harmonic_angle]) 39 AT_XFAIL_IF([/bin/true]) 39 40 AT_SKIP_IF([../../molecuilder --help --actionname fit-potential; if test $? -eq 5; then /bin/true; else /bin/false; fi]) 40 41
Note:
See TracChangeset
for help on using the changeset viewer.