Changeset c738f1 for src/Fragmentation
- Timestamp:
- Nov 11, 2016, 2:25:35 PM (8 years ago)
- Branches:
- Action_Thermostats, Add_AtomRandomPerturbation, Add_RotateAroundBondAction, Add_SelectAtomByNameAction, Adding_Graph_to_ChangeBondActions, Adding_MD_integration_tests, Adding_StructOpt_integration_tests, Automaking_mpqc_open, AutomationFragmentation_failures, Candidate_v1.6.0, Candidate_v1.6.1, ChangeBugEmailaddress, ChangingTestPorts, ChemicalSpaceEvaluator, 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_ChronosMutex, Fix_StatusMsg, Fix_StepWorldTime_single_argument, Fix_Verbose_Codepatterns, ForceAnnealing_goodresults, ForceAnnealing_oldresults, ForceAnnealing_tocheck, ForceAnnealing_with_BondGraph, ForceAnnealing_with_BondGraph_continued, ForceAnnealing_with_BondGraph_continued_betteresults, ForceAnnealing_with_BondGraph_contraction-expansion, GeometryObjects, Gui_displays_atomic_force_velocity, IndependentFragmentGrids_IntegrationTest, JobMarket_RobustOnKillsSegFaults, JobMarket_StableWorkerPool, JobMarket_unresolvable_hostname_fix, ODR_violation_mpqc_open, PartialCharges_OrthogonalSummation, PythonUI_with_named_parameters, QtGui_reactivate_TimeChanged_changes, Recreated_GuiChecks, RotateToPrincipalAxisSystem_UndoRedo, StoppableMakroAction, Subpackage_CodePatterns, Subpackage_JobMarket, Subpackage_LinearAlgebra, Subpackage_levmar, Subpackage_mpqc_open, Subpackage_vmg, ThirdParty_MPQC_rebuilt_buildsystem, TremoloParser_IncreasedPrecision, TremoloParser_MultipleTimesteps, Ubuntu_1604_changes, stable
- Children:
- 884d8c
- Parents:
- 2124aa
- git-author:
- Frederik Heber <heber@…> (10/04/16 20:01:24)
- git-committer:
- Frederik Heber <heber@…> (11/11/16 14:25:35)
- Location:
- src/Fragmentation/Exporters
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
src/Fragmentation/Exporters/SaturatedFragment.cpp
r2124aa rc738f1 294 294 LOG(4, "DEBUG: Places to saturate for atom " << *OtherWalker 295 295 << " are " << positionsiter->second); 296 atom * const father = Walker;296 atom * const father = OtherWalker; 297 297 for (SaturationsPositions_t::const_iterator positer = positionsiter->second.begin(); 298 298 positer != positionsiter->second.end(); ++positer) { … … 320 320 _atom->setFather(_father); 321 321 SaturationHydrogens.insert(_atom->getId()); 322 // note down the id of the replaced atom 323 replaced_atoms.insert( std::make_pair(_father->getId(), _atom->getId()) ); 322 324 323 325 return *_atom; … … 670 672 static FragmentationEdges::edges_t createEdgesFromAtoms( 671 673 const std::vector<atom *> &_atoms, 674 const SaturatedFragment::replaced_atoms_t &replaced_atoms, 672 675 const KeySet &_FullMolecule) 673 676 { … … 682 685 const atom * const OtherWalker = (*bonditer)->GetOtherAtom(walker); 683 686 const atomId_t &otherwalkerid = OtherWalker->getId(); 684 if (walkerid < otherwalkerid) { 685 // check if it's in fullkeysets (also contains excluded and saturation hydrogens) 686 if (_FullMolecule.count(otherwalkerid)) 687 edges.push_back( FragmentationEdges::edge_t(walkerid, otherwalkerid) ); 687 if (_FullMolecule.count(otherwalkerid)) { 688 if (walkerid < otherwalkerid) { 689 // check if it's in fullkeysets (also contains excluded and saturation hydrogens) 690 if (_FullMolecule.count(otherwalkerid)) 691 edges.push_back( FragmentationEdges::edge_t(walkerid, otherwalkerid) ); 692 } 693 } else { 694 ASSERT( replaced_atoms.count(otherwalkerid), 695 "createEdgesFromAtoms() - atom #"+toString(otherwalkerid) 696 +" to a cut bond is not in replaced_atoms."); 697 // add bond to every saturation hydrogen instead 698 const std::pair< 699 SaturatedFragment::replaced_atoms_t::const_iterator, 700 SaturatedFragment::replaced_atoms_t::const_iterator> range = replaced_atoms.equal_range(otherwalkerid); 701 for (SaturatedFragment::replaced_atoms_t::const_iterator replaceiter = range.first; 702 replaceiter != range.second; ++replaceiter) { 703 edges.push_back( FragmentationEdges::edge_t(walkerid, replaceiter->second) ); 704 } 688 705 } 689 706 } … … 739 756 // gather all edges 740 757 const std::vector<atom *> atoms = gatherAllAtoms(FullMolecule); 741 FragmentationEdges::edges_t edges = createEdgesFromAtoms(atoms, FullMolecule);758 FragmentationEdges::edges_t edges = createEdgesFromAtoms(atoms, replaced_atoms, FullMolecule); 742 759 743 760 // translate each edge 744 std::map<atomId_t, atomId_t> idtable = createIdTable(atoms);761 const std::map<atomId_t, atomId_t> idtable = createIdTable(atoms); 745 762 746 763 // rewrite indices of edges in correct order -
src/Fragmentation/Exporters/SaturatedFragment.hpp
r2124aa rc738f1 15 15 16 16 #include <iosfwd> 17 #include <map> 17 18 #include <set> 18 19 #include <string> … … 122 123 std::ostream &out, 123 124 const ParserTypes _type) const; 125 126 //!> typedef for the replaced atom (due to cut bonds) and their replacement hydrogens 127 typedef std::multimap<atomId_t, atomId_t> replaced_atoms_t; 124 128 125 129 private: … … 220 224 //!> whether to actually saturate or not 221 225 const enum HydrogenSaturation saturation; 226 //!> list of saturated hydrogens to their original atoms 227 replaced_atoms_t replaced_atoms; 222 228 }; 223 229
Note:
See TracChangeset
for help on using the changeset viewer.