Changeset d5ca1a for src/Potentials/Specifics/ThreeBodyPotential_Angle.cpp
- Timestamp:
- Nov 4, 2016, 9:37:50 AM (8 years ago)
- Branches:
- Action_Thermostats, Add_AtomRandomPerturbation, Add_RotateAroundBondAction, Add_SelectAtomByNameAction, Adding_Graph_to_ChangeBondActions, Adding_MD_integration_tests, Adding_StructOpt_integration_tests, Automaking_mpqc_open, AutomationFragmentation_failures, Candidate_v1.6.0, Candidate_v1.6.1, ChangeBugEmailaddress, ChangingTestPorts, ChemicalSpaceEvaluator, 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_ChronosMutex, Fix_StatusMsg, Fix_StepWorldTime_single_argument, Fix_Verbose_Codepatterns, ForceAnnealing_goodresults, ForceAnnealing_oldresults, ForceAnnealing_tocheck, ForceAnnealing_with_BondGraph, ForceAnnealing_with_BondGraph_continued, ForceAnnealing_with_BondGraph_continued_betteresults, ForceAnnealing_with_BondGraph_contraction-expansion, GeometryObjects, Gui_displays_atomic_force_velocity, IndependentFragmentGrids_IntegrationTest, JobMarket_RobustOnKillsSegFaults, JobMarket_StableWorkerPool, JobMarket_unresolvable_hostname_fix, ODR_violation_mpqc_open, PartialCharges_OrthogonalSummation, PythonUI_with_named_parameters, QtGui_reactivate_TimeChanged_changes, Recreated_GuiChecks, RotateToPrincipalAxisSystem_UndoRedo, StoppableMakroAction, Subpackage_CodePatterns, Subpackage_JobMarket, Subpackage_LinearAlgebra, Subpackage_levmar, Subpackage_mpqc_open, Subpackage_vmg, ThirdParty_MPQC_rebuilt_buildsystem, TremoloParser_IncreasedPrecision, TremoloParser_MultipleTimesteps, Ubuntu_1604_changes, stable
- Children:
- 67044a
- Parents:
- c5e75f3
- git-author:
- Frederik Heber <heber@…> (10/03/16 18:26:30)
- git-committer:
- Frederik Heber <heber@…> (11/04/16 09:37:50)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
src/Potentials/Specifics/ThreeBodyPotential_Angle.cpp
rc5e75f3 rd5ca1a 67 67 Coordinator::ptr ThreeBodyPotential_Angle::coordinator(Memory::ignore(new ThreeBody_Angle())); 68 68 69 static HomologyGraph generateBindingModel(const EmpiricalPotential::ParticleTypes_t &_ParticleTypes) 70 { 71 // fill nodes 72 HomologyGraph::nodes_t nodes; 73 { 74 ASSERT( _ParticleTypes.size() == (size_t)3, 75 "generateBindingModel() - ThreeBodyPotential_Angle needs three types."); 76 std::pair<HomologyGraph::nodes_t::iterator, bool > inserter; 77 inserter = nodes.insert( std::make_pair(FragmentNode(_ParticleTypes[0], 1), 1) ); 78 if (!inserter.second) 79 ++(inserter.first->second); 80 inserter = nodes.insert( std::make_pair(FragmentNode(_ParticleTypes[1], 2), 1) ); 81 if (!inserter.second) 82 ++(inserter.first->second); 83 inserter = nodes.insert( std::make_pair(FragmentNode(_ParticleTypes[2], 1), 1) ); 84 if (!inserter.second) 85 ++(inserter.first->second); 86 } 87 88 // there are no edges 89 HomologyGraph::edges_t edges; 90 { 91 std::pair<HomologyGraph::edges_t::iterator, bool > inserter; 92 inserter = edges.insert( std::make_pair( FragmentEdge(_ParticleTypes[0], _ParticleTypes[1]), 1) ); 93 if (!inserter.second) 94 ++(inserter.first->second); 95 inserter = edges.insert( std::make_pair( FragmentEdge(_ParticleTypes[1], _ParticleTypes[2]), 1) ); 96 if (!inserter.second) 97 ++(inserter.first->second); 98 } 99 100 return HomologyGraph(nodes, edges); 101 } 102 69 103 ThreeBodyPotential_Angle::ThreeBodyPotential_Angle() : 70 104 EmpiricalPotential(), 71 params(parameters_t(MAXPARAMS, 0.)) 105 params(parameters_t(MAXPARAMS, 0.)), 106 bindingmodel(HomologyGraph()) 72 107 { 73 108 // have some decent defaults for parameter_derivative checking … … 80 115 ) : 81 116 EmpiricalPotential(_ParticleTypes), 82 params(parameters_t(MAXPARAMS, 0.)) 117 params(parameters_t(MAXPARAMS, 0.)), 118 bindingmodel(generateBindingModel(_ParticleTypes)) 83 119 { 84 120 // have some decent defaults for parameter_derivative checking … … 92 128 const double _equilibrium_distance) : 93 129 EmpiricalPotential(_ParticleTypes), 94 params(parameters_t(MAXPARAMS, 0.)) 130 params(parameters_t(MAXPARAMS, 0.)), 131 bindingmodel(generateBindingModel(_ParticleTypes)) 95 132 { 96 133 params[spring_constant] = _spring_constant;
Note:
See TracChangeset
for help on using the changeset viewer.