diff options
author | jthorn <jthorn@f88db872-0e4f-0410-b76b-b9085cfa78c5> | 2002-07-29 15:17:03 +0000 |
---|---|---|
committer | jthorn <jthorn@f88db872-0e4f-0410-b76b-b9085cfa78c5> | 2002-07-29 15:17:03 +0000 |
commit | 96b02268829af3d1c4966d48883367c330849f25 (patch) | |
tree | e2d3358d0501019fff6048e78f7708a2143b393d /src/gr/driver.cc | |
parent | d5842d155c7762a82cf5c8c75b7976a52fdaee10 (diff) |
merge in changes from laptop:
- add support for condition number estimating when solving linear system
- cleanup Schw/EF analytic geometry option
- add option to dump h and H at each Newton iteration for debuggin
git-svn-id: http://svn.einsteintoolkit.org/cactus/EinsteinAnalysis/AHFinderDirect/trunk@669 f88db872-0e4f-0410-b76b-b9085cfa78c5
Diffstat (limited to 'src/gr/driver.cc')
-rw-r--r-- | src/gr/driver.cc | 47 |
1 files changed, 40 insertions, 7 deletions
diff --git a/src/gr/driver.cc b/src/gr/driver.cc index a9b9a13..eb4d629 100644 --- a/src/gr/driver.cc +++ b/src/gr/driver.cc @@ -4,6 +4,7 @@ // <<<prototypes for functions local to this file>>> // AHFinderDirect_driver - top-level driver /// decode_Jacobian_method - decode the Jacobian_method parameter +/// decode_geometry_method - decode the geometry_method parameter /// /// setup_Kerr_horizon - set up Kerr horizon in h (Kerr or Kerr-Schild coords) /// setup_ellipsoid - setup up a coordiante ellipsoid in h @@ -52,6 +53,9 @@ using jtutil::error_exit; namespace { enum Jacobian_method decode_Jacobian_method(const char Jacobian_method_string[]); +enum geometry_method + decode_geometry_method(const char geometry_method_string[]); + void setup_Kerr_horizon(patch_system& ps, fp x_posn, fp y_posn, fp z_posn, fp m, fp a, @@ -83,14 +87,9 @@ CCTK_VInfo(CCTK_THORNSTRING, "initializing AHFinderDirect data structures"); // set up the geometry parameters and the geometry interpolator // struct geometry_info gi; -gi.hardwire_Schwarzschild_EF = (hardwire_Schwarzschild_EF != 0); -gi.hardwire_Schwarzschild_EF__x_posn = hardwire_Schwarzschild_EF__x_posn; -gi.hardwire_Schwarzschild_EF__y_posn = hardwire_Schwarzschild_EF__y_posn; -gi.hardwire_Schwarzschild_EF__z_posn = hardwire_Schwarzschild_EF__z_posn; -gi.hardwire_Schwarzschild_EF__mass = hardwire_Schwarzschild_EF__mass; -gi.hardwire_Schwarzschild_EF__epsilon = hardwire_Schwarzschild_EF__epsilon; -gi.Delta_xyz = hardwire_Schwarzschild_EF__Delta_xyz; +gi.geometry_method = decode_geometry_method(geometry_method); +// parameters for geometry_method = "interpolate from Cactus grid" CCTK_VInfo(CCTK_THORNSTRING, " setting up geometry interpolator"); gi.operator_handle = CCTK_InterpHandle(geometry_interpolator_name); if (gi.operator_handle < 0) @@ -103,6 +102,14 @@ if (gi.param_table_handle < 0) "bad geometry-interpolator parameter(s) \"%s\"!", geometry_interpolator_pars); /*NOTREACHED*/ +// parameters for geometry_method = "Schwarzschild/EF" +gi.geometry__Schwarzschild_EF__mass = geometry__Schwarzschild_EF__mass; +gi.geometry__Schwarzschild_EF__x_posn = geometry__Schwarzschild_EF__x_posn; +gi.geometry__Schwarzschild_EF__y_posn = geometry__Schwarzschild_EF__y_posn; +gi.geometry__Schwarzschild_EF__z_posn = geometry__Schwarzschild_EF__z_posn; +gi.geometry__Schwarzschild_EF__epsilon = geometry__Schwarzschild_EF__epsilon; +gi.geometry__Schwarzschild_EF__Delta_xyz= geometry__Schwarzschild_EF__Delta_xyz; + // // set up the interpatch interpolator @@ -227,8 +234,14 @@ Jacobian_info.perturbation_amplitude = Jacobian_perturbation_amplitude; struct solver_info solver_info; solver_info.max_Newton_iterations = max_Newton_iterations; +solver_info.output_h_and_H_at_each_Newton_iteration + = (output_h_and_H_at_each_Newton_iteration != 0); +solver_info.h_file_name = h_file_name; +solver_info.H_of_h_file_name = H_of_h_file_name; solver_info.H_norm_for_convergence = H_norm_for_convergence; solver_info.Delta_h_norm_for_convergence = Delta_h_norm_for_convergence; +solver_info.final_H_update_if_exit_x_H_small + = (final_H_update_if_exit_x_H_small != 0); // // find the apparent horizon @@ -329,6 +342,26 @@ else CCTK_VWarn(-1, __LINE__, __FILE__, CCTK_THORNSTRING, } //****************************************************************************** + +// +// This function decodes the geometry_method parameter (string) into +// an internal enum for future use. +// +namespace { +enum geometry_method + decode_geometry_method(const char geometry_method_string[]) +{ +if (STRING_EQUAL(geometry_method_string, "interpolate from Cactus grid")) + then return geometry__interpolate_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, + "unknown geometry_method_string=\"%s\"!", + geometry_method_string); /*NOTREACHED*/ +} + } + +//****************************************************************************** //****************************************************************************** //****************************************************************************** |