The caller may set the REDUCE_DIMENSIONS parameter to TRUE in any of the three geometric methods if they want Zoltan to check for a degenerate condition and do lower dimensional partitioning if such a condition if found. They may set the DEGENERATE_RATIO to specify how flat or thin a geometry must be to be considered degenerate.
If KEEP_CUTS is TRUE, the transformation is saved so that in Zoltan_LB_Box_Assign or Zoltan_LB_Point_Assign the coordinates can be transformed before the assignment is calculated. If RCB_REUSE is TRUE in the RCB method, the transformation is also saved. On re-partitioning, we can do some simple tests to see if the degeneracy condition has changed before completely re-calculating the coordinate transformation.
To determine if the geometry is degenerate, we calculate the same inertial matrix that is calculated for RIB, except that we ignore vertex weights. The 3 orthogonal eigenvectors of the inertial matrix describe the three primary directions of the geometry. The bounding box oriented in these directions is tested for degeneracy. In particular (for a 3 dimensional geometry) if the length of the longest side divided by the length of the shortest side exceeds the DEGENERATE_RATIO, we consider the geometry to be flat. If in addition, the length longest side divided by the length of the middle side exceeds the DEGENERATE_RATIO, we consider the geometry to be essentially a line.
If a 3 dimensional geometry is determined to be flat, we transform coordinates to a coordinate system where the XY plane corresponds to the oriented bounding box, and project all coordinates to that plane. These X,Y coordinates are returned to the partitioning algorithm, which performs two dimensional partitioning. Similarly if the geometry is very thin, we transform coordinates to a coordinate system with the X axis going through the bounding box in it's principal direction, and project all points to that axis. Then one dimensional partitioning is performed.
There is a small problem in calculating Zoltan_LB_Box_Assign when the partitioning was performed on transformed geometry. The caller provides the box vertices in problem coordinates, but the partition was calculated in transformed coordinates. When the vertices are transformed, they are in general no longer the vertices of an axis-aligned box in the new coordinate system. The Box_Assign calculation requires an axis-aligned box, and so we use the bounding box of the transformed vertices. The resulting list of processes or parts intersecting the box may therefore contain some processes or parts which actually do not intersect the box in problem coordinates, however it will not omit any.
To use the degenerate geometry detection capability from a new
geometric method, you would add a Zoltan_Transform_Struct
structure to the algorithm specific data structure, add code to
Zoltan_Get_Coordinates to look for it, and check the
Target_Dim field on return to see if the problem dimension
was reduced. You would also need to include the
coordinate transformation in your Box_Assign and Point_Assign