28 std::vector<double>
const &force,
29 std::vector<double>
const &energy)
30 : minval{minval}, maxval{maxval} {
33 throw std::domain_error(
"TabulatedPotential parameter 'max' must be "
34 "larger than or equal to parameter 'min'");
38 throw std::domain_error(
39 "TabulatedPotential parameter 'force' must contain 1 element");
42 throw std::domain_error(
"TabulatedPotential parameter 'force' must "
43 "contain at least 1 element");
46 throw std::invalid_argument(
"TabulatedPotential parameter 'force' must "
47 "have the same size as parameter 'energy'");
std::vector< double > force_tab
Tabulated forces.
double force(double x) const
Evaluate the force at position x.
double invstepsize
Distance on the x-axis between tabulated values.
double maxval
Position on the x-axis of the last tabulated value.
double energy(double x) const
Evaluate the energy at position x.
std::vector< double > energy_tab
Tabulated energies.
double minval
Position on the x-axis of the first tabulated value.
TabulatedPotential()=default