Changeset b8f0b25
- Timestamp:
- Dec 14, 2012, 5:39:41 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:
- 372c912
- Parents:
- 69e065
- git-author:
- Frederik Heber <heber@…> (09/27/12 15:53:20)
- git-committer:
- Frederik Heber <heber@…> (12/14/12 17:39:41)
- Location:
- src
- Files:
-
- 9 edited
Legend:
- Unmodified
- Added
- Removed
-
src/Actions/FragmentationAction/FragmentationAutomationAction.cpp
r69e065 rb8f0b25 413 413 // store homology container again 414 414 std::ofstream outputstream(homology_file.string().c_str()); 415 if (outputstream. fail()) { // check if opened415 if (outputstream.good()) { // check if opened 416 416 boost::archive::text_oarchive oa(outputstream); 417 417 oa << homology_container; … … 513 513 514 514 // Final phase: sum up and print result 515 {516 FragmentationResults results(517 fragmentData,518 longrangeData,519 fullsolutionData,520 params.path.get(),521 getNoAtomsFromAdjacencyFile(params.path.get()),522 full_sample); 523 515 FragmentationResults results( 516 fragmentData, 517 longrangeData, 518 fullsolutionData, 519 params.path.get(), 520 getNoAtomsFromAdjacencyFile(params.path.get()), 521 full_sample); 522 523 { 524 524 LOG(1, "INFO: Parsing fragment files from " << params.path.get() << "."); 525 525 printReceivedFullResults(results); … … 527 527 528 528 // append all keysets to homology file 529 if (Exitflag != 0) {529 if (Exitflag == 0) { 530 530 const boost::filesystem::path &homology_file = params.homology_file.get(); 531 if (!appendToHomologyFile(homology_file)) 532 Exitflag = 1; 531 if (homology_file.string() != "") { 532 LOG(1, "INFO: Appending HomologyGraphs to file " << homology_file.string() << "."); 533 if (!appendToHomologyFile(homology_file)) 534 Exitflag = 1; 535 } 533 536 } 534 537 -
src/Fragmentation/Automation/FragmentationChargeDensity.cpp
r69e065 rb8f0b25 93 93 94 94 /// convert all MPQCData to MPQCDataMap_t 95 Result_Grid_fused =96 OrthogonalSumUpPerLevel<MPQCDataGridMap_t, MPQCData, MPQCDataGridVector_t>(97 fragmentData, MatrixNrLookup, container, subsetmap);98 Result_Fragment_fused =99 OrthogonalSumUpPerLevel<MPQCDataFragmentMap_t, MPQCData, MPQCDataFragmentVector_t>(100 fragmentData, MatrixNrLookup, container, subsetmap);95 OrthogonalSumUpPerLevel<MPQCDataGridMap_t, MPQCData, MPQCDataGridVector_t>( 96 fragmentData, MatrixNrLookup, container, subsetmap, 97 Result_Grid_fused, Result_perIndexSet_Grid); 98 OrthogonalSumUpPerLevel<MPQCDataFragmentMap_t, MPQCData, MPQCDataFragmentVector_t>( 99 fragmentData, MatrixNrLookup, container, subsetmap, 100 Result_Fragment_fused, Result_perIndexSet_Fragment); 101 101 } 102 102 -
src/Fragmentation/Automation/FragmentationChargeDensity.hpp
r69e065 rb8f0b25 22 22 23 23 #include "Fragmentation/SetValues/Fragment.hpp" 24 #include "Fragmentation/Summation/IndexSet.hpp" 24 25 #include "Jobs/MPQCData.hpp" 25 26 #include "Jobs/MPQCDataMap.hpp" … … 44 45 const Fragment &getFragment(); 45 46 47 //!> results per level of summed up sampled grid charge 46 48 std::vector<MPQCDataGridMap_t> Result_Grid_fused; 49 //!> results per level of summed up fragment positions and charges 50 std::vector<MPQCDataFragmentMap_t> Result_Fragment_fused; 47 51 48 std::vector<MPQCDataFragmentMap_t> Result_Fragment_fused; 52 //!> results per IndexSet of summed up sampled grid charge 53 std::map<IndexSet::ptr, MPQCDataGridMap_t> Result_perIndexSet_Grid; 54 //!> results per IndexSet of summed up fragment positions and charges 55 std::map<IndexSet::ptr, MPQCDataFragmentMap_t> Result_perIndexSet_Fragment; 49 56 }; 50 57 -
src/Fragmentation/Automation/FragmentationResults.cpp
r69e065 rb8f0b25 121 121 122 122 typedef boost::mpl::remove<MPQCDataEnergyVector_t, MPQCDataFused::energy_eigenvalues>::type MPQCDataEnergyVector_noeigenvalues_t; 123 Result_Energy_fused =124 OrthogonalSumUpPerLevel<MPQCDataEnergyMap_t, MPQCData, MPQCDataEnergyVector_t>(125 fragmentData, MPQCMatrixNrLookup, container, subsetmap);126 Result_Grid_fused =127 OrthogonalSumUpPerLevel<MPQCDataGridMap_t, MPQCData, MPQCDataGridVector_t>(128 fragmentData, MPQCMatrixNrLookup, container, subsetmap);129 Result_Time_fused =130 SumUpPerLevel<MPQCDataTimeMap_t, MPQCData, MPQCDataTimeVector_t>(131 fragmentData, MPQCMatrixNrLookup, container, subsetmap);132 Result_Fragment_fused =133 OrthogonalSumUpPerLevel<MPQCDataFragmentMap_t, MPQCData, MPQCDataFragmentVector_t>(134 fragmentData, MPQCMatrixNrLookup, container, subsetmap);123 OrthogonalSumUpPerLevel<MPQCDataEnergyMap_t, MPQCData, MPQCDataEnergyVector_t>( 124 fragmentData, MPQCMatrixNrLookup, container, subsetmap, 125 Result_Energy_fused, Result_perIndexSet_Energy); 126 OrthogonalSumUpPerLevel<MPQCDataGridMap_t, MPQCData, MPQCDataGridVector_t>( 127 fragmentData, MPQCMatrixNrLookup, container, subsetmap, 128 Result_Grid_fused, Result_perIndexSet_Grid); 129 SumUpPerLevel<MPQCDataTimeMap_t, MPQCData, MPQCDataTimeVector_t>( 130 fragmentData, MPQCMatrixNrLookup, container, subsetmap, 131 Result_Time_fused, Result_perIndexSet_Time); 132 OrthogonalSumUpPerLevel<MPQCDataFragmentMap_t, MPQCData, MPQCDataFragmentVector_t>( 133 fragmentData, MPQCMatrixNrLookup, container, subsetmap, 134 Result_Fragment_fused, Result_perIndexSet_Fragment); 135 135 136 136 // multiply each short-range potential with the respective charge … … 141 141 } 142 142 // then sum up 143 Result_LongRange_fused =144 OrthogonalSumUpPerLevel<VMGDataMap_t, VMGData, VMGDataVector_t>(145 longrangeData, VMGMatrixNrLookup, container, subsetmap);143 OrthogonalSumUpPerLevel<VMGDataMap_t, VMGData, VMGDataVector_t>( 144 longrangeData, VMGMatrixNrLookup, container, subsetmap, 145 Result_LongRange_fused, Result_perIndexSet_LongRange); 146 146 147 147 // force has extra data converter … … 154 154 container->getContainer(), 155 155 MPQCMatrixNrLookup, 156 Result_Force_fused); 156 Result_Force_fused, 157 Result_perIndexSet_Force); 157 158 boost::mpl::for_each<MPQCDataForceVector_t>(boost::ref(forceSummer)); 158 159 -
src/Fragmentation/Automation/FragmentationResults.hpp
r69e065 rb8f0b25 20 20 21 21 #include "JobMarket/types.hpp" 22 23 #include "Fragmentation/Summation/IndexSet.hpp" 22 24 23 25 #include "Jobs/MPQCData.hpp" … … 75 77 std::vector<VMGDataLongRangeMap_t> Result_LongRangeIntegrated_fused; 76 78 79 //!> results per IndexSet of summed up energy 80 std::map<IndexSet::ptr, MPQCDataEnergyMap_t> Result_perIndexSet_Energy; 81 //!> results per IndexSet of summed up sampled grid charge 82 std::map<IndexSet::ptr, MPQCDataGridMap_t> Result_perIndexSet_Grid; 83 //!> results per IndexSet of summed up times 84 std::map<IndexSet::ptr, MPQCDataTimeMap_t> Result_perIndexSet_Time; 85 //!> results per IndexSet of summed up fragment positions and charges 86 std::map<IndexSet::ptr, MPQCDataFragmentMap_t> Result_perIndexSet_Fragment; 87 //!> results per IndexSet of summed up forces 88 std::map<IndexSet::ptr, MPQCDataForceMap_t> Result_perIndexSet_Force; 89 //!> results per IndexSet of summed up long range potential grids and energy 90 std::map<IndexSet::ptr, VMGDataMap_t> Result_perIndexSet_LongRange; 91 // we don't need the map pendant for Result_LongRangeIntegrated_fused, as this 92 // quantity makes sense only level-wise 93 77 94 private: 78 95 //!> maximum level of summation -
src/Fragmentation/Summation/AllLevelOrthogonalSummator.hpp
r69e065 rb8f0b25 45 45 const IndexSetContainer::Container_t &_container, 46 46 const std::map< JobId_t, size_t > &_MatrixNrLookup, 47 std::vector<MapType> &_results) : 47 std::vector<MapType> &_levelresults, 48 std::map<IndexSet::ptr, MapType> &_keysetresults) : 48 49 subsetmap(_subsetmap), 49 50 data(_data), 50 51 container(_container), 51 52 MatrixNrLookup(_MatrixNrLookup), 52 results(_results) 53 levelresults(_levelresults), 54 keysetresults(_keysetresults) 53 55 { 54 ASSERT( results.size() >= subsetmap->getMaximumSetLevel(),56 ASSERT( levelresults.size() >= subsetmap->getMaximumSetLevel(), 55 57 "AllLevelOrthogonalSummator() - result vector is not large enough."); 56 58 } … … 65 67 // We retrieve the type of the MPQCData member variable from the boost::fusion::map. 66 68 typedef typename boost::fusion::result_of::value_at_key<MapType, MapKey>::type MapValue; 69 67 70 // create OrthogonalSummator instance 68 71 OrthogonalSummator<MapType, MapKey> sum_value( 69 72 subsetmap, data, container, MatrixNrLookup 70 73 ); 74 75 // fill levelresults 71 76 const size_t MaxLevel = subsetmap->getMaximumSetLevel(); 72 77 for (size_t level=1; level <= MaxLevel; ++level) { 73 MapType &LevelResults = results[level-1];74 // sum up and store in results78 MapType &LevelResults = levelresults[level-1]; 79 // sum up and store in levelresults 75 80 const MapValue value = sum_value(level); 76 81 boost::fusion::at_key<MapKey>(LevelResults) = value; 77 82 // print value 78 83 //LOG(0, "STATUS: Level " << level << " resulting " << printKeyNames::printName<MapKey>() << " is " << value << "."); 84 } 85 86 // fill keysetresults 87 for (IndexSetContainer::Container_t::const_iterator indexsetiter = container.begin(); 88 indexsetiter != container.end(); ++indexsetiter) { 89 const IndexSet::ptr &index = *indexsetiter; 90 // this either generates a new entry or updates the present one, as we obtain ref to value 91 boost::fusion::at_key<MapKey>(keysetresults[index]) = 92 sum_value.getContributionForIndexSet(index); 79 93 } 80 94 } … … 89 103 //!> lookup map from job ids to ordering in above vectors 90 104 const std::map< JobId_t, size_t > &MatrixNrLookup; 91 //!> vector of results 92 std::vector<MapType> &results; 105 //!> vector of levelresults 106 std::vector<MapType> &levelresults; 107 typedef std::pair< IndexSet::ptr, MapType > keysetresults_pair_t; 108 //!> typedef for map for keyset and each resulting value 109 typedef std::map<IndexSet::ptr, MapType> keysetresults_t; 110 //!> map for IndexSet and its associated contribution 111 keysetresults_t &keysetresults; 93 112 }; 94 113 -
src/Fragmentation/Summation/AllLevelSummator.hpp
r69e065 rb8f0b25 38 38 * to job id and hence to _data. 39 39 * \param _MatrixNrLookup lookup from job id to ordering in above vectors 40 * \param _ results vector placeresults into40 * \param _levelresults vector place levelresults into 41 41 */ 42 42 AllLevelSummator( … … 45 45 const IndexSetContainer::Container_t &_container, 46 46 const std::map< JobId_t, size_t > &_MatrixNrLookup, 47 std::vector<MapType> &_results) : 47 std::vector<MapType> &_levelresults, 48 std::map<IndexSet::ptr, MapType> &_keysetresults) : 48 49 subsetmap(_subsetmap), 49 50 data(_data), 50 51 container(_container), 51 52 MatrixNrLookup(_MatrixNrLookup), 52 results(_results) 53 levelresults(_levelresults), 54 keysetresults(_keysetresults) 53 55 { 54 ASSERT( results.size() >= subsetmap->getMaximumSetLevel(),56 ASSERT( levelresults.size() >= subsetmap->getMaximumSetLevel(), 55 57 "AllLevelSummator() - result vector is not large enough."); 56 58 } … … 65 67 // We retrieve the type of the MPQCData member variable from the boost::fusion::map. 66 68 typedef typename boost::fusion::result_of::value_at_key<MapType, MapKey>::type MapValue; 69 67 70 // create Summator instance 68 71 Summator<MapType, MapKey> sum_value( 69 72 subsetmap, data, container, MatrixNrLookup 70 73 ); 74 75 // fill levelresults 71 76 const size_t MaxLevel = subsetmap->getMaximumSetLevel(); 72 77 for (size_t level=1; level <= MaxLevel; ++level) { 73 MapType &LevelResults = results[level-1];74 // sum up and store in results78 MapType &LevelResults = levelresults[level-1]; 79 // sum up and store in levelresults 75 80 const MapValue value = sum_value(level); 76 81 boost::fusion::at_key<MapKey>(LevelResults) = value; 77 82 // print value 78 83 //LOG(0, "STATUS: Level " << level << " resulting " << printKeyNames::printName<MapKey>() << " is " << value << "."); 84 } 85 86 // fill keysetresults 87 for (IndexSetContainer::Container_t::const_iterator indexsetiter = container.begin(); 88 indexsetiter != container.end(); ++indexsetiter) { 89 const IndexSet::ptr &index = *indexsetiter; 90 // this either generates a new entry or updates the present one, as we obtain ref to value 91 boost::fusion::at_key<MapKey>(keysetresults[index]) = 92 sum_value.getContributionForIndexSet(index); 79 93 } 80 94 } … … 89 103 //!> lookup map from job ids to ordering in above vectors 90 104 const std::map< JobId_t, size_t > &MatrixNrLookup; 91 //!> vector of results 92 std::vector<MapType> &results; 105 //!> vector of levelresults 106 std::vector<MapType> &levelresults; 107 typedef std::pair< IndexSet::ptr, MapType > keysetresults_pair_t; 108 //!> typedef for map for keyset and each resulting value 109 typedef std::map<IndexSet::ptr, MapType> keysetresults_t; 110 //!> map for IndexSet and its associated contribution 111 keysetresults_t &keysetresults; 93 112 }; 94 113 -
src/Fragmentation/Summation/OrthogonalSumUpPerLevel.hpp
r69e065 rb8f0b25 21 21 #include "Fragmentation/Converter/DataConverter.hpp" 22 22 #include "Fragmentation/Summation/AllLevelOrthogonalSummator.hpp" 23 #include "Fragmentation/Summation/IndexSet.hpp" 23 24 #include "Fragmentation/Summation/IndexSetContainer.hpp" 24 25 … … 28 29 29 30 template <typename TypeMap, typename TypeData, typename TypeVector> 30 std::vector<TypeMap>OrthogonalSumUpPerLevel(31 void OrthogonalSumUpPerLevel( 31 32 const std::map<JobId_t, TypeData> &fragmentData, 32 33 const std::map< JobId_t, size_t > &MatrixNrLookup, 33 34 const IndexSetContainer::ptr &container, 34 SubsetMap::ptr &subsetmap 35 SubsetMap::ptr &subsetmap, 36 std::vector<TypeMap> &levelresults, 37 std::map<IndexSet::ptr, TypeMap> &keysetresults 35 38 ) 36 39 { … … 39 42 convertDataTo<TypeData, TypeMap>(fragmentData, Data_fused); 40 43 // instantiate summator 41 std::vector<TypeMap> Result_fused(subsetmap->getMaximumSetLevel());44 levelresults.resize(subsetmap->getMaximumSetLevel()); 42 45 AllLevelOrthogonalSummator<TypeMap> Summer( 43 46 subsetmap, … … 45 48 container->getContainer(), 46 49 MatrixNrLookup, 47 Result_fused); 50 levelresults, 51 keysetresults); 48 52 // sum up for each type key in TypeVector 49 53 boost::mpl::for_each<TypeVector>(boost::ref(Summer)); 50 return Result_fused;51 54 } 52 55 -
src/Fragmentation/Summation/SumUpPerLevel.hpp
r69e065 rb8f0b25 20 20 #include "Fragmentation/Converter/DataConverter.hpp" 21 21 #include "Fragmentation/Summation/AllLevelSummator.hpp" 22 #include "Fragmentation/Summation/IndexSet.hpp" 22 23 #include "Fragmentation/Summation/IndexSetContainer.hpp" 23 24 … … 27 28 28 29 template <typename TypeMap, typename TypeData, typename TypeVector> 29 std::vector<TypeMap>SumUpPerLevel(30 void SumUpPerLevel( 30 31 const std::map<JobId_t, TypeData> &fragmentData, 31 32 const std::map< JobId_t, size_t > &MatrixNrLookup, 32 33 const IndexSetContainer::ptr &container, 33 SubsetMap::ptr &subsetmap 34 SubsetMap::ptr &subsetmap, 35 std::vector<TypeMap> &levelresults, 36 std::map<IndexSet::ptr, TypeMap> &keysetresults 34 37 ) 35 38 { … … 38 41 convertDataTo<TypeData, TypeMap>(fragmentData, Data_fused); 39 42 // instantiate summator 40 std::vector<TypeMap> Result_fused(subsetmap->getMaximumSetLevel());43 levelresults.resize(subsetmap->getMaximumSetLevel()); 41 44 AllLevelSummator<TypeMap> Summer( 42 45 subsetmap, … … 44 47 container->getContainer(), 45 48 MatrixNrLookup, 46 Result_fused); 49 levelresults, 50 keysetresults); 47 51 // sum up for each type key in TypeVector 48 52 boost::mpl::for_each<TypeVector>(boost::ref(Summer)); 49 return Result_fused;50 53 } 51 54
Note:
See TracChangeset
for help on using the changeset viewer.