Changeset 9291d04 for src/Fragmentation
- Timestamp:
- Feb 27, 2013, 12:42:36 PM (12 years ago)
- 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)
- Location:
- src/Fragmentation
- Files:
-
- 7 edited
Legend:
- Unmodified
- Added
- Removed
-
src/Fragmentation/BondsPerShortestPath.cpp
rc7c615 r9291d04 122 122 * \param _RootKeyNr index of root node 123 123 * \param RestrictedKeySet Restricted vertex set to use in context of molecule 124 * \param saturationthis tells whether to treat hydrogen special or not.125 */ 126 void BondsPerShortestPath::FillSPListandLabelVertices(int _RootKeyNr, KeySet &RestrictedKeySet, const enum Hydrogen Saturation saturation)124 * \param treatment this tells whether to treat hydrogen special or not. 125 */ 126 void BondsPerShortestPath::FillSPListandLabelVertices(int _RootKeyNr, KeySet &RestrictedKeySet, const enum HydrogenTreatment treatment) 127 127 { 128 128 // Actually, we should construct a spanning tree vom the root atom and select all edges therefrom and put them into … … 173 173 if ((RestrictedKeySet.find(OtherWalker->getNr()) != RestrictedKeySet.end()) 174 174 // skip hydrogens if desired and restrict to fragment 175 && (( saturation == DontSaturate) || (OtherWalker->getType()->getAtomicNumber() != 1))) {175 && ((treatment == IncludeHydrogen) || (OtherWalker->getType()->getAtomicNumber() != 1))) { 176 176 LOG(2, "Current partner is " << *OtherWalker << " with nr " << OtherWalker->getNr() << " in bond " << *(*Runner) << "."); 177 177 // set the label if not set (and push on root stack as well) -
src/Fragmentation/BondsPerShortestPath.hpp
rc7c615 r9291d04 33 33 void SetSPList(atom *_Root); 34 34 void ResetSPList(); 35 void FillSPListandLabelVertices(int _RootKeyNr, KeySet &RestrictedKeySet, const enum Hydrogen Saturation saturation);35 void FillSPListandLabelVertices(int _RootKeyNr, KeySet &RestrictedKeySet, const enum HydrogenTreatment treatment); 36 36 void OutputSPList(); 37 37 int CountNumbersInBondsList(); -
src/Fragmentation/Fragmentation.cpp
rc7c615 r9291d04 64 64 * \param _mol molecule for internal use (looking up atoms) 65 65 * \param _FileChecker instance contains adjacency parsed from elsewhere 66 * \param _ saturationwhether to treat hydrogen special and saturate dangling bonds or not67 */ 68 Fragmentation::Fragmentation(molecule *_mol, AdjacencyList &_FileChecker, const enum Hydrogen Saturation _saturation) :66 * \param _treatment whether to treat hydrogen special and saturate dangling bonds or not 67 */ 68 Fragmentation::Fragmentation(molecule *_mol, AdjacencyList &_FileChecker, const enum HydrogenTreatment _treatment) : 69 69 mol(_mol), 70 saturation(_saturation),70 treatment(_treatment), 71 71 FileChecker(_FileChecker) 72 72 {} … … 109 109 110 110 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."); 114 114 break; 115 case DontSaturate:115 case IncludeHydrogen: 116 116 LOG(0, "Hydrogen is treated just like the rest of the lot."); 117 117 break; 118 118 default: 119 ASSERT(0, "Fragmentation::FragmentMolecule() - there is a saturationsetting which I have no idea about.");119 ASSERT(0, "Fragmentation::FragmentMolecule() - there is a HydrogenTreatment setting which I have no idea about."); 120 120 break; 121 121 } … … 137 137 for (molecule::const_iterator iter = mol->begin(); iter != mol->end(); ++iter) { 138 138 // remove in hydrogen and we do saturate 139 if (( saturation == DoSaturate) && ((*iter)->getType()->getAtomicNumber() == 1)) // skip hydrogen139 if ((treatment == ExcludeHydrogen) && ((*iter)->getType()->getAtomicNumber() == 1)) // skip hydrogen 140 140 AtomMask.setFalse((*iter)->getNr()); 141 141 } … … 258 258 259 259 // Create list of Graphs of current Bond Order (i.e. F_{ij}) 260 NumMoleculesOfOrder[RootNr] = PSG(CompleteMolecule, saturation);260 NumMoleculesOfOrder[RootNr] = PSG(CompleteMolecule, treatment); 261 261 262 262 // output resulting number … … 309 309 c = (ListOfBonds.size() > c) ? ListOfBonds.size() : c; 310 310 } 311 FragmentCount = ( saturation == DoSaturate? mol->getNoNonHydrogen() : mol->getAtomCount()) *(1 << (c*order));311 FragmentCount = (treatment == ExcludeHydrogen ? mol->getNoNonHydrogen() : mol->getAtomCount()) *(1 << (c*order)); 312 312 LOG(1, "Upper limit for this subgraph is " << FragmentCount << " for " 313 313 << mol->getNoNonHydrogen() << " non-H atoms with maximum bond degree of " << c << "."); … … 466 466 const atom * const Father = (*iter)->GetTrueFather(); 467 467 if (AtomMask.isTrue(Father->getNr())) // apply mask 468 if (( saturation == DontSaturate) || ((*iter)->getType()->getAtomicNumber() != 1)) // skip hydrogen468 if ((treatment == IncludeHydrogen) || ((*iter)->getType()->getAtomicNumber() != 1)) // skip hydrogen 469 469 RootStack.push_front((*iter)->getNr()); 470 470 } -
src/Fragmentation/Fragmentation.hpp
rc7c615 r9291d04 34 34 { 35 35 public: 36 Fragmentation(molecule *_mol, AdjacencyList &_FileChecker, const enum HydrogenSaturation _saturation); 36 Fragmentation( 37 molecule *_mol, 38 AdjacencyList &_FileChecker, 39 const enum HydrogenTreatment _treatment); 37 40 ~Fragmentation(); 38 41 … … 61 64 //!> pointer to molecule that is fragmented 62 65 molecule *mol; 63 //!> whether to saturate dangling bonds with hydrogen and hencetreat hydrogen special64 const enum Hydrogen Saturation saturation;66 //!> whether to treat hydrogen special 67 const enum HydrogenTreatment treatment; 65 68 //!> reference to an external adjacency for comparison 66 69 AdjacencyList &FileChecker; -
src/Fragmentation/HydrogenSaturation_enum.hpp
rc7c615 r9291d04 19 19 }; 20 20 21 enum 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 21 26 22 27 #endif /* HYDROGENSATURATION_ENUM_HPP_ */ -
src/Fragmentation/PowerSetGenerator.cpp
rc7c615 r9291d04 191 191 * with SP of 2, then those with SP of 3, then those with SP of 4 and so on. 192 192 * \param RestrictedKeySet Restricted vertex set to use in context of molecule 193 * \param saturationwhether to treat hydrogen special or not193 * \param treatment whether to treat hydrogen special or not 194 194 * \return number of inserted fragments 195 195 * \note ShortestPathList in FragmentSearch structure is probably due to NumberOfAtomsSPLevel and SP not needed anymore 196 196 */ 197 int PowerSetGenerator::operator()(KeySet &RestrictedKeySet, const enum Hydrogen Saturation saturation)197 int PowerSetGenerator::operator()(KeySet &RestrictedKeySet, const enum HydrogenTreatment treatment) 198 198 { 199 199 int Counter = FragmentSearch->FragmentCounter; // mark current value of counter … … 205 205 206 206 // 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); 208 208 209 209 // outputting all list for debugging -
src/Fragmentation/PowerSetGenerator.hpp
rc7c615 r9291d04 30 30 31 31 void SPFragmentGenerator(int RootDistance, std::vector<bond::ptr > &BondsSet, int SetDimension, int SubOrder); 32 int operator()(KeySet &RestrictedKeySet, const enum Hydrogen Saturation saturation);32 int operator()(KeySet &RestrictedKeySet, const enum HydrogenTreatment treatment); 33 33 void RemoveAllTouchedFromSnakeStack(int verbosity, KeySet *FragmentSet, int *&TouchedList, int &TouchedIndex); 34 34 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.