- Timestamp:
- Oct 14, 2013, 11:42:03 PM (11 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:
- adb51ab
- Parents:
- 8dbcaf
- git-author:
- Frederik Heber <heber@…> (09/25/13 08:49:20)
- git-committer:
- Frederik Heber <heber@…> (10/14/13 23:42:03)
- Location:
- src
- Files:
-
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
src/Actions/FragmentationAction/FragmentationAction.cpp
r8dbcaf rfe0cb8 50 50 #include "Graph/AdjacencyList.hpp" 51 51 #include "Graph/BondGraph.hpp" 52 #include "Graph/CyclicStructureAnalysis.hpp" 52 53 #include "Graph/DepthFirstSearchAnalysis.hpp" 53 54 #include "Helpers/defs.hpp" … … 128 129 } 129 130 130 // we require the current bond graph131 DepthFirstSearchAnalysis DFS;132 133 131 // we parse in the keysets from last time if present 134 132 Graph StoredGraph; … … 162 160 { 163 161 Graph StoredLocalGraph(StoredGraph.getLocalGraph(mol)); 164 const int tempFlag = Fragmenter.FragmentMolecule(mols_atomids, params.order.get(), params.prefix.get(), DFS,StoredLocalGraph);162 const int tempFlag = Fragmenter.FragmentMolecule(mols_atomids, params.order.get(), params.prefix.get(), StoredLocalGraph); 165 163 if ((ExitFlag == 2) && (tempFlag != 2)) 166 164 ExitFlag = tempFlag; // if there is one molecule that needs further fragmentation, it overrides others … … 175 173 176 174 } 175 // add full cycles if desired 176 if (params.DoCyclesFull.get()) { 177 // get the BackEdgeStack from somewhere 178 DepthFirstSearchAnalysis DFS; 179 DFS(); 180 std::deque<bond::ptr> BackEdgeStack = DFS.getBackEdgeStack(); 181 // then we analyse the cycles and get them 182 CyclicStructureAnalysis CycleAnalysis(params.HowtoTreatHydrogen.get() ? ExcludeHydrogen : IncludeHydrogen); 183 CycleAnalysis(&BackEdgeStack); 184 CyclicStructureAnalysis::cycles_t cycles = CycleAnalysis.getAllCycles(); 185 LOG(0, "STATUS: Adding " << cycles.size() << " cycles."); 186 // Create graph and insert into TotalGraph 187 { 188 Graph CycleGraph; 189 for (CyclicStructureAnalysis::cycles_t::const_iterator iter = cycles.begin(); 190 iter != cycles.end(); ++iter) { 191 const CyclicStructureAnalysis::cycle_t ¤tcycle = *iter; 192 LOG(2, "INFO: Inserting cycle " << currentcycle << "."); 193 #ifndef NDEBUG 194 std::pair< Graph::iterator, bool > inserter = 195 #endif 196 CycleGraph.insert( std::make_pair(currentcycle, NumberValuePair(1,1.)) ); 197 ASSERT( inserter.second, 198 "FragmentationFragmentationAction::performCall() - keyset " 199 +toString(currentcycle)+" inserted twice into CycleGraph."); 200 } 201 TotalGraph.InsertGraph(CycleGraph, keysetcounter); 202 } 203 } 204 177 205 LOG(0, "STATUS: There are " << TotalGraph.size() << " fragments."); 178 206 -
src/Actions/FragmentationAction/FragmentationAction.def
r8dbcaf rfe0cb8 21 21 // ValueStorage by the token "Z" -> first column: int, Z, "Z" 22 22 // "undefine" if no parameters are required, use (NOPARAM_DEFAULT) for each (undefined) default value 23 #define paramtypes (std::string)(double)(unsigned int)(bool)(bool)(std::vector<std::string>)(unsigned int)(unsigned int) 24 #define paramtokens ("fragment-molecule")("distance")("order")("DoSaturate")("ExcludeHydrogen")("output-types")("grid-level")("inter-order") 25 #define paramdescriptions ("prefix of each fragment file")("distance in space up to which fragments are combined")("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")("resolution of density sampling multigrid")("up to which order distinct fragments are combined") 26 #define paramdefaults (NOPARAM_DEFAULT)(NOPARAM_DEFAULT)(NOPARAM_DEFAULT)(PARAM_DEFAULT(true))(PARAM_DEFAULT(true))(NOPARAM_DEFAULT)(PARAM_DEFAULT(5))(PARAM_DEFAULT(0)) 27 #define paramreferences (prefix)(distance)(order)(DoSaturation)(HowtoTreatHydrogen)(types)(level)(InterOrder) 23 #define paramtypes (std::string)(double)(unsigned int)(bool)(bool)(std::vector<std::string>)(unsigned int)(unsigned int)(bool) 24 #define paramtokens ("fragment-molecule")("distance")("order")("DoSaturate")("ExcludeHydrogen")("output-types")("grid-level")("inter-order")("DoCyclesFull") 25 #define paramdescriptions ("prefix of each fragment file")("distance in space up to which fragments are combined")("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")("resolution of density sampling multigrid")("up to which order distinct fragments are combined")("always calculate (aromatic) rings fully, even beyond desired order") 26 #define paramdefaults (NOPARAM_DEFAULT)(NOPARAM_DEFAULT)(NOPARAM_DEFAULT)(PARAM_DEFAULT(true))(PARAM_DEFAULT(true))(NOPARAM_DEFAULT)(PARAM_DEFAULT(5))(PARAM_DEFAULT(0))(PARAM_DEFAULT(false)) 27 #define paramreferences (prefix)(distance)(order)(DoSaturation)(HowtoTreatHydrogen)(types)(level)(InterOrder)(DoCyclesFull) 28 28 #define paramvalids \ 29 29 (DummyValidator< std::string >()) \ … … 35 35 (RangeValidator< unsigned int >(1, 10)) \ 36 36 (DummyValidator< unsigned int >()) \ 37 (DummyValidator< bool >()) 37 38 38 39 #undef statetypes -
src/Fragmentation/Fragmentation.cpp
r8dbcaf rfe0cb8 98 98 * \param Order up to how many neighbouring bonds a fragment contains in BondOrderScheme::BottumUp scheme 99 99 * \param prefix prefix string for every fragment file name (may include path) 100 * \param &DFS contains bond structure analysis data101 100 * \return 1 - continue, 2 - stop (no fragmentation occured) 102 101 */ … … 105 104 int Order, 106 105 const std::string &prefix, 107 DepthFirstSearchAnalysis &DFS,108 106 const Graph &ParsedFragmentList) 109 107 { -
src/Fragmentation/Fragmentation.hpp
r8dbcaf rfe0cb8 14 14 #endif 15 15 16 #include "Graph/DepthFirstSearchAnalysis.hpp"17 18 16 #include "Fragmentation/fragmentation_helpers.hpp" 19 17 #include "Fragmentation/Graph.hpp" 20 18 #include "Fragmentation/HydrogenSaturation_enum.hpp" 19 #include "Graph/ListOfLocalAtoms.hpp" 21 20 #include "types.hpp" 22 21 … … 47 46 ~Fragmentation(); 48 47 49 int FragmentMolecule(const std::vector<atomId_t> &atomids, int Order, const std::string &prefix, DepthFirstSearchAnalysis &DFS,const Graph &ParsedFragmentList);48 int FragmentMolecule(const std::vector<atomId_t> &atomids, int Order, const std::string &prefix, const Graph &ParsedFragmentList); 50 49 51 50 const Graph& getGraph() const { -
src/Graph/CyclicStructureAnalysis.cpp
r8dbcaf rfe0cb8 208 208 Root->GetTrueFather()->IsCyclic = true; 209 209 210 std::stringstream output; 211 output << "Found ring contains: "; 212 Walker = Root; 213 while (Walker != BackEdge->rightatom) { 214 output << Walker->getName() << " <-> "; 215 Walker = PredecessorList[Walker->getNr()]; 216 Walker->GetTrueFather()->IsCyclic = true; 217 RingSize++; 218 } 219 output << Walker->getName() << " with a length of " << RingSize << "."; 220 LOG(0, "INFO: " << output.str()); 210 { 211 CyclicStructureAnalysis::cycle_t currentcycle; 212 std::stringstream output; 213 output << "Found ring contains: "; 214 Walker = Root; 215 currentcycle.insert(Walker->GetTrueFather()->getId()); 216 while (Walker != BackEdge->rightatom) { // leftatom is root 217 output << Walker->getName() << " <-> "; 218 Walker = PredecessorList[Walker->getNr()]; 219 Walker->GetTrueFather()->IsCyclic = true; 220 #ifndef NDEBUG 221 std::pair< cycle_t::iterator, bool > inserter = 222 #endif 223 currentcycle.insert(Walker->GetTrueFather()->getId()); 224 ASSERT( inserter.second, 225 "CyclicStructureAnalysis::RetrieveCycleMembers() - we already inserted " 226 +toString(Walker->GetTrueFather()->getId())+" into currentcycle."); 227 RingSize++; 228 } 229 output << Walker->getName() << " with a length of " << RingSize << "."; 230 LOG(0, "INFO: " << output.str()); 231 allcycles.push_back(currentcycle); 232 } 221 233 222 234 // walk through all and set MinimumRingSize … … 365 377 int MinRingSize = -1; 366 378 379 // clear cycle container 380 allcycles.clear(); 381 367 382 { 368 383 std::stringstream output; -
src/Graph/CyclicStructureAnalysis.hpp
r8dbcaf rfe0cb8 16 16 #include <deque> 17 17 #include <map> 18 #include <vector> 18 19 19 20 #include "Bond/bond.hpp" 20 21 #include "Bond/GraphEdge.hpp" 22 #include "Fragmentation/KeySet.hpp" 21 23 #include "Fragmentation/HydrogenSaturation_enum.hpp" 22 24 #include "Helpers/defs.hpp" … … 29 31 { 30 32 public: 33 //!> typedef for specifying a cycle 34 typedef KeySet cycle_t; 35 //!> typedef for specifying many cycles 36 typedef std::vector< cycle_t > cycles_t; 37 31 38 explicit CyclicStructureAnalysis(const enum HydrogenTreatment _treatment); 32 39 ~CyclicStructureAnalysis(); … … 37 44 const std::map<atomId_t, int >& getMinimumRingSize() const; 38 45 46 /** Getter for all found cycles. 47 * 48 */ 49 cycles_t getAllCycles() const { 50 return allcycles; 51 } 52 39 53 private: 54 40 55 // init or reset 41 56 void InitNode(atomId_t atom_id); … … 59 74 atom *Root; 60 75 76 //!> container for all found cycles, note that these are global ids 77 cycles_t allcycles; 78 61 79 //!> whether to treat hydrogen special or not 62 80 const enum HydrogenTreatment treatment;
Note:
See TracChangeset
for help on using the changeset viewer.