Changeset ad6485
- Timestamp:
- Sep 30, 2016, 3:51:12 PM (9 years ago)
- Branches:
- Add_FitFragmentPartialChargesAction, Fix_ChargeSampling_PBC, Fix_FitPartialCharges, Fix_FitPotential_needs_atomicnumbers, Fix_ParseParticles_split_forward_backward_Actions
- Children:
- 89c71f
- Parents:
- 097535
- git-author:
- Frederik Heber <heber@…> (09/20/16 11:06:47)
- git-committer:
- Frederik Heber <heber@…> (09/30/16 15:51:12)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
src/Fragmentation/Summation/SetValues/SamplingGrid.cpp
r097535 rad6485 55 55 #include "LinearAlgebra/Vector.hpp" 56 56 57 #define MYSAMPLINGGRIDEPSILON (1e2*std::numeric_limits<double>::epsilon()) 58 57 59 // static instances 58 60 const double SamplingGrid::zeroOffset[NDIM] = { 0., 0., 0. }; … … 313 315 for (size_t index=0;index<NDIM;++index) { 314 316 begin_window[index] = getNearestLowerGridPoint(_begin_window[index], index); 315 ASSERT( begin_window[index] >= begin[index],317 ASSERT( (begin_window[index] - begin[index]) > -MYSAMPLINGGRIDEPSILON, 316 318 "SamplingGrid::setWindowSize() - window starts earlier than domain on " 317 319 +toString(index)+"th component."); 318 320 end_window[index] = getNearestHigherGridPoint(_end_window[index], index); 319 ASSERT( end_window[index] <= end[index],321 ASSERT( (end_window[index] - end[index]) < MYSAMPLINGGRIDEPSILON, 320 322 "SamplingGrid::setWindowSize() - window ends later than domain on " 321 323 +toString(index)+"th component."); … … 350 352 for(size_t index=0;index < NDIM; ++index) { 351 353 // check that we truly have to extend the window 352 ASSERT ( begin_window[index] >= _begin_window[index],354 ASSERT ( (begin_window[index] - _begin_window[index]) > -MYSAMPLINGGRIDEPSILON, 353 355 "SamplingGrid::extendWindow() - component "+toString(index)+ 354 356 " of window start is greater than old value."); 355 ASSERT ( end_window[index] <= _end_window[index],357 ASSERT ( (end_window[index] - _end_window[index]) < MYSAMPLINGGRIDEPSILON, 356 358 "SamplingGrid::extendWindow() - component "+toString(index)+ 357 359 " of window end is less than old value."); 358 360 359 361 // check that we are still less than domain 360 ASSERT ( _begin_window[index] >= begin[index],362 ASSERT ( (_begin_window[index] - begin[index]) > -MYSAMPLINGGRIDEPSILON, 361 363 "SamplingGrid::extendWindow() - component "+toString(index)+ 362 364 " of window start is less than domain start."); 363 ASSERT ( _end_window[index] <= end[index],365 ASSERT ( (_end_window[index] - end[index]) < MYSAMPLINGGRIDEPSILON, 364 366 "SamplingGrid::extendWindow() - component "+toString(index)+ 365 367 " of window end is greater than domain end."); … … 388 390 for(size_t index=0;index < NDIM; ++index) { 389 391 // check that we truly have to shrink the window 390 ASSERT ( begin_window[index] <= _begin_window[index],392 ASSERT ( (begin_window[index] - _begin_window[index]) > -MYSAMPLINGGRIDEPSILON, 391 393 "SamplingGrid::shrinkWindow() - component "+toString(index)+ 392 394 " of window start is less than old value."); 393 ASSERT ( end_window[index] >= _end_window[index],395 ASSERT ( (end_window[index] - _end_window[index]) < MYSAMPLINGGRIDEPSILON, 394 396 "SamplingGrid::shrinkWindow() - component "+toString(index)+ 395 397 " of window end is greater than old value."); 396 398 397 399 // check that we are still less than domain 398 ASSERT ( _begin_window[index] >= begin[index],400 ASSERT ( (_begin_window[index] - begin[index]) > -MYSAMPLINGGRIDEPSILON, 399 401 "SamplingGrid::shrinkWindow() - component "+toString(index)+ 400 402 " of window start is less than domain start."); 401 ASSERT ( _end_window[index] <= end[index],403 ASSERT ( (_end_window[index] - end[index]) < MYSAMPLINGGRIDEPSILON, 402 404 "SamplingGrid::shrinkWindow() - component "+toString(index)+ 403 405 " of window end is greater than domain end."); … … 485 487 } 486 488 // total is used as safe-guard against loss due to discrete conversion 487 ASSERT( (_wend[index] - _wbegin[index]) == _wlength[index],489 ASSERT( fabs(_wend[index] - _wbegin[index] - _wlength[index]) < MYSAMPLINGGRIDEPSILON, 488 490 "SamplingGrid::getDiscreteWindowCopyIndices() - end - begin is not equal to length for " 489 491 +toString(index)+"th component."); … … 573 575 #ifndef NDEBUG 574 576 for(size_t index=0;index<NDIM;++index) { 575 ASSERT( smaller_wbegin[index] >= larger_wbegin[index],577 ASSERT( (smaller_wbegin[index] - larger_wbegin[index]) > -MYSAMPLINGGRIDEPSILON, 576 578 "SamplingGrid::addWindowOntoWindow() - given smaller window starts earlier than larger window in component " 577 579 +toString(index)+"."); 578 ASSERT( smaller_wend[index] <= larger_wend[index],580 ASSERT( (smaller_wend[index] - larger_wend[index]) < MYSAMPLINGGRIDEPSILON, 579 581 "SamplingGrid::addWindowOntoWindow() - given smaller window ends later than larger window in component " 580 582 +toString(index)+".");
Note:
See TracChangeset
for help on using the changeset viewer.