Changes in src/config.cpp [49e1ae:58ed4a]
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
TabularUnified src/config.cpp ¶
r49e1ae r58ed4a 19 19 #include "molecule.hpp" 20 20 #include "periodentafel.hpp" 21 #include "World.hpp" 21 22 22 23 /******************************** Functions for class ConfigFileBuffer **********************/ … … 73 74 file= new ifstream(filename); 74 75 if (file == NULL) { 75 eLog() << Verbose(1) << "config file " << filename << " missing!" << endl;76 DoeLog(1) && (eLog()<< Verbose(1) << "config file " << filename << " missing!" << endl); 76 77 return; 77 78 } … … 88 89 // allocate buffer's 1st dimension 89 90 if (buffer != NULL) { 90 eLog() << Verbose(1) << "FileBuffer->buffer is not NULL!" << endl;91 DoeLog(1) && (eLog()<< Verbose(1) << "FileBuffer->buffer is not NULL!" << endl); 91 92 return; 92 93 } else … … 143 144 map<const char *, int, IonTypeCompare> IonTypeLineMap; 144 145 if (LineMapping == NULL) { 145 eLog() << Verbose(0) << "map pointer is NULL: " << LineMapping << endl;146 DoeLog(0) && (eLog()<< Verbose(0) << "map pointer is NULL: " << LineMapping << endl); 146 147 performCriticalExit(); 147 148 return; … … 159 160 LineMapping[CurrentLine+(nr++)] = runner->second; 160 161 else { 161 eLog() << Verbose(0) << "config::MapIonTypesInBuffer - NoAtoms is wrong: We are past the end of the file!" << endl;162 DoeLog(0) && (eLog()<< Verbose(0) << "config::MapIonTypesInBuffer - NoAtoms is wrong: We are past the end of the file!" << endl); 162 163 performCriticalExit(); 163 164 } … … 499 500 // case 'j': // BoxLength 500 501 // Log() << Verbose(0) << "enter lower triadiagonalo form of basis matrix" << endl << endl; 502 // double * const cell_size = World::get()->cell_size; 501 503 // for (int i=0;i<6;i++) { 502 504 // Log() << Verbose(0) << "Cell size" << i << ": "; 503 // cin >> mol->cell_size[i];505 // cin >> cell_size[i]; 504 506 // } 505 507 // break; … … 657 659 { 658 660 if (FileBuffer != NULL) { 659 eLog() << Verbose(2) << "deleting present FileBuffer in PrepareFileBuffer()." << endl;661 DoeLog(2) && (eLog()<< Verbose(2) << "deleting present FileBuffer in PrepareFileBuffer()." << endl); 660 662 delete(FileBuffer); 661 663 } … … 683 685 684 686 if (mol == NULL) { 685 eLog() << Verbose(0) << "Molecule is not allocated in LoadMolecule(), exit.";687 DoeLog(0) && (eLog()<< Verbose(0) << "Molecule is not allocated in LoadMolecule(), exit."); 686 688 performCriticalExit(); 687 689 } … … 689 691 ParseForParameter(verbose,FileBuffer,"MaxTypes", 0, 1, 1, int_type, &(MaxTypes), 1, critical); 690 692 if (MaxTypes == 0) { 691 eLog() << Verbose(0) << "There are no atoms according to MaxTypes in this config file." << endl;692 performCriticalExit();693 DoeLog(1) && (eLog()<< Verbose(1) << "There are no atoms according to MaxTypes in this config file." << endl); 694 //performCriticalExit(); 693 695 } else { 694 696 // prescan number of ions per type … … 708 710 sprintf(name,"Ion_Type%i",MaxTypes); 709 711 if (!ParseForParameter(verbose,FileBuffer, (const char*)name, 1, 1, 1, int_type, &value[0], 1, critical)) { 710 eLog() << Verbose(0) << "There are no atoms in the config file!" << endl;712 DoeLog(0) && (eLog()<< Verbose(0) << "There are no atoms in the config file!" << endl); 711 713 performCriticalExit(); 712 714 return; … … 853 855 ifstream *file = new ifstream(filename); 854 856 if (file == NULL) { 855 eLog() << Verbose(1) << "config file " << filename << " missing!" << endl;857 DoeLog(1) && (eLog()<< Verbose(1) << "config file " << filename << " missing!" << endl); 856 858 return; 857 859 } … … 965 967 // Unit cell and magnetic field 966 968 ParseForParameter(verbose,FileBuffer, "BoxLength", 0, 3, 3, lower_trigrid, BoxLength, 1, critical); /* Lattice->RealBasis */ 967 mol->cell_size[0] = BoxLength[0]; 968 mol->cell_size[1] = BoxLength[3]; 969 mol->cell_size[2] = BoxLength[4]; 970 mol->cell_size[3] = BoxLength[6]; 971 mol->cell_size[4] = BoxLength[7]; 972 mol->cell_size[5] = BoxLength[8]; 969 double * const cell_size = World::get()->cell_size; 970 cell_size[0] = BoxLength[0]; 971 cell_size[1] = BoxLength[3]; 972 cell_size[2] = BoxLength[4]; 973 cell_size[3] = BoxLength[6]; 974 cell_size[4] = BoxLength[7]; 975 cell_size[5] = BoxLength[8]; 973 976 //if (1) fprintf(stderr,"\n"); 974 977 … … 1062 1065 Log() << Verbose(0) << "Bond length table loaded successfully." << endl; 1063 1066 } else { 1064 eLog() << Verbose(1) << "Bond length table loading failed." << endl;1067 DoeLog(1) && (eLog()<< Verbose(1) << "Bond length table loading failed." << endl); 1065 1068 } 1066 1069 } … … 1091 1094 ifstream *file = new ifstream(filename); 1092 1095 if (file == NULL) { 1093 eLog() << Verbose(1) << "config file " << filename << " missing!" << endl;1096 DoeLog(1) && (eLog()<< Verbose(1) << "config file " << filename << " missing!" << endl); 1094 1097 return; 1095 1098 } … … 1169 1172 1170 1173 ParseForParameter(verbose,file, "BoxLength", 0, 3, 3, lower_trigrid, BoxLength, 1, critical); /* Lattice->RealBasis */ 1171 mol->cell_size[0] = BoxLength[0]; 1172 mol->cell_size[1] = BoxLength[3]; 1173 mol->cell_size[2] = BoxLength[4]; 1174 mol->cell_size[3] = BoxLength[6]; 1175 mol->cell_size[4] = BoxLength[7]; 1176 mol->cell_size[5] = BoxLength[8]; 1174 double * const cell_size = World::get()->cell_size; 1175 cell_size[0] = BoxLength[0]; 1176 cell_size[1] = BoxLength[3]; 1177 cell_size[2] = BoxLength[4]; 1178 cell_size[3] = BoxLength[6]; 1179 cell_size[4] = BoxLength[7]; 1180 cell_size[5] = BoxLength[8]; 1177 1181 if (1) fprintf(stderr,"\n"); 1178 1182 config::DoPerturbation = 0; … … 1312 1316 // bring MaxTypes up to date 1313 1317 mol->CountElements(); 1318 const double * const cell_size = World::get()->cell_size; 1314 1319 ofstream * const output = new ofstream(filename, ios::out); 1315 1320 if (output != NULL) { … … 1382 1387 *output << endl; 1383 1388 *output << "BoxLength\t\t\t# (Length of a unit cell)" << endl; 1384 *output << mol->cell_size[0] << "\t" << endl;1385 *output << mol->cell_size[1] << "\t" << mol->cell_size[2] << "\t" << endl;1386 *output << mol->cell_size[3] << "\t" << mol->cell_size[4] << "\t" << mol->cell_size[5] << "\t" << endl;1389 *output << cell_size[0] << "\t" << endl; 1390 *output << cell_size[1] << "\t" << cell_size[2] << "\t" << endl; 1391 *output << cell_size[3] << "\t" << cell_size[4] << "\t" << cell_size[5] << "\t" << endl; 1387 1392 // FIXME 1388 1393 *output << endl; … … 1428 1433 return result; 1429 1434 } else { 1430 eLog() << Verbose(1) << "Cannot open output file:" << filename << endl;1435 DoeLog(1) && (eLog()<< Verbose(1) << "Cannot open output file:" << filename << endl); 1431 1436 return false; 1432 1437 } … … 1450 1455 output = new ofstream(fname->str().c_str(), ios::out); 1451 1456 if (output == NULL) { 1452 eLog() << Verbose(1) << "Cannot open mpqc output file:" << fname << endl;1457 DoeLog(1) && (eLog()<< Verbose(1) << "Cannot open mpqc output file:" << fname << endl); 1453 1458 delete(fname); 1454 1459 return false; … … 1493 1498 output = new ofstream(fname->str().c_str(), ios::out); 1494 1499 if (output == NULL) { 1495 eLog() << Verbose(1) << "Cannot open mpqc hessian output file:" << fname << endl;1500 DoeLog(1) && (eLog()<< Verbose(1) << "Cannot open mpqc hessian output file:" << fname << endl); 1496 1501 delete(fname); 1497 1502 return false; … … 1549 1554 f = fopen(name, "w" ); 1550 1555 if (f == NULL) { 1551 eLog() << Verbose(1) << "Cannot open pdb output file:" << name << endl;1556 DoeLog(1) && (eLog()<< Verbose(1) << "Cannot open pdb output file:" << name << endl); 1552 1557 return false; 1553 1558 } … … 1604 1609 f = fopen(name, "w" ); 1605 1610 if (f == NULL) { 1606 eLog() << Verbose(1) << "Cannot open pdb output file:" << name << endl;1611 DoeLog(1) && (eLog()<< Verbose(1) << "Cannot open pdb output file:" << name << endl); 1607 1612 Free(&elementNo); 1608 1613 return false; … … 1641 1646 /** Stores all atoms in a TREMOLO data input file. 1642 1647 * Note that this format cannot be parsed again. 1648 * Note that TREMOLO does not like Id starting at 0, but at 1. Atoms with Id 0 are discarded! 1643 1649 * \param *filename name of file (without ".in" suffix!) 1644 1650 * \param *mol pointer to molecule … … 1653 1659 output = new ofstream(fname->str().c_str(), ios::out); 1654 1660 if (output == NULL) { 1655 eLog() << Verbose(1) << "Cannot open tremolo output file:" << fname << endl;1661 DoeLog(1) && (eLog()<< Verbose(1) << "Cannot open tremolo output file:" << fname << endl); 1656 1662 delete(fname); 1657 1663 return false; … … 1695 1701 /** Stores all atoms from all molecules in a TREMOLO data input file. 1696 1702 * Note that this format cannot be parsed again. 1703 * Note that TREMOLO does not like Id starting at 0, but at 1. Atoms with Id 0 are discarded! 1697 1704 * \param *filename name of file (without ".in" suffix!) 1698 1705 * \param *MolList pointer to MoleculeListClass containing all atoms … … 1707 1714 output = new ofstream(fname->str().c_str(), ios::out); 1708 1715 if (output == NULL) { 1709 eLog() << Verbose(1) << "Cannot open tremolo output file:" << fname << endl;1716 DoeLog(1) && (eLog()<< Verbose(1) << "Cannot open tremolo output file:" << fname << endl); 1710 1717 delete(fname); 1711 1718 return false; … … 1747 1754 while (Walker->next != (*MolWalker)->end) { 1748 1755 Walker = Walker->next; 1749 *output << AtomNo << "\t";1756 *output << AtomNo+1 << "\t"; 1750 1757 *output << Walker->Name << "\t"; 1751 1758 *output << (*MolWalker)->name << "\t"; 1752 *output << MolCounter << "\t";1759 *output << MolCounter+1 << "\t"; 1753 1760 *output << Walker->node->x[0] << "\t" << Walker->node->x[1] << "\t" << Walker->node->x[2] << "\t"; 1754 1761 *output << (double)Walker->type->Valence << "\t"; 1755 1762 *output << Walker->type->symbol << "\t"; 1756 1763 for (BondList::iterator runner = Walker->ListOfBonds.begin(); runner != Walker->ListOfBonds.end(); runner++) 1757 *output << LocalNotoGlobalNoMap[MolCounter][ (*runner)->GetOtherAtom(Walker)->nr ] << "\t";1764 *output << LocalNotoGlobalNoMap[MolCounter][ (*runner)->GetOtherAtom(Walker)->nr ]+1 << "\t"; 1758 1765 for(int i=Walker->ListOfBonds.size(); i < MaxNeighbours; i++) 1759 1766 *output << "-\t";
Note:
See TracChangeset
for help on using the changeset viewer.