Changeset e2925fd for src/Fragmentation
- Timestamp:
- May 3, 2013, 9:46:45 AM (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:
- a86666
- Parents:
- 5281ff
- git-author:
- Frederik Heber <heber@…> (04/05/13 15:09:16)
- git-committer:
- Frederik Heber <heber@…> (05/03/13 09:46:45)
- Location:
- src/Fragmentation
- Files:
-
- 9 edited
Legend:
- Unmodified
- Added
- Removed
-
src/Fragmentation/Automation/VMGFragmentController.cpp
r5281ff re2925fd 71 71 const size_t near_field_cells, 72 72 const size_t interpolation_degree, 73 const SampleParticles_t _SampleParticles, 74 const TreatGrid_t _TreatGrid, 73 75 const MPQCData::DoValenceOnly_t _DoValenceOnly, 74 76 const bool _DoPrintDebug) … … 86 88 new VMGJob( 87 89 next_id, 88 data.sampled_grid, 90 _TreatGrid == DoTreatGrid ? 91 data.sampled_grid : 92 SamplingGrid(data.sampled_grid.begin, data.sampled_grid.end, data.sampled_grid.level), 89 93 data.positions, 90 94 data.charges, 91 95 near_field_cells, 92 96 interpolation_degree, 97 _SampleParticles == DoSampleParticles, 93 98 _DoPrintDebug) ); 94 99 jobs.push_back(testJob); … … 122 127 iter != full_sampled_grid.end(); 123 128 ++iter) { 129 const SamplingGrid &grid = *iter; 124 130 const JobId_t next_id = getAvailableId(); 125 131 LOG(1, "INFO: Creating full VMGJob with " << *iter … … 128 134 new VMGJob( 129 135 next_id, 130 *iter, 136 _TreatGrid == DoTreatGrid ? 137 grid : 138 SamplingGrid(grid.begin, grid.end, grid.level), 131 139 positions, 132 140 charges, 133 141 near_field_cells, 134 142 interpolation_degree, 143 _SampleParticles == DoSampleParticles, 135 144 _DoPrintDebug) ); 136 145 jobs.push_back(testJob); -
src/Fragmentation/Automation/VMGFragmentController.hpp
r5281ff re2925fd 39 39 {} 40 40 41 //>! Enumerization of possible treatment of nuclei point charges. 42 enum SampleParticles_t { 43 DontSampleParticles=0, 44 DoSampleParticles=1 45 }; 46 47 //>! Enumerization of possible treatment of electronic charge distribution on grid. 48 enum TreatGrid_t { 49 DontTreatGrid=0, 50 DoTreatGrid=1 51 }; 52 41 53 /** Creates the long range jobs from finished short-range jobs. 42 54 * … … 45 57 * \param near_field_cells radius of b-splines for interpolation charges onto grid 46 58 * \param interpolation_degree interpolation degree for newton interpolation from grid 59 * \param _SampleParticles whether to add nuclei charges to vmg calculation. 60 * \param _TreatGrid whether to add electron charge distribution to vmg calculation. 47 61 * \param _DoValenceOnly whether to neglect core electron and nuclei charges 48 62 * \param _DoPrintDebug whether we do print grid for debug visualization or not … … 53 67 const size_t near_field_cells, 54 68 const size_t interpolation_degree, 69 const SampleParticles_t _SampleParticles, 70 const TreatGrid_t _TreatGrid, 55 71 const MPQCData::DoValenceOnly_t _DoValenceOnly, 56 72 const bool _DoPrintDebug); -
src/Fragmentation/Summation/Containers/FragmentationLongRangeResults.cpp
r5281ff re2925fd 129 129 boost::fusion::at_key<VMGDataFused::electron_longrange>(instance) = 0.; 130 130 boost::fusion::at_key<VMGDataFused::electron_shortrange>(instance) = 0.; 131 boost::fusion::at_key<VMGDataFused::mixed_longrange>(instance) = 0.; 132 boost::fusion::at_key<VMGDataFused::mixed_shortrange>(instance) = 0.; 131 133 boost::fusion::at_key<VMGDataFused::nuclei_longrange>(instance) = 0.; 132 134 boost::fusion::at_key<VMGDataFused::nuclei_shortrange>(instance) = 0.; … … 136 138 } 137 139 for (size_t level = 2; level <= MaxLevel; ++level) { 138 // we have to fill in the remainder values in the LongRangeMap by hand 139 // weight times correct charge density of the same level 140 // We have calculated three different contributions: e-e, e-n+n-n, and n-n. 141 // And we want to have e-e+e-n, n-n+n-e (where e-n = n-e). 142 // For each of these three contributions we have a full solution and summed 143 // up short range solutions. 144 145 // first we obtain the full e-e energy as potential times charge on the 146 // respective level. 147 // \note that sampled_potential starts at level 2 because we do not calculate 148 // for level 1 as there saturated hydrogens are still present, leaving the 149 // result to be nonsense. 140 150 const SamplingGrid &charge_weight = 141 151 boost::fusion::at_key<MPQCDataFused::sampled_grid>(Result_Grid_fused[level-1]); 142 152 SamplingGrid full_sample_solution = fullsolutionData[level-2].sampled_potential; 143 153 full_sample_solution *= charge_weight; 154 double electron_solution_energy = full_sample_solution.integral(); 155 156 // then we subtract the summed-up short-range e-e interaction energy from 157 // the full solution. 144 158 const SamplingGrid &short_range_correction = 145 159 boost::fusion::at_key<VMGDataFused::sampled_potential>(Result_LongRange_fused[level-1]); 160 double electron_short_range_energy = short_range_correction.integral(); 146 161 full_sample_solution -= short_range_correction; 147 double full_solution_energy = fullsolutionData[level-2].e_long; 148 const double short_range_energy = 149 boost::fusion::at_key<VMGDataFused::energy_long>(Result_LongRange_fused[level-1]); 150 full_solution_energy -= short_range_energy; 151 152 // multiply element-wise with charge distribution 162 electron_solution_energy -= electron_short_range_energy; 163 ASSERT( fabs(electron_solution_energy - full_sample_solution.integral()) < 1e-7, 164 "FragmentationLongRangeResults::operator() - integral and energy are not exchangeable."); 165 166 // then, we obtain the e-n+n-n full solution in the same way 167 double nuclei_solution_energy = fullsolutionData[level-2].nuclei_long; 168 double nuclei_short_range_energy = 169 boost::fusion::at_key<VMGDataFused::nuclei_long>(Result_LongRange_fused[level-1]); 170 nuclei_solution_energy -= nuclei_short_range_energy; 171 172 // and also the e-n full solution 173 double both_solution_energy = fullsolutionData[level-2].electron_long; 174 double both_short_range_energy = 175 boost::fusion::at_key<VMGDataFused::electron_long>(Result_LongRange_fused[level-1]); 176 both_solution_energy -= both_short_range_energy; 177 178 // energies from interpolation at nuclei position has factor of 1/2 already 179 electron_solution_energy *= .5; 180 electron_short_range_energy *= .5; 181 182 // At last, we subtract e-n from n-n+e-n for full solution and short-range 183 // correction. 184 nuclei_solution_energy -= both_solution_energy; 185 nuclei_short_range_energy -= both_short_range_energy; 186 153 187 VMGDataLongRangeMap_t instance; 154 boost::fusion::at_key<VMGDataFused::electron_longrange>(instance) = .5*full_sample_solution.integral();188 boost::fusion::at_key<VMGDataFused::electron_longrange>(instance) = electron_solution_energy; 155 189 // LOG(0, "Remaining long-range potential integral of level " << level << " is " 156 190 // << full_sample_solution.integral() << "."); 157 boost::fusion::at_key<VMGDataFused::electron_shortrange>(instance) = .5*short_range_correction.integral();191 boost::fusion::at_key<VMGDataFused::electron_shortrange>(instance) = electron_short_range_energy; 158 192 // LOG(0, "Short-range correction potential integral of level " << level << " is " 159 193 // << short_range_correction.integral() << "."); 160 boost::fusion::at_key<VMGDataFused:: nuclei_longrange>(instance) = full_solution_energy;194 boost::fusion::at_key<VMGDataFused::mixed_longrange>(instance) = both_solution_energy; 161 195 // LOG(0, "Remaining long-range energy from potential integral of level " << level << " is " 162 196 // << full_solution_energy << "."); 163 boost::fusion::at_key<VMGDataFused::nuclei_shortrange>(instance) = short_range_energy; 197 boost::fusion::at_key<VMGDataFused::mixed_shortrange>(instance) = both_short_range_energy; 198 // LOG(0, "Short-range correction energy from potential integral of level " << level << " is " 199 // << short_range_energy << "."); 200 boost::fusion::at_key<VMGDataFused::nuclei_longrange>(instance) = nuclei_solution_energy; 201 // LOG(0, "Remaining long-range energy from potential integral of level " << level << " is " 202 // << full_solution_energy << "."); 203 boost::fusion::at_key<VMGDataFused::nuclei_shortrange>(instance) = nuclei_short_range_energy; 164 204 // LOG(0, "Short-range correction energy from potential integral of level " << level << " is " 165 205 // << short_range_energy << "."); 166 206 boost::fusion::at_key<VMGDataFused::total_longrange>(instance) = 167 boost::fusion::at_key<VMGDataFused::electron_longrange>(instance) - full_solution_energy; 207 boost::fusion::at_key<VMGDataFused::electron_longrange>(instance) 208 + 2.*boost::fusion::at_key<VMGDataFused::mixed_longrange>(instance) 209 + boost::fusion::at_key<VMGDataFused::nuclei_longrange>(instance); 168 210 boost::fusion::at_key<VMGDataFused::total_shortrange>(instance) = 169 boost::fusion::at_key<VMGDataFused::electron_shortrange>(instance) - short_range_energy; 211 boost::fusion::at_key<VMGDataFused::electron_shortrange>(instance) 212 + 2.*boost::fusion::at_key<VMGDataFused::mixed_shortrange>(instance) 213 + boost::fusion::at_key<VMGDataFused::nuclei_shortrange>(instance); 170 214 Result_LongRangeIntegrated_fused.push_back(instance); 171 215 } -
src/Fragmentation/Summation/Containers/VMGData.cpp
r5281ff re2925fd 42 42 VMGData::VMGData(const SamplingGridProperties &_props) : 43 43 sampled_potential(_props), 44 e_long(0.) 44 nuclei_long(0.), 45 electron_long(0.) 45 46 {} 46 47 … … 50 51 std::ostream & operator<<(std::ostream &ost, const VMGData &data) 51 52 { 52 ost << "Long-Range energy: " << data.e_long << std::endl; 53 ost << "Nuclei long-Range energy: " << data.nuclei_long << std::endl; 54 ost << "Electron long-Range energy: " << data.electron_long << std::endl; 53 55 return ost; 54 56 } -
src/Fragmentation/Summation/Containers/VMGData.hpp
r5281ff re2925fd 42 42 //!> sampled potential on the grid as output 43 43 SamplingGrid sampled_potential; 44 //!> long-range contribution to energy 45 double e_long; 44 //!> nuclei long-range contribution to energy 45 double nuclei_long; 46 //!> electron long-range contribution to energy 47 double electron_long; 46 48 47 49 private: … … 52 54 { 53 55 ar & sampled_potential; 54 ar & e_long; 56 if (version > 0) 57 ar & nuclei_long; 58 ar & electron_long; 55 59 } 56 60 }; 61 62 BOOST_CLASS_VERSION(VMGData, 1) 57 63 58 64 std::ostream & operator<<(std::ostream &ost, const VMGData &data); -
src/Fragmentation/Summation/Containers/VMGDataFused.hpp
r5281ff re2925fd 27 27 struct sampled_potential {}; 28 28 struct energy_potential {}; 29 struct energy_long {}; 29 struct nuclei_long {}; 30 struct electron_long {}; 30 31 31 32 // keys for longrange … … 35 36 struct nuclei_longrange {}; 36 37 struct nuclei_shortrange {}; 38 struct mixed_longrange {}; 39 struct mixed_shortrange {}; 37 40 struct total_longrange {}; 38 41 struct total_shortrange {}; -
src/Fragmentation/Summation/Containers/VMGDataMap.hpp
r5281ff re2925fd 32 32 boost::fusion::pair<VMGDataFused::sampled_potential, SamplingGrid >, 33 33 boost::fusion::pair<VMGDataFused::energy_potential, double >, 34 boost::fusion::pair<VMGDataFused::energy_long, double > 34 boost::fusion::pair<VMGDataFused::nuclei_long, double >, 35 boost::fusion::pair<VMGDataFused::electron_long, double > 35 36 > VMGDataMap_t; 36 37 … … 38 39 VMGDataFused::sampled_potential, 39 40 VMGDataFused::energy_potential, 40 VMGDataFused::energy_long 41 VMGDataFused::nuclei_long, 42 VMGDataFused::electron_long 41 43 > VMGDataVector_t; 42 44 … … 51 53 boost::fusion::pair<VMGDataFused::electron_longrange, double >, 52 54 boost::fusion::pair<VMGDataFused::electron_shortrange, double >, 55 boost::fusion::pair<VMGDataFused::mixed_longrange, double >, 56 boost::fusion::pair<VMGDataFused::mixed_shortrange, double >, 53 57 boost::fusion::pair<VMGDataFused::nuclei_longrange, double >, 54 58 boost::fusion::pair<VMGDataFused::nuclei_shortrange, double >, … … 60 64 VMGDataFused::electron_longrange, 61 65 VMGDataFused::electron_shortrange, 66 VMGDataFused::mixed_longrange, 67 VMGDataFused::mixed_shortrange, 62 68 VMGDataFused::nuclei_longrange, 63 69 VMGDataFused::nuclei_shortrange, -
src/Fragmentation/Summation/Containers/VMGData_printKeyNames.hpp
r5281ff re2925fd 36 36 (sampled_potential) \ 37 37 (energy_potential) \ 38 (energy_long) \ 38 (nuclei_long) \ 39 (electron_long) \ 39 40 (electron_longrange) \ 40 41 (electron_shortrange) \ 42 (mixed_longrange) \ 43 (mixed_shortrange) \ 41 44 (nuclei_longrange) \ 42 45 (nuclei_shortrange) \ -
src/Fragmentation/Summation/Converter/DataConverter.hpp
r5281ff re2925fd 90 90 boost::fusion::at_key<VMGDataFused::sampled_potential>(instance) = extractedData.sampled_potential; 91 91 boost::fusion::at_key<VMGDataFused::energy_potential>(instance) = extractedData.sampled_potential.integral(); 92 boost::fusion::at_key<VMGDataFused::energy_long>(instance) = extractedData.e_long; 92 boost::fusion::at_key<VMGDataFused::nuclei_long>(instance) = extractedData.nuclei_long; 93 boost::fusion::at_key<VMGDataFused::electron_long>(instance) = extractedData.electron_long; 93 94 VMGData_fused.insert( std::make_pair(dataiter->first, instance) ); 94 95 }
Note:
See TracChangeset
for help on using the changeset viewer.