source: src/Potentials/EmpiricalPotential.hpp@ 64cafb2

Action_Thermostats Add_AtomRandomPerturbation Add_FitFragmentPartialChargesAction Add_RotateAroundBondAction Add_SelectAtomByNameAction Adding_Graph_to_ChangeBondActions Adding_MD_integration_tests Adding_StructOpt_integration_tests Automaking_mpqc_open AutomationFragmentation_failures Candidate_v1.5.4 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_ChargeSampling_PBC Fix_ChronosMutex Fix_FitPartialCharges Fix_FitPotential_needs_atomicnumbers Fix_ForceAnnealing Fix_IndependentFragmentGrids Fix_ParseParticles Fix_ParseParticles_split_forward_backward_Actions Fix_StatusMsg Fix_StepWorldTime_single_argument Fix_Verbose_Codepatterns Fixes 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 IndependentFragmentGrids_IndividualZeroInstances IndependentFragmentGrids_IntegrationTest IndependentFragmentGrids_Sole_NN_Calculation 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 SaturateAtoms_findBestMatching SaturateAtoms_singleDegree StoppableMakroAction Subpackage_CodePatterns Subpackage_JobMarket Subpackage_LinearAlgebra Subpackage_levmar Subpackage_mpqc_open Subpackage_vmg ThirdParty_MPQC_rebuilt_buildsystem TrajectoryDependenant_MaxOrder TremoloParser_IncreasedPrecision TremoloParser_MultipleTimesteps Ubuntu_1604_changes stable
Last change on this file since 64cafb2 was e1fe7e, checked in by Frederik Heber <heber@…>, 11 years ago

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.
  • Property mode set to 100644
File size: 2.7 KB
Line 
1/*
2 * EmpiricalPotential.hpp
3 *
4 * Created on: Sep 26, 2012
5 * Author: heber
6 */
7
8#ifndef EMPIRICALPOTENTIAL_HPP_
9#define EMPIRICALPOTENTIAL_HPP_
10
11
12// include config.h
13#ifdef HAVE_CONFIG_H
14#include <config.h>
15#endif
16
17#include <vector>
18
19#include "FunctionApproximation/FunctionArgument.hpp"
20#include "FunctionApproximation/FunctionModel.hpp"
21#include "Potentials/SerializablePotential.hpp"
22#include "Potentials/InternalCoordinates/Coordinator.hpp"
23
24/** An EmpiricalPotential is a function that is given a vector of objects as
25 * arguments which it uses to evaluate an internal function and returns a
26 * value representing the energy of this configuration indicated by the
27 * arguments.
28 *
29 * It is to be used inside an std::accumulate function after a vector of
30 * arguments (i.e. a vector of a vector) has been prepared initially.
31 *
32 */
33class EmpiricalPotential :
34 public FunctionModel,
35 public SerializablePotential
36{
37public:
38 //!> typedef for the argument vector as input to the function
39 typedef std::vector<argument_t> arguments_t;
40 //!> typedef for a single result degree of freedom
41 typedef double result_t;
42 //!> typedef for the result vector as returned by the function
43 typedef std::vector<result_t> results_t;
44 //!> typedef for the components of the derivative
45 typedef std::vector<result_t> derivative_components_t;
46
47 /** Default constructor for class EmpiricalPotential.
48 *
49 */
50 EmpiricalPotential(const ParticleTypes_t &_ParticleTypes) :
51 SerializablePotential(_ParticleTypes)
52 {}
53
54 /** Destructor for class EmpiricalPotential.
55 *
56 */
57 virtual ~EmpiricalPotential() {}
58
59 /** Evaluates the function with the given \a arguments and the current set of
60 * parameters.
61 *
62 * \param listarguments list of sets of arguments as input variables to the function
63 * \return result of the function
64 */
65 virtual results_t operator()(const list_of_arguments_t &listarguments) const=0;
66
67 /** Evaluates the derivative of the function with the given \a arguments
68 * for each component.
69 *
70 * \param listarguments list of sets of arguments as input variables to the function
71 * \return result vector containing the derivative with respect to each
72 * input comonent of the function
73 */
74 virtual derivative_components_t derivative(const list_of_arguments_t &listarguments) const=0;
75
76 /** Returns the functor that converts argument_s into the
77 * internal coordinate described by this potential function.
78 *
79 * \return coordinator functor
80 */
81 virtual Coordinator::ptr getCoordinator() const=0;
82
83protected:
84 /** Default constructor for class EmpiricalPotential.
85 *
86 * Callable only by derived functions.
87 *
88 */
89 EmpiricalPotential()
90 {}
91};
92
93#endif /* EMPIRICALPOTENTIAL_HPP_ */
Note: See TracBrowser for help on using the repository browser.