aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authortradke <tradke@90eea020-d82d-4da5-bf6e-4ee79ff7632f>2004-06-21 09:12:24 +0000
committertradke <tradke@90eea020-d82d-4da5-bf6e-4ee79ff7632f>2004-06-21 09:12:24 +0000
commit9f5d8476ea4381b681a678bb7928c8b864e3d55c (patch)
tree6790c8b92a89abad10d2aaca60c46de6a9cc40e2
parent10ebc5a3c771b8c7ff239ed33838f9f63e2662c0 (diff)
Renamed local variable 'index' to 'vindex' to get rid of gcc compiler warnings
about naming variables after global functions. git-svn-id: http://svn.cactuscode.org/arrangements/CactusWave/WaveToyC/trunk@110 90eea020-d82d-4da5-bf6e-4ee79ff7632f
-rw-r--r--src/WaveToy.c97
1 files changed, 42 insertions, 55 deletions
diff --git a/src/WaveToy.c b/src/WaveToy.c
index 217cb8f..f9ad97f 100644
--- a/src/WaveToy.c
+++ b/src/WaveToy.c
@@ -1,14 +1,14 @@
/*@@
- @file WaveToy.c
- @date
- @author Tom Goodale
- @desc
- Evolution routines for the wave equation solver
- @enddesc
- @version $Header$
+ @file WaveToy.c
+ @date
+ @author Tom Goodale
+ @desc
+ Evolution routines for the wave equation solver
+ @enddesc
+ @version $Id$
@@*/
-
+
#include "cctk.h"
#include "cctk_Arguments.h"
#include "cctk_Parameters.h"
@@ -21,25 +21,21 @@ void WaveToyC_Boundaries(CCTK_ARGUMENTS);
void WaveToyC_Evolution(CCTK_ARGUMENTS);
/*@@
- @routine WaveToyC_Evolution
- @date
- @author Tom Goodale
- @desc
- Evolution for the wave equation
- @enddesc
- @calls CCTK_SyncGroup, WaveToyC_Boundaries
- @calledby
- @history
- @endhistory
+ @routine WaveToyC_Evolution
+ @date
+ @author Tom Goodale
+ @desc
+ Evolution for the wave equation
+ @enddesc
+ @calls CCTK_SyncGroup, WaveToyC_Boundaries
@@*/
void WaveToyC_Evolution(CCTK_ARGUMENTS)
{
+ DECLARE_CCTK_ARGUMENTS
- DECLARE_CCTK_ARGUMENTS;
-
int i,j,k;
- int index;
+ int vindex;
int istart, jstart, kstart, iend, jend, kend;
CCTK_REAL dx,dy,dz,dt,dx2,dy2,dz2,dt2;
CCTK_REAL dx2i,dy2i,dz2i;
@@ -64,7 +60,7 @@ void WaveToyC_Evolution(CCTK_ARGUMENTS)
istart = 1;
jstart = 1;
kstart = 1;
-
+
iend = cctk_lsh[0]-1;
jend = cctk_lsh[1]-1;
kend = cctk_lsh[2]-1;
@@ -78,65 +74,56 @@ void WaveToyC_Evolution(CCTK_ARGUMENTS)
{
for (i=istart; i<iend; i++)
{
- index = CCTK_GFINDEX3D(cctkGH,i,j,k);
-
- phi[index] = factor*
- phi_p[index] - phi_p_p[index]
- + (dt2) *
+ vindex = CCTK_GFINDEX3D(cctkGH,i,j,k);
+
+ phi[vindex] = factor*
+ phi_p[vindex] - phi_p_p[vindex]
+ + (dt2) *
( ( phi_p[CCTK_GFINDEX3D(cctkGH,i+1,j ,k )]
+phi_p[CCTK_GFINDEX3D(cctkGH,i-1,j ,k )] )*dx2i
+( phi_p[CCTK_GFINDEX3D(cctkGH,i ,j+1,k )]
+phi_p[CCTK_GFINDEX3D(cctkGH,i ,j-1,k )] )*dy2i
+( phi_p[CCTK_GFINDEX3D(cctkGH,i ,j ,k+1)]
+phi_p[CCTK_GFINDEX3D(cctkGH,i ,j, k-1)] )*dz2i);
- }
+ }
}
}
-
- return;
}
/*@@
- @routine WaveToyC_Boundaries
- @date
- @author Tom Goodale
- @desc
- Boundary conditions for the wave equation
- @enddesc
- @history
- @endhistory
+ @routine WaveToyC_Boundaries
+ @date
+ @author Tom Goodale
+ @desc
+ Boundary conditions for the wave equation
+ @enddesc
@@*/
void WaveToyC_Boundaries(CCTK_ARGUMENTS)
{
- DECLARE_CCTK_ARGUMENTS;
- DECLARE_CCTK_PARAMETERS;
+ DECLARE_CCTK_ARGUMENTS
+ DECLARE_CCTK_PARAMETERS
- int ierr;
+ const char *bctype;
- ierr = 0;
- if (CCTK_EQUALS(bound,"flat") || CCTK_EQUALS(bound,"static") ||
- CCTK_EQUALS(bound,"radiation") || CCTK_EQUALS(bound,"robin") ||
+ bctype = NULL;
+ if (CCTK_EQUALS(bound,"flat") || CCTK_EQUALS(bound,"static") ||
+ CCTK_EQUALS(bound,"radiation") || CCTK_EQUALS(bound,"robin") ||
CCTK_EQUALS(bound,"none"))
{
- /* Uses all default arguments, so invalid table handle -1 can be passed */
- ierr = Boundary_SelectVarForBC(cctkGH, CCTK_ALL_FACES, 1, -1,
- "wavetoy::phi", bound);
+ bctype = bound;
}
else if (CCTK_EQUALS(bound,"zero"))
{
- /* Uses all default arguments, so invalid table handle -1 can be passed */
- ierr = Boundary_SelectVarForBC
- (cctkGH, CCTK_ALL_FACES, 1, -1, "wavetoy::phi", "scalar");
-
+ bctype = "scalar";
}
- if (ierr < 0)
+ /* Uses all default arguments, so invalid table handle -1 can be passed */
+ if (bctype && Boundary_SelectVarForBC (cctkGH, CCTK_ALL_FACES, 1, -1,
+ "wavetoy::phi", bctype) < 0)
{
- CCTK_WARN(0,"WaveToyC_Boundaries: Error selecting boundary condition");
+ CCTK_WARN (0, "WaveToyC_Boundaries: Error selecting boundary condition");
}
-
- return;
}