isosurface extraction from hybrid unstructured grids containing

13
Isosurface Extraction from Hybrid Unstructured Grids Containing Pentahedral Elements Akshay Narayan 1 , Jaya Sreevalsan-Nair 1 , Kelly Gaither 2 and Bernd Hamann 3 1 International Institute of Information Technology - Bangalore, 26/C, Electronics City, Hosur Road, Bangalore 560100, India 2 Texas Advanced Computing Center, University of Texas at Austin, 10100 Burnet Road, Austin, TX 78758, U.S.A. 3 Institute for Data Analysis and Visualization, Department of Computer Science, University of California, Davis, One Shields Avenue, Davis, CA95616, U.S.A. [email protected], [email protected], [email protected], [email protected] Keywords: Volume Visualization: Isosurface Extraction: Hybrid Meshes: Marching Methods Abstract: Grid-based computational simulations often use hybrid unstructured grids consisting of various types of elements. Most commonly used elements are tetrahedral, pentahedral (namely, square pyramids and right triangular prisms) and hexahedral elements. Extracting isosurfaces of scalar fields defined on such hybrid unstructured grids is often done using indirect methods, such as, (a) subdividing all non-tetrahedral cells into tetrahedra and computing the triangulated isosurfaces using the marching tetrahedra algorithm, or (b) triangulating intersection points of edges of cells and an isosurface using a standard triangulation algorithm. Using the basic ideas underlying the well-established marching cubes and marching tetrahedra algorithms, which are applied to hexa- hedral and tetrahedral elements, respectively, we generate look-up tables for extracting isosurfaces directly from pentahedral elements. By using appropriate look-up tables, it is possible to process nearly all types of hybrid unstructured grids used in practical applications without the need for indirect methods. We construct look-up tables for square pyramidal and triangular prismatic cells with accurate topological considerations. 1 INTRODUCTION Computer simulations of physical phenomena often use hybrid unstructured grids. For example, these grids are routinely used in computational fluid dynamics (CFD) and finite element analysis (FEA). Hybrid unstructured grids can have very complex geometrical structure, compared to, for example, rectilinear grids. Performing correct di- rect interpolation on such hybrid meshes, e.g., in the context of direct volume visualization or iso- surface extraction, is central to its analysis. The complex geometry and topology, i.e. element con- nectivity, of such meshes makes its analysis more challenging. Throughout this paper, we have used the terms “grids” and “meshes” interchangeably. A great deal of progress has been made in re- cent years in the field of volume rendering using ray-casting. However, research related to simpler and more traditional visualization techniques like isosurface extraction from hybrid meshes has not been fully addressed for the entire spectrum of element types, which are commonly used, in ad- dition to hexahedra and tetrahedra. Some of the commonly used elements are shown in Figure 1. In our work, we have used the following interpo- lation models for elements of our interest: Tetrahedron: Linear interpolation, often us- ing barycentric coordinates, is used. Using barycentric coordinates, α, β, γ , and δ, this model uses three linearly independent vari- ables and a condition for the barycentric co- ordinates, i.e., α + β + γ + δ = 1. Square pyramid (Pentahedron): Bilinear in- terpolation is used for the base quadrilateral combined with linear interpolation from the base quadrilateral to the apex, i.e. the oppos- ing single vertex. (s, t) are parameters used

Upload: others

Post on 03-Feb-2022

7 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: Isosurface Extraction from Hybrid Unstructured Grids Containing

Isosurface Extraction from Hybrid Unstructured GridsContaining Pentahedral Elements

Akshay Narayan1, Jaya Sreevalsan-Nair1, Kelly Gaither2 and Bernd Hamann3

1International Institute of Information Technology - Bangalore,26/C, Electronics City, Hosur Road, Bangalore 560100, India

2 Texas Advanced Computing Center, University of Texas at Austin,10100 Burnet Road, Austin, TX 78758, U.S.A.

3 Institute for Data Analysis and Visualization, Department of Computer Science,University of California, Davis,

One Shields Avenue, Davis, CA95616, [email protected], [email protected], [email protected], [email protected]

Keywords:Volume Visualization: Isosurface Extraction: Hybrid Meshes: Marching Methods

Abstract:Grid-based computational simulations often use hybrid unstructured grids consisting of varioustypes of elements. Most commonly used elements are tetrahedral, pentahedral (namely, squarepyramids and right triangular prisms) and hexahedral elements. Extracting isosurfaces of scalarfields defined on such hybrid unstructured grids is often done using indirect methods, such as, (a)subdividing all non-tetrahedral cells into tetrahedra and computing the triangulated isosurfacesusing the marching tetrahedra algorithm, or (b) triangulating intersection points of edges of cellsand an isosurface using a standard triangulation algorithm. Using the basic ideas underlying thewell-established marching cubes and marching tetrahedra algorithms, which are applied to hexa-hedral and tetrahedral elements, respectively, we generate look-up tables for extracting isosurfacesdirectly from pentahedral elements. By using appropriate look-up tables, it is possible to processnearly all types of hybrid unstructured grids used in practical applications without the need forindirect methods. We construct look-up tables for square pyramidal and triangular prismatic cellswith accurate topological considerations.

1 INTRODUCTION

Computer simulations of physical phenomenaoften use hybrid unstructured grids. For example,these grids are routinely used in computationalfluid dynamics (CFD) and finite element analysis(FEA). Hybrid unstructured grids can have verycomplex geometrical structure, compared to, forexample, rectilinear grids. Performing correct di-rect interpolation on such hybrid meshes, e.g., inthe context of direct volume visualization or iso-surface extraction, is central to its analysis. Thecomplex geometry and topology, i.e. element con-nectivity, of such meshes makes its analysis morechallenging. Throughout this paper, we have usedthe terms “grids” and “meshes” interchangeably.

A great deal of progress has been made in re-cent years in the field of volume rendering usingray-casting. However, research related to simpler

and more traditional visualization techniques likeisosurface extraction from hybrid meshes has notbeen fully addressed for the entire spectrum ofelement types, which are commonly used, in ad-dition to hexahedra and tetrahedra. Some of thecommonly used elements are shown in Figure 1.In our work, we have used the following interpo-lation models for elements of our interest:

