source: molecuilder/src/element.cpp@ 031ec24

Last change on this file since 031ec24 was 828556, checked in by Frederik Heber <heber@…>, 16 years ago

FIX: constructor of element now is shortened and all its member variables initialized (thx to BondGraphUnitTest).

  • Property mode set to 100755
File size: 1.6 KB
RevLine 
[a0bcf1]1/** \file element.cpp
2 *
3 * Function implementations for the class element.
4 *
5 */
6
[4dca8e]7#include <iomanip>
8#include <fstream>
9
10#include "element.hpp"
[a0bcf1]11
12/************************************* Functions for class element **********************************/
13
14/** Constructor of class element.
15 */
[828556]16element::element() :
17 mass(0),
18 CovalentRadius(0),
19 VanDerWaalsRadius(0),
20 Z(-1),
21 previous(NULL),
22 next(NULL),
23 sort(NULL),
24 No(-1),
25 Valence(0),
26 NoValenceOrbitals(0)
27{
[51483b]28};
[a0bcf1]29
30/** Destructor of class element.
31 */
32element::~element() {};
33
34/** Prints element data to \a *out.
35 * \param *out outstream
36 */
[543ce4]37bool element::Output(ofstream * const out) const
[a0bcf1]38{
[a048fa]39 if (out != NULL) {
40 *out << name << "\t" << symbol << "\t" << period << "\t" << group << "\t" << block << "\t" << Z << "\t" << mass << "\t" << CovalentRadius << "\t" << VanDerWaalsRadius << endl;
41 //*out << Z << "\t" << fixed << setprecision(11) << showpoint << mass << "g/mol\t" << name << "\t" << symbol << "\t" << endl;
42 return true;
43 } else
44 return false;
[a0bcf1]45};
46
47/** Prints element data to \a *out.
48 * \param *out outstream
[a048fa]49 * \param No cardinal number of element
[a0bcf1]50 * \param NoOfAtoms total number of atom of this element type
51 */
[543ce4]52bool element::Checkout(ofstream * const out, const int Number, const int NoOfAtoms) const
[a0bcf1]53{
[a048fa]54 if (out != NULL) {
55 *out << "Ion_Type" << Number << "\t" << NoOfAtoms << "\t" << Z << "\t1.0\t3\t3\t" << fixed << setprecision(11) << showpoint << mass << "\t" << name << "\t" << symbol <<endl;
56 return true;
57 } else
58 return false;
[a0bcf1]59};
Note: See TracBrowser for help on using the repository browser.