diff options
author | jthorn <jthorn@f88db872-0e4f-0410-b76b-b9085cfa78c5> | 2002-09-11 12:11:44 +0000 |
---|---|---|
committer | jthorn <jthorn@f88db872-0e4f-0410-b76b-b9085cfa78c5> | 2002-09-11 12:11:44 +0000 |
commit | 38b3c7d1fb08136eacf75862487e197804fb0cb7 (patch) | |
tree | 641ea2ed7971a00cf34fd62beea4731190d3bdfc | |
parent | 258d49b190be82834083f6f52870445de47514c6 (diff) |
adjust verbosity controls on CCTK_VInfo() printing
git-svn-id: http://svn.einsteintoolkit.org/cactus/EinsteinAnalysis/AHFinderDirect/trunk@717 f88db872-0e4f-0410-b76b-b9085cfa78c5
-rw-r--r-- | src/driver/initial_guess.cc | 90 |
1 files changed, 44 insertions, 46 deletions
diff --git a/src/driver/initial_guess.cc b/src/driver/initial_guess.cc index 7bb62df..94d81d2 100644 --- a/src/driver/initial_guess.cc +++ b/src/driver/initial_guess.cc @@ -40,7 +40,7 @@ using jtutil::error_exit; #include "../gr/gfns.hh" #include "../gr/gr.hh" -#include "AHFinderDirect.hh" +#include "driver.hh" //****************************************************************************** @@ -60,7 +60,7 @@ void setup_Kerr_horizon(patch_system& ps, fp x_posn, fp y_posn, fp z_posn, fp m, fp a, bool Kerr_Schild_flag, - bool my_print_msg_flag, bool ellipsoid_print_msg_flag); + const struct verbose_info& verbose_info); void setup_ellipsoid(patch_system& ps, fp x_center, fp y_center, fp z_center, fp x_radius, fp y_radius, fp z_radius, @@ -78,24 +78,44 @@ extern "C" { DECLARE_CCTK_ARGUMENTS DECLARE_CCTK_PARAMETERS - -const bool print_msg_flag - = state.verbose_level >= verbose_level__algorithm_highlights; -const bool print_more_msg_flag - = state.verbose_level >= verbose_level__algorithm_details; +const struct verbose_info& verbose_info = state.verbose_info; struct IO_info& IO_info = state.IO_info; IO_info.time_iteration = cctk_iteration; - for (int hn = 0 ; hn < state.N_horizons ; ++hn) + for (int hn = 1 ; hn <= state.N_horizons ; ++hn) { struct AH_info& AH_info = * state.AH_info_ptrs[hn]; patch_system& ps = * AH_info.ps_ptr; + if (verbose_info.print_algorithm_highlights) + then CCTK_VInfo(CCTK_THORNSTRING, + "setting initial guess for horizon shape h"); + if (STRING_EQUAL(initial_guess_method, "read from file")) then input_gridfn(ps, gfns::gfn__h, IO_info, IO_info.h_base_file_name, - hn, print_msg_flag); + hn, verbose_info.print_algorithm_highlights); + + else if (STRING_EQUAL(initial_guess_method, "Kerr/Kerr")) + then setup_Kerr_horizon(ps, + initial_guess__Kerr__x_posn[hn], + initial_guess__Kerr__y_posn[hn], + initial_guess__Kerr__z_posn[hn], + initial_guess__Kerr__mass[hn], + initial_guess__Kerr__spin[hn], + false, // Kerr coordinates + verbose_info); + else if (STRING_EQUAL(initial_guess_method, "Kerr/Kerr-Schild")) + then setup_Kerr_horizon(ps, + initial_guess__Kerr__x_posn[hn], + initial_guess__Kerr__y_posn[hn], + initial_guess__Kerr__z_posn[hn], + initial_guess__Kerr__mass[hn], + initial_guess__Kerr__spin[hn], + true, // Kerr-Schild coordinates + verbose_info); + else if (STRING_EQUAL(initial_guess_method, "sphere")) then setup_ellipsoid(ps, initial_guess__sphere__x_center[hn], @@ -104,7 +124,7 @@ IO_info.time_iteration = cctk_iteration; initial_guess__sphere__radius[hn], initial_guess__sphere__radius[hn], initial_guess__sphere__radius[hn], - print_msg_flag); + verbose_info.print_algorithm_highlights); else if (STRING_EQUAL(initial_guess_method, "ellipsoid")) then setup_ellipsoid(ps, initial_guess__ellipsoid__x_center[hn], @@ -113,25 +133,8 @@ IO_info.time_iteration = cctk_iteration; initial_guess__ellipsoid__x_radius[hn], initial_guess__ellipsoid__y_radius[hn], initial_guess__ellipsoid__z_radius[hn], - print_msg_flag); - else if (STRING_EQUAL(initial_guess_method, "Kerr/Kerr")) - then setup_Kerr_horizon(ps, - initial_guess__Kerr__x_posn[hn], - initial_guess__Kerr__y_posn[hn], - initial_guess__Kerr__z_posn[hn], - initial_guess__Kerr__mass[hn], - initial_guess__Kerr__spin[hn], - false, // use Kerr coords - print_msg_flag, print_more_msg_flag); - else if (STRING_EQUAL(initial_guess_method, "Kerr/Kerr-Schild")) - then setup_Kerr_horizon(ps, - initial_guess__Kerr__x_posn[hn], - initial_guess__Kerr__y_posn[hn], - initial_guess__Kerr__z_posn[hn], - initial_guess__Kerr__mass[hn], - initial_guess__Kerr__spin[hn], - true, // use Kerr-Schild coords - print_msg_flag, print_more_msg_flag); + verbose_info.print_algorithm_highlights); + else CCTK_VWarn(-1, __LINE__, __FILE__, CCTK_THORNSTRING, "unknown initial_guess_method=\"%s\"!", initial_guess_method); /*NOTREACHED*/ @@ -140,7 +143,7 @@ IO_info.time_iteration = cctk_iteration; if (output_initial_guess != 0) then output_gridfn(ps, gfns::gfn__h, IO_info, IO_info.h_base_file_name, - hn, print_msg_flag); + hn, verbose_info.print_algorithm_highlights); } } @@ -159,25 +162,21 @@ IO_info.time_iteration = cctk_iteration; // a=J/m^2 dimensionless, while MTW take a=J/m=m*(my a). // Kerr_Schild_flag = false to use Kerr coordinates, // true to use Kerr-Schild coordinates -// my_print_msg_flag = true to print messages about the Kerr horizon itself, -// false to skip these -// ellipsoid_print_msg_flag = true to print messages about the ellipsoid -// shape of the Kerr horizon, -// false to skip these +// verbose_info = controls what messages we print // namespace { void setup_Kerr_horizon(patch_system& ps, fp x_posn, fp y_posn, fp z_posn, fp m, fp a, bool Kerr_Schild_flag, - bool my_print_msg_flag, bool ellipsoid_print_msg_flag) + const struct verbose_info& verbose_info) { const char* const name = Kerr_Schild_flag ? "Kerr-Schild" : "Kerr"; -if (my_print_msg_flag) +if (verbose_info.print_algorithm_highlights) then { CCTK_VInfo(CCTK_THORNSTRING, - "setting up Kerr/%s initial guess", + " setting Kerr/%s horizon shape", name); CCTK_VInfo(CCTK_THORNSTRING, " posn=(%g,%g,%g) mass=%g spin=J/m^2=%g", @@ -192,23 +191,22 @@ const fp r = m * (1.0 + sqrt(1.0 - a*a)); const fp z_radius = r; const fp xy_radius = Kerr_Schild_flag ? r * sqrt(1.0 + a*a*m*m/(r*r)) : r; -if (ellipsoid_print_msg_flag) +if (verbose_info.print_algorithm_details) then CCTK_VInfo(CCTK_THORNSTRING, - " horizon is coordinate %s", + " setting coordinate %s", Kerr_Schild_flag ? "ellipsoid" : "sphere"); setup_ellipsoid(ps, x_posn, y_posn, z_posn, xy_radius, xy_radius, z_radius, - ellipsoid_print_msg_flag); + verbose_info.print_algorithm_details); } } //****************************************************************************** // -// This function sets up an ellipsoid in the gridfn h, using the -// formulas in "ellipsoid.maple" and the Maple-generated C code in -// "ellipsoid.c": +// This function sets up an ellipsoid initial guess, using the formulas +// in "ellipsoid.maple" and the Maple-generated C code in "ellipsoid.c": // // ellipsoid has center (A,B,C), radius (a,b,c) // angular coordinate system has center (U,V,W) @@ -235,10 +233,10 @@ void setup_ellipsoid(patch_system& ps, if (print_msg_flag) then { CCTK_VInfo(CCTK_THORNSTRING, - "setting h = ellipsoid: center=(%g,%g,%g)", + " setting ellipsoid: center=(%g,%g,%g)", double(x_center), double(y_center), double(z_center)); CCTK_VInfo(CCTK_THORNSTRING, - " radius=(%g,%g,%g)", + " radius=(%g,%g,%g)", double(x_radius), double(y_radius), double(z_radius)); } |