Changeset 1f2e46 for molecuilder/src/builder.cpp
- Timestamp:
- Apr 22, 2010, 2:00:03 PM (16 years ago)
- Children:
- 423c7b
- Parents:
- c43766
- File:
-
- 1 edited
-
molecuilder/src/builder.cpp (modified) (110 diffs)
Legend:
- Unmodified
- Added
- Removed
-
molecuilder/src/builder.cpp
rc43766 r1f2e46 132 132 if (!valid) DoeLog(2) && (eLog()<< Verbose(2) << "Resulting position out of cell." << endl); 133 133 second = mol->AskAtom("Enter atom number: "); 134 Log() << Verbose(0) << "Enter relative coordinates." << endl;134 DoLog(0) && (Log() << Verbose(0) << "Enter relative coordinates." << endl); 135 135 first->x.AskPosition(World::get()->cell_size, false); 136 136 for (int i=NDIM;i--;) { … … 175 175 continue; 176 176 } 177 Log() << Verbose(0) << "resulting relative coordinates: ";177 DoLog(0) && (Log() << Verbose(0) << "resulting relative coordinates: "); 178 178 z.Output(); 179 Log() << Verbose(0) << endl;179 DoLog(0) && (Log() << Verbose(0) << endl); 180 180 */ 181 181 // calc axis vector … … 185 185 Log() << Verbose(0) << "x: ", 186 186 x.Output(); 187 Log() << Verbose(0) << endl;187 DoLog(0) && (Log() << Verbose(0) << endl); 188 188 z.MakeNormalVector(&second->x,&third->x,&fourth->x); 189 189 Log() << Verbose(0) << "z: ", 190 190 z.Output(); 191 Log() << Verbose(0) << endl;191 DoLog(0) && (Log() << Verbose(0) << endl); 192 192 y.MakeNormalVector(&x,&z); 193 193 Log() << Verbose(0) << "y: ", 194 194 y.Output(); 195 Log() << Verbose(0) << endl;195 DoLog(0) && (Log() << Verbose(0) << endl); 196 196 197 197 // rotate vector around first angle … … 200 200 Log() << Verbose(0) << "Rotated vector: ", 201 201 first->x.Output(); 202 Log() << Verbose(0) << endl;202 DoLog(0) && (Log() << Verbose(0) << endl); 203 203 // remove the projection onto the rotation plane of the second angle 204 204 n.CopyVector(&y); … … 206 206 Log() << Verbose(0) << "N1: ", 207 207 n.Output(); 208 Log() << Verbose(0) << endl;208 DoLog(0) && (Log() << Verbose(0) << endl); 209 209 first->x.SubtractVector(&n); 210 210 Log() << Verbose(0) << "Subtracted vector: ", 211 211 first->x.Output(); 212 Log() << Verbose(0) << endl;212 DoLog(0) && (Log() << Verbose(0) << endl); 213 213 n.CopyVector(&z); 214 214 n.Scale(first->x.ScalarProduct(&z)); 215 215 Log() << Verbose(0) << "N2: ", 216 216 n.Output(); 217 Log() << Verbose(0) << endl;217 DoLog(0) && (Log() << Verbose(0) << endl); 218 218 first->x.SubtractVector(&n); 219 219 Log() << Verbose(0) << "2nd subtracted vector: ", 220 220 first->x.Output(); 221 Log() << Verbose(0) << endl;221 DoLog(0) && (Log() << Verbose(0) << endl); 222 222 223 223 // rotate another vector around second angle … … 226 226 Log() << Verbose(0) << "2nd Rotated vector: ", 227 227 n.Output(); 228 Log() << Verbose(0) << endl;228 DoLog(0) && (Log() << Verbose(0) << endl); 229 229 230 230 // add the two linear independent vectors … … 234 234 first->x.AddVector(&second->x); 235 235 236 Log() << Verbose(0) << "resulting coordinates: ";236 DoLog(0) && (Log() << Verbose(0) << "resulting coordinates: "); 237 237 first->x.Output(); 238 Log() << Verbose(0) << endl;238 DoLog(0) && (Log() << Verbose(0) << endl); 239 239 } while (!(valid = mol->CheckBounds((const Vector *)&first->x))); 240 240 first->type = periode->AskElement(); // give type … … 388 388 cout << Verbose(0) << "Offset vector: "; 389 389 x.Output(); 390 Log() << Verbose(0) << endl;390 DoLog(0) && (Log() << Verbose(0) << endl); 391 391 n.Normalize(); 392 392 break; 393 393 }; 394 Log() << Verbose(0) << "Alignment vector: ";394 DoLog(0) && (Log() << Verbose(0) << "Alignment vector: "); 395 395 n.Output(); 396 Log() << Verbose(0) << endl;396 DoLog(0) && (Log() << Verbose(0) << endl); 397 397 mol->Align(&n); 398 398 }; … … 407 407 char choice; // menu choice char 408 408 409 Log() << Verbose(0) << "===========MIRROR ATOMS=========================" << endl;410 Log() << Verbose(0) << " a - state three atoms defining mirror plane" << endl;411 Log() << Verbose(0) << " b - state normal vector of mirror plane" << endl;412 Log() << Verbose(0) << " c - state two atoms in normal direction" << endl;413 Log() << Verbose(0) << "all else - go back" << endl;414 Log() << Verbose(0) << "===============================================" << endl;415 Log() << Verbose(0) << "INPUT: ";409 DoLog(0) && (Log() << Verbose(0) << "===========MIRROR ATOMS=========================" << endl); 410 DoLog(0) && (Log() << Verbose(0) << " a - state three atoms defining mirror plane" << endl); 411 DoLog(0) && (Log() << Verbose(0) << " b - state normal vector of mirror plane" << endl); 412 DoLog(0) && (Log() << Verbose(0) << " c - state two atoms in normal direction" << endl); 413 DoLog(0) && (Log() << Verbose(0) << "all else - go back" << endl); 414 DoLog(0) && (Log() << Verbose(0) << "===============================================" << endl); 415 DoLog(0) && (Log() << Verbose(0) << "INPUT: "); 416 416 cin >> choice; 417 417 … … 426 426 break; 427 427 case 'b': // normal vector of mirror plane 428 Log() << Verbose(0) << "Enter normal vector of mirror plane." << endl;428 DoLog(0) && (Log() << Verbose(0) << "Enter normal vector of mirror plane." << endl); 429 429 n.AskPosition(World::get()->cell_size,0); 430 430 n.Normalize(); … … 439 439 break; 440 440 }; 441 Log() << Verbose(0) << "Normal vector: ";441 DoLog(0) && (Log() << Verbose(0) << "Normal vector: "); 442 442 n.Output(); 443 Log() << Verbose(0) << endl;443 DoLog(0) && (Log() << Verbose(0) << endl); 444 444 mol->Mirror((const Vector *)&n); 445 445 }; … … 455 455 char choice; // menu choice char 456 456 457 Log() << Verbose(0) << "===========REMOVE ATOMS=========================" << endl;458 Log() << Verbose(0) << " a - state atom for removal by number" << endl;459 Log() << Verbose(0) << " b - keep only in radius around atom" << endl;460 Log() << Verbose(0) << " c - remove this with one axis greater value" << endl;461 Log() << Verbose(0) << "all else - go back" << endl;462 Log() << Verbose(0) << "===============================================" << endl;463 Log() << Verbose(0) << "INPUT: ";457 DoLog(0) && (Log() << Verbose(0) << "===========REMOVE ATOMS=========================" << endl); 458 DoLog(0) && (Log() << Verbose(0) << " a - state atom for removal by number" << endl); 459 DoLog(0) && (Log() << Verbose(0) << " b - keep only in radius around atom" << endl); 460 DoLog(0) && (Log() << Verbose(0) << " c - remove this with one axis greater value" << endl); 461 DoLog(0) && (Log() << Verbose(0) << "all else - go back" << endl); 462 DoLog(0) && (Log() << Verbose(0) << "===============================================" << endl); 463 DoLog(0) && (Log() << Verbose(0) << "INPUT: "); 464 464 cin >> choice; 465 465 … … 468 468 case 'a': 469 469 if (mol->RemoveAtom(mol->AskAtom("Enter number of atom within molecule: "))) 470 Log() << Verbose(1) << "Atom removed." << endl;470 DoLog(1) && (Log() << Verbose(1) << "Atom removed." << endl); 471 471 else 472 Log() << Verbose(1) << "Atom not found." << endl;472 DoLog(1) && (Log() << Verbose(1) << "Atom not found." << endl); 473 473 break; 474 474 case 'b': 475 475 second = mol->AskAtom("Enter number of atom as reference point: "); 476 Log() << Verbose(0) << "Enter radius: ";476 DoLog(0) && (Log() << Verbose(0) << "Enter radius: "); 477 477 cin >> tmp1; 478 478 first = mol->start; … … 486 486 break; 487 487 case 'c': 488 Log() << Verbose(0) << "Which axis is it: ";488 DoLog(0) && (Log() << Verbose(0) << "Which axis is it: "); 489 489 cin >> axis; 490 Log() << Verbose(0) << "Lower boundary: ";490 DoLog(0) && (Log() << Verbose(0) << "Lower boundary: "); 491 491 cin >> tmp1; 492 Log() << Verbose(0) << "Upper boundary: ";492 DoLog(0) && (Log() << Verbose(0) << "Upper boundary: "); 493 493 cin >> tmp2; 494 494 first = mol->start; … … 520 520 char choice; // menu choice char 521 521 522 Log() << Verbose(0) << "===========MEASURE ATOMS=========================" << endl;523 Log() << Verbose(0) << " a - calculate bond length between one atom and all others" << endl;524 Log() << Verbose(0) << " b - calculate bond length between two atoms" << endl;525 Log() << Verbose(0) << " c - calculate bond angle" << endl;526 Log() << Verbose(0) << " d - calculate principal axis of the system" << endl;527 Log() << Verbose(0) << " e - calculate volume of the convex envelope" << endl;528 Log() << Verbose(0) << " f - calculate temperature from current velocity" << endl;529 Log() << Verbose(0) << " g - output all temperatures per step from velocities" << endl;530 Log() << Verbose(0) << "all else - go back" << endl;531 Log() << Verbose(0) << "===============================================" << endl;532 Log() << Verbose(0) << "INPUT: ";522 DoLog(0) && (Log() << Verbose(0) << "===========MEASURE ATOMS=========================" << endl); 523 DoLog(0) && (Log() << Verbose(0) << " a - calculate bond length between one atom and all others" << endl); 524 DoLog(0) && (Log() << Verbose(0) << " b - calculate bond length between two atoms" << endl); 525 DoLog(0) && (Log() << Verbose(0) << " c - calculate bond angle" << endl); 526 DoLog(0) && (Log() << Verbose(0) << " d - calculate principal axis of the system" << endl); 527 DoLog(0) && (Log() << Verbose(0) << " e - calculate volume of the convex envelope" << endl); 528 DoLog(0) && (Log() << Verbose(0) << " f - calculate temperature from current velocity" << endl); 529 DoLog(0) && (Log() << Verbose(0) << " g - output all temperatures per step from velocities" << endl); 530 DoLog(0) && (Log() << Verbose(0) << "all else - go back" << endl); 531 DoLog(0) && (Log() << Verbose(0) << "===============================================" << endl); 532 DoLog(0) && (Log() << Verbose(0) << "INPUT: "); 533 533 cin >> choice; 534 534 535 535 switch(choice) { 536 536 default: 537 Log() << Verbose(1) << "Not a valid choice." << endl;537 DoLog(1) && (Log() << Verbose(1) << "Not a valid choice." << endl); 538 538 break; 539 539 case 'a': … … 567 567 x.SubtractVector((const Vector *)&second->x); 568 568 tmp1 = x.Norm(); 569 Log() << Verbose(1) << "Distance vector is ";569 DoLog(1) && (Log() << Verbose(1) << "Distance vector is "); 570 570 x.Output(); 571 Log() << Verbose(0) << "." << endl << "Norm of distance is " << tmp1 << "." << endl;571 DoLog(0) && (Log() << Verbose(0) << "." << endl << "Norm of distance is " << tmp1 << "." << endl); 572 572 break; 573 573 574 574 case 'c': 575 Log() << Verbose(0) << "Evaluating bond angle between three - first, central, last - atoms." << endl;575 DoLog(0) && (Log() << Verbose(0) << "Evaluating bond angle between three - first, central, last - atoms." << endl); 576 576 first = mol->AskAtom("Enter first atom: "); 577 577 second = mol->AskAtom("Enter central atom: "); … … 582 582 y.CopyVector((const Vector *)&third->x); 583 583 y.SubtractVector((const Vector *)&second->x); 584 Log() << Verbose(0) << "Bond angle between first atom Nr." << first->nr << ", central atom Nr." << second->nr << " and last atom Nr." << third->nr << ": ";585 Log() << Verbose(0) << (acos(x.ScalarProduct((const Vector *)&y)/(y.Norm()*x.Norm()))/M_PI*180.) << " degrees" << endl;584 DoLog(0) && (Log() << Verbose(0) << "Bond angle between first atom Nr." << first->nr << ", central atom Nr." << second->nr << " and last atom Nr." << third->nr << ": "); 585 DoLog(0) && (Log() << Verbose(0) << (acos(x.ScalarProduct((const Vector *)&y)/(y.Norm()*x.Norm()))/M_PI*180.) << " degrees" << endl); 586 586 break; 587 587 case 'd': 588 Log() << Verbose(0) << "Evaluating prinicipal axis." << endl;589 Log() << Verbose(0) << "Shall we rotate? [0/1]: ";588 DoLog(0) && (Log() << Verbose(0) << "Evaluating prinicipal axis." << endl); 589 DoLog(0) && (Log() << Verbose(0) << "Shall we rotate? [0/1]: "); 590 590 cin >> Z; 591 591 if ((Z >=0) && (Z <=1)) … … 596 596 case 'e': 597 597 { 598 Log() << Verbose(0) << "Evaluating volume of the convex envelope.";598 DoLog(0) && (Log() << Verbose(0) << "Evaluating volume of the convex envelope."); 599 599 class Tesselation *TesselStruct = NULL; 600 600 const LinkedCell *LCList = NULL; … … 602 602 FindConvexBorder(mol, TesselStruct, LCList, NULL); 603 603 double clustervolume = VolumeOfConvexEnvelope(TesselStruct, configuration); 604 Log() << Verbose(0) << "The tesselated surface area is " << clustervolume << "." << endl;\604 DoLog(0) && (Log() << Verbose(0) << "The tesselated surface area is " << clustervolume << "." << endl);\ 605 605 delete(LCList); 606 606 delete(TesselStruct); … … 613 613 { 614 614 char filename[255]; 615 Log() << Verbose(0) << "Please enter filename: " << endl;615 DoLog(0) && (Log() << Verbose(0) << "Please enter filename: " << endl); 616 616 cin >> filename; 617 Log() << Verbose(1) << "Storing temperatures in " << filename << "." << endl;617 DoLog(1) && (Log() << Verbose(1) << "Storing temperatures in " << filename << "." << endl); 618 618 ofstream *output = new ofstream(filename, ios::trunc); 619 619 if (!mol->OutputTemperatureFromTrajectories(output, 0, mol->MDSteps)) 620 Log() << Verbose(2) << "File could not be written." << endl;620 DoLog(2) && (Log() << Verbose(2) << "File could not be written." << endl); 621 621 else 622 Log() << Verbose(2) << "File stored." << endl;622 DoLog(2) && (Log() << Verbose(2) << "File stored." << endl); 623 623 output->close(); 624 624 delete(output); … … 637 637 clock_t start, end; 638 638 639 Log() << Verbose(0) << "Fragmenting molecule with current connection matrix ..." << endl;640 Log() << Verbose(0) << "What's the desired bond order: ";639 DoLog(0) && (Log() << Verbose(0) << "Fragmenting molecule with current connection matrix ..." << endl); 640 DoLog(0) && (Log() << Verbose(0) << "What's the desired bond order: "); 641 641 cin >> Order1; 642 642 if (mol->first->next != mol->last) { // there are bonds … … 644 644 mol->FragmentMolecule(Order1, configuration); 645 645 end = clock(); 646 Log() << Verbose(0) << "Clocks for this operation: " << (end-start) << ", time: " << ((double)(end-start)/CLOCKS_PER_SEC) << "s." << endl;646 DoLog(0) && (Log() << Verbose(0) << "Clocks for this operation: " << (end-start) << ", time: " << ((double)(end-start)/CLOCKS_PER_SEC) << "s." << endl); 647 647 } else 648 Log() << Verbose(0) << "Connection matrix has not yet been generated!" << endl;648 DoLog(0) && (Log() << Verbose(0) << "Connection matrix has not yet been generated!" << endl); 649 649 }; 650 650 … … 665 665 bool valid; 666 666 667 Log() << Verbose(0) << "=========MANIPULATE ATOMS======================" << endl;668 Log() << Verbose(0) << "a - add an atom" << endl;669 Log() << Verbose(0) << "r - remove an atom" << endl;670 Log() << Verbose(0) << "b - scale a bond between atoms" << endl;671 Log() << Verbose(0) << "t - turn an atom round another bond" << endl;672 Log() << Verbose(0) << "u - change an atoms element" << endl;673 Log() << Verbose(0) << "l - measure lengths, angles, ... for an atom" << endl;674 Log() << Verbose(0) << "all else - go back" << endl;675 Log() << Verbose(0) << "===============================================" << endl;667 DoLog(0) && (Log() << Verbose(0) << "=========MANIPULATE ATOMS======================" << endl); 668 DoLog(0) && (Log() << Verbose(0) << "a - add an atom" << endl); 669 DoLog(0) && (Log() << Verbose(0) << "r - remove an atom" << endl); 670 DoLog(0) && (Log() << Verbose(0) << "b - scale a bond between atoms" << endl); 671 DoLog(0) && (Log() << Verbose(0) << "t - turn an atom round another bond" << endl); 672 DoLog(0) && (Log() << Verbose(0) << "u - change an atoms element" << endl); 673 DoLog(0) && (Log() << Verbose(0) << "l - measure lengths, angles, ... for an atom" << endl); 674 DoLog(0) && (Log() << Verbose(0) << "all else - go back" << endl); 675 DoLog(0) && (Log() << Verbose(0) << "===============================================" << endl); 676 676 if (molecules->NumberOfActiveMolecules() > 1) 677 677 DoeLog(2) && (eLog()<< Verbose(2) << "There is more than one molecule active! Atoms will be added to each." << endl); 678 Log() << Verbose(0) << "INPUT: ";678 DoLog(0) && (Log() << Verbose(0) << "INPUT: "); 679 679 cin >> choice; 680 680 681 681 switch (choice) { 682 682 default: 683 Log() << Verbose(0) << "Not a valid choice." << endl;683 DoLog(0) && (Log() << Verbose(0) << "Not a valid choice." << endl); 684 684 break; 685 685 … … 688 688 if ((*ListRunner)->ActiveFlag) { 689 689 mol = *ListRunner; 690 Log() << Verbose(0) << "Current molecule is: " << mol->IndexNr << "\t" << mol->name << endl;690 DoLog(0) && (Log() << Verbose(0) << "Current molecule is: " << mol->IndexNr << "\t" << mol->name << endl); 691 691 AddAtoms(periode, mol); 692 692 } … … 697 697 if ((*ListRunner)->ActiveFlag) { 698 698 mol = *ListRunner; 699 Log() << Verbose(0) << "Current molecule is: " << mol->IndexNr << "\t" << mol->name << endl;700 Log() << Verbose(0) << "Scaling bond length between two atoms." << endl;699 DoLog(0) && (Log() << Verbose(0) << "Current molecule is: " << mol->IndexNr << "\t" << mol->name << endl); 700 DoLog(0) && (Log() << Verbose(0) << "Scaling bond length between two atoms." << endl); 701 701 first = mol->AskAtom("Enter first (fixed) atom: "); 702 702 second = mol->AskAtom("Enter second (shifting) atom: "); … … 705 705 minBond += (first->x.x[i]-second->x.x[i])*(first->x.x[i] - second->x.x[i]); 706 706 minBond = sqrt(minBond); 707 Log() << Verbose(0) << "Current Bond length between " << first->type->name << " Atom " << first->nr << " and " << second->type->name << " Atom " << second->nr << ": " << minBond << " a.u." << endl;708 Log() << Verbose(0) << "Enter new bond length [a.u.]: ";707 DoLog(0) && (Log() << Verbose(0) << "Current Bond length between " << first->type->name << " Atom " << first->nr << " and " << second->type->name << " Atom " << second->nr << ": " << minBond << " a.u." << endl); 708 DoLog(0) && (Log() << Verbose(0) << "Enter new bond length [a.u.]: "); 709 709 cin >> bond; 710 710 for (int i=NDIM;i--;) { … … 720 720 if ((*ListRunner)->ActiveFlag) { 721 721 mol = *ListRunner; 722 Log() << Verbose(0) << "Current molecule is: " << mol->IndexNr << "\t" << mol->name << endl;723 Log() << Verbose(0) << "Angstroem -> Bohrradius: 1.8897261\t\tBohrradius -> Angstroem: 0.52917721" << endl;724 Log() << Verbose(0) << "Enter three factors: ";722 DoLog(0) && (Log() << Verbose(0) << "Current molecule is: " << mol->IndexNr << "\t" << mol->name << endl); 723 DoLog(0) && (Log() << Verbose(0) << "Angstroem -> Bohrradius: 1.8897261\t\tBohrradius -> Angstroem: 0.52917721" << endl); 724 DoLog(0) && (Log() << Verbose(0) << "Enter three factors: "); 725 725 factor = new double[NDIM]; 726 726 cin >> factor[0]; … … 737 737 if ((*ListRunner)->ActiveFlag) { 738 738 mol = *ListRunner; 739 Log() << Verbose(0) << "Current molecule is: " << mol->IndexNr << "\t" << mol->name << endl;739 DoLog(0) && (Log() << Verbose(0) << "Current molecule is: " << mol->IndexNr << "\t" << mol->name << endl); 740 740 MeasureAtoms(periode, mol, configuration); 741 741 } … … 746 746 if ((*ListRunner)->ActiveFlag) { 747 747 mol = *ListRunner; 748 Log() << Verbose(0) << "Current molecule is: " << mol->IndexNr << "\t" << mol->name << endl;748 DoLog(0) && (Log() << Verbose(0) << "Current molecule is: " << mol->IndexNr << "\t" << mol->name << endl); 749 749 RemoveAtoms(mol); 750 750 } … … 755 755 if ((*ListRunner)->ActiveFlag) { 756 756 mol = *ListRunner; 757 Log() << Verbose(0) << "Turning atom around another bond - first is atom to turn, second (central) and third specify bond" << endl;757 DoLog(0) && (Log() << Verbose(0) << "Turning atom around another bond - first is atom to turn, second (central) and third specify bond" << endl); 758 758 first = mol->AskAtom("Enter turning atom: "); 759 759 second = mol->AskAtom("Enter central atom: "); … … 789 789 int Z; 790 790 mol = *ListRunner; 791 Log() << Verbose(0) << "Current molecule is: " << mol->IndexNr << "\t" << mol->name << endl;791 DoLog(0) && (Log() << Verbose(0) << "Current molecule is: " << mol->IndexNr << "\t" << mol->name << endl); 792 792 first = NULL; 793 793 do { 794 Log() << Verbose(0) << "Change the element of which atom: ";794 DoLog(0) && (Log() << Verbose(0) << "Change the element of which atom: "); 795 795 cin >> Z; 796 796 } while ((first = mol->FindAtom(Z)) == NULL); 797 Log() << Verbose(0) << "New element by atomic number Z: ";797 DoLog(0) && (Log() << Verbose(0) << "New element by atomic number Z: "); 798 798 cin >> Z; 799 799 first->type = periode->FindElement(Z); 800 Log() << Verbose(0) << "Atom " << first->nr << "'s element is " << first->type->name << "." << endl;800 DoLog(0) && (Log() << Verbose(0) << "Atom " << first->nr << "'s element is " << first->type->name << "." << endl); 801 801 } 802 802 break; … … 819 819 MoleculeLeafClass *Subgraphs = NULL; 820 820 821 Log() << Verbose(0) << "=========MANIPULATE GLOBALLY===================" << endl;822 Log() << Verbose(0) << "c - scale by unit transformation" << endl;823 Log() << Verbose(0) << "d - duplicate molecule/periodic cell" << endl;824 Log() << Verbose(0) << "f - fragment molecule many-body bond order style" << endl;825 Log() << Verbose(0) << "g - center atoms in box" << endl;826 Log() << Verbose(0) << "i - realign molecule" << endl;827 Log() << Verbose(0) << "m - mirror all molecules" << endl;828 Log() << Verbose(0) << "o - create connection matrix" << endl;829 Log() << Verbose(0) << "t - translate molecule by vector" << endl;830 Log() << Verbose(0) << "all else - go back" << endl;831 Log() << Verbose(0) << "===============================================" << endl;821 DoLog(0) && (Log() << Verbose(0) << "=========MANIPULATE GLOBALLY===================" << endl); 822 DoLog(0) && (Log() << Verbose(0) << "c - scale by unit transformation" << endl); 823 DoLog(0) && (Log() << Verbose(0) << "d - duplicate molecule/periodic cell" << endl); 824 DoLog(0) && (Log() << Verbose(0) << "f - fragment molecule many-body bond order style" << endl); 825 DoLog(0) && (Log() << Verbose(0) << "g - center atoms in box" << endl); 826 DoLog(0) && (Log() << Verbose(0) << "i - realign molecule" << endl); 827 DoLog(0) && (Log() << Verbose(0) << "m - mirror all molecules" << endl); 828 DoLog(0) && (Log() << Verbose(0) << "o - create connection matrix" << endl); 829 DoLog(0) && (Log() << Verbose(0) << "t - translate molecule by vector" << endl); 830 DoLog(0) && (Log() << Verbose(0) << "all else - go back" << endl); 831 DoLog(0) && (Log() << Verbose(0) << "===============================================" << endl); 832 832 if (molecules->NumberOfActiveMolecules() > 1) 833 833 DoeLog(2) && (eLog()<< Verbose(2) << "There is more than one molecule active! Atoms will be added to each." << endl); 834 Log() << Verbose(0) << "INPUT: ";834 DoLog(0) && (Log() << Verbose(0) << "INPUT: "); 835 835 cin >> choice; 836 836 837 837 switch (choice) { 838 838 default: 839 Log() << Verbose(0) << "Not a valid choice." << endl;839 DoLog(0) && (Log() << Verbose(0) << "Not a valid choice." << endl); 840 840 break; 841 841 … … 844 844 if ((*ListRunner)->ActiveFlag) { 845 845 mol = *ListRunner; 846 Log() << Verbose(0) << "Current molecule is: " << mol->IndexNr << "\t" << mol->name << endl;847 Log() << Verbose(0) << "State the axis [(+-)123]: ";846 DoLog(0) && (Log() << Verbose(0) << "Current molecule is: " << mol->IndexNr << "\t" << mol->name << endl); 847 DoLog(0) && (Log() << Verbose(0) << "State the axis [(+-)123]: "); 848 848 cin >> axis; 849 Log() << Verbose(0) << "State the factor: ";849 DoLog(0) && (Log() << Verbose(0) << "State the factor: "); 850 850 cin >> faktor; 851 851 … … 903 903 if ((*ListRunner)->ActiveFlag) { 904 904 mol = *ListRunner; 905 Log() << Verbose(0) << "Current molecule is: " << mol->IndexNr << "\t" << mol->name << endl;905 DoLog(0) && (Log() << Verbose(0) << "Current molecule is: " << mol->IndexNr << "\t" << mol->name << endl); 906 906 CenterAtoms(mol); 907 907 } … … 912 912 if ((*ListRunner)->ActiveFlag) { 913 913 mol = *ListRunner; 914 Log() << Verbose(0) << "Current molecule is: " << mol->IndexNr << "\t" << mol->name << endl;914 DoLog(0) && (Log() << Verbose(0) << "Current molecule is: " << mol->IndexNr << "\t" << mol->name << endl); 915 915 AlignAtoms(periode, mol); 916 916 } … … 921 921 if ((*ListRunner)->ActiveFlag) { 922 922 mol = *ListRunner; 923 Log() << Verbose(0) << "Current molecule is: " << mol->IndexNr << "\t" << mol->name << endl;923 DoLog(0) && (Log() << Verbose(0) << "Current molecule is: " << mol->IndexNr << "\t" << mol->name << endl); 924 924 MirrorAtoms(mol); 925 925 } … … 932 932 double bonddistance; 933 933 clock_t start,end; 934 Log() << Verbose(0) << "What's the maximum bond distance: ";934 DoLog(0) && (Log() << Verbose(0) << "What's the maximum bond distance: "); 935 935 cin >> bonddistance; 936 936 start = clock(); 937 937 mol->CreateAdjacencyList(bonddistance, configuration->GetIsAngstroem(), &BondGraph::CovalentMinMaxDistance, NULL); 938 938 end = clock(); 939 Log() << Verbose(0) << "Clocks for this operation: " << (end-start) << ", time: " << ((double)(end-start)/CLOCKS_PER_SEC) << "s." << endl;939 DoLog(0) && (Log() << Verbose(0) << "Clocks for this operation: " << (end-start) << ", time: " << ((double)(end-start)/CLOCKS_PER_SEC) << "s." << endl); 940 940 } 941 941 break; … … 945 945 if ((*ListRunner)->ActiveFlag) { 946 946 mol = *ListRunner; 947 Log() << Verbose(0) << "Current molecule is: " << mol->IndexNr << "\t" << mol->name << endl;948 Log() << Verbose(0) << "Enter translation vector." << endl;947 DoLog(0) && (Log() << Verbose(0) << "Current molecule is: " << mol->IndexNr << "\t" << mol->name << endl); 948 DoLog(0) && (Log() << Verbose(0) << "Enter translation vector." << endl); 949 949 x.AskPosition(World::get()->cell_size,0); 950 950 mol->Center.AddVector((const Vector *)&x); … … 974 974 molecule *mol = NULL; 975 975 976 Log() << Verbose(0) << "==========EDIT MOLECULES=====================" << endl;977 Log() << Verbose(0) << "c - create new molecule" << endl;978 Log() << Verbose(0) << "l - load molecule from xyz file" << endl;979 Log() << Verbose(0) << "n - change molecule's name" << endl;980 Log() << Verbose(0) << "N - give molecules filename" << endl;981 Log() << Verbose(0) << "p - parse atoms in xyz file into molecule" << endl;982 Log() << Verbose(0) << "r - remove a molecule" << endl;983 Log() << Verbose(0) << "all else - go back" << endl;984 Log() << Verbose(0) << "===============================================" << endl;985 Log() << Verbose(0) << "INPUT: ";976 DoLog(0) && (Log() << Verbose(0) << "==========EDIT MOLECULES=====================" << endl); 977 DoLog(0) && (Log() << Verbose(0) << "c - create new molecule" << endl); 978 DoLog(0) && (Log() << Verbose(0) << "l - load molecule from xyz file" << endl); 979 DoLog(0) && (Log() << Verbose(0) << "n - change molecule's name" << endl); 980 DoLog(0) && (Log() << Verbose(0) << "N - give molecules filename" << endl); 981 DoLog(0) && (Log() << Verbose(0) << "p - parse atoms in xyz file into molecule" << endl); 982 DoLog(0) && (Log() << Verbose(0) << "r - remove a molecule" << endl); 983 DoLog(0) && (Log() << Verbose(0) << "all else - go back" << endl); 984 DoLog(0) && (Log() << Verbose(0) << "===============================================" << endl); 985 DoLog(0) && (Log() << Verbose(0) << "INPUT: "); 986 986 cin >> choice; 987 987 988 988 switch (choice) { 989 989 default: 990 Log() << Verbose(0) << "Not a valid choice." << endl;990 DoLog(0) && (Log() << Verbose(0) << "Not a valid choice." << endl); 991 991 break; 992 992 case 'c': … … 998 998 { 999 999 char filename[MAXSTRINGSIZE]; 1000 Log() << Verbose(0) << "Format should be XYZ with: ShorthandOfElement\tX\tY\tZ" << endl;1000 DoLog(0) && (Log() << Verbose(0) << "Format should be XYZ with: ShorthandOfElement\tX\tY\tZ" << endl); 1001 1001 mol = new molecule(periode); 1002 1002 do { 1003 Log() << Verbose(0) << "Enter file name: ";1003 DoLog(0) && (Log() << Verbose(0) << "Enter file name: "); 1004 1004 cin >> filename; 1005 1005 } while (!mol->AddXYZFile(filename)); … … 1022 1022 char filename[MAXSTRINGSIZE]; 1023 1023 do { 1024 Log() << Verbose(0) << "Enter index of molecule: ";1024 DoLog(0) && (Log() << Verbose(0) << "Enter index of molecule: "); 1025 1025 cin >> nr; 1026 1026 mol = molecules->ReturnIndex(nr); 1027 1027 } while (mol == NULL); 1028 Log() << Verbose(0) << "Enter name: ";1028 DoLog(0) && (Log() << Verbose(0) << "Enter name: "); 1029 1029 cin >> filename; 1030 1030 strcpy(mol->name, filename); … … 1036 1036 char filename[MAXSTRINGSIZE]; 1037 1037 do { 1038 Log() << Verbose(0) << "Enter index of molecule: ";1038 DoLog(0) && (Log() << Verbose(0) << "Enter index of molecule: "); 1039 1039 cin >> nr; 1040 1040 mol = molecules->ReturnIndex(nr); 1041 1041 } while (mol == NULL); 1042 Log() << Verbose(0) << "Enter name: ";1042 DoLog(0) && (Log() << Verbose(0) << "Enter name: "); 1043 1043 cin >> filename; 1044 1044 mol->SetNameFromFilename(filename); … … 1051 1051 mol = NULL; 1052 1052 do { 1053 Log() << Verbose(0) << "Enter index of molecule: ";1053 DoLog(0) && (Log() << Verbose(0) << "Enter index of molecule: "); 1054 1054 cin >> nr; 1055 1055 mol = molecules->ReturnIndex(nr); 1056 1056 } while (mol == NULL); 1057 Log() << Verbose(0) << "Format should be XYZ with: ShorthandOfElement\tX\tY\tZ" << endl;1057 DoLog(0) && (Log() << Verbose(0) << "Format should be XYZ with: ShorthandOfElement\tX\tY\tZ" << endl); 1058 1058 do { 1059 Log() << Verbose(0) << "Enter file name: ";1059 DoLog(0) && (Log() << Verbose(0) << "Enter file name: "); 1060 1060 cin >> filename; 1061 1061 } while (!mol->AddXYZFile(filename)); … … 1065 1065 1066 1066 case 'r': 1067 Log() << Verbose(0) << "Enter index of molecule: ";1067 DoLog(0) && (Log() << Verbose(0) << "Enter index of molecule: "); 1068 1068 cin >> nr; 1069 1069 count = 1; … … 1088 1088 char choice; // menu choice char 1089 1089 1090 Log() << Verbose(0) << "===========MERGE MOLECULES=====================" << endl;1091 Log() << Verbose(0) << "a - simple add of one molecule to another" << endl;1092 Log() << Verbose(0) << "b - count the number of bonds of two elements" << endl;1093 Log() << Verbose(0) << "B - count the number of bonds of three elements " << endl;1094 Log() << Verbose(0) << "e - embedding merge of two molecules" << endl;1095 Log() << Verbose(0) << "h - count the number of hydrogen bonds" << endl;1096 Log() << Verbose(0) << "b - count the number of hydrogen bonds" << endl;1097 Log() << Verbose(0) << "m - multi-merge of all molecules" << endl;1098 Log() << Verbose(0) << "s - scatter merge of two molecules" << endl;1099 Log() << Verbose(0) << "t - simple merge of two molecules" << endl;1100 Log() << Verbose(0) << "all else - go back" << endl;1101 Log() << Verbose(0) << "===============================================" << endl;1102 Log() << Verbose(0) << "INPUT: ";1090 DoLog(0) && (Log() << Verbose(0) << "===========MERGE MOLECULES=====================" << endl); 1091 DoLog(0) && (Log() << Verbose(0) << "a - simple add of one molecule to another" << endl); 1092 DoLog(0) && (Log() << Verbose(0) << "b - count the number of bonds of two elements" << endl); 1093 DoLog(0) && (Log() << Verbose(0) << "B - count the number of bonds of three elements " << endl); 1094 DoLog(0) && (Log() << Verbose(0) << "e - embedding merge of two molecules" << endl); 1095 DoLog(0) && (Log() << Verbose(0) << "h - count the number of hydrogen bonds" << endl); 1096 DoLog(0) && (Log() << Verbose(0) << "b - count the number of hydrogen bonds" << endl); 1097 DoLog(0) && (Log() << Verbose(0) << "m - multi-merge of all molecules" << endl); 1098 DoLog(0) && (Log() << Verbose(0) << "s - scatter merge of two molecules" << endl); 1099 DoLog(0) && (Log() << Verbose(0) << "t - simple merge of two molecules" << endl); 1100 DoLog(0) && (Log() << Verbose(0) << "all else - go back" << endl); 1101 DoLog(0) && (Log() << Verbose(0) << "===============================================" << endl); 1102 DoLog(0) && (Log() << Verbose(0) << "INPUT: "); 1103 1103 cin >> choice; 1104 1104 1105 1105 switch (choice) { 1106 1106 default: 1107 Log() << Verbose(0) << "Not a valid choice." << endl;1107 DoLog(0) && (Log() << Verbose(0) << "Not a valid choice." << endl); 1108 1108 break; 1109 1109 … … 1114 1114 { 1115 1115 do { 1116 Log() << Verbose(0) << "Enter index of destination molecule: ";1116 DoLog(0) && (Log() << Verbose(0) << "Enter index of destination molecule: "); 1117 1117 cin >> dest; 1118 1118 destmol = molecules->ReturnIndex(dest); 1119 1119 } while ((destmol == NULL) && (dest != -1)); 1120 1120 do { 1121 Log() << Verbose(0) << "Enter index of source molecule to add from: ";1121 DoLog(0) && (Log() << Verbose(0) << "Enter index of source molecule to add from: "); 1122 1122 cin >> src; 1123 1123 srcmol = molecules->ReturnIndex(src); … … 1186 1186 molecule *srcmol = NULL, *destmol = NULL; 1187 1187 do { 1188 Log() << Verbose(0) << "Enter index of matrix molecule (the variable one): ";1188 DoLog(0) && (Log() << Verbose(0) << "Enter index of matrix molecule (the variable one): "); 1189 1189 cin >> src; 1190 1190 srcmol = molecules->ReturnIndex(src); 1191 1191 } while ((srcmol == NULL) && (src != -1)); 1192 1192 do { 1193 Log() << Verbose(0) << "Enter index of molecule to merge into (the fixed one): ";1193 DoLog(0) && (Log() << Verbose(0) << "Enter index of molecule to merge into (the fixed one): "); 1194 1194 cin >> dest; 1195 1195 destmol = molecules->ReturnIndex(dest); … … 1215 1215 molecule *mol = NULL; 1216 1216 do { 1217 Log() << Verbose(0) << "Enter index of molecule to merge into: ";1217 DoLog(0) && (Log() << Verbose(0) << "Enter index of molecule to merge into: "); 1218 1218 cin >> nr; 1219 1219 mol = molecules->ReturnIndex(nr); … … 1232 1232 1233 1233 case 's': 1234 Log() << Verbose(0) << "Not implemented yet." << endl;1234 DoLog(0) && (Log() << Verbose(0) << "Not implemented yet." << endl); 1235 1235 break; 1236 1236 … … 1241 1241 { 1242 1242 do { 1243 Log() << Verbose(0) << "Enter index of destination molecule: ";1243 DoLog(0) && (Log() << Verbose(0) << "Enter index of destination molecule: "); 1244 1244 cin >> dest; 1245 1245 destmol = molecules->ReturnIndex(dest); 1246 1246 } while ((destmol == NULL) && (dest != -1)); 1247 1247 do { 1248 Log() << Verbose(0) << "Enter index of source molecule to merge into: ";1248 DoLog(0) && (Log() << Verbose(0) << "Enter index of source molecule to merge into: "); 1249 1249 cin >> src; 1250 1250 srcmol = molecules->ReturnIndex(src); … … 1282 1282 1283 1283 // generate some KeySets 1284 Log() << Verbose(0) << "Generating KeySets." << endl;1284 DoLog(0) && (Log() << Verbose(0) << "Generating KeySets." << endl); 1285 1285 KeySet TestSets[mol->AtomCount+1]; 1286 1286 i=1; … … 1292 1292 i++; 1293 1293 } 1294 Log() << Verbose(0) << "Testing insertion of already present item in KeySets." << endl;1294 DoLog(0) && (Log() << Verbose(0) << "Testing insertion of already present item in KeySets." << endl); 1295 1295 KeySetTestPair test; 1296 1296 test = TestSets[mol->AtomCount-1].insert(Walker->nr); 1297 1297 if (test.second) { 1298 Log() << Verbose(1) << "Insertion worked?!" << endl;1298 DoLog(1) && (Log() << Verbose(1) << "Insertion worked?!" << endl); 1299 1299 } else { 1300 Log() << Verbose(1) << "Insertion rejected: Present object is " << (*test.first) << "." << endl;1300 DoLog(1) && (Log() << Verbose(1) << "Insertion rejected: Present object is " << (*test.first) << "." << endl); 1301 1301 } 1302 1302 TestSets[mol->AtomCount].insert(mol->end->previous->nr); … … 1304 1304 1305 1305 // constructing Graph structure 1306 Log() << Verbose(0) << "Generating Subgraph class." << endl;1306 DoLog(0) && (Log() << Verbose(0) << "Generating Subgraph class." << endl); 1307 1307 Graph Subgraphs; 1308 1308 1309 1309 // insert KeySets into Subgraphs 1310 Log() << Verbose(0) << "Inserting KeySets into Subgraph class." << endl;1310 DoLog(0) && (Log() << Verbose(0) << "Inserting KeySets into Subgraph class." << endl); 1311 1311 for (int j=0;j<mol->AtomCount;j++) { 1312 1312 Subgraphs.insert(GraphPair (TestSets[j],pair<int, double>(counter++, 1.))); 1313 1313 } 1314 Log() << Verbose(0) << "Testing insertion of already present item in Subgraph." << endl;1314 DoLog(0) && (Log() << Verbose(0) << "Testing insertion of already present item in Subgraph." << endl); 1315 1315 GraphTestPair test2; 1316 1316 test2 = Subgraphs.insert(GraphPair (TestSets[mol->AtomCount],pair<int, double>(counter++, 1.))); 1317 1317 if (test2.second) { 1318 Log() << Verbose(1) << "Insertion worked?!" << endl;1318 DoLog(1) && (Log() << Verbose(1) << "Insertion worked?!" << endl); 1319 1319 } else { 1320 Log() << Verbose(1) << "Insertion rejected: Present object is " << (*(test2.first)).second.first << "." << endl;1320 DoLog(1) && (Log() << Verbose(1) << "Insertion rejected: Present object is " << (*(test2.first)).second.first << "." << endl); 1321 1321 } 1322 1322 1323 1323 // show graphs 1324 Log() << Verbose(0) << "Showing Subgraph's contents, checking that it's sorted." << endl;1324 DoLog(0) && (Log() << Verbose(0) << "Showing Subgraph's contents, checking that it's sorted." << endl); 1325 1325 Graph::iterator A = Subgraphs.begin(); 1326 1326 while (A != Subgraphs.end()) { 1327 Log() << Verbose(0) << (*A).second.first << ": ";1327 DoLog(0) && (Log() << Verbose(0) << (*A).second.first << ": "); 1328 1328 KeySet::iterator key = (*A).first.begin(); 1329 1329 comp = -1; 1330 1330 while (key != (*A).first.end()) { 1331 1331 if ((*key) > comp) 1332 Log() << Verbose(0) << (*key) << " ";1332 DoLog(0) && (Log() << Verbose(0) << (*key) << " "); 1333 1333 else 1334 Log() << Verbose(0) << (*key) << "! ";1334 DoLog(0) && (Log() << Verbose(0) << (*key) << "! "); 1335 1335 comp = (*key); 1336 1336 key++; 1337 1337 } 1338 Log() << Verbose(0) << endl;1338 DoLog(0) && (Log() << Verbose(0) << endl); 1339 1339 A++; 1340 1340 } … … 1365 1365 if (output == NULL) 1366 1366 strcpy(filename,"main_pcp_linux"); 1367 Log() << Verbose(0) << "Saving as pdb input ";1367 DoLog(0) && (Log() << Verbose(0) << "Saving as pdb input "); 1368 1368 if (configuration->SavePDB(filename, molecules)) 1369 Log() << Verbose(0) << "done." << endl;1369 DoLog(0) && (Log() << Verbose(0) << "done." << endl); 1370 1370 else 1371 Log() << Verbose(0) << "failed." << endl;1371 DoLog(0) && (Log() << Verbose(0) << "failed." << endl); 1372 1372 1373 1373 // then save as tremolo data file … … 1376 1376 if (output == NULL) 1377 1377 strcpy(filename,"main_pcp_linux"); 1378 Log() << Verbose(0) << "Saving as tremolo data input ";1378 DoLog(0) && (Log() << Verbose(0) << "Saving as tremolo data input "); 1379 1379 if (configuration->SaveTREMOLO(filename, molecules)) 1380 Log() << Verbose(0) << "done." << endl;1380 DoLog(0) && (Log() << Verbose(0) << "done." << endl); 1381 1381 else 1382 Log() << Verbose(0) << "failed." << endl;1382 DoLog(0) && (Log() << Verbose(0) << "failed." << endl); 1383 1383 1384 1384 // translate each to its center and merge all molecules in MoleculeListClass into this molecule … … 1400 1400 } 1401 1401 1402 Log() << Verbose(0) << "Storing configuration ... " << endl;1402 DoLog(0) && (Log() << Verbose(0) << "Storing configuration ... " << endl); 1403 1403 // get correct valence orbitals 1404 1404 mol->CalculateOrbitals(*configuration); … … 1416 1416 output.close(); 1417 1417 output.clear(); 1418 Log() << Verbose(0) << "Saving of config file ";1418 DoLog(0) && (Log() << Verbose(0) << "Saving of config file "); 1419 1419 if (configuration->Save(filename, periode, mol)) 1420 Log() << Verbose(0) << "successful." << endl;1420 DoLog(0) && (Log() << Verbose(0) << "successful." << endl); 1421 1421 else 1422 Log() << Verbose(0) << "failed." << endl;1422 DoLog(0) && (Log() << Verbose(0) << "failed." << endl); 1423 1423 1424 1424 // and save to xyz file … … 1433 1433 output.open(filename, ios::trunc); 1434 1434 } 1435 Log() << Verbose(0) << "Saving of XYZ file ";1435 DoLog(0) && (Log() << Verbose(0) << "Saving of XYZ file "); 1436 1436 if (mol->MDSteps <= 1) { 1437 1437 if (mol->OutputXYZ(&output)) 1438 Log() << Verbose(0) << "successful." << endl;1438 DoLog(0) && (Log() << Verbose(0) << "successful." << endl); 1439 1439 else 1440 Log() << Verbose(0) << "failed." << endl;1440 DoLog(0) && (Log() << Verbose(0) << "failed." << endl); 1441 1441 } else { 1442 1442 if (mol->OutputTrajectoriesXYZ(&output)) 1443 Log() << Verbose(0) << "successful." << endl;1443 DoLog(0) && (Log() << Verbose(0) << "successful." << endl); 1444 1444 else 1445 Log() << Verbose(0) << "failed." << endl;1445 DoLog(0) && (Log() << Verbose(0) << "failed." << endl); 1446 1446 } 1447 1447 output.close(); … … 1453 1453 if (output == NULL) 1454 1454 strcpy(filename,"main_pcp_linux"); 1455 Log() << Verbose(0) << "Saving as mpqc input ";1455 DoLog(0) && (Log() << Verbose(0) << "Saving as mpqc input "); 1456 1456 if (configuration->SaveMPQC(filename, mol)) 1457 Log() << Verbose(0) << "done." << endl;1457 DoLog(0) && (Log() << Verbose(0) << "done." << endl); 1458 1458 else 1459 Log() << Verbose(0) << "failed." << endl;1459 DoLog(0) && (Log() << Verbose(0) << "failed." << endl); 1460 1460 1461 1461 if (!strcmp(configuration->configpath, configuration->GetDefaultPath())) { … … 1502 1502 do { 1503 1503 if (argv[argptr][0] == '-') { 1504 Log() << Verbose(0) << "Recognized command line argument: " << argv[argptr][1] << ".\n";1504 DoLog(0) && (Log() << Verbose(0) << "Recognized command line argument: " << argv[argptr][1] << ".\n"); 1505 1505 argptr++; 1506 1506 switch(argv[argptr-1][1]) { … … 1508 1508 case 'H': 1509 1509 case '?': 1510 Log() << Verbose(0) << "MoleCuilder suite" << endl << "==================" << endl << endl;1511 Log() << Verbose(0) << "Usage: " << argv[0] << "[config file] [-{acefpsthH?vfrp}] [further arguments]" << endl;1512 Log() << Verbose(0) << "or simply " << argv[0] << " without arguments for interactive session." << endl;1513 Log() << Verbose(0) << "\t-a Z x1 x2 x3\tAdd new atom of element Z at coordinates (x1,x2,x3)." << endl;1514 Log() << Verbose(0) << "\t-A <source>\tCreate adjacency list from bonds parsed from 'dbond'-style file." <<endl;1515 Log() << Verbose(0) << "\t-b xx xy xz yy yz zz\tCenter atoms in domain with given symmetric matrix of (xx,xy,xz,yy,yz,zz)." << endl;1516 Log() << Verbose(0) << "\t-B xx xy xz yy yz zz\tBound atoms by domain with given symmetric matrix of (xx,xy,xz,yy,yz,zz)." << endl;1517 Log() << Verbose(0) << "\t-c x1 x2 x3\tCenter atoms in domain with a minimum distance to boundary of (x1,x2,x3)." << endl;1518 Log() << Verbose(0) << "\t-C <type> [params] <output> <bin output> <BinWidth> <BinStart> <BinEnd>\tPair Correlation analysis." << endl;1519 Log() << Verbose(0) << "\t-d x1 x2 x3\tDuplicate cell along each axis by given factor." << endl;1520 Log() << Verbose(0) << "\t-D <bond distance>\tDepth-First-Search Analysis of the molecule, giving cycles and tree/back edges." << endl;1521 Log() << Verbose(0) << "\t-e <file>\tSets the databases path to be parsed (default: ./)." << endl;1522 Log() << Verbose(0) << "\t-E <id> <Z>\tChange atom <id>'s element to <Z>, <id> begins at 0." << endl;1523 Log() << Verbose(0) << "\t-f <dist> <order>\tFragments the molecule in BOSSANOVA manner (with/out rings compressed) and stores config files in same dir as config (return code 0 - fragmented, 2 - no fragmentation necessary)." << endl;1524 Log() << Verbose(0) << "\t-F <xyz of filler> <dist_x> <dist_y> <dist_z> <epsilon> <randatom> <randmol> <DoRotate>\tFilling Box with water molecules." << endl;1525 Log() << Verbose(0) << "\t-FF <MaxDistance> <xyz of filler> <dist_x> <dist_y> <dist_z> <epsilon> <randatom> <randmol> <DoRotate>\tFilling Box with water molecules." << endl;1526 Log() << Verbose(0) << "\t-g <file>\tParses a bond length table from the given file." << endl;1527 Log() << Verbose(0) << "\t-h/-H/-?\tGive this help screen." << endl;1528 Log() << Verbose(0) << "\t-I\t Dissect current system of molecules into a set of disconnected (subgraphs of) molecules." << endl;1529 Log() << Verbose(0) << "\t-j\t<path> Store all bonds to file." << endl;1530 Log() << Verbose(0) << "\t-J\t<path> Store adjacency per atom to file." << endl;1531 Log() << Verbose(0) << "\t-L <step0> <step1> <prefix>\tStore a linear interpolation between two configurations <step0> and <step1> into single config files with prefix <prefix> and as Trajectories into the current config file." << endl;1532 Log() << Verbose(0) << "\t-m <0/1>\tCalculate (0)/ Align in(1) PAS with greatest EV along z axis." << endl;1533 Log() << Verbose(0) << "\t-M <basis>\tSetting basis to store to MPQC config files." << endl;1534 Log() << Verbose(0) << "\t-n\tFast parsing (i.e. no trajectories are looked for)." << endl;1535 Log() << Verbose(0) << "\t-N <radius> <file>\tGet non-convex-envelope." << endl;1536 Log() << Verbose(0) << "\t-o <out>\tGet volume of the convex envelope (and store to tecplot file)." << endl;1537 Log() << Verbose(0) << "\t-O\tCenter atoms in origin." << endl;1538 Log() << Verbose(0) << "\t-p <file>\tParse given xyz file and create raw config file from it." << endl;1539 Log() << Verbose(0) << "\t-P <file>\tParse given forces file and append as an MD step to config file via Verlet." << endl;1540 Log() << Verbose(0) << "\t-r <id>\t\tRemove an atom with given id." << endl;1541 Log() << Verbose(0) << "\t-R <id> <radius>\t\tRemove all atoms out of sphere around a given one." << endl;1542 Log() << Verbose(0) << "\t-s x1 x2 x3\tScale all atom coordinates by this vector (x1,x2,x3)." << endl;1543 Log() << Verbose(0) << "\t-S <file> Store temperatures from the config file in <file>." << endl;1544 Log() << Verbose(0) << "\t-t x1 x2 x3\tTranslate all atoms by this vector (x1,x2,x3)." << endl;1545 Log() << Verbose(0) << "\t-T x1 x2 x3\tTranslate periodically all atoms by this vector (x1,x2,x3)." << endl;1546 Log() << Verbose(0) << "\t-u rho\tsuspend in water solution and output necessary cell lengths, average density rho and repetition." << endl;1547 Log() << Verbose(0) << "\t-v\t\tsets verbosity (more is more)." << endl;1548 Log() << Verbose(0) << "\t-V\t\tGives version information." << endl;1549 Log() << Verbose(0) << "\t-X\t\tset default name of a molecule." << endl;1550 Log() << Verbose(0) << "Note: config files must not begin with '-' !" << endl;1510 DoLog(0) && (Log() << Verbose(0) << "MoleCuilder suite" << endl << "==================" << endl << endl); 1511 DoLog(0) && (Log() << Verbose(0) << "Usage: " << argv[0] << "[config file] [-{acefpsthH?vfrp}] [further arguments]" << endl); 1512 DoLog(0) && (Log() << Verbose(0) << "or simply " << argv[0] << " without arguments for interactive session." << endl); 1513 DoLog(0) && (Log() << Verbose(0) << "\t-a Z x1 x2 x3\tAdd new atom of element Z at coordinates (x1,x2,x3)." << endl); 1514 DoLog(0) && (Log() << Verbose(0) << "\t-A <source>\tCreate adjacency list from bonds parsed from 'dbond'-style file." <<endl); 1515 DoLog(0) && (Log() << Verbose(0) << "\t-b xx xy xz yy yz zz\tCenter atoms in domain with given symmetric matrix of (xx,xy,xz,yy,yz,zz)." << endl); 1516 DoLog(0) && (Log() << Verbose(0) << "\t-B xx xy xz yy yz zz\tBound atoms by domain with given symmetric matrix of (xx,xy,xz,yy,yz,zz)." << endl); 1517 DoLog(0) && (Log() << Verbose(0) << "\t-c x1 x2 x3\tCenter atoms in domain with a minimum distance to boundary of (x1,x2,x3)." << endl); 1518 DoLog(0) && (Log() << Verbose(0) << "\t-C <type> [params] <output> <bin output> <BinWidth> <BinStart> <BinEnd>\tPair Correlation analysis." << endl); 1519 DoLog(0) && (Log() << Verbose(0) << "\t-d x1 x2 x3\tDuplicate cell along each axis by given factor." << endl); 1520 DoLog(0) && (Log() << Verbose(0) << "\t-D <bond distance>\tDepth-First-Search Analysis of the molecule, giving cycles and tree/back edges." << endl); 1521 DoLog(0) && (Log() << Verbose(0) << "\t-e <file>\tSets the databases path to be parsed (default: ./)." << endl); 1522 DoLog(0) && (Log() << Verbose(0) << "\t-E <id> <Z>\tChange atom <id>'s element to <Z>, <id> begins at 0." << endl); 1523 DoLog(0) && (Log() << Verbose(0) << "\t-f <dist> <order>\tFragments the molecule in BOSSANOVA manner (with/out rings compressed) and stores config files in same dir as config (return code 0 - fragmented, 2 - no fragmentation necessary)." << endl); 1524 DoLog(0) && (Log() << Verbose(0) << "\t-F <xyz of filler> <dist_x> <dist_y> <dist_z> <epsilon> <randatom> <randmol> <DoRotate>\tFilling Box with water molecules." << endl); 1525 DoLog(0) && (Log() << Verbose(0) << "\t-FF <MaxDistance> <xyz of filler> <dist_x> <dist_y> <dist_z> <epsilon> <randatom> <randmol> <DoRotate>\tFilling Box with water molecules." << endl); 1526 DoLog(0) && (Log() << Verbose(0) << "\t-g <file>\tParses a bond length table from the given file." << endl); 1527 DoLog(0) && (Log() << Verbose(0) << "\t-h/-H/-?\tGive this help screen." << endl); 1528 DoLog(0) && (Log() << Verbose(0) << "\t-I\t Dissect current system of molecules into a set of disconnected (subgraphs of) molecules." << endl); 1529 DoLog(0) && (Log() << Verbose(0) << "\t-j\t<path> Store all bonds to file." << endl); 1530 DoLog(0) && (Log() << Verbose(0) << "\t-J\t<path> Store adjacency per atom to file." << endl); 1531 DoLog(0) && (Log() << Verbose(0) << "\t-L <step0> <step1> <prefix>\tStore a linear interpolation between two configurations <step0> and <step1> into single config files with prefix <prefix> and as Trajectories into the current config file." << endl); 1532 DoLog(0) && (Log() << Verbose(0) << "\t-m <0/1>\tCalculate (0)/ Align in(1) PAS with greatest EV along z axis." << endl); 1533 DoLog(0) && (Log() << Verbose(0) << "\t-M <basis>\tSetting basis to store to MPQC config files." << endl); 1534 DoLog(0) && (Log() << Verbose(0) << "\t-n\tFast parsing (i.e. no trajectories are looked for)." << endl); 1535 DoLog(0) && (Log() << Verbose(0) << "\t-N <radius> <file>\tGet non-convex-envelope." << endl); 1536 DoLog(0) && (Log() << Verbose(0) << "\t-o <out>\tGet volume of the convex envelope (and store to tecplot file)." << endl); 1537 DoLog(0) && (Log() << Verbose(0) << "\t-O\tCenter atoms in origin." << endl); 1538 DoLog(0) && (Log() << Verbose(0) << "\t-p <file>\tParse given xyz file and create raw config file from it." << endl); 1539 DoLog(0) && (Log() << Verbose(0) << "\t-P <file>\tParse given forces file and append as an MD step to config file via Verlet." << endl); 1540 DoLog(0) && (Log() << Verbose(0) << "\t-r <id>\t\tRemove an atom with given id." << endl); 1541 DoLog(0) && (Log() << Verbose(0) << "\t-R <id> <radius>\t\tRemove all atoms out of sphere around a given one." << endl); 1542 DoLog(0) && (Log() << Verbose(0) << "\t-s x1 x2 x3\tScale all atom coordinates by this vector (x1,x2,x3)." << endl); 1543 DoLog(0) && (Log() << Verbose(0) << "\t-S <file> Store temperatures from the config file in <file>." << endl); 1544 DoLog(0) && (Log() << Verbose(0) << "\t-t x1 x2 x3\tTranslate all atoms by this vector (x1,x2,x3)." << endl); 1545 DoLog(0) && (Log() << Verbose(0) << "\t-T x1 x2 x3\tTranslate periodically all atoms by this vector (x1,x2,x3)." << endl); 1546 DoLog(0) && (Log() << Verbose(0) << "\t-u rho\tsuspend in water solution and output necessary cell lengths, average density rho and repetition." << endl); 1547 DoLog(0) && (Log() << Verbose(0) << "\t-v\t\tsets verbosity (more is more)." << endl); 1548 DoLog(0) && (Log() << Verbose(0) << "\t-V\t\tGives version information." << endl); 1549 DoLog(0) && (Log() << Verbose(0) << "\t-X\t\tset default name of a molecule." << endl); 1550 DoLog(0) && (Log() << Verbose(0) << "Note: config files must not begin with '-' !" << endl); 1551 1551 return (1); 1552 1552 break; … … 1556 1556 } 1557 1557 setVerbosity(verbosity); 1558 Log() << Verbose(0) << "Setting verbosity to " << verbosity << "." << endl;1558 DoLog(0) && (Log() << Verbose(0) << "Setting verbosity to " << verbosity << "." << endl); 1559 1559 break; 1560 1560 case 'V': 1561 Log() << Verbose(0) << argv[0] << " " << VERSIONSTRING << endl;1562 Log() << Verbose(0) << "Build your own molecule position set." << endl;1561 DoLog(0) && (Log() << Verbose(0) << argv[0] << " " << VERSIONSTRING << endl); 1562 DoLog(0) && (Log() << Verbose(0) << "Build your own molecule position set." << endl); 1563 1563 return (1); 1564 1564 break; … … 1572 1572 SaveFlag = true; 1573 1573 j = -1; 1574 Log() << Verbose(1) << "Centering atoms in config file within given simulation box." << endl;1574 DoLog(1) && (Log() << Verbose(1) << "Centering atoms in config file within given simulation box." << endl); 1575 1575 double * const cell_size = World::get()->cell_size; 1576 1576 for (int i=0;i<6;i++) { … … 1585 1585 performCriticalExit(); 1586 1586 } else { 1587 Log() << Verbose(0) << "Using " << argv[argptr] << " as elements database." << endl;1587 DoLog(0) && (Log() << Verbose(0) << "Using " << argv[argptr] << " as elements database." << endl); 1588 1588 strncpy (configuration.databasepath, argv[argptr], MAXSTRINGSIZE-1); 1589 1589 argptr+=1; … … 1596 1596 } else { 1597 1597 BondGraphFileName = argv[argptr]; 1598 Log() << Verbose(0) << "Using " << BondGraphFileName << " as bond length table." << endl;1598 DoLog(0) && (Log() << Verbose(0) << "Using " << BondGraphFileName << " as bond length table." << endl); 1599 1599 argptr+=1; 1600 1600 } 1601 1601 break; 1602 1602 case 'n': 1603 Log() << Verbose(0) << "I won't parse trajectories." << endl;1603 DoLog(0) && (Log() << Verbose(0) << "I won't parse trajectories." << endl); 1604 1604 configuration.FastParsing = true; 1605 1605 break; … … 1611 1611 *name = new char[length+2]; 1612 1612 strncpy(*name, argv[argptr], length); 1613 Log() << Verbose(0) << "Default name of new molecules set to " << *name << "." << endl;1613 DoLog(0) && (Log() << Verbose(0) << "Default name of new molecules set to " << *name << "." << endl); 1614 1614 } 1615 1615 break; … … 1624 1624 // 3a. Parse the element database 1625 1625 if (periode->LoadPeriodentafel(configuration.databasepath)) { 1626 Log() << Verbose(0) << "Element list loaded successfully." << endl;1626 DoLog(0) && (Log() << Verbose(0) << "Element list loaded successfully." << endl); 1627 1627 //periode->Output(); 1628 1628 } else { 1629 Log() << Verbose(0) << "Element list loading failed." << endl;1629 DoLog(0) && (Log() << Verbose(0) << "Element list loading failed." << endl); 1630 1630 return 1; 1631 1631 } … … 1633 1633 if (argv[1][0] != '-') { 1634 1634 // simply create a new molecule, wherein the config file is loaded and the manipulation takes place 1635 Log() << Verbose(0) << "Config file given." << endl;1635 DoLog(0) && (Log() << Verbose(0) << "Config file given." << endl); 1636 1636 test.open(argv[1], ios::in); 1637 1637 if (test == NULL) { … … 1639 1639 output.open(argv[1], ios::out); 1640 1640 if (output == NULL) { 1641 Log() << Verbose(1) << "Specified config file " << argv[1] << " not found." << endl;1641 DoLog(1) && (Log() << Verbose(1) << "Specified config file " << argv[1] << " not found." << endl); 1642 1642 configPresent = absent; 1643 1643 } else { 1644 Log() << Verbose(0) << "Empty configuration file." << endl;1644 DoLog(0) && (Log() << Verbose(0) << "Empty configuration file." << endl); 1645 1645 ConfigFileName = argv[1]; 1646 1646 configPresent = empty; … … 1650 1650 test.close(); 1651 1651 ConfigFileName = argv[1]; 1652 Log() << Verbose(1) << "Specified config file found, parsing ... ";1652 DoLog(1) && (Log() << Verbose(1) << "Specified config file found, parsing ... "); 1653 1653 switch (configuration.TestSyntax(ConfigFileName, periode)) { 1654 1654 case 1: 1655 Log() << Verbose(0) << "new syntax." << endl;1655 DoLog(0) && (Log() << Verbose(0) << "new syntax." << endl); 1656 1656 configuration.Load(ConfigFileName, BondGraphFileName, periode, molecules); 1657 1657 configPresent = present; 1658 1658 break; 1659 1659 case 0: 1660 Log() << Verbose(0) << "old syntax." << endl;1660 DoLog(0) && (Log() << Verbose(0) << "old syntax." << endl); 1661 1661 configuration.LoadOld(ConfigFileName, BondGraphFileName, periode, molecules); 1662 1662 configPresent = present; 1663 1663 break; 1664 1664 default: 1665 Log() << Verbose(0) << "Unknown syntax or empty, yet present file." << endl;1665 DoLog(0) && (Log() << Verbose(0) << "Unknown syntax or empty, yet present file." << endl); 1666 1666 configPresent = empty; 1667 1667 } … … 1687 1687 configuration.BG = new BondGraph(configuration.GetIsAngstroem()); 1688 1688 if ((!BondGraphFileName.empty()) && (configuration.BG->LoadBondLengthTable(BondGraphFileName))) { 1689 Log() << Verbose(0) << "Bond length table loaded successfully." << endl;1689 DoLog(0) && (Log() << Verbose(0) << "Bond length table loaded successfully." << endl); 1690 1690 } else { 1691 1691 DoeLog(1) && (eLog()<< Verbose(1) << "Bond length table loading failed." << endl); … … 1696 1696 argptr = 1; 1697 1697 do { 1698 Log() << Verbose(0) << "Current Command line argument: " << argv[argptr] << "." << endl;1698 DoLog(0) && (Log() << Verbose(0) << "Current Command line argument: " << argv[argptr] << "." << endl); 1699 1699 if (argv[argptr][0] == '-') { 1700 1700 argptr++; … … 1709 1709 } else { 1710 1710 SaveFlag = true; 1711 Log() << Verbose(1) << "Parsing xyz file for new atoms." << endl;1711 DoLog(1) && (Log() << Verbose(1) << "Parsing xyz file for new atoms." << endl); 1712 1712 if (!mol->AddXYZFile(argv[argptr])) 1713 Log() << Verbose(2) << "File not found." << endl;1713 DoLog(2) && (Log() << Verbose(2) << "File not found." << endl); 1714 1714 else { 1715 Log() << Verbose(2) << "File found and parsed." << endl;1715 DoLog(2) && (Log() << Verbose(2) << "File found and parsed." << endl); 1716 1716 configPresent = present; 1717 1717 } … … 1726 1726 } else { 1727 1727 SaveFlag = true; 1728 Log() << Verbose(1) << "Adding new atom with element " << argv[argptr] << " at (" << argv[argptr+1] << "," << argv[argptr+2] << "," << argv[argptr+3] << "), ";1728 DoLog(1) && (Log() << Verbose(1) << "Adding new atom with element " << argv[argptr] << " at (" << argv[argptr+1] << "," << argv[argptr+2] << "," << argv[argptr+3] << "), "); 1729 1729 first = new atom; 1730 1730 first->type = periode->FindElement(atoi(argv[argptr])); 1731 1731 if (first->type != NULL) 1732 Log() << Verbose(2) << "found element " << first->type->name << endl;1732 DoLog(2) && (Log() << Verbose(2) << "found element " << first->type->name << endl); 1733 1733 for (int i=NDIM;i--;) 1734 1734 first->x.x[i] = atof(argv[argptr+1+i]); … … 1755 1755 } else { 1756 1756 configuration.basis = argv[argptr]; 1757 Log() << Verbose(1) << "Setting MPQC basis to " << configuration.basis << "." << endl;1757 DoLog(1) && (Log() << Verbose(1) << "Setting MPQC basis to " << configuration.basis << "." << endl); 1758 1758 argptr+=1; 1759 1759 } … … 1762 1762 if (ExitFlag == 0) ExitFlag = 1; 1763 1763 { 1764 Log() << Verbose(1) << "Depth-First-Search Analysis." << endl;1764 DoLog(1) && (Log() << Verbose(1) << "Depth-First-Search Analysis." << endl); 1765 1765 MoleculeLeafClass *Subgraphs = NULL; // list of subgraphs from DFS analysis 1766 1766 int *MinimumRingSize = new int[mol->AtomCount]; … … 1793 1793 break; 1794 1794 case 'I': 1795 Log() << Verbose(1) << "Dissecting molecular system into a set of disconnected subgraphs ... " << endl;1795 DoLog(1) && (Log() << Verbose(1) << "Dissecting molecular system into a set of disconnected subgraphs ... " << endl); 1796 1796 // @TODO rather do the dissection afterwards 1797 1797 molecules->DissectMoleculeIntoConnectedSubgraphs(periode, &configuration); … … 1972 1972 } else { 1973 1973 SaveFlag = true; 1974 Log() << Verbose(1) << "Changing atom " << argv[argptr] << " to element " << argv[argptr+1] << "." << endl;1974 DoLog(1) && (Log() << Verbose(1) << "Changing atom " << argv[argptr] << " to element " << argv[argptr+1] << "." << endl); 1975 1975 first = mol->FindAtom(atoi(argv[argptr])); 1976 1976 first->type = periode->FindElement(atoi(argv[argptr+1])); … … 1984 1984 // fetch first argument as max distance to surface 1985 1985 MaxDistance = atof(argv[argptr++]); 1986 Log() << Verbose(0) << "Filling with maximum layer distance of " << MaxDistance << "." << endl;1986 DoLog(0) && (Log() << Verbose(0) << "Filling with maximum layer distance of " << MaxDistance << "." << endl); 1987 1987 } 1988 1988 if ((argptr+7 >=argc) || (argv[argptr][0] == '-') || (!IsValidNumber(argv[argptr+1])) || (!IsValidNumber(argv[argptr+2])) || (!IsValidNumber(argv[argptr+3])) || (!IsValidNumber(argv[argptr+4])) || (!IsValidNumber(argv[argptr+5])) || (!IsValidNumber(argv[argptr+6])) || (!IsValidNumber(argv[argptr+7]))) { … … 1992 1992 } else { 1993 1993 SaveFlag = true; 1994 Log() << Verbose(1) << "Filling Box with water molecules." << endl;1994 DoLog(1) && (Log() << Verbose(1) << "Filling Box with water molecules." << endl); 1995 1995 // construct water molecule 1996 1996 molecule *filler = new molecule(periode); … … 2021 2021 performCriticalExit(); 2022 2022 } else { 2023 Log() << Verbose(0) << "Parsing bonds from " << argv[argptr] << "." << endl;2023 DoLog(0) && (Log() << Verbose(0) << "Parsing bonds from " << argv[argptr] << "." << endl); 2024 2024 ifstream *input = new ifstream(argv[argptr]); 2025 2025 mol->CreateAdjacencyListFromDbondFile(input); … … 2036 2036 performCriticalExit(); 2037 2037 } else { 2038 Log() << Verbose(0) << "Storing adjacency to path " << argv[argptr] << "." << endl;2038 DoLog(0) && (Log() << Verbose(0) << "Storing adjacency to path " << argv[argptr] << "." << endl); 2039 2039 configuration.BG->ConstructBondGraph(mol); 2040 2040 mol->StoreAdjacencyToFile(NULL, argv[argptr]); … … 2050 2050 performCriticalExit(); 2051 2051 } else { 2052 Log() << Verbose(0) << "Storing bonds to path " << argv[argptr] << "." << endl;2052 DoLog(0) && (Log() << Verbose(0) << "Storing bonds to path " << argv[argptr] << "." << endl); 2053 2053 configuration.BG->ConstructBondGraph(mol); 2054 2054 mol->StoreBondsToFile(NULL, argv[argptr]); … … 2069 2069 //string filename(argv[argptr+1]); 2070 2070 //filename.append(".csv"); 2071 Log() << Verbose(0) << "Evaluating non-convex envelope of biggest molecule.";2072 Log() << Verbose(1) << "Using rolling ball of radius " << atof(argv[argptr]) << " and storing tecplot data in " << argv[argptr+1] << "." << endl;2071 DoLog(0) && (Log() << Verbose(0) << "Evaluating non-convex envelope of biggest molecule."); 2072 DoLog(1) && (Log() << Verbose(1) << "Using rolling ball of radius " << atof(argv[argptr]) << " and storing tecplot data in " << argv[argptr+1] << "." << endl); 2073 2073 // find biggest molecule 2074 2074 int counter = 0; … … 2080 2080 counter++; 2081 2081 } 2082 Log() << Verbose(1) << "Biggest molecule has " << Boundary->AtomCount << " atoms." << endl;2082 DoLog(1) && (Log() << Verbose(1) << "Biggest molecule has " << Boundary->AtomCount << " atoms." << endl); 2083 2083 start = clock(); 2084 2084 LCList = new LinkedCell(Boundary, atof(argv[argptr])*2.); … … 2087 2087 //FindDistributionOfEllipsoids(T, &LCList, N, number, filename.c_str()); 2088 2088 end = clock(); 2089 Log() << Verbose(0) << "Clocks for this operation: " << (end-start) << ", time: " << ((double)(end-start)/CLOCKS_PER_SEC) << "s." << endl;2089 DoLog(0) && (Log() << Verbose(0) << "Clocks for this operation: " << (end-start) << ", time: " << ((double)(end-start)/CLOCKS_PER_SEC) << "s." << endl); 2090 2090 delete(LCList); 2091 2091 delete(T); … … 2100 2100 performCriticalExit(); 2101 2101 } else { 2102 Log() << Verbose(1) << "Storing temperatures in " << argv[argptr] << "." << endl;2102 DoLog(1) && (Log() << Verbose(1) << "Storing temperatures in " << argv[argptr] << "." << endl); 2103 2103 ofstream *output = new ofstream(argv[argptr], ios::trunc); 2104 2104 if (!mol->OutputTemperatureFromTrajectories(output, 0, mol->MDSteps)) 2105 Log() << Verbose(2) << "File could not be written." << endl;2105 DoLog(2) && (Log() << Verbose(2) << "File could not be written." << endl); 2106 2106 else 2107 Log() << Verbose(2) << "File stored." << endl;2107 DoLog(2) && (Log() << Verbose(2) << "File stored." << endl); 2108 2108 output->close(); 2109 2109 delete(output); … … 2119 2119 } else { 2120 2120 SaveFlag = true; 2121 Log() << Verbose(1) << "Linear interpolation between configuration " << argv[argptr] << " and " << argv[argptr+1] << "." << endl;2121 DoLog(1) && (Log() << Verbose(1) << "Linear interpolation between configuration " << argv[argptr] << " and " << argv[argptr+1] << "." << endl); 2122 2122 if (atoi(argv[argptr+3]) == 1) 2123 Log() << Verbose(1) << "Using Identity for the permutation map." << endl;2123 DoLog(1) && (Log() << Verbose(1) << "Using Identity for the permutation map." << endl); 2124 2124 if (!mol->LinearInterpolationBetweenConfiguration(atoi(argv[argptr]), atoi(argv[argptr+1]), argv[argptr+2], configuration, atoi(argv[argptr+3])) == 1 ? true : false) 2125 Log() << Verbose(2) << "Could not store " << argv[argptr+2] << " files." << endl;2125 DoLog(2) && (Log() << Verbose(2) << "Could not store " << argv[argptr+2] << " files." << endl); 2126 2126 else 2127 Log() << Verbose(2) << "Steps created and " << argv[argptr+2] << " files stored." << endl;2127 DoLog(2) && (Log() << Verbose(2) << "Steps created and " << argv[argptr+2] << " files stored." << endl); 2128 2128 argptr+=4; 2129 2129 } … … 2137 2137 } else { 2138 2138 SaveFlag = true; 2139 Log() << Verbose(1) << "Parsing forces file and Verlet integrating." << endl;2139 DoLog(1) && (Log() << Verbose(1) << "Parsing forces file and Verlet integrating." << endl); 2140 2140 if (!mol->VerletForceIntegration(argv[argptr], configuration)) 2141 Log() << Verbose(2) << "File not found." << endl;2141 DoLog(2) && (Log() << Verbose(2) << "File not found." << endl); 2142 2142 else 2143 Log() << Verbose(2) << "File found and parsed." << endl;2143 DoLog(2) && (Log() << Verbose(2) << "File found and parsed." << endl); 2144 2144 argptr+=1; 2145 2145 } … … 2153 2153 } else { 2154 2154 SaveFlag = true; 2155 Log() << Verbose(1) << "Removing atoms around " << argv[argptr] << " with radius " << argv[argptr+1] << "." << endl;2155 DoLog(1) && (Log() << Verbose(1) << "Removing atoms around " << argv[argptr] << " with radius " << argv[argptr+1] << "." << endl); 2156 2156 double tmp1 = atof(argv[argptr+1]); 2157 2157 atom *third = mol->FindAtom(atoi(argv[argptr])); … … 2180 2180 if (ExitFlag == 0) ExitFlag = 1; 2181 2181 SaveFlag = true; 2182 Log() << Verbose(1) << "Translating all ions by given vector." << endl;2182 DoLog(1) && (Log() << Verbose(1) << "Translating all ions by given vector." << endl); 2183 2183 for (int i=NDIM;i--;) 2184 2184 x.x[i] = atof(argv[argptr+i]); … … 2196 2196 if (ExitFlag == 0) ExitFlag = 1; 2197 2197 SaveFlag = true; 2198 Log() << Verbose(1) << "Translating all ions periodically by given vector." << endl;2198 DoLog(1) && (Log() << Verbose(1) << "Translating all ions periodically by given vector." << endl); 2199 2199 for (int i=NDIM;i--;) 2200 2200 x.x[i] = atof(argv[argptr+i]); … … 2212 2212 SaveFlag = true; 2213 2213 j = -1; 2214 Log() << Verbose(1) << "Scaling all ion positions by factor." << endl;2214 DoLog(1) && (Log() << Verbose(1) << "Scaling all ion positions by factor." << endl); 2215 2215 factor = new double[NDIM]; 2216 2216 factor[0] = atof(argv[argptr]); … … 2237 2237 SaveFlag = true; 2238 2238 j = -1; 2239 Log() << Verbose(1) << "Centering atoms in config file within given simulation box." << endl;2239 DoLog(1) && (Log() << Verbose(1) << "Centering atoms in config file within given simulation box." << endl); 2240 2240 double * const cell_size = World::get()->cell_size; 2241 2241 for (int i=0;i<6;i++) { … … 2256 2256 SaveFlag = true; 2257 2257 j = -1; 2258 Log() << Verbose(1) << "Centering atoms in config file within given simulation box." << endl;2258 DoLog(1) && (Log() << Verbose(1) << "Centering atoms in config file within given simulation box." << endl); 2259 2259 double * const cell_size = World::get()->cell_size; 2260 2260 for (int i=0;i<6;i++) { … … 2275 2275 SaveFlag = true; 2276 2276 j = -1; 2277 Log() << Verbose(1) << "Centering atoms in config file within given additional boundary." << endl;2277 DoLog(1) && (Log() << Verbose(1) << "Centering atoms in config file within given additional boundary." << endl); 2278 2278 // make every coordinate positive 2279 2279 mol->CenterEdge(&x); … … 2295 2295 if (ExitFlag == 0) ExitFlag = 1; 2296 2296 SaveFlag = true; 2297 Log() << Verbose(1) << "Centering atoms on edge and setting box dimensions." << endl;2297 DoLog(1) && (Log() << Verbose(1) << "Centering atoms on edge and setting box dimensions." << endl); 2298 2298 x.Zero(); 2299 2299 mol->CenterEdge(&x); … … 2309 2309 } else { 2310 2310 SaveFlag = true; 2311 Log() << Verbose(1) << "Removing atom " << argv[argptr] << "." << endl;2311 DoLog(1) && (Log() << Verbose(1) << "Removing atom " << argv[argptr] << "." << endl); 2312 2312 atom *first = mol->FindAtom(atoi(argv[argptr])); 2313 2313 mol->RemoveAtom(first); … … 2322 2322 performCriticalExit(); 2323 2323 } else { 2324 Log() << Verbose(0) << "Fragmenting molecule with bond distance " << argv[argptr] << " angstroem, order of " << argv[argptr+1] << "." << endl;2325 Log() << Verbose(0) << "Creating connection matrix..." << endl;2324 DoLog(0) && (Log() << Verbose(0) << "Fragmenting molecule with bond distance " << argv[argptr] << " angstroem, order of " << argv[argptr+1] << "." << endl); 2325 DoLog(0) && (Log() << Verbose(0) << "Creating connection matrix..." << endl); 2326 2326 start = clock(); 2327 2327 mol->CreateAdjacencyList(atof(argv[argptr++]), configuration.GetIsAngstroem(), &BondGraph::CovalentMinMaxDistance, NULL); 2328 Log() << Verbose(0) << "Fragmenting molecule with current connection matrix ..." << endl;2328 DoLog(0) && (Log() << Verbose(0) << "Fragmenting molecule with current connection matrix ..." << endl); 2329 2329 if (mol->first->next != mol->last) { 2330 2330 ExitFlag = mol->FragmentMolecule(atoi(argv[argptr]), &configuration); 2331 2331 } 2332 2332 end = clock(); 2333 Log() << Verbose(0) << "Clocks for this operation: " << (end-start) << ", time: " << ((double)(end-start)/CLOCKS_PER_SEC) << "s." << endl;2333 DoLog(0) && (Log() << Verbose(0) << "Clocks for this operation: " << (end-start) << ", time: " << ((double)(end-start)/CLOCKS_PER_SEC) << "s." << endl); 2334 2334 argptr+=2; 2335 2335 } … … 2344 2344 if (j) { 2345 2345 SaveFlag = true; 2346 Log() << Verbose(0) << "Converting to prinicipal axis system." << endl;2346 DoLog(0) && (Log() << Verbose(0) << "Converting to prinicipal axis system." << endl); 2347 2347 } else 2348 Log() << Verbose(0) << "Evaluating prinicipal axis." << endl;2348 DoLog(0) && (Log() << Verbose(0) << "Evaluating prinicipal axis." << endl); 2349 2349 mol->PrincipalAxisSystem((bool)j); 2350 2350 break; … … 2358 2358 class Tesselation *TesselStruct = NULL; 2359 2359 const LinkedCell *LCList = NULL; 2360 Log() << Verbose(0) << "Evaluating volume of the convex envelope.";2361 Log() << Verbose(1) << "Storing tecplot convex data in " << argv[argptr] << "." << endl;2362 Log() << Verbose(1) << "Storing tecplot non-convex data in " << argv[argptr+1] << "." << endl;2360 DoLog(0) && (Log() << Verbose(0) << "Evaluating volume of the convex envelope."); 2361 DoLog(1) && (Log() << Verbose(1) << "Storing tecplot convex data in " << argv[argptr] << "." << endl); 2362 DoLog(1) && (Log() << Verbose(1) << "Storing tecplot non-convex data in " << argv[argptr+1] << "." << endl); 2363 2363 LCList = new LinkedCell(mol, 10.); 2364 2364 //FindConvexBorder(mol, LCList, argv[argptr]); … … 2367 2367 double volumedifference = ConvexizeNonconvexEnvelope(TesselStruct, mol, argv[argptr]); 2368 2368 double clustervolume = VolumeOfConvexEnvelope(TesselStruct, &configuration); 2369 Log() << Verbose(0) << "The tesselated volume area is " << clustervolume << " " << (configuration.GetIsAngstroem() ? "angstrom" : "atomiclength") << "^3." << endl;2370 Log() << Verbose(0) << "The non-convex tesselated volume area is " << clustervolume-volumedifference << " " << (configuration.GetIsAngstroem() ? "angstrom" : "atomiclength") << "^3." << endl;2369 DoLog(0) && (Log() << Verbose(0) << "The tesselated volume area is " << clustervolume << " " << (configuration.GetIsAngstroem() ? "angstrom" : "atomiclength") << "^3." << endl); 2370 DoLog(0) && (Log() << Verbose(0) << "The non-convex tesselated volume area is " << clustervolume-volumedifference << " " << (configuration.GetIsAngstroem() ? "angstrom" : "atomiclength") << "^3." << endl); 2371 2371 delete(TesselStruct); 2372 2372 delete(LCList); … … 2382 2382 } else { 2383 2383 volume = atof(argv[argptr++]); 2384 Log() << Verbose(0) << "Using " << volume << " angstrom^3 as the volume instead of convex envelope one's." << endl;2384 DoLog(0) && (Log() << Verbose(0) << "Using " << volume << " angstrom^3 as the volume instead of convex envelope one's." << endl); 2385 2385 } 2386 2386 case 'u': … … 2394 2394 double density; 2395 2395 SaveFlag = true; 2396 Log() << Verbose(0) << "Evaluating necessary cell volume for a cluster suspended in water.";2396 DoLog(0) && (Log() << Verbose(0) << "Evaluating necessary cell volume for a cluster suspended in water."); 2397 2397 density = atof(argv[argptr++]); 2398 2398 if (density < 1.0) { … … 2482 2482 } else { // no arguments, hence scan the elements db 2483 2483 if (periode->LoadPeriodentafel(configuration.databasepath)) 2484 Log() << Verbose(0) << "Element list loaded successfully." << endl;2484 DoLog(0) && (Log() << Verbose(0) << "Element list loaded successfully." << endl); 2485 2485 else 2486 Log() << Verbose(0) << "Element list loading failed." << endl;2486 DoLog(0) && (Log() << Verbose(0) << "Element list loading failed." << endl); 2487 2487 configuration.RetrieveConfigPathAndName("main_pcp_linux"); 2488 2488 } … … 2508 2508 cout << ESPACKVersion << endl; 2509 2509 2510 Log() << Verbose(1) << "test" << endl;2510 DoLog(1) && (Log() << Verbose(1) << "test" << endl); 2511 2511 DoLog(3) && (Log() << Verbose(1) << "test"); 2512 2512 … … 2539 2539 double * const cell_size = World::get()->cell_size; 2540 2540 if (cell_size[0] == 0.) { 2541 Log() << Verbose(0) << "enter lower tridiagonal form of basis matrix" << endl << endl;2541 DoLog(0) && (Log() << Verbose(0) << "enter lower tridiagonal form of basis matrix" << endl << endl); 2542 2542 for (int i=0;i<6;i++) { 2543 Log() << Verbose(1) << "Cell size" << i << ": ";2543 DoLog(1) && (Log() << Verbose(1) << "Cell size" << i << ": "); 2544 2544 cin >> cell_size[i]; 2545 2545 } … … 2552 2552 2553 2553 // now the main construction loop 2554 Log() << Verbose(0) << endl << "Now comes the real construction..." << endl;2554 DoLog(0) && (Log() << Verbose(0) << endl << "Now comes the real construction..." << endl); 2555 2555 do { 2556 Log() << Verbose(0) << endl << endl;2557 Log() << Verbose(0) << "============Molecule list=======================" << endl;2556 DoLog(0) && (Log() << Verbose(0) << endl << endl); 2557 DoLog(0) && (Log() << Verbose(0) << "============Molecule list=======================" << endl); 2558 2558 molecules->Enumerate((ofstream *)&cout); 2559 Log() << Verbose(0) << "============Menu===============================" << endl;2560 Log() << Verbose(0) << "a - set molecule (in)active" << endl;2561 Log() << Verbose(0) << "e - edit molecules (load, parse, save)" << endl;2562 Log() << Verbose(0) << "g - globally manipulate atoms in molecule" << endl;2563 Log() << Verbose(0) << "M - Merge molecules" << endl;2564 Log() << Verbose(0) << "m - manipulate atoms" << endl;2565 Log() << Verbose(0) << "-----------------------------------------------" << endl;2566 Log() << Verbose(0) << "c - edit the current configuration" << endl;2567 Log() << Verbose(0) << "-----------------------------------------------" << endl;2568 Log() << Verbose(0) << "s - save current setup to config file" << endl;2569 Log() << Verbose(0) << "T - call the current test routine" << endl;2570 Log() << Verbose(0) << "q - quit" << endl;2571 Log() << Verbose(0) << "===============================================" << endl;2572 Log() << Verbose(0) << "Input: ";2559 DoLog(0) && (Log() << Verbose(0) << "============Menu===============================" << endl); 2560 DoLog(0) && (Log() << Verbose(0) << "a - set molecule (in)active" << endl); 2561 DoLog(0) && (Log() << Verbose(0) << "e - edit molecules (load, parse, save)" << endl); 2562 DoLog(0) && (Log() << Verbose(0) << "g - globally manipulate atoms in molecule" << endl); 2563 DoLog(0) && (Log() << Verbose(0) << "M - Merge molecules" << endl); 2564 DoLog(0) && (Log() << Verbose(0) << "m - manipulate atoms" << endl); 2565 DoLog(0) && (Log() << Verbose(0) << "-----------------------------------------------" << endl); 2566 DoLog(0) && (Log() << Verbose(0) << "c - edit the current configuration" << endl); 2567 DoLog(0) && (Log() << Verbose(0) << "-----------------------------------------------" << endl); 2568 DoLog(0) && (Log() << Verbose(0) << "s - save current setup to config file" << endl); 2569 DoLog(0) && (Log() << Verbose(0) << "T - call the current test routine" << endl); 2570 DoLog(0) && (Log() << Verbose(0) << "q - quit" << endl); 2571 DoLog(0) && (Log() << Verbose(0) << "===============================================" << endl); 2572 DoLog(0) && (Log() << Verbose(0) << "Input: "); 2573 2573 cin >> choice; 2574 2574 … … 2576 2576 case 'a': // (in)activate molecule 2577 2577 { 2578 Log() << Verbose(0) << "Enter index of molecule: ";2578 DoLog(0) && (Log() << Verbose(0) << "Enter index of molecule: "); 2579 2579 cin >> j; 2580 2580 for(MoleculeList::iterator ListRunner = molecules->ListOfMolecules.begin(); ListRunner != molecules->ListOfMolecules.end(); ListRunner++) … … 2622 2622 // save element data base 2623 2623 if (periode->StorePeriodentafel(configuration->databasepath)) //ElementsFileName 2624 Log() << Verbose(0) << "Saving of elements.db successful." << endl;2624 DoLog(0) && (Log() << Verbose(0) << "Saving of elements.db successful." << endl); 2625 2625 else 2626 Log() << Verbose(0) << "Saving of elements.db failed." << endl;2626 DoLog(0) && (Log() << Verbose(0) << "Saving of elements.db failed." << endl); 2627 2627 2628 2628 delete(molecules); // also free's all molecules contained
Note:
See TracChangeset
for help on using the changeset viewer.
