From 3f089c600ca2860b10fa5120b6043ce7a7ada0af Mon Sep 17 00:00:00 2001 From: schnetter Date: Sat, 4 Oct 2008 02:27:16 +0000 Subject: Add new parameters track_origin_from_grid_scalar. They tell AHFinderDirect to look at certain grid scalars to reset the origin used for horizon finding. git-svn-id: http://svn.einsteintoolkit.org/cactus/EinsteinAnalysis/AHFinderDirect/trunk@1530 f88db872-0e4f-0410-b76b-b9085cfa78c5 --- param.ccl | 19 +++++++++++++++++++ src/driver/Newton.cc | 22 ++++++++++++++++++++++ 2 files changed, 41 insertions(+) diff --git a/param.ccl b/param.ccl index 412839e..11bdce9 100644 --- a/param.ccl +++ b/param.ccl @@ -1124,6 +1124,25 @@ boolean predict_origin_movement "predict origin movement when moving the origins { } "no" +boolean track_origin_from_grid_scalar[101] "track horizon origin from given grid scalars" STEERABLE=recover +{ +} "no" +string track_origin_source_x[101] "grid scalar containing the x component of the origin estimate" STEERABLE=recover +{ + "" :: "don't use this feature" + "[a-zA-Z_][a-zA-Z0-9_]*[:][:][a-zA-Z_][a-zA-Z0-9_]*(\[0-9+\])" :: "name of a grid scalar" +} "" +string track_origin_source_y[101] "grid scalar containing the x component of the origin estimate" STEERABLE=recover +{ + "" :: "don't use this feature" + "[a-zA-Z_][a-zA-Z0-9_]*[:][:][a-zA-Z_][a-zA-Z0-9_]*(\[0-9+\])" :: "name of a grid scalar" +} "" +string track_origin_source_z[101] "grid scalar containing the x component of the origin estimate" STEERABLE=recover +{ + "" :: "don't use this feature" + "[a-zA-Z_][a-zA-Z0-9_]*[:][:][a-zA-Z_][a-zA-Z0-9_]*(\[0-9+\])" :: "name of a grid scalar" +} "" + # # The "(rotating)" patch system types are ok for evaluating Theta(h), # but alas they don't work yet for apparent horizon finding diff --git a/src/driver/Newton.cc b/src/driver/Newton.cc index 62bab31..26460d2 100644 --- a/src/driver/Newton.cc +++ b/src/driver/Newton.cc @@ -331,6 +331,28 @@ if (hs.has_genuine_horizons()) ps.synchronize(); } } + if (track_origin_from_grid_scalar[hn] && AH_data_ptr->depends_on == 0) { + // move the origin as specified in the grid scalars + fp const * const ox = + static_cast + (CCTK_VarDataPtr (cctkGH, 0, track_origin_source_x[hn])); + assert (ox); + fp const * const oy = + static_cast + (CCTK_VarDataPtr (cctkGH, 0, track_origin_source_y[hn])); + assert (oy); + fp const * const oz = + static_cast + (CCTK_VarDataPtr (cctkGH, 0, track_origin_source_z[hn])); + assert (oz); + if (verbose_info.print_algorithm_highlights) { + std::cout << "AHF tracked position ox " << *ox << " oy " << *oy << " oz " << *oz << std::endl; + } + patch_system& ps = *ps_ptr; + ps.origin_x (*ox); + ps.origin_y (*oy); + ps.origin_z (*oz); + } // modify the initial guess jtutil::norm norms; -- cgit v1.2.3