Changeset c75363 for molecuilder/src/builder.cpp
- Timestamp:
- May 2, 2008, 1:25:48 PM (17 years ago)
- Children:
- 30fda2
- Parents:
- e936b3
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
molecuilder/src/builder.cpp
re936b3 rc75363 559 559 void FragmentAtoms(molecule *mol, config *configuration) 560 560 { 561 enum BondOrderScheme Scheme = NoScheme; 562 enum CutCyclicBond CutCyclic; 563 char schema; 564 int Order1, Order2; 561 int Order1; 565 562 clock_t start, end; 566 563 … … 568 565 cout << Verbose(0) << "What's the desired bond order: "; 569 566 cin >> Order1; 570 cout << Verbose(0) << "What's the desired bond scheme [(B)ottomUp/(T)opDown/(A)NOVA/(C)ombined]: ";571 cin >> schema;572 CutCyclic = SaturateBond;573 switch (schema) {574 default:575 Scheme = NoScheme;576 break;577 case 'B':578 CutCyclic = KeepBond;579 case 'b':580 Scheme = BottomUp;581 Order2 = 0;582 break;583 case 'T':584 CutCyclic = KeepBond;585 case 't':586 Scheme = TopDown;587 Order2 = Order1;588 Order1 = 0;589 break;590 case 'A':591 CutCyclic = KeepBond;592 case 'a':593 Scheme = ANOVA;594 Order2 = 0;595 break;596 case 'C':597 CutCyclic = KeepBond;598 case 'c':599 cout << Verbose(0) << "Combined first selects subgraphs by BottomUp of bond order " << Order1 << " then TopDown to fragment these." << endl;600 cout << Verbose(0) << "What's the desired bond order for TopDown: ";601 cin >> Order2;602 Scheme = Combined;603 break;604 };605 567 if (mol->first->next != mol->last) { // there are bonds 606 568 start = clock(); 607 mol->FragmentMolecule((ofstream *)&cout, Order1, Order2, Scheme, configuration, CutCyclic);569 mol->FragmentMolecule((ofstream *)&cout, Order1, configuration); 608 570 end = clock(); 609 571 cout << Verbose(0) << "Clocks for this operation: " << (end-start) << ", time: " << ((double)(end-start)/CLOCKS_PER_SEC) << "s." << endl; … … 759 721 int j, axis, count, faktor; 760 722 int MinimumRingSize = -1; 761 enum BondOrderScheme Scheme = NoScheme;762 enum CutCyclicBond CutCyclic;763 723 enum ConfigStatus config_present = absent; 764 724 MoleculeLeafClass *Subgraphs = NULL; … … 781 741 case '?': 782 742 cout << "MoleCuilder suite" << endl << "==================" << endl << endl; 783 cout << "Usage: " << argv[0] << "[config file] [-{ace psthH?vfrp}] [further arguments]" << endl;743 cout << "Usage: " << argv[0] << "[config file] [-{acefpsthH?vfrp}] [further arguments]" << endl; 784 744 cout << "or simply " << argv[0] << " without arguments for interactive session." << endl; 785 745 cout << "\t-a Z x1 x2 x3\tAdd new atom of element Z at coordinates (x1,x2,x3)." << endl; 786 746 cout << "\t-c x1 x2 x3\tCenter atoms in domain with a minimum distance to boundary of (x1,x2,x3)." << endl; 787 747 cout << "\t-e <file>\tSets the element database to be parsed from this file (default: elements.db in same dir as " << argv[0] << ")." << endl; 748 cout << "\t-e <dist> <order>\tFragments the molecule in BOSSANOVA manner and stores config files in same dir as config." << endl; 788 749 cout << "\t-h/-H/-?\tGive this help screen." << endl; 789 750 cout << "\t-p <file>\tParse given xyz file and create raw config file from it." << endl; … … 954 915 break; 955 916 case 'f': 956 int i,j;957 917 if (flag ==0) flag = 2; // only set if not already by other command line switch 958 cout << "Fragmenting molecule with bond distance " << argv[argptr] << " angstroem, order of " << argv[argptr+1] << " and type " << argv[argptr+2] << "." << endl;959 if (argc >= argptr+ 3) {918 cout << "Fragmenting molecule with bond distance " << argv[argptr] << " angstroem, order of " << argv[argptr+1] << "." << endl; 919 if (argc >= argptr+2) { 960 920 cout << Verbose(0) << "Creating connection matrix..." << endl; 961 921 start = clock(); 962 922 mol->CreateAdjacencyList((ofstream *)&cout, atof(argv[argptr++])); 963 923 cout << Verbose(0) << "Fragmenting molecule with current connection matrix ..." << endl; 964 cout << Verbose(0) << "What's the desired bond scheme [(B)ottomUp/(T)opDown/(A)NOVA/(C)ombined]: ";965 CutCyclic = SaturateBond;966 switch (argv[argptr+1][0]) {967 default:968 Scheme = NoScheme;969 break;970 case 'B':971 CutCyclic = KeepBond;972 case 'b':973 Scheme = BottomUp;974 i = atoi(argv[argptr]);975 j = 0;976 break;977 case 'T':978 CutCyclic = KeepBond;979 case 't':980 Scheme = TopDown;981 i = 0;982 j = atoi(argv[argptr]);983 break;984 case 'A':985 CutCyclic = KeepBond;986 case 'a':987 Scheme = ANOVA;988 i = atoi(argv[argptr]);989 j = 0;990 break;991 // case 'C':992 // CutCyclic = KeepBond;993 // case 'c':994 // if (argc > 5) {995 // i = atoi(argv[4]);996 // j = atoi(argv[6]);997 // Scheme = Combined;998 // }999 // else1000 // cerr << "Missing second bond order for TopDown fragmentation in combined approach." << endl;1001 // break;1002 };1003 924 if (mol->first->next != mol->last) { 1004 mol->FragmentMolecule((ofstream *)&cout, i, j, Scheme, &configuration, CutCyclic);925 mol->FragmentMolecule((ofstream *)&cout, atoi(argv[argptr]), &configuration); 1005 926 } 1006 927 end = clock(); 1007 928 cout << Verbose(0) << "Clocks for this operation: " << (end-start) << ", time: " << ((double)(end-start)/CLOCKS_PER_SEC) << "s." << endl; 1008 argptr+= 2;929 argptr+=1; 1009 930 } else { 1010 cerr << "Not enough arguments for fragmentation: -f <max. bond distance> <bond order> <type>" << endl;931 cerr << "Not enough arguments for fragmentation: -f <max. bond distance> <bond order>" << endl; 1011 932 } 1012 933 break;
Note:
See TracChangeset
for help on using the changeset viewer.