aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorschnetter <schnetter@a2659f00-0f4f-0410-9214-a4596bbb8a4f>2008-10-03 21:21:20 +0000
committerschnetter <schnetter@a2659f00-0f4f-0410-9214-a4596bbb8a4f>2008-10-03 21:21:20 +0000
commitd88e493e4a617cfc474785105503006df9b30eeb (patch)
tree328831a9e9c2d44b7a739076f6f108401d2f7bf6
parentb673cd8678914bf3aabc677e9ca6f846488f5f72 (diff)
Use CarpetInterp2 if it is available, since this is more efficient
than CarpetInterp. git-svn-id: http://svn.aei.mpg.de/numrel/AEIThorns/PunctureTracker/trunk@11 a2659f00-0f4f-0410-9214-a4596bbb8a4f
-rw-r--r--interface.ccl15
-rw-r--r--src/puncture_tracker.c30
2 files changed, 37 insertions, 8 deletions
diff --git a/interface.ccl b/interface.ccl
index beac81a..cfc47a6 100644
--- a/interface.ccl
+++ b/interface.ccl
@@ -15,3 +15,18 @@ CCTK_REAL pt_loc_p[10] TYPE=scalar
{
pt_loc_t_p pt_loc_x_p pt_loc_y_p pt_loc_z_p
} "Previous location of punctures"
+
+
+
+CCTK_INT FUNCTION \
+ InterpGridArrays \
+ (CCTK_POINTER_TO_CONST IN cctkGH, \
+ CCTK_INT IN N_dims, \
+ CCTK_INT IN order, \
+ CCTK_INT IN N_interp_points, \
+ CCTK_POINTER_TO_CONST IN interp_coords, \
+ CCTK_INT IN N_input_arrays, \
+ CCTK_INT ARRAY IN input_array_indices, \
+ CCTK_INT IN N_output_arrays, \
+ CCTK_POINTER IN output_arrays)
+USES FUNCTION InterpGridArrays
diff --git a/src/puncture_tracker.c b/src/puncture_tracker.c
index 6f2773c..4e36c1f 100644
--- a/src/puncture_tracker.c
+++ b/src/puncture_tracker.c
@@ -105,6 +105,7 @@ PunctureTracker_Track (CCTK_ARGUMENTS)
}
// Interpolation parameter table
+ int const order = 4;
int const param_table_handle = Util_TableCreateFromString ("order=4");
if (param_table_handle < 0) {
CCTK_WARN (CCTK_WARN_ALERT, "Can't create parameter table");
@@ -159,14 +160,27 @@ PunctureTracker_Track (CCTK_ARGUMENTS)
output_arrays[2] = pt_betaz;
// Interpolate
- int const ierr = CCTK_InterpGridArrays
- (cctkGH, dim,
- operator_handle, param_table_handle, coordsys_handle,
- num_points,
- CCTK_VARIABLE_REAL,
- interp_coords,
- num_vars, input_array_indices,
- num_vars, output_array_type_codes, output_arrays);
+ int ierr;
+ if (CCTK_IsFunctionAliased ("InterpGridArrays")) {
+ // TODO: use correct array types
+ // (CCTK_POINTER[] vs. CCTK_REAL[])
+ ierr = InterpGridArrays
+ (cctkGH, dim,
+ order,
+ num_points,
+ interp_coords,
+ num_vars, input_array_indices,
+ num_vars, output_arrays);
+ } else {
+ ierr = CCTK_InterpGridArrays
+ (cctkGH, dim,
+ operator_handle, param_table_handle, coordsys_handle,
+ num_points,
+ CCTK_VARIABLE_REAL,
+ interp_coords,
+ num_vars, input_array_indices,
+ num_vars, output_array_type_codes, output_arrays);
+ }
if (ierr < 0) {
CCTK_WARN (CCTK_WARN_ALERT, "Interpolation error");
goto label_free_param_table;