Changeset 07a47e
- Timestamp:
- Oct 26, 2011, 3:02:53 PM (14 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:
- 41d023
- Parents:
- 99b0dc
- Files:
-
- 1 added
- 20 edited
Legend:
- Unmodified
- Added
- Removed
-
configure.ac
r99b0dc r07a47e 164 164 AC_CHECK_LIB(gsl, gsl_blas_dnrm2, , [AC_MSG_ERROR(["No working BLAS found for GSL, stopping."])]) 165 165 166 # add replacement/saturation hydrogen or not167 AC_ARG_ENABLE([hydrogen],AS_HELP_STRING([--enable-hydrogen],[Adding saturation hydrogen (default is yes)]),168 [enable_hydrogen=$enableval], [enable_hydrogen=yes])169 if test x"$enable_hydrogen" = xyes; then170 AC_DEFINE(ADDHYDROGEN,1, ["Adding saturation hydrogen"])171 AC_SUBST(ADDHYDROGEN)172 fi173 174 166 # use CppUnit TestRunner or not 175 167 AC_ARG_ENABLE([ecut],AS_HELP_STRING([--enable-ecut],[Use ECut TestRunnerClient (default is no)]), -
src/Actions/FragmentationAction/FragmentationAction.cpp
r99b0dc r07a47e 26 26 #include "CodePatterns/Verbose.hpp" 27 27 #include "Fragmentation/Fragmentation.hpp" 28 #include "Fragmentation/HydrogenSaturation_enum.hpp" 28 29 #include "Graph/DepthFirstSearchAnalysis.hpp" 29 30 #include "molecule.hpp" … … 63 64 start = clock(); 64 65 if (mol->hasBondStructure()) { 65 Fragmentation Fragmenter(mol );66 Fragmentation Fragmenter(mol, params.DoSaturation ? DoSaturate : DontSaturate); 66 67 Fragmenter.setOutputTypes(params.types); 67 68 ExitFlag = Fragmenter.FragmentMolecule(params.order, params.prefix, DFS); -
src/Actions/FragmentationAction/FragmentationAction.def
r99b0dc r07a47e 13 13 // ValueStorage by the token "Z" -> first column: int, Z, "Z" 14 14 // "undefine" if no parameters are required, use (NODEFAULT) for each (undefined) default value 15 #define paramtypes (std::string)(double)(int)( std::vector<std::string>)16 #define paramtokens ("fragment-molecule")("distance")("order")(" output-types")17 #define paramdescriptions ("prefix of each fragment file")("distance in space")("order of a discretization, dissection, ...")(" type(s) of parsers that output fragment config files")18 #define paramdefaults (NODEFAULT)(NODEFAULT)(NODEFAULT)(" pcp tremolo xyz")19 #define paramreferences (prefix)(distance)(order)( types)15 #define paramtypes (std::string)(double)(int)(bool)(std::vector<std::string>) 16 #define paramtokens ("fragment-molecule")("distance")("order")("DoSaturate")("output-types") 17 #define paramdescriptions ("prefix of each fragment file")("distance in space")("order of a discretization, dissection, ...")("do saturate dangling bonds with hydrogen")("type(s) of parsers that output fragment config files") 18 #define paramdefaults (NODEFAULT)(NODEFAULT)(NODEFAULT)("1")("pcp tremolo xyz") 19 #define paramreferences (prefix)(distance)(order)(DoSaturation)(types) 20 20 21 21 #undef statetypes -
src/Actions/GraphAction/DepthFirstSearchAction.cpp
r99b0dc r07a47e 25 25 #include "CodePatterns/Log.hpp" 26 26 #include "CodePatterns/Verbose.hpp" 27 #include "Fragmentation/HydrogenSaturation_enum.hpp" 27 28 #include "Graph/CyclicStructureAnalysis.hpp" 28 29 #include "Graph/DepthFirstSearchAnalysis.hpp" … … 63 64 LocalBackEdgeStack = new std::deque<bond *>; // no need to have it Subgraphs->Leaf->BondCount size 64 65 DFS.PickLocalBackEdges(ListOfAtoms, LocalBackEdgeStack); 65 CyclicStructureAnalysis CycleAnalysis ;66 CyclicStructureAnalysis CycleAnalysis(params.DoSaturation ? DoSaturate : DontSaturate); 66 67 CycleAnalysis(LocalBackEdgeStack); 67 68 delete(LocalBackEdgeStack); -
src/Actions/GraphAction/DepthFirstSearchAction.def
r99b0dc r07a47e 12 12 // ValueStorage by the token "Z" -> first column: int, Z, "Z" 13 13 // "undefine" if no parameters are required, use (NODEFAULT) for each (undefined) default value 14 #define paramtypes (double) 15 #define paramtokens ("depth-first-search") 16 #define paramdescriptions ("maximum distance to look for neighbors") 17 # undef paramdefaults18 #define paramreferences (distance) 14 #define paramtypes (double)(bool) 15 #define paramtokens ("depth-first-search")("DoSaturate") 16 #define paramdescriptions ("maximum distance to look for neighbors")("whether to treat hydrogen special or not") 17 #define paramdefaults (NODEFAULT)("1") 18 #define paramreferences (distance)(DoSaturation) 19 19 20 20 #undef statetypes -
src/Fragmentation/BondsPerShortestPath.cpp
r99b0dc r07a47e 101 101 * \param _RootKeyNr index of root node 102 102 * \param RestrictedKeySet Restricted vertex set to use in context of molecule 103 */ 104 void BondsPerShortestPath::FillSPListandLabelVertices(int _RootKeyNr, KeySet &RestrictedKeySet) 103 * \param saturation this tells whether to treat hydrogen special or not. 104 */ 105 void BondsPerShortestPath::FillSPListandLabelVertices(int _RootKeyNr, KeySet &RestrictedKeySet, const enum HydrogenSaturation saturation) 105 106 { 106 107 // Actually, we should construct a spanning tree vom the root atom and select all edges therefrom and put them into … … 146 147 OtherWalker = (*Runner)->GetOtherAtom(Walker); 147 148 if ((RestrictedKeySet.find(OtherWalker->getNr()) != RestrictedKeySet.end()) 148 #ifdef ADDHYDROGEN 149 && (OtherWalker->getType()->getAtomicNumber() != 1) 150 #endif 151 ) { // skip hydrogens and restrict to fragment 149 // skip hydrogens if desired and restrict to fragment 150 && ((saturation == DontSaturate) || (OtherWalker->getType()->getAtomicNumber() != 1))) { 152 151 DoLog(2) && (Log() << Verbose(2) << "Current partner is " << *OtherWalker << " with nr " << OtherWalker->getNr() << " in bond " << *(*Runner) << "." << endl); 153 152 // set the label if not set (and push on root stack as well) -
src/Fragmentation/BondsPerShortestPath.hpp
r99b0dc r07a47e 13 13 #include <config.h> 14 14 #endif 15 16 #include "Fragmentation/HydrogenSaturation_enum.hpp" 15 17 16 18 #include <list> … … 31 33 void SetSPList(atom *_Root); 32 34 void ResetSPList(); 33 void FillSPListandLabelVertices(int _RootKeyNr, KeySet &RestrictedKeySet );35 void FillSPListandLabelVertices(int _RootKeyNr, KeySet &RestrictedKeySet, const enum HydrogenSaturation saturation); 34 36 void OutputSPList(); 35 37 int CountNumbersInBondsList(); -
src/Fragmentation/Fragmentation.cpp
r99b0dc r07a47e 45 45 /** Constructor of class Fragmentation. 46 46 * 47 */ 48 Fragmentation::Fragmentation(molecule *_mol) : 49 mol(_mol) 47 * \param _mol molecule for internal use (looking up atoms) 48 * \param _saturation whether to treat hydrogen special and saturate dangling bonds or not 49 */ 50 Fragmentation::Fragmentation(molecule *_mol, const enum HydrogenSaturation _saturation) : 51 mol(_mol), 52 saturation(_saturation) 50 53 {} 51 54 … … 90 93 91 94 DoLog(0) && (Log() << Verbose(0) << endl); 92 #ifdef ADDHYDROGEN 93 DoLog(0) && (Log() << Verbose(0) << "I will treat hydrogen special and saturate dangling bonds with it." << endl); 94 #else 95 DoLog(0) && (Log() << Verbose(0) << "Hydrogen is treated just like the rest of the lot." << endl); 96 #endif 95 switch (saturation) { 96 case DoSaturate: 97 DoLog(0) && (Log() << Verbose(0) << "I will treat hydrogen special and saturate dangling bonds with it." << endl); 98 break; 99 case DontSaturate: 100 DoLog(0) && (Log() << Verbose(0) << "Hydrogen is treated just like the rest of the lot." << endl); 101 break; 102 default: 103 ASSERT(0, "Fragmentation::FragmentMolecule() - there is a saturation setting which I have no idea about."); 104 break; 105 } 97 106 98 107 // ++++++++++++++++++++++++++++ INITIAL STUFF: Bond structure analysis, file parsing, ... ++++++++++++++++++++++++++++++++++++++++++ … … 151 160 AtomMask[mol->getAtomCount()] = true; // last plus one entry is used as marker that we have been through this loop once already in CheckOrderAtSite() 152 161 // ===== 6b. fill RootStack for each subgraph (second adaptivity check) ===== 153 Subgraphs->next->FillRootStackForSubgraphs(RootStack, AtomMask, (FragmentCounter = 0) );162 Subgraphs->next->FillRootStackForSubgraphs(RootStack, AtomMask, (FragmentCounter = 0), saturation); 154 163 155 164 // ===== 7. fill the bond fragment list ===== … … 359 368 FragmentLowerOrdersList[RootNr][0] = new Graph; 360 369 FragmentSearch.PrepareForPowersetGeneration(1., FragmentLowerOrdersList[RootNr][0], Walker); 361 NumMoleculesOfOrder[RootNr] = PSG(CompleteMolecule );370 NumMoleculesOfOrder[RootNr] = PSG(CompleteMolecule, saturation); 362 371 363 372 // output resulting number … … 487 496 DoeLog(2) && (eLog()<< Verbose(2) << "Unable to parse file, incrementing all." << endl); 488 497 for (molecule::const_iterator iter = mol->begin(); iter != mol->end(); ++iter) { 489 #ifdef ADDHYDROGEN 490 if ((*iter)->getType()->getAtomicNumber() != 1) // skip hydrogen 491 #endif 498 if ((saturation == DontSaturate) || ((*iter)->getType()->getAtomicNumber() != 1)) // skip hydrogen 492 499 { 493 500 AtomMask[(*iter)->getNr()] = true; // include all (non-hydrogen) atoms … … 502 509 } else { // global increase of Bond Order 503 510 for(molecule::const_iterator iter = mol->begin(); iter != mol->end(); ++iter) { 504 #ifdef ADDHYDROGEN 505 if ((*iter)->getType()->getAtomicNumber() != 1) // skip hydrogen 506 #endif 511 if ((saturation == DontSaturate) || ((*iter)->getType()->getAtomicNumber() != 1)) // skip hydrogen 507 512 { 508 513 AtomMask[(*iter)->getNr()] = true; // include all (non-hydrogen) atoms … … 670 675 atom *FatherOfRunner = NULL; 671 676 672 #ifdef ADDHYDROGEN673 molecule::const_iterator runner;674 #endif675 677 // we increment the iter just before skipping the hydrogen 676 678 for (molecule::const_iterator iter = Leaf->begin(); iter != Leaf->end();) { … … 700 702 } else { 701 703 // Log() << Verbose(0) << ", who has no son in this fragment molecule." << endl; 702 #ifdef ADDHYDROGEN703 704 //Log() << Verbose(3) << "Adding Hydrogen to " << (*iter)->Name << " and a bond in between." << endl; 704 if (!Leaf->AddHydrogenReplacementAtom((*BondRunner), (*iter), FatherOfRunner, OtherFather, IsAngstroem))705 exit(1);706 #endif 705 if (saturation == DoSaturate) 706 if (!Leaf->AddHydrogenReplacementAtom((*BondRunner), (*iter), FatherOfRunner, OtherFather, IsAngstroem)) 707 exit(1); 707 708 //NumBonds[(*iter)->getNr()] += Binder->BondDegree; 708 709 } … … 715 716 } 716 717 ++iter; 717 #ifdef ADDHYDROGEN 718 while ((iter != Leaf->end()) && ((*iter)->getType()->getAtomicNumber() == 1)){ // skip added hydrogen719 iter++;720 }721 #endif 718 if (saturation == DoSaturate) { 719 while ((iter != Leaf->end()) && ((*iter)->getType()->getAtomicNumber() == 1)){ // skip added hydrogen 720 iter++; 721 } 722 } 722 723 } 723 724 }; -
src/Fragmentation/Fragmentation.hpp
r99b0dc r07a47e 18 18 #include "Graph/DepthFirstSearchAnalysis.hpp" 19 19 20 #include "Fragmentation/HydrogenSaturation_enum.hpp" 20 21 #include "Fragmentation/fragmentation_helpers.hpp" 21 22 … … 31 32 { 32 33 public: 33 Fragmentation(molecule *_mol );34 Fragmentation(molecule *_mol, const enum HydrogenSaturation _saturation); 34 35 ~Fragmentation(); 35 36 … … 58 59 //!> pointer to molecule that is fragmented 59 60 molecule *mol; 61 //!> whether to saturate dangling bonds with hydrogen and hence treat hydrogen special 62 const enum HydrogenSaturation saturation; 60 63 //!> list of parser types for which a configuration file per fragment is stored 61 64 std::vector<std::string> typelist; -
src/Fragmentation/PowerSetGenerator.cpp
r99b0dc r07a47e 172 172 * with SP of 2, then those with SP of 3, then those with SP of 4 and so on. 173 173 * \param RestrictedKeySet Restricted vertex set to use in context of molecule 174 * \param saturation whether to treat hydrogen special or not 174 175 * \return number of inserted fragments 175 176 * \note ShortestPathList in FragmentSearch structure is probably due to NumberOfAtomsSPLevel and SP not needed anymore 176 177 */ 177 int PowerSetGenerator::operator()(KeySet &RestrictedKeySet )178 int PowerSetGenerator::operator()(KeySet &RestrictedKeySet, const enum HydrogenSaturation saturation) 178 179 { 179 180 int Counter = FragmentSearch->FragmentCounter; // mark current value of counter … … 185 186 186 187 // do a BFS search to fill the SP lists and label the found vertices 187 BondsPerSPList.FillSPListandLabelVertices(FragmentSearch->getRoot()->GetTrueFather()->getNr(), RestrictedKeySet );188 BondsPerSPList.FillSPListandLabelVertices(FragmentSearch->getRoot()->GetTrueFather()->getNr(), RestrictedKeySet, saturation); 188 189 189 190 // outputting all list for debugging -
src/Fragmentation/PowerSetGenerator.hpp
r99b0dc r07a47e 18 18 19 19 #include "Fragmentation/BondsPerShortestPath.hpp" 20 #include "Fragmentation/HydrogenSaturation_enum.hpp" 20 21 21 22 class bond; … … 29 30 30 31 void SPFragmentGenerator(int RootDistance, std::vector<bond *> &BondsSet, int SetDimension, int SubOrder); 31 int operator()(KeySet &RestrictedKeySet );32 int operator()(KeySet &RestrictedKeySet, const enum HydrogenSaturation saturation); 32 33 void RemoveAllTouchedFromSnakeStack(int verbosity, KeySet *FragmentSet, int *&TouchedList, int &TouchedIndex); 33 34 int FillBondsList(std::vector<bond *> &BondsList, std::list<bond *>::const_iterator SetFirst, std::list<bond *>::const_iterator SetLast, int *&TouchedList, int TouchedIndex); -
src/Graph/BreadthFirstSearchAdd.cpp
r99b0dc r07a47e 32 32 33 33 34 BreadthFirstSearchAdd::BreadthFirstSearchAdd(atom *&_Root, int _BondOrder, bool _IsAngstroem ) :34 BreadthFirstSearchAdd::BreadthFirstSearchAdd(atom *&_Root, int _BondOrder, bool _IsAngstroem, const enum HydrogenSaturation _saturation) : 35 35 BondOrder(_BondOrder), 36 36 Root(_Root), 37 saturation(_saturation), 37 38 IsAngstroem(_IsAngstroem) 38 39 { … … 100 101 AddedBondList[Binder] = Mol->CopyBond(AddedAtomList[Walker->getNr()], AddedAtomList[OtherAtom->getNr()], Binder); 101 102 } else { 102 #ifdef ADDHYDROGEN 103 if (!Mol->AddHydrogenReplacementAtom(Binder, AddedAtomList[Walker->getNr()], Walker, OtherAtom, IsAngstroem)) 104 exit(1); 105 #endif 103 if (saturation == DoSaturate) 104 if (!Mol->AddHydrogenReplacementAtom(Binder, AddedAtomList[Walker->getNr()], Walker, OtherAtom, IsAngstroem)) 105 exit(1); 106 106 } 107 107 } … … 118 118 AddedBondList[Binder] = Mol->CopyBond(AddedAtomList[Walker->getNr()], AddedAtomList[OtherAtom->getNr()], Binder); 119 119 } else { // if it's root bond it has to broken (otherwise we would not create the fragments) 120 #ifdef ADDHYDROGEN 121 if(!Mol->AddHydrogenReplacementAtom(Binder, AddedAtomList[Walker->getNr()], Walker, OtherAtom, IsAngstroem)) 122 exit(1); 123 #endif 120 if (saturation == DoSaturate) 121 if(!Mol->AddHydrogenReplacementAtom(Binder, AddedAtomList[Walker->getNr()], Walker, OtherAtom, IsAngstroem)) 122 exit(1); 124 123 } 125 124 } -
src/Graph/BreadthFirstSearchAdd.hpp
r99b0dc r07a47e 18 18 19 19 #include "Bond/GraphEdge.hpp" 20 #include "Fragmentation/HydrogenSaturation_enum.hpp" 20 21 #include "Helpers/defs.hpp" 21 22 #include "types.hpp" … … 28 29 { 29 30 public: 30 BreadthFirstSearchAdd(atom *&_Root, int _BondOrder, bool _IsAngstroem );31 BreadthFirstSearchAdd(atom *&_Root, int _BondOrder, bool _IsAngstroem, const enum HydrogenSaturation _saturation); 31 32 ~BreadthFirstSearchAdd(); 32 33 … … 71 72 std::map<bond *, bond *> AddedBondList; //!< maps from father bond to son 72 73 74 //!> whether to treat hydrogen special or not 75 const enum HydrogenSaturation saturation; 76 77 //!> is angstroem our unit of length 73 78 bool IsAngstroem; 74 79 }; -
src/Graph/CyclicStructureAnalysis.cpp
r99b0dc r07a47e 31 31 #include "molecule.hpp" 32 32 33 CyclicStructureAnalysis::CyclicStructureAnalysis() 33 CyclicStructureAnalysis::CyclicStructureAnalysis(const enum HydrogenSaturation _saturation) : 34 saturation(_saturation) 34 35 {} 35 36 … … 101 102 if ((*Runner) != BackEdge) { // only walk along DFS spanning tree (otherwise we always find SP of one being backedge Binder) 102 103 OtherAtom = (*Runner)->GetOtherAtom(Walker); 103 #ifdef ADDHYDROGEN 104 if (OtherAtom->getType()->getAtomicNumber() != 1) { 105 #endif 106 LOG(2, "INFO: Current OtherAtom is: " << OtherAtom->getName() << " for bond " << *(*Runner) << "." << endl); 107 if (ColorList[OtherAtom->getNr()] == GraphEdge::white) { 108 TouchedStack.push_front(OtherAtom); 109 ColorList[OtherAtom->getNr()] = GraphEdge::lightgray; 110 PredecessorList[OtherAtom->getNr()] = Walker; // Walker is the predecessor 111 ShortestPathList[OtherAtom->getNr()] = ShortestPathList[Walker->getNr()] + 1; 112 LOG(2, "INFO: Coloring OtherAtom " << OtherAtom->getName() << " lightgray, its predecessor is " << Walker->getName() << " and its Shortest Path is " << ShortestPathList[OtherAtom->getNr()] << " egde(s) long." << endl); 113 //if (ShortestPathList[OtherAtom->getNr()] < MinimumRingSize[Walker->GetTrueFather()->getNr()]) { // Check for maximum distance 114 LOG(3, "ACCEPT: Putting OtherAtom into queue." << endl); 115 BFSStack.push_front(OtherAtom); 116 //} 104 if ((saturation == DontSaturate) || (OtherAtom->getType()->getAtomicNumber() != 1)) { 105 LOG(2, "INFO: Current OtherAtom is: " << OtherAtom->getName() << " for bond " << *(*Runner) << "." << endl); 106 if (ColorList[OtherAtom->getNr()] == GraphEdge::white) { 107 TouchedStack.push_front(OtherAtom); 108 ColorList[OtherAtom->getNr()] = GraphEdge::lightgray; 109 PredecessorList[OtherAtom->getNr()] = Walker; // Walker is the predecessor 110 ShortestPathList[OtherAtom->getNr()] = ShortestPathList[Walker->getNr()] + 1; 111 LOG(2, "INFO: Coloring OtherAtom " << OtherAtom->getName() << " lightgray, its predecessor is " << Walker->getName() << " and its Shortest Path is " << ShortestPathList[OtherAtom->getNr()] << " egde(s) long." << endl); 112 //if (ShortestPathList[OtherAtom->getNr()] < MinimumRingSize[Walker->GetTrueFather()->getNr()]) { // Check for maximum distance 113 LOG(3, "ACCEPT: Putting OtherAtom into queue." << endl); 114 BFSStack.push_front(OtherAtom); 115 //} 116 } else { 117 LOG(3, "REJECT: Not Adding, has already been visited." << endl); 118 } 119 if (OtherAtom == Root) 120 break; 117 121 } else { 118 LOG(3, "REJECT: Not Adding, has already been visited." << endl); 122 LOG(2, "INFO: Skipping hydrogen atom " << *OtherAtom << "." << endl); 123 ColorList[OtherAtom->getNr()] = GraphEdge::black; 119 124 } 120 if (OtherAtom == Root)121 break;122 #ifdef ADDHYDROGEN123 } else {124 LOG(2, "INFO: Skipping hydrogen atom " << *OtherAtom << "." << endl);125 ColorList[OtherAtom->getNr()] = GraphEdge::black;126 }127 #endif128 125 } else { 129 126 LOG(2, "REJECT: Bond " << *(*Runner) << " not Visiting, is the back edge." << endl); -
src/Graph/CyclicStructureAnalysis.hpp
r99b0dc r07a47e 18 18 19 19 #include "Bond/GraphEdge.hpp" 20 #include "Fragmentation/HydrogenSaturation_enum.hpp" 20 21 #include "Helpers/defs.hpp" 21 22 #include "types.hpp" … … 28 29 { 29 30 public: 30 CyclicStructureAnalysis();31 explicit CyclicStructureAnalysis(const enum HydrogenSaturation _saturation); 31 32 ~CyclicStructureAnalysis(); 32 33 … … 58 59 atom *Root; 59 60 61 //!> whether to treat hydrogen special or not 62 const enum HydrogenSaturation saturation; 63 60 64 bool BackStepping; 61 65 int CurrentGraphNr; -
src/MoleculeLeafClass.cpp
r99b0dc r07a47e 105 105 * \param *AtomMask defines true/false per global Atom::Nr to mask in/out each nuclear site 106 106 * \param &FragmentCounter counts through the fragments in this MoleculeLeafClass 107 * \param saturation whether to treat hydrogen special or not 107 108 * \return true - stack is non-empty, fragmentation necessary, false - stack is empty, no more sites to update 108 109 */ 109 bool MoleculeLeafClass::FillRootStackForSubgraphs(KeyStack *&RootStack, bool *AtomMask, int &FragmentCounter )110 bool MoleculeLeafClass::FillRootStackForSubgraphs(KeyStack *&RootStack, bool *AtomMask, int &FragmentCounter, const enum HydrogenSaturation saturation) 110 111 { 111 112 atom *Father = NULL; … … 118 119 Father = (*iter)->GetTrueFather(); 119 120 if (AtomMask[Father->getNr()]) // apply mask 120 #ifdef ADDHYDROGEN 121 if ((*iter)->getType()->getAtomicNumber() != 1) // skip hydrogen 122 #endif 123 RootStack[FragmentCounter].push_front((*iter)->getNr()); 121 if ((saturation == DontSaturate) || ((*iter)->getType()->getAtomicNumber() != 1)) // skip hydrogen 122 RootStack[FragmentCounter].push_front((*iter)->getNr()); 124 123 } 125 124 if (next != NULL) 126 next->FillRootStackForSubgraphs(RootStack, AtomMask, ++FragmentCounter );125 next->FillRootStackForSubgraphs(RootStack, AtomMask, ++FragmentCounter, saturation); 127 126 } else { 128 127 DoLog(1) && (Log() << Verbose(1) << "Rootstack[" << FragmentCounter << "] is NULL." << endl); -
src/MoleculeLeafClass.hpp
r99b0dc r07a47e 14 14 15 15 #include "Fragmentation/fragmentation_helpers.hpp" 16 #include "Fragmentation/HydrogenSaturation_enum.hpp" 16 17 17 18 class atom; … … 37 38 38 39 bool AddLeaf(molecule *ptr, MoleculeLeafClass *Previous); 39 bool FillRootStackForSubgraphs(KeyStack *&RootStack, bool *AtomMask, int &FragmentCounter );40 bool FillRootStackForSubgraphs(KeyStack *&RootStack, bool *AtomMask, int &FragmentCounter, const enum HydrogenSaturation saturation); 40 41 bool AssignKeySetsToFragment(molecule *reference, Graph *KeySetList, atom ***&ListOfLocalAtoms, Graph **&FragmentList, int &FragmentCounter, bool FreeList = false); 41 42 void TranslateIndicesToGlobalIDs(Graph **FragmentList, int &FragmentCounter, int &TotalNumberOfKeySets, Graph &TotalGraph); -
src/molecule.hpp
r99b0dc r07a47e 27 27 #include "CodePatterns/ObservedIterator.hpp" 28 28 #include "CodePatterns/Cacheable.hpp" 29 #include "Fragmentation/HydrogenSaturation_enum.hpp" 29 30 #include "Helpers/defs.hpp" 30 31 #include "Formula.hpp" … … 186 187 void Align(Vector *n); 187 188 void Scale(const double ** const factor); 188 void DeterminePeriodicCenter(Vector ¢er );189 void DeterminePeriodicCenter(Vector ¢er, const enum HydrogenSaturation _saturation = DoSaturate); 189 190 Vector * DetermineCenterOfGravity() const; 190 191 Vector * DetermineCenterOfAll() const; -
src/molecule_geometry.cpp
r99b0dc r07a47e 363 363 /** Determines center of molecule (yet not considering atom masses). 364 364 * \param center reference to return vector 365 */ 366 void molecule::DeterminePeriodicCenter(Vector ¢er) 365 * \param saturation whether to treat hydrogen special or not 366 */ 367 void molecule::DeterminePeriodicCenter(Vector ¢er, const enum HydrogenSaturation saturation) 367 368 { 368 369 const RealSpaceMatrix &matrix = World::getInstance().getDomain().getM(); … … 378 379 flag = true; 379 380 for (molecule::const_iterator iter = begin(); iter != end(); ++iter) { 380 #ifdef ADDHYDROGEN 381 if ((*iter)->getType()->getAtomicNumber() != 1) { 382 #endif 381 if ((saturation == DontSaturate) || ((*iter)->getType()->getAtomicNumber() != 1)) { 383 382 Testvector = inversematrix * (*iter)->getPosition(); 384 383 Translationvector.Zero(); … … 406 405 Center += Testvector; 407 406 Log() << Verbose(1) << "vector is: " << Testvector << endl; 408 #ifdef ADDHYDROGEN 409 // now also change all hydrogens 410 for (BondList::const_iterator Runner = ListOfBonds.begin(); 411 Runner != ListOfBonds.end(); 412 ++Runner) { 413 if ((*Runner)->GetOtherAtom((*iter))->getType()->getAtomicNumber() == 1) { 414 Testvector = inversematrix * (*Runner)->GetOtherAtom((*iter))->getPosition(); 415 Testvector += Translationvector; 416 Testvector *= matrix; 417 Center += Testvector; 418 Log() << Verbose(1) << "Hydrogen vector is: " << Testvector << endl; 407 if (saturation == DoSaturate) { 408 // now also change all hydrogens 409 for (BondList::const_iterator Runner = ListOfBonds.begin(); 410 Runner != ListOfBonds.end(); 411 ++Runner) { 412 if ((*Runner)->GetOtherAtom((*iter))->getType()->getAtomicNumber() == 1) { 413 Testvector = inversematrix * (*Runner)->GetOtherAtom((*iter))->getPosition(); 414 Testvector += Translationvector; 415 Testvector *= matrix; 416 Center += Testvector; 417 Log() << Verbose(1) << "Hydrogen vector is: " << Testvector << endl; 418 } 419 419 } 420 420 } 421 421 } 422 #endif423 422 } 424 423 } while (!flag); -
src/moleculelist.cpp
r99b0dc r07a47e 521 521 ofstream outputFragment; 522 522 std::string FragmentName; 523 char PathBackup[MAXSTRINGSIZE];524 523 bool result = true; 525 524 bool intermediateResult = true; 526 525 Vector BoxDimension; 527 526 char *FragmentNumber = NULL; 528 char *path = NULL;529 527 int FragmentCounter = 0; 530 528 ofstream output;
Note:
See TracChangeset
for help on using the changeset viewer.