Ignore:
Timestamp:
Jul 8, 2013, 2:22:03 PM (12 years ago)
Author:
Frederik Heber <heber@…>
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:
baccf6
Parents:
c5e63a
git-author:
Frederik Heber <heber@…> (05/09/13 19:25:45)
git-committer:
Frederik Heber <heber@…> (07/08/13 14:22:03)
Message:

Extended CompoundPotential for multiple occurences of argument bunches.

  • added HomologyGraph::hasGreaterEqualTimesAtomicNumber() has model might have multiple matching arguments within a single fragment.
  • i.e. when there is more than one argument bunch for a given model. Hence, we check the stream whether upcoming arguments match current and next model. Note however that models are not necessarily sorted by particle_types' size. Hence, we must trick a little and need a specific map comparator.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/Potentials/unittests/CompoundPotentialUnitTest.cpp

    rc5e63a r7c1091  
    9292  }
    9393
    94   // create graph
     94  // create graph (i.e. this simulates a water molecule)
    9595  {
    9696    // add nodes
    9797    nodes +=
    98         std::make_pair(FragmentNode(0,1),1),
    99         std::make_pair(FragmentNode(1,1),1);
     98        std::make_pair(FragmentNode(0,2),1),
     99        std::make_pair(FragmentNode(1,1),2);
    100100
    101101    // add edges
    102102    edges +=
    103         std::make_pair(FragmentEdge(0,1),1);
     103        std::make_pair(FragmentEdge(0,1),2);
    104104
    105105    // construct graph
     
    125125      4.46595;
    126126  output +=
    127       -78.5211,
    128       -78.8049,
    129       -78.935,
    130       -78.9822,
    131       -78.9867,
    132       -78.971,
    133       -78.9475,
    134       -78.9225,
    135       -78.899,
    136       -78.8784;
     127      2.*0.467226+d,
     128      2.*0.183388+d,
     129      2.*0.0532649+d,
     130      2.*0.00609808+d,
     131      2.*0.00160056+d,
     132      2.*0.0172506+d,
     133      2.*0.0407952+d,
     134      2.*0.0658475+d,
     135      2.*0.0893157+d,
     136      2.*0.109914+d;
    137137
    138138  CPPUNIT_ASSERT_EQUAL( input.size(), output.size() );
     
    157157  compound.setParameters(params);
    158158  for (size_t index = 0; index < input.size(); ++index) {
    159     argument_t arg(argument_t::indices_t(0,1), argument_t::types_t(0,1), input[index]);
    160     const double result = compound( FunctionModel::arguments_t(1,arg) )[0];
     159    argument_t firstarg(argument_t::indices_t(0,1), argument_t::types_t(0,1), input[index]);
     160    argument_t secondarg(argument_t::indices_t(0,2), argument_t::types_t(0,1), input[index]);
     161    FunctionModel::arguments_t args;
     162    args += firstarg,secondarg;
     163    const double result = compound( args )[0];
    161164    CPPUNIT_ASSERT(
    162165        Helpers::isEqual(
     
    177180//  params += d,a,c,D;
    178181//  compound.setParameters(params);
    179 //  argument_t arg(argument_t::indices_t(0,1), argument_t::types_t(0,1), c);
    180 //  const double result = compound.derivative(FunctionModel::arguments_t(1,arg))[0]
     182//  argument_t firstarg(argument_t::indices_t(0,1), argument_t::types_t(0,1), input[index]);
     183//  argument_t secondarg(argument_t::indices_t(0,2), argument_t::types_t(0,1), input[index]);
     184//  FunctionModel::arguments_t args;
     185//  args += firstarg,secondarg;
     186//  const double result = compound.derivative( args )[0]
    181187//  CPPUNIT_ASSERT(
    182188//      Helpers::isEqual(
     
    197203  params += d,a,c,D;
    198204  compound.setParameters(params);
    199   argument_t arg(argument_t::indices_t(0,1), argument_t::types_t(0,1), c);
    200   {
    201     const double result =
    202         compound.parameter_derivative(
    203             FunctionModel::arguments_t(1,arg),
     205  argument_t firstarg(argument_t::indices_t(0,1), argument_t::types_t(0,1), c);
     206  argument_t secondarg(argument_t::indices_t(0,2), argument_t::types_t(0,1), c);
     207  FunctionModel::arguments_t args;
     208  args += firstarg,secondarg;
     209  {
     210    const double result =
     211        compound.parameter_derivative(
     212            args,
    204213            0)[0];
    205214    CPPUNIT_ASSERT(
     
    214223    const double result =
    215224        compound.parameter_derivative(
    216             FunctionModel::arguments_t(1,arg),
     225            args,
    217226            1)[0];
    218227    CPPUNIT_ASSERT(
     
    227236    const double result =
    228237        compound.parameter_derivative(
    229             FunctionModel::arguments_t(1,arg),
     238            args,
    230239            2)[0];
    231240    CPPUNIT_ASSERT(
     
    240249    const double result =
    241250        compound.parameter_derivative(
    242             FunctionModel::arguments_t(1,arg),
     251            args,
    243252            3)[0];
    244253    CPPUNIT_ASSERT(
Note: See TracChangeset for help on using the changeset viewer.