diff options
author | allen <allen@6a38eb6e-646e-4a02-a296-d141613ad6c4> | 1999-09-11 14:33:14 +0000 |
---|---|---|
committer | allen <allen@6a38eb6e-646e-4a02-a296-d141613ad6c4> | 1999-09-11 14:33:14 +0000 |
commit | a980b3aa387f6371b7307cba6066a7f40be79b6b (patch) | |
tree | 8ac66f0ef69035e57da386482ae3707a2f7ef6cf /src/FlatBoundary.c | |
parent | 5d2f67b5537ddf630fc98c21763e3c2a670ac402 (diff) |
Fixed a few small bugs which pop up in bizarre circumstances because
a > should have been a >=
Added Constant Boundary conditions, but I will change the name for
this as soon as I think of a better one (you give it a value e.g. zero
and it will apply it at every point of the boundary, so it doesn't
have to be constant).
Change so that the routines now return an error code if they don't
apply the boundary condition, they give a warning level 1 instead
of a warning level 0. (This needs to be added to the routine actually
applying the radiation boundary conditions still).
You will need to change/update any thorns with make calls to the
Cactus outer boundary routines.
git-svn-id: http://svn.cactuscode.org/arrangements/CactusBase/Boundary/trunk@20 6a38eb6e-646e-4a02-a296-d141613ad6c4
Diffstat (limited to 'src/FlatBoundary.c')
-rw-r--r-- | src/FlatBoundary.c | 18 |
1 files changed, 14 insertions, 4 deletions
diff --git a/src/FlatBoundary.c b/src/FlatBoundary.c index b1a4fb3..311c943 100644 --- a/src/FlatBoundary.c +++ b/src/FlatBoundary.c @@ -47,7 +47,7 @@ void ApplyFlat3D(cGH *GH,int *doBC,int *lsh,int *stencil_size,CCTK_REAL *var); /* Call with implementation::group notation, eg: ApplyFlatBC(admgerd::metric) */ -void ApplyFlatBC(cGH *GH, int *stencil_size, char *name) { +int ApplyFlatBC(cGH *GH, int *stencil_size, char *name) { DECLARE_CCTK_PARAMETERS @@ -58,7 +58,8 @@ void ApplyFlatBC(cGH *GH, int *stencil_size, char *name) { int *doBC; /* flags if lower/upper BCs are applied (1) or not (0) indexing is as in bbox: 0 lower 1 upper */ - + int retval; /* negative if condition not applied */ + /* Get the pointer to the SymmetryGHextension */ sGHex = (SymmetryGHex*)GH->extensions[CCTK_GHExtensionHandle("Symmetry")]; @@ -87,6 +88,8 @@ void ApplyFlatBC(cGH *GH, int *stencil_size, char *name) { name); CCTK_WARN(1,message); free(message); + retval = -1; + return retval; } } } @@ -102,7 +105,11 @@ void ApplyFlatBC(cGH *GH, int *stencil_size, char *name) { first = CCTK_FirstVarIndexI(num); last = first+CCTK_NumVarsInGroupI(num)-1; if (first == -1 || last == -1) + { CCTK_WARN(0,"Invalid group number used"); + retval = -1; + return retval; + } } else { @@ -141,18 +148,21 @@ void ApplyFlatBC(cGH *GH, int *stencil_size, char *name) { else { CCTKi_NotYetImplemented("Flat boundaries in other than 3D"); + retval = -1; + return retval; } } } if (doBC) free(doBC); + } -void FMODIFIER FORTRAN_NAME(ApplyFlatBC)(cGH *GH, int *stencil_size, ONE_FORTSTRING_ARG) { +void FMODIFIER FORTRAN_NAME(ApplyFlatBC)(int retval, cGH *GH, int *stencil_size, ONE_FORTSTRING_ARG) { ONE_FORTSTRING_CREATE(name) - ApplyFlatBC(GH,stencil_size,name); + retval = ApplyFlatBC(GH,stencil_size,name); free(name); } |