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. This implementation is currently hard coded for \(\gamma=-2\) which avoids sqrt.

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 the number of site types and then the identity of each of those site types in order of the tables given below. (e.g., “site_types n i” where n is the number of site types and each following number is the type of each anisotropic site.)

There is a table for each unique pair of site types. For example, if the first line is as follows: “site_types 2 1 7” then the first table will be for interactions of site type 1 with site type 1 (i.e., 1-1), the second table will be for 1-7 interactions, and the third table will be for 7-7 interactions.

For each pair of site types, i <= j, a table is given by the following lines.

  1. “inner [value]” is the inner hard cutoff distance.

  2. ”num_z [value]” is the number of energy values along the z parameter.

  3. The last line is num_z space-separated values of the potential energy uniformly in the z range of [0, 1].

Arguments

  • table_file: table file with format described above.

Public Functions

void precompute(const ModelParams &existing)

Precompute model parameters based on existing model parameters.

void serialize(std::ostream &ostr) const

Output a serialized version of the existing model.