Changeset d7bb9b1 for src/Fragmentation/Automation
- Timestamp:
- Jul 2, 2012, 7:54:12 AM (13 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:
- a2d653
- Parents:
- 3add4f
- git-author:
- Frederik Heber <heber@…> (05/18/12 07:21:43)
- git-committer:
- Frederik Heber <heber@…> (07/02/12 07:54:12)
- Location:
- src/Fragmentation/Automation
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
src/Fragmentation/Automation/Makefile.am
r3add4f rd7bb9b1 2 2 # Also indentation by a single tab 3 3 4 INCLUDES = -I$(top_srcdir)/LinearAlgebra/src 4 INCLUDES = -I$(top_srcdir)/LinearAlgebra/src -I$(top_srcdir)/src 5 5 6 6 MOSTLYCLEANFILES = … … 139 139 libMolecuilderFragmentationOperations.la \ 140 140 libMolecuilderFragmentJobs.la \ 141 $(top_builddir)/src/libMolecuilderFragmentation.la \ 142 $(top_builddir)/src/libMolecuilderHelpers.la \ 141 143 $(BOOST_ASIO_LIBS) \ 142 144 $(BOOST_SERIALIZATION_LIBS) \ -
src/Fragmentation/Automation/controller.cpp
r3add4f rd7bb9b1 39 39 #include "CodePatterns/Info.hpp" 40 40 #include "CodePatterns/Log.hpp" 41 #include "Fragmentation/EnergyMatrix.hpp" 42 #include "Fragmentation/ForceMatrix.hpp" 43 #include "Fragmentation/KeySetsContainer.hpp" 41 44 #include "FragmentController.hpp" 42 45 #include "Jobs/MPQCCommandJob.hpp" 46 #include "Jobs/MPQCCommandJob_MPQCData.hpp" 43 47 #include "Jobs/SystemCommandJob.hpp" 44 48 #include "Results/FragmentResult.hpp" … … 107 111 } 108 112 109 /** Print received results.113 /** Print MPQCData from received results. 110 114 * 111 115 * @param results vector of all received FragmentResult's 112 116 * @param KeySetFilename filename containing keysets 113 117 */ 114 void printreceivedmpqcresults(std::vector<FragmentResult::ptr> &results, const std::string &KeySetFilename) 115 { 116 // parse in KeySetfile 117 // const size_t MAXBUFFER = 256; 118 std::ifstream inputfile; 119 inputfile.open(KeySetFilename.c_str()); 120 // while (inputfile.getline(buffer, MAXBUFFER)) { 121 // 122 // } 123 inputfile.close(); 124 118 bool printReceivedMPQCResults( 119 std::vector<FragmentResult::ptr> &results, 120 const std::string &KeySetFilename) 121 { 122 EnergyMatrix Energy; 123 EnergyMatrix EnergyFragments; 124 ForceMatrix Force; 125 ForceMatrix ForceFragments; 126 KeySetsContainer KeySet; 127 128 // place results into EnergyMatrix and ForceMatrix 129 //if (!Energy.ParseFragmentMatrix(argv[1], dir, EnergySuffix, 0,0)) return false; 130 //if (!Force.ParseFragmentMatrix(argv[1], dir, ForcesSuffix, 0,0)) return false; 125 131 // combine all found data 126 132 std::vector<MPQCData> fragmentData(results.size()); … … 137 143 LOG(1, "INFO: extracted data is " << extractedData << "."); 138 144 } 139 } 145 146 if (!Energy.InitialiseIndices()) return false; 147 148 if (!Force.ParseIndices(KeySetFilename.c_str())) return false; 149 150 if (!KeySet.ParseKeySets(KeySetFilename.c_str(), Force.RowCounter, Force.MatrixCounter)) return false; 151 152 if (!KeySet.ParseManyBodyTerms()) return false; 153 154 if (!EnergyFragments.AllocateMatrix(Energy.Header, Energy.MatrixCounter, Energy.RowCounter, Energy.ColumnCounter)) return false; 155 if (!ForceFragments.AllocateMatrix(Force.Header, Force.MatrixCounter, Force.RowCounter, Force.ColumnCounter)) return false; 156 157 if(!Energy.SetLastMatrix(0., 0)) return false; 158 if(!Force.SetLastMatrix(0., 2)) return false; 159 160 for (int BondOrder=0;BondOrder<KeySet.Order;BondOrder++) { 161 // --------- sum up energy -------------------- 162 LOG(1, "INFO: Summing energy of order " << BondOrder+1 << " ..."); 163 if (!EnergyFragments.SumSubManyBodyTerms(Energy, KeySet, BondOrder)) return false; 164 if (!Energy.SumSubEnergy(EnergyFragments, NULL, KeySet, BondOrder, 1.)) return false; 165 166 // --------- sum up Forces -------------------- 167 LOG(1, "INFO: Summing forces of order " << BondOrder+1 << " ..."); 168 if (!ForceFragments.SumSubManyBodyTerms(Force, KeySet, BondOrder)) return false; 169 if (!Force.SumSubForces(ForceFragments, KeySet, BondOrder, 1.)) return false; 170 } 171 172 return true; 173 } 174 140 175 141 176 /** Returns a unique index for every command to allow switching over it. … … 183 218 std::cerr << "\t" << iter->first << std::endl; 184 219 } 185 return 1;220 return false; 186 221 } 187 222 … … 325 360 LOG(1, "INFO: Parsing id associations from " << KeySetFilename << "."); 326 361 std::vector<FragmentResult::ptr> results = controller.getReceivedResults(); 327 print receivedmpqcresults(results, KeySetFilename);362 printReceivedMPQCResults(results, KeySetFilename); 328 363 } 329 364 break;
Note:
See TracChangeset
for help on using the changeset viewer.