diff options
author | allen <allen@6a38eb6e-646e-4a02-a296-d141613ad6c4> | 2002-08-20 16:02:05 +0000 |
---|---|---|
committer | allen <allen@6a38eb6e-646e-4a02-a296-d141613ad6c4> | 2002-08-20 16:02:05 +0000 |
commit | 42ee5bdbc563cbc3e51768aa5224bcbd4a77c723 (patch) | |
tree | e4f1dbc78ee88388b8a9061645d4168b784f0851 | |
parent | 7dd69aeb929e0bd65e0c828051ecb4cf0e184d9a (diff) |
Check coordinate indices before applying BC
Fixes Cactus/1059
git-svn-id: http://svn.cactuscode.org/arrangements/CactusBase/Boundary/trunk@179 6a38eb6e-646e-4a02-a296-d141613ad6c4
-rw-r--r-- | src/RadiationBoundary.c | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/src/RadiationBoundary.c b/src/RadiationBoundary.c index 2288921..43c59a2 100644 --- a/src/RadiationBoundary.c +++ b/src/RadiationBoundary.c @@ -1345,6 +1345,7 @@ void CCTK_FCALL CCTK_FNAME (BndRadiativeVN) -3 if NULL pointer passed as stencil array -4 if variable type is not supported -5 if variable dimension is other than 3D + -6 if a coordinate is not found @endreturndesc @@*/ static int ApplyBndRadiative (const cGH *GH, @@ -1437,6 +1438,12 @@ static int ApplyBndRadiative (const cGH *GH, { /* Radiative boundaries need the underlying Cartesian coordinates */ coords[i] = GH->data[CCTK_CoordIndex (i + 1, NULL, coord_system_name)][0]; + if (coords[i] < 0) + { + CCTK_VWarn(1,__LINE__,__FILE__,CCTK_THORNSTRING, + "Coordinate for system %s not found",coord_system_name); + return (-6); + } /* According to the Cactus spec, the true delta_space values for a grid are calculated as follows: */ @@ -1446,8 +1453,15 @@ static int ApplyBndRadiative (const cGH *GH, offset[i] = i == 0 ? 1 : offset[i-1] * GH->cctk_lsh[i-1]; } + sprintf (coord_system_name, "spher%dd", gdim); coords[MAXDIM] = GH->data[CCTK_CoordIndex (-1, "r", coord_system_name)][0]; + if (coords[MAXDIM] < 0) + { + CCTK_VWarn(1,__LINE__,__FILE__,CCTK_THORNSTRING, + "Coordinate for system %s not found",coord_system_name); + return (-6); + } /* see if we have a symmetry array */ sGHex = (SymmetryGHex *) CCTK_GHExtension (GH, "Symmetry"); |