Atoms

class chemfiles::Atom

An `Atom` is a particle in the current `Frame`.

An atom stores the following atomic properties:

  • atom name;
  • atom type;
  • atom mass;
  • atom charge.

The atom name is usually an unique identifier (“H1”, “C_a”) while the atom type will be shared between all particles of the same type: “H”, “Ow”, “CH3”.

Public Functions

Atom(std::string name = "")

Create an atom with the given `name` and set the atom `type` to be the same as `name`.

Atom(std::string name, std::string type)

Create an atom from the given `name` and `type`.

const std::string &name() const

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

const std::string &type() const

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

double mass() const

Get the atom mass.

double charge() const

Get the atom charge.

void set_type(std::string type)

Set the atom type.

void set_name(std::string name)

Set the atom name.

void set_mass(double mass)

Set the atom mass.

void set_charge(double charge)

Set the atom charge.

std::string full_name() const

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

double vdw_radius() const

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

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