diff options
author | jthorn <jthorn@f88db872-0e4f-0410-b76b-b9085cfa78c5> | 2003-12-03 23:25:24 +0000 |
---|---|---|
committer | jthorn <jthorn@f88db872-0e4f-0410-b76b-b9085cfa78c5> | 2003-12-03 23:25:24 +0000 |
commit | cada3378b043d7c8c0e7ee28ecc7087182d311ae (patch) | |
tree | 9ba537a8768a87bbfc2e4460d3aaf582c628928c /src/driver | |
parent | 75e72eb8d538dd35632d3228cb4cbd059e3942d2 (diff) |
At Ian Hawke's request, make the setting of an excision mask specifyable
on a per-horizon basis:
The old parameter set_mask is now replaced by two new parameters:
set_mask_for_all_horizons
set_mask_for_individual_horizon[n]
For most purposes, you can just change set_mask to
set_mask_for_all_horizons in your parameter files. If you
really want to control the setting of the mask on a per-horizon basis,
read section 4.6 in the thorn guide to find out how the new parameters
work.
git-svn-id: http://svn.einsteintoolkit.org/cactus/EinsteinAnalysis/AHFinderDirect/trunk@1222 f88db872-0e4f-0410-b76b-b9085cfa78c5
Diffstat (limited to 'src/driver')
-rw-r--r-- | src/driver/driver.hh | 5 | ||||
-rw-r--r-- | src/driver/find_horizons.cc | 2 | ||||
-rw-r--r-- | src/driver/mask.cc | 7 | ||||
-rw-r--r-- | src/driver/setup.cc | 29 |
4 files changed, 29 insertions, 14 deletions
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) |