• Tetrahedron: Linear interpolation, often us-ing barycentric coordinates, is used. Usingbarycentric coordinates, α, β, γ, and δ, thismodel uses three linearly independent vari-ables and a condition for the barycentric co-ordinates, i.e., α+ β + γ + δ = 1.

• Square pyramid (Pentahedron): Bilinear in-terpolation is used for the base quadrilateralcombined with linear interpolation from thebase quadrilateral to the apex, i.e. the oppos-ing single vertex. (s, t) are parameters used

Page 2: Isosurface Extraction from Hybrid Unstructured Grids Containing

for bilinear interpolation, and u is the param-eter used for linear interpolation along axis.

• Right triangular prism (Pentahedron): Linearinterpolation, often performed using barycen-tric coordinates, is applied to the two oppositetriangular faces (bases) combined with linearinterpolation along the axis of the prism, i.e.,in the direction from one triangular base tothe other. u is the parameter used for linearinterpolation along the axis and α, β, γ areused as barycentric coordinates for the inter-polation within a triangular slice consideredalong the axis. This model uses three linearlyindependent variables in total, after consider-ing the condition that α+ β + γ = 1.

• Hexahedron: Trilinear interpolation is used,with parametric representation s, t, u, whichrepresent x-, y-, and z-coordinates respec-tively.

All parameters of points interior to the cell sat-isfy the property of being in the interval [0, 1].The interpolation models explained above usethree linearly independent variables. These mod-els are generally used for these elements owing totheir low computational complexity. Interpola-tion models for pyramidal and prismatic elementsare discussed in detail in Section 4.1.

The primary reason for lack of efforts has beenthat although these grids are commonly usedfor modeling physics occurring in complex ge-ometries, hybrid meshes consist of elements orcells other than tetrahedra and hexahedra, andthe basis functions for such cells are no longerpurely linear or trilinear. This leads to morecomplex interpolating functions. Recent increasein the availability and accessibility of powerfulcomputational resources has increased use of hy-brid meshes for several CFD and finite elementmethod (FEM) applications, which demands formore in-depth analysis of such grids for visualiza-tion applications.

Mathematically, the problem one must solvewhen confronted with the extraction of (trian-gulated) isosurfaces from such hybrid methodsis this: For all faces of mesh elements that areshared by two neighboring cells, one must ensurethat the linearly or bilinearly varying functiondefined over a shared element face is the same.Further. when computing and connecting isosur-face points lying on the edges of a shared ele-ment face, it must be ensured that such pointsare consistently connected, from the viewpointof both elements sharing this face. In (Lasser,1985), continuity conditions for Bernstein-Bezier

P0010

P000

P000

P101

P100

P110

P111

P010

P011

(a) (b)

(c) (d)

P

P

P

P

P1001 P0101

P0011

P0100

P0010P1000

P0001

P0100

P1000 P100

P110

P010

P001

P001

Figure 1: Different element/cell types: (a) Tetra-hedron, (b) Pentahedron - Square Pyramid, (c) Pen-tahedron - Right Triangular Prism, and (d) Hexa-hedron. Using parametric representation based onthe interpolation models, a point P in space with re-spect to each cell is represented as (a) P (α, β, γ, δ),(b) P (s, t, u), (c) P (α, β, γ, u), (d) P (s, t, u). If P isinterior or on the boundary of the cell, all parame-ters defining it satisfy the condition of being a realnumber in the interval [0, 1].

functions defined over the types of volumetricmesh elements, which we are concerned with here,were used for construction of gradient-continuousspline approximations.

Existing isosurface extraction methods forhexahedra and tetrahedra work well on hybridmeshes, subject to converting a given hybrid gridfirst to a purely hexahedral grid or a purely tetra-hedral grid, respectively. The preprocessing stagefor converting the hybrid mesh entails either re-sampling the grid to a rectilinear grid, or decom-posing the hybrid grid into tetrahedral elements.The commonly used marching cubes or marchingtetrahedra algorithm is then, respectively, imple-mented on the refined mesh to extract isosurfaces.The conversion of a given hybrid mesh to a meshconsisting only of hexahedra and tetrahedra in-troduces additional approximation error, if intro-ducing new vertices is required. Since the conver-sion to a simpler grid type is not uniquely defined,it can lead to multiple analysis results, i.e., resultsthat depend on the choice made among severalcombinatorially possible geometries for the con-version to another grid. This in turn can lead tomultiple topological orientations for an isosurface.

Page 3: Isosurface Extraction from Hybrid Unstructured Grids Containing

Additionally, the conversion approaches scale lin-early with problem size, which may slow downperformance for larger datasets.

We attempted to use open source visualiza-tion tools like ParaView (Moreland, 2011), andGMV (Ortega, 2011), on a large hybrid meshdataset, whose size is of the order of 1 GB. How-ever, loading such a large dataset into systemmemory and generating isosurfaces requires ap-proximately 10 minutes in the serial implementa-tion of ParaView. ParaView’s parallel implemen-tation shows slightly better performance than theserial version. It was not possible to obtain isosur-faces in real time for our specific dataset, whichmotivated our research to perform direct extrac-tion of isosurfaces from hybrid meshes. Thoughour results do not show any significant improve-ment in performance in the case of the largedataset, our work conclusively analyzes the var-ious topological orientations of the pentahedralcells so that we obtain a unique isosurface for anygiven value.

Our datasets consists of tetrahedral, pentahe-dral, and hexahedral elements. The contributionsof our work are to provide look-up tables to ex-tract isosurfaces directly from five-node (squarepyramidal) and six-node (right triangular pris-matic) pentahedral elements, which includes alltopological configurations, and the computationsinvolved in determining body saddle points forspecifically the triangular prismatic element. Thelook-up tables enable us to obtain a unique so-lution for isosurface for a given function value.Specifically we have done the following:

1. We have implemented and tested new look-uptables for all possible cell configurations fordirect isosurface extraction from the squarepyramidal and triangular prismatic cells.

2. We have used our derived equations to com-pute the body saddle points for the triangularprismatic cell, which need to be included incertain configurations to complete the isosur-face tessellation within the cell.

3. We have used a combination of look-up tablesfrom the traditional marching tetrahedra andextended marching cubes, and our proposedones for pentahedral cells, to use the nativeelements directly to compute isosurfaces.

2 RELATED WORK

