Ignore:
Timestamp:
Nov 3, 2009, 2:34:02 PM (16 years ago)
Author:
Frederik Heber <heber@…>
Children:
c1b4a4
Parents:
5f9f8b
git-author:
Frederik Heber <heber@…> (11/03/09 14:27:15)
git-committer:
Frederik Heber <heber@…> (11/03/09 14:34:02)
Message:

Fixing not created adjacency list, partially fixing subgraph dissection in config::Load()

  • CreateAdjacencyList() was called with zero bonddistance.
  • this was due to max_distance not being initialised in the constructor to 0 and subsequently not set if Bond Length Table was not found.
  • new function SetMaxDistanceToMaxOfCovalentRadii() which sets the max_distance to twice the max of covalent radii of all elements.
  • config::Load() - atoms in copied molecule (by DepthFirstSearchAnalysis()) are made their own father (and originals are removed).
File:
1 edited

Legend:

Unmodified
Added
Removed
  • molecuilder/src/molecule_graph.cpp

    r5f9f8b r08b88b  
    114114  *out << Verbose(0) << "Begin of CreateAdjacencyList." << endl;
    115115  // remove every bond from the list
    116   if ((first->next != last) && (last->previous != first)) { // there are bonds present
    117     cleanup(first, last);
     116  bond *Binder = NULL;
     117  while (last->previous != first) {
     118    Binder = last->previous;
     119    Binder->leftatom->UnregisterBond(Binder);
     120    Binder->rightatom->UnregisterBond(Binder);
     121    removewithoutcheck(Binder);
    118122  }
    119123
    120124  // count atoms in molecule = dimension of matrix (also give each unique name and continuous numbering)
    121125  CountAtoms(out);
    122   *out << Verbose(1) << "AtomCount " << AtomCount << "." << endl;
     126  *out << Verbose(1) << "AtomCount " << AtomCount << " and bonddistance is " << bonddistance << "." << endl;
    123127
    124128  if ((AtomCount > 1) && (bonddistance > 1.)) {
     129    *out << Verbose(2) << "Creating Linked Cell structure ... " << endl;
    125130    LC = new LinkedCell(this, bonddistance);
    126131
    127132    // create a list to map Tesselpoint::nr to atom *
     133    *out << Verbose(2) << "Creating TesselPoint to atom map ... " << endl;
    128134    AtomMap = Calloc<atom *> (AtomCount, "molecule::CreateAdjacencyList - **AtomCount");
    129135    Walker = start;
     
    134140
    135141    // 3a. go through every cell
     142    *out << Verbose(2) << "Celling ... " << endl;
    136143    for (LC->n[0] = 0; LC->n[0] < LC->N[0]; LC->n[0]++)
    137144      for (LC->n[1] = 0; LC->n[1] < LC->N[1]; LC->n[1]++)
     
    175182
    176183    // correct bond degree by comparing valence and bond degree
     184    *out << Verbose(2) << "Correcting bond degree ... " << endl;
    177185    CorrectBondDegree(out);
    178186
Note: See TracChangeset for help on using the changeset viewer.