Changes in src/config.cpp [a67d19:4fc93f]
- File:
-
- 1 edited
-
src/config.cpp (modified) (47 diffs)
Legend:
- Unmodified
- Added
- Removed
-
src/config.cpp
ra67d19 r4fc93f 6 6 7 7 #include <stdio.h> 8 #include <cstring>9 8 10 9 #include "atom.hpp" … … 19 18 #include "molecule.hpp" 20 19 #include "periodentafel.hpp" 21 #include "World.hpp"22 20 23 21 /******************************** Functions for class ConfigFileBuffer **********************/ … … 29 27 char number1[8]; 30 28 char number2[8]; 31 c onst char *dummy1, *dummy2;29 char *dummy1, *dummy2; 32 30 //Log() << Verbose(0) << s1 << " " << s2 << endl; 33 31 dummy1 = strchr(s1, '_')+sizeof(char)*5; // go just after "Ion_Type" … … 74 72 file= new ifstream(filename); 75 73 if (file == NULL) { 76 DoeLog(1) && (eLog()<< Verbose(1) << "config file " << filename << " missing!" << endl);74 eLog() << Verbose(1) << "config file " << filename << " missing!" << endl; 77 75 return; 78 76 } … … 85 83 file->clear(); 86 84 file->seekg(file_position, ios::beg); 87 DoLog(1) && (Log() << Verbose(1) << NoLines-1 << " lines were recognized." << endl);85 Log() << Verbose(1) << NoLines-1 << " lines were recognized." << endl; 88 86 89 87 // allocate buffer's 1st dimension 90 88 if (buffer != NULL) { 91 DoeLog(1) && (eLog()<< Verbose(1) << "FileBuffer->buffer is not NULL!" << endl);89 eLog() << Verbose(1) << "FileBuffer->buffer is not NULL!" << endl; 92 90 return; 93 91 } else … … 105 103 lines++; 106 104 } while((!file->eof()) && (lines < NoLines)); 107 DoLog(1) && (Log() << Verbose(1) << lines-1 << " lines were read into the buffer." << endl);105 Log() << Verbose(1) << lines-1 << " lines were read into the buffer." << endl; 108 106 109 107 // close and exit … … 142 140 void ConfigFileBuffer::MapIonTypesInBuffer(const int NoAtoms) 143 141 { 144 map<const char *, int, IonTypeCompare> IonTypeLineMap;142 map<const char *, int, IonTypeCompare> LineList; 145 143 if (LineMapping == NULL) { 146 DoeLog(0) && (eLog()<< Verbose(0) << "map pointer is NULL: " << LineMapping << endl);144 eLog() << Verbose(0) << "map pointer is NULL: " << LineMapping << endl; 147 145 performCriticalExit(); 148 146 return; … … 151 149 // put all into hashed map 152 150 for (int i=0; i<NoAtoms; ++i) { 153 IonTypeLineMap.insert(pair<const char *, int> (buffer[CurrentLine+i], CurrentLine+i));151 LineList.insert(pair<const char *, int> (buffer[CurrentLine+i], CurrentLine+i)); 154 152 } 155 153 156 154 // fill map 157 155 int nr=0; 158 for (map<const char *, int, IonTypeCompare>::iterator runner = IonTypeLineMap.begin(); runner != IonTypeLineMap.end(); ++runner) {156 for (map<const char *, int, IonTypeCompare>::iterator runner = LineList.begin(); runner != LineList.end(); ++runner) { 159 157 if (CurrentLine+nr < NoLines) 160 158 LineMapping[CurrentLine+(nr++)] = runner->second; 161 159 else { 162 DoeLog(0) && (eLog()<< Verbose(0) << "config::MapIonTypesInBuffer - NoAtoms is wrong: We are past the end of the file!" << endl);160 eLog() << Verbose(0) << "config::MapIonTypesInBuffer - NoAtoms is wrong: We are past the end of the file!" << endl; 163 161 performCriticalExit(); 164 162 } … … 250 248 Thermostat = None; 251 249 } else { 252 DoLog(1) && (Log() << Verbose(1) << "Warning: " << ThermostatNames[0] << " thermostat not implemented, falling back to None." << endl);250 Log() << Verbose(1) << "Warning: " << ThermostatNames[0] << " thermostat not implemented, falling back to None." << endl; 253 251 Thermostat = None; 254 252 } … … 258 256 ParseForParameter(verbose,fb,"Thermostat", 0, 2, 1, int_type, &ScaleTempStep, 1, critical); // read scaling frequency 259 257 } else { 260 DoLog(1) && (Log() << Verbose(1) << "Warning: " << ThermostatNames[0] << " thermostat not implemented, falling back to None." << endl);258 Log() << Verbose(1) << "Warning: " << ThermostatNames[0] << " thermostat not implemented, falling back to None." << endl; 261 259 Thermostat = None; 262 260 } … … 266 264 ParseForParameter(verbose,fb,"Thermostat", 0, 2, 1, int_type, &ScaleTempStep, 1, critical); // read collision rate 267 265 } else { 268 DoLog(1) && (Log() << Verbose(1) << "Warning: " << ThermostatNames[0] << " thermostat not implemented, falling back to None." << endl);266 Log() << Verbose(1) << "Warning: " << ThermostatNames[0] << " thermostat not implemented, falling back to None." << endl; 269 267 Thermostat = None; 270 268 } … … 274 272 ParseForParameter(verbose,fb,"Thermostat", 0, 2, 1, double_type, &TempFrequency, 1, critical); // read gamma 275 273 if (ParseForParameter(verbose,fb,"Thermostat", 0, 3, 1, double_type, &alpha, 1, optional)) { 276 DoLog(2) && (Log() << Verbose(2) << "Extended Stochastic Thermostat detected with interpolation coefficient " << alpha << "." << endl);274 Log() << Verbose(2) << "Extended Stochastic Thermostat detected with interpolation coefficient " << alpha << "." << endl; 277 275 } else { 278 276 alpha = 1.; 279 277 } 280 278 } else { 281 DoLog(1) && (Log() << Verbose(1) << "Warning: " << ThermostatNames[0] << " thermostat not implemented, falling back to None." << endl);279 Log() << Verbose(1) << "Warning: " << ThermostatNames[0] << " thermostat not implemented, falling back to None." << endl; 282 280 Thermostat = None; 283 281 } … … 287 285 ParseForParameter(verbose,fb,"Thermostat", 0, 2, 1, double_type, &TempFrequency, 1, critical); // read \tau_T 288 286 } else { 289 DoLog(1) && (Log() << Verbose(1) << "Warning: " << ThermostatNames[0] << " thermostat not implemented, falling back to None." << endl);287 Log() << Verbose(1) << "Warning: " << ThermostatNames[0] << " thermostat not implemented, falling back to None." << endl; 290 288 Thermostat = None; 291 289 } … … 296 294 alpha = 0.; 297 295 } else { 298 DoLog(1) && (Log() << Verbose(1) << "Warning: " << ThermostatNames[0] << " thermostat not implemented, falling back to None." << endl);296 Log() << Verbose(1) << "Warning: " << ThermostatNames[0] << " thermostat not implemented, falling back to None." << endl; 299 297 Thermostat = None; 300 298 } 301 299 } else { 302 DoLog(1) && (Log() << Verbose(1) << " Warning: thermostat name was not understood!" << endl);300 Log() << Verbose(1) << " Warning: thermostat name was not understood!" << endl; 303 301 Thermostat = None; 304 302 } 305 303 } else { 306 304 if ((MaxOuterStep > 0) && (TargetTemp != 0)) 307 DoLog(2) && (Log() << Verbose(2) << "No thermostat chosen despite finite temperature MD, falling back to None." << endl);305 Log() << Verbose(2) << "No thermostat chosen despite finite temperature MD, falling back to None." << endl; 308 306 Thermostat = None; 309 307 } … … 321 319 322 320 do { 323 DoLog(0) && (Log() << Verbose(0) << "===========EDIT CONFIGURATION============================" << endl);324 DoLog(0) && (Log() << Verbose(0) << " A - mainname (prefix for all runtime files)" << endl);325 DoLog(0) && (Log() << Verbose(0) << " B - Default path (for runtime files)" << endl);326 DoLog(0) && (Log() << Verbose(0) << " C - Path of pseudopotential files" << endl);327 DoLog(0) && (Log() << Verbose(0) << " D - Number of coefficient sharing processes" << endl);328 DoLog(0) && (Log() << Verbose(0) << " E - Number of wave function sharing processes" << endl);329 DoLog(0) && (Log() << Verbose(0) << " F - 0: Don't output density for OpenDX, 1: do" << endl);330 DoLog(0) && (Log() << Verbose(0) << " G - 0: Don't output physical data, 1: do" << endl);331 DoLog(0) && (Log() << Verbose(0) << " H - 0: Don't output densities of each unperturbed orbital for OpenDX, 1: do" << endl);332 DoLog(0) && (Log() << Verbose(0) << " I - 0: Don't output current density for OpenDX, 1: do" << endl);333 DoLog(0) && (Log() << Verbose(0) << " J - 0: Don't do the full current calculation, 1: do" << endl);334 DoLog(0) && (Log() << Verbose(0) << " K - 0: Don't do perturbation calculation to obtain susceptibility and shielding, 1: do" << endl);335 DoLog(0) && (Log() << Verbose(0) << " L - 0: Wannier centres as calculated, 1: common centre for all, 2: unite centres according to spread, 3: cell centre, 4: shifted to nearest grid point" << endl);336 DoLog(0) && (Log() << Verbose(0) << " M - Absolute begin of unphysical sawtooth transfer for position operator within cell" << endl);337 DoLog(0) && (Log() << Verbose(0) << " N - (0,1,2) x,y,z-plane to do two-dimensional current vector cut" << endl);338 DoLog(0) && (Log() << Verbose(0) << " O - Absolute position along vector cut axis for cut plane" << endl);339 DoLog(0) && (Log() << Verbose(0) << " P - Additional Gram-Schmidt-Orthonormalization to stabilize numerics" << endl);340 DoLog(0) && (Log() << Verbose(0) << " Q - Initial integer value of random number generator" << endl);341 DoLog(0) && (Log() << Verbose(0) << " R - for perturbation 0, for structure optimization defines upper limit of iterations" << endl);342 DoLog(0) && (Log() << Verbose(0) << " T - Output visual after ...th step" << endl);343 DoLog(0) && (Log() << Verbose(0) << " U - Output source densities of wave functions after ...th step" << endl);344 DoLog(0) && (Log() << Verbose(0) << " X - minimization iterations per wave function, if unsure leave at default value 0" << endl);345 DoLog(0) && (Log() << Verbose(0) << " Y - tolerance value for total spread in iterative Jacobi diagonalization" << endl);346 DoLog(0) && (Log() << Verbose(0) << " Z - Maximum number of minimization iterations" << endl);347 DoLog(0) && (Log() << Verbose(0) << " a - Relative change in total energy to stop min. iteration" << endl);348 DoLog(0) && (Log() << Verbose(0) << " b - Relative change in kinetic energy to stop min. iteration" << endl);349 DoLog(0) && (Log() << Verbose(0) << " c - Check stop conditions every ..th step during min. iteration" << endl);350 DoLog(0) && (Log() << Verbose(0) << " e - Maximum number of minimization iterations during initial level" << endl);351 DoLog(0) && (Log() << Verbose(0) << " f - Relative change in total energy to stop min. iteration during initial level" << endl);352 DoLog(0) && (Log() << Verbose(0) << " g - Relative change in kinetic energy to stop min. iteration during initial level" << endl);353 DoLog(0) && (Log() << Verbose(0) << " h - Check stop conditions every ..th step during min. iteration during initial level" << endl);321 Log() << Verbose(0) << "===========EDIT CONFIGURATION============================" << endl; 322 Log() << Verbose(0) << " A - mainname (prefix for all runtime files)" << endl; 323 Log() << Verbose(0) << " B - Default path (for runtime files)" << endl; 324 Log() << Verbose(0) << " C - Path of pseudopotential files" << endl; 325 Log() << Verbose(0) << " D - Number of coefficient sharing processes" << endl; 326 Log() << Verbose(0) << " E - Number of wave function sharing processes" << endl; 327 Log() << Verbose(0) << " F - 0: Don't output density for OpenDX, 1: do" << endl; 328 Log() << Verbose(0) << " G - 0: Don't output physical data, 1: do" << endl; 329 Log() << Verbose(0) << " H - 0: Don't output densities of each unperturbed orbital for OpenDX, 1: do" << endl; 330 Log() << Verbose(0) << " I - 0: Don't output current density for OpenDX, 1: do" << endl; 331 Log() << Verbose(0) << " J - 0: Don't do the full current calculation, 1: do" << endl; 332 Log() << Verbose(0) << " K - 0: Don't do perturbation calculation to obtain susceptibility and shielding, 1: do" << endl; 333 Log() << Verbose(0) << " L - 0: Wannier centres as calculated, 1: common centre for all, 2: unite centres according to spread, 3: cell centre, 4: shifted to nearest grid point" << endl; 334 Log() << Verbose(0) << " M - Absolute begin of unphysical sawtooth transfer for position operator within cell" << endl; 335 Log() << Verbose(0) << " N - (0,1,2) x,y,z-plane to do two-dimensional current vector cut" << endl; 336 Log() << Verbose(0) << " O - Absolute position along vector cut axis for cut plane" << endl; 337 Log() << Verbose(0) << " P - Additional Gram-Schmidt-Orthonormalization to stabilize numerics" << endl; 338 Log() << Verbose(0) << " Q - Initial integer value of random number generator" << endl; 339 Log() << Verbose(0) << " R - for perturbation 0, for structure optimization defines upper limit of iterations" << endl; 340 Log() << Verbose(0) << " T - Output visual after ...th step" << endl; 341 Log() << Verbose(0) << " U - Output source densities of wave functions after ...th step" << endl; 342 Log() << Verbose(0) << " X - minimization iterations per wave function, if unsure leave at default value 0" << endl; 343 Log() << Verbose(0) << " Y - tolerance value for total spread in iterative Jacobi diagonalization" << endl; 344 Log() << Verbose(0) << " Z - Maximum number of minimization iterations" << endl; 345 Log() << Verbose(0) << " a - Relative change in total energy to stop min. iteration" << endl; 346 Log() << Verbose(0) << " b - Relative change in kinetic energy to stop min. iteration" << endl; 347 Log() << Verbose(0) << " c - Check stop conditions every ..th step during min. iteration" << endl; 348 Log() << Verbose(0) << " e - Maximum number of minimization iterations during initial level" << endl; 349 Log() << Verbose(0) << " f - Relative change in total energy to stop min. iteration during initial level" << endl; 350 Log() << Verbose(0) << " g - Relative change in kinetic energy to stop min. iteration during initial level" << endl; 351 Log() << Verbose(0) << " h - Check stop conditions every ..th step during min. iteration during initial level" << endl; 354 352 // Log() << Verbose(0) << " j - six lower diagonal entries of matrix, defining the unit cell" << endl; 355 DoLog(0) && (Log() << Verbose(0) << " k - Energy cutoff of plane wave basis in Hartree" << endl);356 DoLog(0) && (Log() << Verbose(0) << " l - Maximum number of levels in multi-level-ansatz" << endl);357 DoLog(0) && (Log() << Verbose(0) << " m - Factor by which grid nodes increase between standard and upper level" << endl);358 DoLog(0) && (Log() << Verbose(0) << " n - 0: Don't use RiemannTensor, 1: Do" << endl);359 DoLog(0) && (Log() << Verbose(0) << " o - Factor by which grid nodes increase between Riemann and standard(?) level" << endl);360 DoLog(0) && (Log() << Verbose(0) << " p - Number of Riemann levels" << endl);361 DoLog(0) && (Log() << Verbose(0) << " r - 0: Don't Use RiemannTensor, 1: Do" << endl);362 DoLog(0) && (Log() << Verbose(0) << " s - 0: Doubly occupied orbitals, 1: Up-/Down-Orbitals" << endl);363 DoLog(0) && (Log() << Verbose(0) << " t - Number of orbitals (depends pn SpinType)" << endl);364 DoLog(0) && (Log() << Verbose(0) << " u - Number of SpinUp orbitals (depends on SpinType)" << endl);365 DoLog(0) && (Log() << Verbose(0) << " v - Number of SpinDown orbitals (depends on SpinType)" << endl);366 DoLog(0) && (Log() << Verbose(0) << " w - Number of additional, unoccupied orbitals" << endl);367 DoLog(0) && (Log() << Verbose(0) << " x - radial cutoff for ewald summation in Bohrradii" << endl);368 DoLog(0) && (Log() << Verbose(0) << " y - 0: Don't do structure optimization beforehand, 1: Do" << endl);369 DoLog(0) && (Log() << Verbose(0) << " z - 0: Units are in Bohr radii, 1: units are in Aengstrom" << endl);370 DoLog(0) && (Log() << Verbose(0) << " i - 0: Coordinates given in file are absolute, 1: ... are relative to unit cell" << endl);371 DoLog(0) && (Log() << Verbose(0) << "=========================================================" << endl);372 DoLog(0) && (Log() << Verbose(0) << "INPUT: ");353 Log() << Verbose(0) << " k - Energy cutoff of plane wave basis in Hartree" << endl; 354 Log() << Verbose(0) << " l - Maximum number of levels in multi-level-ansatz" << endl; 355 Log() << Verbose(0) << " m - Factor by which grid nodes increase between standard and upper level" << endl; 356 Log() << Verbose(0) << " n - 0: Don't use RiemannTensor, 1: Do" << endl; 357 Log() << Verbose(0) << " o - Factor by which grid nodes increase between Riemann and standard(?) level" << endl; 358 Log() << Verbose(0) << " p - Number of Riemann levels" << endl; 359 Log() << Verbose(0) << " r - 0: Don't Use RiemannTensor, 1: Do" << endl; 360 Log() << Verbose(0) << " s - 0: Doubly occupied orbitals, 1: Up-/Down-Orbitals" << endl; 361 Log() << Verbose(0) << " t - Number of orbitals (depends pn SpinType)" << endl; 362 Log() << Verbose(0) << " u - Number of SpinUp orbitals (depends on SpinType)" << endl; 363 Log() << Verbose(0) << " v - Number of SpinDown orbitals (depends on SpinType)" << endl; 364 Log() << Verbose(0) << " w - Number of additional, unoccupied orbitals" << endl; 365 Log() << Verbose(0) << " x - radial cutoff for ewald summation in Bohrradii" << endl; 366 Log() << Verbose(0) << " y - 0: Don't do structure optimization beforehand, 1: Do" << endl; 367 Log() << Verbose(0) << " z - 0: Units are in Bohr radii, 1: units are in Aengstrom" << endl; 368 Log() << Verbose(0) << " i - 0: Coordinates given in file are absolute, 1: ... are relative to unit cell" << endl; 369 Log() << Verbose(0) << "=========================================================" << endl; 370 Log() << Verbose(0) << "INPUT: "; 373 371 cin >> choice; 374 372 375 373 switch (choice) { 376 374 case 'A': // mainname 377 DoLog(0) && (Log() << Verbose(0) << "Old: " << config::mainname << "\t new: ");375 Log() << Verbose(0) << "Old: " << config::mainname << "\t new: "; 378 376 cin >> config::mainname; 379 377 break; 380 378 case 'B': // defaultpath 381 DoLog(0) && (Log() << Verbose(0) << "Old: " << config::defaultpath << "\t new: ");379 Log() << Verbose(0) << "Old: " << config::defaultpath << "\t new: "; 382 380 cin >> config::defaultpath; 383 381 break; 384 382 case 'C': // pseudopotpath 385 DoLog(0) && (Log() << Verbose(0) << "Old: " << config::pseudopotpath << "\t new: ");383 Log() << Verbose(0) << "Old: " << config::pseudopotpath << "\t new: "; 386 384 cin >> config::pseudopotpath; 387 385 break; 388 386 389 387 case 'D': // ProcPEGamma 390 DoLog(0) && (Log() << Verbose(0) << "Old: " << config::ProcPEGamma << "\t new: ");388 Log() << Verbose(0) << "Old: " << config::ProcPEGamma << "\t new: "; 391 389 cin >> config::ProcPEGamma; 392 390 break; 393 391 case 'E': // ProcPEPsi 394 DoLog(0) && (Log() << Verbose(0) << "Old: " << config::ProcPEPsi << "\t new: ");392 Log() << Verbose(0) << "Old: " << config::ProcPEPsi << "\t new: "; 395 393 cin >> config::ProcPEPsi; 396 394 break; 397 395 case 'F': // DoOutVis 398 DoLog(0) && (Log() << Verbose(0) << "Old: " << config::DoOutVis << "\t new: ");396 Log() << Verbose(0) << "Old: " << config::DoOutVis << "\t new: "; 399 397 cin >> config::DoOutVis; 400 398 break; 401 399 case 'G': // DoOutMes 402 DoLog(0) && (Log() << Verbose(0) << "Old: " << config::DoOutMes << "\t new: ");400 Log() << Verbose(0) << "Old: " << config::DoOutMes << "\t new: "; 403 401 cin >> config::DoOutMes; 404 402 break; 405 403 case 'H': // DoOutOrbitals 406 DoLog(0) && (Log() << Verbose(0) << "Old: " << config::DoOutOrbitals << "\t new: ");404 Log() << Verbose(0) << "Old: " << config::DoOutOrbitals << "\t new: "; 407 405 cin >> config::DoOutOrbitals; 408 406 break; 409 407 case 'I': // DoOutCurrent 410 DoLog(0) && (Log() << Verbose(0) << "Old: " << config::DoOutCurrent << "\t new: ");408 Log() << Verbose(0) << "Old: " << config::DoOutCurrent << "\t new: "; 411 409 cin >> config::DoOutCurrent; 412 410 break; 413 411 case 'J': // DoFullCurrent 414 DoLog(0) && (Log() << Verbose(0) << "Old: " << config::DoFullCurrent << "\t new: ");412 Log() << Verbose(0) << "Old: " << config::DoFullCurrent << "\t new: "; 415 413 cin >> config::DoFullCurrent; 416 414 break; 417 415 case 'K': // DoPerturbation 418 DoLog(0) && (Log() << Verbose(0) << "Old: " << config::DoPerturbation << "\t new: ");416 Log() << Verbose(0) << "Old: " << config::DoPerturbation << "\t new: "; 419 417 cin >> config::DoPerturbation; 420 418 break; 421 419 case 'L': // CommonWannier 422 DoLog(0) && (Log() << Verbose(0) << "Old: " << config::CommonWannier << "\t new: ");420 Log() << Verbose(0) << "Old: " << config::CommonWannier << "\t new: "; 423 421 cin >> config::CommonWannier; 424 422 break; 425 423 case 'M': // SawtoothStart 426 DoLog(0) && (Log() << Verbose(0) << "Old: " << config::SawtoothStart << "\t new: ");424 Log() << Verbose(0) << "Old: " << config::SawtoothStart << "\t new: "; 427 425 cin >> config::SawtoothStart; 428 426 break; 429 427 case 'N': // VectorPlane 430 DoLog(0) && (Log() << Verbose(0) << "Old: " << config::VectorPlane << "\t new: ");428 Log() << Verbose(0) << "Old: " << config::VectorPlane << "\t new: "; 431 429 cin >> config::VectorPlane; 432 430 break; 433 431 case 'O': // VectorCut 434 DoLog(0) && (Log() << Verbose(0) << "Old: " << config::VectorCut << "\t new: ");432 Log() << Verbose(0) << "Old: " << config::VectorCut << "\t new: "; 435 433 cin >> config::VectorCut; 436 434 break; 437 435 case 'P': // UseAddGramSch 438 DoLog(0) && (Log() << Verbose(0) << "Old: " << config::UseAddGramSch << "\t new: ");436 Log() << Verbose(0) << "Old: " << config::UseAddGramSch << "\t new: "; 439 437 cin >> config::UseAddGramSch; 440 438 break; 441 439 case 'Q': // Seed 442 DoLog(0) && (Log() << Verbose(0) << "Old: " << config::Seed << "\t new: ");440 Log() << Verbose(0) << "Old: " << config::Seed << "\t new: "; 443 441 cin >> config::Seed; 444 442 break; 445 443 446 444 case 'R': // MaxOuterStep 447 DoLog(0) && (Log() << Verbose(0) << "Old: " << config::MaxOuterStep << "\t new: ");445 Log() << Verbose(0) << "Old: " << config::MaxOuterStep << "\t new: "; 448 446 cin >> config::MaxOuterStep; 449 447 break; 450 448 case 'T': // OutVisStep 451 DoLog(0) && (Log() << Verbose(0) << "Old: " << config::OutVisStep << "\t new: ");449 Log() << Verbose(0) << "Old: " << config::OutVisStep << "\t new: "; 452 450 cin >> config::OutVisStep; 453 451 break; 454 452 case 'U': // OutSrcStep 455 DoLog(0) && (Log() << Verbose(0) << "Old: " << config::OutSrcStep << "\t new: ");453 Log() << Verbose(0) << "Old: " << config::OutSrcStep << "\t new: "; 456 454 cin >> config::OutSrcStep; 457 455 break; 458 456 case 'X': // MaxPsiStep 459 DoLog(0) && (Log() << Verbose(0) << "Old: " << config::MaxPsiStep << "\t new: ");457 Log() << Verbose(0) << "Old: " << config::MaxPsiStep << "\t new: "; 460 458 cin >> config::MaxPsiStep; 461 459 break; 462 460 case 'Y': // EpsWannier 463 DoLog(0) && (Log() << Verbose(0) << "Old: " << config::EpsWannier << "\t new: ");461 Log() << Verbose(0) << "Old: " << config::EpsWannier << "\t new: "; 464 462 cin >> config::EpsWannier; 465 463 break; 466 464 467 465 case 'Z': // MaxMinStep 468 DoLog(0) && (Log() << Verbose(0) << "Old: " << config::MaxMinStep << "\t new: ");466 Log() << Verbose(0) << "Old: " << config::MaxMinStep << "\t new: "; 469 467 cin >> config::MaxMinStep; 470 468 break; 471 469 case 'a': // RelEpsTotalEnergy 472 DoLog(0) && (Log() << Verbose(0) << "Old: " << config::RelEpsTotalEnergy << "\t new: ");470 Log() << Verbose(0) << "Old: " << config::RelEpsTotalEnergy << "\t new: "; 473 471 cin >> config::RelEpsTotalEnergy; 474 472 break; 475 473 case 'b': // RelEpsKineticEnergy 476 DoLog(0) && (Log() << Verbose(0) << "Old: " << config::RelEpsKineticEnergy << "\t new: ");474 Log() << Verbose(0) << "Old: " << config::RelEpsKineticEnergy << "\t new: "; 477 475 cin >> config::RelEpsKineticEnergy; 478 476 break; 479 477 case 'c': // MaxMinStopStep 480 DoLog(0) && (Log() << Verbose(0) << "Old: " << config::MaxMinStopStep << "\t new: ");478 Log() << Verbose(0) << "Old: " << config::MaxMinStopStep << "\t new: "; 481 479 cin >> config::MaxMinStopStep; 482 480 break; 483 481 case 'e': // MaxInitMinStep 484 DoLog(0) && (Log() << Verbose(0) << "Old: " << config::MaxInitMinStep << "\t new: ");482 Log() << Verbose(0) << "Old: " << config::MaxInitMinStep << "\t new: "; 485 483 cin >> config::MaxInitMinStep; 486 484 break; 487 485 case 'f': // InitRelEpsTotalEnergy 488 DoLog(0) && (Log() << Verbose(0) << "Old: " << config::InitRelEpsTotalEnergy << "\t new: ");486 Log() << Verbose(0) << "Old: " << config::InitRelEpsTotalEnergy << "\t new: "; 489 487 cin >> config::InitRelEpsTotalEnergy; 490 488 break; 491 489 case 'g': // InitRelEpsKineticEnergy 492 DoLog(0) && (Log() << Verbose(0) << "Old: " << config::InitRelEpsKineticEnergy << "\t new: ");490 Log() << Verbose(0) << "Old: " << config::InitRelEpsKineticEnergy << "\t new: "; 493 491 cin >> config::InitRelEpsKineticEnergy; 494 492 break; 495 493 case 'h': // InitMaxMinStopStep 496 DoLog(0) && (Log() << Verbose(0) << "Old: " << config::InitMaxMinStopStep << "\t new: ");494 Log() << Verbose(0) << "Old: " << config::InitMaxMinStopStep << "\t new: "; 497 495 cin >> config::InitMaxMinStopStep; 498 496 break; … … 500 498 // case 'j': // BoxLength 501 499 // Log() << Verbose(0) << "enter lower triadiagonalo form of basis matrix" << endl << endl; 502 // double * const cell_size = World::get()->cell_size;503 500 // for (int i=0;i<6;i++) { 504 501 // Log() << Verbose(0) << "Cell size" << i << ": "; 505 // cin >> cell_size[i];502 // cin >> mol->cell_size[i]; 506 503 // } 507 504 // break; 508 505 509 506 case 'k': // ECut 510 DoLog(0) && (Log() << Verbose(0) << "Old: " << config::ECut << "\t new: ");507 Log() << Verbose(0) << "Old: " << config::ECut << "\t new: "; 511 508 cin >> config::ECut; 512 509 break; 513 510 case 'l': // MaxLevel 514 DoLog(0) && (Log() << Verbose(0) << "Old: " << config::MaxLevel << "\t new: ");511 Log() << Verbose(0) << "Old: " << config::MaxLevel << "\t new: "; 515 512 cin >> config::MaxLevel; 516 513 break; 517 514 case 'm': // RiemannTensor 518 DoLog(0) && (Log() << Verbose(0) << "Old: " << config::RiemannTensor << "\t new: ");515 Log() << Verbose(0) << "Old: " << config::RiemannTensor << "\t new: "; 519 516 cin >> config::RiemannTensor; 520 517 break; 521 518 case 'n': // LevRFactor 522 DoLog(0) && (Log() << Verbose(0) << "Old: " << config::LevRFactor << "\t new: ");519 Log() << Verbose(0) << "Old: " << config::LevRFactor << "\t new: "; 523 520 cin >> config::LevRFactor; 524 521 break; 525 522 case 'o': // RiemannLevel 526 DoLog(0) && (Log() << Verbose(0) << "Old: " << config::RiemannLevel << "\t new: ");523 Log() << Verbose(0) << "Old: " << config::RiemannLevel << "\t new: "; 527 524 cin >> config::RiemannLevel; 528 525 break; 529 526 case 'p': // Lev0Factor 530 DoLog(0) && (Log() << Verbose(0) << "Old: " << config::Lev0Factor << "\t new: ");527 Log() << Verbose(0) << "Old: " << config::Lev0Factor << "\t new: "; 531 528 cin >> config::Lev0Factor; 532 529 break; 533 530 case 'r': // RTActualUse 534 DoLog(0) && (Log() << Verbose(0) << "Old: " << config::RTActualUse << "\t new: ");531 Log() << Verbose(0) << "Old: " << config::RTActualUse << "\t new: "; 535 532 cin >> config::RTActualUse; 536 533 break; 537 534 case 's': // PsiType 538 DoLog(0) && (Log() << Verbose(0) << "Old: " << config::PsiType << "\t new: ");535 Log() << Verbose(0) << "Old: " << config::PsiType << "\t new: "; 539 536 cin >> config::PsiType; 540 537 break; 541 538 case 't': // MaxPsiDouble 542 DoLog(0) && (Log() << Verbose(0) << "Old: " << config::MaxPsiDouble << "\t new: ");539 Log() << Verbose(0) << "Old: " << config::MaxPsiDouble << "\t new: "; 543 540 cin >> config::MaxPsiDouble; 544 541 break; 545 542 case 'u': // PsiMaxNoUp 546 DoLog(0) && (Log() << Verbose(0) << "Old: " << config::PsiMaxNoUp << "\t new: ");543 Log() << Verbose(0) << "Old: " << config::PsiMaxNoUp << "\t new: "; 547 544 cin >> config::PsiMaxNoUp; 548 545 break; 549 546 case 'v': // PsiMaxNoDown 550 DoLog(0) && (Log() << Verbose(0) << "Old: " << config::PsiMaxNoDown << "\t new: ");547 Log() << Verbose(0) << "Old: " << config::PsiMaxNoDown << "\t new: "; 551 548 cin >> config::PsiMaxNoDown; 552 549 break; 553 550 case 'w': // AddPsis 554 DoLog(0) && (Log() << Verbose(0) << "Old: " << config::AddPsis << "\t new: ");551 Log() << Verbose(0) << "Old: " << config::AddPsis << "\t new: "; 555 552 cin >> config::AddPsis; 556 553 break; 557 554 558 555 case 'x': // RCut 559 DoLog(0) && (Log() << Verbose(0) << "Old: " << config::RCut << "\t new: ");556 Log() << Verbose(0) << "Old: " << config::RCut << "\t new: "; 560 557 cin >> config::RCut; 561 558 break; 562 559 case 'y': // StructOpt 563 DoLog(0) && (Log() << Verbose(0) << "Old: " << config::StructOpt << "\t new: ");560 Log() << Verbose(0) << "Old: " << config::StructOpt << "\t new: "; 564 561 cin >> config::StructOpt; 565 562 break; 566 563 case 'z': // IsAngstroem 567 DoLog(0) && (Log() << Verbose(0) << "Old: " << config::IsAngstroem << "\t new: ");564 Log() << Verbose(0) << "Old: " << config::IsAngstroem << "\t new: "; 568 565 cin >> config::IsAngstroem; 569 566 break; 570 567 case 'i': // RelativeCoord 571 DoLog(0) && (Log() << Verbose(0) << "Old: " << config::RelativeCoord << "\t new: ");568 Log() << Verbose(0) << "Old: " << config::RelativeCoord << "\t new: "; 572 569 cin >> config::RelativeCoord; 573 570 break; … … 648 645 } 649 646 strcpy(configname, ptr); 650 DoLog(0) && (Log() << Verbose(0) << "Found configpath: " << configpath << ", dir slash was found at " << last << ", config name is " << configname << "." << endl);647 Log() << Verbose(0) << "Found configpath: " << configpath << ", dir slash was found at " << last << ", config name is " << configname << "." << endl; 651 648 delete[](buffer); 652 649 }; … … 659 656 { 660 657 if (FileBuffer != NULL) { 661 DoeLog(2) && (eLog()<< Verbose(2) << "deleting present FileBuffer in PrepareFileBuffer()." << endl);658 eLog() << Verbose(2) << "deleting present FileBuffer in PrepareFileBuffer()." << endl; 662 659 delete(FileBuffer); 663 660 } … … 685 682 686 683 if (mol == NULL) { 687 DoeLog(0) && (eLog()<< Verbose(0) << "Molecule is not allocated in LoadMolecule(), exit.");684 eLog() << Verbose(0) << "Molecule is not allocated in LoadMolecule(), exit."; 688 685 performCriticalExit(); 689 686 } … … 691 688 ParseForParameter(verbose,FileBuffer,"MaxTypes", 0, 1, 1, int_type, &(MaxTypes), 1, critical); 692 689 if (MaxTypes == 0) { 693 DoeLog(1) && (eLog()<< Verbose(1) << "There are no atoms according to MaxTypes in this config file." << endl);694 //performCriticalExit();690 eLog() << Verbose(0) << "There are no atoms according to MaxTypes in this config file." << endl; 691 performCriticalExit(); 695 692 } else { 696 693 // prescan number of ions per type 697 DoLog(0) && (Log() << Verbose(0) << "Prescanning ions per type: " << endl);694 Log() << Verbose(0) << "Prescanning ions per type: " << endl; 698 695 int NoAtoms = 0; 699 696 for (int i=0; i < MaxTypes; i++) { … … 702 699 ParseForParameter(verbose,FileBuffer, name, 0, 2, 1, int_type, &Z, 1, critical); 703 700 elementhash[i] = periode->FindElement(Z); 704 DoLog(1) && (Log() << Verbose(1) << i << ". Z = " << elementhash[i]->Z << " with " << No[i] << " ions." << endl);701 Log() << Verbose(1) << i << ". Z = " << elementhash[i]->Z << " with " << No[i] << " ions." << endl; 705 702 NoAtoms += No[i]; 706 703 } … … 710 707 sprintf(name,"Ion_Type%i",MaxTypes); 711 708 if (!ParseForParameter(verbose,FileBuffer, (const char*)name, 1, 1, 1, int_type, &value[0], 1, critical)) { 712 DoeLog(0) && (eLog()<< Verbose(0) << "There are no atoms in the config file!" << endl);709 eLog() << Verbose(0) << "There are no atoms in the config file!" << endl; 713 710 performCriticalExit(); 714 711 return; … … 728 725 bool status = true; 729 726 while (status) { 730 DoLog(0) && (Log() << Verbose(0) << "Currently parsing MD step " << repetition << "." << endl);727 Log() << Verbose(0) << "Currently parsing MD step " << repetition << "." << endl; 731 728 for (int i=0; i < MaxTypes; i++) { 732 729 sprintf(name,"Ion_Type%i",i+1); … … 794 791 } 795 792 repetition--; 796 DoLog(0) && (Log() << Verbose(0) << "Found " << repetition << " trajectory steps." << endl);793 Log() << Verbose(0) << "Found " << repetition << " trajectory steps." << endl; 797 794 if (repetition <= 1) // if onyl one step, desactivate use of trajectories 798 795 mol->MDSteps = 0; … … 806 803 ParseForParameter(verbose,FileBuffer, "Ion_Type1_1", 0, 3, 1, double_type, &value[2], repetition, (repetition == 0) ? critical : optional)) 807 804 repetition++; 808 DoLog(0) && (Log() << Verbose(0) << "I found " << repetition << " times the keyword Ion_Type1_1." << endl);805 Log() << Verbose(0) << "I found " << repetition << " times the keyword Ion_Type1_1." << endl; 809 806 // parse in molecule coordinates 810 807 for (int i=0; i < MaxTypes; i++) { … … 855 852 ifstream *file = new ifstream(filename); 856 853 if (file == NULL) { 857 DoeLog(1) && (eLog()<< Verbose(1) << "config file " << filename << " missing!" << endl);854 eLog() << Verbose(1) << "config file " << filename << " missing!" << endl; 858 855 return; 859 856 } … … 967 964 // Unit cell and magnetic field 968 965 ParseForParameter(verbose,FileBuffer, "BoxLength", 0, 3, 3, lower_trigrid, BoxLength, 1, critical); /* Lattice->RealBasis */ 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]; 966 mol->cell_size[0] = BoxLength[0]; 967 mol->cell_size[1] = BoxLength[3]; 968 mol->cell_size[2] = BoxLength[4]; 969 mol->cell_size[3] = BoxLength[6]; 970 mol->cell_size[4] = BoxLength[7]; 971 mol->cell_size[5] = BoxLength[8]; 976 972 //if (1) fprintf(stderr,"\n"); 977 973 … … 1063 1059 BG = new BondGraph(IsAngstroem); 1064 1060 if (BG->LoadBondLengthTable(BondGraphFileName)) { 1065 DoLog(0) && (Log() << Verbose(0) << "Bond length table loaded successfully." << endl);1061 Log() << Verbose(0) << "Bond length table loaded successfully." << endl; 1066 1062 } else { 1067 DoeLog(1) && (eLog()<< Verbose(1) << "Bond length table loading failed." << endl);1063 eLog() << Verbose(1) << "Bond length table loading failed." << endl; 1068 1064 } 1069 1065 } … … 1078 1074 // don't do this here ... 1079 1075 //MolList->DissectMoleculeIntoConnectedSubgraphs(mol,this); 1080 //delete(mol); 1081 1076 1077 delete(mol); 1082 1078 delete(FileBuffer); 1083 1079 }; … … 1094 1090 ifstream *file = new ifstream(filename); 1095 1091 if (file == NULL) { 1096 DoeLog(1) && (eLog()<< Verbose(1) << "config file " << filename << " missing!" << endl);1092 eLog() << Verbose(1) << "config file " << filename << " missing!" << endl; 1097 1093 return; 1098 1094 } … … 1172 1168 1173 1169 ParseForParameter(verbose,file, "BoxLength", 0, 3, 3, lower_trigrid, BoxLength, 1, critical); /* Lattice->RealBasis */ 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]; 1170 mol->cell_size[0] = BoxLength[0]; 1171 mol->cell_size[1] = BoxLength[3]; 1172 mol->cell_size[2] = BoxLength[4]; 1173 mol->cell_size[3] = BoxLength[6]; 1174 mol->cell_size[4] = BoxLength[7]; 1175 mol->cell_size[5] = BoxLength[8]; 1181 1176 if (1) fprintf(stderr,"\n"); 1182 1177 config::DoPerturbation = 0; … … 1254 1249 BG = new BondGraph(IsAngstroem); 1255 1250 if (BG->LoadBondLengthTable(BondGraphFileName)) { 1256 DoLog(0) && (Log() << Verbose(0) << "Bond length table loaded successfully." << endl);1251 Log() << Verbose(0) << "Bond length table loaded successfully." << endl; 1257 1252 } else { 1258 DoLog(0) && (Log() << Verbose(0) << "Bond length table loading failed." << endl);1253 Log() << Verbose(0) << "Bond length table loading failed." << endl; 1259 1254 } 1260 1255 … … 1263 1258 for (i=MAX_ELEMENTS;i--;) 1264 1259 elementhash[i] = NULL; 1265 DoLog(0) && (Log() << Verbose(0) << "Parsing Ions ..." << endl);1260 Log() << Verbose(0) << "Parsing Ions ..." << endl; 1266 1261 No=0; 1267 1262 found = 0; 1268 1263 while (getline(*file,zeile,'\n')) { 1269 1264 if (zeile.find("Ions_Data") == 0) { 1270 DoLog(1) && (Log() << Verbose(1) << "found Ions_Data...begin parsing" << endl);1265 Log() << Verbose(1) << "found Ions_Data...begin parsing" << endl; 1271 1266 found ++; 1272 1267 } … … 1282 1277 input >> b; // element mass 1283 1278 elementhash[No] = periode->FindElement(Z); 1284 DoLog(1) && (Log() << Verbose(1) << "AtomNo: " << AtomNo << "\tZ: " << Z << "\ta:" << a << "\tl:" << l << "\b:" << b << "\tElement:" << elementhash[No] << "\t:" << endl);1279 Log() << Verbose(1) << "AtomNo: " << AtomNo << "\tZ: " << Z << "\ta:" << a << "\tl:" << l << "\b:" << b << "\tElement:" << elementhash[No] << "\t:" << endl; 1285 1280 for(i=0;i<AtomNo;i++) { 1286 1281 if (!getline(*file,zeile,'\n')) {// parse on and on 1287 DoLog(2) && (Log() << Verbose(2) << "Error: Too few items in ionic list of element" << elementhash[No] << "." << endl << "Exiting." << endl);1282 Log() << Verbose(2) << "Error: Too few items in ionic list of element" << elementhash[No] << "." << endl << "Exiting." << endl; 1288 1283 // return 1; 1289 1284 } else { … … 1316 1311 // bring MaxTypes up to date 1317 1312 mol->CountElements(); 1318 const double * const cell_size = World::get()->cell_size;1319 1313 ofstream * const output = new ofstream(filename, ios::out); 1320 1314 if (output != NULL) { … … 1387 1381 *output << endl; 1388 1382 *output << "BoxLength\t\t\t# (Length of a unit cell)" << 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;1383 *output << mol->cell_size[0] << "\t" << endl; 1384 *output << mol->cell_size[1] << "\t" << mol->cell_size[2] << "\t" << endl; 1385 *output << mol->cell_size[3] << "\t" << mol->cell_size[4] << "\t" << mol->cell_size[5] << "\t" << endl; 1392 1386 // FIXME 1393 1387 *output << endl; … … 1433 1427 return result; 1434 1428 } else { 1435 DoeLog(1) && (eLog()<< Verbose(1) << "Cannot open output file:" << filename << endl);1429 eLog() << Verbose(1) << "Cannot open output file:" << filename << endl; 1436 1430 return false; 1437 1431 } … … 1455 1449 output = new ofstream(fname->str().c_str(), ios::out); 1456 1450 if (output == NULL) { 1457 DoeLog(1) && (eLog()<< Verbose(1) << "Cannot open mpqc output file:" << fname << endl);1451 eLog() << Verbose(1) << "Cannot open mpqc output file:" << fname << endl; 1458 1452 delete(fname); 1459 1453 return false; … … 1498 1492 output = new ofstream(fname->str().c_str(), ios::out); 1499 1493 if (output == NULL) { 1500 DoeLog(1) && (eLog()<< Verbose(1) << "Cannot open mpqc hessian output file:" << fname << endl);1494 eLog() << Verbose(1) << "Cannot open mpqc hessian output file:" << fname << endl; 1501 1495 delete(fname); 1502 1496 return false; … … 1554 1548 f = fopen(name, "w" ); 1555 1549 if (f == NULL) { 1556 DoeLog(1) && (eLog()<< Verbose(1) << "Cannot open pdb output file:" << name << endl);1550 eLog() << Verbose(1) << "Cannot open pdb output file:" << name << endl; 1557 1551 return false; 1558 1552 } … … 1609 1603 f = fopen(name, "w" ); 1610 1604 if (f == NULL) { 1611 DoeLog(1) && (eLog()<< Verbose(1) << "Cannot open pdb output file:" << name << endl);1605 eLog() << Verbose(1) << "Cannot open pdb output file:" << name << endl; 1612 1606 Free(&elementNo); 1613 1607 return false; … … 1646 1640 /** Stores all atoms in a TREMOLO data input file. 1647 1641 * 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!1649 1642 * \param *filename name of file (without ".in" suffix!) 1650 1643 * \param *mol pointer to molecule … … 1659 1652 output = new ofstream(fname->str().c_str(), ios::out); 1660 1653 if (output == NULL) { 1661 DoeLog(1) && (eLog()<< Verbose(1) << "Cannot open tremolo output file:" << fname << endl);1654 eLog() << Verbose(1) << "Cannot open tremolo output file:" << fname << endl; 1662 1655 delete(fname); 1663 1656 return false; … … 1701 1694 /** Stores all atoms from all molecules in a TREMOLO data input file. 1702 1695 * 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!1704 1696 * \param *filename name of file (without ".in" suffix!) 1705 1697 * \param *MolList pointer to MoleculeListClass containing all atoms … … 1714 1706 output = new ofstream(fname->str().c_str(), ios::out); 1715 1707 if (output == NULL) { 1716 DoeLog(1) && (eLog()<< Verbose(1) << "Cannot open tremolo output file:" << fname << endl);1708 eLog() << Verbose(1) << "Cannot open tremolo output file:" << fname << endl; 1717 1709 delete(fname); 1718 1710 return false; … … 1754 1746 while (Walker->next != (*MolWalker)->end) { 1755 1747 Walker = Walker->next; 1756 *output << AtomNo +1<< "\t";1748 *output << AtomNo << "\t"; 1757 1749 *output << Walker->Name << "\t"; 1758 1750 *output << (*MolWalker)->name << "\t"; 1759 *output << MolCounter +1<< "\t";1751 *output << MolCounter << "\t"; 1760 1752 *output << Walker->node->x[0] << "\t" << Walker->node->x[1] << "\t" << Walker->node->x[2] << "\t"; 1761 1753 *output << (double)Walker->type->Valence << "\t"; 1762 1754 *output << Walker->type->symbol << "\t"; 1763 1755 for (BondList::iterator runner = Walker->ListOfBonds.begin(); runner != Walker->ListOfBonds.end(); runner++) 1764 *output << LocalNotoGlobalNoMap[MolCounter][ (*runner)->GetOtherAtom(Walker)->nr ] +1<< "\t";1756 *output << LocalNotoGlobalNoMap[MolCounter][ (*runner)->GetOtherAtom(Walker)->nr ] << "\t"; 1765 1757 for(int i=Walker->ListOfBonds.size(); i < MaxNeighbours; i++) 1766 1758 *output << "-\t"; … … 2131 2123 } 2132 2124 line++; 2133 } while ( (dummy1 != NULL) && ((dummy1[0] == '#') || (dummy1[0] == '\n')));2125 } while (dummy1 != NULL && (dummy1[0] == '#') || (dummy1[0] == '\n')); 2134 2126 dummy = dummy1; 2135 2127 } else { // simple int, strings or doubles start in the same line
Note:
See TracChangeset
for help on using the changeset viewer.
