ModelTableCart1D

class ModelTableCart1D : public feasst::ModelOneBody

A tabular potential for interactions in one Cartesian dimension. The table file is formatted as follows:

The first line should be “site_types=” followed by a comma-separated list of the labels of each site type. The remaining lines are the individual tables for each of the site types. For example, “site_types=O,H” will then contain a line for the table of “O” sites, then another line for the table of “H” sites. Each table is given in a single line by a number of space-separated values that represent the interaction energy spanning the range of a coordinate, z, scaled by the periodic boundary lengths, L, with the range z=[-0.5, 0.5] and linear spacing. For example, if the line contains 5 values, then z=[-0.5, -0.25, 0, 0.25, 0.5] and the potential will be interpolated with Table1D::forward_difference_interpolation.

Public Functions

void precompute(Configuration *config)

Precompute model parameters based on existing model parameters.

double energy(const Position &wrapped_site, const Site &site, const Configuration &config, const ModelParams &model_params)

Return the energy given the wrapped coordinates, site, config and params.

void serialize(std::ostream &ostr) const

Output a serialized version of the existing model.

Arguments

  • table_file: file name for the table.

  • dimension: the cartesian dimension to apply the Potential (default: 2).