Ignore:
Timestamp:
Jun 27, 2014, 9:32:55 PM (11 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:
550f2a
Parents:
16227a
git-author:
Frederik Heber <heber@…> (02/27/14 20:15:41)
git-committer:
Frederik Heber <heber@…> (06/27/14 21:32:55)
Message:

FunctionModel now uses list_of_arguments to split sequence of subsets of distances.

  • this fixes ambiguities with the set of distances: Imagine the distances within a water molecule as OH (A) and HH (B). We then may have a sequence of argument_t as AABAAB. And with the current implementation of CompoundPotential::splitUpArgumentsByModels() we would always choose the latter (and more complex) model. Hence, we make two calls to TriplePotential_Angle, instead of calls twice to PairPotential_Harmonic for A, one to PairPotential_Harmonic for B, and once to TriplePotential_Angle for AAB.
  • now, we new list looks like A,A,B,AAB where each tuple of distances can be uniquely associated with a specific potential.
  • changed signatures of EmpiricalPotential::operator(), ::derivative(), ::parameter_derivative(). This involved changing all of the current specific potentials and CompoundPotential.
  • TrainingData must discern between the InputVector_t (just all distances) and the FilteredInputVector_t (tuples of subsets of distances).
  • FunctionApproximation now has list_of_arguments_t as parameter to evaluate() and evaluate_derivative().
  • DOCU: docu change in TrainingData.
Location:
src/Potentials/Specifics/unittests
Files:
8 edited

Legend:

Unmodified
Added
Removed
  • src/Potentials/Specifics/unittests/ConstantPotentialUnitTest.cpp

    r16227a re1fe7e  
    8282      Helpers::isEqual(
    8383          offset,
    84           constant( FunctionModel::arguments_t() )[0]
     84          constant( FunctionModel::list_of_arguments_t() )[0]
    8585      )
    8686  );
     
    9797          0.,
    9898          constant.derivative(
    99               FunctionModel::arguments_t()
     99              FunctionModel::list_of_arguments_t()
    100100          )[0]
    101101      )
     
    114114          1.,
    115115          constant.parameter_derivative(
    116               FunctionModel::arguments_t(),
     116              FunctionModel::list_of_arguments_t(),
    117117              0
    118118          )[0]
  • src/Potentials/Specifics/unittests/FourBodyPotential_ImproperUnitTest.cpp

    r16227a re1fe7e  
    121121  for (size_t index = 0; index < input.size(); ++index) {
    122122    const FourBodyPotential_Improper::results_t result =
    123         angle( input[index] );
     123        angle( FunctionModel::list_of_arguments_t(1, input[index]) );
    124124    CPPUNIT_ASSERT(
    125125        Helpers::isEqual(
     
    144144          0.,
    145145          angle.derivative(
    146               input[5]
     146              FunctionModel::list_of_arguments_t(1, input[5])
    147147          )[0],
    148148          10.
     
    165165          0.,
    166166          angle.parameter_derivative(
    167               input[5],
     167              FunctionModel::list_of_arguments_t(1, input[5]),
    168168              0
    169169          )[0],
     
    175175          0.,
    176176          angle.parameter_derivative(
    177               input[5],
     177              FunctionModel::list_of_arguments_t(1, input[5]),
    178178              1
    179179          )[0],
  • src/Potentials/Specifics/unittests/FourBodyPotential_TorsionUnitTest.cpp

    r16227a re1fe7e  
    121121  for (size_t index = 0; index < input.size(); ++index) {
    122122    const FourBodyPotential_Torsion::results_t result =
    123         angle( input[index] );
     123        angle( FunctionModel::list_of_arguments_t(1, input[index]) );
    124124    CPPUNIT_ASSERT(
    125125        Helpers::isEqual(
     
    144144          0.,
    145145          angle.derivative(
    146               input[5]
     146              FunctionModel::list_of_arguments_t(1, input[5])
    147147          )[0],
    148148          10.
     
    165165          0.,
    166166          angle.parameter_derivative(
    167               input[5],
     167              FunctionModel::list_of_arguments_t(1, input[5]),
    168168              0
    169169          )[0],
     
    175175          0.,
    176176          angle.parameter_derivative(
    177               input[5],
     177              FunctionModel::list_of_arguments_t(1, input[5]),
    178178              1
    179179          )[0],
  • src/Potentials/Specifics/unittests/ManyBodyPotential_TersoffUnitTest.cpp

    r16227a re1fe7e  
    299299        arg.globalid = index; // this is needed for the triplefunction to the configuration
    300300        FunctionModel::arguments_t args(1,arg);
    301         const ManyBodyPotential_Tersoff::results_t res = tersoff(args);
     301        const ManyBodyPotential_Tersoff::results_t res =
     302            tersoff( FunctionModel::list_of_arguments_t(1, args) );
    302303        temp += res[0];
    303304      }
     
    336337//          0.,
    337338//          tersoff.derivative(
    338 //              FunctionModel::arguments_t(1,argument_t(1.))
     339//              FunctionModel::list_of_arguments_t(1, FunctionModel::arguments_t(1,argument_t(1.)))
    339340//          )[0]
    340341//      )
     
    361362//          0.,
    362363//          tersoff.parameter_derivative(
    363 //              FunctionModel::arguments_t(1,argument_t(1.)),
     364//              FunctionModel::list_of_arguments_t(1, FunctionModel::arguments_t(1,argument_t(1.))),
    364365//              0
    365366//          )[0]
     
    370371//          0.,
    371372//          tersoff.parameter_derivative(
    372 //              FunctionModel::arguments_t(1,argument_t(1.)),
     373//              FunctionModel::list_of_arguments_t(1, FunctionModel::arguments_t(1,argument_t(1.))),
    373374//              1
    374375//          )[0]
     
    379380//          1.,
    380381//          tersoff.parameter_derivative(
    381 //              FunctionModel::arguments_t(1,argument_t(1.)),
     382//              FunctionModel::list_of_arguments_t(1, FunctionModel::arguments_t(1,argument_t(1.))),
    382383//              2
    383384//          )[0]
  • src/Potentials/Specifics/unittests/PairPotential_HarmonicUnitTest.cpp

    r16227a re1fe7e  
    102102        Helpers::isEqual(
    103103            output[index],
    104             harmonic( FunctionModel::arguments_t(1,arg) )[0]
     104            harmonic( FunctionModel::list_of_arguments_t(1, FunctionModel::arguments_t(1,arg)) )[0]
    105105        )
    106106    );
     
    122122          0.,
    123123          harmonic.derivative(
    124               FunctionModel::arguments_t(1,arg)
     124              FunctionModel::list_of_arguments_t(1, FunctionModel::arguments_t(1,arg))
    125125          )[0]
    126126      )
     
    143143          0.,
    144144          harmonic.parameter_derivative(
    145               FunctionModel::arguments_t(1,arg),
     145              FunctionModel::list_of_arguments_t(1, FunctionModel::arguments_t(1,arg)),
    146146              0
    147147          )[0]
     
    152152          0.,
    153153          harmonic.parameter_derivative(
    154               FunctionModel::arguments_t(1,arg),
     154              FunctionModel::list_of_arguments_t(1, FunctionModel::arguments_t(1,arg)),
    155155              1
    156156          )[0]
  • src/Potentials/Specifics/unittests/PairPotential_LennardJonesUnitTest.cpp

    r16227a re1fe7e  
    118118        Helpers::isEqual(
    119119            output[index],
    120             lj( FunctionModel::arguments_t(1,arg) )[0],
     120            lj( FunctionModel::list_of_arguments_t(1, FunctionModel::arguments_t(1,arg)) )[0],
    121121            1.e-4/std::numeric_limits<double>::epsilon() // only compare four digits
    122122        )
     
    140140          0.,
    141141          lj.derivative(
    142               FunctionModel::arguments_t(1,arg)
     142              FunctionModel::list_of_arguments_t(1, FunctionModel::arguments_t(1,arg))
    143143          )[0],
    144144          1.e+6
     
    162162          -1.,
    163163          lj.parameter_derivative(
    164               FunctionModel::arguments_t(1,arg),
     164              FunctionModel::list_of_arguments_t(1, FunctionModel::arguments_t(1,arg)),
    165165              0
    166166          )[0],
     
    172172          0.,
    173173          lj.parameter_derivative(
    174               FunctionModel::arguments_t(1,arg),
     174              FunctionModel::list_of_arguments_t(1, FunctionModel::arguments_t(1,arg)),
    175175              1
    176176          )[0],
  • src/Potentials/Specifics/unittests/PairPotential_MorseUnitTest.cpp

    r16227a re1fe7e  
    120120        Helpers::isEqual(
    121121            output[index],
    122             Morse( FunctionModel::arguments_t(1,arg) )[0],
     122            Morse( FunctionModel::list_of_arguments_t(1, FunctionModel::arguments_t(1,arg)) )[0],
    123123            1.e-4/std::numeric_limits<double>::epsilon() // only compare four digits
    124124        )
     
    141141          0.,
    142142          Morse.derivative(
    143               FunctionModel::arguments_t(1,arg)
     143              FunctionModel::list_of_arguments_t(1, FunctionModel::arguments_t(1,arg))
    144144          )[0],
    145145          1.e+6
     
    163163          0.,
    164164          Morse.parameter_derivative(
    165               FunctionModel::arguments_t(1,arg),
     165              FunctionModel::list_of_arguments_t(1, FunctionModel::arguments_t(1,arg)),
    166166              0
    167167          )[0],
     
    173173          0.,
    174174          Morse.parameter_derivative(
    175               FunctionModel::arguments_t(1,arg),
     175              FunctionModel::list_of_arguments_t(1, FunctionModel::arguments_t(1,arg)),
    176176              1
    177177          )[0],
     
    183183          0.,
    184184          Morse.parameter_derivative(
    185               FunctionModel::arguments_t(1,arg),
     185              FunctionModel::list_of_arguments_t(1, FunctionModel::arguments_t(1,arg)),
    186186              2
    187187          )[0],
  • src/Potentials/Specifics/unittests/ThreeBodyPotential_AngleUnitTest.cpp

    r16227a re1fe7e  
    112112  for (size_t index = 0; index < input.size(); ++index) {
    113113    const ThreeBodyPotential_Angle::results_t result =
    114         angle( input[index] );
     114        angle( FunctionModel::list_of_arguments_t(1, input[index]) );
    115115    CPPUNIT_ASSERT(
    116116        Helpers::isEqual(
     
    135135          0.,
    136136          angle.derivative(
    137               input[5]
     137              FunctionModel::list_of_arguments_t(1, input[5])
    138138          )[0],
    139139          10.
     
    156156          0.,
    157157          angle.parameter_derivative(
    158               input[5],
     158              FunctionModel::list_of_arguments_t(1, input[5]),
    159159              0
    160160          )[0],
     
    166166          0.,
    167167          angle.parameter_derivative(
    168               input[5],
     168              FunctionModel::list_of_arguments_t(1, input[5]),
    169169              1
    170170          )[0],
Note: See TracChangeset for help on using the changeset viewer.