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