Changeset da098d2 for src/Fragmentation/Summation
- Timestamp:
- Sep 14, 2016, 6:43:45 PM (8 years ago)
- Branches:
- Action_Thermostats, Add_AtomRandomPerturbation, Add_FitFragmentPartialChargesAction, Add_RotateAroundBondAction, Add_SelectAtomByNameAction, Adding_Graph_to_ChangeBondActions, Adding_MD_integration_tests, Adding_StructOpt_integration_tests, Automaking_mpqc_open, AutomationFragmentation_failures, Candidate_v1.5.4, Candidate_v1.6.0, Candidate_v1.6.1, ChangeBugEmailaddress, ChangingTestPorts, ChemicalSpaceEvaluator, 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_ChargeSampling_PBC, Fix_ChronosMutex, Fix_FitPartialCharges, Fix_FitPotential_needs_atomicnumbers, Fix_ForceAnnealing, Fix_IndependentFragmentGrids, Fix_ParseParticles, Fix_ParseParticles_split_forward_backward_Actions, Fix_StatusMsg, Fix_StepWorldTime_single_argument, Fix_Verbose_Codepatterns, ForceAnnealing_goodresults, ForceAnnealing_oldresults, ForceAnnealing_tocheck, ForceAnnealing_with_BondGraph, ForceAnnealing_with_BondGraph_continued, ForceAnnealing_with_BondGraph_continued_betteresults, ForceAnnealing_with_BondGraph_contraction-expansion, GeometryObjects, Gui_displays_atomic_force_velocity, IndependentFragmentGrids_IndividualZeroInstances, IndependentFragmentGrids_IntegrationTest, IndependentFragmentGrids_Sole_NN_Calculation, JobMarket_RobustOnKillsSegFaults, JobMarket_StableWorkerPool, JobMarket_unresolvable_hostname_fix, ODR_violation_mpqc_open, PartialCharges_OrthogonalSummation, PythonUI_with_named_parameters, QtGui_reactivate_TimeChanged_changes, Recreated_GuiChecks, RotateToPrincipalAxisSystem_UndoRedo, StoppableMakroAction, Subpackage_CodePatterns, Subpackage_JobMarket, Subpackage_LinearAlgebra, Subpackage_levmar, Subpackage_mpqc_open, Subpackage_vmg, ThirdParty_MPQC_rebuilt_buildsystem, TrajectoryDependenant_MaxOrder, TremoloParser_IncreasedPrecision, TremoloParser_MultipleTimesteps, Ubuntu_1604_changes, stable
- Children:
- 409a05
- Parents:
- 3d444a
- git-author:
- Frederik Heber <heber@…> (06/12/16 07:46:35)
- git-committer:
- Frederik Heber <heber@…> (09/14/16 18:43:45)
- Location:
- src/Fragmentation/Summation
- Files:
-
- 1 added
- 9 edited
Legend:
- Unmodified
- Added
- Removed
-
src/Fragmentation/Summation/AllLevelOrthogonalSummator.hpp
r3d444a rda098d2 21 21 #include "Fragmentation/Summation/SubsetMap.hpp" 22 22 #include "Fragmentation/Summation/OrthogonalSummator.hpp" 23 #include "Fragmentation/Summation/ZeroInstance.hpp" 23 24 24 25 #include "Fragmentation/Summation/printKeyNames.hpp" … … 39 40 * \param _MatrixNrLookup lookup from job id to ordering in above vectors, if 40 41 * out of range this value is set to zero, hence ignored. 41 * \param _results vector place results into 42 * \param _levelresults vector place levelresults into 43 * \param _keysetresults results per index set, set by operator() 44 * \param _ZeroInstances zero instance to use in summation for each type 42 45 */ 43 46 AllLevelOrthogonalSummator( … … 47 50 const std::map< JobId_t, size_t > &_MatrixNrLookup, 48 51 std::vector<MapType> &_levelresults, 49 std::map<IndexSet::ptr, std::pair<MapType, MapType> > &_keysetresults) : 52 std::map<IndexSet::ptr, std::pair<MapType, MapType> > &_keysetresults, 53 MapType &_ZeroInstances) : 50 54 subsetmap(_subsetmap), 51 55 data(_data), … … 53 57 MatrixNrLookup(_MatrixNrLookup), 54 58 levelresults(_levelresults), 55 keysetresults(_keysetresults) 59 keysetresults(_keysetresults), 60 ZeroInstances(_ZeroInstances) 56 61 { 57 62 ASSERT( levelresults.size() >= subsetmap->getMaximumSetLevel(), … … 73 78 subsetmap, data, container, MatrixNrLookup 74 79 ); 80 81 // set zero instance 82 const MapValue &DesiredZeroInstance = boost::fusion::at_key<MapKey>(ZeroInstances); 83 if (DesiredZeroInstance != ZeroInstance<MapValue>()) 84 sum_value.setZeroInstance(DesiredZeroInstance); 75 85 76 86 // fill levelresults … … 113 123 //!> map for IndexSet and its associated contribution 114 124 keysetresults_t &keysetresults; 125 //!> map per type to sum of base/zero instances to enforce specific parameters in summation 126 MapType &ZeroInstances; 115 127 }; 116 128 -
src/Fragmentation/Summation/AllLevelSummator.hpp
r3d444a rda098d2 21 21 #include "Fragmentation/Summation/SubsetMap.hpp" 22 22 #include "Fragmentation/Summation/Summator.hpp" 23 #include "Fragmentation/Summation/ZeroInstance.hpp" 23 24 24 25 #include "Fragmentation/Summation/printKeyNames.hpp" … … 40 41 * out of range this value is set to zero, hence ignored. 41 42 * \param _levelresults vector place levelresults into 43 * \param _keysetresults results per index set, set by operator() 44 * \param _ZeroInstances zero instance to use in summation for each type 42 45 */ 43 46 AllLevelSummator( … … 47 50 const std::map< JobId_t, size_t > &_MatrixNrLookup, 48 51 std::vector<MapType> &_levelresults, 49 std::map<IndexSet::ptr, std::pair<MapType, MapType> > &_keysetresults) : 52 std::map<IndexSet::ptr, std::pair<MapType, MapType> > &_keysetresults, 53 MapType &_ZeroInstances) : 50 54 subsetmap(_subsetmap), 51 55 data(_data), … … 53 57 MatrixNrLookup(_MatrixNrLookup), 54 58 levelresults(_levelresults), 55 keysetresults(_keysetresults) 59 keysetresults(_keysetresults), 60 ZeroInstances(_ZeroInstances) 56 61 { 57 62 ASSERT( levelresults.size() >= subsetmap->getMaximumSetLevel(), … … 73 78 subsetmap, data, container, MatrixNrLookup 74 79 ); 80 81 // set zero instance 82 const MapValue &DesiredZeroInstance = boost::fusion::at_key<MapKey>(ZeroInstances); 83 if (DesiredZeroInstance != ZeroInstance<MapValue>()) 84 sum_value.setZeroInstance(DesiredZeroInstance); 75 85 76 86 // fill levelresults … … 113 123 //!> map for IndexSet and its associated contribution 114 124 keysetresults_t &keysetresults; 125 //!> map per type to sum of base/zero instances to enforce specific parameters in summation 126 MapType &ZeroInstances; 115 127 }; 116 128 -
src/Fragmentation/Summation/Containers/FragmentationLongRangeResults.cpp
r3d444a rda098d2 130 130 IndexedVectors::indices_t fullindices; 131 131 if (hasLongRangeForces()) { 132 // initialize zero instance map 133 VMGDataForceMap_t ZeroInstances; 134 ZeroInstanceInitializer<VMGDataForceMap_t> initZeroInstance(ZeroInstances); 135 boost::mpl::for_each<VMGDataForceVector_t>(boost::ref(initZeroInstance)); 136 132 137 // force has extra data converter (this is similar to MPQCData's forces 133 138 std::map<JobId_t, VMGDataForceMap_t> VMGData_Force_fused; … … 141 146 VMGMatrixNrLookup, 142 147 Result_ForceLongRange_fused, 143 Result_perIndexSet_LongRange_Force); 148 Result_perIndexSet_LongRange_Force, 149 ZeroInstances); 144 150 boost::mpl::for_each<VMGDataForceVector_t>(boost::ref(forceSummer)); 145 151 // build full force index set -
src/Fragmentation/Summation/Containers/FragmentationShortRangeResults.cpp
r3d444a rda098d2 107 107 Result_Time_fused, Result_perIndexSet_Time); 108 108 109 // initialize zero instance map 110 MPQCDataForceMap_t ZeroInstances; 111 ZeroInstanceInitializer<MPQCDataForceMap_t> initZeroInstance(ZeroInstances); 112 boost::mpl::for_each<MPQCDataForceVector_t>(boost::ref(initZeroInstance)); 113 109 114 // force has extra data converter 110 115 std::map<JobId_t, MPQCDataForceMap_t> MPQCData_Force_fused; … … 117 122 MPQCMatrixNrLookup, 118 123 Result_Force_fused, 119 Result_perIndexSet_Force); 124 Result_perIndexSet_Force, 125 ZeroInstances); 120 126 boost::mpl::for_each<MPQCDataForceVector_t>(boost::ref(forceSummer)); 121 127 } -
src/Fragmentation/Summation/Makefile.am
r3d444a rda098d2 29 29 Fragmentation/Summation/writeIndexedTable.hpp \ 30 30 Fragmentation/Summation/writeTable.hpp \ 31 Fragmentation/Summation/ZeroInstance.hpp 31 Fragmentation/Summation/ZeroInstance.hpp \ 32 Fragmentation/Summation/ZeroInstanceInitializer.hpp 32 33 33 34 -
src/Fragmentation/Summation/OrthogonalSumUpPerLevel.hpp
r3d444a rda098d2 23 23 #include "Fragmentation/Summation/IndexSet.hpp" 24 24 #include "Fragmentation/Summation/IndexSetContainer.hpp" 25 #include "Fragmentation/Summation/ZeroInstanceInitializer.hpp" 25 26 26 27 #include "Fragmentation/Summation/Containers/MPQCData.hpp" … … 41 42 std::map<JobId_t, TypeMap> Data_fused; 42 43 convertDataTo<TypeData, TypeMap>(fragmentData, Data_fused); 44 45 // initialize zero instance map 46 TypeMap ZeroInstances; 47 ZeroInstanceInitializer<TypeMap> initZeroInstance(ZeroInstances); 48 boost::mpl::for_each<TypeVector>(boost::ref(initZeroInstance)); 49 43 50 // instantiate summator 44 51 levelresults.resize(subsetmap->getMaximumSetLevel()); … … 49 56 MatrixNrLookup, 50 57 levelresults, 51 keysetresults); 58 keysetresults, 59 ZeroInstances); 52 60 // sum up for each type key in TypeVector 53 61 boost::mpl::for_each<TypeVector>(boost::ref(Summer)); -
src/Fragmentation/Summation/OrthogonalSummator.hpp
r3d444a rda098d2 103 103 } 104 104 105 /** Setter for the zero instance to use as the base in orthogonal summation. 106 * 107 * \sa OrthogonalSummation::setZeroInstance() for explanations. 108 * 109 * \param _zeroinstance 110 */ 111 void setZeroInstance(const MapValue &_zeroinstance) 112 { 113 OS.setZeroInstance(_zeroinstance); 114 } 115 105 116 /** Getter for the contribution of the SetValue<> to a specific \a index. 106 117 * -
src/Fragmentation/Summation/SumUpPerLevel.hpp
r3d444a rda098d2 40 40 std::map<JobId_t, TypeMap> Data_fused; 41 41 convertDataTo<TypeData, TypeMap>(fragmentData, Data_fused); 42 43 // initialize zero instance map 44 TypeMap ZeroInstances; 45 ZeroInstanceInitializer<TypeMap> initZeroInstance(ZeroInstances); 46 boost::mpl::for_each<TypeVector>(boost::ref(initZeroInstance)); 47 42 48 // instantiate summator 43 49 levelresults.resize(subsetmap->getMaximumSetLevel()); … … 48 54 MatrixNrLookup, 49 55 levelresults, 50 keysetresults); 56 keysetresults, 57 ZeroInstances); 51 58 // sum up for each type key in TypeVector 52 59 boost::mpl::for_each<TypeVector>(boost::ref(Summer)); -
src/Fragmentation/Summation/Summator.hpp
r3d444a rda098d2 103 103 } 104 104 105 /** Setter for the zero instance to use as the base in summation. 106 * 107 * \sa Summation::setZeroInstance() for explanations. 108 * 109 * \param _zeroinstance 110 */ 111 void setZeroInstance(const MapValue &_zeroinstance) 112 { 113 OS.setZeroInstance(_zeroinstance); 114 } 105 115 106 116 /** Getter for the contribution of the SetValue<> to a specific \a index.
Note:
See TracChangeset
for help on using the changeset viewer.