diff options
author | Ian Hawke <ih@maths.soton.ac.uk> | 2005-02-23 10:59:00 +0000 |
---|---|---|
committer | Ian Hawke <ih@maths.soton.ac.uk> | 2005-02-23 10:59:00 +0000 |
commit | 6a4554e27d8217384ca2a9871cd1a15ca4626da3 (patch) | |
tree | dd3dc84995b1ce973eddb36ac159072f123e07ce /CarpetDev/CarpetAdaptiveRegrid/src/CAR.cc | |
parent | aff1543fe0db8bbda76f08a8ab8b69ac9d407764 (diff) |
CarpetAdaptiveRegrid: Correct striding correction
darcs-hash:20050223105949-58c7f-e087970950767cb32adb21fc617d7789a6b988ec.gz
Diffstat (limited to 'CarpetDev/CarpetAdaptiveRegrid/src/CAR.cc')
-rw-r--r-- | CarpetDev/CarpetAdaptiveRegrid/src/CAR.cc | 16 |
1 files changed, 7 insertions, 9 deletions
diff --git a/CarpetDev/CarpetAdaptiveRegrid/src/CAR.cc b/CarpetDev/CarpetAdaptiveRegrid/src/CAR.cc index 9c773abf7..80ccb1e9e 100644 --- a/CarpetDev/CarpetAdaptiveRegrid/src/CAR.cc +++ b/CarpetDev/CarpetAdaptiveRegrid/src/CAR.cc @@ -683,16 +683,14 @@ namespace CarpetAdaptiveRegrid { // Check that the striding is correct. - rvect remainder = (up - lo) / str - floor( (up - lo) / str ); + CCTK_REAL remainder = fmod((up[d] - lo[d]), str[d])/str[d]; - for (int d=0; d < dim; ++d) { - if ( abs(remainder[d]) > 1.e-6 ) { - if (ob[d][0]) { - up[d] += str[d] * (1 - remainder[d]); - } - else if (ob[d][1]) { - lo[d] -= str[d] * remainder[d]; - } + if ( abs(remainder) > 1.e-6 ) { + if (ob[d][0]) { + up[d] += str[d] * (1 - remainder); + } + else if (ob[d][1]) { + lo[d] -= str[d] * remainder; } } |