/* * element.hpp * * Created on: Aug 3, 2009 * Author: heber */ #ifndef ELEMENT_HPP_ #define ELEMENT_HPP_ /*********************************************** includes ***********************************/ // include config.h #ifdef HAVE_CONFIG_H #include #endif #include #include #include "types.hpp" #include "boost/serialization/array.hpp" #include "boost/serialization/string.hpp" class periodentafel; /********************************************** declarations *******************************/ /** Chemical element. * Class incorporates data for a certain chemical element to be referenced from atom class. */ class element { friend class periodentafel; public: element(); element(const element&); ~element(); element &operator=(const element&); // accessor functions atomicNumber_t getNumber() const; double getMass() const; const unsigned char *getColor() const; double getCovalentRadius() const; double getElectronegativity() const; double getVanDerWaalsRadius() const; int getAtomicNumber() const; double getValence() const; int getNoValenceOrbitals() const; double getHBondDistance(const size_t i) const; double getHBondAngle(const size_t i) const; const std::string &getSymbol() const; void setSymbol(const std::string &temp); const std::string &getName() const; void setName(const std::string &temp); //> print element entries to screen bool Output(std::ostream * const out) const; bool Checkout(std::ostream * const out, const int No, const int NoOfAtoms) const; bool operator==(const element &other) const; bool operator!=(const element &other) const { return !(*this == other); } private: friend class boost::serialization::access; // serialization template void serialize(Archive & ar, const unsigned int version) { ar & mass; ar & CovalentRadius; ar & Electronegativity; ar & VanDerWaalsRadius; ar & Z; ar & period; ar & group; ar & block; ar & Valence; ar & NoValenceOrbitals; ar & boost::serialization::make_array(HBondDistance, 3); ar & boost::serialization::make_array(HBondAngle, 3); ar & boost::serialization::make_array(color, 3); ar & name; ar & symbol; } double mass; //!< mass in g/mol double CovalentRadius; //!< covalent radius double Electronegativity; //!< electronegativity in Pauling units double VanDerWaalsRadius; //!< can-der-Waals radius int Z; //!< atomic number std::string period; //!< period: n quantum number std::string group; //!< group: l quantum number std::string block; //!< block: l quantum number double Valence; //!< number of valence electrons for this element int NoValenceOrbitals; //!< number of valence orbitals, used for determining bond degree in molecule::CreateConnectmatrix() double HBondDistance[3]; //!< distance in Angstrom of this element to hydrogen (for single, double and triple bonds) double HBondAngle[3]; //!< typical angle for one, two, three bonded hydrogen (in degrees) unsigned char color[3]; //!< typical color for this element (from Jmol) std::string name; //!< atom name, i.e. "Hydrogen" std::string symbol; //!< short form of the atom, i.e. "H" }; std::ostream &operator<<(std::ostream&,const element&); #endif /* ELEMENT_HPP_ */