class PerturbDistance : public feasst::PerturbMove

Put first site in selection in a spherical shell about the first site in anchor. For rigid bonds, the spherical shell has infinitesimal thickness (a sphere). The following Bond Properties (e.g., /feasst/particle/README.rst): length, maximum_length and spring_constant and exponent are as described in Random::bond_length. The length in Bond Properties is equilibrium_length in Random::bond_length. If maximum_length is not provided, it is assumed to be twice the length. If spring_constant is not provided, the bond is assumed to be rigid. If exponent is not provided, it is assumed to be 2 (harmonic).

Subclassed by feasst::PerturbDistanceAngle, feasst::PerturbReptate

Public Functions

void precompute(TrialSelect *select, System *system)

Compute and store the distance from the bond_length property in select. Also store the spring constant.

double bond_type() const

Return the bond type.

double old_bond_energy(const System &system, const TrialSelect *select)

Return the current energy of the existing, old bond.

double random_distance(const System &system, const TrialSelect *select, Random *random, double *bond_energy)

Return the randomly selected distance from the bond potential.

void move(const bool is_position_held, System *system, TrialSelect *select, Random *random, Acceptance *acceptance)

Move the selection of the system.


PerturbDistance(argtype args = argtype())


  • potential_acceptance: index of intramolecular potential that will be used to select the move. This option is intended for MayerSampling only. Note: if the Trial has multiple stages, this may cause problems. Ignore if -1 (default: -1).

  • enable_tunable: enable tunable perturbation, but only implemented for a single stage and a single step.