ModelTwoBodyTable

class ModelTwoBodyTable : public feasst::ModelTwoBody

Tabulate two-body models and interpolate their interactions during the simulation.

Public Functions

ModelTwoBodyTable(argtype args = argtype())

args:

  • hard_sphere_threshold: when r < threshold, return NEAR_INFINITY (default: 0.2).

void resize(const int num_site_types)

Resize the table based on the number of site types.

void set(std::shared_ptr<Table1D> table, const int type1 = 0, const int type2 = 0)

Set a table potential between sites of type1 and type2. Table distances are normalized between 0 and 1, inclusive, where z = (r-rh)/(rc-rh), rh is the hard_sphere_threshold and rc is the cutoff. Thus, the first element of the table is for a distance of rh, and the last element of the table is for a distance of rc.

void set(const ModelParams &model_params, const int size, const int num_types, Model *model)

Tabulate an existing model.

param num_types:

size of table

void set(const ModelParams &model_params, const int size, const int num_types, std::shared_ptr<Model> model)

Same as above, but with a shared_ptr model.

param num_types:

size of table

const Table1D &table(const int type1, const int type2) const

Return the tabular potential.

void serialize(std::ostream &ostr) const

Output a serialized version of the existing model.