Group

class Group : public feasst::PropertiedEntity

Define groups based on particle and site types.

Public Functions

void name_to_index(const ParticleFactory &unique_types)

Convert site type names to interger indexes for optimization. Otherwise, assumes name is index (and index is -1 if stoi fails).

const std::vector<int> site_types() const

Return the list of site types in the group.

const std::vector<int> particle_types() const

Return the list of particle types in the group.

bool is_dynamic() const

Return true if dynamic.

bool is_spatial() const

Return if the group definition is based on location.

bool is_empty() const

Return true if group has no group definitions.

bool is_in(const Site &site) const

Return true if the site is in the group.

bool is_in(const Particle &particle, const int particle_index) const

Return true if the particle is in the group.

void remove_sites(Particle *particle) const

Remove sites from the particle which are not in the group.

std::vector<int> site_indices(const Particle &particle) const

Return the list of site indices in Particle which are in the group.

Arguments

  • prepend: expect all other arguments to have this prepended with underscore. For example, if prepend==water, the following argument would expect “water_site_type0” (default: empty).

  • site_type: add site type(s). If none, all sites included. Multiple can be provided as comma-separated values.

  • particle_type: add particle type(s). If none, all included. Multiple can be provided as comma-separated values.

  • particle_index: add particle index(es). If none, all included. Multiple can be provided as comma-separated values.

  • dynamic: set true if groups should be updated (default: true).

  • spatial: set true if group is based on location (default: false).