aboutsummaryrefslogtreecommitdiff
path: root/CarpetDev
diff options
context:
space:
mode:
authorIan Hawke <ih@maths.soton.ac.uk>2005-02-23 10:59:00 +0000
committerIan Hawke <ih@maths.soton.ac.uk>2005-02-23 10:59:00 +0000
commit6a4554e27d8217384ca2a9871cd1a15ca4626da3 (patch)
treedd3dc84995b1ce973eddb36ac159072f123e07ce /CarpetDev
parentaff1543fe0db8bbda76f08a8ab8b69ac9d407764 (diff)
CarpetAdaptiveRegrid: Correct striding correction
darcs-hash:20050223105949-58c7f-e087970950767cb32adb21fc617d7789a6b988ec.gz
Diffstat (limited to 'CarpetDev')
-rw-r--r--CarpetDev/CarpetAdaptiveRegrid/src/CAR.cc16
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;
}
}