diff options
author | schnetter <> | 2001-12-07 17:23:00 +0000 |
---|---|---|
committer | schnetter <> | 2001-12-07 17:23:00 +0000 |
commit | ebab24bb787677c6b9a726817009c069ac493307 (patch) | |
tree | 60759ac72616c64a517b10121133111673ee50d8 /Carpet/CarpetIOASCII/src | |
parent | ab9dc2cc1a9e053d137f57728f7d83f0c022ca36 (diff) |
Made ASCII output line/plane selection more convenient. Should now
Made ASCII output line/plane selection more convenient. Should now
always select a location that also exists on the coarse grid, and
hence output the same location on all grids.
darcs-hash:20011207172329-07bb3-edb52e32772499e544cb4e0c4bb550b8113f5c2c.gz
Diffstat (limited to 'Carpet/CarpetIOASCII/src')
-rw-r--r-- | Carpet/CarpetIOASCII/src/ioascii.cc | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/Carpet/CarpetIOASCII/src/ioascii.cc b/Carpet/CarpetIOASCII/src/ioascii.cc index 77178ca90..a309203a3 100644 --- a/Carpet/CarpetIOASCII/src/ioascii.cc +++ b/Carpet/CarpetIOASCII/src/ioascii.cc @@ -24,7 +24,7 @@ #include "ioascii.hh" -static const char* rcsid = "$Header: /home/eschnett/C/carpet/Carpet/Carpet/CarpetIOASCII/src/ioascii.cc,v 1.22 2001/12/05 16:30:29 schnetter Exp $"; +static const char* rcsid = "$Header: /home/eschnett/C/carpet/Carpet/Carpet/CarpetIOASCII/src/ioascii.cc,v 1.23 2001/12/07 18:23:29 schnetter Exp $"; @@ -429,9 +429,9 @@ int CarpetIOASCII<outdim> template<int outdim> int CarpetIOASCII<outdim> -::GetGridOffset (const cGH* cgh, int dir, - const char* itempl, const char* iglobal, - const char* ctempl, const char* cglobal, +::GetGridOffset (const cGH* const cgh, const int dir, + const char* const itempl, const char* const iglobal, + const char* const ctempl, const char* const cglobal, const CCTK_REAL cfallback) { // First choice: explicit coordinate @@ -501,7 +501,8 @@ int CarpetIOASCII<outdim> const int npoints = cgh->cctk_gsh[dir-1]; const CCTK_REAL rindex = (coord - lower) / (upper - lower) * (npoints-1); - int cindex = (int)floor(rindex + 0.5 + 1e-6); + const int levfac = cgh->cctk_levfac[dir-1]; + int cindex = (int)floor(rindex / levfac + 0.5 + 1e-6) * levfac; if (cindex<0 || cindex>=npoints) { CCTK_VWarn (1, __LINE__, __FILE__, CCTK_THORNSTRING, |