Changes in src/config.cpp [b34306:a67d19]
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
src/config.cpp
rb34306 ra67d19 74 74 file= new ifstream(filename); 75 75 if (file == NULL) { 76 eLog() << Verbose(1) << "config file " << filename << " missing!" << endl;76 DoeLog(1) && (eLog()<< Verbose(1) << "config file " << filename << " missing!" << endl); 77 77 return; 78 78 } … … 85 85 file->clear(); 86 86 file->seekg(file_position, ios::beg); 87 Log() << Verbose(1) << NoLines-1 << " lines were recognized." << endl;87 DoLog(1) && (Log() << Verbose(1) << NoLines-1 << " lines were recognized." << endl); 88 88 89 89 // allocate buffer's 1st dimension 90 90 if (buffer != NULL) { 91 eLog() << Verbose(1) << "FileBuffer->buffer is not NULL!" << endl;91 DoeLog(1) && (eLog()<< Verbose(1) << "FileBuffer->buffer is not NULL!" << endl); 92 92 return; 93 93 } else … … 105 105 lines++; 106 106 } while((!file->eof()) && (lines < NoLines)); 107 Log() << Verbose(1) << lines-1 << " lines were read into the buffer." << endl;107 DoLog(1) && (Log() << Verbose(1) << lines-1 << " lines were read into the buffer." << endl); 108 108 109 109 // close and exit … … 144 144 map<const char *, int, IonTypeCompare> IonTypeLineMap; 145 145 if (LineMapping == NULL) { 146 eLog() << Verbose(0) << "map pointer is NULL: " << LineMapping << endl;146 DoeLog(0) && (eLog()<< Verbose(0) << "map pointer is NULL: " << LineMapping << endl); 147 147 performCriticalExit(); 148 148 return; … … 160 160 LineMapping[CurrentLine+(nr++)] = runner->second; 161 161 else { 162 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); 163 163 performCriticalExit(); 164 164 } … … 250 250 Thermostat = None; 251 251 } else { 252 Log() << Verbose(1) << "Warning: " << ThermostatNames[0] << " thermostat not implemented, falling back to None." << endl;252 DoLog(1) && (Log() << Verbose(1) << "Warning: " << ThermostatNames[0] << " thermostat not implemented, falling back to None." << endl); 253 253 Thermostat = None; 254 254 } … … 258 258 ParseForParameter(verbose,fb,"Thermostat", 0, 2, 1, int_type, &ScaleTempStep, 1, critical); // read scaling frequency 259 259 } else { 260 Log() << Verbose(1) << "Warning: " << ThermostatNames[0] << " thermostat not implemented, falling back to None." << endl;260 DoLog(1) && (Log() << Verbose(1) << "Warning: " << ThermostatNames[0] << " thermostat not implemented, falling back to None." << endl); 261 261 Thermostat = None; 262 262 } … … 266 266 ParseForParameter(verbose,fb,"Thermostat", 0, 2, 1, int_type, &ScaleTempStep, 1, critical); // read collision rate 267 267 } else { 268 Log() << Verbose(1) << "Warning: " << ThermostatNames[0] << " thermostat not implemented, falling back to None." << endl;268 DoLog(1) && (Log() << Verbose(1) << "Warning: " << ThermostatNames[0] << " thermostat not implemented, falling back to None." << endl); 269 269 Thermostat = None; 270 270 } … … 274 274 ParseForParameter(verbose,fb,"Thermostat", 0, 2, 1, double_type, &TempFrequency, 1, critical); // read gamma 275 275 if (ParseForParameter(verbose,fb,"Thermostat", 0, 3, 1, double_type, &alpha, 1, optional)) { 276 Log() << Verbose(2) << "Extended Stochastic Thermostat detected with interpolation coefficient " << alpha << "." << endl;276 DoLog(2) && (Log() << Verbose(2) << "Extended Stochastic Thermostat detected with interpolation coefficient " << alpha << "." << endl); 277 277 } else { 278 278 alpha = 1.; 279 279 } 280 280 } else { 281 Log() << Verbose(1) << "Warning: " << ThermostatNames[0] << " thermostat not implemented, falling back to None." << endl;281 DoLog(1) && (Log() << Verbose(1) << "Warning: " << ThermostatNames[0] << " thermostat not implemented, falling back to None." << endl); 282 282 Thermostat = None; 283 283 } … … 287 287 ParseForParameter(verbose,fb,"Thermostat", 0, 2, 1, double_type, &TempFrequency, 1, critical); // read \tau_T 288 288 } else { 289 Log() << Verbose(1) << "Warning: " << ThermostatNames[0] << " thermostat not implemented, falling back to None." << endl;289 DoLog(1) && (Log() << Verbose(1) << "Warning: " << ThermostatNames[0] << " thermostat not implemented, falling back to None." << endl); 290 290 Thermostat = None; 291 291 } … … 296 296 alpha = 0.; 297 297 } else { 298 Log() << Verbose(1) << "Warning: " << ThermostatNames[0] << " thermostat not implemented, falling back to None." << endl;298 DoLog(1) && (Log() << Verbose(1) << "Warning: " << ThermostatNames[0] << " thermostat not implemented, falling back to None." << endl); 299 299 Thermostat = None; 300 300 } 301 301 } else { 302 Log() << Verbose(1) << " Warning: thermostat name was not understood!" << endl;302 DoLog(1) && (Log() << Verbose(1) << " Warning: thermostat name was not understood!" << endl); 303 303 Thermostat = None; 304 304 } 305 305 } else { 306 306 if ((MaxOuterStep > 0) && (TargetTemp != 0)) 307 Log() << Verbose(2) << "No thermostat chosen despite finite temperature MD, falling back to None." << endl;307 DoLog(2) && (Log() << Verbose(2) << "No thermostat chosen despite finite temperature MD, falling back to None." << endl); 308 308 Thermostat = None; 309 309 } … … 321 321 322 322 do { 323 Log() << Verbose(0) << "===========EDIT CONFIGURATION============================" << endl;324 Log() << Verbose(0) << " A - mainname (prefix for all runtime files)" << endl;325 Log() << Verbose(0) << " B - Default path (for runtime files)" << endl;326 Log() << Verbose(0) << " C - Path of pseudopotential files" << endl;327 Log() << Verbose(0) << " D - Number of coefficient sharing processes" << endl;328 Log() << Verbose(0) << " E - Number of wave function sharing processes" << endl;329 Log() << Verbose(0) << " F - 0: Don't output density for OpenDX, 1: do" << endl;330 Log() << Verbose(0) << " G - 0: Don't output physical data, 1: do" << endl;331 Log() << Verbose(0) << " H - 0: Don't output densities of each unperturbed orbital for OpenDX, 1: do" << endl;332 Log() << Verbose(0) << " I - 0: Don't output current density for OpenDX, 1: do" << endl;333 Log() << Verbose(0) << " J - 0: Don't do the full current calculation, 1: do" << endl;334 Log() << Verbose(0) << " K - 0: Don't do perturbation calculation to obtain susceptibility and shielding, 1: do" << endl;335 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 Log() << Verbose(0) << " M - Absolute begin of unphysical sawtooth transfer for position operator within cell" << endl;337 Log() << Verbose(0) << " N - (0,1,2) x,y,z-plane to do two-dimensional current vector cut" << endl;338 Log() << Verbose(0) << " O - Absolute position along vector cut axis for cut plane" << endl;339 Log() << Verbose(0) << " P - Additional Gram-Schmidt-Orthonormalization to stabilize numerics" << endl;340 Log() << Verbose(0) << " Q - Initial integer value of random number generator" << endl;341 Log() << Verbose(0) << " R - for perturbation 0, for structure optimization defines upper limit of iterations" << endl;342 Log() << Verbose(0) << " T - Output visual after ...th step" << endl;343 Log() << Verbose(0) << " U - Output source densities of wave functions after ...th step" << endl;344 Log() << Verbose(0) << " X - minimization iterations per wave function, if unsure leave at default value 0" << endl;345 Log() << Verbose(0) << " Y - tolerance value for total spread in iterative Jacobi diagonalization" << endl;346 Log() << Verbose(0) << " Z - Maximum number of minimization iterations" << endl;347 Log() << Verbose(0) << " a - Relative change in total energy to stop min. iteration" << endl;348 Log() << Verbose(0) << " b - Relative change in kinetic energy to stop min. iteration" << endl;349 Log() << Verbose(0) << " c - Check stop conditions every ..th step during min. iteration" << endl;350 Log() << Verbose(0) << " e - Maximum number of minimization iterations during initial level" << endl;351 Log() << Verbose(0) << " f - Relative change in total energy to stop min. iteration during initial level" << endl;352 Log() << Verbose(0) << " g - Relative change in kinetic energy to stop min. iteration during initial level" << endl;353 Log() << Verbose(0) << " h - Check stop conditions every ..th step during min. iteration during initial level" << endl;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); 354 354 // Log() << Verbose(0) << " j - six lower diagonal entries of matrix, defining the unit cell" << endl; 355 Log() << Verbose(0) << " k - Energy cutoff of plane wave basis in Hartree" << endl;356 Log() << Verbose(0) << " l - Maximum number of levels in multi-level-ansatz" << endl;357 Log() << Verbose(0) << " m - Factor by which grid nodes increase between standard and upper level" << endl;358 Log() << Verbose(0) << " n - 0: Don't use RiemannTensor, 1: Do" << endl;359 Log() << Verbose(0) << " o - Factor by which grid nodes increase between Riemann and standard(?) level" << endl;360 Log() << Verbose(0) << " p - Number of Riemann levels" << endl;361 Log() << Verbose(0) << " r - 0: Don't Use RiemannTensor, 1: Do" << endl;362 Log() << Verbose(0) << " s - 0: Doubly occupied orbitals, 1: Up-/Down-Orbitals" << endl;363 Log() << Verbose(0) << " t - Number of orbitals (depends pn SpinType)" << endl;364 Log() << Verbose(0) << " u - Number of SpinUp orbitals (depends on SpinType)" << endl;365 Log() << Verbose(0) << " v - Number of SpinDown orbitals (depends on SpinType)" << endl;366 Log() << Verbose(0) << " w - Number of additional, unoccupied orbitals" << endl;367 Log() << Verbose(0) << " x - radial cutoff for ewald summation in Bohrradii" << endl;368 Log() << Verbose(0) << " y - 0: Don't do structure optimization beforehand, 1: Do" << endl;369 Log() << Verbose(0) << " z - 0: Units are in Bohr radii, 1: units are in Aengstrom" << endl;370 Log() << Verbose(0) << " i - 0: Coordinates given in file are absolute, 1: ... are relative to unit cell" << endl;371 Log() << Verbose(0) << "=========================================================" << endl;372 Log() << Verbose(0) << "INPUT: ";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: "); 373 373 cin >> choice; 374 374 375 375 switch (choice) { 376 376 case 'A': // mainname 377 Log() << Verbose(0) << "Old: " << config::mainname << "\t new: ";377 DoLog(0) && (Log() << Verbose(0) << "Old: " << config::mainname << "\t new: "); 378 378 cin >> config::mainname; 379 379 break; 380 380 case 'B': // defaultpath 381 Log() << Verbose(0) << "Old: " << config::defaultpath << "\t new: ";381 DoLog(0) && (Log() << Verbose(0) << "Old: " << config::defaultpath << "\t new: "); 382 382 cin >> config::defaultpath; 383 383 break; 384 384 case 'C': // pseudopotpath 385 Log() << Verbose(0) << "Old: " << config::pseudopotpath << "\t new: ";385 DoLog(0) && (Log() << Verbose(0) << "Old: " << config::pseudopotpath << "\t new: "); 386 386 cin >> config::pseudopotpath; 387 387 break; 388 388 389 389 case 'D': // ProcPEGamma 390 Log() << Verbose(0) << "Old: " << config::ProcPEGamma << "\t new: ";390 DoLog(0) && (Log() << Verbose(0) << "Old: " << config::ProcPEGamma << "\t new: "); 391 391 cin >> config::ProcPEGamma; 392 392 break; 393 393 case 'E': // ProcPEPsi 394 Log() << Verbose(0) << "Old: " << config::ProcPEPsi << "\t new: ";394 DoLog(0) && (Log() << Verbose(0) << "Old: " << config::ProcPEPsi << "\t new: "); 395 395 cin >> config::ProcPEPsi; 396 396 break; 397 397 case 'F': // DoOutVis 398 Log() << Verbose(0) << "Old: " << config::DoOutVis << "\t new: ";398 DoLog(0) && (Log() << Verbose(0) << "Old: " << config::DoOutVis << "\t new: "); 399 399 cin >> config::DoOutVis; 400 400 break; 401 401 case 'G': // DoOutMes 402 Log() << Verbose(0) << "Old: " << config::DoOutMes << "\t new: ";402 DoLog(0) && (Log() << Verbose(0) << "Old: " << config::DoOutMes << "\t new: "); 403 403 cin >> config::DoOutMes; 404 404 break; 405 405 case 'H': // DoOutOrbitals 406 Log() << Verbose(0) << "Old: " << config::DoOutOrbitals << "\t new: ";406 DoLog(0) && (Log() << Verbose(0) << "Old: " << config::DoOutOrbitals << "\t new: "); 407 407 cin >> config::DoOutOrbitals; 408 408 break; 409 409 case 'I': // DoOutCurrent 410 Log() << Verbose(0) << "Old: " << config::DoOutCurrent << "\t new: ";410 DoLog(0) && (Log() << Verbose(0) << "Old: " << config::DoOutCurrent << "\t new: "); 411 411 cin >> config::DoOutCurrent; 412 412 break; 413 413 case 'J': // DoFullCurrent 414 Log() << Verbose(0) << "Old: " << config::DoFullCurrent << "\t new: ";414 DoLog(0) && (Log() << Verbose(0) << "Old: " << config::DoFullCurrent << "\t new: "); 415 415 cin >> config::DoFullCurrent; 416 416 break; 417 417 case 'K': // DoPerturbation 418 Log() << Verbose(0) << "Old: " << config::DoPerturbation << "\t new: ";418 DoLog(0) && (Log() << Verbose(0) << "Old: " << config::DoPerturbation << "\t new: "); 419 419 cin >> config::DoPerturbation; 420 420 break; 421 421 case 'L': // CommonWannier 422 Log() << Verbose(0) << "Old: " << config::CommonWannier << "\t new: ";422 DoLog(0) && (Log() << Verbose(0) << "Old: " << config::CommonWannier << "\t new: "); 423 423 cin >> config::CommonWannier; 424 424 break; 425 425 case 'M': // SawtoothStart 426 Log() << Verbose(0) << "Old: " << config::SawtoothStart << "\t new: ";426 DoLog(0) && (Log() << Verbose(0) << "Old: " << config::SawtoothStart << "\t new: "); 427 427 cin >> config::SawtoothStart; 428 428 break; 429 429 case 'N': // VectorPlane 430 Log() << Verbose(0) << "Old: " << config::VectorPlane << "\t new: ";430 DoLog(0) && (Log() << Verbose(0) << "Old: " << config::VectorPlane << "\t new: "); 431 431 cin >> config::VectorPlane; 432 432 break; 433 433 case 'O': // VectorCut 434 Log() << Verbose(0) << "Old: " << config::VectorCut << "\t new: ";434 DoLog(0) && (Log() << Verbose(0) << "Old: " << config::VectorCut << "\t new: "); 435 435 cin >> config::VectorCut; 436 436 break; 437 437 case 'P': // UseAddGramSch 438 Log() << Verbose(0) << "Old: " << config::UseAddGramSch << "\t new: ";438 DoLog(0) && (Log() << Verbose(0) << "Old: " << config::UseAddGramSch << "\t new: "); 439 439 cin >> config::UseAddGramSch; 440 440 break; 441 441 case 'Q': // Seed 442 Log() << Verbose(0) << "Old: " << config::Seed << "\t new: ";442 DoLog(0) && (Log() << Verbose(0) << "Old: " << config::Seed << "\t new: "); 443 443 cin >> config::Seed; 444 444 break; 445 445 446 446 case 'R': // MaxOuterStep 447 Log() << Verbose(0) << "Old: " << config::MaxOuterStep << "\t new: ";447 DoLog(0) && (Log() << Verbose(0) << "Old: " << config::MaxOuterStep << "\t new: "); 448 448 cin >> config::MaxOuterStep; 449 449 break; 450 450 case 'T': // OutVisStep 451 Log() << Verbose(0) << "Old: " << config::OutVisStep << "\t new: ";451 DoLog(0) && (Log() << Verbose(0) << "Old: " << config::OutVisStep << "\t new: "); 452 452 cin >> config::OutVisStep; 453 453 break; 454 454 case 'U': // OutSrcStep 455 Log() << Verbose(0) << "Old: " << config::OutSrcStep << "\t new: ";455 DoLog(0) && (Log() << Verbose(0) << "Old: " << config::OutSrcStep << "\t new: "); 456 456 cin >> config::OutSrcStep; 457 457 break; 458 458 case 'X': // MaxPsiStep 459 Log() << Verbose(0) << "Old: " << config::MaxPsiStep << "\t new: ";459 DoLog(0) && (Log() << Verbose(0) << "Old: " << config::MaxPsiStep << "\t new: "); 460 460 cin >> config::MaxPsiStep; 461 461 break; 462 462 case 'Y': // EpsWannier 463 Log() << Verbose(0) << "Old: " << config::EpsWannier << "\t new: ";463 DoLog(0) && (Log() << Verbose(0) << "Old: " << config::EpsWannier << "\t new: "); 464 464 cin >> config::EpsWannier; 465 465 break; 466 466 467 467 case 'Z': // MaxMinStep 468 Log() << Verbose(0) << "Old: " << config::MaxMinStep << "\t new: ";468 DoLog(0) && (Log() << Verbose(0) << "Old: " << config::MaxMinStep << "\t new: "); 469 469 cin >> config::MaxMinStep; 470 470 break; 471 471 case 'a': // RelEpsTotalEnergy 472 Log() << Verbose(0) << "Old: " << config::RelEpsTotalEnergy << "\t new: ";472 DoLog(0) && (Log() << Verbose(0) << "Old: " << config::RelEpsTotalEnergy << "\t new: "); 473 473 cin >> config::RelEpsTotalEnergy; 474 474 break; 475 475 case 'b': // RelEpsKineticEnergy 476 Log() << Verbose(0) << "Old: " << config::RelEpsKineticEnergy << "\t new: ";476 DoLog(0) && (Log() << Verbose(0) << "Old: " << config::RelEpsKineticEnergy << "\t new: "); 477 477 cin >> config::RelEpsKineticEnergy; 478 478 break; 479 479 case 'c': // MaxMinStopStep 480 Log() << Verbose(0) << "Old: " << config::MaxMinStopStep << "\t new: ";480 DoLog(0) && (Log() << Verbose(0) << "Old: " << config::MaxMinStopStep << "\t new: "); 481 481 cin >> config::MaxMinStopStep; 482 482 break; 483 483 case 'e': // MaxInitMinStep 484 Log() << Verbose(0) << "Old: " << config::MaxInitMinStep << "\t new: ";484 DoLog(0) && (Log() << Verbose(0) << "Old: " << config::MaxInitMinStep << "\t new: "); 485 485 cin >> config::MaxInitMinStep; 486 486 break; 487 487 case 'f': // InitRelEpsTotalEnergy 488 Log() << Verbose(0) << "Old: " << config::InitRelEpsTotalEnergy << "\t new: ";488 DoLog(0) && (Log() << Verbose(0) << "Old: " << config::InitRelEpsTotalEnergy << "\t new: "); 489 489 cin >> config::InitRelEpsTotalEnergy; 490 490 break; 491 491 case 'g': // InitRelEpsKineticEnergy 492 Log() << Verbose(0) << "Old: " << config::InitRelEpsKineticEnergy << "\t new: ";492 DoLog(0) && (Log() << Verbose(0) << "Old: " << config::InitRelEpsKineticEnergy << "\t new: "); 493 493 cin >> config::InitRelEpsKineticEnergy; 494 494 break; 495 495 case 'h': // InitMaxMinStopStep 496 Log() << Verbose(0) << "Old: " << config::InitMaxMinStopStep << "\t new: ";496 DoLog(0) && (Log() << Verbose(0) << "Old: " << config::InitMaxMinStopStep << "\t new: "); 497 497 cin >> config::InitMaxMinStopStep; 498 498 break; … … 508 508 509 509 case 'k': // ECut 510 Log() << Verbose(0) << "Old: " << config::ECut << "\t new: ";510 DoLog(0) && (Log() << Verbose(0) << "Old: " << config::ECut << "\t new: "); 511 511 cin >> config::ECut; 512 512 break; 513 513 case 'l': // MaxLevel 514 Log() << Verbose(0) << "Old: " << config::MaxLevel << "\t new: ";514 DoLog(0) && (Log() << Verbose(0) << "Old: " << config::MaxLevel << "\t new: "); 515 515 cin >> config::MaxLevel; 516 516 break; 517 517 case 'm': // RiemannTensor 518 Log() << Verbose(0) << "Old: " << config::RiemannTensor << "\t new: ";518 DoLog(0) && (Log() << Verbose(0) << "Old: " << config::RiemannTensor << "\t new: "); 519 519 cin >> config::RiemannTensor; 520 520 break; 521 521 case 'n': // LevRFactor 522 Log() << Verbose(0) << "Old: " << config::LevRFactor << "\t new: ";522 DoLog(0) && (Log() << Verbose(0) << "Old: " << config::LevRFactor << "\t new: "); 523 523 cin >> config::LevRFactor; 524 524 break; 525 525 case 'o': // RiemannLevel 526 Log() << Verbose(0) << "Old: " << config::RiemannLevel << "\t new: ";526 DoLog(0) && (Log() << Verbose(0) << "Old: " << config::RiemannLevel << "\t new: "); 527 527 cin >> config::RiemannLevel; 528 528 break; 529 529 case 'p': // Lev0Factor 530 Log() << Verbose(0) << "Old: " << config::Lev0Factor << "\t new: ";530 DoLog(0) && (Log() << Verbose(0) << "Old: " << config::Lev0Factor << "\t new: "); 531 531 cin >> config::Lev0Factor; 532 532 break; 533 533 case 'r': // RTActualUse 534 Log() << Verbose(0) << "Old: " << config::RTActualUse << "\t new: ";534 DoLog(0) && (Log() << Verbose(0) << "Old: " << config::RTActualUse << "\t new: "); 535 535 cin >> config::RTActualUse; 536 536 break; 537 537 case 's': // PsiType 538 Log() << Verbose(0) << "Old: " << config::PsiType << "\t new: ";538 DoLog(0) && (Log() << Verbose(0) << "Old: " << config::PsiType << "\t new: "); 539 539 cin >> config::PsiType; 540 540 break; 541 541 case 't': // MaxPsiDouble 542 Log() << Verbose(0) << "Old: " << config::MaxPsiDouble << "\t new: ";542 DoLog(0) && (Log() << Verbose(0) << "Old: " << config::MaxPsiDouble << "\t new: "); 543 543 cin >> config::MaxPsiDouble; 544 544 break; 545 545 case 'u': // PsiMaxNoUp 546 Log() << Verbose(0) << "Old: " << config::PsiMaxNoUp << "\t new: ";546 DoLog(0) && (Log() << Verbose(0) << "Old: " << config::PsiMaxNoUp << "\t new: "); 547 547 cin >> config::PsiMaxNoUp; 548 548 break; 549 549 case 'v': // PsiMaxNoDown 550 Log() << Verbose(0) << "Old: " << config::PsiMaxNoDown << "\t new: ";550 DoLog(0) && (Log() << Verbose(0) << "Old: " << config::PsiMaxNoDown << "\t new: "); 551 551 cin >> config::PsiMaxNoDown; 552 552 break; 553 553 case 'w': // AddPsis 554 Log() << Verbose(0) << "Old: " << config::AddPsis << "\t new: ";554 DoLog(0) && (Log() << Verbose(0) << "Old: " << config::AddPsis << "\t new: "); 555 555 cin >> config::AddPsis; 556 556 break; 557 557 558 558 case 'x': // RCut 559 Log() << Verbose(0) << "Old: " << config::RCut << "\t new: ";559 DoLog(0) && (Log() << Verbose(0) << "Old: " << config::RCut << "\t new: "); 560 560 cin >> config::RCut; 561 561 break; 562 562 case 'y': // StructOpt 563 Log() << Verbose(0) << "Old: " << config::StructOpt << "\t new: ";563 DoLog(0) && (Log() << Verbose(0) << "Old: " << config::StructOpt << "\t new: "); 564 564 cin >> config::StructOpt; 565 565 break; 566 566 case 'z': // IsAngstroem 567 Log() << Verbose(0) << "Old: " << config::IsAngstroem << "\t new: ";567 DoLog(0) && (Log() << Verbose(0) << "Old: " << config::IsAngstroem << "\t new: "); 568 568 cin >> config::IsAngstroem; 569 569 break; 570 570 case 'i': // RelativeCoord 571 Log() << Verbose(0) << "Old: " << config::RelativeCoord << "\t new: ";571 DoLog(0) && (Log() << Verbose(0) << "Old: " << config::RelativeCoord << "\t new: "); 572 572 cin >> config::RelativeCoord; 573 573 break; … … 648 648 } 649 649 strcpy(configname, ptr); 650 Log() << Verbose(0) << "Found configpath: " << configpath << ", dir slash was found at " << last << ", config name is " << configname << "." << endl;650 DoLog(0) && (Log() << Verbose(0) << "Found configpath: " << configpath << ", dir slash was found at " << last << ", config name is " << configname << "." << endl); 651 651 delete[](buffer); 652 652 }; … … 659 659 { 660 660 if (FileBuffer != NULL) { 661 eLog() << Verbose(2) << "deleting present FileBuffer in PrepareFileBuffer()." << endl;661 DoeLog(2) && (eLog()<< Verbose(2) << "deleting present FileBuffer in PrepareFileBuffer()." << endl); 662 662 delete(FileBuffer); 663 663 } … … 685 685 686 686 if (mol == NULL) { 687 eLog() << Verbose(0) << "Molecule is not allocated in LoadMolecule(), exit.";687 DoeLog(0) && (eLog()<< Verbose(0) << "Molecule is not allocated in LoadMolecule(), exit."); 688 688 performCriticalExit(); 689 689 } … … 691 691 ParseForParameter(verbose,FileBuffer,"MaxTypes", 0, 1, 1, int_type, &(MaxTypes), 1, critical); 692 692 if (MaxTypes == 0) { 693 eLog() << Verbose(1) << "There are no atoms according to MaxTypes in this config file." << endl;693 DoeLog(1) && (eLog()<< Verbose(1) << "There are no atoms according to MaxTypes in this config file." << endl); 694 694 //performCriticalExit(); 695 695 } else { 696 696 // prescan number of ions per type 697 Log() << Verbose(0) << "Prescanning ions per type: " << endl;697 DoLog(0) && (Log() << Verbose(0) << "Prescanning ions per type: " << endl); 698 698 int NoAtoms = 0; 699 699 for (int i=0; i < MaxTypes; i++) { … … 702 702 ParseForParameter(verbose,FileBuffer, name, 0, 2, 1, int_type, &Z, 1, critical); 703 703 elementhash[i] = periode->FindElement(Z); 704 Log() << Verbose(1) << i << ". Z = " << elementhash[i]->Z << " with " << No[i] << " ions." << endl;704 DoLog(1) && (Log() << Verbose(1) << i << ". Z = " << elementhash[i]->Z << " with " << No[i] << " ions." << endl); 705 705 NoAtoms += No[i]; 706 706 } … … 710 710 sprintf(name,"Ion_Type%i",MaxTypes); 711 711 if (!ParseForParameter(verbose,FileBuffer, (const char*)name, 1, 1, 1, int_type, &value[0], 1, critical)) { 712 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); 713 713 performCriticalExit(); 714 714 return; … … 728 728 bool status = true; 729 729 while (status) { 730 Log() << Verbose(0) << "Currently parsing MD step " << repetition << "." << endl;730 DoLog(0) && (Log() << Verbose(0) << "Currently parsing MD step " << repetition << "." << endl); 731 731 for (int i=0; i < MaxTypes; i++) { 732 732 sprintf(name,"Ion_Type%i",i+1); … … 794 794 } 795 795 repetition--; 796 Log() << Verbose(0) << "Found " << repetition << " trajectory steps." << endl;796 DoLog(0) && (Log() << Verbose(0) << "Found " << repetition << " trajectory steps." << endl); 797 797 if (repetition <= 1) // if onyl one step, desactivate use of trajectories 798 798 mol->MDSteps = 0; … … 806 806 ParseForParameter(verbose,FileBuffer, "Ion_Type1_1", 0, 3, 1, double_type, &value[2], repetition, (repetition == 0) ? critical : optional)) 807 807 repetition++; 808 Log() << Verbose(0) << "I found " << repetition << " times the keyword Ion_Type1_1." << endl;808 DoLog(0) && (Log() << Verbose(0) << "I found " << repetition << " times the keyword Ion_Type1_1." << endl); 809 809 // parse in molecule coordinates 810 810 for (int i=0; i < MaxTypes; i++) { … … 855 855 ifstream *file = new ifstream(filename); 856 856 if (file == NULL) { 857 eLog() << Verbose(1) << "config file " << filename << " missing!" << endl;857 DoeLog(1) && (eLog()<< Verbose(1) << "config file " << filename << " missing!" << endl); 858 858 return; 859 859 } … … 1063 1063 BG = new BondGraph(IsAngstroem); 1064 1064 if (BG->LoadBondLengthTable(BondGraphFileName)) { 1065 Log() << Verbose(0) << "Bond length table loaded successfully." << endl;1065 DoLog(0) && (Log() << Verbose(0) << "Bond length table loaded successfully." << endl); 1066 1066 } else { 1067 eLog() << Verbose(1) << "Bond length table loading failed." << endl;1067 DoeLog(1) && (eLog()<< Verbose(1) << "Bond length table loading failed." << endl); 1068 1068 } 1069 1069 } … … 1094 1094 ifstream *file = new ifstream(filename); 1095 1095 if (file == NULL) { 1096 eLog() << Verbose(1) << "config file " << filename << " missing!" << endl;1096 DoeLog(1) && (eLog()<< Verbose(1) << "config file " << filename << " missing!" << endl); 1097 1097 return; 1098 1098 } … … 1254 1254 BG = new BondGraph(IsAngstroem); 1255 1255 if (BG->LoadBondLengthTable(BondGraphFileName)) { 1256 Log() << Verbose(0) << "Bond length table loaded successfully." << endl;1256 DoLog(0) && (Log() << Verbose(0) << "Bond length table loaded successfully." << endl); 1257 1257 } else { 1258 Log() << Verbose(0) << "Bond length table loading failed." << endl;1258 DoLog(0) && (Log() << Verbose(0) << "Bond length table loading failed." << endl); 1259 1259 } 1260 1260 … … 1263 1263 for (i=MAX_ELEMENTS;i--;) 1264 1264 elementhash[i] = NULL; 1265 Log() << Verbose(0) << "Parsing Ions ..." << endl;1265 DoLog(0) && (Log() << Verbose(0) << "Parsing Ions ..." << endl); 1266 1266 No=0; 1267 1267 found = 0; 1268 1268 while (getline(*file,zeile,'\n')) { 1269 1269 if (zeile.find("Ions_Data") == 0) { 1270 Log() << Verbose(1) << "found Ions_Data...begin parsing" << endl;1270 DoLog(1) && (Log() << Verbose(1) << "found Ions_Data...begin parsing" << endl); 1271 1271 found ++; 1272 1272 } … … 1282 1282 input >> b; // element mass 1283 1283 elementhash[No] = periode->FindElement(Z); 1284 Log() << Verbose(1) << "AtomNo: " << AtomNo << "\tZ: " << Z << "\ta:" << a << "\tl:" << l << "\b:" << b << "\tElement:" << elementhash[No] << "\t:" << endl;1284 DoLog(1) && (Log() << Verbose(1) << "AtomNo: " << AtomNo << "\tZ: " << Z << "\ta:" << a << "\tl:" << l << "\b:" << b << "\tElement:" << elementhash[No] << "\t:" << endl); 1285 1285 for(i=0;i<AtomNo;i++) { 1286 1286 if (!getline(*file,zeile,'\n')) {// parse on and on 1287 Log() << Verbose(2) << "Error: Too few items in ionic list of element" << elementhash[No] << "." << endl << "Exiting." << endl;1287 DoLog(2) && (Log() << Verbose(2) << "Error: Too few items in ionic list of element" << elementhash[No] << "." << endl << "Exiting." << endl); 1288 1288 // return 1; 1289 1289 } else { … … 1433 1433 return result; 1434 1434 } else { 1435 eLog() << Verbose(1) << "Cannot open output file:" << filename << endl;1435 DoeLog(1) && (eLog()<< Verbose(1) << "Cannot open output file:" << filename << endl); 1436 1436 return false; 1437 1437 } … … 1455 1455 output = new ofstream(fname->str().c_str(), ios::out); 1456 1456 if (output == NULL) { 1457 eLog() << Verbose(1) << "Cannot open mpqc output file:" << fname << endl;1457 DoeLog(1) && (eLog()<< Verbose(1) << "Cannot open mpqc output file:" << fname << endl); 1458 1458 delete(fname); 1459 1459 return false; … … 1498 1498 output = new ofstream(fname->str().c_str(), ios::out); 1499 1499 if (output == NULL) { 1500 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); 1501 1501 delete(fname); 1502 1502 return false; … … 1554 1554 f = fopen(name, "w" ); 1555 1555 if (f == NULL) { 1556 eLog() << Verbose(1) << "Cannot open pdb output file:" << name << endl;1556 DoeLog(1) && (eLog()<< Verbose(1) << "Cannot open pdb output file:" << name << endl); 1557 1557 return false; 1558 1558 } … … 1609 1609 f = fopen(name, "w" ); 1610 1610 if (f == NULL) { 1611 eLog() << Verbose(1) << "Cannot open pdb output file:" << name << endl;1611 DoeLog(1) && (eLog()<< Verbose(1) << "Cannot open pdb output file:" << name << endl); 1612 1612 Free(&elementNo); 1613 1613 return false; … … 1646 1646 /** Stores all atoms in a TREMOLO data input file. 1647 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! 1648 1649 * \param *filename name of file (without ".in" suffix!) 1649 1650 * \param *mol pointer to molecule … … 1658 1659 output = new ofstream(fname->str().c_str(), ios::out); 1659 1660 if (output == NULL) { 1660 eLog() << Verbose(1) << "Cannot open tremolo output file:" << fname << endl;1661 DoeLog(1) && (eLog()<< Verbose(1) << "Cannot open tremolo output file:" << fname << endl); 1661 1662 delete(fname); 1662 1663 return false; … … 1700 1701 /** Stores all atoms from all molecules in a TREMOLO data input file. 1701 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! 1702 1704 * \param *filename name of file (without ".in" suffix!) 1703 1705 * \param *MolList pointer to MoleculeListClass containing all atoms … … 1712 1714 output = new ofstream(fname->str().c_str(), ios::out); 1713 1715 if (output == NULL) { 1714 eLog() << Verbose(1) << "Cannot open tremolo output file:" << fname << endl;1716 DoeLog(1) && (eLog()<< Verbose(1) << "Cannot open tremolo output file:" << fname << endl); 1715 1717 delete(fname); 1716 1718 return false; … … 1752 1754 while (Walker->next != (*MolWalker)->end) { 1753 1755 Walker = Walker->next; 1754 *output << AtomNo << "\t";1756 *output << AtomNo+1 << "\t"; 1755 1757 *output << Walker->Name << "\t"; 1756 1758 *output << (*MolWalker)->name << "\t"; 1757 *output << MolCounter << "\t";1759 *output << MolCounter+1 << "\t"; 1758 1760 *output << Walker->node->x[0] << "\t" << Walker->node->x[1] << "\t" << Walker->node->x[2] << "\t"; 1759 1761 *output << (double)Walker->type->Valence << "\t"; 1760 1762 *output << Walker->type->symbol << "\t"; 1761 1763 for (BondList::iterator runner = Walker->ListOfBonds.begin(); runner != Walker->ListOfBonds.end(); runner++) 1762 *output << LocalNotoGlobalNoMap[MolCounter][ (*runner)->GetOtherAtom(Walker)->nr ] << "\t";1764 *output << LocalNotoGlobalNoMap[MolCounter][ (*runner)->GetOtherAtom(Walker)->nr ]+1 << "\t"; 1763 1765 for(int i=Walker->ListOfBonds.size(); i < MaxNeighbours; i++) 1764 1766 *output << "-\t";
Note:
See TracChangeset
for help on using the changeset viewer.