diff options
Diffstat (limited to 'src/WaveBinary.c')
-rw-r--r-- | src/WaveBinary.c | 23 |
1 files changed, 11 insertions, 12 deletions
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<binary_size*binary_size) - phi_n[index] = phi_n[index] + charge_factor; + { + phi[index] = phi[index] + charge_factor; + } } + } + } } /* end of the sign loop */ } - /* reset firstcall to zero */ firstcall = 0; |