Changeset 94db13
- Timestamp:
- Oct 13, 2015, 8:12:54 PM (9 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:
- 20bb3b
- Parents:
- 83a425
- git-author:
- Frederik Heber <heber@…> (10/25/14 21:56:32)
- git-committer:
- Frederik Heber <heber@…> (10/13/15 20:12:54)
- Location:
- src
- Files:
-
- 13 edited
Legend:
- Unmodified
- Added
- Removed
-
src/Actions/FragmentationAction/AnalyseFragmentationResultsAction.cpp
r83a425 r94db13 251 251 filename += FRAGMENTPREFIX + std::string("_VMGEnergy.dat"); 252 252 writeToFile(filename, gridresult); 253 } 254 255 if (results.hasLongRangeForces()) { 256 const std::string forceresult = 257 writeTable<VMGDataForceMap_t, VMGDataForceVector_t>()( 258 results.Result_ForceLongRange_fused, results.getMaxLevel()); 259 LOG(2, "DEBUG: Force table is \n" << forceresult); 260 std::string filename; 261 filename += FRAGMENTPREFIX + std::string("_VMGForces.dat"); 262 writeToFile(filename, forceresult); 253 263 } 254 264 -
src/Actions/FragmentationAction/FragmentationAutomationAction.cpp
r83a425 r94db13 316 316 destiter->second.both_sampled_potential = srciter->second.sampled_potential; 317 317 destiter->second.nuclei_long = srciter->second.nuclei_long; 318 destiter->second.particle_forces = srciter->second.particle_forces; 318 destiter->second.forces = srciter->second.forces; 319 destiter->second.hasForces = srciter->second.hasForces; 319 320 } 320 321 } -
src/Fragmentation/Summation/Containers/FragmentationLongRangeResults.cpp
r83a425 r94db13 65 65 const KeySetsContainer& _ForceKeySet) : 66 66 KeySet(_KeySet), 67 ForceKeySet(_ForceKeySet) 67 ForceKeySet(_ForceKeySet), 68 hasForces((!longrangeData.empty()) && (longrangeData.begin()->second.hasForces)) 68 69 { 69 70 initLookups(fragmentData, longrangeData); … … 125 126 longrangeData, VMGMatrixNrLookup, container, subsetmap, 126 127 Result_LongRange_fused, Result_perIndexSet_LongRange); 128 129 if (hasLongRangeForces()) { 130 // force has extra data converter (this is similar to MPQCData's forces 131 std::map<JobId_t, VMGDataForceMap_t> VMGData_Force_fused; 132 convertDatatoForceMap<VMGData, VMGDataForceMap_t, VMGDataFused>( 133 longrangeData, ForceKeySet, VMGData_Force_fused); 134 Result_ForceLongRange_fused.resize(MaxLevel); // we need the results of correct size already 135 AllLevelOrthogonalSummator<VMGDataForceMap_t> forceSummer( 136 subsetmap, 137 VMGData_Force_fused, 138 container->getContainer(), 139 VMGMatrixNrLookup, 140 Result_ForceLongRange_fused, 141 Result_perIndexSet_LongRange_Force); 142 boost::mpl::for_each<VMGDataForceVector_t>(boost::ref(forceSummer)); 143 } 127 144 128 145 // then sum up -
src/Fragmentation/Summation/Containers/FragmentationLongRangeResults.hpp
r83a425 r94db13 87 87 } 88 88 89 const bool hasLongRangeForces() const 90 { return hasForces; } 91 89 92 private: 90 93 void initLookups( … … 100 103 IndexSetContainer::ptr container; 101 104 SubsetMap::ptr subsetmap; 105 //!> indicates whether the longrange results contain VMG forces data or not 106 bool hasForces; 102 107 103 108 public: 104 109 //!> results per level of summed up sampled grid charge 105 110 std::vector<MPQCDataGridMap_t> Result_Grid_fused; 106 //!> results per level of summed up long range energ y and forces111 //!> results per level of summed up long range energies 107 112 std::vector<VMGDataMap_t> Result_LongRange_fused; 113 //!> results per level of summed up long range forces 114 std::vector<VMGDataForceMap_t> Result_ForceLongRange_fused; 108 115 //!> results per level of summed up long range potential grids 109 116 std::vector<VMGDataGridMap_t> Result_GridLongRange_fused; … … 113 120 //!> results per IndexSet of summed up sampled grid charge 114 121 std::map<IndexSet::ptr, std::pair<MPQCDataGridMap_t,MPQCDataGridMap_t> > Result_perIndexSet_Grid; 115 //!> results per IndexSet of summed up long range energ y and forces122 //!> results per IndexSet of summed up long range energies 116 123 std::map<IndexSet::ptr, std::pair<VMGDataMap_t, VMGDataMap_t> > Result_perIndexSet_LongRange; 124 //!> results per IndexSet of summed up long range forces 125 std::map<IndexSet::ptr, std::pair<VMGDataForceMap_t, VMGDataForceMap_t> > Result_perIndexSet_LongRange_Force; 117 126 //!> results per IndexSet of summed up long range potential grids 118 127 std::map<IndexSet::ptr, std::pair<VMGDataGridMap_t, VMGDataGridMap_t> > Result_perIndexSet_LongRange_Grid; -
src/Fragmentation/Summation/Containers/FragmentationShortRangeResults.cpp
r83a425 r94db13 109 109 // force has extra data converter 110 110 std::map<JobId_t, MPQCDataForceMap_t> MPQCData_Force_fused; 111 convert MPQCDatatoForceMap(fragmentData, ForceKeySet, MPQCData_Force_fused);111 convertDatatoForceMap<MPQCData, MPQCDataForceMap_t, MPQCDataFused>(fragmentData, ForceKeySet, MPQCData_Force_fused); 112 112 Result_Force_fused.resize(MaxLevel); // we need the results of correct size already 113 113 AllLevelOrthogonalSummator<MPQCDataForceMap_t> forceSummer( -
src/Fragmentation/Summation/Containers/MPQCDataFused.hpp
r83a425 r94db13 22 22 * instance when going throughb the list with boost::mpl::for_each. 23 23 */ 24 namespaceMPQCDataFused {24 struct MPQCDataFused { 25 25 // keys for energy_t 26 26 struct energy_total {}; … … 51 51 struct times_gather_cputime {}; 52 52 struct times_gather_flops {}; 53 } 53 }; 54 54 55 55 -
src/Fragmentation/Summation/Containers/VMGData.cpp
r83a425 r94db13 44 44 sampled_potential(_props), 45 45 nuclei_long(0.), 46 electron_long(0.) 46 electron_long(0.), 47 hasForces(false) 47 48 {} 48 49 … … 54 55 ost << "Nuclei long-Range energy: " << data.nuclei_long << std::endl; 55 56 ost << "Electron long-Range energy: " << data.electron_long << std::endl; 56 ost << "Nuclei long-Range forces: " << data. particle_forces << std::endl;57 ost << "Nuclei long-Range forces: " << data.forces << std::endl; 57 58 return ost; 58 59 } -
src/Fragmentation/Summation/Containers/VMGData.hpp
r83a425 r94db13 50 50 double electron_long; 51 51 //!> force vectors of all nuclei 52 FragmentForces particle_forces; 52 FragmentForces forces; 53 54 //!> internal value to check when we should sum forces and when not 55 bool hasForces; 53 56 54 57 private: … … 64 67 ar & nuclei_long; 65 68 ar & electron_long; 66 if (version > 2) 67 ar & particle_forces; 69 if (version > 2) { 70 ar & forces; 71 hasForces = true; 72 } else 73 hasForces = false; 68 74 } 69 75 }; -
src/Fragmentation/Summation/Containers/VMGDataFused.hpp
r83a425 r94db13 23 23 * instance when going throughb the list with boost::mpl::for_each. 24 24 */ 25 namespaceVMGDataFused {25 struct VMGDataFused { 26 26 // keys for sampled_potential 27 27 struct sampled_potential {}; … … 30 30 struct electron_long {}; 31 31 // keys for forces 32 struct particle_forces {};32 struct forces {}; 33 33 34 34 // keys for longrange … … 42 42 struct total_shortrange {}; 43 43 44 } 44 }; 45 45 46 46 -
src/Fragmentation/Summation/Containers/VMGDataMap.hpp
r83a425 r94db13 34 34 typedef boost::fusion::map< 35 35 boost::fusion::pair<VMGDataFused::nuclei_long, double >, 36 boost::fusion::pair<VMGDataFused::electron_long, double >, 37 boost::fusion::pair<VMGDataFused::particle_forces, IndexedVectors > 36 boost::fusion::pair<VMGDataFused::electron_long, double > 38 37 > VMGDataMap_t; 39 38 40 39 typedef boost::mpl::list< 41 40 VMGDataFused::nuclei_long, 42 VMGDataFused::electron_long, 43 VMGDataFused::particle_forces 41 VMGDataFused::electron_long 44 42 > VMGDataVector_t; 43 44 /** This boost::fusion map defines key-value or rather key-type pairs with 45 * which we associate all forces data members in VMGData and their type. 46 * 47 * This lets us resolves any ambiguitites of types in VMGData, e.g. 48 * to know vector<double> is forces or energy_eigenvalues. 49 * 50 */ 51 typedef boost::fusion::map< 52 boost::fusion::pair<VMGDataFused::forces, IndexedVectors > 53 > VMGDataForceMap_t; 54 55 typedef boost::mpl::list< 56 VMGDataFused::forces 57 > VMGDataForceVector_t; 45 58 46 59 typedef boost::fusion::map< -
src/Fragmentation/Summation/Containers/VMGData_printKeyNames.hpp
r83a425 r94db13 38 38 (nuclei_long) \ 39 39 (electron_long) \ 40 ( particle_forces) \40 (forces) \ 41 41 (electron_longrange) \ 42 42 (electron_shortrange) \ -
src/Fragmentation/Summation/Converter/DataConverter.hpp
r83a425 r94db13 113 113 #endif 114 114 115 inline void convertMPQCDatatoForceMap( 116 const std::map<JobId_t, MPQCData> &fragmentData, 115 template <class datatype, class dataforcemap, class dataforcefused> 116 inline void convertDatatoForceMap( 117 const std::map<JobId_t, datatype> &fragmentData, 117 118 const KeySetsContainer &ForceKeySet, 118 std::map<JobId_t, MPQCDataForceMap_t> &MPQCData_Force_fused)119 std::map<JobId_t, dataforcemap> &Data_Force_fused) 119 120 { 120 121 // forces 121 122 ASSERT( ForceKeySet.KeySets.size() == fragmentData.size(), 122 123 "FragmentationAutomationAction::performCall() - indices and fragmentData differ in size."); 123 MPQCData_Force_fused.clear();124 std::map<JobId_t, MPQCData>::const_iterator dataiter = fragmentData.begin();124 Data_Force_fused.clear(); 125 typename std::map<JobId_t, datatype>::const_iterator dataiter = fragmentData.begin(); 125 126 KeySetsContainer::ArrayOfIntVectors::const_iterator arrayiter = ForceKeySet.KeySets.begin(); 126 127 for(;dataiter != fragmentData.end(); ++dataiter, ++arrayiter) { 127 const MPQCData&extractedData = dataiter->second;128 LOG(4, "DEBUG: Current extracted Data is " << extractedData << "."); 129 MPQCDataForceMap_tinstance;128 const datatype &extractedData = dataiter->second; 129 LOG(4, "DEBUG: Current extracted Data is " << extractedData << "."); 130 dataforcemap instance; 130 131 // must convert int to index_t 131 132 if (DoLog(5)) { … … 138 139 } 139 140 IndexedVectors::indices_t indices(arrayiter->begin(), arrayiter->end()); 140 boost::fusion::at_key< MPQCDataFused::forces>(instance) =141 boost::fusion::at_key<typename dataforcefused::forces>(instance) = 141 142 IndexedVectors(indices, extractedData.forces); 142 MPQCData_Force_fused.insert( std::make_pair(dataiter->first, instance) );143 Data_Force_fused.insert( std::make_pair(dataiter->first, instance) ); 143 144 } 144 145 } -
src/Jobs/InterfaceVMGJob.cpp
r83a425 r94db13 355 355 { 356 356 size_t index = 0; 357 returndata. particle_forces.resize(357 returndata.forces.resize( 358 358 num_particles_local, FragmentForces::force_t(3, 0.) ); 359 for (FragmentForces::forces_t::iterator iter = returndata. particle_forces.begin();360 iter != returndata. particle_forces.end(); ++iter)359 for (FragmentForces::forces_t::iterator iter = returndata.forces.begin(); 360 iter != returndata.forces.end(); ++iter) 361 361 for (size_t i=0;i<3;++i) 362 362 (*iter)[i] = f[index++];
Note:
See TracChangeset
for help on using the changeset viewer.