Hierarchical Visualization of Large-scale Unstructured Hexahedral Volume Data Jaya Sreevalsan-Nair∗ Lars Linsen∗ Benjamin A. Ahlborn∗ Michael S. Green∗ Center for Image Processing and Integrated Computing (CIPIC) Department of Computer Science University of California, Davis, Davis, CA 95616
Abstract Multi-block unstructured hexahedral grids are widely used in numerical simulations, but they cause various problems for data visualization due to the hangingnode problem. We present a multi-resolution approach for unstructured hexahedral grid visualization based on cost-minimizing face collapses. We resolve the hangingnode problem in its general form in order to generate visualizations using cutting planes and isosurface extraction. We alleviate the problems due to discontinuities on cell boundaries by using local interpolation schemes and dual contouring approaches in cutting-plane visualization and isosurface extraction, respectively.
1
Introduction
Scientific volume data sets are typically defined on structured or unstructured 3D grids. Unstructured grids adapt well to the underlying trivariate function describing some field function (a scalar, vector, or tensor field - or even multiple fields). This adaptivity makes unstructured grids appropriate for visual representation of many scientific phenomena. Though unstructured tetrahedral meshes, for instance, have been examined for a long time, hardly any work has been done on multi-resolution approaches in unstructured hexahedral meshes, despite the fact that hexahedral grids are commonly used in simulations such as finite element analysis and computational fluid dynamics. Unfortunately, standard data exploration and visualization tools can, in general, not be applied directly to multi-block unstructured hexahedral grids and we need to generate a multi-resolution hierarchy in these meshes. We propose generation of the hierarchy of unstructured, rectilinear, hexahedral grids using minimal local variation for collapsing two neighboring cells. This approach allows us to construct a continuous level-ofdetail representation [10]. However, visualization of the resulting data hierarchy ∗ {sreevals, ahlborn,
[email protected].
greenm,
hamann}@cs.ucdavis.edu,
Bernd Hamann∗
is difficult due to continuity desiderata in the levelsof-detail. Hence, we have developed a cutting-plane and an isosurface extraction tool for a general setting, where arbitrary-sized hexahedral building blocks, possibly with hanging nodes on cell boundaries, are used to discretize a 3D domain. In addition, our method preserves the adaptive characteristics of the unstructured grids. Isosurface extraction using conventional cube-based algorithms, like the Marching Cubes algorithm, would lead to cracks in the resulting isosurface. Fixing such cracks in a general hexahedral setting is a tedious process and may not be free of artifacts. Thus, we chose to use a dual approach (cf. [5] [8]). For cutting-plane visualization, trilinear interpolation leads to discontinuities when hanging nodes exist. Our approach uses scattered data interpolation techniques for generating slices and includes neighboring hanging nodes for interpolation. We compare several techniques, namely Shepard’s local method, and Sibson’s method, for the estimation of function values locally.
2
Related Work
Although several multi-resolution approaches exist for unstructured tetrahedral meshes, efforts for hexahedral meshes are restricted to (adaptive) multi-resolution approaches for structured grids [11, 14, 20, 23, 28]. This unequal treatment of tetrahedral and hexahedral grids is due to the fact that unstructured hexahedral grids generate hanging nodes during the construction of a multi-resolution hierarchy, and hanging nodes are generally intractable during visualization. However, this fact does not deter the use of unstructured hexahedral grids in numerical simulations such as in finite element applications that exploit the adaptive nature of these grids (as in the case of adaptive hp grids). At the same time, hexahedral-to-tetrahedral mesh transformations for resolving the hanging-node problem are not free from artifacts, as, there is a conflict between the linear interpolation for tetrahedra and trilinear interpolation for hexahedra. Since these transformations lead
to a different piecewise polynomial representation of a data field, they are futile. Hence, instead of eliminating the hanging nodes in the hierarchy, we focus on designing visualization techniques on unstructured hexahedral grids with hanging nodes. Usually, construction of mesh hierarchies is done using either bottom-up or top-down strategies. Our problem requires a bottom-up approach producing coarser mesh resolutions by mesh simplification [1]. Previous work on bottom-up schemes are as follows: Renze and Oliver used vertex removal for 3D mesh decimation [22]. Re-triangulation is done using Delaunay triangulation of the vertices adjacent to a removed vertex. Irregular tetrahedral mesh simplification was done by Trotts et al. [27] using ordering of approximation errors that would result from a tetrahedral cell collapse (implemented via three edge collapses). Staadt et al. [26] extend Hoppe’s progressive mesh algorithm [7] of collapses applied to tetrahedra. Hoppe uses an energy function whose minimization drives edge collapses. Meredith et al. [16] use view-dependent error-based resolution selection for generating a hierarchy in order to maintain accuracy at all levels. Energy-based methods, using Dirichlet energy specifically, are common for surface reconstruction purposes [3]. Pinkall and Polthier [21] use minimum Dirichlet energy to be the exact equivalent of the distortion measure to determine an optimal triangulation. Desbrun et al. [3] extended this work to obtain intrinsic parametrization by minimization of different distortion measures of the mesh. Levy et al. [9] mentioned that Dirichlet energy minimizers are harmonic functions and that hierarchical solvers perform well when minimizing a criterion for which the minimum is a harmonic map. These works inspired us to extend the use of Dirichlet energy minimizers in defining a criterion for face removal in an unstructured hexahedral 3D mesh. Our work focuses on cutting-plane visualization and isosurface generation on multi-resolution hierarchy in unstructured hexahedral grids. Cutting planes constrain the visualization of 3D data set to an arbitrarily oriented 2D slice. Hence, it is a useful tool to study changes in the interior of a volume. For a uniformly resolved mesh, cutting-plane values can be computed using trilinear interpolation. However, in an adaptive multi-resolution representation, discontinuities along cell boundaries are inevitable. Hence, we have adopted scattered data interpolation for constructing slice values instead. Isosurfacing is an indispensable tool used in scientific visualization. However, hanging nodes pose a problem for adaptively refined grids, as the conventional MC algorithm determines the isopoints using linear interpolation on cell edges, which unfortunately yields bad results in these grids due to the inherent edge discontinuities in their cells. To overcome this problem, we explore the local continuity of the scalar (or vector) field distribution in the cell interior, and use dual-contouring tech-
niques. In contrast to dual-contouring methods [5, 8], our algorithm generates vertices on the actual isosurface without using the normal information at vertex locations. Instead, we adopt a ray-casting technique to find the points lying in the cell interior. Though the use of ray-casting techniques is not new in isosurfacing problems, there are differences in the purpose and mechanisms adopted in our work. Earlier ray-casting techniques for isosurfacing were used for refining the isosurface generated using the conventional MC Algorithm [2]. Fr¨ uhauf [4] pioneered in adopting a ray-casting approach (which usually uses a trilinear interpolation filter) to produce output meshes that are better than those generated by the MC technique. A number of different interpolation filters have been proposed [6, 15, 17, 18] for more precise computation of field values and gradients. However, its drawbacks are its high time complexity and view-dependence. We blend ray-casting and dual isocontouring in a viewindependent fashion to construct a crack-free isosurface. View-independence is achieved by casting rays along the space (or body) diagonals in each cell. In addition, the advantage of our technique is the fact that it supports the adoption of any reconstruction filter used for interpolation of field values.
3
Multi-resolution Hierarchy
We introduce a novel face-removal technique for constructing multi-resolution hierarchy in unstructured hexahedral grids. The underlying fields typically result from numerical simulations, and are approximated using trilinear interpolation in the cell interior. The function is a trivariate harmonic function, as it has continuous second order partial derivatives that satisfies the Laplace equation. For such a real-valued harmonic function in a closed domain, one can define the Dirichlet energy to be the closed integral of the square of the L2 norm of the function’s gradient over the domain. Dirichlet energies of different cells provide an estimate of the relativeness of the gradients of the function. Gradients reflect the behavior of the function in the cells: high gradients indicate significant changes in the scalar field, and low gradients indicate smooth variation over the cell. Our goal while generating coarser resolutions of a multi-resolution hierarchy is to preserve as much information about the function as possible. In order to retain regions of significant changes in the function, we sort the Dirichlet energy contained in each cell to define an order for face removal. The discrete Dirichlet energy in each cell, computed as the sum of squares of the L2 norm of function gradient in each cell edge, is represented as: X 2 E = (k∇fi k2 ) , (1) all edges
ei
where fi is the function value along edge ei of a cell. The cells in the grid are sorted in ascending order of
Dirichlet energy functional values. A user-defined minimum number of cells with low Dirichlet energy value is considered. From the reduced set of cells, combinations of two cells are selected, which must satisfy the following criteria for collapsing: 1. The cells share a common face. 2. The Dirichlet energy of the resulting collapsed cell should be minimal. If the first pass fails, the next group of cells in the initial sorted list is considered. This two-pass sorting process terminates when two appropriate cells, which can be collapsed to one, are found. Intuitively, the combinations occurring in consecutive iterations are in the regions of the grid where the field varies smoothly. We chose this two-pass approach over the straightforward one-pass approach in order to reduce computational overhead. Once the appropriate set of cells is found, the collapse operation is implemented by removing the common face and appropriately rearranging the connectivity information of the vertices in the resulting cell. Removal of the common face results in a new hexahedral cell, thus favorably preserving shape properties even after the cell collapse.
4
Cutting planes
Cutting planes is a restriction of the 3D volume data on an arbitrary 2D plane. This helps us to study the variation of the field in the interior of the volume. Trilinear interpolation of the points in the cutting plane is a very simple technique for rectilinear grids. However. it fails on a coarse grid with hanging nodes, as it generates artifacts due to the inherent edge discontinuities in the cells. This fact makes trilinear interpolation a poor choice for cutting-plane visualization in certain cases. Thus, we turn to scattered data interpolation techniques like the Sibson’s interpolation and Shepard’s local method, where the interpolation using closest neighboring points may include hanging nodes from neighboring cells. Sibson’s interpolation method [25] uses information from voxels in the neighborhood of a point in the cutting plane. This method effectively addresses the problem of cracks in cutting-plane value computation in a coarse grid. However, it has a drawback due to high computational overhead, which compels us to revisit other scattered data interpolation techniques. Shepard’s localized scattered data interpolation method [24], like Sibson interpolation, uses information of the points in the immediate neighborhood of the cutting plane point to be evaluated. Since this technique solely uses distances of the local neighborhood voxels, there is increased user interactivity. Though we trade accuracy for time complexity in this case, the results obtained using Shepard’s method are good.
5
Isosurfacing
The idea of dual isocontouring was inspired mainly by the work of Ju et al. [8] and Greß et al. [5]. In contrast to the MC algorithm [12, 13, 16, 19], dual contouring computes the isopoints in the cell interior, rather than on the edges. The dual approach is desirable in the case of hanging nodes. However, our algorithm still uses the case look-up table of the MC algorithm in order to distinguish between the cases. We shoot rays along the space diagonals of the hexahedral cell and find the intersection points with the trilinearly interpolated implicit surfaces in the cell interior using Cardan’s solution for cubic equations. The algorithm is divided into three parts, namely, case identification, isopoint computation and triangulation.
5.1
Case Identification
The preprocessing of our isosurfacing algorithm involves the use of a look-up table of the conventional MC algorithm in order to identify the specific case to which a cell corresponds. Using the information in the look-up table, we can determine: 1. The rays that are to be shot along the body diagonals (Since we use the minimum number of rays necessary for determining isopoints, the look-up table defines which rays intersect the isosurface). 2. The number of disjoint isosurface components in each cell (as the look-up table defines how many isosurface components exist in a cell and how they are connected to the components detected in the neighboring cells).
5.2
Isopoint Computation
This step involves finding the intersection of a ray and the implicitly defined isosurface for a given isovalue. A ray is represented as: r = r1 + p(r2 − r1 ),
(2)
where r1 and r2 are the position vectors of two points on the ray (which, in this case, are the endpoints of the diagonal along which the ray is shot) and p ∈ [0, 1] is the parameter. The isosurface is given as: I
=
(1 − s)(1 − t)(1 − u)f000 + (1 − s)(1 − t)uf001 + (1 − s)t(1 − u)f010 + (1 − s)tuf011 + s(1 − t)(1 − u)f100 + s(1 − t)uf101 + st(1 − u)f110 + stuf111 ,
(3)
where s, t, and u are local parameters along x, y, and z directions, respectively, fijk is a field value at the corresponding vertex of the cell, and I is the isovalue. The
parametric representation of the intersection point in (s, t, u) space is expressed via p, which reduces Equation 3 to a cubic equation for p. The zeros of the cubic equation are found using Cardan’s solution. Real roots in the range [0,1] define the required intersection points. There may be more than one real root in a cell, which indicates the existence of disconnected multiple surface components in a cell. We choose as many real roots as there are isosurface components existing in the cell. In cases where we may get real roots (solution from different rays) corresponding to the same isosurface component, we take any one of them and discard the others. This ensures that there will be at least one point per cell containing at least one edge with opposite signs at its ends, and there will be one intersection point for each isosurface component existing in the cell.
5.3
Triangulation
The triangulation of all interior points is determined by the following rules: 1. Edges are constructed from an interior point to points in at most three distinct neighboring cells [8]. 2. In case of boundary cells, the MC algorithm is used to find points on the mesh boundaries for terminating the isosurface. 3. Points in a cell are not connected to each other. This is necessary to maintain the number of disconnected isosurface components within each cell.
6
Results
For developing our isosurfacing algorithm, we have used simple test cases. For finding the minimum number of rays to be cast, a test case of one cube is used and for constructing the isosurface triangulation, a test case of eight neighboring cubes is used. Some of the isosurfaces that are obtained are as shown in Figures 1 and 2.
Figure 1: Cells (a) and (b) corresponding to cases 6 and 7, respectively, of the original MC look-up table. The number of rays (yellow lines) cast is minimal. The white triangles are the MC isosurfaces, and the cyan points are the dual isopoints.
Figure 2: (a) compares the MC isosurface (white) and the dual isosurface (magenta). (b) shows the octahedron (white) of the MC method and its dual, a cube (edges shown in green) generated using our dual method. We have applied our methods to a multi-block data set of flow simulations of an oil-water field at different time steps, with data representing oil pressure, oil concentration, water saturation and oil velocity. The data set consists of 876, 148, 576, 152 and 872 cells in five different blocks, as shown in Figure 3. Each block is considered as a separate grid for most of our computational procedures, except while constructing multiresolution hierarchy, we sort the Dirichlet energies in the five blocks together in order to find the optimum cells for collapse. Our multi-resolution hierarchy is constructed using the oil pressure field, whose color representation is as shown in Figure 3. For developing the multi-resolution hierarchy, shown in Figure 4, we observe that after 1000 cell collapses only small changes in the color representing oil pressure are seen. However, after 1500 cell collapses, discontinuities in the color mapping become visible. Most of the initial cell collapses occur in the third grid, where the function varies smoothly. The artifacts in the color mapping in the latter case are due to the Gouraud shading. Trilinear, Sibson’s and Shepard’s local interpolation schemes were applied to the dataset to obtain a slice orthogonal to xz plane, as shown in Figure 5. Sibson’s interpolation is more time-consuming than Shepard’s. The quality of the results is more accurate in the Sibson’s method than in the other two, where discontinuities can be seen (Figure 5). It can be observed that Shepard’s method is the best tradeoff between time complexity and accuracy, though one should resort to Sibson’s method when accuracy is weighed more. Our isosurfacing algorithm was applied to the oil pressure field. We observed that prior to cell collapse, our algorithm and the MC algorithm yield similar results (Figure 6). Except in our method, there exists a discontinuity on the boundary between different blocks.
7
Conclusions and Future Work
Overall, our method leads to desirable results. However, certain issues need to be addressed further. They are : 1. One cell collapse per iteration is not economical.
The algorithm should be improved in order to perform more than one collapse per iteration. 2. “Optimization” of the isosurfacing algorithm is needed to make the approach applicable on largescale data sets too. 3. Isosurfacing needs to be extended to deal with cases including more complex isosurface cases, like tunnels [12]. 4. A complete look-up table for isosurfacing must be defined. Specific boundary cases must be considered. This aspect is essential for using the algorithm in cases of hanging nodes.
Acknowledgments This work was supported by the National Science Foundation under contracts ACI 9624034 (CAREER Award) and ACI 0222909, through the Large Scientific and Software Data Set Visualization (LSSDSV) program under contract ACI 9982251, and through the National Partnership for Advanced Computational Infrastructure (NPACI); the National Institute of Mental Health and the National Science Foundation under contract NIMH 2 P20 MH60975-06A2; and the Lawrence Livermore National Laboratory under ASCI ASAP Level-2 Memorandum Agreement B347878 and under Memorandum Agreement B503159. We thank the members of the Visualization and Graphics Research Group at the Center for Image Processing and Integrated Computing (CIPIC) at the University of California, Davis.
References [1] P. Cignoni, D. Costanza, C. Montani, C. Rocchini, and R. Scopigno, Simplification of tetrahedral meshes with accurate error evaluation, in Proceedings of Visualization 2000, Los Alamitos, CA, 2000, IEEE Computer Society Press, pp. 85–92. [2] P. Cignoni, F. Ganovelli, C. Montani, and R. Scopigno, Reconstruction of topologically correct and adaptive trilinear isosurfaces, Computer & Graphics, 24(3) (2000), pp. 399–418.
[5] A. GREß AND R. KLEIN, Efficient representation and extraction of 2-manifold isosurfaces using kdtrees, in Proceedings of Pacific Graphics 2003, IEEE CS Press, October 8-10 2003. [6] B. Hamann, E. LaMar, and K. I. Joy, Highquality rendering of smooth isosurfaces, The Journal of Visualization and Computer Animation, 10 (1999), pp. 79–90. [7] H. Hoppe, Progressive meshes, in Proceedings of Siggraph 1996, ACM Press, New York, NY, 1996, pp. 99–108. [8] T. Ju, F. Losasso, S. Schaefer, and J. Warren, Dual contouring of hermite data, in Proceedings of Siggraph 2002, ACM Press, New York, NY, 2002, pp. 339–346. [9] B. Levy, S. Petitjean, N. Ray, and J. Mailot, Least squares conformal maps for automatic texture atlas generation, in Proceedings of SIGGRAPH 2002, ACM Press, New York, NY, 2002, pp. 362–371. [10] P. Lindstrom, D. Koller, W. Ribarsky, L. F. Hodges, N. Faust, and G. A.Turner, Real-time, continuous level of detail rendering of height fields, in Proceedings of the SIGGRAPH 1996, ACM Press, 1996, pp. 109–118. [11] L. Lippert, M. H. Gross, and C. Kurmann, Compression domain volume rendering for distributed environments, in Proceedings of the Eurographics ’97, vol. 14, COMPUTER GRAPHICS Forum, 1997, pp. 95–107. [12] A. Lopes and K. Brodlie, Improving the robustness and accuracy of the marching cubes algorithm for isosurfacing, IEEE Transactions on Visualization and Computer Graphics, 9(1) (2003), pp. 16– 29. [13] W. E. Lorensen and H.E.Cline, Marching cubes: A high-resolution 3d surface construction algorithm, in Proceedings of SIGGRAPH 1987, vol. 21(4), Computer Graphics, 1987, pp. 163–169. [14] D. Maegher, Geometric modeling using octree encoding, Computer Graphics and Image Processing, 19 (1982), pp. 129–147.
[3] M. Desbrun, M. Meyer, and P. Alliez, Intrinsic parameterization of surface meshes, in Proceedings of Eurographics 2002, 2002, pp. 209–218.
[15] S. R. Marschner and R. J. Lobb, An evaluation of reconstruction filters for volume rendering, in Proceedings of IEEE Visualization 1994, Tyson Corner, VA, 1994, R. D. Bergeron and A. E. Kaufman, pp. 100–107.
¨hauf, Raycasting opaque isosurfaces in [4] T. Fru nonregularly gridded cfd data, in Visualization in Scientific Computing (1995 Eurographics WS Proc.), Springer KG, Wien, Chia, 3-5 May 1995, pp. 45–57.
[16] J. Meredith and K.-L. Ma, Multiresolution view-dependent splat-based volume rendering of large irregular data, in Proceedings of IEEE Symposium on Parallel and Large Data Visualization and Graphics, 2001, pp. 93–100.
¨ ller, R. Machiraju, K. Mu ¨eller, and [17] T. Mo R. Yagel, Classification and local error estimation of interpolation and derivative filters for volume rendering, in Proceedings of IEEE Symposium on Volume Visualization 1996, 1996, pp. 71–78. ¨ ller, R. Machiraju, K. Mu ¨eller, and [18] T. Mo R. Yagel, A comparison of normal estimation schemes, in IEEE Visualization, 1997, pp. 19–26. [19] G. M. Nielson, On marching cubes, IEEE Transactions on Visualization and Computer Graphics, 9(3) (2003), pp. 283–292.
Figure 3: (a) Oil field mesh with different colors indicating different blocks. (b) Color representation of the oil pressure field.
[20] M. Ohlberger and M. Rumpf, Hierarchical and adaptive visualization on nested grids, Computing, 59 (1997), pp. 365–385. [21] U. Pinkall and K. Polthier, Computing discrete minimal surfaces, Experimental Mathematics, 2(1) (1993), pp. 15–36. [22] K. J. Renze and J.H.Oliver, Generalized unstructured decimation, IEEE Computer Graphics & Applications, 16(6) (1996), pp. 24–32. [23] R. Shekhar, E. Fayyad, R. Yagel, and J. F. Cornhill, Octree-based decimation of marching cubes surfaces, in Proceedings of IEEE Conference on Visualization 1997, R. Yagel and G. M. Nielson, eds., IEEE, IEEE Computer Society Press, 1996, pp. 335–342.
Figure 4: Mesh and Oil pressure field (a) after 1000 collapses (b) after 1500 collapses
[24] D. Shepard., A two-dimensional interpolation function for irregularly spaced data, in Proceedings of the 23rd National Conference, ACM, August 1968, pp. 517–524. [25] R. Sibson, A brief description of natural neighbor interpolation, in Interpreting Multivariate Data, V.Barnett, ed., John Wiley & Sons, New York, 1981, pp. 21–36. [26] O. G. Staadt and M.H.Gross, Progressive tetrahedralization, in Proceedings of IEEE Visualization 1998, IEEE Computer Society, Washington DC, 1998, pp. 397–402.
Figure 5: Comparison of (a) trilinear, (b) Sibson’s, and (c) Shepard’s local interpolation schemes for cuttingplane visualization on a grid obtained after 500 collapses.
[27] I. J. Trotts, B. Hamann, K. I. Joy, and D. F. Wiley, Simplification of tetrahedral meshes, in Proceedings of IEEE Visualization 1998, IEEE Computer Society, Washington DC, 1998, pp. 287– 295. [28] R. Westermann, L. Kobbelt, and T. Ertl, Real-time exploration of regular volume data by adaptive reconstruction of isosurfaces, The Visual Computer, (1999), pp. 100–111.
Figure 6: (a) Isosurface obtained using the MC algorithm (b) Isosurface obtained using our algorithm. The discontinuity in the surface is due to boundaries between blocks, not due to cell collapse.