Changeset d5ca1a for src/Potentials/Specifics
- 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)
- Location:
- src/Potentials/Specifics
- Files:
-
- 16 edited
Legend:
- Unmodified
- Added
- Removed
-
src/Potentials/Specifics/ConstantPotential.cpp
rc5e75f3 rd5ca1a 65 65 Coordinator::ptr ConstantPotential::coordinator(Memory::ignore(new OneBody_Constant())); 66 66 67 static HomologyGraph generateBindingModel(const EmpiricalPotential::ParticleTypes_t &_ParticleTypes) 68 { 69 // fill nodes 70 ASSERT( _ParticleTypes.size() <= (size_t)1, 71 "generateBindingModel() - ConstantPotential needs zero or one type."); 72 HomologyGraph::nodes_t nodes; 73 if (_ParticleTypes.size() == (size_t)1) 74 nodes.insert( std::make_pair(FragmentNode(_ParticleTypes.front(), 0), 1) ); 75 76 // there are no edges 77 HomologyGraph::edges_t edges; 78 79 return HomologyGraph(nodes, edges); 80 } 81 67 82 ConstantPotential::ConstantPotential() : 68 83 EmpiricalPotential(), 69 params(parameters_t(MAXPARAMS, 0.)) 84 params(parameters_t(MAXPARAMS, 0.)), 85 bindingmodel(HomologyGraph()) 70 86 { 71 87 // have some decent defaults for parameter_derivative checking … … 77 93 ) : 78 94 EmpiricalPotential(_ParticleTypes), 79 params(parameters_t(MAXPARAMS, 0.)) 95 params(parameters_t(MAXPARAMS, 0.)), 96 bindingmodel(generateBindingModel(_ParticleTypes)) 80 97 { 81 98 // have some decent defaults for parameter_derivative checking … … 87 104 const double _energy_offset) : 88 105 EmpiricalPotential(_ParticleTypes), 89 params(parameters_t(MAXPARAMS, 0.)) 106 params(parameters_t(MAXPARAMS, 0.)), 107 bindingmodel(generateBindingModel(_ParticleTypes)) 90 108 { 91 109 params[energy_offset] = _energy_offset; -
src/Potentials/Specifics/ConstantPotential.hpp
rc5e75f3 rd5ca1a 184 184 }; 185 185 186 /** Getter for the graph specifying the binding model of the potential. 187 * 188 * \return HomologyGraph of the binding model 189 */ 190 const HomologyGraph& getBindingModel() const 191 { return bindingmodel; } 192 186 193 private: 187 194 //!> parameter vector with parameters as in enum parameter_enum_t … … 196 203 //!> internal coordinator object for converting arguments_t 197 204 static Coordinator::ptr coordinator; 205 206 //!> binding model for this potential 207 const HomologyGraph bindingmodel; 198 208 }; 199 209 -
src/Potentials/Specifics/FourBodyPotential_Improper.cpp
rc5e75f3 rd5ca1a 35 35 #include "CodePatterns/MemDebug.hpp" 36 36 37 #include "CodePatterns/Assert.hpp" 38 37 39 #include "FourBodyPotential_Improper.hpp" 38 40 … … 51 53 Coordinator::ptr FourBodyPotential_Improper::coordinator(Memory::ignore(new FourBody_ImproperAngle())); 52 54 55 static HomologyGraph generateBindingModel(const EmpiricalPotential::ParticleTypes_t &_ParticleTypes) 56 { 57 // fill nodes 58 HomologyGraph::nodes_t nodes; 59 { 60 ASSERT( _ParticleTypes.size() == (size_t)4, 61 "generateBindingModel() - FourBodyPotential_Improper needs four types."); 62 std::pair<HomologyGraph::nodes_t::iterator, bool > inserter; 63 inserter = nodes.insert( std::make_pair(FragmentNode(_ParticleTypes[0], 3), 1) ); 64 if (!inserter.second) 65 ++(inserter.first->second); 66 inserter = nodes.insert( std::make_pair(FragmentNode(_ParticleTypes[1], 1), 1) ); 67 if (!inserter.second) 68 ++(inserter.first->second); 69 inserter = nodes.insert( std::make_pair(FragmentNode(_ParticleTypes[2], 1), 1) ); 70 if (!inserter.second) 71 ++(inserter.first->second); 72 inserter = nodes.insert( std::make_pair(FragmentNode(_ParticleTypes[3], 1), 1) ); 73 if (!inserter.second) 74 ++(inserter.first->second); 75 } 76 77 // there are no edges 78 HomologyGraph::edges_t edges; 79 { 80 std::pair<HomologyGraph::edges_t::iterator, bool > inserter; 81 inserter = edges.insert( std::make_pair( FragmentEdge(_ParticleTypes[0], _ParticleTypes[1]), 1) ); 82 if (!inserter.second) 83 ++(inserter.first->second); 84 inserter = edges.insert( std::make_pair( FragmentEdge(_ParticleTypes[0], _ParticleTypes[2]), 1) ); 85 if (!inserter.second) 86 ++(inserter.first->second); 87 inserter = edges.insert( std::make_pair( FragmentEdge(_ParticleTypes[0], _ParticleTypes[3]), 1) ); 88 if (!inserter.second) 89 ++(inserter.first->second); 90 } 91 92 return HomologyGraph(nodes, edges); 93 } 94 53 95 FourBodyPotential_Improper::FourBodyPotential_Improper() : 54 FourBodyPotential_Torsion() 96 FourBodyPotential_Torsion(), 97 bindingmodel(HomologyGraph()) 55 98 {} 56 99 57 100 FourBodyPotential_Improper::FourBodyPotential_Improper( 58 101 const ParticleTypes_t &_ParticleTypes) : 59 FourBodyPotential_Torsion(_ParticleTypes) 102 FourBodyPotential_Torsion(_ParticleTypes), 103 bindingmodel(generateBindingModel(_ParticleTypes)) 60 104 {} 61 105 … … 67 111 _ParticleTypes, 68 112 _spring_constant, 69 _equilibrium_distance) 113 _equilibrium_distance), 114 bindingmodel(generateBindingModel(_ParticleTypes)) 70 115 {} 71 116 -
src/Potentials/Specifics/FourBodyPotential_Improper.hpp
rc5e75f3 rd5ca1a 60 60 virtual ~FourBodyPotential_Improper() {} 61 61 62 /** Getter for the graph specifying the binding model of the potential. 63 * 64 * \return HomologyGraph of the binding model 65 */ 66 const HomologyGraph& getBindingModel() const 67 { return bindingmodel; } 68 62 69 private: 63 70 /** Function to obtain angle between planes from distances. … … 91 98 //!> internal coordinator object for converting arguments_t 92 99 static Coordinator::ptr coordinator; 100 101 //!> binding model for this potential 102 const HomologyGraph bindingmodel; 93 103 }; 94 104 -
src/Potentials/Specifics/FourBodyPotential_Torsion.cpp
rc5e75f3 rd5ca1a 66 66 Coordinator::ptr FourBodyPotential_Torsion::coordinator(Memory::ignore(new FourBody_TorsionAngle())); 67 67 68 static HomologyGraph generateBindingModel(const EmpiricalPotential::ParticleTypes_t &_ParticleTypes) 69 { 70 // fill nodes 71 HomologyGraph::nodes_t nodes; 72 { 73 ASSERT( _ParticleTypes.size() == (size_t)4, 74 "generateBindingModel() - FourBodyPotential_Torsion needs four types."); 75 std::pair<HomologyGraph::nodes_t::iterator, bool > inserter; 76 inserter = nodes.insert( std::make_pair(FragmentNode(_ParticleTypes[0], 1), 1) ); 77 if (!inserter.second) 78 ++(inserter.first->second); 79 inserter = nodes.insert( std::make_pair(FragmentNode(_ParticleTypes[1], 2), 1) ); 80 if (!inserter.second) 81 ++(inserter.first->second); 82 inserter = nodes.insert( std::make_pair(FragmentNode(_ParticleTypes[2], 2), 1) ); 83 if (!inserter.second) 84 ++(inserter.first->second); 85 inserter = nodes.insert( std::make_pair(FragmentNode(_ParticleTypes[3], 1), 1) ); 86 if (!inserter.second) 87 ++(inserter.first->second); 88 } 89 90 // there are no edges 91 HomologyGraph::edges_t edges; 92 { 93 std::pair<HomologyGraph::edges_t::iterator, bool > inserter; 94 inserter = edges.insert( std::make_pair( FragmentEdge(_ParticleTypes[0], _ParticleTypes[1]), 1) ); 95 if (!inserter.second) 96 ++(inserter.first->second); 97 inserter = edges.insert( std::make_pair( FragmentEdge(_ParticleTypes[1], _ParticleTypes[2]), 1) ); 98 if (!inserter.second) 99 ++(inserter.first->second); 100 inserter = edges.insert( std::make_pair( FragmentEdge(_ParticleTypes[2], _ParticleTypes[3]), 1) ); 101 if (!inserter.second) 102 ++(inserter.first->second); 103 } 104 105 return HomologyGraph(nodes, edges); 106 } 107 68 108 FourBodyPotential_Torsion::FourBodyPotential_Torsion() : 69 109 EmpiricalPotential(), 70 params(parameters_t(MAXPARAMS, 0.)) 110 params(parameters_t(MAXPARAMS, 0.)), 111 bindingmodel(HomologyGraph()) 71 112 { 72 113 // have some decent defaults for parameter_derivative checking … … 79 120 ) : 80 121 EmpiricalPotential(_ParticleTypes), 81 params(parameters_t(MAXPARAMS, 0.)) 122 params(parameters_t(MAXPARAMS, 0.)), 123 bindingmodel(generateBindingModel(_ParticleTypes)) 82 124 { 83 125 // have some decent defaults for parameter_derivative checking … … 91 133 const double _equilibrium_distance) : 92 134 EmpiricalPotential(_ParticleTypes), 93 params(parameters_t(MAXPARAMS, 0.)) 135 params(parameters_t(MAXPARAMS, 0.)), 136 bindingmodel(generateBindingModel(_ParticleTypes)) 94 137 { 95 138 params[spring_constant] = _spring_constant; -
src/Potentials/Specifics/FourBodyPotential_Torsion.hpp
rc5e75f3 rd5ca1a 191 191 }; 192 192 193 /** Getter for the graph specifying the binding model of the potential. 194 * 195 * \return HomologyGraph of the binding model 196 */ 197 const HomologyGraph& getBindingModel() const 198 { return bindingmodel; } 199 193 200 protected: 194 201 virtual result_t function_theta( … … 212 219 //!> internal coordinator object for converting arguments_t 213 220 static Coordinator::ptr coordinator; 221 222 //!> binding model for this potential 223 const HomologyGraph bindingmodel; 214 224 }; 215 225 -
src/Potentials/Specifics/ManyBodyPotential_Tersoff.cpp
rc5e75f3 rd5ca1a 82 82 Coordinator::ptr ManyBodyPotential_Tersoff::coordinator(Memory::ignore(new OneBody_Constant())); 83 83 84 static HomologyGraph generateBindingModel(const EmpiricalPotential::ParticleTypes_t &_ParticleTypes) 85 { 86 // fill nodes 87 HomologyGraph::nodes_t nodes; 88 { 89 ASSERT( _ParticleTypes.size() == (size_t)2, 90 "generateBindingModel() - ManyBodyPotential_Tersoff needs two types."); 91 std::pair<HomologyGraph::nodes_t::iterator, bool > inserter; 92 inserter = nodes.insert( std::make_pair(FragmentNode(_ParticleTypes[0], 1), 1) ); 93 if (!inserter.second) 94 ++(inserter.first->second); 95 inserter = nodes.insert( std::make_pair(FragmentNode(_ParticleTypes[1], 1), 1) ); 96 if (!inserter.second) 97 ++(inserter.first->second); 98 } 99 100 // there are no edges 101 HomologyGraph::edges_t edges; 102 { 103 edges.insert( std::make_pair( FragmentEdge(_ParticleTypes[0], _ParticleTypes[1]), 1) ); 104 } 105 106 return HomologyGraph(nodes, edges); 107 } 108 84 109 ManyBodyPotential_Tersoff::ManyBodyPotential_Tersoff() : 85 110 EmpiricalPotential(), … … 91 116 chi(1.), 92 117 omega(1.), 93 triplefunction(&Helpers::NoOp_Triplefunction) 118 triplefunction(&Helpers::NoOp_Triplefunction), 119 bindingmodel(HomologyGraph()) 94 120 {} 95 121 … … 105 131 chi(1.), 106 132 omega(1.), 107 triplefunction(&Helpers::NoOp_Triplefunction) 133 triplefunction(&Helpers::NoOp_Triplefunction), 134 bindingmodel(generateBindingModel(_ParticleTypes)) 108 135 { 109 136 // have some decent defaults for parameter_derivative checking … … 144 171 chi(_chi), 145 172 omega(_mu), 146 triplefunction(&Helpers::NoOp_Triplefunction) 173 triplefunction(&Helpers::NoOp_Triplefunction), 174 bindingmodel(generateBindingModel(_ParticleTypes)) 147 175 { 148 176 // Info info(__func__); -
src/Potentials/Specifics/ManyBodyPotential_Tersoff.hpp
rc5e75f3 rd5ca1a 213 213 { triplefunction = _triplefunction; } 214 214 215 /** Getter for the graph specifying the binding model of the potential. 216 * 217 * \return HomologyGraph of the binding model 218 */ 219 const HomologyGraph& getBindingModel() const 220 { return bindingmodel; } 221 215 222 private: 216 223 /** This function represents the cutoff \f$ f_C \f$. … … 363 370 //!> internal coordinator object for converting arguments_t 364 371 static Coordinator::ptr coordinator; 372 373 //!> binding model for this potential 374 const HomologyGraph bindingmodel; 365 375 }; 366 376 -
src/Potentials/Specifics/PairPotential_Harmonic.cpp
rc5e75f3 rd5ca1a 67 67 Coordinator::ptr PairPotential_Harmonic::coordinator(Memory::ignore(new TwoBody_Length())); 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)2, 75 "generateBindingModel() - PairPotential_Harmonic needs two 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], 1), 1) ); 81 if (!inserter.second) 82 ++(inserter.first->second); 83 } 84 85 // there are no edges 86 HomologyGraph::edges_t edges; 87 { 88 edges.insert( std::make_pair( FragmentEdge(_ParticleTypes[0], _ParticleTypes[1]), 1) ); 89 } 90 91 return HomologyGraph(nodes, edges); 92 } 93 69 94 PairPotential_Harmonic::PairPotential_Harmonic() : 70 95 EmpiricalPotential(), 71 params(parameters_t(MAXPARAMS, 0.)) 96 params(parameters_t(MAXPARAMS, 0.)), 97 bindingmodel(HomologyGraph()) 72 98 { 73 99 // have some decent defaults for parameter_derivative checking … … 79 105 const ParticleTypes_t &_ParticleTypes) : 80 106 EmpiricalPotential(_ParticleTypes), 81 params(parameters_t(MAXPARAMS, 0.)) 107 params(parameters_t(MAXPARAMS, 0.)), 108 bindingmodel(generateBindingModel(_ParticleTypes)) 82 109 { 83 110 // have some decent defaults for parameter_derivative checking … … 91 118 const double _equilibrium_distance) : 92 119 EmpiricalPotential(_ParticleTypes), 93 params(parameters_t(MAXPARAMS, 0.)) 120 params(parameters_t(MAXPARAMS, 0.)), 121 bindingmodel(generateBindingModel(_ParticleTypes)) 94 122 { 95 123 params[spring_constant] = _spring_constant; -
src/Potentials/Specifics/PairPotential_Harmonic.hpp
rc5e75f3 rd5ca1a 185 185 MAXPARAMS 186 186 }; 187 188 /** Getter for the graph specifying the binding model of the potential. 189 * 190 * \return HomologyGraph of the binding model 191 */ 192 const HomologyGraph& getBindingModel() const 193 { return bindingmodel; } 194 187 195 private: 188 196 //!> parameter vector with parameters as in enum parameter_enum_t … … 197 205 //!> internal coordinator object for converting arguments_t 198 206 static Coordinator::ptr coordinator; 207 208 //!> binding model for this potential 209 const HomologyGraph bindingmodel; 199 210 }; 200 211 -
src/Potentials/Specifics/PairPotential_LennardJones.cpp
rc5e75f3 rd5ca1a 67 67 Coordinator::ptr PairPotential_LennardJones::coordinator(Memory::ignore(new TwoBody_Length())); 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)2, 75 "generateBindingModel() - PairPotential_LennardJones needs two 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], 1), 1) ); 81 if (!inserter.second) 82 ++(inserter.first->second); 83 } 84 85 // there are no edges 86 HomologyGraph::edges_t edges; 87 88 return HomologyGraph(nodes, edges); 89 } 90 69 91 void PairPotential_LennardJones::setDefaultParameters() 70 92 { … … 75 97 PairPotential_LennardJones::PairPotential_LennardJones() : 76 98 EmpiricalPotential(), 77 params(parameters_t(MAXPARAMS, 0.)) 99 params(parameters_t(MAXPARAMS, 0.)), 100 bindingmodel(HomologyGraph()) 78 101 { 79 102 // have some decent defaults for parameter_derivative checking … … 85 108 ) : 86 109 EmpiricalPotential(_ParticleTypes), 87 params(parameters_t(MAXPARAMS, 0.)) 110 params(parameters_t(MAXPARAMS, 0.)), 111 bindingmodel(generateBindingModel(_ParticleTypes)) 88 112 { 89 113 // have some decent defaults for parameter_derivative checking … … 97 121 ) : 98 122 EmpiricalPotential(_ParticleTypes), 99 params(parameters_t(MAXPARAMS, 0.)) 123 params(parameters_t(MAXPARAMS, 0.)), 124 bindingmodel(generateBindingModel(_ParticleTypes)) 100 125 { 101 126 params[epsilon] = _epsilon; -
src/Potentials/Specifics/PairPotential_LennardJones.hpp
rc5e75f3 rd5ca1a 187 187 }; 188 188 189 /** Getter for the graph specifying the binding model of the potential. 190 * 191 * \return HomologyGraph of the binding model 192 */ 193 const HomologyGraph& getBindingModel() const 194 { return bindingmodel; } 195 189 196 private: 190 197 /** Sets some sensible default parameter values. … … 205 212 //!> internal coordinator object for converting arguments_t 206 213 static Coordinator::ptr coordinator; 214 215 //!> binding model for this potential 216 const HomologyGraph bindingmodel; 207 217 }; 208 218 -
src/Potentials/Specifics/PairPotential_Morse.cpp
rc5e75f3 rd5ca1a 69 69 Coordinator::ptr PairPotential_Morse::coordinator(Memory::ignore(new TwoBody_Length())); 70 70 71 static HomologyGraph generateBindingModel(const EmpiricalPotential::ParticleTypes_t &_ParticleTypes) 72 { 73 // fill nodes 74 HomologyGraph::nodes_t nodes; 75 { 76 ASSERT( _ParticleTypes.size() == (size_t)2, 77 "generateBindingModel() - PairPotential_Morse needs two types."); 78 std::pair<HomologyGraph::nodes_t::iterator, bool > inserter; 79 inserter = nodes.insert( std::make_pair(FragmentNode(_ParticleTypes[0], 1), 1) ); 80 if (!inserter.second) 81 ++(inserter.first->second); 82 inserter = nodes.insert( std::make_pair(FragmentNode(_ParticleTypes[1], 1), 1) ); 83 if (!inserter.second) 84 ++(inserter.first->second); 85 } 86 87 // there are no edges 88 HomologyGraph::edges_t edges; 89 { 90 edges.insert( std::make_pair( FragmentEdge(_ParticleTypes[0], _ParticleTypes[1]), 1) ); 91 } 92 93 return HomologyGraph(nodes, edges); 94 } 95 71 96 PairPotential_Morse::PairPotential_Morse() : 72 97 EmpiricalPotential(), 73 params(parameters_t(MAXPARAMS, 0.)) 98 params(parameters_t(MAXPARAMS, 0.)), 99 bindingmodel(HomologyGraph()) 74 100 { 75 101 // have some decent defaults for parameter_derivative checking … … 83 109 ) : 84 110 EmpiricalPotential(_ParticleTypes), 85 params(parameters_t(MAXPARAMS, 0.)) 111 params(parameters_t(MAXPARAMS, 0.)), 112 bindingmodel(generateBindingModel(_ParticleTypes)) 86 113 { 87 114 // have some decent defaults for parameter_derivative checking … … 97 124 const double _dissociation_energy) : 98 125 EmpiricalPotential(_ParticleTypes), 99 params(parameters_t(MAXPARAMS, 0.)) 126 params(parameters_t(MAXPARAMS, 0.)), 127 bindingmodel(generateBindingModel(_ParticleTypes)) 100 128 { 101 129 params[spring_constant] = _spring_constant; -
src/Potentials/Specifics/PairPotential_Morse.hpp
rc5e75f3 rd5ca1a 188 188 }; 189 189 190 /** Getter for the graph specifying the binding model of the potential. 191 * 192 * \return HomologyGraph of the binding model 193 */ 194 const HomologyGraph& getBindingModel() const 195 { return bindingmodel; } 196 190 197 private: 191 198 //!> parameter vector with parameters as in enum parameter_enum_t … … 200 207 //!> internal coordinator object for converting arguments_t 201 208 static Coordinator::ptr coordinator; 209 210 //!> binding model for this potential 211 const HomologyGraph bindingmodel; 202 212 }; 203 213 -
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; -
src/Potentials/Specifics/ThreeBodyPotential_Angle.hpp
rc5e75f3 rd5ca1a 188 188 }; 189 189 190 /** Getter for the graph specifying the binding model of the potential. 191 * 192 * \return HomologyGraph of the binding model 193 */ 194 const HomologyGraph& getBindingModel() const 195 { return bindingmodel; } 196 190 197 private: 191 198 result_t … … 207 214 //!> internal coordinator object for converting arguments_t 208 215 static Coordinator::ptr coordinator; 216 217 //!> binding model for this potential 218 const HomologyGraph bindingmodel; 209 219 }; 210 220
Note:
See TracChangeset
for help on using the changeset viewer.