The foundation of our work has been themarching cubes algorithm, which has been ex-tensively researched in the scientific visualiza-tion community, for which (Lorensen and Cline,1987), (Nielson and Hamann, 1991), (Nielson,2003), (Lopes and Brodlie, 2003) are some of therepresentative papers. In particular, we point thereaders to a very comprehensive survey of themarching cubes algorithm in (Newman and Yi,2006).

Concerning isosurface extraction from hybridunstructured grids, work has been done towardsextending the marching cubes algorithm to hy-brid meshes containing tetrahedral, prismatic andhexahedral elements in (Gallagher and Nagtegaal,1989). Though our work is similar, we discussthe look-up tables more exhaustively, for bothfive- and six-node pentahedral elements. In arelated paper (Takahashi et al., 2004), look-uptable approach for octahedral elements has beendiscussed.

In the visualization software GMV, isosurfaceextraction from hybrid meshes is implementedby determining intersection points of isosurfaceson edges of cells and triangulating these pointsto generate a 2-manifold surface (Ortega, 2008).However, this method discards the informationprovided by the grid during the triangulationstage, which can lead to a different solution fromthe one would obtain by using an interpolationfunction for each cell.

(Bhaniramka et al., 2004) presented an algo-rithm for automatically generating case tables forisosurfaces in cells containing hypercubes, cellswith 2k vertices in k-dimensional space. Theiralgorithm creates look-up tables similar to thatof (Montani et al., 1994). It uses the convexhull of an intersection set of vertices, V +

h and

Uh, where V +h are vertices of the hypercube with

scalar values greater than the isosurface value andUh is the set of the intersection points of isosur-face and the hypercube. It further removes (k−1)dimensional facets that lie on the faces of the hy-percube from the convex hulls, and the remnantof the convex hulls are the isosurfaces. This al-gorithm can be extended to pentahedral cells, asit is applicable to all topological homotopes inthe k-dimensional space. Tetrahedral, pentahe-dral, hexahedral and octahedral cells, which arethe typical cell types used in hybrid meshes, areconvex polyhedra with Euler characteristic χ = 2,and hence are topological homotopes of a three-

Page 4: Isosurface Extraction from Hybrid Unstructured Grids Containing

dimensional hypercube.(Weber et al., 2003) described a crack-free

isosurface extraction algorithm, specifically formeshes subjected to adaptive mesh refinement(AMR). This scheme uses “stitch cells” to bridgethe gap between meshes of different levels of hier-archy. These stitch cells could be tetrahedra, pen-tahedra, or hexahedra. They have further sug-gested extending the marching cubes algorithmappropriately for each of the cell types and han-dling ambiguities, as has been done in the caseof successors of the original marching cubes algo-rithm. We have used the interpolation functionsthat (Weber et al., 2001) use.

While methods by (Weber et al., 2003)and (Bhaniramka et al., 2004) work for our appli-cation, we are going a step further to resolve thetopological configurations for pentahedral cells byusing similar patterns that are found in hexahe-dra. Our work closely follows the indexing for theconfigurations used by (Nielson, 2003) for hexa-hedra.

In relation to our argument against subdivi-sion of elements, (Carr et al., 2006) have discussedvarious artifacts that can be introduced while per-forming simplicial subdivision of a hexahedral el-ement.

In the area of visualization of hybrid unstruc-tured grids, a great deal of research has beendone for both software- and hardware-based ap-proaches in volume rendering. The direct vol-ume rendering methods for unstructured gridsare described in, for example, (Williams et al.,1998), (Muigg et al., 2007).

3 DISADVANTAGES OFAPPROACHES BASED ONTETRAHEDRALIZATION OFHYBRID GRIDS

The marching tetrahedra algorithm is one ofthe most convenient isosurface extraction algo-rithms since it does not have to deal with any ofthe ambiguous cases which occur in the case of themarching cubes algorithm. However, in the caseof hybrid unstructured grids, extracting isosur-faces using the marching tetrahedra algorithm re-quires an extra processing step of subdividing thenon-tetrahedral elements in the mesh into tetra-hedral ones while ensuring continuity of isosur-face across faces. A tetrahedral element inher-ently uses a linear interpolation function, there-

fore making its processing simple and straightfor-ward. Since tetrahedra are basic building blocks,and all complex geometric shapes can be brokendown into tetrahedra, it is one of most commonlyused finite elements.

However, one has to be aware of the differencesin interpolants that occur when decomposing ahybrid mesh to a tetrahedral mesh. We discusssome of these differences in the following.

• A straightforward tetrahedralization can bedone without inserting new vertices in themesh. However, in certain cases, it is not pos-sible without the introduction of additionalvertices in the interior of a complicated ele-ment bounded by triangular and quadrilateralfaces. Nevertheless, the first step in subdi-vision of cells to tetrahedra is subdivision ofits quadrilateral faces to triangles. In a stan-dard Lagrange finite element, a bilinear inter-polation function is used in the quadrilateralface, and piecewise linear interpolation func-tions are used after subdivision of the face.

Considering the parametric representation ofa function F on a bilinear surface, at any pointP (x, y, z), one obtains:

F (x, y, z) = f(s, t)

= (1− s)(1− t)F00 + s(1− t)F10

+stF11 + (1− s)tF01

where (s, t) is the parametric representationof the point P (x, y, z) in the quadrilateralP00P10P11P01, as shown in Figure 2(a); andFij is the function value at Pij for {i, j} ={0, 1}. On the diagonals (where s = t ors + t = 1), the interpolating function isquadratic in either s or t. However, when wetriangulate the quadrilateral and use one ofthe diagonals as an edge to compute pointson the isosurface, we use a linear interpola-tion model. The different interpolation mod-els used for computing and visualizing the so-lution can lead to artifacts in the isosurface,as shown in (Carr et al., 2006).

• Tetrahedralization of a hybrid mesh is an ap-proach that leads to non-unique solutions.Subdividing a quadrilateral face can lead totwo solutions, as either of its two diagonalscan be used to triangulate the surface. Thus,different possible tetrahedralizations can leadto different results for isosurfaces. The differ-ences in the isolines generated for a quadrilat-eral face, depending on the choice of triangu-lation is shown in Figure 2.

Page 5: Isosurface Extraction from Hybrid Unstructured Grids Containing

(Value=5) (Value=2)

(Value=2) (Value=3)

s

t

(Value=3.5)

(a) (b) (c)

