aboutsummaryrefslogtreecommitdiff
path: root/src/RadiationBoundary.c
diff options
context:
space:
mode:
authorrideout <rideout@6a38eb6e-646e-4a02-a296-d141613ad6c4>2002-12-29 17:03:37 +0000
committerrideout <rideout@6a38eb6e-646e-4a02-a296-d141613ad6c4>2002-12-29 17:03:37 +0000
commit8f154b55e17ffe1a01b8388751827d0cccdc475b (patch)
treefd5f8ff4c6fe7ea94ec38574a1a66fab9366feeb /src/RadiationBoundary.c
parent6723531f97ceaa24d9dc246bc07d65ff8acd09ad (diff)
Implementation of new boundary condition spec described on the
cactuscode.org development web page. Registers a routine implementing radiative boundary conditions under the boundary condition name "Radiative". The registered routine is a wrapper for the existing radiative boundary conditions. For the moment this uses hard-wired parameters, and calls BndRadiativeVI() sequentially on each variable requested for radiative boundary conditions. git-svn-id: http://svn.cactuscode.org/arrangements/CactusBase/Boundary/trunk@186 6a38eb6e-646e-4a02-a296-d141613ad6c4
Diffstat (limited to 'src/RadiationBoundary.c')
-rw-r--r--src/RadiationBoundary.c86
1 files changed, 84 insertions, 2 deletions
diff --git a/src/RadiationBoundary.c b/src/RadiationBoundary.c
index 8cd220d..4eb2e5f 100644
--- a/src/RadiationBoundary.c
+++ b/src/RadiationBoundary.c
@@ -79,12 +79,93 @@
/* the rcs ID and its dummy function to use it */
static const char *rcsid = "$Header$";
-CCTK_FILEVERSION(CactusBase_Boundary_RadiationBoundary_c)
-
+CCTK_FILEVERSION(CactusBase_Boundary_RadiationBoundary_c);
/********************************************************************
******************** External Routines ************************
********************************************************************/
+
+/*@@
+ @routine BndRadiative
+ @date 6 Nov 2002
+ @author David Rideout
+ @desc
+ Top level function which is registered as handling
+ this boundary condition
+ @enddesc
+ @calls BndRadiativeVI, for the moment
+ @history
+ Perliminary version for testing, simply calls BndRadiativeVI
+ with hardwired arguments
+ @endhistory
+ @var GH
+ @vdesc Pointer to CCTK grid hierarchy
+ @vtype const cGH *
+ @vio in
+ @endvar
+ @var num_vars
+ @vdesc number of variables passed in through var_indices[]
+ @vtype int
+ @vio in
+ @endvar
+ @var var_indices
+ @vdesc array of variable indicies to which to apply this boundary
+ condition
+ @vtype int *
+ @vio in
+ @endvar
+ @var table_handles
+ @vdesc array of table handles which hold extra arguments
+ @vtype int
+ @vio in
+ @endvar
+ @returntype int
+ @returndesc
+ return code of @seeroutine BndRadiativeVI <BR>
+ |= -16 if valid table handle passed
+ @endreturndesc
+@@*/
+
+int BndRadiative(const cGH *GH, int num_vars, int *var_indices,
+ int *table_handles)
+{
+ int i, retval=0;
+ int sw[3] = {1,1,1};
+
+#ifdef DEBUG
+ printf("BndRadiative(): got passed GH=%p, num_vars=%d, var_indices[0]=%d, table_handles[0]=%d\n", (const void *) GH, num_vars, var_indices[0], table_handles[0]);
+#endif
+
+ /* loop through each variable (Is there some way to take advantage
+ of knowing the entire list of variables ahead of time?) */
+ for (i=0; i<num_vars; ++i) {
+
+ /* Check the input arguments */
+ if (table_handles[i]>=0) {
+ CCTK_VWarn(1, __LINE__, __FILE__, CCTK_THORNSTRING,
+ "Ignoring table handle %d, because parameters are simply "
+ "hardwired at the moment. Please complain.", i);
+ retval |= -16;
+ }
+
+ /* hardwiring: stencil width
+ constant var0 = 0.0
+ wave speed = 1.0
+ same var for from and to */
+ if ((retval = BndRadiativeVI(GH, sw, 0., 1., var_indices[i],
+ var_indices[i])) < 0) {
+ CCTK_VWarn(1, __LINE__, __FILE__, CCTK_THORNSTRING,
+ "BndRadiativeVI() returned %d", retval);
+ }
+ }
+#ifdef DEBUG
+ printf("BndRadiative(): returning %d\n",retval);
+#endif
+
+ return retval;
+}
+
+
/* prototypes for external C routines are declared in header Boundary.h
here only follow the fortran wrapper prototypes */
void CCTK_FCALL CCTK_FNAME (BndRadiativeDirGI)
@@ -153,6 +234,7 @@ void CCTK_FCALL CCTK_FNAME (BndRadiativeVN)
TWO_FORTSTRING_ARG);
+
/********************************************************************
******************** Internal Routines ************************
********************************************************************/