TablePotential
-
class TablePotential : public feasst::ModelTwoBody
Represent isotropic interactions using a tabular potential that is precomputed and read from a file.
For an isotropic site, the radial distance, r, between the centers is scaled as \(z=[(r^\gamma - r_h^\gamma)/(r_c^\gamma - r_h^\gamma)]\) which varies from z=0 at the hard contact distance, \(r_h\), to \(z=1\) at the cutoff, \(r_c\). A stretching parameter, \(\gamma\), increases the resolution at shorter distances when negative.
The default value of \(\gamma=-2\) avoids the expensive sqrt operation, but can also be problematic if \(r_h \approx 0\). For \(r_h \approx 0\), \(\gamma=1\) may be more appropriate.
Interpolation uses Table1D::forward_difference_interpolation.
The format of the tabular potential stored in a file is as follows.
The first line should be ‘site_types=’ followed by comma-separated values for the names of each of the site types (e.g., “site_types=O,H” will expect tables for sites of type name “O” and H”).
The table for each unique pair of site types is required.
For example, if the first line is as follows:
”site_types=O,H”
then the first table will be for interactions of site type O with
site type O (i.e., O-O), the second table will be for O-H interactions,
and the third table will be for H-H interactions.
For each pair of site types, a table is given by the following lines.
1. “gamma [value]” is the optional stretching exponential.
If this line is not provided, then the default value of -2 is used.
2. “inner [value]” is the inner hard cutoff distance (required).
The last line is space-separated values of the potential energy uniformly in the z range of [0, 1].
Public Functions
-
void precompute(Configuration *config)
Precompute model parameters based on existing model parameters.
-
void serialize(std::ostream &ostr) const
Output a serialized version of the existing model.
Arguments
table_file: table file with format described above.