Skip to content

DetermineElementType

dstoeckel edited this page Mar 16, 2015 · 2 revisions

How can I determine the element type of an atom (i.e., C, N, ...)?

Determining an atom's type is trivial with the help of the class PTE:

#include <BALL/KERNEL/PTE.h>

if (atom.getElement() == PTE[Element::C])
{
  std::cout << "This is a carbon atom!" << std::endl;

  // the next line should print
  // Element symbol: C
  std::cout << "Element symbol: " << atom.getElement().getSymbol() << std::endl;
}
Clone this wiki locally