diff options
author | jthorn <jthorn@f88db872-0e4f-0410-b76b-b9085cfa78c5> | 2003-11-20 16:03:21 +0000 |
---|---|---|
committer | jthorn <jthorn@f88db872-0e4f-0410-b76b-b9085cfa78c5> | 2003-11-20 16:03:21 +0000 |
commit | 1973e5b8fe2d76d877fdf0203447633ef15249c5 (patch) | |
tree | cb1c0ace8beda4793286445685b53ab9b8a47618 /src | |
parent | e2bd8fbbb79977bf06270461a23865c4165edf24 (diff) |
add new parameter
real min_horizon_size_for_mask \
"only set mask if min horizon radius >= this number of local grid spacings"
docs will follow shortly...
git-svn-id: http://svn.einsteintoolkit.org/cactus/EinsteinAnalysis/AHFinderDirect/trunk@1208 f88db872-0e4f-0410-b76b-b9085cfa78c5
Diffstat (limited to 'src')
-rw-r--r-- | src/driver/driver.hh | 1 | ||||
-rw-r--r-- | src/driver/mask.cc | 40 | ||||
-rw-r--r-- | src/driver/setup.cc | 1 |
3 files changed, 36 insertions, 6 deletions
diff --git a/src/driver/driver.hh b/src/driver/driver.hh index 04665b9..0ef2126 100644 --- a/src/driver/driver.hh +++ b/src/driver/driver.hh @@ -195,6 +195,7 @@ struct mask_info CCTK_REAL radius_multiplier, radius_offset; CCTK_REAL buffer_thickness; bool mask_is_noshrink; + CCTK_REAL min_horizon_size_for_mask; bool set_old_style_mask, set_new_style_mask; struct old_style_mask_info { diff --git a/src/driver/mask.cc b/src/driver/mask.cc index 129e035..bfcb9fd 100644 --- a/src/driver/mask.cc +++ b/src/driver/mask.cc @@ -79,12 +79,16 @@ struct mask_grid_info cGH *GH; // --> Cactus grid hierarchy // Cactus coordinate system + // (for the *current* grid if we are doing mesh refinement) fp proc_coord_origin[N_GRID_DIMS]; // global (x,y,z) of // *this processor's* // (i,j,k) = (0,0,0) // grid point fp coord_delta[N_GRID_DIMS]; // (x,y,z) grid spacing + // maximum of x,y,z grid spacings + fp max_coord_delta; + // geometric mean of x,y,z grid spacings, // on the *base* grid if we are doing mesh refinement // (we need the base-grid semantics to make excision consistent @@ -200,6 +204,11 @@ mgi.GH = cctkGH; mgi.coord_delta[X_AXIS] = CCTK_DELTA_SPACE(X_AXIS); mgi.coord_delta[Y_AXIS] = CCTK_DELTA_SPACE(Y_AXIS); mgi.coord_delta[Z_AXIS] = CCTK_DELTA_SPACE(Z_AXIS); +mgi.max_coord_delta = jtutil::max(mgi.coord_delta[X_AXIS], + jtutil::max(mgi.coord_delta[Y_AXIS], + mgi.coord_delta[Z_AXIS])); + +// Cactus grid spacings on the *base* grid const fp base_grid_delta_product = cctk_delta_space[X_AXIS] * cctk_delta_space[Y_AXIS] * cctk_delta_space[Z_AXIS]; @@ -391,22 +400,41 @@ set_mask_gridfn_to_outside_value(mgi, // // loop over each horizon's xyz bounding box // (intersected with (this processor's chunk of) the grid) -// to set the mask accurately +// to set the mask accurately (or skip this horizon if it's too small) // for (int hn = 1 ; hn <= N_horizons ; ++hn) { const struct AH_data& AH_data = *AH_data_array[hn]; if (! AH_data.found_flag) - then continue; // *** LOOP CONTROL *** + then continue; // *** LOOP CONTROL *** + + const patch_system& ps = *AH_data.ps_ptr; + const struct BH_diagnostics& BH_diagnostics = AH_data.BH_diagnostics; + + // + // skip this horizon if it's too small + // + if (BH_diagnostics.min_radius + < mask_info.min_horizon_size_for_mask*mgi.max_coord_delta) + then { + if (verbose_info.print_algorithm_details) + then CCTK_VInfo(CCTK_THORNSTRING, + " min_radius=%g < %g grid points ==> skipping mask for horizon %d", + BH_diagnostics.min_radius, + mask_info.min_horizon_size_for_mask, + hn); + continue; // *** LOOP CONTROL *** + } + + // + // get to here ==> normal mask processing for this horizon + // if (verbose_info.print_algorithm_details) then CCTK_VInfo(CCTK_THORNSTRING, - " setting mask grid function to \"buffer\"/\"inside\" for horizon %d", + " setting mask grid function to \"buffer\"/\"inside\" for horizon %d", hn); - const patch_system& ps = *AH_data.ps_ptr; - const struct BH_diagnostics& BH_diagnostics = AH_data.BH_diagnostics; - // horizon bounding box, rounded "out" to the next grid point const int AH_min_i = mgi.ijk_floor_of_global_xyz(X_AXIS, BH_diagnostics.min_x); diff --git a/src/driver/setup.cc b/src/driver/setup.cc index 42a5bfa..795010b 100644 --- a/src/driver/setup.cc +++ b/src/driver/setup.cc @@ -306,6 +306,7 @@ if (mask_info.set_mask) mask_info.radius_offset = mask_radius_offset; mask_info.buffer_thickness = mask_buffer_thickness; mask_info.mask_is_noshrink = mask_is_noshrink; + mask_info.min_horizon_size_for_mask = min_horizon_size_for_mask; mask_info.set_old_style_mask = (set_old_style_mask != 0); mask_info.set_new_style_mask = (set_new_style_mask != 0); if (mask_info.set_old_style_mask) |