- Timestamp:
- Nov 16, 2012, 2:03:40 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:
- a67a04
- Parents:
- fb69e9
- git-author:
- Frederik Heber <heber@…> (11/16/12 14:01:22)
- git-committer:
- Frederik Heber <heber@…> (11/16/12 14:03:40)
- Location:
- src
- Files:
-
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
src/Actions/FragmentationAction/FragmentationAutomationAction.cpp
rfb69e9 r8b58ac 38 38 39 39 #include "CodePatterns/MemDebug.hpp" 40 41 #include <boost/assign.hpp>42 40 43 41 #include "CodePatterns/Assert.hpp" … … 60 58 #include "Fragmentation/Summation/printSum.hpp" 61 59 #include "Graph/DepthFirstSearchAnalysis.hpp" 60 #include "Helpers/defs.hpp" 62 61 #include "Jobs/MPQCJob.hpp" 63 62 #include "Jobs/MPQCData.hpp" … … 79 78 80 79 using namespace MoleCuilder; 81 82 using namespace boost::assign;83 80 84 81 // and construct the stuff … … 282 279 // initialise indices 283 280 KeySetsContainer KeySet; 281 KeySetsContainer ForceKeySet; 284 282 if (!Energy.InitialiseIndices()) return false; 285 283 286 284 if (!Force.ParseIndices(KeySetFilename.c_str())) return false; 287 285 288 if (!KeySet.ParseKeySets(KeySetFilename.c_str(), Force.RowCounter, Force.MatrixCounter)) return false; 289 290 /// prepare for OrthogonalSummation 286 { 287 std::stringstream filename; 288 filename << FRAGMENTPREFIX << KEYSETFILE; 289 if (!KeySet.ParseKeySets(KeySetFilename, filename.str(), FragmentCounter)) return false; 290 } 291 292 { 293 std::stringstream filename; 294 filename << FRAGMENTPREFIX << FORCESFILE; 295 if (!ForceKeySet.ParseKeySets(KeySetFilename, filename.str(), FragmentCounter)) return false; 296 } 291 297 292 298 // forces need different keysets: they must include hydrogen -
src/Fragmentation/KeySetsContainer.cpp
rfb69e9 r8b58ac 37 37 #include <fstream> 38 38 #include <sstream> 39 40 #include <boost/lexical_cast.hpp> 41 #include <boost/tokenizer.hpp> 39 42 40 43 #include "CodePatterns/Log.hpp" … … 72 75 * \return parsing succesful 73 76 */ 74 bool KeySetsContainer::ParseKeySets(const std::string name, const IntVector ACounter, const int FCounter) {77 bool KeySetsContainer::ParseKeySets(const std::string path, const std::string name, const int FCounter) { 75 78 ifstream input; 76 char *FragmentNumber = NULL;79 //char *FragmentNumber = NULL; 77 80 stringstream file; 78 81 char filename[1023]; 79 82 80 83 FragmentCounter = FCounter; 81 LOG(0, "Parsing key sets.");82 84 KeySets.resize(FragmentCounter); 83 file << name << FRAGMENTPREFIX << KEYSETFILE; 85 AtomCounter.resize(FragmentCounter); 86 87 // open file 88 file << path << "/" << name; 84 89 input.open(file.str().c_str(), ios::in); 85 90 if (input.fail()) { … … 88 93 } 89 94 90 AtomCounter.resize(FragmentCounter); 95 // parse each line, i.e. get the index set per fragment 96 LOG(0, "Parsing key sets."); 91 97 for(int i=0;(i<FragmentCounter) && (!input.eof());i++) { 92 stringstream line;93 AtomCounter[i] = ACounter[i];94 // parse the values95 KeySets[i].resize(AtomCounter[i]);96 for(int j=AtomCounter[i];j--;)97 KeySets[i][j] = -1;98 FragmentNumber = FixedDigitNumber(FragmentCounter, i);99 //std::stringstream output;100 //output << FRAGMENTPREFIX << FragmentNumber << "[" << AtomCounter[i] << "]:";101 delete[](FragmentNumber);102 98 input.getline(filename, 1023); 103 line.str(filename); 104 for(int j=0;(j<AtomCounter[i]) && (!line.eof());j++) { 105 line >> KeySets[i][j]; 106 //output << " " << KeySets[i][j]; 99 string line(filename); 100 // LOG(2, "DEBUG: line is " << line << "."); 101 std::stringstream set_output; 102 typedef boost::tokenizer<boost::char_separator<char> > tokenizer; 103 boost::char_separator<char> sep(" \t"); 104 tokenizer tok(line, sep); 105 for(tokenizer::iterator beg=tok.begin(); 106 beg != tok.end();++beg){ 107 const int tempvalue = boost::lexical_cast<int>(*beg); 108 KeySets[i].push_back(tempvalue); 109 // set_output << " " << KeySets[i].back(); 107 110 } 108 //LOG(0, output.str()); 111 // LOG(2, "DEBUG: Scanned keys are '" << set_output.str() << "'."); 112 AtomCounter[i] = KeySets[i].size(); 113 // { 114 // std::stringstream output; 115 // FragmentNumber = FixedDigitNumber(FragmentCounter, i); 116 // output << FRAGMENTPREFIX << FragmentNumber << "[" << AtomCounter[i] << "]:" << set_output.str(); 117 // delete[](FragmentNumber); 118 // LOG(0, output.str()); 119 // } 109 120 } 110 121 input.close(); -
src/Fragmentation/KeySetsContainer.hpp
rfb69e9 r8b58ac 35 35 ~KeySetsContainer(); 36 36 37 bool ParseKeySets(const std::string name, const std::vector<int> ACounter, const int FCounter);37 bool ParseKeySets(const std::string path, const std::string name, const int FCounter); 38 38 bool ParseManyBodyTerms(); 39 39 bool Contains(const int GreaterSet, const int SmallerSet); -
src/Fragmentation/analyzer.cpp
rfb69e9 r8b58ac 182 182 183 183 // ---------- Parse the KeySets into an array --------------- 184 if (!KeySet.ParseKeySets(argv[1], Force.RowCounter, Force.MatrixCounter)) return 1; 184 { 185 std::stringstream filename; 186 filename << FRAGMENTPREFIX << KEYSETFILE; 187 if (!KeySet.ParseKeySets(argv[1], filename.str(), Force.MatrixCounter)) return 1; 188 } 185 189 if (!KeySet.ParseManyBodyTerms()) return 1; 186 190 -
src/Fragmentation/joiner.cpp
rfb69e9 r8b58ac 147 147 148 148 // ---------- Parse the KeySets into an array --------------- 149 if (!KeySet.ParseKeySets(argv[1], Force.RowCounter, Force.MatrixCounter)) return 1; 149 { 150 std::stringstream filename; 151 filename << FRAGMENTPREFIX << KEYSETFILE; 152 if (!KeySet.ParseKeySets(argv[1], filename.str(), Force.MatrixCounter)) return 1; 153 } 150 154 151 155 if (!KeySet.ParseManyBodyTerms()) return 1; -
src/controller_MPQCCommandJob.cpp
rfb69e9 r8b58ac 217 217 if (!Force.ParseIndices(KeySetFilename.c_str())) return false; 218 218 219 if (!KeySet.ParseKeySets(KeySetFilename.c_str(), Force.RowCounter, Force.MatrixCounter)) return false; 219 { 220 std::stringstream filename; 221 filename << FRAGMENTPREFIX << KEYSETFILE; 222 if (!KeySet.ParseKeySets(KeySetFilename.c_str(), filename.str(), Force.MatrixCounter)) return 1; 223 } 220 224 221 225 if (!KeySet.ParseManyBodyTerms()) return false;
Note:
See TracChangeset
for help on using the changeset viewer.