Changes in src/periodentafel.cpp [61745cc:389cc8]
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
src/periodentafel.cpp
r61745cc r389cc8 4 4 * 5 5 */ 6 7 #include "Helpers/MemDebug.hpp" 6 8 7 9 using namespace std; … … 30 32 periodentafel::periodentafel() 31 33 { 32 bool status = true; 33 status = LoadElementsDatabase(new stringstream(elementsDB,ios_base::in)); 34 ASSERT(status, "General element initialization failed"); 35 status = LoadValenceDatabase(new stringstream(valenceDB,ios_base::in)); 36 ASSERT(status, "Valence entry of element initialization failed"); 37 status = LoadOrbitalsDatabase(new stringstream(orbitalsDB,ios_base::in)); 38 ASSERT(status, "Orbitals entry of element initialization failed"); 39 status = LoadHBondAngleDatabase(new stringstream(HbondangleDB,ios_base::in)); 40 ASSERT(status, "HBond angle entry of element initialization failed"); 41 status = LoadHBondLengthsDatabase(new stringstream(HbonddistanceDB,ios_base::in)); 42 ASSERT(status, "HBond distance entry of element initialization failed"); 34 { 35 stringstream input(elementsDB,ios_base::in); 36 bool status = LoadElementsDatabase(&input); 37 ASSERT(status, "General element initialization failed"); 38 } 39 { 40 stringstream input(valenceDB,ios_base::in); 41 bool status = LoadValenceDatabase(&input); 42 ASSERT(status, "Valence entry of element initialization failed"); 43 } 44 { 45 stringstream input(orbitalsDB,ios_base::in); 46 bool status = LoadOrbitalsDatabase(&input); 47 ASSERT(status, "Orbitals entry of element initialization failed"); 48 } 49 { 50 stringstream input(HbondangleDB,ios_base::in); 51 bool status = LoadHBondAngleDatabase(&input); 52 ASSERT(status, "HBond angle entry of element initialization failed"); 53 } 54 { 55 stringstream input(HbonddistanceDB,ios_base::in); 56 bool status = LoadHBondLengthsDatabase(&input); 57 ASSERT(status, "HBond distance entry of element initialization failed"); 58 } 43 59 }; 44 60 … … 109 125 * \return pointer to element 110 126 */ 111 element * const periodentafel::FindElement(const char * constshorthand) const127 element * const periodentafel::FindElement(const string &shorthand) const 112 128 { 113 129 element *res = 0; … … 195 211 }; 196 212 197 /** Prints period table to given stream.198 * \param *output output stream199 * \param *checkliste elements table for this molecule200 */201 bool periodentafel::Checkout(ostream * const output, const int * const checkliste) const202 {203 bool result = true;204 int No = 1;205 206 if (output != NULL) {207 *output << "# Ion type data (PP = PseudoPotential, Z = atomic number)" << endl;208 *output << "#Ion_TypeNr.\tAmount\tZ\tRGauss\tL_Max(PP)L_Loc(PP)IonMass\t# chemical name, symbol" << endl;209 for(const_iterator iter=elements.begin(); iter!=elements.end();++iter){210 if (((*iter).first < MAX_ELEMENTS) && (checkliste[(*iter).first])) {211 (*iter).second->No = No;212 result = result && (*iter).second->Checkout(output, No++, checkliste[(*iter).first]);213 }214 }215 return result;216 } else217 return false;218 };219 220 213 /** Loads element list from file. 221 214 * \param *path to to standard file names … … 331 324 ASSERT(Elemental != NULL, "element should be present but is not??"); 332 325 *Elemental = *neues; 326 delete(neues); 327 neues = Elemental; 333 328 } else { 334 329 InserterTest = elements.insert(pair <atomicNumber_t,element*> (neues->getNumber(), neues)); … … 371 366 (*input) >> elements[Z]->Valence; 372 367 (*input) >> ws; 373 //Log() << Verbose(3) << "Element " << (int)tmp << " has " << FindElement((int)tmp)->Valence << " valence electrons." << endl;368 //Log() << Verbose(3) << "Element " << Z << " has " << FindElement(Z)->Valence << " valence electrons." << endl; 374 369 } 375 370 return true; … … 394 389 (*input) >> elements[Z]->NoValenceOrbitals; 395 390 (*input) >> ws; 396 //Log() << Verbose(3) << "Element " << (int)tmp << " has " << FindElement((int)tmp)->NoValenceOrbitals << " number of singly occupied valence orbitals." << endl;391 //Log() << Verbose(3) << "Element " << Z << " has " << FindElement(Z)->NoValenceOrbitals << " number of singly occupied valence orbitals." << endl; 397 392 } 398 393 return true;
Note:
See TracChangeset
for help on using the changeset viewer.