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.

  • CORSE_GRAIN = = 1 -

    Corse-grained atom are composed of more than one element: CH3 groups, amino-acids are corse-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.

const float & mass() const

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

const float & charge() const

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

const AtomType & type() const

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

void name(const std::string & n)

Set the atom name.

void mass(float m)

Set the atom mass.

void charge(float c)

Set the atom charge.

void 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.