Ignore:
Timestamp:
Nov 4, 2016, 9:37:50 AM (8 years ago)
Author:
Frederik Heber <heber@…>
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)
Message:

Added HomologyGraph describing binding model to every EmpiricalPotential.

File:
1 edited

Legend:

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

    rc5e75f3 rd5ca1a  
    6666Coordinator::ptr FourBodyPotential_Torsion::coordinator(Memory::ignore(new FourBody_TorsionAngle()));
    6767
     68static 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
    68108FourBodyPotential_Torsion::FourBodyPotential_Torsion() :
    69109  EmpiricalPotential(),
    70   params(parameters_t(MAXPARAMS, 0.))
     110  params(parameters_t(MAXPARAMS, 0.)),
     111  bindingmodel(HomologyGraph())
    71112{
    72113  // have some decent defaults for parameter_derivative checking
     
    79120    ) :
    80121  EmpiricalPotential(_ParticleTypes),
    81   params(parameters_t(MAXPARAMS, 0.))
     122  params(parameters_t(MAXPARAMS, 0.)),
     123  bindingmodel(generateBindingModel(_ParticleTypes))
    82124{
    83125  // have some decent defaults for parameter_derivative checking
     
    91133    const double _equilibrium_distance) :
    92134  EmpiricalPotential(_ParticleTypes),
    93   params(parameters_t(MAXPARAMS, 0.))
     135  params(parameters_t(MAXPARAMS, 0.)),
     136  bindingmodel(generateBindingModel(_ParticleTypes))
    94137{
    95138  params[spring_constant] = _spring_constant;
Note: See TracChangeset for help on using the changeset viewer.