diff options
author | jthorn <jthorn@f88db872-0e4f-0410-b76b-b9085cfa78c5> | 2002-10-28 16:19:21 +0000 |
---|---|---|
committer | jthorn <jthorn@f88db872-0e4f-0410-b76b-b9085cfa78c5> | 2002-10-28 16:19:21 +0000 |
commit | 10bf1d1f324a250bf42058d41cd4258492176b74 (patch) | |
tree | 8f5b20f16c9d107582a88a5c96ce0d0e355be530 /src/patch | |
parent | 394a4db2135324bb61f53940ab4c4801552c50ce (diff) |
* rename some private functions, eg
from interlink_plus_xy_quadrant_patch_system()
to setup_ghost_zones__plus_xy_quadrant_mirrored()
* add support for new mirrored patch system types
in patch_system::patch_system() constructor
* add comments in integrate_gridfn() to document silent assumptions:
> // FIXME:
> // It would be better to compute the full-sphere integral, but that would
> // require knowing the gridfn's symmetries.
> //
> // FIXME:
> // We silently assume that the patches butt-join, i.e. that they don't
> // overlap, i.e. that N_overlap_points=1
git-svn-id: http://svn.einsteintoolkit.org/cactus/EinsteinAnalysis/AHFinderDirect/trunk@868 f88db872-0e4f-0410-b76b-b9085cfa78c5
Diffstat (limited to 'src/patch')
-rw-r--r-- | src/patch/patch_system.cc | 414 | ||||
-rw-r--r-- | src/patch/patch_system.hh | 38 |
2 files changed, 325 insertions, 127 deletions
diff --git a/src/patch/patch_system.cc b/src/patch/patch_system.cc index 238ba6b..1a4df74 100644 --- a/src/patch/patch_system.cc +++ b/src/patch/patch_system.cc @@ -5,11 +5,13 @@ // patch_system::~patch_system // patch_system::create_patches // patch_system::setup_gridfn_storage -// patch_system::interlink_full_sphere_patch_system -// patch_system::interlink_plus_z_hemisphere_patch_system -// patch_system::interlink_plus_xy_quadrant_patch_system -// patch_system::interlink_plus_xz_quadrant_patch_system -// patch_system::interlink_plus_xyz_octant_patch_system +// patch_system::setup_ghost_zones__full_sphere +// patch_system::setup_ghost_zones__plus_z_hemisphere +// patch_system::setup_ghost_zones__plus_xy_quadrant_mirrored +// patch_system::setup_ghost_zones__plus_xy_quadrant_rotating +// patch_system::setup_ghost_zones__plus_xz_quadrant_rotating +// patch_system::setup_ghost_zones__plus_xyz_octant_mirrored +// patch_system::setup_ghost_zones__plus_xyz_octant_rotating // patch_system::create_periodic_symmetry_ghost_zones // patch_system::create_interpatch_ghost_zones // patch_system::finish_interpatch_setup @@ -97,9 +99,13 @@ using jtutil::error_exit; // be 1; in general // N_overlap_points = 2*N_extend_points + 1 // delta_drho_dsigma = Grid spacing (both rho and sigma) in degrees. -// print_msg_flag = true to print CCTK_VInfo messages describing the -// construction process, -// false to skip this (and be silent except for errors) +// print_summary_msg_flag = true to print 2 lines of CCTK_VInfo messages +// giving the patch system type and origin +// false to skip this +// print_detailed_msg_flag = true to print extensive messages tracing the +// creation and initialization of various +// data structures +// false to skip this // patch_system::patch_system(fp origin_x_in, fp origin_y_in, fp origin_z_in, enum patch_system_type type_in, @@ -108,7 +114,8 @@ patch_system::patch_system(fp origin_x_in, fp origin_y_in, fp origin_z_in, int min_gfn_in, int max_gfn_in, int ghosted_min_gfn_in, int ghosted_max_gfn_in, int interp_handle, int interp_par_table_handle, - bool print_msg_flag) + bool print_summary_msg_flag, + bool print_detailed_msg_flag) : global_coords_(origin_x_in, origin_y_in, origin_z_in), type_(type_in), @@ -137,69 +144,117 @@ if (N_ghost_points < fd_grid::molecule_radius()) N_ghost_points, fd_grid::molecule_radius(), FINITE_DIFF_ORDER); /*NOTREACHED*/ +if (print_summary_msg_flag) + then { + CCTK_VInfo(CCTK_THORNSTRING, + " constructing %s patch system", + name_of_type(type())); + CCTK_VInfo(CCTK_THORNSTRING, + " at origin (%g,%g,%g)", + double(origin_x()), double(origin_y()), double(origin_z())); + } + // construct/interlink the patches and ghost zones switch (type_in) { -case full_sphere_patch_system: - create_patches(patch_system_info::full_sphere::patch_info_array, +case patch_system__full_sphere: + create_patches(patch_system_info::full_sphere + ::patch_info_array, N_ghost_points, N_extend_points, delta_drho_dsigma, - print_msg_flag); + print_detailed_msg_flag); setup_gridfn_storage(min_gfn_in, max_gfn_in, ghosted_min_gfn_in, ghosted_max_gfn_in, - print_msg_flag); - interlink_full_sphere_patch_system(N_overlap_points, - interp_handle, - interp_par_table_handle, - print_msg_flag); + print_detailed_msg_flag); + setup_ghost_zones__full_sphere(N_overlap_points, + interp_handle, + interp_par_table_handle, + print_detailed_msg_flag); break; -case plus_z_hemisphere_patch_system: - create_patches(patch_system_info::plus_z_hemisphere::patch_info_array, + +case patch_system__plus_z_hemisphere: + create_patches(patch_system_info::plus_z_hemisphere + ::patch_info_array, N_ghost_points, N_extend_points, delta_drho_dsigma, - print_msg_flag); + print_detailed_msg_flag); setup_gridfn_storage(min_gfn_in, max_gfn_in, ghosted_min_gfn_in, ghosted_max_gfn_in, - print_msg_flag); - interlink_plus_z_hemisphere_patch_system(N_overlap_points, - interp_handle, - interp_par_table_handle, - print_msg_flag); + print_detailed_msg_flag); + setup_ghost_zones__plus_z_hemisphere(N_overlap_points, + interp_handle, + interp_par_table_handle, + print_detailed_msg_flag); break; -case plus_xy_quadrant_patch_system: - create_patches(patch_system_info::plus_xy_quadrant::patch_info_array, + +case patch_system__plus_xy_quadrant_mirrored: + create_patches(patch_system_info::plus_xy_quadrant_mirrored + ::patch_info_array, N_ghost_points, N_extend_points, delta_drho_dsigma, - print_msg_flag); + print_detailed_msg_flag); setup_gridfn_storage(min_gfn_in, max_gfn_in, ghosted_min_gfn_in, ghosted_max_gfn_in, - print_msg_flag); - interlink_plus_xy_quadrant_patch_system(N_overlap_points, - interp_handle, - interp_par_table_handle, - print_msg_flag); + print_detailed_msg_flag); + setup_ghost_zones__plus_xy_quadrant_mirrored(N_overlap_points, + interp_handle, + interp_par_table_handle, + print_detailed_msg_flag); break; -case plus_xz_quadrant_patch_system: - create_patches(patch_system_info::plus_xz_quadrant::patch_info_array, + +case patch_system__plus_xy_quadrant_rotating: + create_patches(patch_system_info::plus_xy_quadrant_rotating + ::patch_info_array, + N_ghost_points, N_extend_points, delta_drho_dsigma, + print_detailed_msg_flag); + setup_gridfn_storage(min_gfn_in, max_gfn_in, + ghosted_min_gfn_in, ghosted_max_gfn_in, + print_detailed_msg_flag); + setup_ghost_zones__plus_xy_quadrant_rotating(N_overlap_points, + interp_handle, + interp_par_table_handle, + print_detailed_msg_flag); + break; + +case patch_system__plus_xz_quadrant_rotating: + create_patches(patch_system_info::plus_xz_quadrant_rotating + ::patch_info_array, N_ghost_points, N_extend_points, delta_drho_dsigma, - print_msg_flag); + print_detailed_msg_flag); setup_gridfn_storage(min_gfn_in, max_gfn_in, ghosted_min_gfn_in, ghosted_max_gfn_in, - print_msg_flag); - interlink_plus_xz_quadrant_patch_system(N_overlap_points, - interp_handle, - interp_par_table_handle, - print_msg_flag); + print_detailed_msg_flag); + setup_ghost_zones__plus_xz_quadrant_rotating(N_overlap_points, + interp_handle, + interp_par_table_handle, + print_detailed_msg_flag); break; -case plus_xyz_octant_patch_system: - create_patches(patch_system_info::plus_xyz_octant::patch_info_array, + +case patch_system__plus_xyz_octant_mirrored: + create_patches(patch_system_info::plus_xyz_octant_mirrored + ::patch_info_array, N_ghost_points, N_extend_points, delta_drho_dsigma, - print_msg_flag); + print_detailed_msg_flag); setup_gridfn_storage(min_gfn_in, max_gfn_in, ghosted_min_gfn_in, ghosted_max_gfn_in, - print_msg_flag); - interlink_plus_xyz_octant_patch_system(N_overlap_points, - interp_handle, - interp_par_table_handle, - print_msg_flag); + print_detailed_msg_flag); + setup_ghost_zones__plus_xyz_octant_mirrored(N_overlap_points, + interp_handle, + interp_par_table_handle, + print_detailed_msg_flag); break; + +case patch_system__plus_xyz_octant_rotating: + create_patches(patch_system_info::plus_xyz_octant_rotating + ::patch_info_array, + N_ghost_points, N_extend_points, delta_drho_dsigma, + print_detailed_msg_flag); + setup_gridfn_storage(min_gfn_in, max_gfn_in, + ghosted_min_gfn_in, ghosted_max_gfn_in, + print_detailed_msg_flag); + setup_ghost_zones__plus_xyz_octant_rotating(N_overlap_points, + interp_handle, + interp_par_table_handle, + print_detailed_msg_flag); + break; + default: error_exit(ERROR_EXIT, "***** patch_system::patch_system(): bad type_in=(int)%d!\n" @@ -244,15 +299,6 @@ void patch_system::create_patches(const struct patch_info patch_info_in[], fp delta_drho_dsigma, bool print_msg_flag) { -if (print_msg_flag) - then { - CCTK_VInfo(CCTK_THORNSTRING, - " constructing %s patch system", - name_of_type(type())); - CCTK_VInfo(CCTK_THORNSTRING, - " at origin (%g,%g,%g)", - double(origin_x()), double(origin_y()), double(origin_z())); - } N_grid_points_ = 0; ghosted_N_grid_points_ = 0; for (int pn = 0 ; pn < N_patches() ; ++pn) @@ -261,7 +307,7 @@ ghosted_N_grid_points_ = 0; if (print_msg_flag) then CCTK_VInfo(CCTK_THORNSTRING, - " constructing %s patch", + " constructing %s patch", pi.name); struct patch *p; @@ -370,13 +416,14 @@ const int ghosted_N_storage = ghosted_gfn_stride * ghosted_N_gridfns_in; if (print_msg_flag) then { - CCTK_VInfo(CCTK_THORNSTRING, " setting up gridfn storage"); CCTK_VInfo(CCTK_THORNSTRING, - " gfn=[%d,%d] ghosted_gfn=[%d,%d]", + " setting up gridfn storage"); + CCTK_VInfo(CCTK_THORNSTRING, + " gfn=[%d,%d] ghosted_gfn=[%d,%d]", min_gfn_in, max_gfn_in, ghosted_min_gfn_in, ghosted_max_gfn_in); CCTK_VInfo(CCTK_THORNSTRING, - " N_grid_points()=%d ghosted_N_grid_points()=%d", + " N_grid_points()=%d ghosted_N_grid_points()=%d", N_grid_points(), ghosted_N_grid_points()); } @@ -412,7 +459,7 @@ ghosted_gridfn_storage_ = new fp[ghosted_N_storage]; if (print_msg_flag) then { CCTK_VInfo(CCTK_THORNSTRING, - " checking that storage is partitioned properly"); + " checking that storage is partitioned properly"); } // check to make sure storage for distinct gridfns @@ -553,17 +600,17 @@ const patch& plast = ith_patch(N_patches()-1); //****************************************************************************** // -// This function constructs and interlinks the ghost zones for a -// full-sphere patch system. +// This function sets up (constructs and interlinks) the ghost zones +// for a full-sphere patch system. // -void patch_system::interlink_full_sphere_patch_system +void patch_system::setup_ghost_zones__full_sphere (int N_overlap_points, int interp_handle, int interp_par_table_handle, bool print_msg_flag) { if (print_msg_flag) then CCTK_VInfo(CCTK_THORNSTRING, - " interlinking full sphere patch system"); + " seting up full sphere ghost zones"); patch& pz = ith_patch(patch_number_of_name("+z")); patch& px = ith_patch(patch_number_of_name("+x")); @@ -574,7 +621,8 @@ patch& mz = ith_patch(patch_number_of_name("-z")); // create the ghost zones if (print_msg_flag) - then CCTK_VInfo(CCTK_THORNSTRING, " creating ghost zones"); + then CCTK_VInfo(CCTK_THORNSTRING, + " creating ghost zones"); create_interpatch_ghost_zones(pz, px, N_overlap_points); create_interpatch_ghost_zones(pz, py, N_overlap_points); create_interpatch_ghost_zones(pz, mx, N_overlap_points); @@ -590,7 +638,8 @@ create_interpatch_ghost_zones(mz, my, N_overlap_points); // finish setting up the interpatch ghost zones if (print_msg_flag) - then CCTK_VInfo(CCTK_THORNSTRING, " finishing interpatch setup"); + then CCTK_VInfo(CCTK_THORNSTRING, + " finishing interpatch setup"); finish_interpatch_setup(pz, px, N_overlap_points, interp_handle, interp_par_table_handle); @@ -634,17 +683,17 @@ assert_all_ghost_zones_fully_setup(); //****************************************************************************** // -// This function constructs and interlinks the ghost zones for a -// +z hemisphere patch system. +// This function sets up (constructs and interlinks) the ghost zones +// for a +z hemisphere patch system. // -void patch_system::interlink_plus_z_hemisphere_patch_system +void patch_system::setup_ghost_zones__plus_z_hemisphere (int N_overlap_points, int interp_handle, int interp_par_table_handle, bool print_msg_flag) { if (print_msg_flag) then CCTK_VInfo(CCTK_THORNSTRING, - " interlinking +z hemisphere patch system"); + " setting up +z hemisphere ghost zones"); patch& pz = ith_patch(patch_number_of_name("+z")); patch& px = ith_patch(patch_number_of_name("+x")); @@ -654,7 +703,8 @@ patch& my = ith_patch(patch_number_of_name("-y")); // create the ghost zones if (print_msg_flag) - then CCTK_VInfo(CCTK_THORNSTRING, " creating ghost zones"); + then CCTK_VInfo(CCTK_THORNSTRING, + " creating ghost zones"); create_interpatch_ghost_zones(pz, px, N_overlap_points); create_interpatch_ghost_zones(pz, py, N_overlap_points); create_interpatch_ghost_zones(pz, mx, N_overlap_points); @@ -670,7 +720,8 @@ my.create_mirror_symmetry_ghost_zone(my.min_rho_patch_edge()); // finish setting up the interpatch ghost zones if (print_msg_flag) - then CCTK_VInfo(CCTK_THORNSTRING, " finishing interpatch setup"); + then CCTK_VInfo(CCTK_THORNSTRING, + " finishing interpatch setup"); finish_interpatch_setup(pz, px, N_overlap_points, interp_handle, interp_par_table_handle); @@ -702,17 +753,17 @@ assert_all_ghost_zones_fully_setup(); //****************************************************************************** // -// This function constructs and interlinks the ghost zones for a -// +xy quadrant patch system. +// This function sets up (constructs and interlinks) the ghost zones +// for a +xy quadrant (mirrored) patch system. // -void patch_system::interlink_plus_xy_quadrant_patch_system +void patch_system::setup_ghost_zones__plus_xy_quadrant_mirrored (int N_overlap_points, int interp_handle, int interp_par_table_handle, bool print_msg_flag) { if (print_msg_flag) then CCTK_VInfo(CCTK_THORNSTRING, - " interlinking +xy quadrant patch system"); + " setting up +xy quadrant (mirrored) ghost zones"); patch& pz = ith_patch(patch_number_of_name("+z")); patch& px = ith_patch(patch_number_of_name("+x")); @@ -721,7 +772,67 @@ patch& mz = ith_patch(patch_number_of_name("-z")); // create the ghost zones if (print_msg_flag) - then CCTK_VInfo(CCTK_THORNSTRING, " creating ghost zones"); + then CCTK_VInfo(CCTK_THORNSTRING, + " creating ghost zones"); +create_interpatch_ghost_zones(pz, px, N_overlap_points); +create_interpatch_ghost_zones(pz, py, N_overlap_points); +create_interpatch_ghost_zones(px, py, N_overlap_points); +create_interpatch_ghost_zones(mz, px, N_overlap_points); +create_interpatch_ghost_zones(mz, py, N_overlap_points); +pz.create_mirror_symmetry_ghost_zone(pz.min_rho_patch_edge()); +pz.create_mirror_symmetry_ghost_zone(pz.min_sigma_patch_edge()); +px.create_mirror_symmetry_ghost_zone(px.min_sigma_patch_edge()); +py.create_mirror_symmetry_ghost_zone(py.max_sigma_patch_edge()); +mz.create_mirror_symmetry_ghost_zone(mz.max_rho_patch_edge()); +mz.create_mirror_symmetry_ghost_zone(mz.max_sigma_patch_edge()); + +// finish setting up the interpatch ghost zones +if (print_msg_flag) + then CCTK_VInfo(CCTK_THORNSTRING, + " finishing interpatch setup"); +finish_interpatch_setup(pz, px, + N_overlap_points, + interp_handle, interp_par_table_handle); +finish_interpatch_setup(pz, py, + N_overlap_points, + interp_handle, interp_par_table_handle); +finish_interpatch_setup(px, py, + N_overlap_points, + interp_handle, interp_par_table_handle); +finish_interpatch_setup(mz, px, + N_overlap_points, + interp_handle, interp_par_table_handle); +finish_interpatch_setup(mz, py, + N_overlap_points, + interp_handle, interp_par_table_handle); + +assert_all_ghost_zones_fully_setup(); +} + +//****************************************************************************** + +// +// This function sets up (constructs and interlinks) the ghost zones +// for a +xy quadrant (rotating) patch system. +// +void patch_system::setup_ghost_zones__plus_xy_quadrant_rotating + (int N_overlap_points, + int interp_handle, int interp_par_table_handle, + bool print_msg_flag) +{ +if (print_msg_flag) + then CCTK_VInfo(CCTK_THORNSTRING, + " setting up +xy quadrant (rotating) ghost zones"); + +patch& pz = ith_patch(patch_number_of_name("+z")); +patch& px = ith_patch(patch_number_of_name("+x")); +patch& py = ith_patch(patch_number_of_name("+y")); +patch& mz = ith_patch(patch_number_of_name("-z")); + +// create the ghost zones +if (print_msg_flag) + then CCTK_VInfo(CCTK_THORNSTRING, + " creating ghost zones"); create_interpatch_ghost_zones(pz, px, N_overlap_points); create_interpatch_ghost_zones(pz, py, N_overlap_points); create_interpatch_ghost_zones(px, py, N_overlap_points); @@ -739,7 +850,8 @@ create_periodic_symmetry_ghost_zones(mz.max_rho_patch_edge(), // finish setting up the interpatch ghost zones if (print_msg_flag) - then CCTK_VInfo(CCTK_THORNSTRING, " finishing interpatch setup"); + then CCTK_VInfo(CCTK_THORNSTRING, + " finishing interpatch setup"); finish_interpatch_setup(pz, px, N_overlap_points, interp_handle, interp_par_table_handle); @@ -762,17 +874,17 @@ assert_all_ghost_zones_fully_setup(); //****************************************************************************** // -// This function constructs and interlinks the ghost zones for a -// +xz quadrant patch system. +// This function sets up (constructs and interlinks) the ghost zones +// for a +xz quadrant (rotating) patch system. // -void patch_system::interlink_plus_xz_quadrant_patch_system +void patch_system::setup_ghost_zones__plus_xz_quadrant_rotating (int N_overlap_points, int interp_handle, int interp_par_table_handle, bool print_msg_flag) { if (print_msg_flag) then CCTK_VInfo(CCTK_THORNSTRING, - " interlinking +xz quadrant patch system"); + " setting up +xz quadrant (rotating) ghost zones"); patch& pz = ith_patch(patch_number_of_name("+z")); patch& px = ith_patch(patch_number_of_name("+x")); @@ -781,7 +893,8 @@ patch& my = ith_patch(patch_number_of_name("-y")); // create the ghost zones if (print_msg_flag) - then CCTK_VInfo(CCTK_THORNSTRING, " creating ghost zones"); + then CCTK_VInfo(CCTK_THORNSTRING, + " creating ghost zones"); create_interpatch_ghost_zones(pz, px, N_overlap_points); create_interpatch_ghost_zones(pz, py, N_overlap_points); create_interpatch_ghost_zones(pz, my, N_overlap_points); @@ -799,7 +912,8 @@ create_periodic_symmetry_ghost_zones(py.max_sigma_patch_edge(), // finish setting up the interpatch ghost zones if (print_msg_flag) - then CCTK_VInfo(CCTK_THORNSTRING, " finishing interpatch setup"); + then CCTK_VInfo(CCTK_THORNSTRING, + " finishing interpatch setup"); finish_interpatch_setup(pz, px, N_overlap_points, interp_handle, interp_par_table_handle); @@ -822,17 +936,67 @@ assert_all_ghost_zones_fully_setup(); //****************************************************************************** // -// This function constructs and interlinks the ghost zones for a -// +xyz octant patch system. +// This function sets up (constructs and interlinks) the ghost zones +// for a +xyz octant (mirrored) patch system. +// +void patch_system::setup_ghost_zones__plus_xyz_octant_mirrored + (int N_overlap_points, + int interp_handle, int interp_par_table_handle, + bool print_msg_flag) +{ +if (print_msg_flag) + then CCTK_VInfo(CCTK_THORNSTRING, + " setting up +xyz octant (mirrored) ghost zones"); + +patch& pz = ith_patch(patch_number_of_name("+z")); +patch& px = ith_patch(patch_number_of_name("+x")); +patch& py = ith_patch(patch_number_of_name("+y")); + +// create the ghost zones +if (print_msg_flag) + then CCTK_VInfo(CCTK_THORNSTRING, + " creating ghost zones"); +create_interpatch_ghost_zones(pz, px, N_overlap_points); +create_interpatch_ghost_zones(pz, py, N_overlap_points); +create_interpatch_ghost_zones(px, py, N_overlap_points); +pz.create_mirror_symmetry_ghost_zone(pz.min_rho_patch_edge()); +pz.create_mirror_symmetry_ghost_zone(pz.min_sigma_patch_edge()); +px.create_mirror_symmetry_ghost_zone(px.max_rho_patch_edge()); +px.create_mirror_symmetry_ghost_zone(px.min_sigma_patch_edge()); +py.create_mirror_symmetry_ghost_zone(py.max_rho_patch_edge()); +py.create_mirror_symmetry_ghost_zone(py.max_sigma_patch_edge()); + +// finish setting up the interpatch ghost zones +if (print_msg_flag) + then CCTK_VInfo(CCTK_THORNSTRING, + " finishing interpatch setup"); +finish_interpatch_setup(pz, px, + N_overlap_points, + interp_handle, interp_par_table_handle); +finish_interpatch_setup(pz, py, + N_overlap_points, + interp_handle, interp_par_table_handle); +finish_interpatch_setup(px, py, + N_overlap_points, + interp_handle, interp_par_table_handle); + +assert_all_ghost_zones_fully_setup(); +} + +//****************************************************************************** + +// +// This function sets up (constructs and interlinks) the ghost zones +// for a +xyz octant (rotating) patch system. // -void patch_system::interlink_plus_xyz_octant_patch_system +void patch_system::setup_ghost_zones__plus_xyz_octant_rotating (int N_overlap_points, int interp_handle, int interp_par_table_handle, bool print_msg_flag) { if (print_msg_flag) then CCTK_VInfo(CCTK_THORNSTRING, - " interlinking +xyz octant patch system"); + " setting up +xyz octant (rotating) ghost zones"); patch& pz = ith_patch(patch_number_of_name("+z")); patch& px = ith_patch(patch_number_of_name("+x")); @@ -840,7 +1004,8 @@ patch& py = ith_patch(patch_number_of_name("+y")); // create the ghost zones if (print_msg_flag) - then CCTK_VInfo(CCTK_THORNSTRING, " creating ghost zones"); + then CCTK_VInfo(CCTK_THORNSTRING, + " creating ghost zones"); create_interpatch_ghost_zones(pz, px, N_overlap_points); create_interpatch_ghost_zones(pz, py, N_overlap_points); create_interpatch_ghost_zones(px, py, N_overlap_points); @@ -855,7 +1020,8 @@ create_periodic_symmetry_ghost_zones(px.min_sigma_patch_edge(), // finish setting up the interpatch ghost zones if (print_msg_flag) - then CCTK_VInfo(CCTK_THORNSTRING, " finishing interpatch setup"); + then CCTK_VInfo(CCTK_THORNSTRING, + " finishing interpatch setup"); finish_interpatch_setup(pz, px, N_overlap_points, interp_handle, interp_par_table_handle); @@ -960,16 +1126,20 @@ void patch_system::assert_all_ghost_zones_fully_setup() const { switch (type_in) { -case full_sphere_patch_system: +case patch_system__full_sphere: return patch_system_info::full_sphere::N_patches; -case plus_z_hemisphere_patch_system: +case patch_system__plus_z_hemisphere: return patch_system_info::plus_z_hemisphere::N_patches; -case plus_xy_quadrant_patch_system: - return patch_system_info::plus_xy_quadrant::N_patches; -case plus_xz_quadrant_patch_system: - return patch_system_info::plus_xz_quadrant::N_patches; -case plus_xyz_octant_patch_system: - return patch_system_info::plus_xyz_octant::N_patches; +case patch_system__plus_xy_quadrant_mirrored: + return patch_system_info::plus_xy_quadrant_mirrored::N_patches; +case patch_system__plus_xy_quadrant_rotating: + return patch_system_info::plus_xy_quadrant_rotating::N_patches; +case patch_system__plus_xz_quadrant_rotating: + return patch_system_info::plus_xz_quadrant_rotating::N_patches; +case patch_system__plus_xyz_octant_mirrored: + return patch_system_info::plus_xyz_octant_mirrored::N_patches; +case patch_system__plus_xyz_octant_rotating: + return patch_system_info::plus_xyz_octant_rotating::N_patches; default: error_exit(PANIC_EXIT, "***** patch_system::N_patches_of_type(): bad type=(int)%d!\n" @@ -989,11 +1159,13 @@ default: { switch (type_in) { -case full_sphere_patch_system: return "full sphere"; -case plus_z_hemisphere_patch_system: return "+z hemisphere"; -case plus_xy_quadrant_patch_system: return "+xy quadrant"; -case plus_xz_quadrant_patch_system: return "+xz quadrant"; -case plus_xyz_octant_patch_system: return "+xyz octant"; +case patch_system__full_sphere: return "full sphere"; +case patch_system__plus_z_hemisphere: return "+z hemisphere"; +case patch_system__plus_xy_quadrant_mirrored: return "+xy quadrant (mirrored)"; +case patch_system__plus_xy_quadrant_rotating: return "+xy quadrant (rotating)"; +case patch_system__plus_xz_quadrant_rotating: return "+xz quadrant (rotating)"; +case patch_system__plus_xyz_octant_mirrored: return "+xyz octant (mirrored)"; +case patch_system__plus_xyz_octant_rotating: return "+xyz octant (rotating)"; default: error_exit(PANIC_EXIT, "***** patch_system::name_of_type(): bad type=(int)%d!\n" @@ -1013,15 +1185,19 @@ default: patch_system::type_of_name(const char* name_in) { if (STRING_EQUAL(name_in, "full sphere")) - then return full_sphere_patch_system; + then return patch_system__full_sphere; else if (STRING_EQUAL(name_in, "+z hemisphere")) - then return plus_z_hemisphere_patch_system; -else if (STRING_EQUAL(name_in, "+xy quadrant")) - then return plus_xy_quadrant_patch_system; -else if (STRING_EQUAL(name_in, "+xz quadrant")) - then return plus_xz_quadrant_patch_system; -else if (STRING_EQUAL(name_in, "+xyz octant")) - then return plus_xyz_octant_patch_system; + then return patch_system__plus_z_hemisphere; +else if (STRING_EQUAL(name_in, "+xy quadrant (mirrored)")) + then return patch_system__plus_xy_quadrant_mirrored; +else if (STRING_EQUAL(name_in, "+xy quadrant (rotating)")) + then return patch_system__plus_xy_quadrant_rotating; +else if (STRING_EQUAL(name_in, "+xz quadrant (rotating)")) + then return patch_system__plus_xz_quadrant_rotating; +else if (STRING_EQUAL(name_in, "+xyz octant (mirrored)")) + then return patch_system__plus_xyz_octant_mirrored; +else if (STRING_EQUAL(name_in, "+xyz octant (rotating)")) + then return patch_system__plus_xyz_octant_rotating; else error_exit(PANIC_EXIT, "***** patch_system::type_of_name(): unknown name=\"%s\"!", name_in); /*NOTREACHED*/ @@ -1363,6 +1539,14 @@ norms.reset(); // = \int f(\rho,\sigma) \sqrt{|J|} \, d\rho \, d\sigma$ // where $J$ is the Jacobian of $(x,y,z)$ with respect to $(rho,sigma). // +// FIXME: +// It would be better to compute the full-sphere integral, but that would +// require knowing the gridfn's symmetries. +// +// FIXME: +// We silently assume that the patches butt-join, i.e. that they don't +// overlap, i.e. that N_overlap_points=1 +// // Arguments: // src_gfn = (in) The gridfn to be integrated. // ghosted_radius_gfn = (in) The surface radius. @@ -1848,7 +2032,7 @@ else if (xgz.is_symmetry() && xe.ipar_is_in_corner(x_ipar)) const int z_irho = ze. irho_of_iperp_ipar(z_iperp, z_ipar); const int z_isigma = ze.isigma_of_iperp_ipar(z_iperp, z_ipar); const ghost_zone& true_zgz - = zp.ghost_zone_containing_point(z_irho, z_isigma); + = zp.ghost_zone_containing_noncorner_point(z_irho, z_isigma); const patch_edge& true_ze = true_zgz.my_edge(); const int true_z_iperp = true_ze.iperp_of_irho_isigma(z_irho, z_isigma); const int true_z_ipar = true_ze. ipar_of_irho_isigma(z_irho, z_isigma); diff --git a/src/patch/patch_system.hh b/src/patch/patch_system.hh index 08c15d8..0683a6f 100644 --- a/src/patch/patch_system.hh +++ b/src/patch/patch_system.hh @@ -45,11 +45,13 @@ public: // what patch-system type are supported? // (see "patch_system_info.hh" for detailed descriptions of these) enum patch_system_type { - full_sphere_patch_system, - plus_z_hemisphere_patch_system, - plus_xy_quadrant_patch_system, - plus_xz_quadrant_patch_system, - plus_xyz_octant_patch_system + patch_system__full_sphere, + patch_system__plus_z_hemisphere, + patch_system__plus_xy_quadrant_mirrored, + patch_system__plus_xy_quadrant_rotating, + patch_system__plus_xz_quadrant_rotating, + patch_system__plus_xyz_octant_mirrored, + patch_system__plus_xyz_octant_rotating }; // maximum number of patches in any patch-system type @@ -280,6 +282,10 @@ public: // = \int f(\rho,\sigma) \sqrt{|J|} \, d\rho \, d\sigma$ // where $J$ is the Jacobian of $(x,y,z)$ with respect to $(rho,sigma) // ... integration method selected by method argument + // ... note integral is only over patch system itself, + // even if this covers a proper subset of the full sphere + // FIXME: it would be better to compute the full-sphere integral + // (but this would require knowing the gridfn's symmetries) fp integrate_gridfn(int src_gfn, int ghosted_radius_gfn, int g_xx_gfn, int g_xy_gfn, int g_xz_gfn, @@ -427,7 +433,7 @@ public: int min_gfn_in, int max_gfn_in, int ghosted_min_gfn_in, int ghosted_max_gfn_in, int interp_handle_in, int interp_par_table_handle_in, - bool print_msg_flag); + bool print_summary_msg_flag, bool print_detailed_msg_flag); ~patch_system(); @@ -450,24 +456,32 @@ private: int ghosted_min_gfn_in, int ghosted_max_gfn_in, bool print_msg_flag); - // create/interlink ghost zones - void interlink_full_sphere_patch_system + // setup (create/interlink) all ghost zones + void setup_ghost_zones__full_sphere (int N_overlap_points, int interp_handle, int interp_par_table_handle, bool print_msg_flag); - void interlink_plus_z_hemisphere_patch_system + void setup_ghost_zones__plus_z_hemisphere (int N_overlap_points, int interp_handle, int interp_par_table_handle, bool print_msg_flag); - void interlink_plus_xy_quadrant_patch_system + void setup_ghost_zones__plus_xy_quadrant_mirrored (int N_overlap_points, int interp_handle, int interp_par_table_handle, bool print_msg_flag); - void interlink_plus_xz_quadrant_patch_system + void setup_ghost_zones__plus_xy_quadrant_rotating (int N_overlap_points, int interp_handle, int interp_par_table_handle, bool print_msg_flag); - void interlink_plus_xyz_octant_patch_system + void setup_ghost_zones__plus_xz_quadrant_rotating + (int N_overlap_points, + int interp_handle, int interp_par_table_handle, + bool print_msg_flag); + void setup_ghost_zones__plus_xyz_octant_mirrored + (int N_overlap_points, + int interp_handle, int interp_par_table_handle, + bool print_msg_flag); + void setup_ghost_zones__plus_xyz_octant_rotating (int N_overlap_points, int interp_handle, int interp_par_table_handle, bool print_msg_flag); |