Particle

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

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.

Other

Other utility functions for particles

double max_distance() const

Return the maximum distance of a site from the origin.

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.

Properties

Change the properties of the sites in the particle

void replace_properties(const int site_index, const Properties &replacement)

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 add_bond_model(const int bond, const std::string model)

Add bond model.

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.

const std::vector<int> &bond_neighbors(const int site) const

List the site indices bonded to the given site.

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.

void add_angle_model(const int angle, const std::string model)

Add angle model.

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.

const std::vector<std::vector<int>> &angle_neighbors(const int site) const

List the site indices that form angles with the given site.

Dihedrals

Dihedrals between four sites in the particle

int num_dihedrals() const

Return the number of dihedrals.

const Dihedral &dihedral(const int index) const

Return the dihedral by index.

const std::vector<Dihedral> dihedrals() const

Return the dihedrals.

void add_dihedral(const Dihedral &dihedral)

Add a dihedral.

void add_dihedral_property(const int dihedral, const std::string name, const double value)

Add a property to a bond.

void add_dihedral_model(const int dihedral, const std::string model)

Add dihedral model.

const Dihedral &dihedral(const int site_index1, const int site_index2, const int site_index3, const int site_index4) const

Find the dihedral between given sites 1-2-3-4.

const std::vector<std::vector<int>> &dihedral_neighbors(const int site) const

List the site indices that form dihedrals with the given site.