Changeset 7e4d0a6


Ignore:
Timestamp:
Apr 4, 2018, 4:59:24 PM (7 years ago)
Author:
Frederik Heber <frederik.heber@…>
Branches:
Adding_MD_integration_tests, Adding_StructOpt_integration_tests, AutomationFragmentation_failures, Candidate_v1.6.1, ChemicalSpaceEvaluator, Enhanced_StructuralOptimization, Enhanced_StructuralOptimization_continued, Exclude_Hydrogens_annealWithBondGraph, ForceAnnealing_with_BondGraph, ForceAnnealing_with_BondGraph_contraction-expansion, Gui_displays_atomic_force_velocity, JobMarket_RobustOnKillsSegFaults, JobMarket_StableWorkerPool, PythonUI_with_named_parameters, StoppableMakroAction, TremoloParser_IncreasedPrecision
Children:
37fe17
Parents:
0aae02
git-author:
Frederik Heber <frederik.heber@…> (07/12/17 20:53:30)
git-committer:
Frederik Heber <frederik.heber@…> (04/04/18 16:59:24)
Message:

FIX: Fragmentation does no longer use getTrueFather().

  • in a very early implementations saturation hydrogens were all over the place and we needed to look at the original atom. Every atom has a father member where for the saturation hydrogen the original atom (i.e. the one from the dangling bond not present in the current fragment) was stored. Now, however, we only look at the set of atoms without any hydrogens and saturation is done after the fragmentation has taken place (namely in the ExportGraph routines). Therefore, we do not need the getTrueFather() calls any longer.
  • FIX: This fixes a bug where we filled the box with water molecules and intended to perform a long-range MD afterwards but only a single fragment is calculated. This is because of the getTrueFather() calls that mask every atom except for the three atoms of the original water molecule that was used to fill the box with.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/Fragmentation/Fragmentation.cpp

    r0aae02 r7e4d0a6  
    286286    atom *Walker = mol->FindAtom(RootKeyNr);
    287287    // check cyclic lengths
    288     //if ((MinimumRingSize[Walker->GetTrueFather()->getNr()] != -1) && (Walker->GetTrueFather()->getAdaptiveOrder()+1 > MinimumRingSize[Walker->GetTrueFather()->getNr()])) {
    289     //  LOG(0, "Bond order " << Walker->GetTrueFather()->getAdaptiveOrder() << " of Root " << *Walker << " greater than or equal to Minimum Ring size of " << MinimumRingSize << " found is not allowed.");
     288    //if ((MinimumRingSize[Walker->getNr()] != -1) && (Walker->getAdaptiveOrder()+1 > MinimumRingSize[Walker->getNr()])) {
     289    //  LOG(0, "Bond order " << Walker->getAdaptiveOrder() << " of Root " << *Walker << " greater than or equal to Minimum Ring size of " << MinimumRingSize << " found is not allowed.");
    290290    //} else
    291291    {
    292292      // set adaptive order to desired max order
    293       Walker->GetTrueFather()->setAdaptiveOrder(Walker->GetTrueFather()->getMaxOrder());
    294       Order = Walker->GetTrueFather()->getAdaptiveOrder();
     293      Walker->setAdaptiveOrder(Walker->getMaxOrder());
     294      Order = Walker->getAdaptiveOrder();
    295295      Walker->setAdaptiveOrder(Order);
    296296
     
    320320      //NumMoleculesOfOrder[Walker->getAdaptiveOrder()-1] = NumMolecules;
    321321      TotalNumMolecules += NumMoleculesOfOrder[RootNr];
    322 //      LOG(1, "Number of resulting molecules for Order " << (int)Walker->GetTrueFather()->getAdaptiveOrder() << " is: " << NumMoleculesOfOrder[RootNr] << ".");
     322//      LOG(1, "Number of resulting molecules for Order " << (int)Walker->getAdaptiveOrder() << " is: " << NumMoleculesOfOrder[RootNr] << ".");
    323323      RootStack.push_back(RootKeyNr); // put back on stack
    324324      RootNr++;
     
    540540      iter != const_cast<const molecule *>(mol)->end();
    541541      ++iter) {
    542     const atom * const Father = (*iter)->GetTrueFather();
    543     if (AtomMask.isTrue(Father->getNr())) // apply mask
    544       if ((treatment == IncludeHydrogen) || ((*iter)->getType()->getAtomicNumber() != 1)) // skip hydrogen
    545         RootStack.push_front((*iter)->getNr());
     542    const atom * const Walker = (*iter);
     543    if (AtomMask.isTrue(Walker->getNr())) // apply mask
     544      if ((treatment == IncludeHydrogen) || (Walker->getType()->getAtomicNumber() != 1)) // skip hydrogen
     545        RootStack.push_front(Walker->getNr());
    546546  }
    547547}
     
    600600    KeySet TempSet;
    601601    for (KeySet::iterator sprinter = (*runner).first.begin(); sprinter != (*runner).first.end(); sprinter++)
    602       TempSet.insert((mol->FindAtom(*sprinter))->GetTrueFather()->getId());
     602      TempSet.insert((mol->FindAtom(*sprinter))->getId());
    603603    TotalGraph.insert(GraphPair(TempSet, pair<int, double> (TotalNumberOfKeySets++, (*runner).second.second)));
    604604  }
Note: See TracChangeset for help on using the changeset viewer.