aboutsummaryrefslogtreecommitdiff
path: root/src/Utils.c
diff options
context:
space:
mode:
authortradke <tradke@b32723a9-ab3a-4a60-88e2-2e5d99d7c17a>2001-05-08 22:31:37 +0000
committertradke <tradke@b32723a9-ab3a-4a60-88e2-2e5d99d7c17a>2001-05-08 22:31:37 +0000
commitab19e2985ec795b93f394d7216fd021cb2116e71 (patch)
treeb6941395f77afa89ed7be9e090d82018a6ae2898 /src/Utils.c
parent2671a533ca99b434598f67ec3dc78463681fb504 (diff)
Also set the slice center if there's no coordinate system registered.
In this case it will take the values from the out_[xyz]line_[xyz]i parameters. git-svn-id: http://svn.cactuscode.org/arrangements/CactusBase/IOUtil/trunk@119 b32723a9-ab3a-4a60-88e2-2e5d99d7c17a
Diffstat (limited to 'src/Utils.c')
-rw-r--r--src/Utils.c46
1 files changed, 23 insertions, 23 deletions
diff --git a/src/Utils.c b/src/Utils.c
index 3385fb5..62f125b 100644
--- a/src/Utils.c
+++ b/src/Utils.c
@@ -24,7 +24,7 @@ CCTK_FILEVERSION(CactusBase_IOUtil_Utils_c)
/* uncomment this if you want some debugging output */
-/* #define DEBUG_IOUTIL 1 */
+#define DEBUG_IOUTIL 1
/*@@
@@ -39,7 +39,8 @@ CCTK_FILEVERSION(CactusBase_IOUtil_Utils_c)
of that line on the grid.
@enddesc
- @calls CCTK_CoordRange
+ @calls CCTK_CoordSystemHandle
+ CCTK_CoordRange
@var GH
@vdesc Pointer to CCTK GH
@@ -69,8 +70,7 @@ CCTK_FILEVERSION(CactusBase_IOUtil_Utils_c)
@returntype int
@returndesc
- 0 for success
- -1 no coordinate system of given dimensions found
+ 0 for success
@endreturndesc
@@*/
int IOUtil_1DLines (cGH *GH,
@@ -85,33 +85,33 @@ int IOUtil_1DLines (cGH *GH,
CCTK_REAL *lower_range, *upper_range;
- /* get the appropriate coordinate system name */
- sprintf (system_name, "cart%dd", num_dims);
-
- if (CCTK_CoordSystemHandle (system_name) < 0)
- {
- CCTK_VWarn (4, __LINE__, __FILE__, CCTK_THORNSTRING,
- "IOUtil_1DLines: Cartesian coordinate system '%s' not found",
- system_name);
- return (-1);
- }
-
/* allocate arrays for ranges */
lower_range = (CCTK_REAL *) calloc (2 * num_dims, sizeof (CCTK_REAL));
upper_range = lower_range + num_dims;
- /* get the ranges in every direction */
- for (dir = 0; dir < num_dims; dir++)
+ /* get the appropriate coordinate system name */
+ sprintf (system_name, "cart%dd", num_dims);
+ if (CCTK_CoordSystemHandle (system_name) >= 0)
{
- if (CCTK_CoordRange (GH, &lower_range[dir], &upper_range[dir],
- dir + 1, NULL, system_name) < 0)
+ /* get the ranges in every direction */
+ for (dir = 0; dir < num_dims; dir++)
{
- CCTK_VWarn (1, __LINE__, __FILE__, CCTK_THORNSTRING,
- "IOUtil_1DLines: Could not get ranges for %c-direction "
- "of coordinate system '%s'",
- 'x' + dir, system_name);
+ if (CCTK_CoordRange (GH, &lower_range[dir], &upper_range[dir],
+ dir + 1, NULL, system_name) < 0)
+ {
+ CCTK_VWarn (1, __LINE__, __FILE__, CCTK_THORNSTRING,
+ "IOUtil_1DLines: Could not get ranges for %c-direction "
+ "of coordinate system '%s'",
+ 'x' + dir, system_name);
+ }
}
}
+ else
+ {
+ CCTK_VWarn (4, __LINE__, __FILE__, CCTK_THORNSTRING,
+ "IOUtil_1DLines: Cartesian coordinate system '%s' not found",
+ system_name);
+ }
/* now set the slice center for each line
according to origin_index[] or origin_phys[] */