diff options
author | jthorn <jthorn@f88db872-0e4f-0410-b76b-b9085cfa78c5> | 2003-07-27 13:36:48 +0000 |
---|---|---|
committer | jthorn <jthorn@f88db872-0e4f-0410-b76b-b9085cfa78c5> | 2003-07-27 13:36:48 +0000 |
commit | 4803dd5038921ea721184c950f69c0bf7ddfd0f3 (patch) | |
tree | dc05a8ec2e72bba2caa5841f32903459f8986c5c /src | |
parent | 01396fd7523818432964709675304828ebe3d87f (diff) |
drop support for (optionally) using CCTK_InterpLocalUniform() instead of
CCTK_InterpGridArrays() to interpolate the Cactus geometry grid functions
to the horizon position
-- this was never used in practice, and it conflicts with the changse
I'm about to commit to make AHFinderDirect work properly under Carpet
git-svn-id: http://svn.einsteintoolkit.org/cactus/EinsteinAnalysis/AHFinderDirect/trunk@1146 f88db872-0e4f-0410-b76b-b9085cfa78c5
Diffstat (limited to 'src')
-rw-r--r-- | src/driver/find_horizons.cc | 53 | ||||
-rw-r--r-- | src/driver/setup.cc | 16 | ||||
-rw-r--r-- | src/gr/expansion.cc | 212 | ||||
-rw-r--r-- | src/gr/gr.hh | 21 |
4 files changed, 88 insertions, 214 deletions
diff --git a/src/driver/find_horizons.cc b/src/driver/find_horizons.cc index 5f891fd..3464177 100644 --- a/src/driver/find_horizons.cc +++ b/src/driver/find_horizons.cc @@ -5,8 +5,6 @@ // <<<prototypes for functions local to this file>>> // AHFinderDirect_find_horizons - top-level driver to find apparent horizons /// -/// setup_Cactus_gridfn_dataptrs - get all data pointers given variable indices -/// /// find_horizon - find a horizon /// do_evaluate_expansions /// do_test_expansion_Jacobian @@ -60,8 +58,6 @@ extern struct state state; // ***** prototypes for functions local to this file // namespace { -void setup_Cactus_gridfn_dataptrs(const cGH *GH, struct cactus_grid_info& cgi); - void do_evaluate_expansions(int my_proc, int N_horizons, horizon_sequence& hs, struct AH_data* const AH_data_array[], @@ -131,12 +127,6 @@ IO_info.output_Theta = (IO_info.how_often_to_output_Theta > 0) && ((IO_info.time_iteration % IO_info.how_often_to_output_Theta) == 0); -// if we're using them, -// we need to re-fetch the Cactus data pointers at least each time step, -// because they change each time Cactus rotates the time levels -if (gi.geometry_method == geometry__local_interp_from_Cactus_grid) - then setup_Cactus_gridfn_dataptrs(cctkGH, cgi); - // set initial guess for any (genuine) horizons that need it, // i.e. for any (genuine) horizons where we didn't find the horizon previously for (int hn = hs.init_hn() ; hs.is_genuine() ; hn = hs.next_hn()) @@ -230,49 +220,6 @@ if (mask_info.set_mask) //****************************************************************************** // -// This function sets up the geometry data pointers in a -// struct cactus_grid_info . -// - -namespace { -void setup_Cactus_gridfn_dataptrs(const cGH *GH, struct cactus_grid_info& cgi) -{ -cgi.g_dd_11_dataptr = Cactus_gridfn_dataptr<CCTK_REAL> - (GH, cgi.g_dd_11_varindex, "g_11"); -cgi.g_dd_12_dataptr = Cactus_gridfn_dataptr<CCTK_REAL> - (GH, cgi.g_dd_12_varindex, "g_12"); -cgi.g_dd_13_dataptr = Cactus_gridfn_dataptr<CCTK_REAL> - (GH, cgi.g_dd_13_varindex, "g_13"); -cgi.g_dd_22_dataptr = Cactus_gridfn_dataptr<CCTK_REAL> - (GH, cgi.g_dd_22_varindex, "g_22"); -cgi.g_dd_23_dataptr = Cactus_gridfn_dataptr<CCTK_REAL> - (GH, cgi.g_dd_23_varindex, "g_23"); -cgi.g_dd_33_dataptr = Cactus_gridfn_dataptr<CCTK_REAL> - (GH, cgi.g_dd_33_varindex, "g_33"); -cgi.K_dd_11_dataptr = Cactus_gridfn_dataptr<CCTK_REAL> - (GH, cgi.K_dd_11_varindex, "K_11"); -cgi.K_dd_12_dataptr = Cactus_gridfn_dataptr<CCTK_REAL> - (GH, cgi.K_dd_12_varindex, "K_12"); -cgi.K_dd_13_dataptr = Cactus_gridfn_dataptr<CCTK_REAL> - (GH, cgi.K_dd_13_varindex, "K_13"); -cgi.K_dd_22_dataptr = Cactus_gridfn_dataptr<CCTK_REAL> - (GH, cgi.K_dd_22_varindex, "K_22"); -cgi.K_dd_23_dataptr = Cactus_gridfn_dataptr<CCTK_REAL> - (GH, cgi.K_dd_23_varindex, "K_23"); -cgi.K_dd_33_dataptr = Cactus_gridfn_dataptr<CCTK_REAL> - (GH, cgi.K_dd_33_varindex, "K_33"); -const bool check_for_NULL = cgi.use_Cactus_conformal_metric; -cgi.psi_dataptr = Cactus_gridfn_dataptr<CCTK_REAL> - (GH, cgi.psi_varindex, "psi", - check_for_NULL); -} - } - -//****************************************************************************** -//****************************************************************************** -//****************************************************************************** - -// // This function implements AHFinderDirect::method == "horizon function": // On processor #0 it evaluates the Theta(h) function for each apparent // horizon (and does any I/O desired); on other processors it does N_horizons diff --git a/src/driver/setup.cc b/src/driver/setup.cc index 965dddd..5f60afa 100644 --- a/src/driver/setup.cc +++ b/src/driver/setup.cc @@ -213,22 +213,6 @@ cgi.K_dd_23_varindex = Cactus_gridfn_varindex("ADMBase::kyz"); cgi.K_dd_33_varindex = Cactus_gridfn_varindex("ADMBase::kzz"); cgi.psi_varindex = Cactus_gridfn_varindex("StaticConformal::psi"); -// we can't set the data pointers yet because they may change from time -// step to time step as (if) Cactus rotates the multiple time levels -cgi.g_dd_11_dataptr = NULL; // dummy value, will be reset later -cgi.g_dd_12_dataptr = NULL; // dummy value, will be reset later -cgi.g_dd_13_dataptr = NULL; // dummy value, will be reset later -cgi.g_dd_22_dataptr = NULL; // dummy value, will be reset later -cgi.g_dd_23_dataptr = NULL; // dummy value, will be reset later -cgi.g_dd_33_dataptr = NULL; // dummy value, will be reset later -cgi.K_dd_11_dataptr = NULL; // dummy value, will be reset later -cgi.K_dd_12_dataptr = NULL; // dummy value, will be reset later -cgi.K_dd_13_dataptr = NULL; // dummy value, will be reset later -cgi.K_dd_22_dataptr = NULL; // dummy value, will be reset later -cgi.K_dd_23_dataptr = NULL; // dummy value, will be reset later -cgi.K_dd_33_dataptr = NULL; // dummy value, will be reset later -cgi.psi_dataptr = NULL; // dummy value, will be reset later - // // geometry info diff --git a/src/gr/expansion.cc b/src/gr/expansion.cc index d6c51b5..7ddf6ee 100644 --- a/src/gr/expansion.cc +++ b/src/gr/expansion.cc @@ -341,10 +341,11 @@ if (print_msg_flag) // setup and a a dummy interpolator call, as described in the comments // to expansion() above. // -// The interpolation may be either via CCTK_InterpGridArrays() or via -// CCTK_InterpLocalUniform() , according to gi.geometry_method. For the -// former, if the interpolator returns a "ghost size too small" error code, -// this function prints an informative message and aborts the Cactus run. +// The interpolation is done via CCTK_InterpGridArrays() . This has the +// option to return both an overall interpolation status, and a "local" +// status which gives the results of interpolating only the points requested +// on *this* processor; if the local status is available we use it, otherwise +// we fall back to the overall status. // // Inputs (angular gridfns, all on the nominal grid): // global_[xyz] # xyz positions of grid points @@ -452,25 +453,9 @@ const CCTK_INT input_array_type_codes[] // psi CCTK_VARIABLE_REAL, }; -const void* const input_arrays[] - = { - static_cast<const void*>(cgi.g_dd_11_dataptr), - static_cast<const void*>(cgi.g_dd_12_dataptr), - static_cast<const void*>(cgi.g_dd_13_dataptr), - static_cast<const void*>(cgi.g_dd_22_dataptr), - static_cast<const void*>(cgi.g_dd_23_dataptr), - static_cast<const void*>(cgi.g_dd_33_dataptr), - static_cast<const void*>(cgi.K_dd_11_dataptr), - static_cast<const void*>(cgi.K_dd_12_dataptr), - static_cast<const void*>(cgi.K_dd_13_dataptr), - static_cast<const void*>(cgi.K_dd_22_dataptr), - static_cast<const void*>(cgi.K_dd_23_dataptr), - static_cast<const void*>(cgi.K_dd_33_dataptr), - static_cast<const void*>(cgi.psi_dataptr), - }; - const int N_input_arrays_for_psi = 1; -const int N_input_arrays_dim = sizeof(input_arrays) / sizeof(input_arrays[0]); +const int N_input_arrays_dim = sizeof(input_array_variable_indices) + / sizeof(input_array_variable_indices[0]); const int N_input_arrays_use = psi_flag ? N_input_arrays_dim : N_input_arrays_dim - N_input_arrays_for_psi; @@ -648,7 +633,7 @@ if (print_msg_flag) #ifdef GEOMETRY_INTERP_DEBUG printf("AHFinderDirect:: proc %d: initializing interpolator outputs to 999.999\n", int(CCTK_MyProc(cgi.GH))); - { + { for (int pt = 0 ; pt < N_interp_points ; ++pt) { for (int out = 0 ; out < N_output_arrays_use ; ++out) @@ -658,116 +643,95 @@ printf("AHFinderDirect:: proc %d: initializing interpolator outputs to 999.999\n out_ptr[pt] = 999.999; } } - } + } #endif -switch (gi.geometry_method) - { -case geometry__global_interp_from_Cactus_grid: - { - #ifdef GEOMETRY_INTERP_DEBUG - printf("AHFinderDirect:: proc %d: calling global interpolator (N_interp_points=%d)\n", - int(CCTK_MyProc(cgi.GH)), N_interp_points); - fflush(stdout); - #endif - #ifdef GEOMETRY_INTERP_SYNC_SLEEP - sleep(1); - #endif - #ifdef GEOMETRY_INTERP_SYNC_BARRIER - CCTK_Barrier(cgi.GH); - #endif - status = CCTK_InterpGridArrays(cgi.GH, N_GRID_DIMS, - gi.operator_handle, - gi.param_table_handle, - cgi.coord_system_handle, - N_interp_points, - interp_coords_type_code, - interp_coords, - N_input_arrays_use, - input_array_variable_indices, - N_output_arrays_use, - output_array_type_codes, - output_arrays); - #ifdef GEOMETRY_INTERP_DEBUG - printf("AHFinderDirect:: proc %d: CCTK_InterpGridArrays() returned status=%d\n", - int(CCTK_MyProc(cgi.GH)), status); - fflush(stdout); - #endif - #ifdef GEOMETRY_INTERP_DEBUG2 +#ifdef GEOMETRY_INTERP_DEBUG +printf("AHFinderDirect:: proc %d: calling global interpolator (N_interp_points=%d)\n", + int(CCTK_MyProc(cgi.GH)), N_interp_points); +fflush(stdout); +#endif + +#ifdef GEOMETRY_INTERP_SYNC_SLEEP +sleep(1); +#endif + +#ifdef GEOMETRY_INTERP_SYNC_BARRIER +CCTK_Barrier(cgi.GH); +#endif + +status = CCTK_InterpGridArrays(cgi.GH, N_GRID_DIMS, + gi.operator_handle, gi.param_table_handle, + cgi.coord_system_handle, + N_interp_points, + interp_coords_type_code, + interp_coords, + N_input_arrays_use, + input_array_variable_indices, + N_output_arrays_use, + output_array_type_codes, + output_arrays); + +#ifdef GEOMETRY_INTERP_DEBUG +printf("AHFinderDirect:: proc %d: CCTK_InterpGridArrays() returned status=%d\n", + int(CCTK_MyProc(cgi.GH)), status); +fflush(stdout); +#endif + +#ifdef GEOMETRY_INTERP_DEBUG2 { - for (int pt = 0 ; pt < N_interp_points ; pt = 2*pt + (pt == 0)) + for (int pt = 0 ; pt < N_interp_points ; pt = 2*pt + (pt == 0)) + { + printf("AHFinderDirect:: proc %d: CCTK_InterpGridArrays() results for pt=%d:\n", + int(CCTK_MyProc(cgi.GH)), pt); + for (int out = 0 ; out < N_output_arrays_use ; ++out) { - printf("AHFinderDirect:: proc %d: CCTK_InterpGridArrays() results for pt=%d:\n", - int(CCTK_MyProc(cgi.GH)), pt); - for (int out = 0 ; out < N_output_arrays_use ; ++out) - { - const CCTK_REAL* const out_ptr - = static_cast<const CCTK_REAL*>(output_arrays[out]); - printf(" out=%d result=%g\n", out, double(out_ptr[pt])); - } + const CCTK_REAL* const out_ptr + = static_cast<const CCTK_REAL*>(output_arrays[out]); + printf(" out=%d result=%g\n", out, double(out_ptr[pt])); } + } } - #endif /* GEOMETRY_INTERP_DEBUG2 */ - // - // CCTK_InterpGridArrays() returns a status that reflects - // the interpolation on *all* processors, but what we really - // want here is just the status for the interpolation of the - // points that *we* (this processor) asked for ==> get that - // status (assuming the global and local interpolators support - // providing it) - // - CCTK_INT local_interpolator_status; - const int table_status = Util_TableGetInt(gi.param_table_handle, - &local_interpolator_status, - "local_interpolator_status"); - if (table_status == 1) - then { - // we got the local interpolator status successfully - // ==> use it for all further checks - #ifdef GEOMETRY_INTERP_DEBUG - printf("AHFinderDirect:: proc %d: replacing status=%d with local_interpolator_status=%d\n", - int(CCTK_MyProc(cgi.GH)), status, int(local_interpolator_status)); - fflush(stdout); - #endif - status = local_interpolator_status; - } - else if (status == UTIL_ERROR_TABLE_NO_SUCH_KEY) - then { - // evidently the interpolators don't provide the - // local interpolator status - // ==> stick with the status have - // ==> no-op here - } - else error_exit(ERROR_EXIT, +#endif /* GEOMETRY_INTERP_DEBUG2 */ + + +// +// ***** get the local interpolator status (if available) +// +// CCTK_InterpGridArrays() returns a status that reflects the interpolation +// on *all* processors, but what we really want here is just the status +// for the interpolation of the points that *we* (this processor) asked for +// ==> get the local status if it's available +// +CCTK_INT local_interpolator_status; +const int table_status = Util_TableGetInt(gi.param_table_handle, + &local_interpolator_status, + "local_interpolator_status"); +if (table_status == 1) + then { + // we got the local interpolator status successfully + // ==> use it for all further checks + #ifdef GEOMETRY_INTERP_DEBUG + printf("AHFinderDirect:: proc %d: replacing status=%d with local_interpolator_status=%d\n", + int(CCTK_MyProc(cgi.GH)), status, int(local_interpolator_status)); + fflush(stdout); + #endif + status = local_interpolator_status; + } +else if (status == UTIL_ERROR_TABLE_NO_SUCH_KEY) + then { + // evidently the interpolators don't provide the + // local interpolator status + // ==> stick with the status have + // ==> no-op here + } +else error_exit(ERROR_EXIT, "***** interpolate_geometry():\n" " error return %d trying to get local interpolator status\n" " from parameter table! (CCTK_InterpGridArrays() status=%d)\n" - , - table_status, status); /*NOTREACHED*/ - break; - } -case geometry__local_interp_from_Cactus_grid: - status = CCTK_InterpLocalUniform(N_GRID_DIMS, - gi.operator_handle, - gi.param_table_handle, - cgi.global_coord_origin, - cgi.coord_delta, - N_interp_points, - interp_coords_type_code, - interp_coords, - N_input_arrays_use, - cgi.local_gridfn_dims, - input_array_type_codes, - input_arrays, - N_output_arrays_use, - output_array_type_codes, - output_arrays); - break; -default: - error_exit(ERROR_EXIT, -"***** interpolate_geometry(): bad gi.geometry_method=(int)%d!", - int(gi.geometry_method)); /*NOTREACHED*/ - } + , + table_status, status); /*NOTREACHED*/ + // // ***** handle any interpolation errors ***** diff --git a/src/gr/gr.hh b/src/gr/gr.hh index 599d704..a31148f 100644 --- a/src/gr/gr.hh +++ b/src/gr/gr.hh @@ -132,27 +132,6 @@ struct cactus_grid_info K_dd_22_varindex, K_dd_23_varindex, K_dd_33_varindex; int psi_varindex; // unused if !use_Cactus_conformal_metric - - // - // stuff for doing a local interpolation via CCTK_InterpLocalUniform() - // i.e. geometry_info.geometry_method - // == geometry__local_interp_from_Cactus_grid - // - - // --> Cactus gridfn data for grid posn (0,0,0) - const fp* g_dd_11_dataptr; - const fp* g_dd_12_dataptr; - const fp* g_dd_13_dataptr; - const fp* g_dd_22_dataptr; - const fp* g_dd_23_dataptr; - const fp* g_dd_33_dataptr; - const fp* K_dd_11_dataptr; - const fp* K_dd_12_dataptr; - const fp* K_dd_13_dataptr; - const fp* K_dd_22_dataptr; - const fp* K_dd_23_dataptr; - const fp* K_dd_33_dataptr; - const fp* psi_dataptr; // NULL if !use_Cactus_conformal_metric }; // |