Particle

class Particle : public feasst::PropertiedEntity, public feasst::TypedEntity, public feasst::SpatialEntity

Particles may be a collection of sites (anisotropic) or a single site (isotropic).

The position of a site is often used as its “center” with respect to whole-particle operations such as the following:

  1. distance-based particle cut-off methods

  2. wrapping positions about periodic boundary conditions

  3. rigid rotation of the particle

Each site has its own position which is not relative to the position of the particle. Reference sites may be stored optionally.

Sites

Sites of the particle.

void add(Site site)

Add a Site to the Particle.

const Site &site(const int index) const

Return a site for a given index.

void set_site(const int index, const Site &site)

Set the site of a given index.

const std::vector<Site> &sites() const

Return the sites.

int num_sites() const

Return the number of Sites.

void remove_site(const int index)

Remove a particular site by its index.

Typing

Site types and checks

bool is_isotropic()

Return true if the particle is isotropic (e.g., 1 or less sites)

void set_site_physical(const int site, const bool physical)

Set a site as physical/nonphysical.

void check()

Check that the dimensionality of the site and particle positions match.

void increment_site_types(const int increment)

Increment the types of the sites.

void remove_non_unique_types()

Remove sites and bonds which are of the same type as a previous one.

void set_site_type(const int site, const int type)

Set the site type.

int num_sites_of_type(const int type) const

Return the number of sites of a given type.

Movement

Move the sites and the particle.

void displace(const Position &displacement)

Displace the Particle. This also displaces the Sites.

void replace_position(const Particle &particle)

Swap the positions of particle with self.

void replace_position(const int site_index, const Position &replacement)

Replace the position of site by index.

Position average_site_position() const

Return the average of the site positions.

void set_position_as_center()

Set the particle position as the average of site positions.

Properties

Change the properties of the sites in the particle

void replace_properties(const int site_index, const Properties &replacement, const std::vector<std::string> &exclude)

Replace the properties of site by index.

void add_site_property(const std::string name, const double value, const int site_index)

Add the property of a site.

void add_or_set_site_property(const std::string name, const double value, const int site_index)

Add or set the property of a site.

void set_site_property(const std::string name, const double value, const int site_index)

Set the property of a site.

Bonds

Bonds between two sites in the particle

int num_bonds() const

Return the number of bonds.

const Bond &bond(const int index) const

Return the bond by index.

const std::vector<Bond> bonds() const

Return the bonds.

void add_bond(const Bond &bond)

Add a bond.

void add_bond_property(const int bond, const std::string name, const double value)

Add a property to a bond.

void erase_bonds()

Erase all bonds from particle.

const Bond &bond(const int site_index1, const int site_index2) const

Find the bond between the given site indices.

Angles

Angles between three sites in the particle

int num_angles() const

Return the number of angles.

const Angle &angle(const int index) const

Return the angle by index.

const std::vector<Angle> angles() const

Return the angles.

void add_angle(const Angle &angle)

Add an angle.

void add_angle_property(const int angle, const std::string name, const double value)

Add a property to a bond.

const Angle &angle(const int site_index1, const int site_index2, const int site_index3) const

Find the angle between given sites 1-2-3, with 2 as the vertex.