Changes in / [47548d:f39735]
- Files:
-
- 4 edited
-
molecuilder/src/builder.cpp (modified) (5 diffs)
-
molecuilder/src/molecules.cpp (modified) (7 diffs)
-
util/src/CalculateDensity.sh.in (modified) (1 diff)
-
util/src/CalculateMass.sh.in (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
molecuilder/src/builder.cpp
r47548d rf39735 463 463 cin >> tmp1; 464 464 first = mol->start; 465 second = first->next; 466 while(second != mol->end) { 467 first = second; 468 second = first->next; 465 while(first->next != mol->end) { 466 first = first->next; 469 467 if (first->x.DistanceSquared((const Vector *)&second->x) > tmp1*tmp1) // distance to first above radius ... 470 468 mol->RemoveAtom(first); … … 474 472 cout << Verbose(0) << "Which axis is it: "; 475 473 cin >> axis; 476 cout << Verbose(0) << "L owerboundary: ";474 cout << Verbose(0) << "Left inward boundary: "; 477 475 cin >> tmp1; 478 cout << Verbose(0) << " Upperboundary: ";476 cout << Verbose(0) << "Right inward boundary: "; 479 477 cin >> tmp2; 480 478 first = mol->start; 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; 479 while(first->next != mol->end) { 480 first = first->next; 481 if ((first->x.x[axis] > tmp2) || (first->x.x[axis] < tmp1)) // out of boundary ... 487 482 mol->RemoveAtom(first); 488 }489 483 } 490 484 break; … … 1355 1349 cout << "\t-m <0/1>\tCalculate (0)/ Align in(1) PAS with greatest EV along z axis." << endl; 1356 1350 cout << "\t-n\tFast parsing (i.e. no trajectories are looked for)." << endl; 1357 cout << "\t-N <radius> <file>\tGet non-convex-envelope." << endl;1351 cout << "\t-N\tGet non-convex-envelope." << endl; 1358 1352 cout << "\t-o <out>\tGet volume of the convex envelope (and store to tecplot file)." << endl; 1359 1353 cout << "\t-p <file>\tParse given xyz file and create raw config file from it." << endl; … … 1361 1355 cout << "\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; 1362 1356 cout << "\t-r\t\tConvert file from an old pcp syntax." << endl; 1363 cout << "\t-R\t\tRemove all atoms out of sphere around a given one." << endl;1364 1357 cout << "\t-t x1 x2 x3\tTranslate all atoms by this vector (x1,x2,x3)." << endl; 1365 1358 cout << "\t-T <file> Store temperatures from the config file in <file>." << endl; … … 1628 1621 cout << Verbose(2) << "File found and parsed." << endl; 1629 1622 argptr+=1; 1630 }1631 break;1632 case 'R':1633 ExitFlag = 1;1634 if ((argptr+1 >= argc) || (!IsValidNumber(argv[argptr])) || (!IsValidNumber(argv[argptr+1]))) {1635 ExitFlag = 255;1636 cerr << "Not enough or invalid arguments given for removing atoms: -R <id> <distance>" << endl;1637 } else {1638 SaveFlag = true;1639 cout << Verbose(1) << "Removing atoms around " << argv[argptr] << " with radius " << argv[argptr+1] << "." << endl;1640 double tmp1 = atof(argv[argptr+1]);1641 atom *third = mol->FindAtom(atoi(argv[argptr]));1642 atom *first = mol->start;1643 if ((third != NULL) && (first != mol->end)) {1644 atom *second = first->next;1645 while(second != mol->end) {1646 first = second;1647 second = first->next;1648 if (first->x.DistanceSquared((const Vector *)&third->x) > tmp1*tmp1) // distance to first above radius ...1649 mol->RemoveAtom(first);1650 }1651 } else {1652 cerr << "Removal failed due to missing atoms on molecule or wrong id." << endl;1653 }1654 argptr+=2;1655 1623 } 1656 1624 break; -
molecuilder/src/molecules.cpp
r47548d rf39735 1860 1860 bool molecule::RemoveAtom(atom *pointer) 1861 1861 { 1862 if (ElementsInMolecule[pointer->type->Z] != 0) {// this would indicate an error1862 if (ElementsInMolecule[pointer->type->Z] != 0) // this would indicate an error 1863 1863 ElementsInMolecule[pointer->type->Z]--; // decrease number of atom of this element 1864 AtomCount--; 1865 } else 1864 else 1866 1865 cerr << "ERROR: Atom " << pointer->Name << " is of element " << pointer->type->Z << " but the entry in the table of the molecule is 0!" << endl; 1867 1866 if (ElementsInMolecule[pointer->type->Z] == 0) // was last atom of this element? … … 2846 2845 ColorList[i] = white; 2847 2846 } 2848 2847 2849 2848 *out << Verbose(1) << "Back edge list - "; 2850 2849 BackEdgeStack->Output(out); … … 3853 3852 OtherAtom = ListOfBondsPerAtom[Walker->nr][i]->GetOtherAtom(Walker); 3854 3853 if (OtherAtom == ListOfLocalAtoms[Binder->rightatom->nr]) { // found the bond 3855 LocalStack->Push(ListOfBondsPerAtom[Walker->nr][i]);3856 *out << Verbose(3) << "Found local edge " << *(ListOfBondsPerAtom[Walker->nr][i]) << "." << endl;3854 LocalStack->Push(ListOfBondsPerAtom[Walker->nr][i]); 3855 *out << Verbose(3) << "Found local edge " << *(ListOfBondsPerAtom[Walker->nr][i]) << "." << endl; 3857 3856 break; 3858 3857 } … … 3862 3861 ReferenceStack->Push(Binder); 3863 3862 } while (FirstBond != Binder); 3864 3863 3865 3864 return status; 3866 3865 }; … … 4007 4006 Walker = start; 4008 4007 while (Walker->next != end) { 4009 Walker = Walker->next; 4008 Walker = Walker->next; 4010 4009 *out << Verbose(4) << "Atom " << Walker->Name << "/" << Walker->nr << " with " << NumberOfBondsPerAtom[Walker->nr] << " bonds: "; 4011 4010 TotalDegree = 0; … … 4366 4365 #ifdef ADDHYDROGEN 4367 4366 && (Walker->type->Z == 1) 4367 #endif 4368 ) { // search for first non-hydrogen atom 4369 *out << Verbose(4) << "Current Root candidate is " << Walker->Name << "." << endl; 4370 Walker = Walker->next; 4371 } 4372 if (Walker != end) 4373 RootStack->Push(Walker); 4374 else 4375 *out << Verbose(0) << "ERROR: Could not find an appropriate Root atom!" << endl; 4376 *out << Verbose(3) << "Root " << Walker->Name << " is on AtomStack, beginning loop through all vertices ..." << endl; 4377 4378 ///// OUTER LOOP //////////// 4379 while (!RootStack->IsEmpty()) { 4380 // get new root vertex from atom stack 4381 Root = RootStack->PopFirst(); 4382 ShortestPathList[Root->nr] = 0; 4383 if (Labels[Root->nr] == -1) 4384 Labels[Root->nr] = RunningIndex++; // prevent it from getting again on AtomStack 4385 PredecessorList[Root->nr] = Root; 4386 TouchedStack->Push(Root); 4387 *out << Verbose(0) << "Root for this loop is: " << Root->Name << ".\n"; 4388 4389 // clear snake stack 4390 SnakeStack->ClearStack(); 4391 //SnakeStack->TestImplementation(out, start->next); 4392 4393 ///// INNER LOOP //////////// 4394 // Problems: 4395 // - what about cyclic bonds? 4396 Walker = Root; 4397 do { 4398 *out << Verbose(1) << "Current Walker is: " << Walker->Name; 4399 // initial setting of the new Walker: label, color, shortest path and put on stacks 4400 if (Labels[Walker->nr] == -1) { // give atom a unique, monotonely increasing number 4401 Labels[Walker->nr] = RunningIndex++; 4402 RootStack->Push(Walker); 4403 } 4404 *out << ", has label " << Labels[Walker->nr]; 4405 if ((ColorVertexList[Walker->nr] == white) || ((Binder != NULL) && (ColorEdgeList[Binder->nr] == white))) { // color it if newly discovered and push on stacks (and if within reach!) 4406 if ((Binder != NULL) && (ColorEdgeList[Binder->nr] == white)) { 4407 // Binder ought to be set still from last neighbour search 4408 *out << ", coloring bond " << *Binder << " black"; 4409 ColorEdgeList[Binder->nr] = black; // mark this bond as used 4410 } 4411 if (ShortestPathList[Walker->nr] == -1) { 4412 ShortestPathList[Walker->nr] = ShortestPathList[PredecessorList[Walker->nr]->nr]+1; 4413 TouchedStack->Push(Walker); // mark every atom for lists cleanup later, whose shortest path has been changed 4414 } 4415 if ((ShortestPathList[Walker->nr] < Order) && (ColorVertexList[Walker->nr] != darkgray)) { // if not already on snake stack 4416 SnakeStack->Push(Walker); 4417 ColorVertexList[Walker->nr] = darkgray; // mark as dark gray of on snake stack 4368 4418 } 4369 4419 } … … 4402 4452 } else { // otherwise check its colour and element 4403 4453 if ( 4454 #ifdef ADDHYDROGEN 4404 4455 (OtherAtom->type->Z != 1) && 4405 4456 #endif -
util/src/CalculateDensity.sh.in
r47548d rf39735 3 3 # calculates the density of a molecule contained in a espack config file 4 4 5 exec_prefix=@prefix@6 5 MOLECUILDER="@bindir@/molecuilder" 7 6 -
util/src/CalculateMass.sh.in
r47548d rf39735 3 3 # calculates mass of a molecule in a XYZ file 4 4 5 exec_prefix=@prefix@6 5 ELEMENTSDB="@bindir@/elements.db" 7 6 … … 34 33 done 35 34 36 echo "Totalmass is $totalmass atomic massunit"35 echo "Totalmass is $totalmass atomicunits" 37 36 exit 0
Note:
See TracChangeset
for help on using the changeset viewer.
