aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--doc/TODO3
-rw-r--r--doc/documentation.tex10
-rw-r--r--param.ccl23
-rw-r--r--src/driver/find_horizons.cc11
-rw-r--r--src/driver/initial_guess.cc6
-rw-r--r--src/driver/setup.cc4
6 files changed, 48 insertions, 9 deletions
diff --git a/doc/TODO b/doc/TODO
index 16b8704..d552d9c 100644
--- a/doc/TODO
+++ b/doc/TODO
@@ -1,6 +1,7 @@
small things
set centroid variables for drift correction
- ??larger max_Newton_iterations for initial data than for time evolution??
+ somehow recover after we hit the edge of the grid
+ (right now we never move the trial horizon surface back again!)
do we work properly with fisheye?
medium things
diff --git a/doc/documentation.tex b/doc/documentation.tex
index 0774358..8226eaa 100644
--- a/doc/documentation.tex
+++ b/doc/documentation.tex
@@ -260,8 +260,14 @@ modern \Cplusplus{} compilers. As to specific \Cplusplus{} features\dots
or other low-level stuff templated on the floating-point or
integer datatype, and these templates are always instantiated
explicitly.
-\item \code{bool}, \code{mutable}, and \code{typename}]
- are used.
+\item \code{bool}, \code{mutable}, and \code{typename} are used.
+\item New-style casts are used, \eg{}
+ \begin{verbatim}
+ const CCTK_REAL* const_real_ptr(const void* vp)
+ {
+ return const_cast<const CCTK_REAL*>(vp);
+ }
+ \end{verbatim}
\item The code will work ok under either the archaic or the modern
\code{for}-loop declaration scope rules.
\item C header files are used in the pre-namespaces form
diff --git a/param.ccl b/param.ccl
index 3ab365b..da9ae57 100644
--- a/param.ccl
+++ b/param.ccl
@@ -146,7 +146,22 @@ real Jacobian_perturbation_amplitude \
# parameters for the Newton's-method solution of H(h) = 0
#
-int max_Newton_iterations "maximum number of Newton iterations before giving up"
+#
+# The first time we (try to) find a given horizon, our initial
+# guess is likely to be rather inaccurate, so we may need a
+# larger number of iterations. But if we've found this horizon
+# before, then we have its previous position as an initial guess,
+# so we shouldn't need as many iterations.
+#
+int max_Newton_iterations__initial \
+ "maximum number of Newton iterations before giving up \
+ when initially finding a given horizon"
+{
+(0:* :: "any positive integer"
+} 20
+int max_Newton_iterations__subsequent \
+ "maximum number of Newton iterations before giving up \
+ when re-finding a given horizon after finding it before"
{
(0:* :: "any positive integer"
} 10
@@ -270,9 +285,9 @@ private:
#
# For each apparent horizon, you need to set these parameters to the
-# Cactus xyz coordinates of an "origin point" inside the horizon, which
-# will serve as the origin for the apparent horizon finder's local angular
-# coordinate system.
+# Cactus xyz coordinates of a "local origin point" inside the horizon,
+# which will serve as the origin for the apparent horizon finder's
+# local angular coordinate system.
#
# The apparent horizon surface (and in fact all the trial surfaces the
# apparent horizon finder generates while iteratively solving the apparent
diff --git a/src/driver/find_horizons.cc b/src/driver/find_horizons.cc
index a228915..3d750d5 100644
--- a/src/driver/find_horizons.cc
+++ b/src/driver/find_horizons.cc
@@ -110,6 +110,17 @@ state.IO_info.time_iteration = cctk_iteration;
struct AH_info& AH_info = * state.AH_info_ptrs[hn];
patch_system& ps = *AH_info.ps_ptr;
+ //
+ // The first time we (try to) find a given horizon, our initial
+ // guess is likely to be rather inaccurate, so we may need a
+ // larger number of iterations. But if we've found this horizon
+ // before, then we have its previous position as an initial guess,
+ // so we shouldn't need as many iterations.
+ //
+ state.solver_info.max_Newton_iterations
+ = AH_info.AH_found ? max_Newton_iterations__subsequent
+ : max_Newton_iterations__initial;
+
AH_info.AH_found
= find_horizon(state.method,
verbose_info, state.timer_handle,
diff --git a/src/driver/initial_guess.cc b/src/driver/initial_guess.cc
index 2f55312..41961cc 100644
--- a/src/driver/initial_guess.cc
+++ b/src/driver/initial_guess.cc
@@ -279,7 +279,11 @@ if (print_msg_flag)
" expected exactly one r>0 solution to quadratic, got 0 or 2!\n"
" %s patch (irho,isigma)=(%d,%d) ==> (rho,sigma)=(%g,%g)\n"
" direction cosines (xcos,ycos,zcos)=(%g,%g,%g)\n"
-" ==> r_plus=%g r_minus=%g\n"
+" r_plus=%g r_minus=%g\n"
+" ==> this probably means the initial guess surface doesn't contain\n"
+" the local origin point, or more generally that the initial\n"
+" guess surface isn't a Strahlkoerper (\"star-shaped region\")\n"
+" with respect to the local origin point\n"
,
p.name(), irho, isigma,
double(rho), double(sigma),
diff --git a/src/driver/setup.cc b/src/driver/setup.cc
index 375e458..7b96884 100644
--- a/src/driver/setup.cc
+++ b/src/driver/setup.cc
@@ -145,7 +145,9 @@ Jac_info.Jacobian_storage_method
Jac_info.perturbation_amplitude = Jacobian_perturbation_amplitude;
struct solver_info& solver_info = state.solver_info;
-solver_info.max_Newton_iterations = max_Newton_iterations;
+solver_info.max_Newton_iterations = 0; // dummy value; actual value
+ // will be filled in by
+ // AHFinderDirect_find_horizons()
solver_info.max_Delta_h_over_h = max_Delta_h_over_h;
solver_info.H_norm_for_convergence = H_norm_for_convergence;
solver_info.Delta_h_norm_for_convergence = Delta_h_norm_for_convergence;