Changeset 9291d04 for src/Fragmentation


Ignore:
Timestamp:
Feb 27, 2013, 12:42:36 PM (12 years ago)
Author:
Frederik Heber <heber@…>
Branches:
Action_Thermostats, Add_AtomRandomPerturbation, Add_FitFragmentPartialChargesAction, Add_RotateAroundBondAction, Add_SelectAtomByNameAction, Added_ParseSaveFragmentResults, AddingActions_SaveParseParticleParameters, Adding_Graph_to_ChangeBondActions, Adding_MD_integration_tests, Adding_ParticleName_to_Atom, Adding_StructOpt_integration_tests, AtomFragments, Automaking_mpqc_open, AutomationFragmentation_failures, Candidate_v1.5.4, Candidate_v1.6.0, Candidate_v1.6.1, ChangeBugEmailaddress, ChangingTestPorts, ChemicalSpaceEvaluator, CombiningParticlePotentialParsing, Combining_Subpackages, Debian_Package_split, Debian_package_split_molecuildergui_only, Disabling_MemDebug, Docu_Python_wait, EmpiricalPotential_contain_HomologyGraph, EmpiricalPotential_contain_HomologyGraph_documentation, Enable_parallel_make_install, Enhance_userguide, Enhanced_StructuralOptimization, Enhanced_StructuralOptimization_continued, Example_ManyWaysToTranslateAtom, Exclude_Hydrogens_annealWithBondGraph, FitPartialCharges_GlobalError, Fix_BoundInBox_CenterInBox_MoleculeActions, Fix_ChargeSampling_PBC, Fix_ChronosMutex, Fix_FitPartialCharges, Fix_FitPotential_needs_atomicnumbers, Fix_ForceAnnealing, Fix_IndependentFragmentGrids, Fix_ParseParticles, Fix_ParseParticles_split_forward_backward_Actions, Fix_PopActions, Fix_QtFragmentList_sorted_selection, Fix_Restrictedkeyset_FragmentMolecule, Fix_StatusMsg, Fix_StepWorldTime_single_argument, Fix_Verbose_Codepatterns, Fix_fitting_potentials, Fixes, ForceAnnealing_goodresults, ForceAnnealing_oldresults, ForceAnnealing_tocheck, ForceAnnealing_with_BondGraph, ForceAnnealing_with_BondGraph_continued, ForceAnnealing_with_BondGraph_continued_betteresults, ForceAnnealing_with_BondGraph_contraction-expansion, FragmentAction_writes_AtomFragments, FragmentMolecule_checks_bonddegrees, GeometryObjects, Gui_Fixes, Gui_displays_atomic_force_velocity, ImplicitCharges, IndependentFragmentGrids, IndependentFragmentGrids_IndividualZeroInstances, IndependentFragmentGrids_IntegrationTest, IndependentFragmentGrids_Sole_NN_Calculation, JobMarket_RobustOnKillsSegFaults, JobMarket_StableWorkerPool, JobMarket_unresolvable_hostname_fix, MoreRobust_FragmentAutomation, ODR_violation_mpqc_open, PartialCharges_OrthogonalSummation, PdbParser_setsAtomName, PythonUI_with_named_parameters, QtGui_reactivate_TimeChanged_changes, Recreated_GuiChecks, Rewrite_FitPartialCharges, RotateToPrincipalAxisSystem_UndoRedo, SaturateAtoms_findBestMatching, SaturateAtoms_singleDegree, StoppableMakroAction, Subpackage_CodePatterns, Subpackage_JobMarket, Subpackage_LinearAlgebra, Subpackage_levmar, Subpackage_mpqc_open, Subpackage_vmg, Switchable_LogView, ThirdParty_MPQC_rebuilt_buildsystem, TrajectoryDependenant_MaxOrder, TremoloParser_IncreasedPrecision, TremoloParser_MultipleTimesteps, TremoloParser_setsAtomName, Ubuntu_1604_changes, stable
Children:
39a07a
Parents:
c7c615
git-author:
Frederik Heber <heber@…> (12/11/12 10:39:30)
git-committer:
Frederik Heber <heber@…> (02/27/13 12:42:36)
Message:

Split saturation with hydrogen of treatment of hydrogen.

Location:
src/Fragmentation
Files:
7 edited

Legend:

