diff options
author | jthorn <jthorn@f88db872-0e4f-0410-b76b-b9085cfa78c5> | 2003-07-27 14:13:00 +0000 |
---|---|---|
committer | jthorn <jthorn@f88db872-0e4f-0410-b76b-b9085cfa78c5> | 2003-07-27 14:13:00 +0000 |
commit | 01cc4d16163b6d64eef20fab70c7c530d3e40ce7 (patch) | |
tree | 35b62a6f77bacdedbace1bad61544397a7f15ba4 | |
parent | b6a5c035ba5870ea3d2a1bd8b88e5f644b905f9e (diff) |
move mask processing stuff (about the Cactus grid)
out of gr / struct cactus_grid_info
into new driver / struct mask_grid_info which is private
to driver/mask.cc
--> also revise this info a bit to play better with Carpet
git-svn-id: http://svn.einsteintoolkit.org/cactus/EinsteinAnalysis/AHFinderDirect/trunk@1150 f88db872-0e4f-0410-b76b-b9085cfa78c5
-rw-r--r-- | src/README | 45 | ||||
-rw-r--r-- | src/driver/mask.cc | 214 | ||||
-rw-r--r-- | src/driver/setup.cc | 38 | ||||
-rw-r--r-- | src/gr/gr.hh | 34 | ||||
-rw-r--r-- | src/include/README | 6 |
5 files changed, 196 insertions, 141 deletions
@@ -1,33 +1,42 @@ This is the top-level source directory for the AHFinderDirect thorn. See ../doc/ for further documentation. -In this directory, + +Files in this directory: CODESTYLE documents some general programming conventions I have used in this thorn +make.code.defn usual Cactus definition of subdirectories + + +Subdirectories which are *not* used directly in compiling this thorn +within Cactus: +misc/ contains misc source code that's not part of the Cactus + executable, including the 'mpp' Maple preprocessor used + by the Maple code in other directories +maple/ contains Maple code to generate C/C++ from complicated + expressions + + +Subdirectories which *are* used directly in compiling this thorn +within Cactus; these are listed in top-down order (no code depends +on, or includes header files from, higher-level code): driver/ contains high-level driver routines to solve the Theta(h) = 0 equations and interface to the rest of Cactus +gr/ contains relativity code; all knowledge of the actual + apparent horizon equation lives in the code in this directory +gr.cg/ contains Maple-generated C code (generated from Maple + code in gr/ subdirectory) to compute the Theta(h) + function and its Jacobian coefficients elliptic/ contains code to solve elliptic equations on the multipatch $S^2$ sparse-matrix/ constains sparse-matrix libraries imported from outside this thorn -gr/ contains relativity code; all knowledge of the actual - apparent horizon equation lives in the code in this directory -gr.cg/ contains Maple-generated code to compute the Theta(h) - function and its Jacobian coefficients patch/ contains the basic multipatch infrastructure for storing and finite differencing gridfns in angular coordinates on the surface of a 2-sphere -jtutil/ contains various low-level utility routines - (templates and inline functions for things like - integer <--> floating-point linear maps, fuzzy - floating-point comparisons, N-dimensional arrays, etc); - except for one C function which will disappear once - Tom Goodale commits some pending Cactus-flesh changes) - all this code lives in the C++ namespace jtutil:: +jtutil/ contains various low-level utility routines for things + like integer <--> floating-point linear maps, fuzzy + floating-point comparisons, N-dimensional arrays, etc include/ contains common header files which don't live in any other - source directory -misc/ contains misc source code that doesn't fit anywhere else, - including the 'mpp' Maple preprocessor used by the Maple - code in other directories -maple/ contains Maple code to generate C/C++ from complicated - expressions + source directory; all compile-time options for this thorn + are configured here diff --git a/src/driver/mask.cc b/src/driver/mask.cc index 04a0b57..e654a63 100644 --- a/src/driver/mask.cc +++ b/src/driver/mask.cc @@ -2,8 +2,10 @@ // $Header$ // // <<<access to persistent data>>> -// <<<prototypes for functions local to this file>>> +/// <<<data structures local to this file>>> +/// <<<prototypes for functions local to this file>>> // AHFinderDirect_do_masks - top-level driver for all mask stuff +/// setup_mask_grid_info - setup mask grid origin/delta etc /// setup_mask_dataptrs_and_bitfields - map gridfn/bitfield names to ptr/bitmask /// set_mask_gridfn - set mask gridfn(s) based on each horizon's shape /// set_mask_gridfn_to_outside_value - ... "outside" value @@ -47,6 +49,9 @@ using jtutil::error_exit; #include "BH_diagnostics.hh" #include "driver.hh" +// define this to get extra debugging on the mask grid origin/delta etc +#undef DEBUG_MASK_GRID + //****************************************************************************** // @@ -57,23 +62,77 @@ extern struct state state; //****************************************************************************** // -// prototypes for functions local to this file +// ***** data structures local to this file ***** +// + +// +// This structure holds all the information we need about the (Cactus) +// grid where the mask gridfn(s) is/are stored. +// +namespace { +struct mask_grid_info + { + cGH *GH; // --> Cactus grid hierarchy + + // Cactus coordinate system + fp global_coord_origin[N_GRID_DIMS]; // global (x,y,z) + // = global origin + ijk*delta + fp local_coord_origin[N_GRID_DIMS]; // global (x,y,z) + // of (i,j,k) = (0,0,0) + // on this processor + fp coord_delta[N_GRID_DIMS]; // (x,y,z) grid spacing + fp mean_coord_delta; // geometric mean of x,y,z grid spacings + + // dimensions of gridfn data on this processor, viewed as a 3-D array + // n.b. storage ordering is Fortran, + // i.e. i is contiguous, j has stride Ni, k has stride Ni*Nj + CCTK_INT local_gridfn_dims[N_GRID_DIMS]; + + + // + // coordinate conversion functions + // + // here ijk = gridfn array indices on this processor + // xyz = floating-point global coordinates + // + + // convert integer ijk --> floating-point global xyz coordinates + fp global_xyz_of_ijk(int axis, int ijk) const + { return local_coord_origin[axis] + ijk*coord_delta[axis]; } + // convert floating-point global xyz --> integer ijk coordinates + // ... but as a floating-point number + fp fp_ijk_of_global_xyz(int axis, fp xyz) const + { return (xyz - local_coord_origin[axis]) / coord_delta[axis]; } + // convert floating-point global_xyz --> integer ijk coordinates + // ... rounding down/up to the next integer (= to the next grid point) + int ijk_floor_of_global_xyz(int axis, fp xyz) const + { return jtutil::ifloor(fp_ijk_of_global_xyz(axis, xyz)); } + int ijk_ceil_of_global_xyz (int axis, fp xyz) const + { return jtutil::iceil(fp_ijk_of_global_xyz(axis, xyz)); } + }; + } + +//****************************************************************************** + +// +// ***** prototypes for functions local to this file ***** // namespace { +void setup_mask_grid_info(CCTK_ARGUMENTS, struct mask_grid_info& mgi); void setup_mask_dataptrs_and_bitfields(const cGH *GH, struct mask_info& mask_info); void set_mask_gridfn(int N_horizons, const struct AH_data* const AH_data_array[], - const struct cactus_grid_info& cgi, + const struct mask_grid_info& mgi, const struct mask_info& mask_info, const struct verbose_info& verbose_info); -void set_mask_gridfn_to_outside_value(const struct cactus_grid_info& cgi, +void set_mask_gridfn_to_outside_value(const struct mask_grid_info& mgi, const struct mask_info& mask_info, const struct verbose_info& verbose_info); void set_mask_gridfn_to_inside_and_buffer_values - (const struct cactus_grid_info& cgi, + (const struct mask_grid_info& mgi, int use_min_i, int use_max_i, int use_min_j, int use_max_j, int use_min_k, int use_max_k, @@ -94,16 +153,24 @@ extern "C" DECLARE_CCTK_ARGUMENTS DECLARE_CCTK_PARAMETERS -const struct cactus_grid_info& cgi = state.cgi; -const struct verbose_info& verbose_info = state.verbose_info; - struct mask_info& mask_info = state.mask_info; +const struct verbose_info& verbose_info = state.verbose_info; + struct mask_info& mask_info = state.mask_info; // optionally set the mask gridfn based on each horizon's shape if (mask_info.set_mask) then { + // + // this setup has to be done each time we're called, and + // the mask_grid_info structure can't live in struct state , + // because if mesh refinement is in effect we'll be called + // separately for each separate locally-uniform grid patch + // + mask_grid_info mgi; + setup_mask_grid_info(CCTK_PASS_CTOC, mgi); + setup_mask_dataptrs_and_bitfields(cctkGH, mask_info); set_mask_gridfn(N_horizons, state.AH_data_array, - cgi, mask_info, + mgi, mask_info, verbose_info); } } @@ -111,6 +178,63 @@ if (mask_info.set_mask) //****************************************************************************** // +// This function sets up the mask_grid_info structure to describe +// the (current) Cactus grid where the mask gridfn(s) live. +// +namespace { +void setup_mask_grid_info(CCTK_ARGUMENTS, struct mask_grid_info& mgi) +{ +DECLARE_CCTK_ARGUMENTS + +mgi.GH = cctkGH; + +// Cactus grid spacing +mgi.coord_delta[X_AXIS] = CCTK_DELTA_SPACE(X_AXIS); +mgi.coord_delta[Y_AXIS] = CCTK_DELTA_SPACE(Y_AXIS); +mgi.coord_delta[Z_AXIS] = CCTK_DELTA_SPACE(Z_AXIS); +mgi.mean_coord_delta + = pow(mgi.coord_delta[X_AXIS]*mgi.coord_delta[Y_AXIS]*mgi.coord_delta[Z_AXIS], + 1.0/3.0); + +// get global/local Cactus grid origin +// KLUDGE -- is this the right way to get this?? +mgi.global_coord_origin[X_AXIS] = cctk_origin_space[X_AXIS]; +mgi.global_coord_origin[Y_AXIS] = cctk_origin_space[Y_AXIS]; +mgi.global_coord_origin[Z_AXIS] = cctk_origin_space[Z_AXIS]; +mgi.local_coord_origin[X_AXIS] = cctk_origin_space[X_AXIS] + + cctk_lbnd[X_AXIS] * mgi.coord_delta[X_AXIS]; +mgi.local_coord_origin[Y_AXIS] = cctk_origin_space[Y_AXIS] + + cctk_lbnd[Y_AXIS] * mgi.coord_delta[Y_AXIS]; +mgi.local_coord_origin[Z_AXIS] = cctk_origin_space[Z_AXIS] + + cctk_lbnd[Z_AXIS] * mgi.coord_delta[Z_AXIS]; +mgi.local_gridfn_dims[X_AXIS] = cctk_lsh[X_AXIS]; +mgi.local_gridfn_dims[Y_AXIS] = cctk_lsh[Y_AXIS]; +mgi.local_gridfn_dims[Z_AXIS] = cctk_lsh[Z_AXIS]; + +#ifdef DEBUG_MASK_GRID +printf("mask.cc:: cctk_lsh[] = [%d,%d,%d]\n", + int(cctk_lsh[X_AXIS]), + int(cctk_lsh[Y_AXIS]), + int(cctk_lsh[Z_AXIS])); +printf("mask.cc:: mgi.coord_delta[] = [%g,%g,%g]\n", + double(mgi.coord_delta[X_AXIS]), + double(mgi.coord_delta[Y_AXIS]), + double(mgi.coord_delta[Z_AXIS])); +printf("mask.cc:: mgi.global_coord_origin[] = [%g,%g,%g]\n", + double(mgi.global_coord_origin[X_AXIS]), + double(mgi.global_coord_origin[Y_AXIS]), + double(mgi.global_coord_origin[Z_AXIS])); +printf("mask.cc:: mgi.local_coord_origin[] = [%g,%g,%g]\n", + double(mgi.local_coord_origin[X_AXIS]), + double(mgi.local_coord_origin[Y_AXIS]), + double(mgi.local_coord_origin[Z_AXIS])); +#endif +} + } + +//****************************************************************************** + +// // This function maps the character-string names of the mask gridfn(s) // and/or bitfield(s) into internal data pointers and/or bit masks/values: // @@ -191,11 +315,11 @@ if (mask_info.set_new_style_mask) namespace { void set_mask_gridfn(int N_horizons, const struct AH_data* const AH_data_array[], - const struct cactus_grid_info& cgi, + const struct mask_grid_info& mgi, const struct mask_info& mask_info, const struct verbose_info& verbose_info) { -const fp Cactus_dx = cgi.mean_coord_delta; +const fp Cactus_dx = mgi.mean_coord_delta; const bool set_old_style_mask = mask_info.set_old_style_mask; const bool set_new_style_mask = mask_info.set_new_style_mask; const struct mask_info::old_style_mask_info& osmi = mask_info.old_style_mask_info; @@ -222,16 +346,16 @@ if (verbose_info.print_algorithm_debug) then { CCTK_VInfo(CCTK_THORNSTRING, " grid on this processor has x=[%g,%g]", - double(cgi.global_xyz_of_ijk(X_AXIS, 0)), - double(cgi.global_xyz_of_ijk(X_AXIS, cgi.local_gridfn_dims[X_AXIS]-1))); + double(mgi.global_xyz_of_ijk(X_AXIS, 0)), + double(mgi.global_xyz_of_ijk(X_AXIS, mgi.local_gridfn_dims[X_AXIS]-1))); CCTK_VInfo(CCTK_THORNSTRING, " y=[%g,%g]", - double(cgi.global_xyz_of_ijk(Y_AXIS, 0)), - double(cgi.global_xyz_of_ijk(Y_AXIS, cgi.local_gridfn_dims[Y_AXIS]-1))); + double(mgi.global_xyz_of_ijk(Y_AXIS, 0)), + double(mgi.global_xyz_of_ijk(Y_AXIS, mgi.local_gridfn_dims[Y_AXIS]-1))); CCTK_VInfo(CCTK_THORNSTRING, " z=[%g,%g]", - double(cgi.global_xyz_of_ijk(Z_AXIS, 0)), - double(cgi.global_xyz_of_ijk(Z_AXIS, cgi.local_gridfn_dims[Z_AXIS]-1))); + double(mgi.global_xyz_of_ijk(Z_AXIS, 0)), + double(mgi.global_xyz_of_ijk(Z_AXIS, mgi.local_gridfn_dims[Z_AXIS]-1))); } @@ -239,7 +363,7 @@ if (verbose_info.print_algorithm_debug) // set the mask to the outside value everywhere in // (this processor's chunk of) the grid // -set_mask_gridfn_to_outside_value(cgi, +set_mask_gridfn_to_outside_value(mgi, mask_info, verbose_info); @@ -265,12 +389,12 @@ set_mask_gridfn_to_outside_value(cgi, // horizon bounding box, rounded "out" to the next grid point - const int AH_min_i = cgi.ijk_floor_of_global_xyz(X_AXIS, BH_diagnostics.min_x); - const int AH_max_i = cgi.ijk_ceil_of_global_xyz (X_AXIS, BH_diagnostics.max_x); - const int AH_min_j = cgi.ijk_floor_of_global_xyz(Y_AXIS, BH_diagnostics.min_y); - const int AH_max_j = cgi.ijk_ceil_of_global_xyz (Y_AXIS, BH_diagnostics.max_y); - const int AH_min_k = cgi.ijk_floor_of_global_xyz(Z_AXIS, BH_diagnostics.min_z); - const int AH_max_k = cgi.ijk_ceil_of_global_xyz (Z_AXIS, BH_diagnostics.max_z); + const int AH_min_i = mgi.ijk_floor_of_global_xyz(X_AXIS, BH_diagnostics.min_x); + const int AH_max_i = mgi.ijk_ceil_of_global_xyz (X_AXIS, BH_diagnostics.max_x); + const int AH_min_j = mgi.ijk_floor_of_global_xyz(Y_AXIS, BH_diagnostics.min_y); + const int AH_max_j = mgi.ijk_ceil_of_global_xyz (Y_AXIS, BH_diagnostics.max_y); + const int AH_min_k = mgi.ijk_floor_of_global_xyz(Z_AXIS, BH_diagnostics.min_z); + const int AH_max_k = mgi.ijk_ceil_of_global_xyz (Z_AXIS, BH_diagnostics.max_z); if (verbose_info.print_algorithm_debug) then { CCTK_VInfo(CCTK_THORNSTRING, @@ -306,29 +430,29 @@ set_mask_gridfn_to_outside_value(cgi, // +-------------------------+ // const int use_min_i = jtutil::max(AH_min_i, 0); - const int use_max_i = jtutil::min(AH_max_i, cgi.local_gridfn_dims[X_AXIS]-1); + const int use_max_i = jtutil::min(AH_max_i, mgi.local_gridfn_dims[X_AXIS]-1); const int use_min_j = jtutil::max(AH_min_j, 0); - const int use_max_j = jtutil::min(AH_max_j, cgi.local_gridfn_dims[Y_AXIS]-1); + const int use_max_j = jtutil::min(AH_max_j, mgi.local_gridfn_dims[Y_AXIS]-1); const int use_min_k = jtutil::max(AH_min_k, 0); - const int use_max_k = jtutil::min(AH_max_k, cgi.local_gridfn_dims[Z_AXIS]-1); + const int use_max_k = jtutil::min(AH_max_k, mgi.local_gridfn_dims[Z_AXIS]-1); if (verbose_info.print_algorithm_debug) then { CCTK_VInfo(CCTK_THORNSTRING, " use bounding box is x=[%g,%g]", - double(cgi.global_xyz_of_ijk(X_AXIS, use_min_i)), - double(cgi.global_xyz_of_ijk(X_AXIS, use_max_i))); + double(mgi.global_xyz_of_ijk(X_AXIS, use_min_i)), + double(mgi.global_xyz_of_ijk(X_AXIS, use_max_i))); CCTK_VInfo(CCTK_THORNSTRING, " y=[%g,%g]", - double(cgi.global_xyz_of_ijk(Y_AXIS, use_min_j)), - double(cgi.global_xyz_of_ijk(Y_AXIS, use_max_j))); + double(mgi.global_xyz_of_ijk(Y_AXIS, use_min_j)), + double(mgi.global_xyz_of_ijk(Y_AXIS, use_max_j))); CCTK_VInfo(CCTK_THORNSTRING, " z=[%g,%g]", - double(cgi.global_xyz_of_ijk(Z_AXIS, use_min_k)), - double(cgi.global_xyz_of_ijk(Z_AXIS, use_max_k))); + double(mgi.global_xyz_of_ijk(Z_AXIS, use_min_k)), + double(mgi.global_xyz_of_ijk(Z_AXIS, use_max_k))); } - set_mask_gridfn_to_inside_and_buffer_values(cgi, + set_mask_gridfn_to_inside_and_buffer_values(mgi, use_min_i, use_max_i, use_min_j, use_max_j, use_min_k, use_max_k, @@ -349,7 +473,7 @@ set_mask_gridfn_to_outside_value(cgi, // option is set). // namespace { -void set_mask_gridfn_to_outside_value(const struct cactus_grid_info& cgi, +void set_mask_gridfn_to_outside_value(const struct mask_grid_info& mgi, const struct mask_info& mask_info, const struct verbose_info& verbose_info) { @@ -363,13 +487,13 @@ if (verbose_info.print_algorithm_details) then CCTK_VInfo(CCTK_THORNSTRING, " setting mask grid function to \"outside\""); - for (int k = 0 ; k < cgi.local_gridfn_dims[Z_AXIS] ; ++k) + for (int k = 0 ; k < mgi.local_gridfn_dims[Z_AXIS] ; ++k) { - for (int j = 0 ; j < cgi.local_gridfn_dims[Y_AXIS] ; ++j) + for (int j = 0 ; j < mgi.local_gridfn_dims[Y_AXIS] ; ++j) { - for (int i = 0 ; i < cgi.local_gridfn_dims[X_AXIS] ; ++i) + for (int i = 0 ; i < mgi.local_gridfn_dims[X_AXIS] ; ++i) { - const int posn = CCTK_GFINDEX3D(cgi.GH, i,j,k); + const int posn = CCTK_GFINDEX3D(mgi.GH, i,j,k); if (set_old_style_mask) then { const CCTK_REAL old_value = osmi.gridfn_dataptr[posn]; @@ -430,7 +554,7 @@ if (verbose_info.print_algorithm_details) // namespace { void set_mask_gridfn_to_inside_and_buffer_values - (const struct cactus_grid_info& cgi, + (const struct mask_grid_info& mgi, int use_min_i, int use_max_i, int use_min_j, int use_max_j, int use_min_k, int use_max_k, @@ -442,7 +566,7 @@ const bool set_old_style_mask = mask_info.set_old_style_mask; const bool set_new_style_mask = mask_info.set_new_style_mask; const struct mask_info::old_style_mask_info& osmi = mask_info.old_style_mask_info; const struct mask_info::new_style_mask_info& nsmi = mask_info.new_style_mask_info; -const fp Cactus_dx = cgi.mean_coord_delta; +const fp Cactus_dx = mgi.mean_coord_delta; long inside_count = 0; long buffer_count = 0; @@ -453,11 +577,11 @@ long buffer_count = 0; { for (int i = use_min_i ; i <= use_max_i ; ++i) { - const int posn = CCTK_GFINDEX3D(cgi.GH, i,j,k); + const int posn = CCTK_GFINDEX3D(mgi.GH, i,j,k); - const fp global_x = cgi.global_xyz_of_ijk(X_AXIS, i); - const fp global_y = cgi.global_xyz_of_ijk(Y_AXIS, j); - const fp global_z = cgi.global_xyz_of_ijk(Z_AXIS, k); + const fp global_x = mgi.global_xyz_of_ijk(X_AXIS, i); + const fp global_y = mgi.global_xyz_of_ijk(Y_AXIS, j); + const fp global_z = mgi.global_xyz_of_ijk(Z_AXIS, k); const fp local_x = global_x - ps.origin_x(); const fp local_y = global_y - ps.origin_y(); const fp local_z = global_z - ps.origin_z(); diff --git a/src/driver/setup.cc b/src/driver/setup.cc index 78de556..b5703da 100644 --- a/src/driver/setup.cc +++ b/src/driver/setup.cc @@ -53,9 +53,6 @@ using jtutil::error_exit; #include "BH_diagnostics.hh" #include "driver.hh" -// print extra debugging info concerning local/global Cactus coordinates -#undef DEBUG_COORDS - //****************************************************************************** // @@ -164,41 +161,6 @@ if (cgi.coord_system_handle < 0) coordinate_system_name); /*NOTREACHED*/ cgi.use_Cactus_conformal_metric = false; // dummy value, may change later -// get global/local Cactus grid origin -// KLUDGE -- is this the right way to get this?? -cgi.global_coord_origin[X_AXIS] = cctk_origin_space[X_AXIS]; -cgi.global_coord_origin[Y_AXIS] = cctk_origin_space[Y_AXIS]; -cgi.global_coord_origin[Z_AXIS] = cctk_origin_space[Z_AXIS]; -cgi.local_coord_origin[X_AXIS] = cctk_origin_space[X_AXIS] - + cctk_lbnd[X_AXIS] * cctk_delta_space[X_AXIS]; -cgi.local_coord_origin[Y_AXIS] = cctk_origin_space[Y_AXIS] - + cctk_lbnd[Y_AXIS] * cctk_delta_space[Y_AXIS]; -cgi.local_coord_origin[Z_AXIS] = cctk_origin_space[Z_AXIS] - + cctk_lbnd[Z_AXIS] * cctk_delta_space[Z_AXIS]; -cgi.coord_delta[X_AXIS] = cctk_delta_space[X_AXIS]; -cgi.coord_delta[Y_AXIS] = cctk_delta_space[Y_AXIS]; -cgi.coord_delta[Z_AXIS] = cctk_delta_space[Z_AXIS]; -cgi.mean_coord_delta - = pow(cgi.coord_delta[X_AXIS]*cgi.coord_delta[Y_AXIS]*cgi.coord_delta[Z_AXIS], - 1.0/3.0); -cgi.local_gridfn_dims[X_AXIS] = cctk_lsh[X_AXIS]; -cgi.local_gridfn_dims[Y_AXIS] = cctk_lsh[Y_AXIS]; -cgi.local_gridfn_dims[Z_AXIS] = cctk_lsh[Z_AXIS]; -#ifdef DEBUG_COORDS -printf("### cctk_origin_space[] = [%g,%g,%g]\n", - double(cctk_origin_space[X_AXIS]), - double(cctk_origin_space[Y_AXIS]), - double(cctk_origin_space[Z_AXIS])); -printf("### cctk_delta_space[] = [%g,%g,%g]\n", - double(cctk_delta_space[X_AXIS]), - double(cctk_delta_space[Y_AXIS]), - double(cctk_delta_space[Z_AXIS])); -printf("### cctk_lsh[] = [%d,%d,%d]\n", - int(cctk_lsh[X_AXIS]), - int(cctk_lsh[Y_AXIS]), - int(cctk_lsh[Z_AXIS])); -#endif // DEBUG_COORDS - cgi.g_dd_11_varindex = Cactus_gridfn_varindex("ADMBase::gxx"); cgi.g_dd_12_varindex = Cactus_gridfn_varindex("ADMBase::gxy"); cgi.g_dd_13_varindex = Cactus_gridfn_varindex("ADMBase::gxz"); diff --git a/src/gr/gr.hh b/src/gr/gr.hh index 9fb02fb..88877ac 100644 --- a/src/gr/gr.hh +++ b/src/gr/gr.hh @@ -71,40 +71,6 @@ struct cactus_grid_info // false ==> the Cactus g_ij are the physical metric bool use_Cactus_conformal_metric; - // Cactus coordinate system - fp global_coord_origin[N_GRID_DIMS]; // global (x,y,z) - // = global origin + ijk*delta - fp local_coord_origin[N_GRID_DIMS]; // global (x,y,z) - // of (i,j,k) = (0,0,0) - // on this processor - fp coord_delta[N_GRID_DIMS]; // (x,y,z) grid spacing - fp mean_coord_delta; // geometric mean of x,y,z grid spacings - - // dimensions of gridfn data on this processor, viewed as a 3-D array - // n.b. storage ordering is Fortran, - // i.e. i is contiguous, j has stride Ni, k has stride Ni*Nj - CCTK_INT local_gridfn_dims[N_GRID_DIMS]; - - // - // coordinate conversion functions - // here ijk = gridfn array indices on this processor - // xyz = floating-point global coordinates - // - - // convert integer ijk --> floating-point global xyz coordinates - fp global_xyz_of_ijk(int axis, int ijk) const - { return local_coord_origin[axis] + ijk*coord_delta[axis]; } - // convert floating-point global xyz --> integer ijk coordinates - // ... but as a floating-point number - fp fp_ijk_of_global_xyz(int axis, fp xyz) const - { return (xyz - local_coord_origin[axis]) / coord_delta[axis]; } - // convert floating-point global_xyz --> integer ijk coordinates - // ... rounding down/up to the next integer (= to the next grid point) - int ijk_floor_of_global_xyz(int axis, fp xyz) const - { return jtutil::ifloor(fp_ijk_of_global_xyz(axis, xyz)); } - int ijk_ceil_of_global_xyz (int axis, fp xyz) const - { return jtutil::iceil(fp_ijk_of_global_xyz(axis, xyz)); } - // Cactus variable indices of geometry variables int g_dd_11_varindex, g_dd_12_varindex, g_dd_13_varindex, g_dd_22_varindex, g_dd_23_varindex, diff --git a/src/include/README b/src/include/README index 84f80ed..8858d92 100644 --- a/src/include/README +++ b/src/include/README @@ -13,9 +13,3 @@ config.hh defines compile-time configuration for this thorn, eg the "fp" typedef (= CCTK_REAL), the choice of 2nd vs 4th order finite differencing, etc etc - -stl_vector.hh - This defines the STL vector class in the global namespace, - by #including the appropriate system header (either <vector.h> - or <vector> as appropriate for this platform), and possibly using - an explicit using declaration. |