Changes in / [47548d:f39735]


Ignore:
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • molecuilder/src/builder.cpp

    r47548d rf39735  
    463463      cin >> tmp1;
    464464      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;
    469467        if (first->x.DistanceSquared((const Vector *)&second->x) > tmp1*tmp1) // distance to first above radius ...
    470468          mol->RemoveAtom(first);
     
    474472      cout << Verbose(0) << "Which axis is it: ";
    475473      cin >> axis;
    476       cout << Verbose(0) << "Lower boundary: ";
     474      cout << Verbose(0) << "Left inward boundary: ";
    477475      cin >> tmp1;
    478       cout << Verbose(0) << "Upper boundary: ";
     476      cout << Verbose(0) << "Right inward boundary: ";
    479477      cin >> tmp2;
    480478      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 ...
    487482          mol->RemoveAtom(first);
    488         }
    489483      }
    490484      break;
     
    13551349            cout << "\t-m <0/1>\tCalculate (0)/ Align in(1) PAS with greatest EV along z axis." << endl;
    13561350            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;
    13581352            cout << "\t-o <out>\tGet volume of the convex envelope (and store to tecplot file)." << endl;
    13591353            cout << "\t-p <file>\tParse given xyz file and create raw config file from it." << endl;
     
    13611355            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;
    13621356            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;
    13641357            cout << "\t-t x1 x2 x3\tTranslate all atoms by this vector (x1,x2,x3)." << endl;
    13651358            cout << "\t-T <file> Store temperatures from the config file in <file>." << endl;
     
    16281621                  cout << Verbose(2) << "File found and parsed." << endl;
    16291622                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;
    16551623              }
    16561624              break;
  • molecuilder/src/molecules.cpp

    r47548d rf39735  
    18601860bool molecule::RemoveAtom(atom *pointer)
    18611861{
    1862   if (ElementsInMolecule[pointer->type->Z] != 0)  { // this would indicate an error
     1862  if (ElementsInMolecule[pointer->type->Z] != 0)  // this would indicate an error
    18631863    ElementsInMolecule[pointer->type->Z]--;  // decrease number of atom of this element
    1864     AtomCount--;
    1865   } else
     1864  else
    18661865    cerr << "ERROR: Atom " << pointer->Name << " is of element " << pointer->type->Z << " but the entry in the table of the molecule is 0!" << endl;
    18671866  if (ElementsInMolecule[pointer->type->Z] == 0)  // was last atom of this element?
     
    28462845    ColorList[i] = white;
    28472846  }
    2848 
     2847 
    28492848  *out << Verbose(1) << "Back edge list - ";
    28502849  BackEdgeStack->Output(out);
     
    38533852        OtherAtom = ListOfBondsPerAtom[Walker->nr][i]->GetOtherAtom(Walker);
    38543853        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;
    38573856          break;
    38583857        }
     
    38623861    ReferenceStack->Push(Binder);
    38633862  } while (FirstBond != Binder);
    3864 
     3863 
    38653864  return status;
    38663865};
     
    40074006  Walker = start;
    40084007  while (Walker->next != end) {
    4009     Walker = Walker->next;
     4008    Walker = Walker->next; 
    40104009    *out << Verbose(4) << "Atom " << Walker->Name << "/" << Walker->nr << " with " << NumberOfBondsPerAtom[Walker->nr] << " bonds: ";
    40114010    TotalDegree = 0;
     
    43664365#ifdef ADDHYDROGEN
    43674366   && (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
    43684418        }
    43694419      }
     
    44024452            } else { // otherwise check its colour and element
    44034453              if (
     4454#ifdef ADDHYDROGEN
    44044455              (OtherAtom->type->Z != 1) &&
    44054456#endif
  • util/src/CalculateDensity.sh.in

    r47548d rf39735  
    33# calculates the density of a molecule contained in a espack config file
    44
    5 exec_prefix=@prefix@
    65MOLECUILDER="@bindir@/molecuilder"
    76
  • util/src/CalculateMass.sh.in

    r47548d rf39735  
    33# calculates mass of a molecule in a XYZ file
    44
    5 exec_prefix=@prefix@
    65ELEMENTSDB="@bindir@/elements.db"
    76
     
    3433done
    3534
    36 echo "Totalmass is $totalmass atomicmassunit"
     35echo "Totalmass is $totalmass atomicunits"
    3736exit 0
Note: See TracChangeset for help on using the changeset viewer.