P01 P11

P00 P10

Figure 2: Difference of isolines without and with triangulation. For extracting isoline for function value 3.5,(a) shows the approximation of isoline using bilinear interpolation-based contouring, (b) and (c) show the twodifferent isolines one obtains when considering the two possible triangulations of the quadrilateral. Note thatthe isolines in (b) and (c) are still topological homotopes. (a) also shows the parametric representation of thevertices in (s, t) in a bilinear interpolation model.

• Though we can obtain a good approximationof the isosurface using the marching tetrahe-dra algorithm on a purely tetrahedral mesh, inthe case of large datasets, the computationaland storage overhead induced by generatingand using the additional elements may can-cel the gain of eliminating ambiguities andusing linear elements. Minimally, a pyra-mid can be decomposed to two tetrahedra,a prism to three and a hexahedron to five.In one of our datasets, the missile dataset,for each time-step we have around 24,800,000tetrahedra, 17,700 pyramids and 4,207,000prisms; which on tetrahedralization results in37,456,400 tetrahedra, which is a 30% increasein the number of cells. The additional tetra-hedra not only require extra computations togenerate, but also introduce additional mem-ory overhead which can slow down perfor-mance to a certain extent.

• (Carr et al., 2006) discussed on how minimalsubdivision of hexahedral cells causes cracksin the isosurface and hence using a parity rulewhile subdividing is essential for a crack-freeisosurface. The minimal subdivision discussedthere is equivalent to the decomposition weare discussing here, and the parity rule im-plies a rule that ensures that a quadrilateralface shared between two cells uses the samediagonal for triangulation to ensure C0 conti-nuity of the isosurface across the face. In theabsence of indexed cells in a grid, one has tobuild the spatial neighborhood of each cell toensure this parity rule. This is a huge compu-

tational overhead, in the case of large hybridmeshes and it negates the benefits of “embar-rassingly parallel” nature of the marching al-gorithms.

For the missile dataset which consists of 85%tetrahedra, tetrahedralization of the grid does notlead to any significant benefits with respect tospatial or time complexity, or performance. Al-ternatively, we explore computing isosurfaces inthe non-tetrahedral cells by implementing sepa-rate look-up tables for each of the unique geomet-ric element types. In the following, we describein detail how these look-up tables are constructedfor five- and six-node pentahedral elements, andhow they are used in a marching method to ex-tract isosurfaces directly. We have found thatour method, using our new look-up tables, showscomparable performance with respect to existingvisualization tools.

4 PENTAHEDRAL CELLS

Pentahedral cells are frequently used in con-formal grids in CFD and FEM applications, for“stitching” pure tetrahedral or hexahedral grids.The five-node (square pyramidal) and the six-node (triangular prismatic) pentahedral cells arevery commonly used as “stitch cells” or filler cellsin hybrid unstructured grids. The marching algo-rithms can be extended for the pentahedral cellsby building appropriate look-up tables. Just as inthe marching tetrahedra and the marching cubesalgorithms, these look-up tables ensure piecewise-

Page 6: Isosurface Extraction from Hybrid Unstructured Grids Containing

continuous isosurfaces for pentahedral cells. Inthe marching algorithms, we use linear interpola-tion on the edges of the cells, and the isosurfaceson the faces of the cells reduce to isolines, thusensuring piecewise continuous surfaces.

4.1 INTERPOLATINGFUNCTIONS

The interpolation functions for a square pyramidand triangular prism depends on their respectiveorientation. For sake of simplicity while derivingthe interpolation functions, we assume that theaxis of the cell is along z-axis in its local coordi-nates. This section shows that the interpolationfunctions in the case of the pentahedral cells arenot symmetric with respect to the basis vectors,as are the cases with the tetrahedron and the hex-ahedron.

4.1.1 Square Pyramids

The interpolation function for a square pyramid,with its z-axis defined by the direction implied bythe base quadrilateral and the apex, is given by:

F (x, y, z) = C0 + C1x+ C2y + C3xy + C4z

for real values of Ci, for 0 ≤ i ≤ 4, i being anon-negative integer.

There are several parametric representationspossible. The simplest representation using threelinearly independent variables is by using a pa-rameter u representing position in the direction ofz-axis, and two parameters (s, t) for the paramet-ric representation of a bilinearly interpolated sur-face in a quadrilateral slice at a particular height,as shown in Figure 3. (u = 0) and (u = 1) rep-resent the quadrilateral base and the apex, re-spectively; (s = 0), (s = 1), (t = 0), and (t = 1)represent the four triangular faces of the pyramid,respectively.

Let the cell be defined with vertices P001 at theapex and P000, P100, P110, and P010 at the base.The function value at Pstu, for is given by Fstuand coordinates are given by (xstu, ystu, zstu).Every point P (x, y, z) in space can be representedas p(s, t, u) with respect to this cell, and the func-tion value at P , F (x, y, z) = f(s, t, u) is interpo-lated using:

F ′001 =(1− s)(1− t)F000 + s(1− t)F100

+ stF110 + (1− s)tF010

F (x, y, z) =f(s, t, u) = uF001 + (1− u)F ′001(1)

yx

z

P(x,y,z)

us

t

P001

P000 P100

P010 P110

P100’

P110’P010’

P000’

Figure 3: Parametric representation in a square pyra-mid: (s, t, u) parameter three-tuples representation isused for points. For determining the parametric rep-resentation of P (x, y, z), we use the quadrilateral sliceP ′000P

′100P

′110P

′010 containing P being parallel to base

face P000P100P110P010. u is the parameter in the di-rection of the z-axis; (s, t) is the two-tuple parametricrepresentation of a bilinearly represented point in theslice parallel to the base face. The slice degeneratesto a single point at the apex P001.

where, u is the parameter along the z-axis, and sand t are parameters for the bilinear represen-tation of the quadrilateral slice containing thepoint. For any point in the interior or on theboundary of the cell, 0.0 ≤ s, t, u ≤ 1.0. To de-termine (s, t, u) for a given point, P (x, y, z), weperform the following steps:

1. Any permissible value of u defines a quadri-lateral slice formed by vertices at a ratio ofu : (1− u) along the edges from apex to base.For a planar base, we perform the followingsteps to determine u:

(a) We determine the normal vector n of thebase P000P100P110P010, and derive the planeequation of the base, Ax+By+Cz+D0 = 0,where n = {A,B,C}T .

