/** \file element.cpp * * Function implementations for the class element. * */ // include config.h #ifdef HAVE_CONFIG_H #include #endif #include "Helpers/MemDebug.hpp" #include #include #include "element.hpp" using namespace std; /************************************* Functions for class element **********************************/ /** Constructor of class element. */ element::element() : mass(0), CovalentRadius(0), VanDerWaalsRadius(0), Z(-1), Valence(0), NoValenceOrbitals(0) { }; element::element(const element &src) : mass(src.mass), CovalentRadius(src.CovalentRadius), VanDerWaalsRadius(src.VanDerWaalsRadius), Z(src.Z), Valence(src.Valence), NoValenceOrbitals(src.NoValenceOrbitals), name(src.name), symbol(src.symbol) { strncpy(period,src.period,strfield_length+1); strncpy(group,src.group,strfield_length+1); strncpy(block,src.block,strfield_length+1); } /** Destructor of class element. */ element::~element() {}; element &element::operator=(const element &src){ if(this!=&src){ mass=src.mass; CovalentRadius=src.CovalentRadius; VanDerWaalsRadius=src.VanDerWaalsRadius; Z=src.Z; Valence=src.Valence; NoValenceOrbitals=src.NoValenceOrbitals; name=src.name; symbol=src.symbol; strncpy(period,src.period,strfield_length+1); strncpy(group,src.group,strfield_length+1); strncpy(block,src.block,strfield_length+1); } return *this; } /** Prints element data to \a *out. * \param *out outstream */ bool element::Output(ostream * const out) const { if (out != NULL) { *out << name << "\t" << symbol << "\t" << period << "\t" << group << "\t" << block << "\t" << Z << "\t" << mass << "\t" << CovalentRadius << "\t" << VanDerWaalsRadius << endl; //*out << Z << "\t" << fixed << setprecision(11) << showpoint << mass << "g/mol\t" << name << "\t" << symbol << "\t" << endl; return true; } else return false; }; /** Prints element data to \a *out. * \param *out outstream * \param No cardinal number of element * \param NoOfAtoms total number of atom of this element type */ bool element::Checkout(ostream * const out, const int Number, const int NoOfAtoms) const { if (out != NULL) { *out << "Ion_Type" << Number << "\t" << NoOfAtoms << "\t" << Z << "\t1.0\t3\t3\t" << fixed << setprecision(11) << showpoint << mass << "\t" << name << "\t" << symbol <