TrialSelect

class TrialSelect

Select the mobile particles and sites that are to be perturbed via trials. Store the original position in mobile_original for reverting. Also store the ‘anchor’ particles and sites which are not mobile but may be required to complete the perturbation (e.g., bonds).

Subclassed by feasst::SelectCluster, feasst::SelectNothing, feasst::SelectParticleAVB, feasst::SelectParticleAVBDivalent, feasst::SelectParticlePivot, feasst::SelectPerturbed, feasst::SelectSiteOfType, feasst::SelectTwoSites, feasst::TrialSelectAll, feasst::TrialSelectBond, feasst::TrialSelectParticle

Public Functions

int group_index() const

Return the index of group for selection.

int particle_type() const

Return the particle type.

int configuration_index() const

Return the index of the configuration.

const Configuration &configuration(const System &system) const

Given the system, return the configuration.

Configuration *get_configuration(System *system) const

Given the system pointer, return the configuration pointer.

void set_configuration_index(const int config)

Set the configuration index.

void before_select()

Perform upkeep before select.

virtual bool select(const Select &perturbed, System *system, Random *random)

Perform the selection as implemented in the derived class. Return false if the selection cannot be made. Otherwise, return true.

param perturbed:

Perturbed is included to allow chaining of selection based on previous.

bool sel(System *system, Random *random)

Same as above but with an empty perturbed.

virtual void precompute(System *system)

Precompute quantities before simulation for optimization.

const Select &mobile() const

Return the mobile selection. These can change during the trial.

void set_mobile(const Select &mobile)

Set the mobile selection.

const Select &mobile_original() const

Return originally-seleted mobile. These do not change during trial.

void set_mobile_original(const System *system)

Set the original mobile, including Euler if anisotropic.

const Select &anchor() const

Return the anchor selection.

const Position &anchor_position(const int particle_index, const int site_index, const System &system) const

Return anchor position.

param particle_index:

anchor index, not configuration index

param site_index:

anchor index

void set_trial_state(const int state)

Set the state of the trial for the mobile select (e.g., old, move, add). See Select::trial_state

void reset_mobile()

Reset the mobile selection to the original.

double probability() const

Return the probability of the selection. For example, if a random particle type is selected, then the probability is the inverse of the number of particles of that type.

virtual void mid_stage()

Call between rosenbluth calculation of old and new configuration.

void set_ghost(const bool ghost = true)

Select from ghost particles.

bool is_ghost() const

Return true if selecting from ghost particles.

const std::map<std::string, std::shared_ptr<Accumulator>> &printable() const

Return printable properties.

virtual bool are_constraints_satisfied(const int old, const System &system) const

Return true if constraints are satisfied.

bool is_particle_type_set() const

Return true if particle type is set.

void remove_unphysical_sites(const Configuration &config)

Remove unphysical sites from mobile.

void replace_mobile(const Select &replacement, const int sel_part_index, const Configuration &config)

Fast replace of a single particle in mobile.

double property(const std::string name) const

Return the property value by name.

bool has_property(const std::string name) const

Return true if entity has property of name.

void add_or_set_property(const std::string name, const double value)

Add a property, or set its value if name already exists.

bool is_isotropic(const System *system) const

Return true if all sites in mobile are isotropic.

Arguments

  • group_index: index of group defined within system (default: 0).

  • group: name of group defined within system (default: “”).

  • particle_type: type of particle in configuration (default: -1)

  • configuration_index: index of configuration (default: 0).