From 788cabc64b97ec8868962bb5f165cd300a4b5bcb Mon Sep 17 00:00:00 2001 From: tradke Date: Mon, 6 Jan 2003 13:21:36 +0000 Subject: For PUGHInterp_InterpGridArrays (which overloads CCTK_InterpGridArrays()), merge the local and global parameter tables into a single one. You also need to update the flesh now. git-svn-id: http://svn.cactuscode.org/arrangements/CactusPUGH/PUGHInterp/trunk@40 1c20744c-e24a-42ec-9533-f5004cb800e5 --- src/InterpGridArrays.c | 68 ++++++++++++++++++-------------------------------- src/pughInterpGH.h | 3 +-- 2 files changed, 25 insertions(+), 46 deletions(-) diff --git a/src/InterpGridArrays.c b/src/InterpGridArrays.c index d993f1b..eb886d1 100644 --- a/src/InterpGridArrays.c +++ b/src/InterpGridArrays.c @@ -78,8 +78,7 @@ typedef struct /******************************************************************** ******************** Internal Routines ************************ ********************************************************************/ -static int CreateParameterTable (int global_param_table_handle, - int local_param_table_handle); +static int CreateParameterTable (int param_table_handle); /*@@ @@ -101,15 +100,9 @@ static int CreateParameterTable (int global_param_table_handle, @vtype int @vio in @endvar - @var global_param_table_handle + @var param_table_handle @vdesc parameter table handle for passing optional parameters to the - global interpolator routine - @vtype int - @vio in - @endvar - @var local_param_table_handle - @vdesc parameter table handle for passing optional parameters to the - local interpolator routine + interpolator routine @vtype int @vio in @endvar @@ -172,8 +165,7 @@ static int CreateParameterTable (int global_param_table_handle, @@*/ int PUGHInterp_InterpGridArrays (const cGH *GH, int N_dims, - int global_param_table_handle, - int local_param_table_handle, + int param_table_handle, int local_interp_handle, int coord_system_handle, int N_points, @@ -185,7 +177,7 @@ int PUGHInterp_InterpGridArrays (const cGH *GH, const CCTK_INT output_array_types[], void *const output_arrays[]) { - int i, param_table_handle, retval; + int i, retval; CCTK_REAL *origin_local, *delta_local; CCTK_INT *input_array_dims, *input_array_types; const void **input_arrays; @@ -267,9 +259,8 @@ int PUGHInterp_InterpGridArrays (const cGH *GH, } /* create the parameter table for the local interpolator from the - user-supplied global and local parameter tables */ - param_table_handle = CreateParameterTable (global_param_table_handle, - local_param_table_handle); + user-supplied parameter table */ + param_table_handle = CreateParameterTable (param_table_handle); if (param_table_handle < 0) { return (param_table_handle); @@ -346,7 +337,7 @@ int PUGHInterp_InterpGridArrays (const cGH *GH, if (retval >= 0 && pughGH->nprocs == 1) { retval = CCTK_InterpLocalUniform (N_dims, local_interp_handle, - local_param_table_handle, + param_table_handle, origin_local, delta_local, N_points, interp_coords_type, interp_coords, N_input_arrays, input_array_dims, @@ -359,7 +350,6 @@ int PUGHInterp_InterpGridArrays (const cGH *GH, free (origin_local); free (input_arrays); free (input_array_dims); - Util_TableDestroy (param_table_handle); return (retval); } @@ -442,7 +432,6 @@ int PUGHInterp_InterpGridArrays (const cGH *GH, free (input_arrays); free (input_array_dims); free (type_desc); - Util_TableDestroy (param_table_handle); return (UTIL_ERROR_BAD_INPUT); } @@ -560,7 +549,6 @@ int PUGHInterp_InterpGridArrays (const cGH *GH, free (input_arrays); free (input_array_dims); free (type_desc); - Util_TableDestroy (param_table_handle); return (UTIL_ERROR_BAD_INPUT); } @@ -702,7 +690,7 @@ int PUGHInterp_InterpGridArrays (const cGH *GH, /* now call the local interpolator for all local points and store the results in the intermediate local output arrays */ retval = CCTK_InterpLocalUniform (N_dims, local_interp_handle, - local_param_table_handle, + param_table_handle, origin_local, delta_local, N_points_local, interp_coords_type, (const void **) interp_coords_local, @@ -878,8 +866,6 @@ int PUGHInterp_InterpGridArrays (const cGH *GH, free (type_desc); #endif /* MPI */ - Util_TableDestroy (param_table_handle); - return (retval); } @@ -892,22 +878,16 @@ int PUGHInterp_InterpGridArrays (const cGH *GH, @date Fri 20 Dec 2002 @author Thomas Radke @desc - Parses the options given in the user-supplied global parameter - table and creates a parameter table to be passed to the local - interpolator. - The table is cloned from the user-supplied local parameter table - - or created as an empty table if there is no local parameter - table - and then completed with options from the global - interpolator. + Parses the options given in the user-supplied parameter table + and creates a parameter table to be passed to the local + interpolator. If the user-supplied parameter table is invalid, + a new table will be created. + The table will be completed with necessary options from the + global interpolator. @enddesc - @var global_param_table_handle - @vdesc handle to the user-supplied global parameter table - @vtype int - @vio in - @endvar - @var local_param_table_handle - @vdesc handle to the user-supplied local parameter table + @var param_table_handle + @vdesc handle to the user-supplied parameter table @vtype int @vio in @endvar @@ -918,25 +898,25 @@ int PUGHInterp_InterpGridArrays (const cGH *GH, one of the UTIL_ERROR_TABLE_* error codes @endreturndesc @@*/ -static int CreateParameterTable (int global_param_table_handle, - int local_param_table_handle) +static int CreateParameterTable (int param_table_handle) { int retval; - retval = local_param_table_handle >= 0 ? - Util_TableClone (local_param_table_handle) : Util_TableCreate (0); + retval = param_table_handle >= 0 ? param_table_handle : Util_TableCreate (0); if (retval < 0) { - CCTK_WARN (1, "couldn't create/clone local interpolator parameter table"); + CCTK_WARN (1, "couldn't create interpolator parameter table"); } - /* FIXME: must evaluate options from global parameter table */ - if (global_param_table_handle >= 0) +#if 0 + /* FIXME: must evaluate options from parameter table */ + if (Util_TableQueryNKeys (param_table_handle) > 0) { CCTK_WARN (1, "options in global interpolator parameter table are ignored " "so far"); } +#endif return (retval); } diff --git a/src/pughInterpGH.h b/src/pughInterpGH.h index 2abd51b..e25b4f6 100644 --- a/src/pughInterpGH.h +++ b/src/pughInterpGH.h @@ -35,8 +35,7 @@ typedef struct /* prototype of PUGHInterp's routine which overloads CCTK_InterpGridArrays() */ int PUGHInterp_InterpGridArrays (const cGH *GH, int N_dims, - int global_param_table_handle, - int local_param_table_handle, + int param_table_handle, int local_interp_handle, int coord_system_handle, int N_interp_points, -- cgit v1.2.3