Changeset 56c55f3
- 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)
- Files:
-
- 5 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 -
src/Actions/FragmentationAction/FragmentationAction.def
r6e5ca9 r56c55f3 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)(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 (PARAM_DEFAULT("BondFragment"))(PARAM_DEFAULT(3.))(PARAM_DEFAULT(3))(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) 23 #define paramtypes (std::string)(double)(int)(bool)(bool)(std::vector<std::string>)(unsigned int)(unsigned int)(bool)(bool) 24 #define paramtokens ("fragment-molecule")("distance")("order")("DoSaturate")("ExcludeHydrogen")("output-types")("grid-level")("inter-order")("DoCyclesFull")("parse-state-files") 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")("whether to parse keysets, orderatsite, adjacency from state files") 26 #define paramdefaults (PARAM_DEFAULT("BondFragment"))(PARAM_DEFAULT(3.))(PARAM_DEFAULT(3))(PARAM_DEFAULT(true))(PARAM_DEFAULT(true))(NOPARAM_DEFAULT)(PARAM_DEFAULT(5))(PARAM_DEFAULT(0))(PARAM_DEFAULT(false))(PARAM_DEFAULT(false)) 27 #define paramreferences (prefix)(distance)(order)(DoSaturation)(HowtoTreatHydrogen)(types)(level)(InterOrder)(DoCyclesFull)(ParseStateFiles) 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 (DummyValidator< bool >()) 38 39 -
src/Fragmentation/Fragmentation.cpp
r6e5ca9 r56c55f3 118 118 int Order, 119 119 const std::string &prefix, 120 const Graph &ParsedFragmentList) 120 const Graph &ParsedFragmentList, 121 const bool _ParseStateFile) 121 122 { 122 123 std::fstream File; … … 178 179 179 180 // ===== 4. check globally whether there's something to do actually (first adaptivity check) 180 FragmentationToDo = FragmentationToDo && ParseOrderAtSiteFromFile(atomids, prefix, Global_local_bimap); 181 if (_ParseStateFile) 182 FragmentationToDo = FragmentationToDo && ParseOrderAtSiteFromFile(atomids, prefix, Global_local_bimap); 181 183 182 184 // =================================== Begin of FRAGMENTATION =============================== -
src/Fragmentation/Fragmentation.hpp
r6e5ca9 r56c55f3 46 46 ~Fragmentation(); 47 47 48 int FragmentMolecule(const std::vector<atomId_t> &atomids, int Order, const std::string &prefix, const Graph &ParsedFragmentList );48 int FragmentMolecule(const std::vector<atomId_t> &atomids, int Order, const std::string &prefix, const Graph &ParsedFragmentList, const bool _ParseStateFile); 49 49 50 50 const Graph& getGraph() const { -
tests/Python/AllActions/options.dat
r6e5ca9 r56c55f3 132 132 parse-particle-parameters "water.particles" 133 133 parse-potentials "water.potentials" 134 parse-state-files "1" 134 135 parse-tremolo-potentials "argon.potentials" 135 136 parse-tremolo-potentials "tensid.potentials"
Note:
See TracChangeset
for help on using the changeset viewer.