From d22189e957dcbbca1524894aeb10919055ab0f1a Mon Sep 17 00:00:00 2001 From: tradke Date: Wed, 29 May 2002 13:23:03 +0000 Subject: Removed the local interpolation operator from PUGHInterp. The code for this lives in thorn LocalInterp now. git-svn-id: http://svn.cactuscode.org/arrangements/CactusPUGH/PUGHInterp/trunk@25 1c20744c-e24a-42ec-9533-f5004cb800e5 --- src/Operator.c | 177 ----------------------------------------------------- src/Startup.c | 78 ----------------------- src/pughInterpGH.h | 16 ----- 3 files changed, 271 deletions(-) (limited to 'src') diff --git a/src/Operator.c b/src/Operator.c index 0ee3c23..90a15be 100644 --- a/src/Operator.c +++ b/src/Operator.c @@ -686,183 +686,6 @@ int PUGHInterp_InterpGV (cGH *GH, } -/*@@ - @routine PUGHInterp_InterpLocal - @date Sun Jul 04 1999 - @author Thomas Radke - @desc - The interpolation operator registered with the CCTK - under the name "uniform cartesian". - - Interpolates a list of non-distributed, processor-local - input arrays to a list of output arrays (one-to-one) - at a given number of interpolation points (indicated by - their coordinates). The points are located on a coordinate - system which is assumed to be a uniform cartesian. - @enddesc - - @var GH - @vdesc Pointer to CCTK grid hierarchy - @vtype cGH * - @vio in - @endvar - @var order - @vdesc interpolation order - @vtype int - @vio in - @endvar - @var num_points - @vdesc number of points to be interpolated on this processor - @vtype int - @vio in - @endvar - @var num_dims - @vdesc dimensionality of the underlying grid - @vtype int - @vio in - @endvar - @var num_in_arrays - @vdesc number of input arrays to interpolate from - @vtype int - @vio in - @endvar - @var num_out_arrays - @vdesc number of output arrays to interpolate to - @vtype int - @vio in - @endvar - @var coord_dims - @vdesc dimensions of the underlying grid - @vtype int [num_dims] - @vio in - @endvar - @var coord_arrays - @vdesc list of grid coordinate arrays - @vtype void *const [num_dims] - @vio in - @endvar - @var coord_array_types - @vdesc CCTK data type of coordinate arrays - @vtype int [num_dims] - @vio int - @endvar - @var interp_coord_arrays - @vdesc coordinates of points to interpolate at - @vtype void *const [num_dims] - @vio in - @endvar - @var interp_coord_array_types - @vdesc CCTK data type of coordinate arrays to interpolate at - @vtype int [num_dims] - @vio out - @endvar - @var in_arrays - @vdesc list of input arrays to interpolate on - @vtype void *const [num_in_arrays] - @vio in - @endvar - @var in_array_types - @vdesc CCTK data types of input arrays - @vtype int [num_in_arrays] - @vio in - @endvar - @var out_arrays - @vdesc list of output arrays to interpolate to - @vtype void *const [num_out_arrays] - @vio out - @endvar - @var out_array_types - @vdesc CCTK data types of output arrays - @vtype int [num_out_arrays] - @vio in - @endvar - - @returntype int - @returndesc - 0 - successful interpolation - -1 - in case of any errors - @endreturndesc -@@*/ -int PUGHInterp_InterpLocal (cGH *GH, - int order, - int num_points, - int num_dims, - int num_in_arrays, - int num_out_arrays, - const int coord_dims[], - const void *const coord_arrays[], - const int coord_array_types[], - const void *const interp_coord_arrays[], - const int interp_coord_array_types[], - const void *const in_arrays[], - const int in_array_types[], - void *const out_arrays[], - const int out_array_types[]) -{ - int dim, point, retval; - CCTK_REAL *coords, *origin, *delta; - const CCTK_REAL *const *data; - - - /* check arguments */ - retval = PUGHInterp_CheckArguments (GH, num_dims, num_points, - num_in_arrays, num_out_arrays, - interp_coord_array_types); - if (retval <= 0) - { - return (retval); - } - for (dim = 0; dim < num_dims; dim++) - { - if (coord_array_types[dim] != CCTK_VARIABLE_REAL) - { - CCTK_WARN (1, "Coordinates should be of type CCTK_REAL"); - return (-1); - } - if (interp_coord_array_types[dim] != CCTK_VARIABLE_REAL) - { - CCTK_WARN (1, "Interpolation coordinates should be of type CCTK_REAL"); - return (-1); - } - } - - /* get the grid spacings - this assumes a cartesian grid */ - origin = (CCTK_REAL *) malloc (2 * num_dims * sizeof (CCTK_REAL)); - delta = origin + num_dims; - data = (const CCTK_REAL *const *) coord_arrays; - for (dim = 0; dim < num_dims; dim++) - { - origin[dim] = data[dim][0]; - delta[dim] = data[dim][1] - data[dim][0]; - } - - /* sort the individual interpolation coordinate arrays into a single one */ - coords = (CCTK_REAL *) malloc (num_dims * num_points * sizeof (CCTK_REAL)); - data = (const CCTK_REAL *const *) interp_coord_arrays; - for (point = 0; point < num_points; point++) - { - for (dim = 0; dim < num_dims; dim++) - { - *coords++ = data[dim][point]; - } - } - coords -= num_dims * num_points; - - /* call the interpolator function */ - retval = PUGHInterp_Interpolate (order, - num_points, num_dims, num_out_arrays, - coord_dims, coords, origin, delta, - in_array_types, in_arrays, - out_array_types, out_arrays); - - /* free allocated resources */ - free (coords); - free (origin); - - return (retval); -} - - /**************************************************************************/ /* local routines */ /**************************************************************************/ diff --git a/src/Startup.c b/src/Startup.c index f642715..5e60877 100644 --- a/src/Startup.c +++ b/src/Startup.c @@ -144,78 +144,6 @@ static int PUGHInterp_InterpGV_3rdOrder (cGH *GH, } -static int PUGHInterp_InterpLocal_1stOrder (cGH *GH, - int num_points, - int num_dims, - int num_in_arrays, - int num_out_arrays, - const int coord_dims[], - const void *const coord_arrays[], - const int coord_array_types[], - const void *const interp_coord_arrays[], - const int interp_coord_array_types[], - const void *const in_arrays[], - const int in_array_types[], - void *const out_arrays[], - const int out_array_types[]) -{ - return (PUGHInterp_InterpLocal (GH, 1, num_points, num_dims, - num_in_arrays, num_out_arrays, - coord_dims, coord_arrays, coord_array_types, - interp_coord_arrays, interp_coord_array_types, - in_arrays, in_array_types, - out_arrays, out_array_types)); -} - - -static int PUGHInterp_InterpLocal_2ndOrder (cGH *GH, - int num_points, - int num_dims, - int num_in_arrays, - int num_out_arrays, - const int coord_dims[], - const void *const coord_arrays[], - const int coord_array_types[], - const void *const interp_coord_arrays[], - const int interp_coord_array_types[], - const void *const in_arrays[], - const int in_array_types[], - void *const out_arrays[], - const int out_array_types[]) -{ - return (PUGHInterp_InterpLocal (GH, 2, num_points, num_dims, - num_in_arrays, num_out_arrays, - coord_dims, coord_arrays, coord_array_types, - interp_coord_arrays, interp_coord_array_types, - in_arrays, in_array_types, - out_arrays, out_array_types)); -} - - -static int PUGHInterp_InterpLocal_3rdOrder (cGH *GH, - int num_points, - int num_dims, - int num_in_arrays, - int num_out_arrays, - const int coord_dims[], - const void *const coord_arrays[], - const int coord_array_types[], - const void *const interp_coord_arrays[], - const int interp_coord_array_types[], - const void *const in_arrays[], - const int in_array_types[], - void *const out_arrays[], - const int out_array_types[]) -{ - return (PUGHInterp_InterpLocal (GH, 3, num_points, num_dims, - num_in_arrays, num_out_arrays, - coord_dims, coord_arrays, coord_array_types, - interp_coord_arrays, interp_coord_array_types, - in_arrays, in_array_types, - out_arrays, out_array_types)); -} - - /*@@ @routine PUGHInterp_Startup @date Sun Jul 04 1999 @@ -238,14 +166,8 @@ void PUGHInterp_Startup (void) CCTK_InterpRegisterOperatorGV (PUGHInterp_InterpGV_1stOrder, "first-order uniform cartesian"); - CCTK_InterpRegisterOperatorLocal (PUGHInterp_InterpLocal_1stOrder, - "first-order uniform cartesian"); CCTK_InterpRegisterOperatorGV (PUGHInterp_InterpGV_2ndOrder, "second-order uniform cartesian"); - CCTK_InterpRegisterOperatorLocal (PUGHInterp_InterpLocal_2ndOrder, - "second-order uniform cartesian"); CCTK_InterpRegisterOperatorGV (PUGHInterp_InterpGV_3rdOrder, "third-order uniform cartesian"); - CCTK_InterpRegisterOperatorLocal (PUGHInterp_InterpLocal_3rdOrder, - "third-order uniform cartesian"); } diff --git a/src/pughInterpGH.h b/src/pughInterpGH.h index c9187ff..23dc6ef 100644 --- a/src/pughInterpGH.h +++ b/src/pughInterpGH.h @@ -40,22 +40,6 @@ int PUGHInterp_InterpGV (cGH *GH, void *const out_arrays[], const int out_array_types[]); -int PUGHInterp_InterpLocal (cGH *GH, - int order, - int num_points, - int num_dims, - int num_in_arrays, - int num_out_arrays, - const int coord_dims[], - const void *const coord_arrays[], - const int coord_array_types[], - const void *const interp_coord_arrays[], - const int interp_coord_array_types[], - const void *const in_arrays[], - const int in_array_types[], - void *const out_arrays[], - const int out_array_types[]); - /* prototypes of routines used internally */ int PUGHInterp_Interpolate (int order, int num_points, -- cgit v1.2.3