From 273db6bcd613fa4af323b480651618af5fa27f70 Mon Sep 17 00:00:00 2001 From: allen Date: Wed, 18 Apr 2001 20:37:26 +0000 Subject: Updating timelevel names, and some formatting changes. git-svn-id: http://svn.cactuscode.org/arrangements/CactusWave/WaveBinarySource/trunk@17 b9286e40-80fe-41ab-903a-d6b447012e1e --- src/WaveBinary.c | 23 +++++++++++------------ 1 file changed, 11 insertions(+), 12 deletions(-) (limited to 'src/WaveBinary.c') diff --git a/src/WaveBinary.c b/src/WaveBinary.c index 68f1fe9..568df21 100644 --- a/src/WaveBinary.c +++ b/src/WaveBinary.c @@ -4,11 +4,7 @@ /* Using Cactus infrastructure */ #include "cctk.h" - -/* Using Cactus parameters */ #include "cctk_Parameters.h" - -/* Using Cactus arguments lists */ #include "cctk_Arguments.h" int IndexCeilC(cGH *GH, CCTK_REAL coord_value, int d); @@ -17,10 +13,7 @@ int IndexFloorC(cGH *GH, CCTK_REAL coord_value, int d); void WaveBinaryC(CCTK_ARGUMENTS) { - /* Declare variables in argument list */ DECLARE_CCTK_ARGUMENTS - - /* Declare parameters */ DECLARE_CCTK_PARAMETERS int i,j,k,d,index; @@ -45,7 +38,8 @@ void WaveBinaryC(CCTK_ARGUMENTS) /* Because binary_charge and binary_size are a steerable parameters now, charge_factor needs to be recomputed at every iteration. */ - charge_factor = 3.0*binary_charge/(4.0*3.1415*binary_size*binary_size*binary_size); + charge_factor = 3.0*binary_charge/ + (4.0*3.1415*binary_size*binary_size*binary_size); /* Initialize the range arrays */ for (d=0;d<3;d++) @@ -77,8 +71,8 @@ void WaveBinaryC(CCTK_ARGUMENTS) /* calculate the center of a single binary source */ CCTK_CoordRange(cctkGH, &zmin, &zmax, -1, "z", "cart3d"); - xs = sign * binary_radius * cos(binary_omega*cctk_time); - ys = sign * binary_radius * sin(binary_omega*cctk_time); + xs = sign * binary_radius * cos(binary_omega*(cctk_time-cctk_delta_time)); + ys = sign * binary_radius * sin(binary_omega*(cctk_time-cctk_delta_time)); zs = (zmax-zmin)/2 + zmin; /* shortcuts for the physical boundaries of @@ -161,7 +155,9 @@ void WaveBinaryC(CCTK_ARGUMENTS) if (onthisproc==3) { for (k=lowerloc[2];k<=upperloc[2];k++) + { for (j=lowerloc[1];j<=upperloc[1];j++) + { for (i=lowerloc[0];i<=upperloc[0];i++) { index = CCTK_GFINDEX3D(cctkGH,i,j,k); @@ -171,14 +167,17 @@ void WaveBinaryC(CCTK_ARGUMENTS) ((z[index]-zs)*(z[index]-zs)); if (rad