Atoms and atomic informationsΒΆ

class chemfiles::Atom

An Atom is a particle in the current Frame. It can be used to store and retrieve informations about a particle, such as mass, name, atomic number, etc.

Public Type

AtomType enum

An Atom can be of various kind. This is encoded by a value in this enum.

Values:

  • ELEMENT = = 0 -

    Element from the periodic table of elements.

  • COARSE_GRAINED = = 1 -

    Coarse-grained atom are composed of more than one element: CH3 groups, amino-acids are coarse-grained atoms.

  • DUMMY = = 2 -

    Dummy site, with no physical reality.

  • UNDEFINED = = 3 -

    Undefined atom-type.

Public Functions

Atom(const std::string & name)

Create an element from its name.

Atom(AtomType type, const std::string & name = "")

Create an element from its name and its type.

Atom()

Default is to create an UNDEFINED atom type with no name.

const std::string & name() const

Get a const (non-modifiable) reference to the atom name.

float mass() const

Get the atom mass.

float charge() const

Get the atom charge.

AtomType type() const

Get the atom type.

void set_name(const std::string & n)

Set the atom name.

void set_mass(float m)

Set the atom mass.

void set_charge(float c)

Set the atom charge.

void set_type(AtomType t)

Set the atom type.

std::string full_name() const

Try to get the full element name, return and empty string if this is impossible.

float vdw_radius() const

Try to get the Van der Waals of the atom. Returns -1 if it can not be found.

float covalent_radius() const

Try to get the covalent radius of the atom. Returns -1 if it can not be found.

int atomic_number() const

Try to get the atomic number, if defined. Returns -1 if it can not be found.