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/bondgraph.cpp

    r5f9f8b r08b88b  
    1313#include "molecule.hpp"
    1414#include "parser.hpp"
     15#include "periodentafel.hpp"
    1516#include "vector.hpp"
    1617
     
    1819 * This classes contains typical bond lengths and thus may be used to construct a bond graph for a given molecule.
    1920 */
    20 BondGraph::BondGraph(bool IsA) : BondLengthMatrix(NULL), IsAngstroem(IsA)
     21BondGraph::BondGraph(bool IsA) : BondLengthMatrix(NULL), max_distance(0), IsAngstroem(IsA)
    2122{
    2223};
     
    104105};
    105106
     107/** Determines the maximum of all element::CovalentRadius.
     108 * \param *out output stream for debugging
     109 * \param *periode periodentafel with all elements.
     110 */
     111double BondGraph::SetMaxDistanceToMaxOfCovalentRadii(ofstream * const out, const periodentafel * const periode)
     112{
     113  max_distance = 0.;
     114
     115  element * Runner = periode->start;
     116  while (Runner->next != periode->end) {
     117    Runner = Runner->next;
     118    if (Runner->CovalentRadius > max_distance)
     119      max_distance = Runner->CovalentRadius;
     120  }
     121  max_distance *= 2.;
     122
     123  return max_distance;
     124};
     125
    106126/** Returns bond criterion for given pair based on covalent radius.
    107127 * \param *Walker first BondedParticle
Note: See TracChangeset for help on using the changeset viewer.