aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--doc/documentation.tex24
-rw-r--r--par/bl-different-mask-min-radius-points=5.par2
-rw-r--r--par/bl-different-mask.par2
-rw-r--r--par/misner-mask-noshrink.par2
-rw-r--r--par/misner-mask-xnoshrink.par2
-rw-r--r--param.ccl9
-rw-r--r--schedule.ccl53
-rw-r--r--src/driver/driver.hh5
-rw-r--r--src/driver/find_horizons.cc2
-rw-r--r--src/driver/mask.cc7
-rw-r--r--src/driver/setup.cc29
11 files changed, 81 insertions, 56 deletions
diff --git a/doc/documentation.tex b/doc/documentation.tex
index 4f12788..d04fb72 100644
--- a/doc/documentation.tex
+++ b/doc/documentation.tex
@@ -878,18 +878,26 @@ with respect to the apparent horizon(s). This is usually used for
excision.
\begin{description}
-\item[\code{set\_mask}]
+\item[%%%
+ \begin{tabular}{@{}l@{}}
+ \code{set\_mask\_for\_all\_horizons} \\
+ \code{set\_mask\_for\_individual\_horizon[}$n$\code{]} %%%\\
+ \end{tabular}
+ ]
\mbox{}\\
- If this Boolean parameter is set to true,
- \thorn{AHFinderDirect} will set a mask grid function(s).
- This parameter defaults to false (don't set a mask).
-
- If this parameter is set to true, you almost certainly also
- need to set the Boolean parameter \verb|SpaceMask::use_mask|
+ These Boolean parameters control whether \thorn{AHFinderDirect}
+ should set a mask grid function(s): If the (C) expression
+ \verb:set_mask_for_all_horizons || set_mask_for_individual_horizon[i]:
+ is true, then \thorn{AHFinderDirect} will set a mask grid
+ function(s) for apparent horizon $i$.
+ All these parameters default to false (don't set a mask).
+
+ If any of these parameters is set to true, you almost certainly
+ also need to set the Boolean parameter \verb|SpaceMask::use_mask|
to true to to turn on storage for the mask grid function(s)!
\end{description}
-If \verb|set_mask| is set, \thorn{AHFinderDirect} partitions the
+If it's setting a mask(s), \thorn{AHFinderDirect} partitions the
Cactus grid into 3~regions: an \defn{inside}, a \defn{buffer},
and an \defn{outside}. Typically the inner region is excised, but
\thorn{AHFinderDirect} doesn't itself do this: It just sets the mask(s);
diff --git a/par/bl-different-mask-min-radius-points=5.par b/par/bl-different-mask-min-radius-points=5.par
index 581efab..68ff3c7 100644
--- a/par/bl-different-mask-min-radius-points=5.par
+++ b/par/bl-different-mask-min-radius-points=5.par
@@ -81,7 +81,7 @@ AHFinderDirect::verbose_level = "algorithm details"
AHFinderDirect::h_base_file_name = "bl-different-mask-min-radius-points=5.h"
AHFinderDirect::BH_diagnostics_base_file_name = "bl-different-mask-min-radius-points=5.BH_diagnostics"
-AHFinderDirect::set_mask = "true"
+AHFinderDirect::set_mask_for_all_horizons = "true"
AHFinderDirect::set_old_style_mask = "true"
# inside = horizon - 5 grid points
# buffer = from there out to horizon
diff --git a/par/bl-different-mask.par b/par/bl-different-mask.par
index 212f0cb..df4740f 100644
--- a/par/bl-different-mask.par
+++ b/par/bl-different-mask.par
@@ -81,7 +81,7 @@ AHFinderDirect::verbose_level = "algorithm details"
AHFinderDirect::h_base_file_name = "bl-different-mask.h"
AHFinderDirect::BH_diagnostics_base_file_name = "bl-different-mask.BH_diagnostics"
-AHFinderDirect::set_mask = "true"
+AHFinderDirect::set_mask_for_all_horizons = "true"
AHFinderDirect::set_old_style_mask = "true"
# inside = horizon - 5 grid points
# buffer = from there out to horizon
diff --git a/par/misner-mask-noshrink.par b/par/misner-mask-noshrink.par
index 618b250..2b4577b 100644
--- a/par/misner-mask-noshrink.par
+++ b/par/misner-mask-noshrink.par
@@ -76,7 +76,7 @@ ActiveThorns = "always AEILocalInterp PUGHInterp PUGHReduce AHFinderDirect"
AHFinderDirect::print_timing_stats = "true"
##AHFinderDirect::verbose_level = "algorithm details"
-AHFinderDirect::set_mask = "true"
+AHFinderDirect::set_mask_for_all_horizons = "true"
AHFinderDirect::set_old_style_mask = "true"
AHFinderDirect::set_new_style_mask = "false"
diff --git a/par/misner-mask-xnoshrink.par b/par/misner-mask-xnoshrink.par
index dc25b77..afdfe4a 100644
--- a/par/misner-mask-xnoshrink.par
+++ b/par/misner-mask-xnoshrink.par
@@ -76,7 +76,7 @@ ActiveThorns = "always AEILocalInterp PUGHInterp PUGHReduce AHFinderDirect"
AHFinderDirect::print_timing_stats = "true"
##AHFinderDirect::verbose_level = "algorithm details"
-AHFinderDirect::set_mask = "true"
+AHFinderDirect::set_mask_for_all_horizons = "true"
AHFinderDirect::set_old_style_mask = "true"
AHFinderDirect::set_new_style_mask = "false"
diff --git a/param.ccl b/param.ccl
index aa31186..2c5b69b 100644
--- a/param.ccl
+++ b/param.ccl
@@ -472,8 +472,13 @@ string Jacobian_base_file_name "base file name for Jacobian output file(s)"
# ***** based on each apparent horizon shape *****
#
-boolean set_mask \
- "should we set a mask grid function (or functions) for each horizon?"
+boolean set_mask_for_all_horizons \
+ "should we set a mask grid function (or functions) for all horizons?"
+{
+} "false"
+
+boolean set_mask_for_individual_horizon[11] \
+ "should we set a mask grid function (or functions) for *this* horizon?"
{
} "false"
diff --git a/schedule.ccl b/schedule.ccl
index 0f6d05d..4ea2702 100644
--- a/schedule.ccl
+++ b/schedule.ccl
@@ -27,34 +27,31 @@ if (find_every != 0)
} "announce horizon position(s) to other thorns"
}
- if (set_mask != 0)
- {
- #
- # *** KLUDGE ***
- #
- # We would really like to give this routine the
- # options:global
- # attribute, so it only runs on those time levels where
- # we've found (or at least tried to fnid) horizons. But
- # this doesn't work, because we need a GH -- and the other
- # thorns' routines we call need valid grid variables in
- # it -- in the announcing code, and options:global
- # routines don't have a "normal" GH, but instead a special
- # one without usual grid variables defined in the usual
- # manner.
- #
- # So, what to do? The present kludge is to have this
- # routine called on every grid, then have it explicitly
- # test if it's at a horizon-finding time and on a base
- # grid.
- #
- schedule AHFinderDirect_do_masks at CCTK_ANALYSIS \
- after AHFinderDirect_find_horizons
- {
- lang: C
- triggers: always
- } "set mask(s) based on apparent horizon position(s)"
- }
+ #
+ # *** KLUDGE ***
+ #
+ # We would really like to give this routine the
+ # options:global
+ # attribute, so it only runs on those time levels where
+ # we've found (or at least tried to fnid) horizons. But
+ # this doesn't work, because we need a GH -- and the other
+ # thorns' routines we call need valid grid variables in
+ # it -- in the announcing code, and options:global
+ # routines don't have a "normal" GH, but instead a special
+ # one without usual grid variables defined in the usual
+ # manner.
+ #
+ # So, what to do? The present kludge is to have this
+ # routine called on every grid, then have it explicitly
+ # test if it's at a horizon-finding time and on a base
+ # grid.
+ #
+ schedule AHFinderDirect_maybe_do_masks at CCTK_ANALYSIS \
+ after AHFinderDirect_find_horizons
+ {
+ lang: C
+ triggers: always
+ } "set mask(s) based on apparent horizon position(s)"
}
########################################
diff --git a/src/driver/driver.hh b/src/driver/driver.hh
index 1179839..71cb488 100644
--- a/src/driver/driver.hh
+++ b/src/driver/driver.hh
@@ -191,7 +191,8 @@ struct verbose_info
//
struct mask_info
{
- bool set_mask;
+ bool set_mask_for_any_horizon;
+ bool* set_mask_for_this_horizon;
CCTK_REAL radius_multiplier, radius_offset;
CCTK_REAL buffer_thickness;
bool mask_is_noshrink;
@@ -380,7 +381,7 @@ extern "C"
// mask.cc
// ... called from Cactus Scheduler
extern "C"
- void AHFinderDirect_do_masks(CCTK_ARGUMENTS);
+ void AHFinderDirect_maybe_do_masks(CCTK_ARGUMENTS);
// initial_guess.cc
void setup_initial_guess(patch_system& ps,
diff --git a/src/driver/find_horizons.cc b/src/driver/find_horizons.cc
index 4f74ade..8975341 100644
--- a/src/driver/find_horizons.cc
+++ b/src/driver/find_horizons.cc
@@ -105,7 +105,7 @@ if (state.timer_handle >= 0)
const int my_proc = state.my_proc;
horizon_sequence& hs = *state.my_hs;
const bool active_flag = hs.has_genuine_horizons();
-const bool broadcast_horizon_shape = state.mask_info.set_mask;
+const bool broadcast_horizon_shape = state.mask_info.set_mask_for_any_horizon;
struct cactus_grid_info& cgi = state.cgi;
const struct geometry_info& gi = state.gi;
diff --git a/src/driver/mask.cc b/src/driver/mask.cc
index 5a36f5f..baa08d4 100644
--- a/src/driver/mask.cc
+++ b/src/driver/mask.cc
@@ -168,7 +168,7 @@ fp outer_mask_radius(const struct mask_grid_info& mgi,
// apparent horizons, to do all this thorn's mask processing.
//
extern "C"
- void AHFinderDirect_do_masks(CCTK_ARGUMENTS)
+ void AHFinderDirect_maybe_do_masks(CCTK_ARGUMENTS)
{
DECLARE_CCTK_ARGUMENTS
DECLARE_CCTK_PARAMETERS
@@ -177,7 +177,7 @@ const struct verbose_info& verbose_info = state.verbose_info;
struct mask_info& mask_info = state.mask_info;
// optionally set the mask gridfn based on each horizon's shape
-if (mask_info.set_mask)
+if (mask_info.set_mask_for_any_horizon)
then {
//
// this setup has to be done each time we're called, and
@@ -412,6 +412,9 @@ set_mask_gridfn_to_outside_value(mgi,
//
for (int hn = 1 ; hn <= N_horizons ; ++hn)
{
+ if (! mask_info.set_mask_for_this_horizon[hn])
+ then continue; // *** LOOP CONTROL ***
+
const struct AH_data& AH_data = *AH_data_array[hn];
if (! AH_data.found_flag)
then continue; // *** LOOP CONTROL ***
diff --git a/src/driver/setup.cc b/src/driver/setup.cc
index 1eb977f..fc8fdee 100644
--- a/src/driver/setup.cc
+++ b/src/driver/setup.cc
@@ -238,11 +238,9 @@ solver_info.max_Newton_iterations__subsequent
= max_Newton_iterations__subsequent;
solver_info.max_allowable_Delta_h_over_h = max_allowable_Delta_h_over_h;
solver_info.Theta_norm_for_convergence = Theta_norm_for_convergence;
-solver_info.max_allowable_horizon_radius
- = new double[state.N_horizons+1]; // horizon numbers run from
- // 1 to N_horizons inclusive
- // so the array size is
- // N_horizons+1
+// ... horizon numbers run from 1 to N_horizons inclusive
+// so the array size is N_horizons+1
+solver_info.max_allowable_horizon_radius = new double[state.N_horizons+1];
{
for (int hn = 0 ; hn <= N_horizons ; ++hn)
{
@@ -299,8 +297,21 @@ state.BH_diagnostics_info.integral_method
// mask parameters
//
struct mask_info& mask_info = state.mask_info;
-mask_info.set_mask = (set_mask != 0);
-if (mask_info.set_mask)
+mask_info.set_mask_for_any_horizon = false;
+// ... horizon numbers run from 1 to N_horizons inclusive
+// so the array size is N_horizons+1
+mask_info.set_mask_for_this_horizon = new bool[N_horizons+1];
+ {
+ for (int hn = 1 ; hn <= N_horizons ; ++hn)
+ {
+ mask_info.set_mask_for_this_horizon[hn]
+ = (set_mask_for_all_horizons != 0)
+ || (set_mask_for_individual_horizon[hn] != 0);
+ mask_info.set_mask_for_any_horizon
+ |= mask_info.set_mask_for_this_horizon[hn];
+ }
+ }
+if (mask_info.set_mask_for_any_horizon)
then {
mask_info.radius_multiplier = mask_radius_multiplier;
mask_info.radius_offset = mask_radius_offset;
@@ -359,8 +370,8 @@ state.N_active_procs
hs,
verbose_info);
-// horizon numbers run from 1 to N_horizons inclusive
-// so the array size is N_horizons+1
+// ... horizon numbers run from 1 to N_horizons inclusive
+// so the array size is N_horizons+1
state.AH_data_array = new AH_data*[N_horizons+1];
{
for (int hn = 0 ; hn <= N_horizons ; ++hn)