aboutsummaryrefslogtreecommitdiff
path: root/src/gr
diff options
context:
space:
mode:
authorjthorn <jthorn@f88db872-0e4f-0410-b76b-b9085cfa78c5>2003-07-27 13:45:47 +0000
committerjthorn <jthorn@f88db872-0e4f-0410-b76b-b9085cfa78c5>2003-07-27 13:45:47 +0000
commit568744fb18e1e2fdd7453124e57c5c299251947e (patch)
treea229fb0f61de4a328e47c2dbbbe901f1e91e5dec /src/gr
parent4803dd5038921ea721184c950f69c0bf7ddfd0f3 (diff)
change enum geometry_method
to bool hardwire_Schwarzschild_geometry git-svn-id: http://svn.einsteintoolkit.org/cactus/EinsteinAnalysis/AHFinderDirect/trunk@1147 f88db872-0e4f-0410-b76b-b9085cfa78c5
Diffstat (limited to 'src/gr')
-rw-r--r--src/gr/expansion.cc66
-rw-r--r--src/gr/gr.hh38
-rw-r--r--src/gr/misc-gr.cc52
3 files changed, 25 insertions, 131 deletions
diff --git a/src/gr/expansion.cc b/src/gr/expansion.cc
index 7ddf6ee..3c25aad 100644
--- a/src/gr/expansion.cc
+++ b/src/gr/expansion.cc
@@ -203,50 +203,26 @@ if (active_flag)
}
// compute the "geometry" g_ij, K_ij, and partial_k g_ij
-switch (gi.geometry_method)
- {
-case geometry__global_interp_from_Cactus_grid:
-case geometry__local_interp_from_Cactus_grid:
+if (gi.hardwire_Schwarzschild_EF_geometry)
+ then {
+ if (active_flag)
+ then Schwarzschild_EF_geometry(*ps_ptr,
+ gi,
+ print_msg_flag);
+ }
+ else {
// this is the only function we call unconditionally; it looks at
// ps_ptr (non-NULL vs NULL) to choose a normal vs dummy computation
- {
- #ifdef GEOMETRY_INTERP_DEBUG
- printf("AHFinderDirect:: proc %d: about to call interpolate_geometry()\n",
- int(CCTK_MyProc(cgi.GH)));
- fflush(stdout);
- #endif
- const
- enum expansion_status status
- = interpolate_geometry(ps_ptr,
- cgi, gi,
- error_info, initial_flag,
- print_msg_flag);
- #ifdef GEOMETRY_INTERP_DEBUG
- printf("AHFinderDirect:: proc %d: interpolate_geometry() status=(int)%d\n",
- int(CCTK_MyProc(cgi.GH)), int(status));
- fflush(stdout);
- #endif
+ const enum expansion_status status
+ = interpolate_geometry(ps_ptr,
+ cgi, gi,
+ error_info, initial_flag,
+ print_msg_flag);
if (status != expansion_success)
then return status; // *** ERROR RETURN ***
- }
if (active_flag && cgi.use_Cactus_conformal_metric)
then convert_conformal_to_physical(*ps_ptr,
print_msg_flag);
- break;
-
-case geometry__Schwarzschild_EF:
- if (active_flag)
- then Schwarzschild_EF_geometry(*ps_ptr,
- gi,
- print_msg_flag);
- break;
-
-default:
- error_exit(PANIC_EXIT,
-"***** expansion(): unknown gi.geometry_method=(int)%d!\n"
-" (this should never happen!)\n"
- ,
- int(gi.geometry_method)); /*NOTREACHED*/
}
if (active_flag)
@@ -381,6 +357,7 @@ enum expansion_status
bool print_msg_flag)
{
const bool active_flag = (ps_ptr != NULL);
+const bool psi_flag = cgi.use_Cactus_conformal_metric;
//
// Implementation Notes:
@@ -395,16 +372,9 @@ const bool active_flag = (ps_ptr != NULL);
// if this is our first call).
//
-const char* const global_local_str
- = (gi.geometry_method == geometry__global_interp_from_Cactus_grid)
- ? "global"
- : "local";
-const bool psi_flag = cgi.use_Cactus_conformal_metric;
-
if (print_msg_flag)
then CCTK_VInfo(CCTK_THORNSTRING,
- " %s-interpolating %s from Cactus grid",
- global_local_str,
+ " interpolating %s from Cactus grid",
(psi_flag ? "{g_ij, K_ij, psi}" : "{g_ij, K_ij}"));
int status;
@@ -626,8 +596,7 @@ if (par_table_setup && (psi_flag == par_table_psi_flag))
//
if (print_msg_flag)
then CCTK_VInfo(CCTK_THORNSTRING,
- " calling %s interpolator (%s%d points)",
- global_local_str,
+ " calling geometry interpolator (%s%d points)",
(active_flag ? "" : "dummy: "), N_interp_points);
#ifdef GEOMETRY_INTERP_DEBUG
@@ -647,7 +616,7 @@ printf("AHFinderDirect:: proc %d: initializing interpolator outputs to 999.999\n
#endif
#ifdef GEOMETRY_INTERP_DEBUG
-printf("AHFinderDirect:: proc %d: calling global interpolator (N_interp_points=%d)\n",
+printf("AHFinderDirect:: proc %d: calling CCTK_InterpGridArrays(N_interp_points=%d)\n",
int(CCTK_MyProc(cgi.GH)), N_interp_points);
fflush(stdout);
#endif
@@ -655,7 +624,6 @@ fflush(stdout);
#ifdef GEOMETRY_INTERP_SYNC_SLEEP
sleep(1);
#endif
-
#ifdef GEOMETRY_INTERP_SYNC_BARRIER
CCTK_Barrier(cgi.GH);
#endif
diff --git a/src/gr/gr.hh b/src/gr/gr.hh
index a31148f..9fb02fb 100644
--- a/src/gr/gr.hh
+++ b/src/gr/gr.hh
@@ -10,17 +10,6 @@
enum { N_GRID_DIMS = 3, N_HORIZON_DIMS = 2 };
//
-// this enum holds the (a) decoded geometry_method parameter,
-// i.e. it specifies how we compute the (a) geometry
-//
-enum geometry_method
- {
- geometry__global_interp_from_Cactus_grid,
- geometry__local_interp_from_Cactus_grid,
- geometry__Schwarzschild_EF // no comma
- };
-
-//
// this enum holds the (a) decoded Jacobian_compute_method parameter,
// i.e. it specifies how we compute the (a) Jacobian matrix
//
@@ -74,6 +63,7 @@ enum expansion_status
struct cactus_grid_info
{
cGH *GH; // --> Cactus grid hierarchy
+ int coord_system_handle; // Cactus coordinate system handle
// this describes the semantics of the Cactus gij gridfns:
// true ==> the Cactus g_ij are conformal values as per
@@ -115,16 +105,7 @@ struct cactus_grid_info
int ijk_ceil_of_global_xyz (int axis, fp xyz) const
{ return jtutil::iceil(fp_ijk_of_global_xyz(axis, xyz)); }
- //
- // stuff for doing a global interpolation via CCTK_InterpGridArrays()
- // i.e. geometry_info.geometry_method
- // == geometry__global_interp_from_Cactus_grid
- //
-
- // Cactus coordinate system
- int coord_system_handle;
-
- // Cactus variable indices
+ // 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,
g_dd_33_varindex;
@@ -142,14 +123,16 @@ struct cactus_grid_info
//
struct geometry_info
{
- enum geometry_method geometry_method;
+ // normally false; true for testing/debugging
+ bool hardwire_Schwarzschild_EF_geometry;
- // parameters for geometry_method = interpolate_from_Cactus_grid
+ // parameters for the normal case
+ // hardwire_Schwarzschild_EF_geometry == false
int operator_handle; // Cactus handle to interpolation op
int param_table_handle; // Cactus handle to parameter table
// for the interpolator
- // parameters for geometry_method = Schwarzschild_EF
+ // parameters for hardwire_Schwarzschild_EF_geometry == true
fp geometry__Schwarzschild_EF__x_posn; // x posn of Schwarzschild BH
fp geometry__Schwarzschild_EF__y_posn; // y posn of Schwarzschild BH
fp geometry__Schwarzschild_EF__z_posn; // z posn of Schwarzschild BH
@@ -239,12 +222,7 @@ void Schwarzschild_EF_geometry(patch_system& ps,
const struct geometry_info& gi,
bool msg_flag);
-// misc.cc
-enum geometry_method
- decode_geometry_method(const char geometry_method_string[]);
-#ifdef NOT_USED
-bool geometry_method_is_interp(enum geometry_method geometry_method);
-#endif
+// misc-gr.cc
enum Jacobian_compute_method
decode_Jacobian_compute_method(const char Jacobian_compute_method_string[]);
const char* expansion_status_string(enum expansion_status status);
diff --git a/src/gr/misc-gr.cc b/src/gr/misc-gr.cc
index 9ca3d1f..cc9988f 100644
--- a/src/gr/misc-gr.cc
+++ b/src/gr/misc-gr.cc
@@ -1,11 +1,6 @@
// misc-gr.cc -- misc support routines
// $Header$
//
-// decode_geometry_method - decode the geometry_method parameter
-#ifdef NOT_USED
-// geomery_method_is_interp - does enum geometry_method specify interpolation?
-#endif
-// decode_geometry_method - decode the geometry_method parameter
// expansion_status_string - string describing expansion_status
//
@@ -42,53 +37,6 @@
//******************************************************************************
//
-// This function decodes the geometry_method parameter (string) into
-// an internal enum for future use.
-//
-enum geometry_method
- decode_geometry_method(const char geometry_method_string[])
-{
-if (STRING_EQUAL(geometry_method_string,
- "globally interpolate from Cactus grid"))
- then return geometry__global_interp_from_Cactus_grid;
-else if (STRING_EQUAL(geometry_method_string,
- "locally interpolate from Cactus grid"))
- then return geometry__local_interp_from_Cactus_grid;
-else if (STRING_EQUAL(geometry_method_string,
- "Schwarzschild/EF"))
- then return geometry__Schwarzschild_EF;
-else CCTK_VWarn(FATAL_ERROR, __LINE__, __FILE__, CCTK_THORNSTRING,
-"decode_geometry_method(): unknown geometry_method_string=\"%s\"!",
- geometry_method_string); /*NOTREACHED*/
-}
-
-//******************************************************************************
-
-#ifdef NOT_USED
-//
-// This function determines whether or not an enum geometry_method
-// value specifies an interpolation.
-//
-bool geometry_method_is_interp(enum geometry_method geometry_method)
-{
-switch (geometry_method)
- {
-case geometry__global_interp_from_Cactus_grid:
-case geometry__local_interp_from_Cactus_grid:
- return true;
-case geometry__Schwarzschild_EF:
- return false;
-default:
- CCTK_VWarn(FATAL_ERROR, __LINE__, __FILE__, CCTK_THORNSTRING,
-"geometry_method_is_interp(): unknown geometry_method=(int)%d!",
- geometry_method); /*NOTREACHED*/
- }
-}
-#endif
-
-//******************************************************************************
-
-//
// This function decodes the Jacobian_compute_method parameter (string) into
// an internal enum for future use.
//