Changeset 9c793c for src/Potentials


Ignore:
Timestamp:
Nov 11, 2016, 2:25:36 PM (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:
f5dbea
Parents:
bc069f
git-author:
Frederik Heber <heber@…> (10/05/16 21:33:40)
git-committer:
Frederik Heber <heber@…> (11/11/16 14:25:36)
Message:

All ..Potentials now return BindingModel instead of HomologyGraph, Extractors::reorderArg..() uses it.

  • Extractors::filterArg..() and ::reorderArg..() expect BindingModel instead of HomologyGraph.
  • TESTFIX: Lennard Jones potential fitting regression test no longer fails because it is purely non-bonded.
Location:
src/Potentials
Files:
17 edited

Legend:

Unmodified
Added
Removed
  • src/Potentials/EmpiricalPotential.hpp

    rbc069f r9c793c  
    1717#include <vector>
    1818
    19 #include "Fragmentation/Homology/HomologyGraph.hpp"
    2019#include "FunctionApproximation/FunctionArgument.hpp"
    2120#include "FunctionApproximation/FunctionModel.hpp"
     21#include "Potentials/BindingModel.hpp"
    2222#include "Potentials/SerializablePotential.hpp"
    2323#include "Potentials/InternalCoordinates/Coordinator.hpp"
     
    8484  /** Getter for the graph specifying the binding model of the potential.
    8585   *
    86    * \return HomologyGraph of the binding model
     86   * \return BindingModel ref of the binding model
    8787   */
    88   virtual const HomologyGraph& getBindingModel() const=0;
     88  virtual const BindingModel& getBindingModel() const=0;
    8989
    9090protected:
  • src/Potentials/Specifics/ConstantPotential.cpp

    rbc069f r9c793c  
    6565Coordinator::ptr ConstantPotential::coordinator(Memory::ignore(new OneBody_Constant()));
    6666
    67 static HomologyGraph generateBindingModel(const EmpiricalPotential::ParticleTypes_t &_ParticleTypes)
     67static BindingModel generateBindingModel(const EmpiricalPotential::ParticleTypes_t &_ParticleTypes)
    6868{
    6969  // fill nodes
    7070  ASSERT( _ParticleTypes.size() <= (size_t)1,
    7171      "generateBindingModel() - ConstantPotential needs zero or one type.");
    72   HomologyGraph::nodes_t nodes;
     72  BindingModel::vector_nodes_t nodes;
    7373  if (_ParticleTypes.size() == (size_t)1)
    74     nodes.insert( std::make_pair(FragmentNode(_ParticleTypes.front(), 0), 1) );
     74    nodes.push_back( FragmentNode(_ParticleTypes.front(), 0) );
    7575
    7676  // there are no edges
    7777  HomologyGraph::edges_t edges;
    7878
    79   return HomologyGraph(nodes, edges);
     79  return BindingModel(nodes, edges);
    8080}
    8181
     
    8383    EmpiricalPotential(),
    8484    params(parameters_t(MAXPARAMS, 0.)),
    85     bindingmodel(HomologyGraph())
     85    bindingmodel(BindingModel())
    8686{
    8787  // have some decent defaults for parameter_derivative checking
  • src/Potentials/Specifics/ConstantPotential.hpp

    rbc069f r9c793c  
    186186  /** Getter for the graph specifying the binding model of the potential.
    187187   *
    188    * \return HomologyGraph of the binding model
    189    */
    190   const HomologyGraph& getBindingModel() const
     188   * \return BindingModel ref of the binding model
     189   */
     190  const BindingModel& getBindingModel() const
    191191  { return bindingmodel; }
    192192
     
    205205
    206206  //!> binding model for this potential
    207   const HomologyGraph bindingmodel;
     207  const BindingModel bindingmodel;
    208208};
    209209
  • src/Potentials/Specifics/FourBodyPotential_Improper.cpp

    rbc069f r9c793c  
    5353Coordinator::ptr FourBodyPotential_Improper::coordinator(Memory::ignore(new FourBody_ImproperAngle()));
    5454
    55 static HomologyGraph generateBindingModel(const EmpiricalPotential::ParticleTypes_t &_ParticleTypes)
     55static BindingModel generateBindingModel(const EmpiricalPotential::ParticleTypes_t &_ParticleTypes)
    5656{
    5757  // fill nodes
    58   HomologyGraph::nodes_t nodes;
     58  BindingModel::vector_nodes_t nodes;
    5959  {
    6060    ASSERT( _ParticleTypes.size() == (size_t)4,
    6161        "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);
     62    nodes.push_back( FragmentNode(_ParticleTypes[0], 3) );
     63    nodes.push_back( FragmentNode(_ParticleTypes[1], 1) );
     64    nodes.push_back( FragmentNode(_ParticleTypes[2], 1) );
     65    nodes.push_back( FragmentNode(_ParticleTypes[3], 1) );
    7566  }
    7667
     
    9081  }
    9182
    92   return HomologyGraph(nodes, edges);
     83  return BindingModel(nodes, edges);
    9384}
    9485
    9586FourBodyPotential_Improper::FourBodyPotential_Improper() :
    9687    FourBodyPotential_Torsion(),
    97     bindingmodel(HomologyGraph())
     88    bindingmodel(BindingModel())
    9889{}
    9990
  • src/Potentials/Specifics/FourBodyPotential_Improper.hpp

    rbc069f r9c793c  
    6262  /** Getter for the graph specifying the binding model of the potential.
    6363   *
    64    * \return HomologyGraph of the binding model
     64   * \return BindingModel ref of the binding model
    6565   */
    66   const HomologyGraph& getBindingModel() const
     66  const BindingModel& getBindingModel() const
    6767  { return bindingmodel; }
    6868
     
    8989
    9090  //!> binding model for this potential
    91   const HomologyGraph bindingmodel;
     91  const BindingModel bindingmodel;
    9292};
    9393
  • src/Potentials/Specifics/FourBodyPotential_Torsion.cpp

    rbc069f r9c793c  
    6666Coordinator::ptr FourBodyPotential_Torsion::coordinator(Memory::ignore(new FourBody_TorsionAngle()));
    6767
    68 static HomologyGraph generateBindingModel(const EmpiricalPotential::ParticleTypes_t &_ParticleTypes)
     68static BindingModel generateBindingModel(const EmpiricalPotential::ParticleTypes_t &_ParticleTypes)
    6969{
    7070  // fill nodes
    71   HomologyGraph::nodes_t nodes;
     71  BindingModel::vector_nodes_t nodes;
    7272  {
    7373    ASSERT( _ParticleTypes.size() == (size_t)4,
    7474        "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);
     75    nodes.push_back( FragmentNode(_ParticleTypes[0], 1) );
     76    nodes.push_back( FragmentNode(_ParticleTypes[1], 2) );
     77    nodes.push_back( FragmentNode(_ParticleTypes[2], 2) );
     78    nodes.push_back( FragmentNode(_ParticleTypes[3], 1) );
    8879  }
    8980
     
    10394  }
    10495
    105   return HomologyGraph(nodes, edges);
     96  return BindingModel(nodes, edges);
    10697}
    10798
     
    109100  EmpiricalPotential(),
    110101  params(parameters_t(MAXPARAMS, 0.)),
    111   bindingmodel(HomologyGraph())
     102  bindingmodel(BindingModel())
    112103{
    113104  // have some decent defaults for parameter_derivative checking
  • src/Potentials/Specifics/FourBodyPotential_Torsion.hpp

    rbc069f r9c793c  
    193193  /** Getter for the graph specifying the binding model of the potential.
    194194   *
    195    * \return HomologyGraph of the binding model
    196    */
    197   const HomologyGraph& getBindingModel() const
     195   * \return BindingModel ref of the binding model
     196   */
     197  const BindingModel& getBindingModel() const
    198198  { return bindingmodel; }
    199199
     
    221221
    222222  //!> binding model for this potential
    223   const HomologyGraph bindingmodel;
     223  const BindingModel bindingmodel;
    224224};
    225225
  • src/Potentials/Specifics/ManyBodyPotential_Tersoff.cpp

    rbc069f r9c793c  
    8282Coordinator::ptr ManyBodyPotential_Tersoff::coordinator(Memory::ignore(new OneBody_Constant()));
    8383
    84 static HomologyGraph generateBindingModel(const EmpiricalPotential::ParticleTypes_t &_ParticleTypes)
     84static BindingModel generateBindingModel(const EmpiricalPotential::ParticleTypes_t &_ParticleTypes)
    8585{
    8686  // fill nodes
    87   HomologyGraph::nodes_t nodes;
     87  BindingModel::vector_nodes_t nodes;
    8888  {
    8989    ASSERT( _ParticleTypes.size() == (size_t)2,
    9090        "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);
     91    nodes.push_back( FragmentNode(_ParticleTypes[0], 1) );
     92    nodes.push_back( FragmentNode(_ParticleTypes[1], 1) );
    9893  }
    9994
     
    10499  }
    105100
    106   return HomologyGraph(nodes, edges);
     101  return BindingModel(nodes, edges);
    107102}
    108103
     
    117112    omega(1.),
    118113    triplefunction(&Helpers::NoOp_Triplefunction),
    119     bindingmodel(HomologyGraph())
     114    bindingmodel(BindingModel())
    120115{}
    121116
  • src/Potentials/Specifics/ManyBodyPotential_Tersoff.hpp

    rbc069f r9c793c  
    215215  /** Getter for the graph specifying the binding model of the potential.
    216216   *
    217    * \return HomologyGraph of the binding model
    218    */
    219   const HomologyGraph& getBindingModel() const
     217   * \return BindingModel ref of the binding model
     218   */
     219  const BindingModel& getBindingModel() const
    220220  { return bindingmodel; }
    221221
     
    372372
    373373  //!> binding model for this potential
    374   const HomologyGraph bindingmodel;
     374  const BindingModel bindingmodel;
    375375};
    376376
  • src/Potentials/Specifics/PairPotential_Harmonic.cpp

    rbc069f r9c793c  
    6767Coordinator::ptr PairPotential_Harmonic::coordinator(Memory::ignore(new TwoBody_Length()));
    6868
    69 static HomologyGraph generateBindingModel(const EmpiricalPotential::ParticleTypes_t &_ParticleTypes)
     69static BindingModel generateBindingModel(const EmpiricalPotential::ParticleTypes_t &_ParticleTypes)
    7070{
    7171  // fill nodes
    72   HomologyGraph::nodes_t nodes;
     72  BindingModel::vector_nodes_t nodes;
    7373  {
    7474    ASSERT( _ParticleTypes.size() == (size_t)2,
    7575        "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);
     76    nodes.push_back( FragmentNode(_ParticleTypes[0], 1) );
     77    nodes.push_back( FragmentNode(_ParticleTypes[1], 1) );
    8378  }
    8479
     
    8984  }
    9085
    91   return HomologyGraph(nodes, edges);
     86  return BindingModel(nodes, edges);
    9287}
    9388
     
    9590  EmpiricalPotential(),
    9691  params(parameters_t(MAXPARAMS, 0.)),
    97   bindingmodel(HomologyGraph())
     92  bindingmodel(BindingModel())
    9893{
    9994  // have some decent defaults for parameter_derivative checking
  • src/Potentials/Specifics/PairPotential_Harmonic.hpp

    rbc069f r9c793c  
    188188  /** Getter for the graph specifying the binding model of the potential.
    189189   *
    190    * \return HomologyGraph of the binding model
    191    */
    192   const HomologyGraph& getBindingModel() const
     190   * \return BindingModel ref of the binding model
     191   */
     192  const BindingModel& getBindingModel() const
    193193  { return bindingmodel; }
    194194
     
    207207
    208208  //!> binding model for this potential
    209   const HomologyGraph bindingmodel;
     209  const BindingModel bindingmodel;
    210210};
    211211
  • src/Potentials/Specifics/PairPotential_LennardJones.cpp

    rbc069f r9c793c  
    6767Coordinator::ptr PairPotential_LennardJones::coordinator(Memory::ignore(new TwoBody_Length()));
    6868
    69 static HomologyGraph generateBindingModel(const EmpiricalPotential::ParticleTypes_t &_ParticleTypes)
     69static BindingModel generateBindingModel(const EmpiricalPotential::ParticleTypes_t &_ParticleTypes)
    7070{
    7171  // fill nodes
    72   HomologyGraph::nodes_t nodes;
     72  BindingModel::vector_nodes_t nodes;
    7373  {
    7474    ASSERT( _ParticleTypes.size() == (size_t)2,
    7575        "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);
     76    nodes.push_back( FragmentNode(_ParticleTypes[0], 1) );
     77    nodes.push_back( FragmentNode(_ParticleTypes[1], 1) );
    8378  }
    8479
     
    8681  HomologyGraph::edges_t edges;
    8782
    88   return HomologyGraph(nodes, edges);
     83  return BindingModel(nodes, edges);
    8984}
    9085
     
    9893    EmpiricalPotential(),
    9994    params(parameters_t(MAXPARAMS, 0.)),
    100     bindingmodel(HomologyGraph())
     95    bindingmodel(BindingModel())
    10196{
    10297  // have some decent defaults for parameter_derivative checking
  • src/Potentials/Specifics/PairPotential_LennardJones.hpp

    rbc069f r9c793c  
    189189  /** Getter for the graph specifying the binding model of the potential.
    190190   *
    191    * \return HomologyGraph of the binding model
    192    */
    193   const HomologyGraph& getBindingModel() const
     191   * \return BindingModel ref of the binding model
     192   */
     193  const BindingModel& getBindingModel() const
    194194  { return bindingmodel; }
    195195
     
    214214
    215215  //!> binding model for this potential
    216   const HomologyGraph bindingmodel;
     216  const BindingModel bindingmodel;
    217217};
    218218
  • src/Potentials/Specifics/PairPotential_Morse.cpp

    rbc069f r9c793c  
    6969Coordinator::ptr PairPotential_Morse::coordinator(Memory::ignore(new TwoBody_Length()));
    7070
    71 static HomologyGraph generateBindingModel(const EmpiricalPotential::ParticleTypes_t &_ParticleTypes)
     71static BindingModel generateBindingModel(const EmpiricalPotential::ParticleTypes_t &_ParticleTypes)
    7272{
    7373  // fill nodes
    74   HomologyGraph::nodes_t nodes;
     74  BindingModel::vector_nodes_t nodes;
    7575  {
    7676    ASSERT( _ParticleTypes.size() == (size_t)2,
    7777        "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);
     78    nodes.push_back( FragmentNode(_ParticleTypes[0], 1) );
     79    nodes.push_back( FragmentNode(_ParticleTypes[1], 1) );
    8580  }
    8681
     
    9186  }
    9287
    93   return HomologyGraph(nodes, edges);
     88  return BindingModel(nodes, edges);
    9489}
    9590
     
    9792  EmpiricalPotential(),
    9893  params(parameters_t(MAXPARAMS, 0.)),
    99   bindingmodel(HomologyGraph())
     94  bindingmodel(BindingModel())
    10095{
    10196  // have some decent defaults for parameter_derivative checking
  • src/Potentials/Specifics/PairPotential_Morse.hpp

    rbc069f r9c793c  
    190190  /** Getter for the graph specifying the binding model of the potential.
    191191   *
    192    * \return HomologyGraph of the binding model
    193    */
    194   const HomologyGraph& getBindingModel() const
     192   * \return BindingModel ref of the binding model
     193   */
     194  const BindingModel& getBindingModel() const
    195195  { return bindingmodel; }
    196196
     
    209209
    210210  //!> binding model for this potential
    211   const HomologyGraph bindingmodel;
     211  const BindingModel bindingmodel;
    212212};
    213213
  • src/Potentials/Specifics/ThreeBodyPotential_Angle.cpp

    rbc069f r9c793c  
    6767Coordinator::ptr ThreeBodyPotential_Angle::coordinator(Memory::ignore(new ThreeBody_Angle()));
    6868
    69 static HomologyGraph generateBindingModel(const EmpiricalPotential::ParticleTypes_t &_ParticleTypes)
     69static BindingModel generateBindingModel(const EmpiricalPotential::ParticleTypes_t &_ParticleTypes)
    7070{
    7171  // fill nodes
    72   HomologyGraph::nodes_t nodes;
     72  BindingModel::vector_nodes_t nodes;
    7373  {
    7474    ASSERT( _ParticleTypes.size() == (size_t)3,
    7575        "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);
     76    nodes.push_back( FragmentNode(_ParticleTypes[0], 1) );
     77    nodes.push_back( FragmentNode(_ParticleTypes[1], 2) );
     78    nodes.push_back( FragmentNode(_ParticleTypes[2], 1) );
    8679  }
    8780
     
    9891  }
    9992
    100   return HomologyGraph(nodes, edges);
     93  return BindingModel(nodes, edges);
    10194}
    10295
     
    10497  EmpiricalPotential(),
    10598  params(parameters_t(MAXPARAMS, 0.)),
    106   bindingmodel(HomologyGraph())
     99  bindingmodel(BindingModel())
    107100{
    108101  // have some decent defaults for parameter_derivative checking
  • src/Potentials/Specifics/ThreeBodyPotential_Angle.hpp

    rbc069f r9c793c  
    192192   * \return HomologyGraph of the binding model
    193193   */
    194   const HomologyGraph& getBindingModel() const
     194  const BindingModel& getBindingModel() const
    195195  { return bindingmodel; }
    196196
     
    216216
    217217  //!> binding model for this potential
    218   const HomologyGraph bindingmodel;
     218  const BindingModel bindingmodel;
    219219};
    220220
Note: See TracChangeset for help on using the changeset viewer.