aboutsummaryrefslogtreecommitdiff
path: root/src/RadiationBoundary.c
diff options
context:
space:
mode:
authorlanfer <lanfer@6a38eb6e-646e-4a02-a296-d141613ad6c4>1999-10-08 14:48:48 +0000
committerlanfer <lanfer@6a38eb6e-646e-4a02-a296-d141613ad6c4>1999-10-08 14:48:48 +0000
commit04c1e8245791267a59e2534158ff672166e67f1f (patch)
treeb55e74d14dc0a6a215c4fb1d2f0812324d0cb6aa /src/RadiationBoundary.c
parent8598c59173c79dabf9bf4fe769e94c503b0165ac (diff)
added comments
git-svn-id: http://svn.cactuscode.org/arrangements/CactusBase/Boundary/trunk@32 6a38eb6e-646e-4a02-a296-d141613ad6c4
Diffstat (limited to 'src/RadiationBoundary.c')
-rw-r--r--src/RadiationBoundary.c68
1 files changed, 68 insertions, 0 deletions
diff --git a/src/RadiationBoundary.c b/src/RadiationBoundary.c
index 706979a..c65f971 100644
--- a/src/RadiationBoundary.c
+++ b/src/RadiationBoundary.c
@@ -1,6 +1,74 @@
#include "cctk.h"
#include "cctk_parameters.h"
+/*@@
+ @file RadiationBoundary.F
+ @date Mon Mar 15 15:50:14 1999
+ @author Gerd Lanfermann
+ @desc
+ File contains the C routine, which performs the
+ actual GF field assignments for the radiation boundaries.
+ Since this is now in C, there is really now reason to have
+ the wrapper around. Anyhow, for now we keep this struture.
+ @enddesc
+@@*/
+
+
+
+/*@@
+ @routine RadiativeBC
+ @date Mon Mar 15 15:51:57 1999
+ @author Miguel Alcubierre
+ @desc
+ Implements radiative boundary condition.
+ The boundary condition that is implemented is:
+
+
+ f = f0 + u(r - v0*t) / r
+
+
+ which leads to the differential equation:
+
+
+ (x / r) d f + v d f + v0 x (f - f0) / r^2 = 0
+ i t i i
+
+ where xi is the normal direction to the given boundaries.
+
+ That is, I assume outgoing radial waves with the correct 1/r
+ fall off, and the correct asymptotic value f0 (f0 = 1 for
+ diagonal metric components, and f0 = 0 for everything else),
+ but at a given boundary I only worry about derivatives in
+ the normal direction. This works very well.
+
+ The only problem with this condition is that it does not
+ use the physical characteristic speed, but rather it assumes
+ a wave speed of v0, so the boundaries should be out in
+ the region where the characteristic speed is constant.
+ Notice that this speed does not have to be 1. For gauge
+ quantities {alpha,phi,trK} we can have a different asymptotic
+ speed, which is why the value of v0 is passed as a parameter.
+
+
+ Some remarks on the C version for Fortran programmers:
+ this is 1:1 translation of the
+ F code, which used the very nice looking F array assignments
+ x(2,:,:), etc. In C this needs to written as loops, but to
+ my surprise it doesn;t look to bad actually. F statments like
+ x(1,:,:) becomes x(xgp0) (the integer index "xgp0" meaning
+ the zero'th gridpoint from the boundary), x(2,:,:) --> x(xgp1), where:
+ xgp0 = CCTK_GFINDEX3D(GH,0,j,k)
+ xgp1 = CCTK_GFINDEX3D(GH,1,j,k) and i,j are looping of the grid sizes.
+
+ @enddesc
+ @calls
+ @calledby
+ @history Cactus 4.0 by Gerd Lanfermann
+
+ @endhistory
+@@*/
+
+
#define SQR(a) ((a)*(a))
void RadiativeBC(cGH *GH, int *doBC, int *sw, int *lsh, int *dxyz, int dt,