(b) At the apex P001, we determineD1 = −(Ax0 +By0 + Cz0).

(c) We determine the parameter

u(x, y, z) = −Ax+By+Cz+D0

D1−D0.

2. Further, we determine the quadrilateral sliceP ′000P

′100P

′110P

′010 containing P , and we rep-

resent P using bilinear interpolation on theslice.The parameter two-tuple (s, t), requiredfor bilinear interpolation in a slice, is definedby the three equations implied by the threecoordinates of a point, i.e.,

P = (1− s)(1− t)P ′000 + s(1− t)P ′100+stP ′110 + (1− s)tP ′010

Page 7: Isosurface Extraction from Hybrid Unstructured Grids Containing

z

y

x

P(x,y,z)

P0100’

u

P1000

P0100P0010

P0010’

P1000’

P1001

P0101P0011

Figure 4: Parametric representation in a right trian-gular prism: (α, β, γ, u) parameter three-tuples rep-resentation is used for points. For determining theparametric representation of P(x,y,z), we use the tri-angular slice P ′

1000P′0100P

′0010, whose vertices are at

ratio u : (1−u) on the axial edges, namely, P1000P1001,P0100P0101, and P0010P0011. u is the linear parame-ter along one of the three axial edges. (α, β, γ), athree-tuple gives the barycentric coordinates of P inP ′1000P

′0100P

′0010.

This interpolation function reduces to a bilin-ear function on the quadrilateral face, and a lin-ear function on the triangular faces and the edges,thus ensuring C0 continuity at the edges and facesof the cells.

4.1.2 Right Triangular Prisms

The interpolation function for a triangular prism,with its z-axis defined by its opposite triangularfaces, is given by

F (x, y, z) = C0 + C1x+ C2y

+C3z + C4xz + C5yz

The cell can be represented parametrically byusing a parameter u representing the positionwith respect to any of the three edges not be-longing to the triangular bases (referred to asaxial edges), and three barycentric coordinates,(α, β, γ), in the triangular slice obtained fromthe points at the parameter u on the three axialedges, as shown in Figure 4. (u = 0) and (u = 1)represent the two triangular bases, respectively,and the three quadrilateral faces are representedby (α = 1), (β = 1), and (γ = 1), respectively.

Let the cell contain vertices, P1000, P0100,P0010 on one triangular face and P1001, P0101,P0011 at the other end. The function valuesat Pαβγu, are given by Fαβγu and coordinatesare (xαβγu, yαβγu, zαβγu). Every point P (x, y, z)

in space can be represented as p(α, β, γ, u) withrespect to the cell. The function value at P ,F (x, y, z) = f(α, β, γ, u) is interpolated using theformula:

F (x, y, z) =f(α, β, γ, u)

=(1− u)(F1000α+ F0100β + F0010γ)

+ u(F1001α+ F0101β + F0011γ)

(2)

where, u is the parameter along axial edges and α,β and γ are barycentric coordinates of the pointin the triangular slice P ′1000P

′0100P

′0010. For any

point in the interior to or on the boundary of thecell, 0.0 ≤ u, α, β, γ ≤ 1.0 and (α + β + γ = 1).Due to linear dependence of α, β, and γ, we canreduce the parametric representation to a three-tuple, (α, β, u) to represent the set of linearly in-dependent variables. However, to maintain theease of representing the interpolation function, wecontinue to refer to the four-tuple parametric rep-resentation, (α, β, γ, u).

To determine (α, β, γ, u) for a given pointP (x, y, z) we perform the following steps:

1. The parameter u defines the triangular slice(P ′1000P

′0100P

′0010) containing P .

P ′1000 = P1000 + u(P1001 − P1000)

P ′0100 = P0100 + u(P0101 − P0100)

P ′0010 = P0010 + u(P0011 − P0010)

If the two triangular bases are parallel, we ob-tain u the same way as in the case of squarepyramids.

(a) We determine the normal vector n to thebase P1000P0100P0010, and formulate theplane equation of the base, Ax+By+Cz+D0 = 0, where n = {A,B,C}T .

(b) For the opposite triangular faceP1001P0101P0011, we determine the corre-sponding value of D1 using one of the threevertices in the face: D1 = −(Ax+By+Cz).

(c) We determine the parameter

u(x, y, z) = −Ax+By+Cz+D0

D1−D0.

However, more generally, the value for u is thesolution of the cubic equation in u given by:

(P ′1000 − P ) · ((P ′0100 − P )× (P ′0010 − P )) = 0

In the case of a right triangular prism, we geta unique real value for u, which satisfies thecondition 0.0 ≤ u ≤ 1.0.

2. Further, we determine the triangular slice(P ′1000P

′0100P

′0010) containing P , and deter-

mine the barycentric coordinates (α, β, γ) of

Page 8: Isosurface Extraction from Hybrid Unstructured Grids Containing

the point in the triangle, which is given bythe ratios of areas subtended by the point tothe vertices of the specific triangular slice, tothe total area of the triangle.

This interpolation function reduces to a linearfunction at the triangular faces, and to a bilinearfunction at the quadrilateral faces and the edges.Thus, our interpolation model ensures that the re-sulting isosurface is continuous across elements.

4.2 LOOK-UP TABLES

Configuration Cases

0 0, 311 1, 302 2, 4, 8, 15, 16, 23, 27, 293 6, 7, 12, 13, 18, 19, 24, 254 10, 11, 20, 215 3, 5, 9, 14, 17, 22, 26, 28

Table 1: Classification of all cases into six baseconfigurations of a square pyramid element.

Configuration Cases

0 0, 631 1, 2, 4, 8, 16, 31,

32, 47, 55, 59, 61, 622 3, 5, 6, 15, 23, 24,

39, 40, 48, 57, 58, 603 9, 18, 27, 36, 45, 544 10, 12, 17, 20, 29, 30,

33, 34, 43, 46, 51, 535 14, 21, 28, 35, 42, 496 11, 13, 19, 22, 25, 26,

37, 38, 41, 44, 50, 527 7, 56

Table 2: Classification of all cases into eight baseconfigurations of a right triangular prismatic ele-ment.

