| Last change
 on this file since 08e223 was             51483b, checked in by Frederik Heber <heber@…>, 17 years ago | 
        
          | 
Some sensible starting values for element class construct
 | 
        
          | 
              
Property                 mode
 set to                 100644 | 
        
          | File size:
            1.4 KB | 
      
      
| Line |  | 
|---|
| 1 | /** \file element.cpp | 
|---|
| 2 | * | 
|---|
| 3 | * Function implementations for the class element. | 
|---|
| 4 | * | 
|---|
| 5 | */ | 
|---|
| 6 |  | 
|---|
| 7 | #include "molecules.hpp" | 
|---|
| 8 |  | 
|---|
| 9 | /************************************* Functions for class element **********************************/ | 
|---|
| 10 |  | 
|---|
| 11 | /** Constructor of class element. | 
|---|
| 12 | */ | 
|---|
| 13 | element::element() { | 
|---|
| 14 | Z = -1; | 
|---|
| 15 | No = -1; | 
|---|
| 16 | previous = NULL; | 
|---|
| 17 | next = NULL; | 
|---|
| 18 | sort = NULL; | 
|---|
| 19 | }; | 
|---|
| 20 |  | 
|---|
| 21 | /** Destructor of class element. | 
|---|
| 22 | */ | 
|---|
| 23 | element::~element() {}; | 
|---|
| 24 |  | 
|---|
| 25 | /** Prints element data to \a *out. | 
|---|
| 26 | * \param *out outstream | 
|---|
| 27 | */ | 
|---|
| 28 | bool element::Output(ofstream *out) const | 
|---|
| 29 | { | 
|---|
| 30 | if (out != NULL) { | 
|---|
| 31 | *out << name << "\t" << symbol << "\t" << period << "\t" << group << "\t" << block << "\t" << Z << "\t" << mass << "\t" << CovalentRadius << "\t" << VanDerWaalsRadius << endl; | 
|---|
| 32 | //*out << Z << "\t"  << fixed << setprecision(11) << showpoint << mass << "g/mol\t" << name << "\t" << symbol << "\t" << endl; | 
|---|
| 33 | return true; | 
|---|
| 34 | } else | 
|---|
| 35 | return false; | 
|---|
| 36 | }; | 
|---|
| 37 |  | 
|---|
| 38 | /** Prints element data to \a *out. | 
|---|
| 39 | * \param *out outstream | 
|---|
| 40 | * \param No  cardinal number of element | 
|---|
| 41 | * \param NoOfAtoms total number of atom of this element type | 
|---|
| 42 | */ | 
|---|
| 43 | bool element::Checkout(ofstream *out, const int No, const int NoOfAtoms) const | 
|---|
| 44 | { | 
|---|
| 45 | if (out != NULL) { | 
|---|
| 46 | *out << "Ion_Type" << No << "\t" << NoOfAtoms << "\t" << Z << "\t1.0\t3\t3\t" << fixed << setprecision(11) << showpoint << mass << "\t" << name << "\t" << symbol <<endl; | 
|---|
| 47 | return true; | 
|---|
| 48 | } else | 
|---|
| 49 | return false; | 
|---|
| 50 | }; | 
|---|
       
      
  Note:
 See   
TracBrowser
 for help on using the repository browser.