Changeset d34341 for molecuilder/src/builder.cpp
- Timestamp:
- Jan 27, 2010, 2:36:09 PM (16 years ago)
- Children:
- dbd19f
- Parents:
- 41182a (diff), 478683 (diff)
Note: this is a merge changeset, the changes displayed below correspond to the merge itself.
Use the(diff)links above to see all the changes relative to each parent. - File:
-
- 1 edited
-
molecuilder/src/builder.cpp (modified) (12 diffs)
Legend:
- Unmodified
- Added
- Removed
-
molecuilder/src/builder.cpp
r41182a rd34341 51 51 52 52 using namespace std; 53 54 #include <cstring> 53 55 54 56 #include "analysis_correlation.hpp" … … 1296 1298 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; 1297 1299 Log() << Verbose(0) << "\t-c x1 x2 x3\tCenter atoms in domain with a minimum distance to boundary of (x1,x2,x3)." << endl; 1298 Log() << Verbose(0) << "\t-C \tPair Correlation analysis." << endl;1300 Log() << Verbose(0) << "\t-C <Z> <output> <bin output>\tPair Correlation analysis." << endl; 1299 1301 Log() << Verbose(0) << "\t-d x1 x2 x3\tDuplicate cell along each axis by given factor." << endl; 1300 1302 Log() << Verbose(0) << "\t-D <bond distance>\tDepth-First-Search Analysis of the molecule, giving cycles and tree/back edges." << endl; 1301 1303 Log() << Verbose(0) << "\t-e <file>\tSets the databases path to be parsed (default: ./)." << endl; 1302 1304 Log() << Verbose(0) << "\t-E <id> <Z>\tChange atom <id>'s element to <Z>, <id> begins at 0." << endl; 1303 Log() << Verbose(0) << "\t-f/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; 1305 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; 1306 Log() << Verbose(0) << "\t-F <dist_x> <dist_y> <dist_z> <epsilon> <randatom> <randmol> <DoRotate>\tFilling Box with water molecules." << endl; 1304 1307 Log() << Verbose(0) << "\t-g <file>\tParses a bond length table from the given file." << endl; 1305 1308 Log() << Verbose(0) << "\t-h/-H/-?\tGive this help screen." << endl; 1309 Log() << Verbose(0) << "\t-I\t Dissect current system of molecules into a set of disconnected (subgraphs of) molecules." << endl; 1306 1310 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; 1307 1311 Log() << Verbose(0) << "\t-m <0/1>\tCalculate (0)/ Align in(1) PAS with greatest EV along z axis." << endl; … … 1433 1437 if (configuration.BG == NULL) { 1434 1438 configuration.BG = new BondGraph(configuration.GetIsAngstroem()); 1435 if (( BondGraphFileName.empty()) && (configuration.BG->LoadBondLengthTable(BondGraphFileName))) {1439 if ((!BondGraphFileName.empty()) && (configuration.BG->LoadBondLengthTable(BondGraphFileName))) { 1436 1440 Log() << Verbose(0) << "Bond length table loaded successfully." << endl; 1437 1441 } else { … … 1461 1465 else { 1462 1466 Log() << Verbose(2) << "File found and parsed." << endl; 1463 // @TODO rather do the dissection afterwards1464 // mol->SetNameFromFilename(argv[argptr]);1465 // molecules->ListOfMolecules.remove(mol);1466 // molecules->DissectMoleculeIntoConnectedSubgraphs(mol,&configuration);1467 // delete(mol);1468 // if (molecules->ListOfMolecules.size() != 0) {1469 // for (MoleculeList::iterator ListRunner = molecules->ListOfMolecules.begin(); ListRunner != molecules->ListOfMolecules.end(); ListRunner++)1470 // if ((*ListRunner)->ActiveFlag) {1471 // mol = *ListRunner;1472 // break;1473 // }1474 // }1475 1467 configPresent = present; 1476 1468 } … … 1551 1543 //argptr+=1; 1552 1544 break; 1545 case 'I': 1546 Log() << Verbose(1) << "Dissecting molecular system into a set of disconnected subgraphs ... " << endl; 1547 // @TODO rather do the dissection afterwards 1548 molecules->DissectMoleculeIntoConnectedSubgraphs(periode, &configuration); 1549 mol = NULL; 1550 if (molecules->ListOfMolecules.size() != 0) { 1551 for (MoleculeList::iterator ListRunner = molecules->ListOfMolecules.begin(); ListRunner != molecules->ListOfMolecules.end(); ListRunner++) 1552 if ((*ListRunner)->ActiveFlag) { 1553 mol = *ListRunner; 1554 break; 1555 } 1556 } 1557 if (mol == NULL) { 1558 mol = *(molecules->ListOfMolecules.begin()); 1559 mol->ActiveFlag = true; 1560 } 1561 break; 1553 1562 case 'C': 1554 1563 if (ExitFlag == 0) ExitFlag = 1; … … 1558 1567 performCriticalExit(); 1559 1568 } else { 1560 SaveFlag = false;1561 1569 ofstream output(argv[argptr+1]); 1562 1570 ofstream binoutput(argv[argptr+2]); … … 1578 1586 counter = 0; 1579 1587 for (MoleculeList::iterator BigFinder = molecules->ListOfMolecules.begin(); BigFinder != molecules->ListOfMolecules.end(); BigFinder++) { 1580 Actives[counter ] = (*BigFinder)->ActiveFlag;1588 Actives[counter++] = (*BigFinder)->ActiveFlag; 1581 1589 (*BigFinder)->ActiveFlag = (*BigFinder == Boundary) ? false : true; 1582 1590 } … … 1586 1594 int ranges[NDIM] = {1,1,1}; 1587 1595 CorrelationToSurfaceMap *surfacemap = PeriodicCorrelationToSurface( molecules, elemental, TesselStruct, LCList, ranges ); 1596 //OutputCorrelationToSurface(&output, surfacemap); 1588 1597 BinPairMap *binmap = BinData( surfacemap, 0.5, 0., 0. ); 1589 1598 OutputCorrelation ( &binoutput, binmap ); … … 1591 1600 binoutput.close(); 1592 1601 for (MoleculeList::iterator BigFinder = molecules->ListOfMolecules.begin(); BigFinder != molecules->ListOfMolecules.end(); BigFinder++) 1593 (*BigFinder)->ActiveFlag = Actives[counter ];1602 (*BigFinder)->ActiveFlag = Actives[counter++]; 1594 1603 Free(&Actives); 1595 1604 delete(LCList); … … 1614 1623 case 'F': 1615 1624 if (ExitFlag == 0) ExitFlag = 1; 1616 if (argptr+ 5>=argc) {1625 if (argptr+6 >=argc) { 1617 1626 ExitFlag = 255; 1618 eLog() << Verbose(0) << "Not enough or invalid arguments given for filling box with water: -F <dist_x> <dist_y> <dist_z> < randatom> <randmol> <DoRotate>" << endl;1627 eLog() << Verbose(0) << "Not enough or invalid arguments given for filling box with water: -F <dist_x> <dist_y> <dist_z> <boundary> <randatom> <randmol> <DoRotate>" << endl; 1619 1628 performCriticalExit(); 1620 1629 } else { … … 1622 1631 Log() << Verbose(1) << "Filling Box with water molecules." << endl; 1623 1632 // construct water molecule 1624 molecule *filler = new molecule(periode); ;1633 molecule *filler = new molecule(periode); 1625 1634 molecule *Filling = NULL; 1626 1635 atom *second = NULL, *third = NULL; 1636 // first = new atom(); 1637 // first->type = periode->FindElement(5); 1638 // first->x.Zero(); 1639 // filler->AddAtom(first); 1627 1640 first = new atom(); 1628 1641 first->type = periode->FindElement(1); … … 1643 1656 for (int i=0;i<NDIM;i++) 1644 1657 distance[i] = atof(argv[argptr+i]); 1645 Filling = FillBoxWithMolecule(molecules, filler, configuration, distance, atof(argv[argptr+3]), atof(argv[argptr+4]), ato i(argv[argptr+5]));1658 Filling = FillBoxWithMolecule(molecules, filler, configuration, distance, atof(argv[argptr+3]), atof(argv[argptr+4]), atof(argv[argptr+5]), atoi(argv[argptr+6])); 1646 1659 if (Filling != NULL) { 1660 Filling->ActiveFlag = false; 1647 1661 molecules->insert(Filling); 1648 1662 }
Note:
See TracChangeset
for help on using the changeset viewer.