Unmodified
Added
Removed
  • src/Fragmentation/BondsPerShortestPath.cpp

    rc7c615 r9291d04  
    122122 * \param _RootKeyNr index of root node
    123123 * \param RestrictedKeySet Restricted vertex set to use in context of molecule
    124  * \param saturation this tells whether to treat hydrogen special or not.
    125  */
    126 void BondsPerShortestPath::FillSPListandLabelVertices(int _RootKeyNr, KeySet &RestrictedKeySet, const enum HydrogenSaturation saturation)
     124 * \param treatment this tells whether to treat hydrogen special or not.
     125 */
     126void BondsPerShortestPath::FillSPListandLabelVertices(int _RootKeyNr, KeySet &RestrictedKeySet, const enum HydrogenTreatment treatment)
    127127{
    128128  // Actually, we should construct a spanning tree vom the root atom and select all edges therefrom and put them into
     
    173173        if ((RestrictedKeySet.find(OtherWalker->getNr()) != RestrictedKeySet.end())
    174174            // skip hydrogens if desired and restrict to fragment
    175             && ((saturation == DontSaturate) || (OtherWalker->getType()->getAtomicNumber() != 1))) {
     175            && ((treatment == IncludeHydrogen) || (OtherWalker->getType()->getAtomicNumber() != 1))) {
    176176          LOG(2, "Current partner is " << *OtherWalker << " with nr " << OtherWalker->getNr() << " in bond " << *(*Runner) << ".");
    177177          // set the label if not set (and push on root stack as well)
  • src/Fragmentation/BondsPerShortestPath.hpp

    rc7c615 r9291d04  
    3333  void SetSPList(atom *_Root);
    3434  void ResetSPList();
    35   void FillSPListandLabelVertices(int _RootKeyNr, KeySet &RestrictedKeySet, const enum HydrogenSaturation saturation);
     35  void FillSPListandLabelVertices(int _RootKeyNr, KeySet &RestrictedKeySet, const enum HydrogenTreatment treatment);
    3636  void OutputSPList();
    3737  int CountNumbersInBondsList();
  • src/Fragmentation/Fragmentation.cpp

    rc7c615 r9291d04  
    6464 * \param _mol molecule for internal use (looking up atoms)
    6565 * \param _FileChecker instance contains adjacency parsed from elsewhere
    66  * \param _saturation whether to treat hydrogen special and saturate dangling bonds or not
    67  */
    68 Fragmentation::Fragmentation(molecule *_mol, AdjacencyList &_FileChecker, const enum HydrogenSaturation _saturation) :
     66 * \param _treatment whether to treat hydrogen special and saturate dangling bonds or not
     67 */
     68Fragmentation::Fragmentation(molecule *_mol, AdjacencyList &_FileChecker, const enum HydrogenTreatment _treatment) :
    6969  mol(_mol),
    70   saturation(_saturation),
     70  treatment(_treatment),
    7171  FileChecker(_FileChecker)
    7272{}
     
    109109
    110110  LOG(0, std::endl);
    111   switch (saturation) {
    112     case DoSaturate:
    113       LOG(0, "I will treat hydrogen special and saturate dangling bonds with it.");
     111  switch (treatment) {
     112    case ExcludeHydrogen:
     113      LOG(0, "I will treat hydrogen special.");
    114114      break;
    115     case DontSaturate:
     115    case IncludeHydrogen:
    116116      LOG(0, "Hydrogen is treated just like the rest of the lot.");
    117117      break;
    118118    default:
    119       ASSERT(0, "Fragmentation::FragmentMolecule() - there is a saturation setting which I have no idea about.");
     119      ASSERT(0, "Fragmentation::FragmentMolecule() - there is a HydrogenTreatment setting which I have no idea about.");
    120120      break;
    121121  }
     
    137137  for (molecule::const_iterator iter = mol->begin(); iter != mol->end(); ++iter) {
    138138    // remove in hydrogen and we do saturate
    139     if ((saturation == DoSaturate) && ((*iter)->getType()->getAtomicNumber() == 1)) // skip hydrogen
     139    if ((treatment == ExcludeHydrogen) && ((*iter)->getType()->getAtomicNumber() == 1)) // skip hydrogen
    140140      AtomMask.setFalse((*iter)->getNr());
    141141  }
     
    258258
    259259      // Create list of Graphs of current Bond Order (i.e. F_{ij})
    260       NumMoleculesOfOrder[RootNr] = PSG(CompleteMolecule, saturation);
     260      NumMoleculesOfOrder[RootNr] = PSG(CompleteMolecule, treatment);
    261261
    262262      // output resulting number
     
    309309    c = (ListOfBonds.size() > c) ? ListOfBonds.size() : c;
    310310  }
    311   FragmentCount = (saturation == DoSaturate ? mol->getNoNonHydrogen() : mol->getAtomCount()) *(1 << (c*order));
     311  FragmentCount = (treatment == ExcludeHydrogen ? mol->getNoNonHydrogen() : mol->getAtomCount()) *(1 << (c*order));
    312312  LOG(1, "Upper limit for this subgraph is " << FragmentCount << " for "
    313313      << mol->getNoNonHydrogen() << " non-H atoms with maximum bond degree of " << c << ".");
     
    466466    const atom * const Father = (*iter)->GetTrueFather();
    467467    if (AtomMask.isTrue(Father->getNr())) // apply mask
    468       if ((saturation == DontSaturate) || ((*iter)->getType()->getAtomicNumber() != 1)) // skip hydrogen
     468      if ((treatment == IncludeHydrogen) || ((*iter)->getType()->getAtomicNumber() != 1)) // skip hydrogen
    469469        RootStack.push_front((*iter)->getNr());
    470470  }
  • src/Fragmentation/Fragmentation.hpp

    rc7c615 r9291d04  
    3434{
    3535public:
    36   Fragmentation(molecule *_mol, AdjacencyList &_FileChecker, const enum HydrogenSaturation _saturation);
     36  Fragmentation(
     37      molecule *_mol,
     38      AdjacencyList &_FileChecker,
     39      const enum HydrogenTreatment _treatment);
    3740  ~Fragmentation();
    3841
     
    6164  //!> pointer to molecule that is fragmented
    6265  molecule *mol;
    63   //!> whether to saturate dangling bonds with hydrogen and hence treat hydrogen special
    64   const enum HydrogenSaturation saturation;
     66  //!> whether to treat hydrogen special
     67  const enum HydrogenTreatment treatment;
    6568  //!> reference to an external adjacency for comparison
    6669  AdjacencyList &FileChecker;
  • src/Fragmentation/HydrogenSaturation_enum.hpp

    rc7c615 r9291d04  
    1919};
    2020
     21enum HydrogenTreatment {
     22  ExcludeHydrogen, //!< exclude hydrogen from the bond graph, i.e. fragmentation treats hydrogen special
     23  IncludeHydrogen,   //!< include hydrogen from the bond graph, i.e. fragmentation treats hydrogen just as the rest
     24};
     25
    2126
    2227#endif /* HYDROGENSATURATION_ENUM_HPP_ */
  • src/Fragmentation/PowerSetGenerator.cpp

    rc7c615 r9291d04  
    191191 * with SP of 2, then those with SP of 3, then those with SP of 4 and so on.
    192192 * \param RestrictedKeySet Restricted vertex set to use in context of molecule
    193  * \param saturation whether to treat hydrogen special or not
     193 * \param treatment whether to treat hydrogen special or not
    194194 * \return number of inserted fragments
    195195 * \note ShortestPathList in FragmentSearch structure is probably due to NumberOfAtomsSPLevel and SP not needed anymore
    196196 */
    197 int PowerSetGenerator::operator()(KeySet &RestrictedKeySet, const enum HydrogenSaturation saturation)
     197int PowerSetGenerator::operator()(KeySet &RestrictedKeySet, const enum HydrogenTreatment treatment)
    198198{
    199199  int Counter = FragmentSearch->FragmentCounter; // mark current value of counter
     
    205205
    206206  // do a BFS search to fill the SP lists and label the found vertices
    207   BondsPerSPList.FillSPListandLabelVertices(FragmentSearch->getRoot()->GetTrueFather()->getNr(), RestrictedKeySet, saturation);
     207  BondsPerSPList.FillSPListandLabelVertices(FragmentSearch->getRoot()->GetTrueFather()->getNr(), RestrictedKeySet, treatment);
    208208
    209209  // outputting all list for debugging
  • src/Fragmentation/PowerSetGenerator.hpp

    rc7c615 r9291d04  
    3030
    3131  void SPFragmentGenerator(int RootDistance, std::vector<bond::ptr > &BondsSet, int SetDimension, int SubOrder);
    32   int operator()(KeySet &RestrictedKeySet, const enum HydrogenSaturation saturation);
     32  int operator()(KeySet &RestrictedKeySet, const enum HydrogenTreatment treatment);
    3333  void RemoveAllTouchedFromSnakeStack(int verbosity, KeySet *FragmentSet, int *&TouchedList, int &TouchedIndex);
    3434  int FillBondsList(std::vector<bond::ptr > &BondsList, std::list<bond::ptr >::const_iterator SetFirst, std::list<bond::ptr >::const_iterator SetLast, int *&TouchedList, int TouchedIndex);
Note: See TracChangeset for help on using the changeset viewer.