Just as in the marching cubes algorithm, werepresent the cases of pentahedral cells using abit-string where each bit corresponds to a spe-cific vertex of the cell and the value of the bit isthe boolean value indicating if the data value atthe vertex is greater than or equal to the isosur-face value. For a k-node cell, thus, there can be2k cases. However, these cases can be reducedto unique configurations using mapping based onmirroring, rotation and complementation. Thus,32 cases of square pyramid reduce to six uniqueconfigurations; and 64 cases of right triangularprisms reduce to eight. Figures 5 and 6 show the

C0 C1

C2 C3

C4 C5

Figure 5: Six configurations of a square pyramidalelement. Black points and circles indicate verticeswhose function values are larger or smaller than theisosurface value.

C0 C1

C2 C3

C4 C5

C6 C7

Figure 6: Eight configurations of a right triangularprismatic element. Black points and circles indicatevertices whose data values are larger or smaller thanthe isosurface value, respectively.

Page 9: Isosurface Extraction from Hybrid Unstructured Grids Containing

A B

CD

C4.0 C4.1

Figure 7: Subconfigurations of square pyramidalcells: Blue lines help to show if the ambiguous face isconnected or separated. In subconfigurations 4.0 and4.1, ABCD is separated and connected, respectively.

C4.0

C5.0 C5.1

C4.1

C5.2C5.3

A

C

E

B

F

D

Figure 8: Subconfigurations of right triangular pris-matic cells: Blue lines help to show if the ambiguousfaces are connected or separated. In subconfigura-tions 4.0 and 4.1, ABDC is separated and connected,respectively. In subconfigurations 5.0 and 5.3, thequadrilaterals ABDC and CDFE are both separatedand connected, respectively. Subconfigurations 5.1and 5.2 are complementary: in 5.1, ABDC is sep-arated and CDFE is connected; and in 5.2, ABDCis connected and CDFE is separated. Isosurfaces inconfigurations 5.1 and 5.2 require additional vertices,namely the tangent points, indicated by green ver-tices.

unique base configurations of both cell types. Ta-bles 1 and 2 classify all cases according to theirrespective base configurations.

4.2.1 Resolving Ambiguities

Quadrilateral faces in the pentahedral cells canlead to ambiguities. Just as in the marching cubesalgorithm, the ambiguities are resolved using theasymptotic decider (Nielson and Hamann, 1991).

As shown in Figure 7, configuration 4 containsa single ambiguous face, ABCD. Subconfigura-tions 4.0 and 4.1 occur when ABCD is “sepa-rated” and “connected” (Nielson and Hamann,1991), respectively.

Figure 9: Isosurfaces for all seven configurations ofthe square pyramidal cells with topological consider-ations.

Figure 10: Isosurfaces for all twelve configurations ofthe right triangular prismatic cells with topologicalconsiderations.

As shown in Figure 8, configurations 4 and5 have been resolved. Configuration 4 containsa single ambiguous face, ABDC; while configu-ration 5 contains two ambiguous faces, ABDCand CDFE. Subconfigurations 4.0 and 4.1 occurwhen ABDC is separated and connected, respec-tively. Subconfigurations of 5 occur with possi-

Page 10: Isosurface Extraction from Hybrid Unstructured Grids Containing

bilities of ABDC and CDFE being separated andconnected, respectively. Thus, we have subcon-figurations 5.0 and 5.3 with both faces being sep-arated and connected, respectively. 5.1 and 5.2are complementary: in 5.1, ABDC is separatedand CDFE is connected; and in 5.2, vice versa.Configurations 5.1 and 5.2 require tangent pointsto obtain accurate topological representation ofthe isosurface, as the isosurface assumes the be-havior of topological type A.2, which is discussedin (Lopes and Brodlie, 2003). The computationof tangent points for right triangular prisms isdiscussed in Appendix.

The surfaces computed from our interpolationmodels for all the configurations for both celltypes are shown in Figures 9 and 10.

5 DIRECT ISOSURFACEEXTRACTION FROMHYBRID MESHES

As explained in Section 3, for direct isosur-face extraction from hybrid meshes, we use therespective look-up tables for each element type,namely, tetrahedra, square pyramids, triangularprisms and hexahedra.

In addition to these cell types which are com-monly used finite elements, there exist severalother types of finite elements all having theirown associated complicated interpolation func-tions. Nevertheless, those other types do notoccur in our specific applications. Often, theseother types of cells, which might be bounded byan arbitrary number of n-gons, require a combina-tion of appropriate linear interpolation functions.

5.1 Gradient Approximation

Gradient interpolation is required for computingnormal vectors which are used for lighting pur-poses during rendering the isosurface. We imple-mented gradient approximation using a prepro-cessing step implemented at all the grid nodes.We use a least squares procedure (Anderson andBonhaus, 1994), which computes unweighted gra-dients in two-dimensional space by solving anover-determined system of equations. We extendthe algorithm in (Anderson and Bonhaus, 1994)to the three-dimensional case, using the equation:

fi = f0 + fx0(xi − x0)

+fy0(yi − y0) + fz0(zi − z0)

where fi and f0 are the values of the function fat points Pi and P0, and Pi, for i = 1, 2, . . . , N

have edges with P0. The gradient at N0 is ~f ′0 =(fx0 , fy0 , fz0). This leads to an N × 3 system ofequations:

∆x1 ∆y1 ∆z1∆x2 ∆y2 ∆z2

......

...∆xN ∆yN ∆zN

fx0

fy0fz0

=

f1 − f0f2 − f0

...fN − f0

For solving this over-determined system of equa-tions, we compute

rab =

N∑i=1

(a0 − ai)(b0 − bi), where a, b ∈ {x, y, z} rxx rxy rxzrxy ryy ryzrxz ryz rzz

W xi

W yi

W zi

=

xi − x0yi − y0zi − z0

We solve for W x

i , W yi and W z

i using Cramer’srule, and approximate the gradient using theseweights:

fa0 =

N∑i=1

W ai (fi − f0), where a ∈ {x, y, z}

~f ′0 = (fx0, fy0 , fz0)T

6 RESULTS

We implemented our algorithm on a visualiza-tion cluster, Colt, at TACC, with the followingspecifications: 2 Intel Xeon quad core E5440 pro-cessors (8 cores total), 16 GB of RAM , nVidiaQuadro FX5800 graphics card with 4 GB mem-ory.

