aboutsummaryrefslogtreecommitdiff
path: root/src/patch
diff options
context:
space:
mode:
authorjthorn <jthorn@f88db872-0e4f-0410-b76b-b9085cfa78c5>2002-11-15 15:13:14 +0000
committerjthorn <jthorn@f88db872-0e4f-0410-b76b-b9085cfa78c5>2002-11-15 15:13:14 +0000
commit998e71cd3357c649978ccf012e6b8f990be9b2bf (patch)
tree24b32e2806aeba6426554f643f259dc78b26d898 /src/patch
parentaa8e8a4eda590765c36d3d50ec72d12d51976a50 (diff)
change to using the "enum hack" for patch numbers
so these are now available as array sizes etc git-svn-id: http://svn.einsteintoolkit.org/cactus/EinsteinAnalysis/AHFinderDirect/trunk@892 f88db872-0e4f-0410-b76b-b9085cfa78c5
Diffstat (limited to 'src/patch')
-rw-r--r--src/patch/patch_system_info.hh250
1 files changed, 127 insertions, 123 deletions
diff --git a/src/patch/patch_system_info.hh b/src/patch/patch_system_info.hh
index 6295e68..cf7a9d2 100644
--- a/src/patch/patch_system_info.hh
+++ b/src/patch/patch_system_info.hh
@@ -16,6 +16,13 @@
//******************************************************************************
+//
+// This namespace contains static data describing the patch sizes and
+// shapes for each type of patch system. Since this data only describes
+// the patch sizes/shapes, we don't distinguish between the different
+// boundary conditions.
+//
+
namespace patch_system_info
{
//
@@ -24,27 +31,35 @@ namespace patch_system_info
//
namespace full_sphere
{
- static const struct patch_info patch_info_array[]
- = {
-// +z patch (90 x 90 degrees): dmu [ -45, 45], dnu [ -45, 45]
- {"+z", patch::patch_is_plus, 'z', -45.0, 45.0, -45.0, 45.0},
-
-// +x patch (90 x 90 degrees): dnu [ 45, 135], dphi [ -45, 45]
- {"+x", patch::patch_is_plus, 'x', 45.0, 135.0, -45.0, 45.0},
-
-// +y patch (90 x 90 degrees): dmu [ 45, 135], dphi [ 45, 135]
- {"+y", patch::patch_is_plus, 'y', 45.0, 135.0, 45.0, 135.0},
-
-// -x patch (90 x 90 degrees): dnu [-135, -45], dphi [ 135, 225]
- {"-x", patch::patch_is_minus, 'x', -135.0, -45.0, 135.0, 225.0},
-
-// -y patch (90 x 90 degrees): dmu [-135, -45], dphi [-135, -45]
- {"-y", patch::patch_is_minus, 'y', -135.0, -45.0, -135.0, -45.0},
-
-// -z patch (90 x 90 degrees): dmu [ 135, 225], dnu [ 135, 225]
- {"-z", patch::patch_is_minus, 'z', 135.0, 225.0, 135.0, 225.0},
- };
- static const int N_patches = sizeof(patch_info_array) / sizeof(patch_info);
+ enum {
+ patch_number__pz = 0,
+ patch_number__px,
+ patch_number__py,
+ patch_number__mx,
+ patch_number__my,
+ patch_number__mz,
+ N_patches // no comma
+ };
+ static const struct patch_info patch_info_array[N_patches]
+ = {
+ // +z patch (90 x 90 degrees): dmu [ -45, 45], dnu [ -45, 45]
+ {"+z", patch::patch_is_plus, 'z', -45.0, 45.0, -45.0, 45.0},
+
+ // +x patch (90 x 90 degrees): dnu [ 45, 135], dphi [ -45, 45]
+ {"+x", patch::patch_is_plus, 'x', 45.0, 135.0, -45.0, 45.0},
+
+ // +y patch (90 x 90 degrees): dmu [ 45, 135], dphi [ 45, 135]
+ {"+y", patch::patch_is_plus, 'y', 45.0, 135.0, 45.0, 135.0},
+
+ // -x patch (90 x 90 degrees): dnu [-135, -45], dphi [ 135, 225]
+ {"-x", patch::patch_is_minus, 'x', -135.0, -45.0, 135.0, 225.0},
+
+ // -y patch (90 x 90 degrees): dmu [-135, -45], dphi [-135, -45]
+ {"-y", patch::patch_is_minus, 'y', -135.0, -45.0, -135.0, -45.0},
+
+ // -z patch (90 x 90 degrees): dmu [ 135, 225], dnu [ 135, 225]
+ {"-z", patch::patch_is_minus, 'z', 135.0, 225.0, 135.0, 225.0},
+ };
} // namespace patch_system_info::full_sphere
//
@@ -53,131 +68,120 @@ namespace full_sphere
//
namespace plus_z_hemisphere
{
- static const struct patch_info patch_info_array[]
- = {
-// +z patch (90 x 90 degrees): dmu [ -45, 45], dnu [ -45, 45]
- {"+z", patch::patch_is_plus, 'z', -45.0, 45.0, -45.0, 45.0},
-
-// +x patch (45 x 90 degrees): dnu [ 45, 90], dphi [ -45, 45]
- {"+x", patch::patch_is_plus, 'x', 45.0, 90.0, -45.0, 45.0},
-
-// +y patch (45 x 90 degrees): dmu [ 45, 90], dphi [ 45, 135]
- {"+y", patch::patch_is_plus, 'y', 45.0, 90.0, 45.0, 135.0},
-
-// -x patch (45 x 90 degrees): dnu [ -90, -45], dphi [ 135, 225]
- {"-x", patch::patch_is_minus, 'x', -90.0, -45.0, 135.0, 225.0},
-
-// -y patch (45 x 90 degrees): dmu [ -90, -45], dphi [-135, -45]
- {"-y", patch::patch_is_minus, 'y', -90.0, -45.0, -135.0, -45.0},
- };
- static const int N_patches = sizeof(patch_info_array) / sizeof(patch_info);
+ enum {
+ patch_number__pz = 0,
+ patch_number__px,
+ patch_number__py,
+ patch_number__mx,
+ patch_number__my,
+ N_patches // no comma
+ };
+ static const struct patch_info patch_info_array[N_patches]
+ = {
+ // +z patch (90 x 90 degrees): dmu [ -45, 45], dnu [ -45, 45]
+ {"+z", patch::patch_is_plus, 'z', -45.0, 45.0, -45.0, 45.0},
+
+ // +x patch (45 x 90 degrees): dnu [ 45, 90], dphi [ -45, 45]
+ {"+x", patch::patch_is_plus, 'x', 45.0, 90.0, -45.0, 45.0},
+
+ // +y patch (45 x 90 degrees): dmu [ 45, 90], dphi [ 45, 135]
+ {"+y", patch::patch_is_plus, 'y', 45.0, 90.0, 45.0, 135.0},
+
+ // -x patch (45 x 90 degrees): dnu [ -90, -45], dphi [ 135, 225]
+ {"-x", patch::patch_is_minus, 'x', -90.0, -45.0, 135.0, 225.0},
+
+ // -y patch (45 x 90 degrees): dmu [ -90, -45], dphi [-135, -45]
+ {"-y", patch::patch_is_minus, 'y', -90.0, -45.0, -135.0, -45.0},
+ };
} // namespace patch_system_info::plus_z_hemisphere
//
// +[xy] "vertical" quarter-grid (quadrant) patch system
+// two types of boundary conditions:
// ... mirror symmetry across x=0 and y=0 planes
-//
-namespace plus_xy_quadrant_mirrored
- {
- static const struct patch_info patch_info_array[]
- = {
-// +z patch (45 x 45 degrees): dmu [ 0, 45], dnu [ 0, 45]
- {"+z", patch::patch_is_plus, 'z', 0.0, 45.0, 0.0, 45.0},
-
-// +x patch (90 x 45 degrees): dnu [ 45, 135], dphi [ 0, 45]
- {"+x", patch::patch_is_plus, 'x', 45.0, 135.0, 0.0, 45.0},
-
-// +y patch (90 x 45 degrees): dmu [ 45, 135], dphi [ 45, 90]
- {"+y", patch::patch_is_plus, 'y', 45.0, 135.0, 45.0, 90.0},
-
-// -z patch (45 x 45 degrees): dmu [ 135, 180], dnu [ 135, 180]
- {"-z", patch::patch_is_minus, 'z', 135.0, 180.0, 135.0, 180.0},
- };
- static const int N_patches = sizeof(patch_info_array) / sizeof(patch_info);
- } // namespace patch_system_info::plus_xy_quadrant_mirrored
-
-//
-// +[xy] "vertical" quarter-grid (quadrant) patch system
// ... 90 degree periodic rotation symmetry about z axis
//
-namespace plus_xy_quadrant_rotating
+namespace plus_xy_quadrant
{
- static const struct patch_info patch_info_array[]
- = {
-// +z patch (45 x 45 degrees): dmu [ 0, 45], dnu [ 0, 45]
- {"+z", patch::patch_is_plus, 'z', 0.0, 45.0, 0.0, 45.0},
-
-// +x patch (90 x 45 degrees): dnu [ 45, 135], dphi [ 0, 45]
- {"+x", patch::patch_is_plus, 'x', 45.0, 135.0, 0.0, 45.0},
-
-// +y patch (90 x 45 degrees): dmu [ 45, 135], dphi [ 45, 90]
- {"+y", patch::patch_is_plus, 'y', 45.0, 135.0, 45.0, 90.0},
-
-// -z patch (45 x 45 degrees): dmu [ 135, 180], dnu [ 135, 180]
- {"-z", patch::patch_is_minus, 'z', 135.0, 180.0, 135.0, 180.0},
- };
- static const int N_patches = sizeof(patch_info_array) / sizeof(patch_info);
- } // namespace patch_system_info::plus_xy_quadrant_rotating
+ enum {
+ patch_number__pz = 0,
+ patch_number__px,
+ patch_number__py,
+ patch_number__mz,
+ N_patches // no comma
+ };
+ static const struct patch_info patch_info_array[N_patches]
+ = {
+ // +z patch (45 x 45 degrees): dmu [ 0, 45], dnu [ 0, 45]
+ {"+z", patch::patch_is_plus, 'z', 0.0, 45.0, 0.0, 45.0},
+
+ // +x patch (90 x 45 degrees): dnu [ 45, 135], dphi [ 0, 45]
+ {"+x", patch::patch_is_plus, 'x', 45.0, 135.0, 0.0, 45.0},
+
+ // +y patch (90 x 45 degrees): dmu [ 45, 135], dphi [ 45, 90]
+ {"+y", patch::patch_is_plus, 'y', 45.0, 135.0, 45.0, 90.0},
+
+ // -z patch (45 x 45 degrees): dmu [ 135, 180], dnu [ 135, 180]
+ {"-z", patch::patch_is_minus, 'z', 135.0, 180.0, 135.0, 180.0},
+ };
+ } // namespace patch_system_info::plus_xy_quadrant
//
// +[xz] "horizontal" quarter-grid (quadrant) patch system
// ... 180 degree periodic rotation symmetry about z axis,
// mirror symmetry across z=0 plane
//
-namespace plus_xz_quadrant_rotating
+namespace plus_xz_quadrant
{
- static const struct patch_info patch_info_array[]
- = {
-// +z patch (90 x 45 degrees): dmu [ -45, 45], dnu [ 0, 45]
- {"+z", patch::patch_is_plus, 'z', -45.0, 45.0, 0.0, 45.0},
-
-// +x patch (45 x 90 degrees): dnu [ 45, 90], dphi [ -45, 45]
- {"+x", patch::patch_is_plus, 'x', 45.0, 90.0, -45.0, 45.0},
-
-// +y patch (45 x 45 degrees): dmu [ 45, 90], dphi [ 45, 90]
- {"+y", patch::patch_is_plus, 'y', 45.0, 90.0, 45.0, 90.0},
-
-// -y patch (45 x 45 degrees): dmu [ -90, -45], dphi [ -90, -45]
- {"-y", patch::patch_is_minus, 'y', -90.0, -45.0, -90.0, -45.0},
- };
- static const int N_patches = sizeof(patch_info_array) / sizeof(patch_info);
+ enum {
+ patch_number__pz = 0,
+ patch_number__px,
+ patch_number__py,
+ patch_number__my,
+ N_patches // no comma
+ };
+ static const struct patch_info patch_info_array[N_patches]
+ = {
+ // +z patch (90 x 45 degrees): dmu [ -45, 45], dnu [ 0, 45]
+ {"+z", patch::patch_is_plus, 'z', -45.0, 45.0, 0.0, 45.0},
+
+ // +x patch (45 x 90 degrees): dnu [ 45, 90], dphi [ -45, 45]
+ {"+x", patch::patch_is_plus, 'x', 45.0, 90.0, -45.0, 45.0},
+
+ // +y patch (45 x 45 degrees): dmu [ 45, 90], dphi [ 45, 90]
+ {"+y", patch::patch_is_plus, 'y', 45.0, 90.0, 45.0, 90.0},
+
+ // -y patch (45 x 45 degrees): dmu [ -90, -45], dphi [ -90, -45]
+ {"-y", patch::patch_is_minus, 'y', -90.0, -45.0, -90.0, -45.0},
+ };
} // namespace patch_system_info::plus_xz_quadrant_rotating
//
// +[xyz] (octant) patch system
+// two types of boundary conditions:
// ... mirror symmetry across x=0 plane, y=0 plane, z=0 plane
-//
-namespace plus_xyz_octant_mirrored
- {
- static const struct patch_info patch_info_array[]
- = {
-// +z patch (45 x 45 degrees): dmu [ 0, 45], dnu [ 0, 45]
- {"+z", patch::patch_is_plus, 'z', 0.0, 45.0, 0.0, 45.0},
-// +x patch (45 x 45 degrees): dnu [ 45, 90], dphi [ 0, 45]
- {"+x", patch::patch_is_plus, 'x', 45.0, 90.0, 0.0, 45.0},
-// +y patch (45 x 45 degrees): dmu [ 45, 90], dphi [ 45, 90]
- {"+y", patch::patch_is_plus, 'y', 45.0, 90.0, 45.0, 90.0},
- };
- static const int N_patches = sizeof(patch_info_array) / sizeof(patch_info);
- } // namespace patch_system_info::octant_mirrored
-
-//
-// +[xyz] (octant) patch system
// ... 90 degree periodic rotation symmetry about z axis,
// mirror symmetry across z=0 plane
//
-namespace plus_xyz_octant_rotating
+namespace plus_xyz_octant
{
- static const struct patch_info patch_info_array[]
- = {
-// +z patch (45 x 45 degrees): dmu [ 0, 45], dnu [ 0, 45]
- {"+z", patch::patch_is_plus, 'z', 0.0, 45.0, 0.0, 45.0},
-// +x patch (45 x 45 degrees): dnu [ 45, 90], dphi [ 0, 45]
- {"+x", patch::patch_is_plus, 'x', 45.0, 90.0, 0.0, 45.0},
-// +y patch (45 x 45 degrees): dmu [ 45, 90], dphi [ 45, 90]
- {"+y", patch::patch_is_plus, 'y', 45.0, 90.0, 45.0, 90.0},
- };
- static const int N_patches = sizeof(patch_info_array) / sizeof(patch_info);
- } // namespace patch_system_info::plus_xyz_octant_rotating
+ enum {
+ patch_number__pz = 0,
+ patch_number__px,
+ patch_number__py,
+ N_patches // no comma
+ };
+ static const struct patch_info patch_info_array[N_patches]
+ = {
+ // +z patch (45 x 45 degrees): dmu [ 0, 45], dnu [ 0, 45]
+ {"+z", patch::patch_is_plus, 'z', 0.0, 45.0, 0.0, 45.0},
+
+ // +x patch (45 x 45 degrees): dnu [ 45, 90], dphi [ 0, 45]
+ {"+x", patch::patch_is_plus, 'x', 45.0, 90.0, 0.0, 45.0},
+
+ // +y patch (45 x 45 degrees): dmu [ 45, 90], dphi [ 45, 90]
+ {"+y", patch::patch_is_plus, 'y', 45.0, 90.0, 45.0, 90.0},
+ };
+ } // namespace patch_system_info::octant_mirrored
} // namespace patch_system_info::