Changeset ea9696
- Timestamp:
- Jul 3, 2009, 2:25:17 PM (16 years ago)
- Children:
- 1f6efb
- Parents:
- 13088d
- File:
-
- 1 edited
-
molecuilder/src/builder.cpp (modified) (4 diffs)
Legend:
- Unmodified
- Added
- Removed
-
molecuilder/src/builder.cpp
r13088d rea9696 474 474 cout << Verbose(0) << "Which axis is it: "; 475 475 cin >> axis; 476 cout << Verbose(0) << "L eft inwardboundary: ";476 cout << Verbose(0) << "Lower boundary: "; 477 477 cin >> tmp1; 478 cout << Verbose(0) << " Right inwardboundary: ";478 cout << Verbose(0) << "Upper boundary: "; 479 479 cin >> tmp2; 480 480 first = mol->start; 481 while(first->next != mol->end) { 482 first = first->next; 483 if ((first->x.x[axis] > tmp2) || (first->x.x[axis] < tmp1)) // out of boundary ... 481 second = first->next; 482 while(second != mol->end) { 483 first = second; 484 second = first->next; 485 if ((first->x.x[axis] < tmp1) || (first->x.x[axis] > tmp2)) {// out of boundary ... 486 //cout << "Atom " << *first << " with " << first->x.x[axis] << " on axis " << axis << " is out of bounds [" << tmp1 << "," << tmp2 << "]." << endl; 484 487 mol->RemoveAtom(first); 488 } 485 489 } 486 490 break; … … 1268 1272 cout << "\t-m <0/1>\tCalculate (0)/ Align in(1) PAS with greatest EV along z axis." << endl; 1269 1273 cout << "\t-n\tFast parsing (i.e. no trajectories are looked for)." << endl; 1270 cout << "\t-N \tGet non-convex-envelope." << endl;1274 cout << "\t-N <radius> <file>\tGet non-convex-envelope." << endl; 1271 1275 cout << "\t-o <out>\tGet volume of the convex envelope (and store to tecplot file)." << endl; 1272 1276 cout << "\t-p <file>\tParse given xyz file and create raw config file from it." << endl; 1273 1277 cout << "\t-P <file>\tParse given forces file and append as an MD step to config file via Verlet." << endl; 1274 1278 cout << "\t-r\t\tConvert file from an old pcp syntax." << endl; 1279 cout << "\t-R\t\tRemove all atoms out of sphere around a given one." << endl; 1275 1280 cout << "\t-t x1 x2 x3\tTranslate all atoms by this vector (x1,x2,x3)." << endl; 1276 1281 cout << "\t-T <file> Store temperatures from the config file in <file>." << endl; … … 1495 1500 LinkedCell LCList(mol, atof(argv[argptr])); // \NOTE not twice the radius?? 1496 1501 Find_non_convex_border((ofstream *)&cout, mol, &T, &LCList, argv[argptr+1], atof(argv[argptr])); 1497 FindDistributionOfEllipsoids((ofstream *)&cout, &T, &LCList, N, number, filename.c_str());1502 //FindDistributionOfEllipsoids((ofstream *)&cout, &T, &LCList, N, number, filename.c_str()); 1498 1503 argptr+=2; 1499 1504 } … … 1531 1536 } 1532 1537 break; 1538 case 'R': 1539 ExitFlag = 1; 1540 if ((argptr+1 >= argc) || (!IsValidNumber(argv[argptr])) || (!IsValidNumber(argv[argptr+1]))) { 1541 ExitFlag = 255; 1542 cerr << "Not enough or invalid arguments given for removing atoms: -R <id> <distance>" << endl; 1543 } else { 1544 SaveFlag = true; 1545 cout << Verbose(1) << "Removing atoms around " << argv[argptr] << " with radius " << argv[argptr+1] << "." << endl; 1546 double tmp1 = atof(argv[argptr+1]); 1547 atom *third = mol->FindAtom(atoi(argv[argptr])); 1548 atom *first = mol->start; 1549 if ((third != NULL) && (first != mol->end)) { 1550 atom *second = first->next; 1551 while(second != mol->end) { 1552 first = second; 1553 second = first->next; 1554 if (first->x.DistanceSquared((const Vector *)&third->x) > tmp1*tmp1) // distance to first above radius ... 1555 mol->RemoveAtom(first); 1556 } 1557 } else { 1558 cerr << "Removal failed due to missing atoms on molecule or wrong id." << endl; 1559 } 1560 argptr+=2; 1561 } 1562 break; 1533 1563 case 't': 1534 1564 ExitFlag = 1;
Note:
See TracChangeset
for help on using the changeset viewer.