We tested our method for a synthetic datasetconsisting of 1,315 nodes, containing all prisms.For comparison purposes, we further tessellatedthis dataset into a purely tetrahedral mesh. Weextracted isosurfaces from the original prismdataset and the purely tetrahedral dataset, andprovide our comparative results in Figure 11. Thetime taken to render the isosurfaces in the prismgrid and tetrahedral grid are 0.01s and 0.03sseconds, respectively, for an isosurface value of0.2019.

We applied our method to hybrid meshesdefining (a) a wind-tunnel model from NASA,shown in Figure 12, and (b) a missile, shownin Figure 13. The wind-tunnel dataset consistsof 442,368 hexahedral, 721,413 tetrahedral, and

Page 11: Isosurface Extraction from Hybrid Unstructured Grids Containing

13,824 pyramidal elements. The missile datasetconsists of 6,378,506 nodes, 2,479,668 tetrahedra,17,691 pyramids and 4,207,433 prisms. The re-sults of our direct isosurface extraction methodare tabulated in Table 3. Our timing measure-ments for reading the file and preprocessing gra-dients did not show any improvement comparedto our experiments using ParaView, and hence,we have not included them here.

7 CONCLUSIONS

Our implementations in Figures 11-13 showthat our method generated results comparable tothose from standard methods. Our method gen-erated fewer triangles compared to applying themarching tetrahedra algorithm on a tessellatedgrid. This is mainly due to the fact that the num-ber of elements (tetrahedral, pentahedral, andothers) being handled is smaller than in the caseof a hybrid mesh that has been tetrahedralized.

Our method is comparably computationallyefficient, especially for larger datasets. The gra-dient computation requires O(n) time for n be-ing the number of nodes in the dataset. How-ever, the gradient estimation step needs to be per-formed just once as a preprocessing step, whichmakes real-time generation of smooth isosurfacesefficient. Furthermore, we have covered all theambiguous configurations possible that can occurfor pentahedral elements, i.e., our look-up tablesare complete. Computing body saddle points ina triangular prismatic element is similar to thatof the hexahedron,

Our method can be further enhanced withthe optimization strategies which are used in themarching cubes method. Specific methods whichare not influenced by the shape of the elementscan be used directly without any modifications,as we use the same algorithm with the exceptionof different look-up tables.

ACKNOWLEDGEMENTS

We are grateful to Dr. David Marcum of Mis-sissippi State University, and to Dr. BenjaminKirk of NASA/JSC for sharing the missile andwind-tunnel datasets, respectively. We are alsograteful to Dr. John W. Peterson of TACC forhelping with using GMV and for providing exper-imental FEM datasets. This work has been sup-ported by a TeraGrid Resource Provider Grantas well as IIIT-Bangalore. We would like to

thank all members of the Visualization Groupin TACC and IIIT-Bangalore for supporting ourwork. Our special gratitude to Prof. K. V. Dine-sha and Pratap J. Rao for helping with discus-sions and resources.

REFERENCES

Anderson, W. K. and Bonhaus, D. L. (1994). AnImplicit Upwind Algorithm for Computing Tur-bulent Flows on Unstructured Grids. Comput.Fluids, 23:1–21.

Bhaniramka, P., Wenger, R., and Crawfis, R. (2004).Isosurface Construction in Any Dimension UsingConvex Hulls. IEEE Transactions on Visualiza-tion and Computer Graphics, 10:130–141.

Carr, H., Moller, T., and Snoeyink, J. (2006). Arti-facts Caused by Simplicial Subdivision. IEEETransactions on Visualization and ComputerGraphics, 12:231–242.

Gallagher, R. S. and Nagtegaal, J. C. (1989). An Effi-cient 3-D Visualization Technique for Finite El-ement Models and Other Coarse Volumes. SIG-GRAPH Comput. Graph., 23:185–194.

Lasser, D. (1985). Bernstein-Bezier Representationof Volumes. Computer Aided Geometric Design,2(1-3):145–149.

Lopes, A. and Brodlie, K. (2003). Improving the Ro-bustness and Accuracy of the Marching CubesAlgorithm for Isosurfacing. IEEE Transactionson Visualization and Computer Graphics, 9:16–29.

Lorensen, W. E. and Cline, H. E. (1987). MarchingCubes: A High Resolution 3D Surface Construc-tion Algorithm. In Proceedings of ACM confer-ence on Computer graphics and interactive tech-niques - SIGGRAPH 1987, pages 163–169. ACMPress.

Montani, C., Scateni, R., and Scopigno, R. (1994).A Modified Look-up Table for Implicit Disam-biguation of Marching Cubes. The Visual Com-puter, 10(6):353–355.

Moreland, K. (2011). ParaView User’s Guidev3.12. Kitware Inc., Sandia National Labo-ratory, CSimSoft, http://www.itk.org/Wiki/ParaView/Users_Guide/Table_Of_Contents.

Muigg, P., Hadwiger, M., Doleisch, H., and Hauser,H. (2007). Scalable Hybrid Unstructured andStructured Grid Raycasting. IEEE Transac-tions on Visualization and Computer Graphics,13(6):1592–1599.

Newman, T. S. and Yi, H. (2006). A Survey ofthe Marching Cubes Algorithm. Computers &Graphics, 30(5):854–879.

Nielson, G. M. (2003). On Marching Cubes. IEEETransactions on Visualization and ComputerGraphics, 9(3):283–297.

Page 12: Isosurface Extraction from Hybrid Unstructured Grids Containing

Data Isosurface Extraction #Tri-tetra #Tri-pyram #Tri-prism #Tri-hexavalue time (in s)

Wind-tunnel 13.0464 0.95 29,241 586 0 30,226dataset 12.1772 0.77 25,117 390 0 5,198Missile 1.167 180.26 1,446,544 4,316 352,177 0dataset 0.62 93.6 236,384 4,570 700,971 0

Table 3: Results of our isosurface extraction algorithms from (top) the wind-tunnel dataset and (bottom)the missile dataset. #Tri-tetra represents the number of triangles rendered using look-up table fortetrahedra, #Tri-pyram represents the number of triangles for square pyramids, #Tri-prism representsthe number of triangles for triangular prisms, and #Tri-hexa represents the number of triangle forhexahedra.

