- Timestamp:
- Aug 31, 2016, 10:54:47 AM (9 years ago)
- Branches:
- FragmentMolecule_checks_bonddegrees, Gui_Fixes
- Children:
- e3d0fe
- Parents:
- 6e5ca9
- git-author:
- Frederik Heber <heber@…> (08/31/16 10:45:35)
- git-committer:
- Frederik Heber <heber@…> (08/31/16 10:54:47)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
src/Actions/FragmentationAction/FragmentationAction.cpp
r6e5ca9 r56c55f3 41 41 #include "Descriptors/AtomSelectionDescriptor.hpp" 42 42 #include "Descriptors/MoleculeIdDescriptor.hpp" 43 #include "Fragmentation/AdaptivityMap.hpp" 43 44 #include "Fragmentation/Exporters/ExportGraph_ToAtomFragments.hpp" 44 45 #include "Fragmentation/Exporters/ExportGraph_ToFiles.hpp" … … 117 118 boost::shared_ptr<AdjacencyList> FileChecker; 118 119 boost::filesystem::path filename(params.prefix.get() + std::string(ADJACENCYFILE)); 119 if (boost::filesystem::exists(filename) && boost::filesystem::is_regular_file(filename)) { 120 if ((params.ParseStateFiles.get()) 121 && boost::filesystem::exists(filename) 122 && boost::filesystem::is_regular_file(filename)) { 120 123 std::ifstream File; 121 124 File.open(filename.string().c_str(), ios::out); … … 144 147 // we parse in the keysets from last time if present 145 148 Graph StoredGraph; 146 StoredGraph.ParseKeySetFile(params.prefix.get()); 149 if (params.ParseStateFiles.get()) { 150 StoredGraph.ParseKeySetFile(params.prefix.get()); 151 // check parsed graph against the set of atoms 152 { 153 AdaptivityMap *amap = StoredGraph.GraphToAdaptivityMap(); 154 bool status = true; 155 for (World::AtomSelectionConstIterator iter = world.beginAtomSelection(); 156 iter != world.endAtomSelection(); ++iter) { 157 const atomId_t atomid = iter->second->getId(); 158 // skip hydrogens in check if saturation is turned on 159 if ((iter->second->getType()->getAtomicNumber() != 1) 160 || (!params.DoSaturation.get())) { 161 if (amap->count(atomid) == 0) { 162 ELOG(1, "Atom #" << atomid << " not contained in KeySet file. "); 163 status = false; 164 break; 165 } 166 } else if (amap->count(atomid) != 0) { 167 ELOG(1, "Atom #" << atomid << " in KeySet file is a hydrogen, but is now excluded. "); 168 status = false; 169 break; 170 } 171 } 172 delete amap; 173 174 if (!status) { 175 ELOG(1, "KeySetsFile seems to contain leftover from an old fragmentation, hence not using file."); 176 StoredGraph.clear(); 177 } 178 } 179 } 147 180 148 181 start = clock(); … … 174 207 { 175 208 Graph StoredLocalGraph(StoredGraph.getLocalGraph(mol)); 176 const int tempFlag = Fragmenter.FragmentMolecule(mols_atomids, params.order.get(), params.prefix.get(), StoredLocalGraph );209 const int tempFlag = Fragmenter.FragmentMolecule(mols_atomids, params.order.get(), params.prefix.get(), StoredLocalGraph, params.ParseStateFiles.get()); 177 210 if ((ExitFlag == 2) && (tempFlag != 2)) 178 211 ExitFlag = tempFlag; // if there is one molecule that needs further fragmentation, it overrides others
Note:
See TracChangeset
for help on using the changeset viewer.