aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorschnetter <schnetter@1c20744c-e24a-42ec-9533-f5004cb800e5>2004-05-28 16:35:54 +0000
committerschnetter <schnetter@1c20744c-e24a-42ec-9533-f5004cb800e5>2004-05-28 16:35:54 +0000
commit6dcfcb4596bbd63f549a93135bc7bf9e739ce242 (patch)
treebc9370c4276adefbc0f3df2909532ef5058d0777
parent2e703e1d86f13b8a26b4358dc5d2f9af4b7ef440 (diff)
Use symmetry interpolation.
git-svn-id: http://svn.cactuscode.org/arrangements/CactusPUGH/PUGHInterp/trunk@78 1c20744c-e24a-42ec-9533-f5004cb800e5
-rw-r--r--interface.ccl41
-rw-r--r--src/InterpGridArrays.c123
-rw-r--r--src/pughInterpGH.h19
3 files changed, 183 insertions, 0 deletions
diff --git a/interface.ccl b/interface.ccl
index 8c50ef4..adc69e5 100644
--- a/interface.ccl
+++ b/interface.ccl
@@ -2,3 +2,44 @@
# $Header$
Implements: Interp
+
+
+
+# Interpolation
+CCTK_INT FUNCTION \
+ SymmetryInterpolate \
+ (CCTK_POINTER_TO_CONST IN cctkGH, \
+ CCTK_INT IN N_dims, \
+ CCTK_INT IN local_interp_handle, \
+ CCTK_INT IN param_table_handle, \
+ CCTK_INT IN coord_system_handle, \
+ CCTK_INT IN N_interp_points, \
+ CCTK_INT IN interp_coords_type, \
+ CCTK_POINTER_TO_CONST ARRAY IN interp_coords, \
+ CCTK_INT IN N_input_arrays, \
+ CCTK_INT ARRAY IN input_array_indices, \
+ CCTK_INT IN N_output_arrays, \
+ CCTK_INT ARRAY IN output_array_types, \
+ CCTK_POINTER ARRAY IN output_arrays)
+USES FUNCTION SymmetryInterpolate
+
+
+
+CCTK_INT FUNCTION \
+ DriverInterpolate \
+ (CCTK_POINTER_TO_CONST IN cctkGH, \
+ CCTK_INT IN N_dims, \
+ CCTK_INT IN local_interp_handle, \
+ CCTK_INT IN param_table_handle, \
+ CCTK_INT IN coord_system_handle, \
+ CCTK_INT IN N_interp_points, \
+ CCTK_INT IN interp_coords_type, \
+ CCTK_POINTER_TO_CONST ARRAY IN interp_coords, \
+ CCTK_INT IN N_input_arrays, \
+ CCTK_INT ARRAY IN input_array_indices, \
+ CCTK_INT IN N_output_arrays, \
+ CCTK_INT ARRAY IN output_array_types, \
+ CCTK_POINTER ARRAY IN output_arrays)
+PROVIDES FUNCTION DriverInterpolate \
+ WITH PUGHInterp_DriverInterpolate \
+ LANGUAGE C
diff --git a/src/InterpGridArrays.c b/src/InterpGridArrays.c
index e97712d..b9873f7 100644
--- a/src/InterpGridArrays.c
+++ b/src/InterpGridArrays.c
@@ -185,6 +185,129 @@ int PUGHInterp_InterpGridArrays (const cGH *GH,
const CCTK_INT output_array_types[],
void *const output_arrays[])
{
+ if (CCTK_IsFunctionAliased ("SymmetryInterpolate")) {
+ return SymmetryInterpolate
+ (GH, N_dims,
+ local_interp_handle, param_table_handle, coord_system_handle,
+ N_points, interp_coords_type, interp_coords,
+ N_input_arrays, input_array_indices,
+ N_output_arrays, output_array_types, output_arrays);
+ } else {
+ return PUGHInterp_DriverInterpolate
+ (GH, N_dims,
+ local_interp_handle, param_table_handle, coord_system_handle,
+ N_points, interp_coords_type, interp_coords,
+ N_input_arrays, input_array_indices,
+ N_output_arrays, output_array_types, output_arrays);
+ }
+}
+
+
+
+
+/*@@
+ @routine PUGHInterp_DriverInterpolate
+ @date 2004-05-28
+ @author Erik Schnetter
+ @desc
+ PUGHInterp's interpolation routine for distributed grid arrays.
+ This routine provides the aliased function DriverInterpolate.
+ @enddesc
+
+ @var GH
+ @vdesc pointer to CCTK grid hierarchy
+ @vtype CCTK_POINTER_TO_CONST
+ @vio in
+ @endvar
+ @var N_dims
+ @vdesc number of dimensions for the interpolation
+ @vtype CCTK_INT
+ @vio in
+ @endvar
+ @var local_interp_handle
+ @vdesc handle which specifies the local interpolator to use
+ @vtype CCTK_INT
+ @vio in
+ @endvar
+ @var param_table_handle
+ @vdesc parameter table handle for passing optional parameters to the
+ interpolator routine
+ @vtype CCTK_INT
+ @vio in
+ @endvar
+ @var coord_system_handle
+ @vdesc handle for the underlying coordinate system
+ @vtype CCTK_INT
+ @vio in
+ @endvar
+ @var N_points
+ @vdesc number of points to interpolate at
+ @vtype CCTK_INT
+ @vio in
+ @endvar
+ @var interp_coords_type
+ @vdesc CCTK datatype of the coordinate arrays as passed via
+ <interp_coords> (common datatype for all arrays)
+ @vtype CCTK_INT
+ @vio in
+ @endvar
+ @var interp_coords
+ @vdesc list of <N_dims> arrays with coordinate for <N_points>
+ points to interpolate at
+ @vtype const CCTK_POINTER_TO_CONST []
+ @vio in
+ @endvar
+ @var N_input_arrays
+ @vdesc number of input arrays
+ @vtype CCTK_INT
+ @vio in
+ @endvar
+ @var input_array_indices
+ @vdesc list of <N_input_arrays> grid variables (given by their indices)
+ to interpolate
+ @vtype const CCTK_INT []
+ @vio in
+ @endvar
+ @var N_output_arrays
+ @vdesc number of output arrays
+ @vtype CCTK_INT
+ @vio in
+ @endvar
+ @var out_array_types
+ @vdesc list of <N_output_arrays> requested CCTK datatypes for the
+ output arrays
+ @vtype const CCTK_INT []
+ @vio in
+ @endvar
+ @var output_arrays
+ @vdesc list of <N_output_arrays> output arrays (given by their pointers)
+ which receive the interpolation results
+ @vtype const CCTK_POINTER []
+ @vio out
+ @endvar
+
+ @returntype CCTK_INT
+ @returndesc
+ 0 - successful interpolation
+ -1 - in case of any errors
+ @endreturndesc
+@@*/
+CCTK_INT
+PUGHInterp_DriverInterpolate (CCTK_POINTER_TO_CONST const GH_,
+ CCTK_INT const N_dims,
+ CCTK_INT const local_interp_handle,
+ CCTK_INT const param_table_handle,
+ CCTK_INT const coord_system_handle,
+ CCTK_INT const N_points,
+ CCTK_INT const interp_coords_type,
+ CCTK_POINTER_TO_CONST const interp_coords [],
+ CCTK_INT const N_input_arrays,
+ CCTK_INT const input_array_indices [],
+ CCTK_INT const N_output_arrays,
+ CCTK_INT const output_array_types [],
+ CCTK_POINTER const output_arrays [])
+{
+ cGH const * restrict const GH = GH_;
int i, suppress_warnings, retval;
CCTK_REAL *origin_local, *delta;
CCTK_INT *input_array_dims, *input_array_types, *input_array_time_levels;
diff --git a/src/pughInterpGH.h b/src/pughInterpGH.h
index 871cf22..4e94a18 100644
--- a/src/pughInterpGH.h
+++ b/src/pughInterpGH.h
@@ -47,6 +47,25 @@ int PUGHInterp_InterpGridArrays (const cGH *GH,
const CCTK_INT output_array_types[],
void *const output_arrays[]);
+
+/* prototype of PUGHInterp's routine which provides the aliased
+ function DriverInterpolate */
+CCTK_INT
+PUGHInterp_DriverInterpolate (CCTK_POINTER_TO_CONST const GH_,
+ CCTK_INT const N_dims,
+ CCTK_INT const local_interp_handle,
+ CCTK_INT const param_table_handle,
+ CCTK_INT const coord_system_handle,
+ CCTK_INT const N_points,
+ CCTK_INT const interp_coords_type,
+ CCTK_POINTER_TO_CONST const interp_coords [],
+ CCTK_INT const N_input_arrays,
+ CCTK_INT const input_array_indices [],
+ CCTK_INT const N_output_arrays,
+ CCTK_INT const output_array_types [],
+ CCTK_POINTER const output_arrays []);
+
+
#ifdef __cplusplus
} // extern "C"
#endif