Nielson, G. M. and Hamann, B. (1991). TheAsymptotic Decider: Resolving the Ambiguityin Marching Cubes. In Nielson, G. M. andRosenblum, L. J., editors, Proceedings of IEEEVisualization 1991, pages 83–91. IEEE Com-puter Society Press.

Ortega, F. A. (2008). Personal correspondence viae-mail with chief developer of GMV. http://www-xdiv.lanl.gov/XCM/gmv/GMVHome.html.

Ortega, F. A. (2011). GMV 4.5 General MeshViewer User’s Guide. Los Alamos Na-tional Laboratory, CPFD Software, http://www.generalmeshviewer.com/.

Takahashi, T., Mekada, Y., Murase, H., andYonekura, T. (2004). High Quality IsosurfaceGeneration from Volumetric Data and Its Ap-plication to Visualization of Medical CT Data.In Proceedings of the Pattern Recognition, 17thInternational Conference on (ICPR’04) Volume3 - Volume 03, ICPR ’04, pages 734–737, Wash-ington, DC, USA. IEEE Computer Society.

Weber, G. H., Kreylos, O., Ligocki, T. J., Shalf, J.,Hagen, H., Hamann, B., Joy, K. I., and Ma, K.-L. (2001). High-quality Volume Rendering ofAdaptive Mesh Refinement Data. In Proceed-ings of the Vision Modeling and VisualizationConference 2001, VMV ’01, pages 121–128. AkaGmbH.

Weber, G. H., Kreylos, O., Ligocki, T. J., Shalf, J. M.,Hagen, H., Hamann, B., and Joy, K. (2003). Ex-traction of Crack-Free Isosurfaces from AdaptiveMesh Refinement Data, pages 19–40. Springer-Verlag, Heidelberg, Germany.

Williams, P. L., Max, N. L., and Stein, C. M. (1998).A High Accuracy Volume Renderer For Unstruc-tured Data. IEEE Transactions on Visualizationand Computer Graphics, 4:37–54.

APPENDIX

Computation of tangent points in triangu-lar prisms for configurations 5.1 and 5.2:

As explained in Section 4.1.2, the combined

(a) (b)

Figure 11: Isosurface for same value extracted froma grid consisting of 1331 nodes, consisting of 2000triangular prismatic elements in (a), and 5220 tetra-hedral cells in (b). The isosurface in (a) consists of630 triangles and the one in (b) of 1224 triangles.

(a) (b)

Figure 12: Isosurfaces of function ln(c ‖ ~x − ~x0 ‖2),for constants c and ~x0, in hybrid mesh of a wind-tunnel model for values: (a) 13.0464 and (b) 12.1772.The red surface is generated by using look-up tablefor tetrahedra, the blue surface by that for hexahedraand green surface by that for pyramids.

interpolation model of linear (along axis) and lin-ear (in the triangular slice) uses three linearly in-dependent variables, namely, α, β, and u. Sincebarycentric coordinates are used for the triangu-lar bases as well as for intermediate slices, thequadrilateral faces of the prism can be repre-sented as either (α = 1), (β = 1), or (γ = 1),respectively. For e.g., (α = 1) refers to the faceP0100P0101P0011P0010, as shown in Figure 4.

Page 13: Isosurface Extraction from Hybrid Unstructured Grids Containing

(a)

(b)

Figure 13: Isosurface from the missile dataset fordensity in compressible flow for values (a) 1.167 and(b) 0.62. The blue surface is generated using our newlook-up tables for prisms and pyramids, and the redone is generated by that for tetrahedra.

Configuration 5 of a triangular prismatic ele-ment occurs when two of the three quadrilateralfaces are ambiguous and one of them is not. Thetangent at the body saddle point of the isosur-face will be parallel to the non-ambiguous face,for configurations 5.1 and 5.2. Hence, the tan-gent point coincides with the body saddle point.

Here, we describe the computations for thecase where (α = 1) is the non-ambiguous face. Insuch a case, the tangent point or the body saddlepoint occurs at a point where, for an isosurface ofvalue I, the following conditions are satisfied:

1. F = F (x, y, z)− I = f(ατ , βτ , γτ , uτ )− I = 0

2. ∂F∂u = Fu = 0

3. ∂F∂α = Fα = 0

We use the following notations for simplifying al-gebraic expressions:

D(α,0) = F1000 − F0010

D(α,1) = F1001 − F0011

Dα = D(α,0) −D(α,1)

We use similar notations in the case of β forD(β,0), D(β,1), and Dβ .

On substituting for γτ = (1− ατ − βτ ), in Equa-tion 2, the coefficient of α reduces to 0. Hence,on applying the condition F = 0, one obtains:

βτ =(Dα · I + F1001 · F0010 − F1000 · F0011)

(D(α,0) ·D(β,1) −D(α,1) ·D(β,0))(3)

Differentiating F with respect to u,

Fu =− (F1000ατ + F0100βτ + F0010(1− ατ − βτ ))

+ (F1001ατ + F0101βτ + F0011(1− ατ − βτ ))

(4)

After applying the condition Fu = 0 on Equa-tion 4 and simplifying, one obtains:

Dαατ +Dββτ = F0011 − F0010 (5)

Substituting for βτ from Equation 3 in Equa-tion 5, one obtains:

ατ =(F0011 − F0010)

− Dβ

Dα· (Dα · I + F1001 · F0010 − F1000 · F0011)

(D(α,0) ·D(β,1) −D(α,1) ·D(β,0))

(6)

Differentiating F with respect to α,

Fα = (1− uτ )(F1000 − F0010) + uτ (F1001 − F0011)

= (1− uτ )D(α,0) + uτD(α,1)

(7)

After applying the condition Fα = 0 on Equa-tion 7 and simplifying, one obtains:

1− uτuτ

=D(α,1)

D(α,0)

uτ =D(α,0)

(8)

Using the interpolation model from Equation 2,the values for parameters from Equations 3, 6,and 8, and substituting γτ = (1 − ατ − βτ ), thetangent point is computed as:

Pτ (x,y, z) = p(ατ , βτ , γτ , uτ )

=(1− uτ )(ατP1000 + βτP0100 + γτP0010)

+ uτ (ατP1001 + βτP0101 + γτP0011)

(9)

Similar computations can be implemented forconfigurations 5.1 and 5.2 of the triangular pris-matic element, in the cases of (β = 1) and (γ = 1)being the non-ambiguous face.