aboutsummaryrefslogtreecommitdiff
path: root/src/gr
diff options
context:
space:
mode:
Diffstat (limited to 'src/gr')
-rw-r--r--src/gr/Schwarzschild_EF.cc9
-rw-r--r--src/gr/expansion.cc12
-rw-r--r--src/gr/gr.hh19
-rw-r--r--src/gr/make.code.defn2
4 files changed, 23 insertions, 19 deletions
diff --git a/src/gr/Schwarzschild_EF.cc b/src/gr/Schwarzschild_EF.cc
index 80869a4..598dd94 100644
--- a/src/gr/Schwarzschild_EF.cc
+++ b/src/gr/Schwarzschild_EF.cc
@@ -137,10 +137,13 @@ if (msg_flag)
const fp sigma = p.sigma_of_isigma(isigma);
fp local_x, local_y, local_z;
p.xyz_of_r_rho_sigma(r,rho,sigma, local_x, local_y, local_z);
+ const fp global_x = ps.origin_x() + local_x;
+ const fp global_y = ps.origin_y() + local_y;
+ const fp global_z = ps.origin_z() + local_z;
- const fp x_rel = ps.global_x_of_local_x(local_x) - x_posn;
- const fp y_rel = ps.global_y_of_local_y(local_y) - y_posn;
- const fp z_rel = ps.global_z_of_local_z(local_z) - z_posn;
+ const fp x_rel = global_x - x_posn;
+ const fp y_rel = global_y - y_posn;
+ const fp z_rel = global_z - z_posn;
// compute g_ij and K_ij
Schwarzschild_EF_gij_xyz(mass, epsilon,
diff --git a/src/gr/expansion.cc b/src/gr/expansion.cc
index f10106e..054e216 100644
--- a/src/gr/expansion.cc
+++ b/src/gr/expansion.cc
@@ -272,9 +272,9 @@ if (print_msg_flag)
fp local_x, local_y, local_z;
p.xyz_of_r_rho_sigma(r,rho,sigma, local_x,local_y,local_z);
- const fp global_x = ps.global_x_of_local_x(local_x);
- const fp global_y = ps.global_y_of_local_y(local_y);
- const fp global_z = ps.global_z_of_local_z(local_z);
+ const fp global_x = ps.origin_x() + local_x;
+ const fp global_y = ps.origin_y() + local_y;
+ const fp global_z = ps.origin_z() + local_z;
p.gridfn(gfns::gfn__global_x, irho,isigma) = global_x;
p.gridfn(gfns::gfn__global_y, irho,isigma) = global_y;
@@ -1019,9 +1019,9 @@ if (print_msg_flag)
const fp dsigma = jtutil::degrees_of_radians(sigma);
fp local_x, local_y, local_z;
p.xyz_of_r_rho_sigma(h,rho,sigma, local_x,local_y,local_z);
- const fp global_x = ps.global_x_of_local_x(local_x);
- const fp global_y = ps.global_y_of_local_y(local_y);
- const fp global_z = ps.global_z_of_local_z(local_z);
+ const fp global_x = ps.origin_x() + local_x;
+ const fp global_y = ps.origin_y() + local_y;
+ const fp global_z = ps.origin_z() + local_z;
CCTK_VWarn(error_info.warn_level__nonfinite_geometry,
__LINE__, __FILE__, CCTK_THORNSTRING,
"\n"
diff --git a/src/gr/gr.hh b/src/gr/gr.hh
index 8b66482..599008a 100644
--- a/src/gr/gr.hh
+++ b/src/gr/gr.hh
@@ -77,6 +77,16 @@ struct cactus_grid_info
// false ==> the Cactus g_ij are the physical metric
bool Cactus_conformal_metric;
+ // Cactus coordinate system
+ fp coord_origin[N_GRID_DIMS]; // (x,y,z) of grid posn (0,0,0)
+ 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, 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 gridfn_dims[N_GRID_DIMS];
+
//
// stuff for doing a global interpolation via CCTK_InterpGridArrays()
// i.e. geometry_info.geometry_method
@@ -101,15 +111,6 @@ struct cactus_grid_info
// == geometry__local_interp_from_Cactus_grid
//
- // Cactus coordinate system
- fp coord_origin[N_GRID_DIMS]; // (x,y,z) of grid posn (0,0,0)
- fp coord_delta[N_GRID_DIMS]; // (x,y,z) grid spacing
-
- // dimensions of gridfn data, 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 gridfn_dims[N_GRID_DIMS];
-
// --> Cactus gridfn data for grid posn (0,0,0)
const fp* g_dd_11_data;
const fp* g_dd_12_data;
diff --git a/src/gr/make.code.defn b/src/gr/make.code.defn
index bffea61..1a10449 100644
--- a/src/gr/make.code.defn
+++ b/src/gr/make.code.defn
@@ -5,7 +5,7 @@
SRCS = expansion.cc \
expansion_Jacobian.cc \
Schwarzschild_EF.cc \
- misc.cc
+ misc-gr.cc
# Subdirectories containing source files
SUBDIRS =