// test_patch_system.cc -- test driver for patch_system:: // $Id$ // // <<>> // driver - Cactus interface // misc global data // main /// /// setup_sym_fn_xyz - set up symmetrized test function fn(global_[xyz]) /// setup_fn_rho_sigma - set up test function fn(rho,sigma) /// finite_diff - compute linear combination of finite differences /// analytic_derivs - compute linear combination of analytic derivatives /// gridfn_minus - compute gridfn x - gridfn y --> gridfn z /// /// sym_fn_xyz - symmetrized test function fn(x,y,z) + fn(-y,x,z) + ... /// fn_xyz - test function fn(x,y,z) /// /// fn_rho_sigma - test function fn(rho,sigma) /// finite_diff_fn - finite differences of fn(rho,sigma) /// analytic_deriv_fn - analytical derivs of fn(rho,sigma) (via Maple) /// #include #include #include #include "util_Table.h" #include "cctk.h" #include "cctk_Arguments.h" #include "cctk_Parameters.h" #include "jt/stdc.h" #include "jt/util.hh" #include "jt/array.hh" #include "jt/cpm_map.hh" #include "jt/linear_map.hh" using jtutil::error_exit; #include "fp.hh" #include "coords.hh" #include "grid.hh" #include "fd_grid.hh" #include "patch.hh" #include "patch_edge.hh" #include "ghost_zone.hh" #include "patch_frontier.hh" #include "patch_system.hh" //****************************************************************************** // // ***** prototypes ***** // extern "C" void test_patch_system(CCTK_ARGUMENTS); //****************************************************************************** // // This function is the Cactus interface for the test driver. // extern "C" void test_patch_system(CCTK_ARGUMENTS) { DECLARE_CCTK_ARGUMENTS DECLARE_CCTK_PARAMETERS // // set up the interpatch interpolator // const int interp_handle = CCTK_InterpHandle(interpatch_interpolator_name); if (interp_handle < 0) then CCTK_VWarn(-1, __LINE__, __FILE__, CCTK_THORNSTRING, "couldn't find interpolator \"%s\"!", interpatch_interpolator_name); /*NOTREACHED*/ const int interp_par_table_handle = Util_TableCreateFromString(interpatch_interpolator_pars); if (interp_par_table_handle < 0) then CCTK_VWarn(-1, __LINE__, __FILE__, CCTK_THORNSTRING, "bad interpatch-interpolator parameter(s) \"%s\"!", interpatch_interpolator_pars); /*NOTREACHED*/ const int min_gfn = 1; const int max_gfn = 3; const int ghosted_min_gfn = -2; const int ghosted_max_gfn = -1; // create the patch system CCTK_VInfo(CCTK_THORNSTRING, "about to create patch system"); patch_system ps(origin_x, origin_y, origin_z, patch_system::type_of_name(patch_system_type), N_ghost_points, N_overlap_points, delta_drho_dsigma, min_gfn, max_gfn, ghosted_min_gfn, ghosted_max_gfn, interp_handle, interp_par_table_handle); CCTK_VInfo(CCTK_THORNSTRING, "patch system created ok"); }