aboutsummaryrefslogtreecommitdiff
path: root/src/FlatBoundary.c
diff options
context:
space:
mode:
authortradke <tradke@6a38eb6e-646e-4a02-a296-d141613ad6c4>2003-07-07 14:54:03 +0000
committertradke <tradke@6a38eb6e-646e-4a02-a296-d141613ad6c4>2003-07-07 14:54:03 +0000
commit7ebb090a5bc6c7d4205733018dd3c93a115fd58f (patch)
treecacb14eece28482011150e2af760573db6aee549 /src/FlatBoundary.c
parent9c96ad2308dc2ec42e6726e2be6bf4e0ba0b14c3 (diff)
Fixed loads of int/CCTK_INT variable type mismatches.
git-svn-id: http://svn.cactuscode.org/arrangements/CactusBase/Boundary/trunk@239 6a38eb6e-646e-4a02-a296-d141613ad6c4
Diffstat (limited to 'src/FlatBoundary.c')
-rw-r--r--src/FlatBoundary.c118
1 files changed, 59 insertions, 59 deletions
diff --git a/src/FlatBoundary.c b/src/FlatBoundary.c
index be758b3..4f9e9e3 100644
--- a/src/FlatBoundary.c
+++ b/src/FlatBoundary.c
@@ -34,16 +34,16 @@ CCTK_FILEVERSION(CactusBase_Boundary_FlatBoundary_c);
static int ApplyBndFlat (const cGH *GH,
int stencil_dir,
- const int *stencil_alldirs,
+ const CCTK_INT *stencil_alldirs,
int dir,
int first_var,
int num_vars);
static int OldApplyBndFlat (const cGH *GH,
- int stencil_dir,
- const int *stencil_alldirs,
- int dir,
- int first_var,
- int num_vars);
+ int stencil_dir,
+ const int *stencil_alldirs,
+ int dir,
+ int first_var,
+ int num_vars);
/********************************************************************
******************** External Routines ************************
@@ -53,8 +53,8 @@ static int OldApplyBndFlat (const cGH *GH,
@date 13 Feb 2003
@author David Rideout
@desc
- Top level function which is registered as handling
- the Flat boundary condition
+ Top level function which is registered as handling
+ the Flat boundary condition
@enddesc
@calls ApplyBndFlat
@@ -65,45 +65,44 @@ static int OldApplyBndFlat (const cGH *GH,
@endvar
@var num_vars
@vdesc number of variables passed in through var_indices[]
- @vtype int
+ @vtype CCTK_INT
@vio in
@endvar
@var var_indices
- @vdesc array of variable indicies to which to apply this boundary
+ @vdesc array of variable indicies to which to apply this boundary
condition
- @vtype int *
+ @vtype CCTK_INT *
@vio in
@endvar
@var faces
@vdesc array of set of faces to which to apply the bc
- @vtype int
+ @vtype CCTK_INT
@vio in
@endvar
@var widths
@vdesc array of boundary widths for each variable
- @vtype int
+ @vtype CCTK_INT
@vio in
@endvar
@var table_handles
@vdesc array of table handles which hold extra arguments
- @vtype int
+ @vtype CCTK_INT
@vio in
@endvar
- @returntype int
+ @returntype CCTK_INT
@returndesc
return code of @seeroutine ApplyBndFlat
-21 error reading boundary width array from table
- -22 wrong size boundary width array in table
+ -22 wrong size boundary width array in table
@endreturndesc
@@*/
-
-int BndFlat(const cGH *GH, int num_vars, int *vars, int *faces, int *widths,
- int *tables)
+CCTK_INT BndFlat(const cGH *GH, CCTK_INT num_vars, CCTK_INT *vars,
+ CCTK_INT *faces, CCTK_INT *widths, CCTK_INT *tables)
{
int i, j, k, gi, gdim, max_gdim, err, retval;
/* variables to pass to ApplyBndFlat */
- int *width_alldirs; /* width of boundary in all directions */
+ CCTK_INT *width_alldirs; /* width of boundary in all directions */
int dir; /* direction in which to apply bc */
retval = 0; width_alldirs = NULL; max_gdim = 0;
@@ -116,10 +115,10 @@ int BndFlat(const cGH *GH, int num_vars, int *vars, int *faces, int *widths,
can do is find variables of the same group which are selected
for identical bcs. If all GFs had the same staggering then we
could groups many GFs together. */
- gi = CCTK_GroupIndexFromVarI (vars[i]);
- while (i+j<num_vars && vars[i+j]==vars[i]+j &&
- CCTK_GroupIndexFromVarI(vars[i+j])==gi && tables[i+j]==tables[i]
- && faces[i+j]==faces[i] && widths[i+j]==widths[i])
+ gi = CCTK_GroupIndexFromVarI (vars[i]);
+ while (i+j<num_vars && vars[i+j]==vars[i]+j &&
+ CCTK_GroupIndexFromVarI(vars[i+j])==gi && tables[i+j]==tables[i]
+ && faces[i+j]==faces[i] && widths[i+j]==widths[i])
{
++j;
}
@@ -128,10 +127,10 @@ int BndFlat(const cGH *GH, int num_vars, int *vars, int *faces, int *widths,
if (faces[i] != CCTK_ALL_FACES)
{
CCTK_VWarn(1, __LINE__, __FILE__, CCTK_THORNSTRING,
- "Faces specification %d for Flat boundary conditions on "
- "%s is not implemented yet. "
- "Applying Flat bcs to all (external) faces.", faces[i],
- CCTK_VarName(vars[i]));
+ "Faces specification %d for Flat boundary conditions on "
+ "%s is not implemented yet. "
+ "Applying Flat bcs to all (external) faces.", faces[i],
+ CCTK_VarName(vars[i]));
}
dir = 0; /* apply bc to all faces */
@@ -140,34 +139,34 @@ int BndFlat(const cGH *GH, int num_vars, int *vars, int *faces, int *widths,
gdim = CCTK_GroupDimI(gi);
if (gdim > max_gdim)
{
- width_alldirs = realloc(width_alldirs, 2*gdim*sizeof(int));
+ width_alldirs = realloc(width_alldirs, 2*gdim*sizeof(CCTK_INT));
max_gdim = gdim;
}
- /* fill it with values, either from table or the boundary_width
+ /* fill it with values, either from table or the boundary_width
parameter */
if (widths[i]<0)
{
- err = Util_TableGetIntArray(tables[i], gdim, width_alldirs,
- "BOUNDARY WIDTH");
+ err = Util_TableGetIntArray(tables[i], gdim, width_alldirs,
+ "BOUNDARY WIDTH");
if (err<0)
{
- CCTK_VWarn(1, __LINE__, __FILE__, CCTK_THORNSTRING,
- "Error %d when reading boundary width array from table "
- "for %s", err, CCTK_VarName(vars[i]));
- return -21;
+ CCTK_VWarn(1, __LINE__, __FILE__, CCTK_THORNSTRING,
+ "Error %d when reading boundary width array from table "
+ "for %s", err, CCTK_VarName(vars[i]));
+ return -21;
} else if (err!=2*gdim)
{
- CCTK_VWarn(1, __LINE__, __FILE__, CCTK_THORNSTRING,
- "Boundary width array for %s has %d elements, but %d "
- "expected", CCTK_VarName(vars[i]), err, 2*gdim);
- return -22;
+ CCTK_VWarn(1, __LINE__, __FILE__, CCTK_THORNSTRING,
+ "Boundary width array for %s has %d elements, but %d "
+ "expected", CCTK_VarName(vars[i]), err, 2*gdim);
+ return -22;
}
} else
{
for (k=0; k<2*gdim; ++k)
{
- width_alldirs[k] = widths[i];
+ width_alldirs[k] = widths[i];
}
}
@@ -175,7 +174,7 @@ int BndFlat(const cGH *GH, int num_vars, int *vars, int *faces, int *widths,
if ((retval = ApplyBndFlat(GH, 0, width_alldirs, dir, vars[i], j)) < 0)
{
CCTK_VWarn(1, __LINE__, __FILE__, CCTK_THORNSTRING,
- "ApplyBndFlat() returned %d", retval);
+ "ApplyBndFlat() returned %d", retval);
}
}
free(width_alldirs);
@@ -876,7 +875,7 @@ void CCTK_FCALL CCTK_FNAME (BndFlatVN)
@endvar
@var in_widths
@vdesc boundary widths for all directions
- @vtype int [ dimension of variable(s) ]
+ @vtype CCTK_INT [ dimension of variable(s) ]
@vio in
@endvar
@var dir
@@ -917,14 +916,14 @@ void CCTK_FCALL CCTK_FNAME (BndFlatVN)
@@*/
static int ApplyBndFlat (const cGH *GH,
int width_dir,
- const int *in_widths,
+ const CCTK_INT *in_widths,
int dir,
int first_var,
int num_vars)
{
int i, j, k;
int var, vtypesize, gindex, gdim, timelvl;
- int doBC[2*MAXDIM], dstag[MAXDIM], lsh[MAXDIM], lssh[MAXDIM],
+ int doBC[2*MAXDIM], dstag[MAXDIM], lsh[MAXDIM], lssh[MAXDIM],
widths[2*MAXDIM];
SymmetryGHex *sGHex;
@@ -966,7 +965,7 @@ static int ApplyBndFlat (const cGH *GH,
else
{
CCTK_WARN (1, "ApplyBndFlat: NULL pointer passed for boundary width "
- "array");
+ "array");
return (-3);
}
@@ -1023,11 +1022,11 @@ static int ApplyBndFlat (const cGH *GH,
#ifdef DEBUG_BOUNDARY
if (doBC[0])
{
- printf("Boundary: Applying lower x flat boundary condition\n");
+ printf("Boundary: Applying lower x flat boundary condition\n");
}
if (doBC[1])
{
- printf("Boundary: Applying upper x flat boundary condition\n");
+ printf("Boundary: Applying upper x flat boundary condition\n");
}
#endif /* DEBUG_BOUNDARY */
/* lower x */
@@ -1043,11 +1042,11 @@ static int ApplyBndFlat (const cGH *GH,
#ifdef DEBUG_BOUNDARY
if (doBC[2])
{
- printf("Boundary: Applying lower y flat boundary condition\n");
+ printf("Boundary: Applying lower y flat boundary condition\n");
}
if (doBC[3])
{
- printf("Boundary: Applying upper y flat boundary condition\n");
+ printf("Boundary: Applying upper y flat boundary condition\n");
}
#endif /* DEBUG_BOUNDARY */
/* lower y */
@@ -1062,11 +1061,11 @@ static int ApplyBndFlat (const cGH *GH,
#ifdef DEBUG_BOUNDARY
if (doBC[4])
{
- printf("Boundary: Applying lower z flat boundary condition\n");
+ printf("Boundary: Applying lower z flat boundary condition\n");
}
if (doBC[5])
{
- printf("Boundary: Applying upper z flat boundary condition\n");
+ printf("Boundary: Applying upper z flat boundary condition\n");
}
#endif /* DEBUG_BOUNDARY */
/* lower z */
@@ -1134,14 +1133,15 @@ static int ApplyBndFlat (const cGH *GH,
@@*/
int OldApplyBndFlat(const cGH *GH, int stencil_dir, const int *stencil_alldirs,
- int dir, int first_var, int num_vars)
+ int dir, int first_var, int num_vars)
{
- int retval, *boundary_widths, dim, i;
+ int dim, i, retval;
+ CCTK_INT *boundary_widths;
static int warned;
/* Convert stencil_alldirs to new format */
dim = CCTK_GroupDimFromVarI(first_var);
- boundary_widths = (int *) malloc(2*dim*sizeof(int));
+ boundary_widths = malloc(2*dim*sizeof(CCTK_INT));
for (i=0; i<2*dim; ++i)
{
boundary_widths[i] = stencil_alldirs[i/2];
@@ -1152,14 +1152,14 @@ int OldApplyBndFlat(const cGH *GH, int stencil_dir, const int *stencil_alldirs,
{
CCTK_VWarn (2, __LINE__, __FILE__, CCTK_THORNSTRING,
"Copied older d-element array of boundary widths into the "
- "newer 2d-element format. Please use the new boundary "
- "interface to avoid this.");
+ "newer 2d-element format. Please use the new boundary "
+ "interface to avoid this.");
warned = 1;
}
/* Call ApplyBnd... with new boundary width array */
- retval = ApplyBndFlat(GH, stencil_dir, boundary_widths, dir, first_var,
- num_vars);
+ retval = ApplyBndFlat(GH, stencil_dir, boundary_widths, dir, first_var,
+ num_vars);
free(boundary_widths);
return retval;