- 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)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
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 }
Note:
See TracChangeset
for help on using the changeset viewer.