// misc.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 // #include #include #include #include #include "util_Table.h" #include "cctk.h" #include "cctk_Arguments.h" #include "config.h" #include "stdc.h" #include "../jtutil/util.hh" #include "../jtutil/array.hh" #include "../jtutil/cpm_map.hh" #include "../jtutil/linear_map.hh" #include "../patch/coords.hh" #include "../patch/grid.hh" #include "../patch/fd_grid.hh" #include "../patch/patch.hh" #include "../patch/patch_edge.hh" #include "../patch/patch_interp.hh" #include "../patch/ghost_zone.hh" #include "../patch/patch_system.hh" #include "../elliptic/Jacobian.hh" #include "gfns.hh" #include "gr.hh" //****************************************************************************** // // 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. // enum Jacobian_compute_method decode_Jacobian_compute_method(const char Jacobian_compute_method_string[]) { if (STRING_EQUAL(Jacobian_compute_method_string, "numerical perturbation")) then return Jacobian__numerical_perturbation; else if (STRING_EQUAL(Jacobian_compute_method_string, "symbolic differentiation with finite diff d/dr")) then return Jacobian__symbolic_diff_with_FD_dr; else if (STRING_EQUAL(Jacobian_compute_method_string, "symbolic differentiation")) then return Jacobian__symbolic_diff; else CCTK_VWarn(FATAL_ERROR, __LINE__, __FILE__, CCTK_THORNSTRING, "\n" " decode_Jacobian_compute_method():\n" " unknown Jacobian_compute_method_string=\"%s\"!", Jacobian_compute_method_string); /*NOTREACHED*/ }