diff options
Diffstat (limited to 'CarpetDev/CarpetAdaptiveRegrid')
-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; } } |