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
Line 
1/** \file element.cpp
2 *
3 * Function implementations for the class element.
4 *
5 */
6
7#include <iomanip>
8#include <fstream>
9
10#include "element.hpp"
11
12/************************************* Functions for class element **********************************/
13
14/** Constructor of class element.
15 */
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{
28};
29
30/** Destructor of class element.
31 */
32element::~element() {};
33
34/** Prints element data to \a *out.
35 * \param *out outstream
36 */
37bool element::Output(ofstream * const out) const
38{
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;
45};
46
47/** Prints element data to \a *out.
48 * \param *out outstream
49 * \param No cardinal number of element
50 * \param NoOfAtoms total number of atom of this element type
51 */
52bool element::Checkout(ofstream * const out, const int Number, const int NoOfAtoms) const
53{
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;
59};
Note: See TracBrowser for help on using the repository browser.