Changeset 9291d04
- 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)
- Files:
-
- 17 edited
Legend:
- Unmodified
- Added
- Removed
-
src/Actions/FragmentationAction/FragmentationAction.cpp
rc7c615 r9291d04 100 100 } 101 101 102 // get whether to saturate or not103 const enum HydrogenSaturation saturation = params.DoSaturation.get() ? DoSaturate : DontSaturate;104 105 102 // parse in Adjacency file 106 103 boost::shared_ptr<AdjacencyList> FileChecker; … … 143 140 LOG(2, "INFO: Fragmenting in molecule " << mol->getName() << " in " << clusters.count(mol) 144 141 << " atoms, out of " << mol->getAtomCount() << "."); 145 Fragmentation Fragmenter(mol, *FileChecker, saturation); 142 const enum HydrogenTreatment treatment = params.HowtoTreatHydrogen.get() ? ExcludeHydrogen : IncludeHydrogen; 143 Fragmentation Fragmenter(mol, *FileChecker, treatment); 146 144 147 145 // perform fragmentation … … 167 165 // store molecule's fragment to file 168 166 { 167 const enum HydrogenSaturation saturation = params.DoSaturation.get() ? DoSaturate : DontSaturate; 169 168 ExportGraph_ToFiles exporter(TotalGraph, saturation); 170 169 exporter.setPrefix(params.prefix.get()); -
src/Actions/FragmentationAction/FragmentationAction.def
rc7c615 r9291d04 20 20 // ValueStorage by the token "Z" -> first column: int, Z, "Z" 21 21 // "undefine" if no parameters are required, use (NOPARAM_DEFAULT) for each (undefined) default value 22 #define paramtypes (std::string)(double)(unsigned int)(bool)( std::vector<std::string>)23 #define paramtokens ("fragment-molecule")("distance")("order")("DoSaturate")(" output-types")24 #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")25 #define paramdefaults (NOPARAM_DEFAULT)(NOPARAM_DEFAULT)(NOPARAM_DEFAULT)(PARAM_DEFAULT(true)) 26 #define paramreferences (prefix)(distance)(order)(DoSaturation)( types)22 #define paramtypes (std::string)(double)(unsigned int)(bool)(bool)(std::vector<std::string>) 23 #define paramtokens ("fragment-molecule")("distance")("order")("DoSaturate")("ExcludeHydrogen")("output-types") 24 #define paramdescriptions ("prefix of each fragment file")("distance in space")("order of a discretization, dissection, ...")("do saturate dangling bonds with hydrogen")("whether to exclude hydrogen in the bond graph dissection or not")("type(s) of parsers that output fragment config files") 25 #define paramdefaults (NOPARAM_DEFAULT)(NOPARAM_DEFAULT)(NOPARAM_DEFAULT)(PARAM_DEFAULT(true))(PARAM_DEFAULT(true))(PARAM_DEFAULT(std::vector<std::string>(1, std::string("pcp")))) 26 #define paramreferences (prefix)(distance)(order)(DoSaturation)(HowtoTreatHydrogen)(types) 27 27 #define paramvalids \ 28 28 (DummyValidator< std::string >()) \ 29 29 (BoxLengthValidator()) \ 30 30 (DummyValidator< unsigned int >()) \ 31 (DummyValidator< bool >()) \ 31 32 (DummyValidator< bool >()) \ 32 33 (STLVectorValidator< std::vector<std::string> >(1, 10, ParserTypeValidator())) -
src/Actions/FragmentationAction/FragmentationAutomationAction.cpp
rc7c615 r9291d04 65 65 #include "Fragmentation/ForceMatrix.hpp" 66 66 #include "Fragmentation/Fragmentation.hpp" 67 #include "Fragmentation/HydrogenSaturation_enum.hpp"68 67 #include "Fragmentation/Homology/HomologyContainer.hpp" 69 68 #include "Fragmentation/Homology/HomologyGraph.hpp" -
src/Actions/GraphAction/DepthFirstSearchAction.cpp
rc7c615 r9291d04 71 71 LocalBackEdgeStack = new std::deque<bond::ptr >; // no need to have it Subgraphs->Leaf->BondCount size 72 72 DFS.PickLocalBackEdges(ListOfAtoms, LocalBackEdgeStack); 73 CyclicStructureAnalysis CycleAnalysis(params. DoSaturation.get() ? DoSaturate : DontSaturate);73 CyclicStructureAnalysis CycleAnalysis(params.HowtoTreatHydrogen.get() ? ExcludeHydrogen : IncludeHydrogen); 74 74 CycleAnalysis(LocalBackEdgeStack); 75 75 delete(LocalBackEdgeStack); -
src/Actions/GraphAction/DepthFirstSearchAction.def
rc7c615 r9291d04 15 15 // "undefine" if no parameters are required, use (NOPARAM_DEFAULT) for each (undefined) default value 16 16 #define paramtypes (bool) 17 #define paramtokens (" DoSaturate")17 #define paramtokens ("ExcludeHydrogen") 18 18 #define paramdescriptions ("whether to treat hydrogen special or not") 19 19 #define paramdefaults (PARAM_DEFAULT(true)) 20 #define paramreferences ( DoSaturation)20 #define paramreferences (HowtoTreatHydrogen) 21 21 #define paramvalids \ 22 22 (DummyValidator< bool >()) -
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); -
src/Graph/CyclicStructureAnalysis.cpp
rc7c615 r9291d04 46 46 #include "molecule.hpp" 47 47 48 CyclicStructureAnalysis::CyclicStructureAnalysis(const enum Hydrogen Saturation _saturation) :49 saturation(_saturation)48 CyclicStructureAnalysis::CyclicStructureAnalysis(const enum HydrogenTreatment _treatment) : 49 treatment(_treatment) 50 50 {} 51 51 … … 117 117 if ((*Runner) != BackEdge) { // only walk along DFS spanning tree (otherwise we always find SP of one being backedge Binder) 118 118 OtherAtom = (*Runner)->GetOtherAtom(Walker); 119 if (( saturation == DontSaturate) || (OtherAtom->getType()->getAtomicNumber() != 1)) {119 if ((treatment == IncludeHydrogen) || (OtherAtom->getType()->getAtomicNumber() != 1)) { 120 120 LOG(2, "INFO: Current OtherAtom is: " << OtherAtom->getName() << " for bond " << *(*Runner) << "." << endl); 121 121 if (ColorList[OtherAtom->getNr()] == GraphEdge::white) { -
src/Graph/CyclicStructureAnalysis.hpp
rc7c615 r9291d04 29 29 { 30 30 public: 31 explicit CyclicStructureAnalysis(const enum Hydrogen Saturation _saturation);31 explicit CyclicStructureAnalysis(const enum HydrogenTreatment _treatment); 32 32 ~CyclicStructureAnalysis(); 33 33 … … 60 60 61 61 //!> whether to treat hydrogen special or not 62 const enum Hydrogen Saturation saturation;62 const enum HydrogenTreatment treatment; 63 63 64 64 bool BackStepping; -
src/molecule.hpp
rc7c615 r9291d04 268 268 void Align(Vector *n); 269 269 void Scale(const double ** const factor); 270 void DeterminePeriodicCenter(Vector ¢er, const enum Hydrogen Saturation _saturation = DoSaturate);270 void DeterminePeriodicCenter(Vector ¢er, const enum HydrogenTreatment _treatment = ExcludeHydrogen); 271 271 Vector * DetermineCenterOfGravity() const; 272 272 Vector * DetermineCenterOfAll() const; -
src/molecule_geometry.cpp
rc7c615 r9291d04 371 371 /** Determines center of molecule (yet not considering atom masses). 372 372 * \param center reference to return vector 373 * \param saturationwhether to treat hydrogen special or not374 */ 375 void molecule::DeterminePeriodicCenter(Vector ¢er, const enum Hydrogen Saturation saturation)373 * \param treatment whether to treat hydrogen special or not 374 */ 375 void molecule::DeterminePeriodicCenter(Vector ¢er, const enum HydrogenTreatment treatment) 376 376 { 377 377 const RealSpaceMatrix &matrix = World::getInstance().getDomain().getM(); … … 387 387 flag = true; 388 388 for (const_iterator iter = begin(); iter != end(); ++iter) { 389 if (( saturation == DontSaturate) || ((*iter)->getType()->getAtomicNumber() != 1)) {389 if ((treatment == IncludeHydrogen) || ((*iter)->getType()->getAtomicNumber() != 1)) { 390 390 Testvector = inversematrix * (*iter)->getPosition(); 391 391 Translationvector.Zero(); … … 413 413 Center += Testvector; 414 414 LOG(1, "vector is: " << Testvector); 415 if ( saturation == DoSaturate) {415 if (treatment == ExcludeHydrogen) { 416 416 // now also change all hydrogens 417 417 for (BondList::const_iterator Runner = ListOfBonds.begin(); -
tests/Python/AllActions/options.dat
rc7c615 r9291d04 66 66 elements "1 8" 67 67 end-step "1" 68 ExcludeHydrogen "1" 68 69 fastparsing "1" 69 70 filename "test.exttypes"
Note:
See TracChangeset
for help on using the changeset viewer.