Skip to content

Commit

Permalink
Merge pull request #24 from acwen11/update_interp_calls
Browse files Browse the repository at this point in the history
AHFinderDirect: update interpolator calls (also PunctureTracker)
  • Loading branch information
lwJi authored May 17, 2024
2 parents 80eb41d + 58a2637 commit f49f92e
Show file tree
Hide file tree
Showing 4 changed files with 36 additions and 3 deletions.
17 changes: 17 additions & 0 deletions AHFinderDirect/interface.ccl
Original file line number Diff line number Diff line change
Expand Up @@ -148,3 +148,20 @@ FUNCTION sf_IdFromName (CCTK_INT IN id, CCTK_POINTER_TO_CONST IN name)
USES FUNCTION sf_IdFromName

################################################################################

# CarpetX Interpolator
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)
REQUIRES FUNCTION DriverInterpolate
2 changes: 1 addition & 1 deletion AHFinderDirect/src/gr/expansion.cc
Original file line number Diff line number Diff line change
Expand Up @@ -826,7 +826,7 @@ sleep(1);
CCTK_Barrier(cgi.GH);
#endif

status = CCTK_InterpGridArrays(cgi.GH, N_GRID_DIMS,
status = DriverInterpolate(cgi.GH, N_GRID_DIMS,
gi.operator_handle, gi.param_table_handle,
cgi.coord_system_handle,
N_interp_points,
Expand Down
16 changes: 16 additions & 0 deletions PunctureTracker/interface.ccl
Original file line number Diff line number Diff line change
Expand Up @@ -17,3 +17,19 @@ CCTK_REAL pt_vel[10] TYPE=scalar
{
pt_vel_t pt_vel_x pt_vel_y pt_vel_z
} "Velocity of punctures"

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)
REQUIRES FUNCTION DriverInterpolate
4 changes: 2 additions & 2 deletions PunctureTracker/src/puncture_tracker.cc
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@ extern "C" void PunctureTracker_Track(CCTK_ARGUMENTS) {

// Interpolation operator
const int operator_handle =
CCTK_InterpHandle("Lagrange polynomial interpolation");
CCTK_InterpHandle("CarpetX");
if (operator_handle < 0) {
CCTK_WARN(CCTK_WARN_ALERT, "Can't get interpolation handle");
return;
Expand Down Expand Up @@ -169,7 +169,7 @@ extern "C" void PunctureTracker_Track(CCTK_ARGUMENTS) {

// Interpolate
int ierr;
ierr = CCTK_InterpGridArrays(
ierr = DriverInterpolate(
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);
Expand Down

0 comments on commit f49f92e

Please sign in to comment.