Changeset a1eeb3
- Timestamp:
- Jun 9, 2016, 6:32:25 PM (9 years ago)
- Parents:
- e2fd2c
- git-author:
- Frederik Heber <heber@…> (06/07/16 08:00:51)
- git-committer:
- Frederik Heber <heber@…> (06/09/16 18:32:25)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
src/Fragmentation/Summation/Containers/FragmentationLongRangeResults.cpp
re2fd2c ra1eeb3 172 172 // first we obtain the full e-e energy as potential times charge on the 173 173 // respective level. 174 const SamplingGrid &charge_weight = 175 boost::fusion::at_key<MPQCDataFused::sampled_grid>(Result_Grid_fused[level-1]); 174 const SamplingGrid &charge_weight = full_sample[level-1]; 176 175 SamplingGrid full_sample_solution = fullsolutionData[level-1].sampled_potential; 177 176 full_sample_solution *= charge_weight; … … 183 182 boost::fusion::at_key<VMGDataFused::sampled_potential>(Result_GridLongRange_fused[level-1]); 184 183 double electron_short_range_energy = short_range_correction.integral(); 185 full_sample_solution -= short_range_correction;186 184 electron_solution_energy -= electron_short_range_energy; 187 ASSERT( fabs(electron_solution_energy - full_sample_solution.integral()) < 1e-7, 188 "FragmentationLongRangeResults::operator() - integral and energy are not exchangeable."); 185 #ifndef NDEBUG 186 { 187 static const double round_offset( 188 (std::numeric_limits<size_t>::round_style == std::round_toward_zero) ? 189 0.5 : 0.); // need offset to get to round_toward_nearest behavior 190 // we can only check equivalence if both have same level, otherwise 191 // short_range_correction.integral() has higher precision because of finger grid 192 const int surplus_level = full_sample_solution.getSurplusLevel(short_range_correction)+round_offset; 193 if (full_sample_solution.level == short_range_correction.level+surplus_level) { 194 SamplingGrid check_difference_full_solution = full_sample_solution; 195 check_difference_full_solution -= short_range_correction; 196 ASSERT( fabs(electron_solution_energy - check_difference_full_solution.integral()) < 1e-7, 197 "FragmentationLongRangeResults::operator() - integral and energy are not exchangeable."); 198 } 199 } 200 #endif 189 201 190 202 // then, we obtain the e-n+n-n full solution in the same way
Note:
See TracChangeset
for help on using the changeset viewer.