diff options
author | jthorn <jthorn@f88db872-0e4f-0410-b76b-b9085cfa78c5> | 2003-01-15 09:29:28 +0000 |
---|---|---|
committer | jthorn <jthorn@f88db872-0e4f-0410-b76b-b9085cfa78c5> | 2003-01-15 09:29:28 +0000 |
commit | ccd050da1496ca00845174ffcd4f4eaf22a9b792 (patch) | |
tree | db8483d2fd84f93d357cd709644f353483bd77bb /src/gr | |
parent | 2146d420048dfbec1bd4a0ed584d0e0e7c95f89c (diff) |
oops, forgot to add this file! :)
git-svn-id: http://svn.einsteintoolkit.org/cactus/EinsteinAnalysis/AHFinderDirect/trunk@919 f88db872-0e4f-0410-b76b-b9085cfa78c5
Diffstat (limited to 'src/gr')
-rw-r--r-- | src/gr/misc.cc | 106 |
1 files changed, 106 insertions, 0 deletions
diff --git a/src/gr/misc.cc b/src/gr/misc.cc new file mode 100644 index 0000000..58ab640 --- /dev/null +++ b/src/gr/misc.cc @@ -0,0 +1,106 @@ +// misc.cc -- misc support routines +// $Header$ +// +// decode_geometry_method - decode the geometry_method parameter +// geomery_method_is_interp - does enum geometry_method specify interpolation? +// decode_geometry_method - decode the geometry_method parameter +// + +#include <stdio.h> +#include <assert.h> +#include <math.h> + +#include "util_Table.h" +#include "cctk.h" +#include "cctk_Arguments.h" + +#include "stl_vector.hh" + +#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(-1, __LINE__, __FILE__, CCTK_THORNSTRING, +"decode_geometry_method(): unknown geometry_method_string=\"%s\"!", + geometry_method_string); /*NOTREACHED*/ +} + +//****************************************************************************** + +// +// 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(-1, __LINE__, __FILE__, CCTK_THORNSTRING, +"geometry_method_is_interp(): unknown geometry_method=(int)%d!", + geometry_method); /*NOTREACHED*/ + } +} + +//****************************************************************************** + +// +// This function decodes the Jacobian_method parameter (string) into +// an internal enum for future use. +// +enum Jacobian_method + decode_Jacobian_method(const char Jacobian_method_string[]) +{ +if (STRING_EQUAL(Jacobian_method_string, + "numerical perturbation")) + then return Jacobian_method__numerical_perturb; +else if (STRING_EQUAL(Jacobian_method_string, + "symbolic differentiation with finite diff d/dr")) + then return Jacobian_method__symbolic_diff_with_FD_dr; +else if (STRING_EQUAL(Jacobian_method_string, + "symbolic differentiation")) + then return Jacobian_method__symbolic_diff; +else CCTK_VWarn(-1, __LINE__, __FILE__, CCTK_THORNSTRING, +"decode_Jacobian_method(): unknown Jacobian_method_string=\"%s\"!", + Jacobian_method_string); /*NOTREACHED*/ +} |