Proceedings of the 19th International Meshing Roundtable
Suzanne Shontz (Ed.)
Proceedings of the 19th International Meshing Roundtable
ABC
Suzanne Shontz Pennsylvania State University 343J IST Building University Park, PA 16802 Tel.: 814-865-0193 E-mail:
[email protected]
ISBN 978-3-642-15413-3
e-ISBN 978-3-642-15414-0
DOI 10.1007/978-3-642-15414-0 Library of Congress Control Number: 2010935732 c 2010 Springer-Verlag Berlin Heidelberg This work is subject to copyright. All rights are reserved, whether the whole or part of the material is concerned, specifically the rights of translation, reprinting, reuse of illustrations, recitation, broadcasting, reproduction on microfilm or in any other way, and storage in data banks. Duplication of this publication or parts thereof is permitted only under the provisions of the German Copyright Law of September 9, 1965, in its current version, and permission for use must always be obtained from Springer. Violations are liable to prosecution under the German Copyright Law. The use of general descriptive names, registered names, trademarks, etc. in this publication does not imply, even in the absence of a specific statement, that such names are exempt from the relevant protective laws and regulations and therefore free for general use. Typesetting: Data supplied by the authors Production & Cover Design: Scientific Publishing Services Pvt. Ltd., Chennai, India Printed on acid-free paper 987654321 springer.com
This page intentionally left blank
Preface
The papers in this volume were selected for presentation at the 19th International Meshing Roundtable (IMR), held October 3–6, 2010 in Chattanooga, Tennessee, USA. The conference was started by Sandia National Laboratories in 1992 as a small meeting of organizations striving to establish a common focus for research and development in the field of mesh generation. Now after 19 consecutive years, the International Meshing Roundtable has become recognized as an international focal point annually attended by researchers and developers from dozens of countries around the world. The 19th International Meshing Roundtable consists of technical presentations from contributed papers, research notes, keynote and invited talks, short course presentations, and a poster session and competition. The Program Committee would like to express its appreciation to all who participate to make the IMR a successful and enriching experience. The papers in these proceedings were selected by the Program Committee from among numerous submissions. Based on input from peer reviews, the committee selected these papers for their perceived quality, originality, and appropriateness to the theme of the International Meshing Roundtable. We would like to thank all who submitted papers. We would also like to thank the colleagues who provided reviews of the submitted papers. The names of the reviewers are acknowledged in the following pages. We extend special thanks to Jacqueline Hunter for her time and effort to make the 19th IMR another outstanding conference.
August 2010
19th IMR Program Committee
This page intentionally left blank
Contents
Session 1A, Surface Meshing Hexagon-Based All-Quadrilateral Mesh Generation with Guaranteed Angle Bounds . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Xinghua Liang, Yongjie Zhang
1
Q-TRAN: A New Approach to Transform Triangular Meshes into Quadrilateral Meshes Locally . . . . . . . . . . . . . . . . . . . Mohamed S. Ebeida, Kaan Karamete, Eric Mestreau, Saikat Dey
23
Mesh Construction with Prescribed Properties Near Boundary . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Boris Azarenok
35
A Transfinite Meshing Approach for Body-In-White Analyses . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Kirk Beatty, Nilanjan Mukherjee
49
Session 2A, Optimization Introducing the Target-Matrix Paradigm for Mesh Optimization via Node-Movement . . . . . . . . . . . . . . . . . . . . . . . . . . . Patrick Knupp An Analytical Framework for Quadrilateral Surface Mesh Improvement with an Underlying Triangulated Surface Definition . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Kiran Shivanna, Nicole Grosland, Vincent Magnotta
67
85
Efficient Solution of Elliptic Partial Differential Equations via Effective Combination of Mesh Quality Metrics, Preconditioners, and Sparse Linear Solvers . . . . . . . . . . . . . . . . . . 103 Jibum Kim, Shankar Prasad Sastry, Suzanne M. Shontz
VIII
Contents
Virtual Control Volumes for Two-Dimensional Unstructured Elliptic Smoothing . . . . . . . . . . . . . . . . . . . . . . . . . . . . 121 Steve L. Karman Jr.
Session 2B, Surface Reconstruction and Repair Reconstructing High-Order Surfaces for Meshing . . . . . . . . . . . . 143 Xiangmin Jiao, Duo Wang Simple Method for Constructing NURBS Surfaces from Unorganized Points . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 161 Nallig Leal, Esmeide Leal, John William Branch Sealing Faceted Surfaces to Achieve Watertight CAD Models . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 177 Brandon M. Smith, Timothy J. Tautges, Paul P.H. Wilson A Metric for Automatic Hole Characterization . . . . . . . . . . . . . . 195 German Sanchez T., John W. Branch, Pedro Atencio
Session 3A, Hex Meshing Receding Front Method: A New Approach Applied to Generate Hexahedral Meshes of Outer Domains . . . . . . . . . . . . . 209 Xevi Roca, Eloi Ruiz-Giron´es, Josep Sarrate EBMesh: An Embedded Boundary Meshing Tool . . . . . . . . . . . . 227 Hong-Jun Kim, Timothy J. Tautges Sharp Feature Preservation in Octree-Based Hexahedral Mesh Generation for CAD Assembly Models . . . . . . . . . . . . . . . . 243 Jin Qian, Yongjie Zhang Pen-Based User Interface for Geometric Decomposition for Hexahedral Mesh Generation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 263 Jean Hsiang-Chun Lu, Inho Song, William Roshan Quadros, Kenji Shimada
Session 4A, Research Notes Session 4B, Research Notes Session 5A, Professional Development Session 5B, Research Notes
Contents
IX
Session 6A, Adaptive Particle Systems for Adaptive, Isotropic Meshing of CAD Models . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 279 Jonathan R. Bronson, Joshua A. Levine, Ross T. Whitaker A Study on Using Hierarchical Basis Error Estimates in Anisotropic Mesh Adaptation for the Finite Element Method . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 297 Lennard Kamenski Bisection-Based Triangulations of Nested Hypercubic Meshes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 315 Kenneth Weiss, Leila De Floriani Optimizing Voronoi Diagrams for Polygonal Finite Element Computations . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 335 Daniel Sieger, Pierre Alliez, Mario Botsch
Session 6B, Applications Creating Geometry and Mesh Models for Nuclear Reactor Core Geometries Using a Lattice Hierarchy-Based Approach . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 351 Timothy J. Tautges, Rajeev Jain Multi-tissue Mesh Generation for Brain Images . . . . . . . . . . . . . . 367 Yixun Liu, Panagiotis Foteinos, Andrey Chernikov, Nikos Chrisochoides A Toolkit for Parallel Overset Grid Assembly Targeting Large-Scale Moving Body Aerodynamic Simulations . . . . . . . . . 385 George Zagaris, Michael T. Campbell, Daniel J. Bodony, Eric Shaffer, Mark D. Brandyberry A Dimension-Independent Data Structure for Simplicial Complexes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 403 Leila De Floriani, Annie Hui, Daniele Panozzo, David Canino Index of Authors and Co-authors . . . . . . . . . . . . . . . . . . . . . . . . . . . . 421 Paper Reviewers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 423 Committee Members . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 425
Hexagon-Based All-Quadrilateral Mesh Generation with Guaranteed Angle Bounds Xinghua Liang and Yongjie Zhang Department of Mechanical Engineering, Carnegie Mellon University, Pittsburgh, PA 15213, USA Tel.: (412) 268-5332; Fax: (412) 268-3348
[email protected]
Summary. In this paper, we present a novel hexagon-based mesh generation method which creates all-quadrilateral (all-quad) meshes with guaranteed angle bounds and feature preservation for arbitrary planar domains. Given any planar curves, an adaptive hexagon-tree structure is constructed by using the curvature of the boundaries and narrow regions. Then a buffer zone and a hexagonal core mesh are created by removing elements outside or around the boundary. To guarantee the mesh quality, boundary edges of the core mesh are adjusted to improve their formed angles facing the boundary, and two layers of quad elements are inserted in the buffer zone. For any curve with sharp features, a corresponding smooth curve is firstly constructed and meshed, and then another layer of elements is inserted to match the smooth curve with the original one. It is proved that for any planar smooth curve all the element angles are within [60◦ -ε, 120◦ +ε] (ε ≤ 5◦ ). We also prove that the scaled Jacobians defined by two edge vectors are in the range of [sin(60◦ -ε), sin90◦ ], or [0.82, 1.0]. Furthermore, the same angle range can be guaranteed for curves with sharp features, with the exception of small angles in the input curve. In addition, all the elements in the final mesh are grouped into five types, and most elements only need a few flops to construct the stiffness matrix for finite element analysis. This will significantly reduce the computational time and the required memory during the stiffness matrix construction. We have applied our algorithm to a set of complicated geometries, including the Lake Superior map, and a three-component air foil with sharp features. Keywords: Quadrilateral mesh, guaranteed angle bound, hexagon-tree, sharp feature, narrow region.
Corresponding author.
2
X. Liang and Y. Zhang
1 Introduction A fully automatic and robust mesh generator is always desired by the community of finite element analysis and computer graphics. Although provably good-quality triangular mesh generation methods have been well developed for planar and curved surfaces, many analysts prefer to use quadrilateral (quad) elements because of their superior performance in various applications. Only a few algorithms exist in literature addressing provable angle bounds for all-quad mesh generation [4, 1], but none of them guarantee a good angle range with both lower and upper bounds. As early as in 1991, Bishop [5] had theoretically proved that any planar n-gon can be meshed by O(n) quads with all the angles bounded between 45◦ -ε and 135◦+ε, where ε is a small perturbation. However, there was no algorithm that can generate such guaranteed-quality all-quad meshes until in 2009 a quadtree-based method [11] was firstly developed to construct all-quad meshes for any given point clouds or planar smooth curves, with a guaranteed angle range of [45◦ ε, 135◦ +ε] (ε ≤ 5◦ ). Inspired by [17, 18], we find that an adaptive hexagonal subdivision scheme can also be used for all-quad mesh generation, with the advantages of not creating any hanging nodes and providing better angle bounds as compared to using the quadtree. In this paper, we improve the algorithm described in [11] by using the hexagon-tree structure, which results in a better guaranteed angle range, [60◦ -ε, 120◦ +ε] (ε ≤ 5◦ ), for any complicated smooth curves (e.g., the Lake Superior map in Fig. 1). Moreover, this angle range can also be guaranteed even for geometries with sharp features, except small angles in the input geometry.
Fig. 1. The Lake Superior map. (a) An all-quad mesh with all angles ∈ [57◦ , 122◦ ]; and (b-c) Zoom-in pictures of (a).
Hexagon-Based All-Quad Mesh Generation
3
For any planar smooth curves, six steps are developed to construct all-quad meshes with guaranteed angle bounds. Firstly, each curve is decomposed into a set of line segments based on its curvature. Secondly, a strongly balanced adaptive hexagon-tree structure is constructed without creating any hanging nodes. The element size is controlled by the boundary curvature and narrow regions. Thirdly, elements outside and around the boundary are removed to create a hexagonal core mesh and a buffer zone. Next, a group of templates are designed to adjust the boundary edges and improve their formed angles facing the boundary in the core mesh. Then angular bisectors are used to construct the first buffer layer. Finally, the points generated in the first layer are projected to the boundary and form the second buffer layer. It is proved that for any planar smooth curves, all the angles in the constructed mesh are within [60◦ -ε, 120◦+ε] (ε ≤ 5◦ ), and all the scaled Jacobians defined by two edge vectors are within [sin(60◦ -ε), sin90◦], or [0.82, 1.0]. If a given curve contains sharp features, the corresponding smooth curve is firstly constructed and guaranteed-quality quads are created through the above six steps. Then four cases are introduced to match the smooth curve to the original one while preserving the angle range, with the exception of small angles in the input curve. We have tested our algorithm with several complicated geometries, including the Lake Superior map, and a three-component air foil with sharp features. Our algorithm efficiently deals with curves in large-scale size, and generates meshes with guaranteed angle bounds while minimizing the number of elements. Additionally, we categorize all the quad elements in the generated meshes into five element types. In finite element analysis, the stiffness matrices of element types 1-4 can be precomputed which can significantly reduce the computational time, save memory, and provide more precise results. The remainder of this paper is organized as follows: Section 2 reviews the related work. Section 3 explains the detailed algorithm for guaranteed-quality mesh generation of smooth curves. Section 4 talks about sharp feature and boundary layer. Section 5 shows some results. Section 6 introduces five element types and explains the advantages of our algorithm in terms of stiffness matrix construction. Finally, Section 7 presents our conclusion and discussion.
2 Previous Work Quadrilateral Mesh Generation: For unstructured quad mesh generation [13], there are three direct methods: advancing front, domain decomposition, and grid-based. For practical purposes, the advancing front method generally gives high quality and reliable mesh generation. In [25], two triangles are firstly created using the traditional advancing front method and then combined to a single quad. A paving algorithm places a complete row of quads next to the front toward the interior [6]. The robustness of the paving algorithm is enhanced in [20] through creating individual quads rather than a complete row. However, the closure algorithms for the interior are still
4
X. Liang and Y. Zhang
unstable. Heuristic decisions are made which usually generate elements with poor quality. Domain decomposition can be achieved by various techniques. Tam and Armstrong [19] introduced medial axis decomposition. Quadros et al. [15] introduced an algorithm that couples medial axis decomposition with an advancing front method. In general, these methods produce high quality meshes but they are not robust and may require a great deal of user interaction especially when the domain has non-manifold boundaries. For grid-based methods, Baehmann et al. [2] modified a balanced quadtree to generate a quad mesh for an arbitrary domain. Schneiders et al. [16] used an isomorphism technique to conform an adaptive octree structure to the object boundaries. Zhang et al. developed an octree-based isocontouring method to generate adaptive quadrilateral and hexahedral meshes for manifold and non-manifold domains [14, 21, 22, 24]. Grid-based algorithms are robust but often generate poor quality elements at the boundary. Quality Improvement: In finite element analysis, elements with small angles and angles close to 180◦ inside the mesh usually lead to ill-conditioned linear systems. Therefore, a post-procedure is crucial to improving the overall quality of the elements. Smoothing and clean-up methods are the two main categories of mesh improvement. Smoothing methods relocate vertices without changing the connectivity. Although simple and easy to implement, Laplacian smoothing is heuristic and unstable and sometimes inverts or degrades the local elements. Optimization-based smoothing methods were then proposed [7, 9], which relocate each node to the optimum location based on the local gradient of the surrounding element quality. Optimization-based methods provide much better mesh quality but they need excessive amounts of computations. For this reason such methods are usually combined with a Laplacian smoothing technique [8]. Surface feature preservation represents another challenging problem. Methods based on local curvature [3] and volume preserving geometric flows [23] were developed to identify and preserve the main surface features. Clean-up methods for quad meshes [10] were utilized to improve the node valence and topology. Pillowing [12] was used to ensure that any two adjacent quads share at most one edge. However, none of the above meshing and quality improvement techniques can guarantee any bounds for the element angles. Last year, we developed a quadtree-based method which creates all-quad meshes for any planar smooth curves with a guaranteed angle range of [45◦ -ε, 135◦ +ε] (ε ≤ 5◦ ). In this paper, we will present a novel hexagon-based approach that constructs allquad meshes with a better guaranteed angle range, [60◦ -ε, 120◦ +ε].
3 Guaranteed-Quality Meshing of Smooth Curves Given a planar domain Ω and closed smooth curves C represented by cubic splines, we aim to generate an all-quad mesh for the regions enclosed by C with a good guaranteed angle range. Six steps are designed as shown in
Hexagon-Based All-Quad Mesh Generation
5
Fig. 2, including (1) curve decomposition, (2) adaptive hexagon-tree construction, (3) buffer zone clearance, (4) template implementation, (5) first buffer layer construction, and (6) second buffer layer construction. 3.1
Curve Decomposition
Given any closed smooth curves C represented by cubic splines, we firstly decompose C into a set of piecewise-linear line segments, considering the curve local curvature. Two requirements need to be satisfied: the angle ε formed by two neighboring lines is ≤ 5◦ ; and, the approximation error δ of each line segment is less than a given threshold. As a result, we obtain non-uniform sampling points X, see Fig. 2(a).
(a)
(d)
(b)
(e)
(c)
(f)
Fig. 2. Flow chart of all-quad mesh generation. (a) Curve decomposition; (b) Adaptive hexagon-tree construction; (c) Buffer zone clearance; (d) Template implementation; (e-f) First and second buffer layer construction.
3.2
Adaptive Hexagon-Tree Construction
Instead of using the quadtree, here we construct an adaptive hexagon-tree because it does not induce any hanging nodes and provides a better angle range. The hexagon-tree construction is based on the sampling points X obtained from curve decomposition, see Fig. 2(b). Firstly, we define the size function as si = min(dij ), where dij is the distance between two points i and j (i, j ∈ X and i = j). Then a large hexagon Ω is generated to enclose all the points X, as shown in Fig. 3(a). Ω corresponds to the root of the hexagontree, marked as Level 0. Then each cell c in the hexagon-tree is recursively
6
X. Liang and Y. Zhang
refined using two refinement templates in Fig. 3(b-c), unless the cell size is smaller than the size function of any point inside this cell. After that, each pair of semi-hexagons is grouped into one hexagon if possible, see Fig. 3(d). For each refinement or grouping, we update the corresponding cell levels. Similar to [18], hexagons are always marked in even levels and semi-hexagons are always marked in odd levels. We also apply the strongly balanced criterion to the hexagon-tree, which means the level difference around each cell c is at most one. For those cells not satisfying this criterion, we split and group them as shown in Fig. 3(e). As a final step, we split each hexagon to two semi-hexagons to obtain all-quad meshes. Local mesh refinement and mesh coarsening are supported in our algorithm by using refinement (Fig. 3(b-c)) and grouping (Fig. 3(d)). Narrow region is another important feature of the input geometry C. A region is defined as narrow if it contains no more than two elements in one direction after the adaptive hexagon-tree construction. The detected narrow region will be refined until all directions contain more than two elements, which guarantees the correct topology during mesh generation. 3.3
Buffer Zone Clearance
In order to conform the hexagon-tree mesh to the boundary, we delete elements outside or near the boundary curves so that later we have enough spaces to generate quads with provable good angles. We call such a procedure buffer zone clearance. Similar definitions in [11] are utilized here, see Fig. 4(a). A buffer zone is a zonal area that serves the purpose of keeping the quad mesh distant from boundaries. A boundary edge is an edge contained in only one element of the hexagonal core mesh, e.g., AB, BC and CD. One boundary edge consists of two boundary points, two neighboring boundary
(a)
(b)
(d)
(c)
(e)
Fig. 3. Operations used in adaptive hexagon-tree construction. (a) Hexagonal bounding box; (b-c) Two refinement templates; (d) Grouping; and (e) Strongly balanced tree construction. The numbers represent the corresponding cell levels. Hexagons are in even levels, and semi-hexagons are in odd levels.
Hexagon-Based All-Quad Mesh Generation
(a)
7
(b)
Fig. 4. Definitions and Criterion 3 in Buffer Zone Clearance. (a) The red curve is the boundary. A, B, C and D are boundary points. AB, BC and CD are boundary edges. α and β are boundary angles. ψ is a boundary edge angle; and (b) An example of applying Criterion 3.
edges form a boundary angle, and a boundary edge angle is the angle formed from the boundary edge to the boundary which cannot cross other edges. E.g., α and β are two boundary angles, and ψ is a boundary edge angle. Three criteria are applied to adaptive hexagon-tree construction, and then a hexagonal core mesh and a buffer zone are created, see Fig. 2(c). The buffer zone is filled with quads with all angles within [60◦ -ε, 120◦ +ε]. These three criteria are: 1) Any elements outside the regions to be meshed are deleted; 2) Any elements intersecting with the given curves C are deleted; 3) If the shortest distance from any vertex to the boundary is less than a pre-defined threshold εs , all elements sharing this vertex are deleted. Here we choose εs = 12 max(si ), where si is the size of the ith element sharing this vertex. Fig. 4(b) shows an example of applying Criterion 3. 3.4
Template Implementation
After buffer zone clearance, the boundary angles of the core mesh are among {60◦ , 120◦ , 180◦ , 240◦ , 300◦}, and the boundary edge angles are within [0◦ , 180◦]. In order to generate good-quality elements around the boundary, we design the following three operations to improve the boundary angles and boundary edge angles. Boundary angle improvement: For any boundary angle 60◦ , we delete the larger element sharing this boundary angle. For any boundary angle 300◦ , we delete the element containing this boundary angle. Finally, for any two neighboring boundary angles 240◦ -240◦, we delete the element containing them. Now the boundary angles are among {120◦, 180◦ , 240◦}. Self-intersection avoidance: In the following first buffer layer construction, we will use angular bisectors of the boundary angles to construct new elements. To avoid element self-intersection, we check all the possible combinations among the improved boundary angles {120◦ , 180◦ , 240◦ }. For a pair of boundary angles, there are 32 =9 combinations in total. However, 120◦ 240◦ , 180◦-180◦ and 180◦ -240◦ never cause self-intersections as shown in
8
X. Liang and Y. Zhang
Fig 5, and 240◦ -240◦ has been removed in Operation 1 (boundary angle improvement). Considering symmetry and complementary of the boundary angles, only 120◦ -120◦ and 120◦ -180◦ are left. For each of them, we divide it into two groups since we will implement different templates on them. Therefore, there are a total of four combinations which may introduce self-intersections: 120◦ -120◦-120◦, 120◦ -120◦-(180◦ or 240◦ ), 120◦ -180◦-120◦, and 120◦ -180◦(180◦ or 240◦ ). The developed templates for these four combinations are shown in Fig. 6. In Fig. 6(d), if |CC | > 2|BC|, we add a parallelogram ABCD to avoid self-intersections. From Fig. 6, it is obvious to observe that all the newly generated edges are parallel to the existing ones. Therefore, the boundary angles and boundary edge angles are still among {120◦, 180◦ , 240◦} and [0◦ , 180◦], respectively. Note that the boundary angle pair 120◦-120◦ is eliminated, see Fig. 6(a-b).
(a) 120◦ -240◦
(b) 180◦ -180◦
(c) 180◦ -240◦
Fig. 5. Three combinations that never cause self-intersection in our algorithm. Dash lines are angular bisectors.
(a) 120◦ -120◦ -120◦
(b) 120◦ -120◦ -(180◦ or 240◦ )
(c) 120◦ -180◦ -120◦
(d) 120◦ -180◦ -(180◦ or 240◦ )
Fig. 6. Four templates to avoid self-intersections
Hexagon-Based All-Quad Mesh Generation
(a) 120◦
9
(b) 240◦
Fig. 7. Boundary edge angle improvement
Boundary edge angle improvement: To improve the boundary edge angles, we first check two boundary angles 120◦ and 240◦ . For each boundary angle 120◦ as shown in Fig. 7(a), if |AA | > |BB | or |CC | > |BB |, we add a parallelogram ABCD. Similarly, for each boundary angle 240◦ as shown in Fig. 7(b), if |AA | < |BB | or |CC | < |BB |, we add a parallelogram BCDE. We keep doing this until these two cases vanish at the boundary of the core mesh. After that, Operation 2 (self-intersection avoidance) may be applied again to remove self-intersections. Since the newly generated edges are parallel to the existing ones, the boundary angle at Point C is also 120◦ , see Fig. 7(a). Then we have |CC | ≥ |DD | & |CC | ≥ |EE |. The worst boundary edge angle happens when |CC | = |DD | or |CC | = |EE |, which results in a 60◦ angle for the boundary edge CD or CE. Similarly for the boundary angle 240◦ in Fig. 7(b), the worst boundary edge angle is also 60◦ . The boundary angle 180◦ performs as a straight line, which finally connects to either the boundary angle 120◦ or the boundary angle 240◦ , so its worst boundary edge angle is the same, 60◦ . Therefore after template implementation, the boundary edge angle range is improved from [0◦ , 180◦ ] to [0◦ , 60◦ ]. Remark: In summary, all the element angles in the hexagonal core mesh are either 60◦ or 120◦. After template implementation, all the boundary angles are among {120◦, 180◦ , 240◦ }, and all the boundary edge angles are within [0◦ , 60◦ ]. 3.5
First Buffer Layer Construction
To fill the buffer zone with guaranteed-quality quads, we firstly generate the first buffer layer. For each boundary point in the core mesh, we use angular bisectors to calculate a corresponding point inside the buffer zone called the first buffer point. Then, each pair of neighboring boundary points and their first buffer points construct a quad. All these new quads form the first buffer layer as shown in Fig. 2(e). Here is the algorithm to calculate the first buffer points. As shown in Fig. 8(a), the boundary point B is shared by two boundary edges AB and BC with corresponding boundary edge angles. We choose the larger boundary edge angle ψ, and draw its angular bisector. We also draw an angular
10
X. Liang and Y. Zhang
bisector of the boundary angle at B. These two angular bisectors intersect at B which is the first buffer point of B. If the larger boundary edge angle ψ is small (e.g. ≤ 10◦ ), then we just project point B to the boundary, and choose the middle as B . Using all the boundary points and their first buffer points, we form the first buffer layer inside the buffer zone. Lemma 1: All the element angles in the first buffer layer are within [60◦ ε, 120◦+ε], where ε ≤ 5◦ . After the first buffer layer construction, the boundary edge angle range becomes [0◦ , 30◦ ]. Proof: To simplify the proof, we first assume that the boundary curve around each boundary edge is a straight line. In Fig. 8(a), A and B are the first buffer points corresponding to the boundary points A and B, the boundary angles at A and B are 2α and 2β, and the boundary edge angle of AB is ψ. Suppose A and B are on the angular bisector of ψ. After template implementation, the boundary edge angle ψ ∈ [0◦ , 60◦ ], and the boundary angle combinations of 120◦ -120◦ and 240◦-240◦ are eliminated. Therefore suppose α ≤ β, we have 2α ∈ {120◦ , 180◦} or α ∈ [60◦ , 90◦ ], 2β ∈ {180◦ , 240◦ } or β ∈ [90◦ , 120◦ ], and ϕ = ψ/2 ∈ [0◦ , 30◦ ]. Then, we can get θ = 180◦ − α − ϕ ∈ [60◦ , 120◦ ], and γ = ϕ + (180◦ − β) ∈ [60◦ , 120◦ ]. In summary, all the angles of the quad ABB A are within [60◦ , 120◦ ]. However, considering that the boundary curve has a small perturbation ε ≤ 5◦ , we relax the angle range to [60◦ -ε, 120◦+ε]. Finally, after the first buffer layer construction, the new boundary edge angle range becomes half of the original one, [0◦ , 30◦ ]. 3.6
Second Buffer Layer Construction
The second buffer layer construction is straightforward. As shown in Fig. 8(b), we project all the second buffer points to the boundary and obtain
(a)
(b)
Fig. 8. Two buffer layers. (a) First buffer layer; and (b) Second buffer layer
Hexagon-Based All-Quad Mesh Generation
11
the corresponding second buffer points. Then the second buffer layer is generated, see Fig. 2(f). We use Lemma 2 to prove its angle bounds. Lemma 2: All the element angles in the second buffer layer are within [60◦ ε, 120◦+ε], where ε ≤ 5◦ . Proof: We still assume that the boundary curve is a straight line around each boundary edge. In Fig. 8(b), A and B are the first buffer points, A and B are the second buffer points. Obviously, γ = θ = 90◦ . From Lemma 1, we have the boundary edge angle ψ ∈ [0◦ , 30◦ ]. Therefore, α = 90◦ − ψ ∈ [60◦ , 90◦ ] and β = 90◦ + ψ ∈ [90◦ , 120◦ ]. Considering the boundary curve may have a small perturbation ≤ 5◦ , the angle range is relaxed to [60◦ -ε, 120◦ +ε]. Remark: After applying the designed six steps in Fig. 2, the element angles in the core mesh, the first and the second buffer layers are all within [60◦ ε, 120◦+ε] (ε ≤ 5◦ ). As proven in [11], the scaled Jacobian defined by two edge vectors [21, 23] is a sine function of the element angle. For example, if we denote the scaled Jacobian as J, the two normalized edge vectors as e1 and e2 , and the angle formed by them as θ, then J = |e1 × e2 | = |e1 ||e2 |sinθ = sinθ because |e1 | = |e2 | = 1. Therefore our algorithm also guarantees that all the scaled Jacobians in the constructed mesh are in the range of [sin(60◦ ε), sin90◦] (ε ≤ 5◦ ), or [0.82, 1.0].
4 Sharp Feature and Boundary Layer If the input geometry contains sharp features, we need an extra buffer layer, called sharp feature layer, to preserve the sharp features and also guarantee the angle bounds. For each input curve C, we first generate a smooth curve C inside the region to be meshed with a distance d. To achieve this, we consider three cases as shown in Fig. 9: (1) smooth parts of the curve; (2) sharp feature with an angle ∈ (0◦ , 180◦ ]; and (3) sharp feature with an angle ∈ (180◦ , 360◦ ). For the smooth part, we simply move the curve inside with a distance d. Then, for each sharp angle ∈ (0◦ , 180◦), as shown in Fig. 9(b), we draw the angular bisector of this angle, and choose a point O such that |OC| = (r + d)/cos(ψ/2). Taking O as the circle center, we obtain an arc with the radius r between the two projection lines OA and OE. Here the radius r can be arbitrary. For each sharp angle ∈ (180◦ , 360◦ ), as shown in Fig. 9(c), we also draw the angular bisector of this angle, but choose a point O such that |OC| = (r − d)/cos(ψ/2). Taking O as the circle center, we again obtain an arc with the radius r between the two projection lines OA and OE . However, to guarantee the arc is inside the region to be meshed, we require |OC| < r, or r < d/(1 − cos(ψ/2)).
12
X. Liang and Y. Zhang
(a)
(b)
(c)
Fig. 9. Smooth curve generation from the curves with sharp features. (a) Smooth parts; (b) Sharp angles ∈ (0◦ , 180◦ ); and (c) Sharp angles ∈ (180◦ , 360◦ ).
As soon as the smooth curve C is constructed, it can be meshed using the six steps in Section 3. Now we need to connect the resulting mesh to the original curve C. For each smooth part, as shown in Fig. 9(a), we directly project all the second buffer points to the curve C, and construct corresponding quads. For each part with a sharp angle, as shown in Fig. 9(b-c), we draw lines from the center O to each second buffer point. These lines intersect with the curve C at a set of boundary points. Then these boundary points and the second buffer points are used to form quads. By doing that, the curve C is completely meshed with guaranteed-quality quads, except elements near the sharp features. Then the final step is to improve these elements. Noticing that we enforce a second buffer point C to locate on the angular bisector of the sharp angle. We also have the following Lemma 3. Lemma 3: For smooth parts and sharp angles within [120◦, 180◦ ) or (180◦ , 240◦ ], the constructed quads in the sharp feature region are always ∈ [60◦ , 120◦]. Proof: For the smooth parts, all the element angles are obviously close to 90◦ , as shown in Fig. 9(a). For any sharp angle ∈ [120◦ , 180◦), quads containing the sharp point have the worst angle range, see Fig. 9(b). Thus we only need to prove the angle range of BCC B is good. Since CC is the angular bisector, α ∈ [60◦ , 90◦ ). B and C are on the arc, so β = γ = 90◦ + ϕ/2. Then θ = 180◦ − ϕ − α ∈ (90◦ − ϕ, 120◦ − ϕ]. From Section 3.1, ϕ = ε ≤ 5◦ . Therefore, all the four element angles of BCC B are within [60◦ , 120◦ ). Similarly, for any sharp angle ∈ (180◦ , 240◦], as shown in Fig. 9(c), we only need to prove the angle range of BCC B is good. β ∈ (90◦ , 120◦ ] because CC is the angular bisector. Since B and C are on the arc, α = θ = 90◦ − ϕ/2. Then γ = 180◦ − β + ϕ ∈ [60◦ + ϕ, 90◦ + ϕ], where ϕ = ε ≤ 5◦ . Therefore, all the four element angles of BCC B are within (60◦ , 120◦ ].
Hexagon-Based All-Quad Mesh Generation
13
For sharp angles within (0◦ , 120◦ ) or (240◦ , 360◦ ), the angle bounds of the constructed quads may not be good. Here we explain how to improve the angle bounds for these two cases. When the sharp angle α ∈ (0◦ , 120◦) as shown in Fig. 10(a), for each boundary point X (X = {A, B, C, G, H, I}), if ∠X XE > 120◦, we rotate the edge X X such that ∠X XE = 120◦ . Finally, we delete the edge E E and add two other edges E D and E F such that β = θ = 120◦ , γ = 120◦ − α when α ∈ (0◦ , 60◦ ], or γ = α, β = θ = 180◦ − α when α ∈ (60◦ , 120◦ ). In this way, we guarantee all the angles ∈ [60◦ , 120◦ ] except the sharp angle α in the input curve. With the sharp angle ∈ (240◦ , 360◦ ), we use a different method as shown in Fig. 10(b). Here the green region and the blue region are symmetric w.r.t. the angular bisector AA . The green region is generated by connecting O with each second buffer point, and the blue region is improved by inserting another layer of elements locally. In the blue region, Point B is removed, and two new points B and C are added such that β = β = β = 120◦ and θ = 60◦ . Before we reach a rectangle element, we continue to add new points D and E using the angular bisectors of ∠C C C and ∠D D D. If η or ζ < 60◦ , we adjust D or E to make it equal to 60◦ . Then the edge F F is rotated to have ∠F F E = 120◦ . Finally, two new points F and G are added to split the original quad EE F F to three new quads, where F F is an angular bisector, E F //EF and F G //F F . Then we use Lemma 4 to prove the angle bounds of quad elements in these two cases.
(a)
(b)
Fig. 10. Quality improvement of elements around sharp features. (a) Sharp angle ∈ (0◦ , 120◦ ); and (b) Sharp angle ∈ (240◦ , 360◦ ).
14
X. Liang and Y. Zhang
Lemma 4: For sharp angles within (0◦ , 120◦ ) or (240◦ , 360◦), all the element angles in the sharp feature layer are within [60◦ -ε, 120◦+ε] (ε ≤ 5◦ ), except small sharp angles in the given curve. Proof: For any sharp angle α ∈ (0◦ , 120◦ ) as shown in Fig. 10(a), it is obvious that all the elements, except the element containing the sharp corner E, have the angle range ∈ [60◦ , 120◦ ] because we enforced the maximum element angle to be ≤ 120◦ . The only exception is the sharp angle when it is less than 60◦ . Since this bad angle is required by the input geometry, we just keep it. For any sharp angle ∈ (240◦ , 360◦ ) as shown in Fig. 10(b), we firstly check the elements around the sharp corner A. We can easily obtain β = β = β = 120◦, γ = θ = 90◦ − ϕ/2 and θ = α = 90◦ − ψ/2. Then α = 360◦ − γ − θ − β = 60◦ + ϕ, and γ = 360◦ − θ − α − β = 60◦ + ψ. Moreover, α = ∠A AC − α = (120◦ − α , 180◦ − α ) ∈ (60◦ − ϕ, 120◦ − ϕ), γ = 360◦ − α − β − θ ∈ (60◦ + ψ, 120◦ + ψ], and θ = 60◦ . From Section 3.1, ϕ = ψ = ε ≤ 5◦ ; therefore, the angle range of the three elements sharing Point B is [60◦ − ε, 120◦ + ε]. It is obvious that the angle range of the other elements is [60◦ , 120◦ ]. Therefore, all the angles generated in this case are within [60◦ -ε, 120◦ +ε]. Remark: In summary, all the element angles in the sharp feature layer are within [60◦ -ε, 120◦+ε], where ε ≤ 5◦ , except small sharp angles in the given curve. As an example, we use the Delta Wing to test our algorithm for sharp feature preservation. The meshing results are shown in Figs. 11 & 12. All the element angles are of provable good quality. The lower angle bound in Fig. 11 is required by the small sharp angle (31.75◦ ) in the given curve. Additionally, multiple boundary layers are required in Computer Fluid Dynamics (CFD) simulations. Our algorithm can conveniently construct boundary layers by splitting the elements in the second buffer layer or the sharp feature layer, see Fig. 12. Only three templates are needed, as shown in Fig. 12(e-g). The black points are boundary points, the red points are new points, and the blue quads are elements constructed for the boundary layer. Obviously, all the angles are preserved in Fig. 12(f-g), but an angle is split in Fig. 12(e), resulting in a reduction of the angle range to [30◦ − ε, 150◦ + ε]. Fig. 12(e) is needed only if there are sharp features > 240◦ , and the angle range will be reduced only once no matter how many boundary layers are constructed.
Hexagon-Based All-Quad Mesh Generation
15
Fig. 11. An interior mesh of Delta wing with sharp features. (a) All-quad mesh with all angles ∈ [31.75◦ , 120◦ ]. The lower bound corresponds to the small angle in the geometry; and (b-d) Zoom-in pictures of (a).
Fig. 12. An exterior mesh of Delta wing with sharp features. (a) All-quad mesh with all angles ∈ [60◦ , 120◦ ] before boundary layer generation, and [42◦ , 147◦ ] after generating a boundary layer; and (b-d) Zoom-in pictures of (a); (e-g) Three boundary layer templates with one, two and three boundary points. Black points are boundary points, and red points are new points.
16
X. Liang and Y. Zhang
Fig. 13. The Mouse mesh. (a) An all-quad mesh with all angles ∈ [60◦ , 120◦ ]; and (b-e) Zoom-in pictures of (a).
Fig. 14. A three-component air foil with sharp features. (a) An all-quad mesh with all angles ∈ [56◦ , 120◦ ]; and (b-f) Zoom-in pictures of (a).
5 Results We have applied our algorithm to three models: the Mouse in Fig. 13, the Lake Superior map in Fig. 1, and a three-component air foil with sharp features in
Hexagon-Based All-Quad Mesh Generation
17
Table 1. Mesh statistics of three testing models Dataset
Mouse
Sampling Point 971 Mesh Size (vertex, element) (24702, 22554) Angle Range [min, max] [60◦ , 120◦ ] Scaled Jacobian [worst, best] [0.86, 1.0] Aspect Ratio [best, worst] [1.0, 31.6] Time (s) 26
Lake Superior
Air Foil
3921 (63927, 59124) [57◦ , 122◦ ] [0.83, 1.0] [1.0, 25.8] 213
329 (5695, 5331) [56◦ , 120◦ ] [0.83, 1.0] [1.0, 308.0] 4
Fig. 14. Our results were computed on a PC equipped with a 2.4 GHz Intel Q6600 CPU and 4GB of Memory. Statistics of these three meshes are given in Table 1. The sampling points are points obtained from the curve decomposition. The aspect ratio is defined as the longest edge over the shortest edge in a single element. We can observe that our algorithm generates meshes with all the angles ∈ [60◦ -ε, 120◦+ε] (ε ≤ 5◦ ) and the scaled Jacobians ∈ [sin(60◦ -ε), sin90◦ ], or [0.82, 1.0]. Moreover, we can conclude from Table 1 that the run time of our algorithm correlates with the geometry complexity, e.g., the Lake Superior example takes more time than others due to its complicated boundaries. Among the six steps in our algorithm, adaptive hexagon-tree construction and buffer zone clearance are the two most time-consuming steps, since they need to compare each element with its surrounding sampling points.
6 Five Element Types We can observe that most elements in the resulting meshes have similar shapes. To take advantage of that, we categorize all the elements into five types as listed in Fig. 15. The percentage of each element type in the three meshes is listed in Table 2. For element types 1-4, we can use the precomputed stiffness matrix templates to reduce the computational time and the required memory for stiffness matrix construction in finite element analysis. Type 1 is an isosceles trapezoid with a 60◦ angle, where the top and bottom edge lengths can be multiples of a, see Fig. 15(a). When n = 1, it is the dominant element type, which occupies about 50% in the whole mesh. This is
(a) Type 1
(b) Type 2
(c) Type 3
Fig. 15. Five element types
(d) Type 4
(e) Type 5
18
X. Liang and Y. Zhang Table 2. Element percentage and flops for stiffness matrix construction
Element type Mouse Lake Superior Air Foil Type Type Type Type Type
1 2 3 4 5
56.5% 5.5% 8.9% 24.3% 4.8%
62.8% 4.9% 7.7% 20.0% 4.6%
63.0% 2.6% 3.8% 22.9% 7.7%
Flops (1st )
Flops
68 16 54 16 347 347 274 274 5,476∗ /12,376∗ ∗ 5,476∗ /12,376∗ ∗
Note: The 5th , 6th columns are the flops for the first computation and the rest, respectively. Types 1-4 are calculated analytically using the corresponding equations in Appendix; ∗ Using 4 Gaussian integration points;
∗∗ Using 9 Gaussian integration points.
because during the adaptive hexagon-tree construction, this kind of elements is widely used as the transitional element, and each hexagonal element is finally split into two of this type. For other elements with n = 2, 3, 4, they are only generated during template implementation. Type 2 is a parallelogram with a 60◦ angle, where the top and bottom edge lengths are also multiples of a, see Fig. 15(b). This type is generated during template implementation, and only occupies a small portion of the whole mesh. We can firstly calculate the element stiffness matrices for all the shapes of Types 1-2 and store them as templates. When forming the global stiffness matrix, for each element of Types 1-2, we can directly get the values from corresponding stiffness matrix templates instead of recalculating them using the general method. Therefore, we can significantly save the computational time and memory. Type 3 is a trapezoid with a 60◦ angle and a 120◦ angle. This type is mainly generated during the first buffer layer construction where we use angular bisectors for the boundary angles 120◦ and 240◦ . Type 4 is a trapezoid with two 90◦ angles. Like Type 3, this type is mainly induced by the projection during the second buffer layer construction. Different from Types 1-2, the stiffness matrix of Types 3-4 cannot be stored with certain calculated values. However, the formula used in calculating the stiffness matrix can be derived analytically and further simplified. Type 5 is a general element. It mainly exists in the first buffer layer, but also has a small amount in the second buffer layer. Since this element type is irregular, we can only use the general way to calculate the stiffness matrix for each element, which takes lots of time. However, as shown in Table 2, elements of Type 5 generally occupy a small percentage (< 10%) in the final meshes. Remark: As an instance, we treat all the five element types as 4-node bilinear quad elements in the finite element analysis for a Laplace problem, and count the flops used to form the element stiffness matrix for each element type. The results are listed in Table 2, and the derived expressions for each type of stiffness matrix can be found in the appendix. Compared to Type 5 which needs at least 5476 flops for each element, Types 1 and 2 only need 16 flops to
Hexagon-Based All-Quad Mesh Generation
19
generate an element stiffness matrix since the values of their stiffness matrices can be saved as templates, and Types 3 and 4 only need 347 and 274 flops for each element, respectively. We can conclude that using Types 1-4 can save a great amount of computational flops (> 80%) in constructing the stiffness matrix. Usually, Gaussian integration is utilized to calculate the stiffness matrix of a general element, it is inevitable to bring numerical errors. However, since we have analytical expressions of the stiffness matrices for Types 1-4, the resulting stiffness matrices are precise. This is another advantage of our algorithm. Finally, besides speeding up the computation of forming the stiffness matrix, our algorithm can also save lots of memory. As discussed above, the element stiffness matrix of Types 1 and 2 can be stored as templates after the first time calculation, we do not need to store the stiffness matrix for each element. From Table 2, we can see that Types 1-2 elements occupy at least 50% of the final mesh, which means we can at least save half memory during the stiffness matrix construction.
7 Conclusions and Discussion In this paper, we present a novel hexagon-based meshing algorithm, which creates all-quad meshes with provable angle bounds for arbitrary planar curves. It is proved that all the elements are quads with angles ∈ [60◦ ε, 120◦+ε] (ε ≤ 5◦ ) and the scaled Jacobians ∈ [sin(60◦ -ε), sin90◦] or [0.82, 1.0], except small angles in the input geometry. By categorizing elements into five types, we can significantly reduce the computational time, save memory, and provide more precise results during stiffness matrix construction. We have applied our algorithm to a set of complicated geometries, including the Lake Superior map and an air foil with sharp features. Our algorithm provides a theoretical basis of guaranteed-quality all-quad mesh generation. To guarantee the angle range, sometimes the algorithm needs aggressive refinement required by narrow regions, boundary curvatures and sharp features. This restriction will force more elements in the final result, which may not be practical for some applications. Moreover, we did not apply any quality improvement techniques to our generated meshes because it would make the guarantee of angle bounds unpredictable. For practical purposes, the application of smoothing and optimization would further improve the overall mesh quality. Finally, since we use the hexagon-tree in our algorithm, there is no 90◦ angles in the core mesh, and only 50 ∼ 60% vertices are regular (with valence number 4). However, most elements near the boundary are close to rectangles, which is suitable for CFD simulations. Compared to the quadtree method in [11], the hexagon-tree approach results in better angle bounds and no hanging nodes. For the same geometry, these two algorithms generate meshes with similar mesh sizes. However, the hexagon-tree cannot generate square elements in the core mesh while the
20
X. Liang and Y. Zhang
quadtree can. During template implementation, the templates based on the hexagon-tree are much simpler than those in the quadtree method, because the combination of the boundary angles {n × 60◦ |n = 1, 2, ..., 5} is less than that of {n × 45◦ |n = 1, 2, ..., 7}. Moreover, we use a totally different method to preserve sharp features in this paper, the angle bounds are strictly proven. In the current algorithm, the generated interior and exterior meshes do not conform to each other. In the future, we will extend our algorithm to interior and exterior mesh generation with conformal boundaries and guaranteed angle bounds.
Acknowledgements We would like to thank Deborah Gruner for proofreading the paper. This research was supported in part by ONR grant N00014-08-1-0653, which is gratefully acknowledged.
Appendix The following stiffness matrices are derived based on a 4-node bilinear quad element for the Laplace equation. All of them are symmetric. The stiffness matrix for Types 1-4 are denoted as M1 , M2 , M3 and M4 , respectively. ⎡ ⎤ m11 sym ⎢ ⎥ 1 ⎢ m21 m22 ⎥, where: M1 = 3√ ⎦ 3 ⎣ m31 m32 m33 m41 m42 m43 m44 = m22 = 3 − 3n + 5n2 log((1 + n)/n), = [−3 + 12n − 10n2 log((1 + n)/n)]/2, = m42 = −3 − 6n + 5n(1 + n)log((1 + n)/n), = m32 = [3 + 6n − 10n(1 + n)log((1 + n)/n)]/2, = m44 = −6 − 3n + 5(1 + n)2 log((1 + n)/n), = [15 + 12n − 10(1 + n)2 log((1 + n)/n)]/2 (n = 1, 2, 3, 4). ⎡ 4−3n+4n2 ⎤ √ sym 6 3n 2 ⎢ 1−2n2 ⎥ 4+3n+4n √ √ ⎢ ⎥ 3 3n 6 3n ⎥ (n = 1, 2, 3, 4) M2 = ⎢ 2 2 2 ⎢ −2+n ⎥ 1−2n 4−3n+4n √ √ ⎣ 3√3n ⎦ 3 3n 6 3n m11 m21 m31 m41 m33 m43
2 1−2n √ 3 3n
M3 =
√ 1 3 3b(a−c)3
2 −2−3n−2n √ 6 3n
⎡
2 −2+n √ 3 3n
2 4+3n+4n √ 6 3n
⎤ m11 sym ⎢ m21 m22 ⎥ ⎢ ⎥, where: ⎣ m31 m32 m33 ⎦ m41 m42 m43 m44
m11 = 3(a − c)[a2 (a − b − 3c) − c(3b2 + 3bc + c2 ) + a(b2 + 3bc + 3c2 )] − c2 Δ, m21 = 12 [3b(−a + 2b + c)(a2 − c2 ) + 2acΔ],
Hexagon-Based All-Quad Mesh Generation
21
m22 = −3(a − c)[a2 (a − 2b − 3c) + (3a − c)(b2 + bc + c2 )] − a2 Δ, m31 = −3(a − c)[a2 (a − b − 2c) + b2 c + a(b2 + bc + c2 )] − acΔ, m32 = 12 {3(a − c)(a2 (2a − 3b − 4c) − bc(2b + c) + 2a(3b2 + 2bc + c2 )] + a2 Δ}, m33 = 3b(a − c)[a2 + bc − a(3b + c)] − a2 Δ, m41 = 12 {3(a − c)[a2 (b + 2c) − 2a(b2 + 2bc + 2c2) + c(6b2 + 3bc + 2c2 )] + 2c2 Δ}, m42 = −3(a − c)[a2 c + a(b − 2c)(b + c) + c(b2 + bc + c2 )] − acΔ, m43 = 12 [3b(−a + 2b + c)(a2 − c2 ) + 2acΔ], m44 = 3b(a − c)[a(b + c) − c(3b + c)] − c2 Δ, Δ = (2a2 − 3ab + 6b2 − 4ac + 3bc + 2c2 )log(c/a). ⎡ ⎤ m11 sym ⎢ m21 m22 ⎥ 1 ⎢ ⎥, where: M4 = 6b(a−c) 3 ⎣ m31 m32 m33 ⎦ m41 m42 m43 m44 m11 = 3(a − c)[(a − 3c)(a2 + b2 ) + c2 (3a − c)] − 2c2 Δ, m21 = 3b2 (a2 − c2 ) + 2acΔ, m22 = 3(a − c)[a2 (a − 3c) + (3a − c)(b2 + c2 )] + 2a2 Δ, m31 = −3(a − c)[a2 (a − 2c) + b2 c + a(b2 + c2 )] − 2acΔ, m32 = 3(a − c)[a2 (a − 2c) − b2 c + a(3b2 + c2 )] + 2a2 Δ, m33 = −3b2 (3a2 − 4ac + c2 ) − 2a2 Δ, m41 = 3(a − c)[c(a2 + 3b2 + c2 ) − a(b2 + 2c2 )] + 2acΔ, m42 = −3(a − c)[ab2 + (a2 + b2 )c − c2 (2a − c)] − 2acΔ, m43 = 3b2 (a2 + c2 ) + 2acΔ, m44 = 3b2 (a − 3c)(a − c) − 2c2 Δ, Δ = [3b2 + (a − c)2 ]log(c/a).
References 1. Atalay, F.B., Ramaswami, S.: Quadrilateral meshes with bounded minimum angle. In: 17th Int. Meshing Roundtable, pp. 73–91 (2008) 2. Baehmann, P.L., Wittchen, S.L., Shephard, M.S., Grice, K.R., Yerry, M.A.: Robust geometrically based, automatic two-dimensional mesh generation. Int. J. Numer. Meth. Eng. 24(6), 1043–1078 (1987) 3. Baker, T.J.: Identification and preservation of surface features. In: 13th Int. Meshing Roundtable, pp. 299–309 (2004) 4. Bern, M., Eppstein, D.: Quadrilateral meshing by circle packing. Int. J. Comp. Geom. & Appl. 10(4), 347–360 (2000) 5. Bishop, C.J.: Quadrilateral meshes with no small angles (1991) (manuscript) , http://www.math.sunysb.edu/~ bishop/papers/quadmesh.ps 6. Blacker, T.D., Stephenson, M.B.: Paving: A new approach to automated quadrilateral mesh generation. Int. J. Numer. Meth. Eng. 32(4), 811–847 (1991) 7. Brewer, M., Diachin, L., Knupp, P.M., Leurent, T., Melander, D.: The Mesquite mesh quality improvement toolkit. In: 12th Int. Meshing Roundtable, pp. 239– 250 (2003) 8. Canann, S.A., Tristano, J.R., Staten, M.L.: An approach to combined laplacian and optimization-based smoothing for triangular, quadrilateral, and quaddominant meshes. In: 7th Int. Meshing Roundtable, pp. 211–224 (1998)
22
X. Liang and Y. Zhang
9. Garimella, R.V., Shashkov, M.J., Knupp, P.M.: Triangular and quadrilateral surface mesh quality optimization using local parametrization. Comp. Meth. Appl. Mech. Engr. 193(9–11), 913–928 (2004) 10. Kinney, P.: CleanUp: Improving quadrilateral finite element meshes. In: 6th Int. Meshing Roundtable, pp. 437–447 (1997) 11. Liang, X., Ebeida, M., Zhang, Y.: Guaranteed-quality all-quadrilateral mesh generation with feature preservation. Comp. Meth. Appl. Mech. Engr. 199(29– 32), 2072–2083 (2010) 12. Mitchell, S.A., Tautges, T.J.: Pillowing doublets: Refining a mesh to ensure that faces share at most one edge. In: 4th Int. Meshing Roundtable, pp. 231–240 (1995) 13. Owen, S.: A survey of unstructured mesh generation technology. In: 7th Int. Meshing Roundtable, pp. 26–28 (1998) 14. Qian, J., Zhang, Y., Wang, W., Lewis, A.C., Qidwai, M.A.S., Geltmacher, A.B.: Quality improvement of non-manifold hexahedral meshes for critical feature determination of microstructure materials. Int. J. Numer. Meth. Eng. 82(11), 1406–1423 (2010) 15. Quadros, W.R., Ramaswami, K., Prinz, F.B., Gurumoorthy, B.: LayTracks: A new approach to automated geometry adaptive quadrilateral mesh generaton using medial axis transform. Int. J. Numer. Meth. Eng. 61, 209–237 (2004) 16. Schneiders, R., Schindler, R., Weiler, F.: Octree-based generation of hexahedral element meshes. In: 5th Int. Meshing Roundtable, pp. 205–216 (1996) 17. Sußner, G., Dachsbacher, C., Greiner, G.: Hexagonal LOD for interactive terrain rendering. In: Vision Modeling and Visualization, pp. 437–444 (2005) 18. Sußner, G., Greiner, G.: Hexagonal Delaunay triangulation. In: 18th Int. Meshing Roundtable, pp. 519–538 (2009) 19. Tam, T., Armstrong, C.G.: 2D finite element mesh generation by medial axis subdivision. Adv. Eng. Software 13(5–6), 313–324 (1991) 20. White, D.R., Kinney, P.: Redesign of the paving algorithm: Robustness enhancements through element by element meshing. In: 6th Int. Meshing Roundtable, pp. 323–335 (1997) 21. Zhang, Y., Bajaj, C.: Adaptive and quality quadrilateral/hexahedral meshing from volumetric Data. Comput. Meth. Appl. Mech. Eng. 195(9–12), 942–960 (2006) 22. Zhang, Y., Bajaj, C., Sohn, B.-S.: 3D finite element meshing from imaging data. Comput. Meth. Appl. Mech. Eng. 194(48–49), 5083–5106 (2005) 23. Zhang, Y., Bajaj, C., Xu, G.: Surface smoothing and quality improvement of quadrilateral/hexahedral meshes with geometric flow. Commun. Numer. Meth. Eng. 25(1), 1–18 (2009) 24. Zhang, Y., Hughes, T., Bajaj., C.: An automatic 3D mesh generation method for domains with multiple materials. Comput. Meth. Appl. Mech. Eng. 199(5– 8), 405–415 (2010) 25. Zhu, J.Z., Zienkiewicz, O.C., Hinton, E., Wu, J.: A new approach to the development of automatic quadrilateral mesh generation. Int. J. Numer. Meth. Eng. 32(4), 849–866 (1991)
Q-TRAN: A New Approach to Transform Triangular Meshes into Quadrilateral Meshes Locally Mohamed S. Ebeida1 , Kaan Karamete2, Eric Mestreau2 , and Saikat Dey2 1 2
Org. 1414, Applied Math and Applications, Sandia National Laboratories
[email protected] Code 7130, Physical Acoustics Branch, Naval Research Laboratories
[email protected],
[email protected],
[email protected]
Summary. Q-Tran is a new indirect algorithm to transform triangular tessellation of bounded three-dimensional surfaces into all-quadrilateral meshes. The proposed method is simple, fast and produces quadrilaterals with provablygood quality and hence it does not require a smoothing post-processing step. The method is capable of identifying and recovering structured regions in the input tessellation. The number of generated quadrilaterals tends to be almost the same as the number of the triangles in the input tessellation. Q-Tran preserves the vertices of the input tessellation and hence the geometry is preserved even for highly curved surfaces. Several examples of Q-Tran are presented to demonstrate the efficiency of the proposed method. Keywords: Mesh generation, all-quadrilateral, indirect methods, curved surfaces.
1 Introduction Automatic mesh generation is one of the main procedures in Finite Element Analysis (FEA) as well as many other fields. Hence, a robust automatic mesh generator becomes an indispensable tool in such applications. Nowadays, the generation of triangular meshes on 3D surfaces by either the Delaunay triangulation [1, 2, 3, 4] or the advancing front technique [5, 6, 7, 8] are considered matured. However, in many applications, quadrilaterals are preferable to triangular meshes due to their superior performance for various applications such as sheet metal forming and crash simulations. A smaller set of literature exists for quadrilateral meshing. In the last decade, different approaches have been proposed in the area of unstructured all-quadrilateral mesh generation. Virtually, all existing quadrilateral meshing algorithms can be grouped into two main categories, namely, the direct and the indirect approaches.
24
M.S. Ebeida et al.
In the indirect methods, quadrilaterals are formed based on a triangular tessellation called a background mesh. The simplest approach under this category is to divide each triangular face into three quadrilaterals by inserting a vertex into at the center of each face as well as splitting all of its three edges. This method is fast, robust and preserves the angle bounds of the background mesh. However it triples the number of the faces of the input tessellation and introduce a large number of irregular vertices, which are usually not favored in many applications. An irregular vertex is an internal vertex with valence number other than four. An alternative method is to combine adjacent pairs of triangles to form a single quadrilateral [9, 10]. The drawback of this method that in order to generate a mesh with good quality, many triangular faces in the initial tessellation might be left in the output mesh. To minimize the number of these remaining triangles, several heuristic procedures suggested to control the order in which triangles are combined, and in some cases split during the conversion[11, 12, 13]. Velho proposed a local transformation method that utilizes clustering of triangular pairs and produce all-quadrilateral meshes[14]. Owen et al. [15] developed an advancing front algorithm, Q-MORPH, based on a background mesh and the techniques used in the paving algorithm [16]. Q-MORPH generates an all-quadrilateral mesh with well aligned rows of elements and a fewer number of irregular vertices. However, this method needs an initial front to start the quadrilateral conversion and the quality of the generated quadrilaterals depends heavily on that front. This might be a problem for applying Q-MORPH to closed 3D triangular tessellation that is not associated with sharp features. Miyazaki et al. proposed a method to generate a suitable initial front in these cases[17]. However, the Q-Morph transformation is still not local, since each triangular face cannot be transformed unless it becomes adjacent to the advancing front. Moreover, Q-Morph does not preserve the vertices of the input tessellation which may alter the associated geometry for a curved input surface. On the other hand, in the direct methods, quadrilaterals are directly created over the problem domain. These methods are generally classified into one of three main categories. The first depends on some form of domain decomposition [18, 19, 20]. The second is based on the advancing front method [21, 16, 22]. The third extracts a quadrilateral surface using a Cartesian grid [23] or packing of circles [24]. In general, direct methods are slower and less robust compared to indirect methods. The main objective of this study is to present a new indirect quadrilateral mesh generation scheme over 3D curved surface while preserving the vertices of the input triangular tessellation. The proposed method is partially similar to the technique proposed by Velho [14]; however, Q-Tran produces fewer quadrilaterals and fewer irregular vertices in general.
Q-TRAN: Transform Triangular Meshes into Quadrilateral Meshes
25
2 Outline of the Q-Tran Algorithm The Q-Tran algorithm is briefly outlined in the following steps: 1. Initial edge classification: Each edge in the input triangular tessellation is classified as one of the following six types (see Figure 1) • A boundary edge, BE, is either an edge adjacent to a single triangular face or associated with a sharp feature or specified by the user. • An anisotropic diagonal edge, ADE, is a non-boundary edge adjacent to two triangular faces such that its length is greater than the length of the remaining four edges and at least one of the two triangle is anisotropic. A triangular face is considered anisotropic if its aspect ratio exceeds 3.0 otherwise it is considered to be isotropic. • An isotropic diagonal edge, IDE, is an edge that does not fall into any of the two categories mentioned above and adjacent to two isotropic triangular faces such that its length is greater than the length of the remaining four edges and none of these edges is a boundary edge. • A corner edge, CE, is an edge that does not fall into any of the three categories mentioned above and adjacent to two isotropic triangular faces with at least one of these two has two boundary edges. • A regular edge, RE, is any other edge that does not fall into any of the four categories mentioned above. • A special regular edge, SRE, is a regular edge with two adjacent triangles that has two aligned boundary edges. 2. Reclassification of regular and corner edges: • A regular edge that shares a vertex with an anisotropic diagonal edge is reclassified as a boundary edge. • A special regular edge is reclassified as a boundary edge. • A corner edge is reclassified into an anisotropic diagonal edge if its two adjacent faces has four boundary edges. • A corner or a regular edge is reclassified into a boundary edge if it would result in violating the angle bounds of the input tessellation during the conversion process. 3. Check for optimal solution: If the number of diagonal edges is half the number of the faces in the input tessellation, an optimal solution exists. Retrieve it by merging the two adjacent triangles to each diagonal edge into a single quad and exit, otherwise proceed to the next step. 4. Creation of new vertices: • Create a vertex, edge vertex, at the center of non-regular edge. • Create a vertex, regular face vertex, at the center of each triangular face with three regular edges or with two boundary edges. • Create a vertex, boundary face vertex, at the center of each triangular face with three boundary edges. 5. Quadrilateral formation: • For each boundary face vertex, generate three quadrilaterals by splitting the associated boundary face into three quadrilaterals.
26
M.S. Ebeida et al.
(a) ADE
(b) ADE
(d) CE
(c) IDE
(e) SRE
Fig. 1. Classification of the edges of the input tessellation
•
For each anisotropic diagonal edge, transform the adjacent two triangles into four quadrilaterals. • For each regular edge, generate a quadrilateral using the two vertices of that edge and the two created vertices in the adjacent faces. • For each corner edge generate the quadrilaterals as shown in Figure 3(b). 6. Topology clean-up: • Minimize the number of irregular vertices using face collapse of the quadrilaterals with two opposite tri-valence vertices that are created during the Q-Tran algorithm. Do not execute this step if the quality will deteriorate due this heuristic operation. This operation is illustrated in Figure 2.
3 Quality of the Generated Mesh In this section, we study the quality of the quadrilaterals generated during the Q-Tran algorithm in terms of preserving the angle bounds of the input tessellation. As mentioned in the previous section, there are six cases associated with the generation of the quadrilaterals within Q-Tran. The first three types, Group A, are illustrated in Figure 3(a). In these cases, the angle bounds of the input tessellation are preserved automatically. The proof is trivial and follows the simple fact: x+y ≤ max(x, y) (1) 2 where x and y in Equation 1 represents two adjacent angles in the triangular tessellation while x+y represents the corresponding angle in the quadrilateral 2 tessellation. min(x, y) ≤
Q-TRAN: Transform Triangular Meshes into Quadrilateral Meshes
(a) Input
27
(b) Output
Fig. 2. Topology clean-up using face collapse to reduce the number of irregular vertices. A quadrilateral face is collapsed converting two irregular vertices into a regular one. The triangular tessellation is shown using dotted lines in both figures.
For the second group, the quality of the input tessellation is preserved by construction, where an edge from Group B would be reclassified into an edge from Group A if it causes a violation to the angle bounds of the input tessellation. However, we note that throughout the test problems that we have used in this paper we have never encountered this case. Further investigations are required to prove that this case can ever exists.
4 Analysis of Q-Tran Performance In order to test the performance of Q-Tran, we generated a sequence of triangular tessellations covering a planar hexagon. A triangular tessellation, Mi , i = 2, 3, ..., 7, is obtained by isotropic refinement of the previous tessellation, Mi−1 , where each triangular face is split into four triangular faces. Q-Tran is then utilized to convert each tessellation in this sequence into an all-quadrilateral mesh. Note that all the internal edges in any tessellation here are regular edges, which means that random Topology clean-up will be applied everywhere in the mesh at the end of the algorithm. This should represent a worst case scenario for Q-Tran with regard to the time of execution, given that the algorithm should have the same performance for planar and curved surfaces. The results of this test are summarized in Table 1. As we notice from these results, random clean-up operations might increase the relative number of the generated quadrilaterals in some cases to be as much as twice the number of the faces in the input tessellation. All of the tests performed in this section were performed using a 32-bit operating system and 2.0 GHz (T7250) processor with 2.0 GB of memory. Q-Tran was implemented in a generic function so the performance might vary based on the utilized datastructure.
28
M.S. Ebeida et al.
(a) Group A
(b) Group B Fig. 3. Quadrilateral formation in Q-Tran. The quality of the quadrilaterals generated in Group A is guaranteed automatically while the quality of the quadrilaterals generated in Group B is guaranteed by construction. Table 1. Performance of Q-Tran for the hexagon problem Model Name Hexagon-3 Hexagon-4 Hexagon-5 Hexagon-6 Hexagon-7 Hexagon-8 Hexagon-9
N umT 96 384 1,536 6,144 24,576 98,304 393,219
N umQ N umQ /N umT Time (seconds) Rate (N umT /min.) 158 1.65 0.451 12,700 668 1.74 0.486 47,407 2,920 1.90 0.557 165,457 11,856 1.93 1.359 271,258 47,458 1.93 4.206 350,584 104,976 1.07 13.219 446,194 405,914 1.03 54.880 429,904
The performance of Q-Tran is mainly affected by the relative number different edges categories in the input tessellation. For example, if all the edges are classified as boundary edges, then the number of the faces of the input tessellation will be quadrupled. On the contrary, if the number of diagonal edges in the mesh is half the number of the faces of the input tessellation, then the latter will be reduced by half in the output mesh. For most cases, where the relative ratio of internal to boundary edges is relatively large, Q-Tran tends to
Q-TRAN: Transform Triangular Meshes into Quadrilateral Meshes
(a)
(b)
(c)
(d)
(e)
(f)
(g)
(h)
29
Fig. 4. The first four meshes in a sequence utilized to test the performance of Q-Tran. The upper figures show the triangular tessellation of a Hexagon while the lower figures show the corresponding quadrilateral meshes. Table 2. Performance of Q-Tran for various problems Model Name hook ref-plane siklone-1 siklone-2 siklone-3 topology-1 topology-2 vase-1 vase-2 vase-3 tori-1 tori-2 tori-3
N umT 1,014 3,406 29,428 117,716 470,864 35,000 140,0000 19,460 77,844 311,360 12,000 48,000 192,016
N umQ N umQ /N umT Time (seconds) Rate (N umT /min.) 1,212 1.20 3.350 18,161 3,776 1.11 0.933 219,035 31,749 1.08 6.809 259,315 123,892 1.05 18.855 374,593 487,156 1.03 70.674 399,748 41,993 1.20 7.244 289,895 171,785 1.23 23.989 350,160 27,508 1.41 6.28 185,923 107,546 1.38 14.346 325,570 419,060 1.35 53.685 347,985 12,129 1.01 2.769 260,021 49,788 1.04 7.412 388,559 197,252 1.03 28.422 405,353
almost preserve the number of the faces in the input tessellation. With regard to the required computational time, Q-Tran tends to be much faster as the number of diagonal edges relatively increase, since fewer clean-up operations would be required. As shown in the next section we have applied Q-Tran to a wide range of different types meshes. Some of these meshes have some structured patches with anisotropic faces, others are decomposed of highly curved surfaces with no boundary edges at all, ... etc. The performance of Q-Tran for these meshes is summarized in Table 2. To have an overall average estimation of the Q-Tran performance, the results of all the test performed in this section are illustrated in Figure 5. These results shows that the number of the quadrilaterals in most cases tends to be almost the same as the number of the triangles in the input. This may increase
30
M.S. Ebeida et al.
(a) Input
(b) Output
Fig. 5. Q-Tran performance. The relation between the number of the faces in the input and the output meshes is illustrated in the right figure while the execution time for the various test problems is illustrated in the left figure. The inclined line in each of the two figures is used as a reference.
in the worst cases to be as much as twice that number. On average, Q-Tran seems to convert a triangular tessellation into an all-quadrilaterals meshes at an average rate of 375,000 triangles per minute using a 2.0 GHz processor. Again, this is considered a rough estimation since we utilized a generic implementation These results might be further improved if a datastructure-specific implementation is to be utilized because Q-Tran depends to a large extent on the speed of adjacency queries.
5 Example Problems Six examples, shown in Figures 6-11, demonstrates various features of the Q-Tran algorithm. The first example shown in Figure 6 demonstrates the capability of Q-Tran to handle highly curved surfaces with no boundary edges. This example illustrates the ability of Q-Tran to detect and preserve structured regions in the input tessellation. Figure 7, on the other hand, shows the quality of the quadrilaterals generated for a Cad model with non-manifold boundary edges. This example includes almost all the types of edge classifications within Q-Tran. The ability to handle a triangular mesh with some anisotropic faces is illustrated in Figures 8. As this figure show, the final quadrilateral mesh preserves the directionality of the stretched faces. Figures 9 and 10 show that the vertices distribution in the final quadrilateral mesh is almost the same as in the input tessellation. This is demonstrated using a highly curved surface as well as a simple planar surface with variable density distribution. The final example, in Figure 11, demonstrates that efficiency of recovering the structured regions from the input tessellation. As illustrated in that figure Q-Tran was capable of recovering all of the structured regions in this example leaving behind a very small number of irregular vertices.
Q-TRAN: Transform Triangular Meshes into Quadrilateral Meshes
(a) Input: 35,000 triangles
(b) Output: 41,993 quadrilaterals
Fig. 6. Topology Model (execution time = 7.244 seconds)
(a) Input: 1,014 triangles
(b) Output: 1,212 quadrilaterals
Fig. 7. Hook Model (execution time = 3.35 seconds)
(a) Input: 19,460 triangles
(b) Output: 27,508 quadrilaterals
Fig. 8. Vase Model (execution time = 6.28 seconds)
31
32
M.S. Ebeida et al.
(a) Input: 29,428 triangles
(b) Output: 31,749 quadrilaterals
Fig. 9. Siklone Model (execution time = 6.809 seconds)
(a) Input: 3,406 triangles
(b) Output: 3,770 quadrilaterals
Fig. 10. Refined-Plane Model (execution time = 0.933 seconds)
(a) Input: 12,000 triangles
(b) Output: 12,129 quadrilaterals
Fig. 11. Tori Model (execution time = 2.769 seconds)
Q-TRAN: Transform Triangular Meshes into Quadrilateral Meshes
33
6 Conclusion The Q-Tran algorithm is an indirect quadrilateral meshing algorithm that utilizes edge classification to transform triangles into quadrilaterals locally. It generates an all-quadrilateral mesh with provably-good quality. The resulting quadrilaterals, in general, follow the boundaries of the domain. The Q-Tran algorithm is capable of detecting and recovering the structured regions in the input tessellation. It can handle isotropic and anisotropic cases with almost the same efficiency. Compared to the Q-Morph algorithm, Q-Tran can be implemented in parallel, preserves the vertices of the input tessellation and does not require an initial front. Moreover, the quality of the generated quadrilaterals is guaranteed, hence, no smoothing is required as a post processing step. Improvements include minimizing of the irregular vertices as well as controlling the directionality in the isotropic structured regions.
Acknowledgments This research was performed under contract to US Naval Research Laboratory as part of the Computational Research and Engineering Acquisition Tools and Environments (CREATE) program of the DoD High Performance Computer Modernization Program. We would like to thank Dave Morris, and Frank Su for the “Topology” and the “Vase” models. These models are courtesy of 3dvia (http://www.3dvia.com). We would also like to thank Herbert Edelsbrunner, (http://www.cs.duke.edu/~edels/Tubes/), for the “Tori” model.
References 1. Chew, L.P.: Constrained Delaunay triangulations. Algorithmica 4, 97–108 (1989) 2. Dey, T.K., Bajaj, C.L., Sugihara, K.: On good triangulations in three dimensions. Int. J. Comput. Geom. & App. 2, 75–95 (1992) 3. Miller, G.L., Talmor, D., Teng, S.-H., Walkington, N.: A Delaunay based numerical method for three dimensions: generation, formulation, and partition. In: 27th Annual ACM Symposium on the Theory of Computing, pp. 683–692 (1995) 4. Cohen-Steiner, D., Colin, E., Yvinec, M.: Conforming Delaunay triangulations in 3D. In: 18th Annual Symposium on Computational Geometry, pp. 199–208 (2002) 5. George, P.L., Seveno, E.: The advancing front mesh generation method revisited. Int. J. Numer. Meth. Engng. 37, 3605–3619 (1994) 6. Mavriplis, D.J.: An advancing front Delaunay triangulation algorithm designed for robustness. J. of Comput. Phys. 117, 90–101 (1995) 7. Lohner, R.: Extensions and improvements of the advancing front grid generation technique. Commun. Numer. Meth. Engng. 12, 683–702 (1996)
34
M.S. Ebeida et al.
8. Lau, T.S., Lo, S.H.: Finite element mesh generation over analytical surfaces. Comput. Struct. 59, 301–309 (1996) 9. Heighwayl, E.A.: A mesh generator for automatically subdividing irregular polygons into quadrilaterals. IEEE Transactions on Magnetics Mag-19, 2535–2538 (1983) 10. Itoh, T., Inoue, K., Yamada, A., Shimada, K., Furuhata, T.: Automated conversion of 2D triangular Mesh into quadrilateral mesh with directionality control. In: 7th International Meshing Roundtable, pp. 77–86 (1998) 11. Lo, S.H.: Generating quadrilateral elements on plane and over curved surfaces. Comput. Struct. 31, 421–426 (1989) 12. Johnston, B.P., Sullivan Jr., J.M., Kwasnik, A.: Automatic conversion of triangular finite element meshes to quadrilateral elements. Int. J. Numer. Meth. Engng. 31, 67–84 (1991) 13. Lee, C.K., Lo, S.H.: A new scheme for the generation of a graded quadrilateral mesh. Comput. Struct. 52, 847–857 (1994) 14. Velho, L.: Quadrilateral meshing using 4-8 clustering. In: CILANCE 2000, pp. 61–64 (2000) 15. Owen, S.J., et al.: Q-Morph: An indirect approach to advancing front quad meshing. Int. J. Numer. Meth. Engng. 44, 1317–1340 (1999) 16. Blacker, T.D., Stephenson, M.B.: Paving: A new approach to automated quadrilateral mesh generation. Int. J. Numer. Meth. Engng. 32, 811–847 (1991) 17. Miyazaki, R., Harada, K.: Transformation of a closed 3D triangular mesh to a quadrilateral mesh based on feature edges. Int. J. Comput. Sci. Network Security. 9, 30–36 (2009) 18. Baehmann, P.L., Wittchen, S.L., Shephard, M.S., Grice, K.R., Yerry, M.A.: Robust geometrically based, automatic two-dimensional mesh generation. Int. J. Numer. Meth. Engng. 24, 1043–1078 (1987) 19. Tam, T.K.H., Armstrong, C.G.: 2D finite element mesh generation by medial axis subdivision. Adv. Engng. Software 13, 313–324 (1991) 20. Joe, B.: Quadrilateral mesh generation in polygonal regions. Comput. Aid. Des. 27(3), 209–222 (1991) 21. Zhu, J.Z., Zienkiewicz, O.C., Hinton, E., Wu, J.: A new approach to the development of automatic quadrilateral mesh generation. Int. J. Numer. Meth. Engng. 32, 849–866 (1991) 22. White, D.R., Kinney, P.: Redesign of the paving algorithm: Robustness enhancements through element by element meshing. In: 6th International Meshing Roundtable, pp. 323–335 (1997) 23. Zhang, Y., Bajaj, C.: Adaptive and quality quadrilateral/hexahedral meshing from volumetric Data. Comput. Meth. in Appl. Mech. Engng. 195, 942–960 (2006) 24. Bern, M., Eppstein, D.: Quadrilateral meshing by circle packing. Int. J. Comp. Geom. & Appl. 10(4), 347–360 (2000)
Mesh Construction with Prescribed Properties Near Boundary Boris Azarenok Dorodnicyn Computing Center of Russian Academy of Sciences, Moscow, Russia
[email protected]
Summary. A quasi-conformal mapping of the parametric domain onto the underlying physical domain is used to generate a 2D structured mesh with required properties: grid line orthogonality and prescribed mesh point clustering near the domain boundary. The functions implementing the mapping are sought by solving the Dirichlet problem for the elliptic partial differential equations. An additional control for the cell shape is executed by introducing a local mapping. Example of the mesh near the airfoil is presented. Keywords: structured mesh; elliptic grid generation; control metric.
1 Introduction When constructing a structured (block-structured) mesh on a two-dimensional domain with aim to simulate viscous gas flow near a body, there are additional requirements imposed on the mesh. It is grid line orthogonality and prescribed strong mesh point clustering near the streamline body. If the outside domain boundary is in “infinity” and may have an arbitrary shape, then one may use algorithms based on solving hyperbolic partial differential equations (PDEs) (cf. [1, 2]). If the entire boundary is stringently defined, such methods are badly applicable due to the boundary value problem (BVP) is ill-possed. Besides, the hyperbolic PDEs transfer singularities of the solution (i.e., breaks on the boundary) along characteristics. Quasilinear hyperbolic PDEs may produce a non-smooth and even discontinuous solution even with smooth boundary conditions [3]. For the rigidly defined boundary it is convenient to utilize elliptic PDEs of the second order (cf. [4, 5, 6]) producing meshes at a quasi-conformal mapping. Here it is sought a mapping of the domain P in the parametric plane with a given square mesh onto the domain Ω in the physical plane where the grid is required. We call P a parametric domain and Ω is called a physical domain. If to employ a homeomorphic mapping F : P→Ω then the image of the square mesh on P is an unfolded grid on Ω. For the Laplace equations,
36
B. Azarenok
the Rad´o theorem [7] asserts that the harmonic mapping of a simply connected bounded domain onto a simply connected bounded convex domain is univalent subject to a given homeomorphism between the boundaries. To satisfy the conditions of the Rad´ o theorem for nonconvex physical domains, the inverted Laplace equations are applied (cf. [4, 6]). The use of the inverted Laplace equations provides a smooth and quasiuniform grid. However, the grid so generated is not always satisfactory in the sense that points may not be clustered to where they are needed and grid orthogonality near the domain boundary is not supported. Besides, some problem arises at discrete level that leads to mesh folding (cf. [8, 9, 10, 11]). In [5], with purpose to implement grid line control, a substitution of variables was implemented for the inverted Laplace equations. In [12], the source terms were used in those Eqs. and, in [16], an algorithm of specifying coefficients in source terms was suggested to impose grid line orthogonality and prescribed mesh point clustering near the domain boundary. An additional algebraic transformation was applied in [13], additional local mapping was executed in [14, 10]. It is not possible to obtain orthogonal mesh in the entire domain with a curvilinear boundary, except simple canonical domains (disk, ring or their sector, etc.) because the BVP is ill-possed [15]. In complicated domains, the mesh, generated by using a conformal mapping, is not applicable for mathematical simulation. On the other hand, one may obtain a mesh with orthogonal grid lines of one family towards the boundary and prescribed mesh point clustering near the domain boundary. To this end, in the source terms of the Poisson equations of [12] it is specified coefficients at the exponent by solving an inverse problem [16]. This process is rather cumbersome and practical calculation demonstrates that grid line may approach the boundary at an angle substantially differing from 90o [16, 2, 17]. We present the grid generation method based on solving the Dirichlet problem for the elliptic PDEs [10, 11]. Grid line control is imposed by introducing an additional local mapping which induces the control metric. We present the way of specifying the control metric with aim of obtaining grid line orthogonality and required mesh point clustering near the domain boundary. Example of the mesh near the NACA6409 airfoil is considered.
2 Grid Generation Using Mapping Let a structured mesh be required on a simple connected domain Ω represented as a curvilinear quadrangle in the plane of physical variables x, y. The mesh is defined by the nodal Cartesian coordinates ri,j = (x, y)i,j , i = 1, 2, . . . , N1 , j = 1, 2, . . . , N2 , subject to given nodal coordinates on the boundary ∂Ω ri,1 , ri,N2 , i=1, . . . , N1 ; r1,j , rN1 ,j j=1, . . . , N2 .
Mesh Construction with Prescribed Properties Near Boundary
37
To this end, the parametric domain P, rectangle with the sides N1 −1 and N2 −1 subdivided into unit squares, in the plane ξ, η is mapped onto the physical domain Ω. If a homeomorphic mapping F : P→Ω can be found, the image of the square mesh on the domain P will be an unfolded mesh on the domain Ω. This is true at least in continuous approach. Meantime at the discrete level, truncation error may case grid folding (cf. [11, 9, 8]). As grid lines on Ω it is utilized the equipotential lines of the functions ξ(x, y) and η(x, y). The functions F=x(ξ)=(x(ξ, η), y(ξ, η)), of class C2 , executing the mapping x(ξ) : P→Ω (see Fig. 1), are sought by solving the Dirichlet problem for the elliptic PDEs [10, 11] ˜ 22 (P − Q) + G ˜ 12 (S − R) (1) L(x) = g22 xξξ − 2g12xξη + g11 xηη − xξ G ˜ 11 (R − S) + G ˜ 12 (Q − P ) = 0, −xη G L(y) = 0,
˜ ˜ ˜ ˜ ˜ kl = √Gkl , P = g11 ∂ G12 − g12 ∂ G11 , Q = 1 g11 ∂ G22 − g22 ∂ G11 , G ∂η ∂η 2 ∂ξ ∂ξ det G
˜ 22 ˜ 12 ˜ 22 ˜ 11 ∂G ∂G 1 ∂G ∂G S = g12 − g22 , R= g11 − g22 . ∂ξ ∂ξ 2 ∂η ∂η The components of the metric tensor gkl , induced by the mapping x(ξ), are g11 = x2ξ + yξ2 , g12 = xξ xη + yξ yη , g22 = x2η + yη2 . In Eqs. (1), we use one more metric G. The control metric G is induced by a local mapping X(ξ) of a subdomain P1 ⊂P to a domain in the plane of new variables X, Y . At discrete level it may be, for instance, four adjacent cells in the parametric plane ξ, η, forming a 9-point stencil to approximate Y
6
η
y
-
X
X(ξ)
x(ξ)
P
ξ
Ω
-
x
Fig. 1. Mapping x(ξ) : P→Ω is sought by solving problem (1),(2). Control metric G is specified by local mapping X(ξ), e.g., 4 cells (dotted) in plane ξ, η onto 4 cells in plane X, Y .
38
B. Azarenok
the system (1), onto four adjacent cells in the plane X, Y (see Fig. 1). The components of the control metric tensor Gkl are G11 = Xξ2 + Yξ2 , G12 = Xξ Xη + Yξ Yη , G22 = Xη2 + Yη2 . The boundary conditions specify the boundary correspondence x = xb (ξ, η) ,
(ξ, η) ∈ ∂P.
y = yb (ξ, η),
(2)
The mapping x(ξ) is quasi-conformal, i.e., it transforms an infinitesimal circle of P to an infinitesimal ellips of Ω. In some particular cases, the mapping x(ξ) : P→Ω is a composition of two sequential mappings. First, we construct the mapping X(ξ) of the domain P onto the domain C in the plane X, Y (see Fig. 2). Therefore, a mesh (or a part of the mesh) is constructed on the domain C. Next the image of this mesh is obtained on the domain Ω at the mapping x(X) : C→Ω. If Gkl is the identity tensor, then Eqs. (1) turn to the inverted Laplace equations of [4] and x(ξ) : P→Ω is the inverse harmonic mapping. By the Rad´ o theorem [7], the direct harmonic mapping ξ(x) : Ω→P, specified by the Laplace equations, is univalent. PDEs (1) are the Euler equations to the universal functional suggested in [14]. The property of universality implies that by specifying the control metric Y
C
X
x(X) y
X(ξ)
Ω
η
x(ξ)
P
x ξ Fig. 2. In particular cases, first mapping X(ξ) : P→C is used and then mapping x(X) : C→Ω is considered
Mesh Construction with Prescribed Properties Near Boundary
39
G any given smooth homeomorphic mapping F : P→Ω may be reproduced by solving the problem (1),(2) and, at discrete level, any given unfolded mesh may by constructed. In addition, Eqs. (1) are invariant to nonsingular transformations of the coordinates x, y and X, Y . These two properties of Eqs. (1) allow to obtain a grid with required properties subject to such a grid exists.
3 Discretization and Numerical Solution Eqs. (1) are approximated to second order at the interior mesh node (i, j) on the domain P via the difference relations on the 9-point square stencil of spacing 1. The derivatives of the function x(ξ, η) are approximated as follows xξ ≈ [xξ ]i,j = 0.5(xi+1,j − xi−1,j ), xη ≈ [xη ]i,j = 0.5(xi,j+1 − xi,j−1 ), xξξ ≈[xξξ ]i,j =xi+1,j − 2xi,j + xi−1,j , xηη ≈[xηη ]i,j =xi,j+1 − 2xi,j + xi,j−1 ,
(3)
xξη ≈ [xξη ]i,j = 0.25(xi+1,j+1 − xi+1,j−1 − xi−1,j+1 + xi−1,j−1 ),
and the components of the metric tensor gkl are approximated as follows [g11 ]i,j = [xξ ]2i,j + [yξ ]2i,j , [g22 ]i,j = [xη ]2i,j + [yη ]2i,j , [g12 ]i,j = [xξ ]i,j [xη ]i,j + [yξ ]i,j [yη ]i,j . The components of the control metric tensor Gkl are approximated similarly. Substituting these relations into Eqs. (1) gives approximation of the operators L(x) and L(y) denoted [L(x)]i,j and [L(y)]i,j , respectively. The resulting discretized equations with boundary conditions (2) are solved by employing the iterative procedure. Let nodal coordinates be known at the lth iteration. Then at the l+1th iteration they are updated by formulae [5] l xl+1 i,j = xi,j + τ
[L(x)]i,j [L(y)]i,j l+1 l , yi,j = yi,j +τ . (4) 2([g11 ]i,j + [g22 ]i,j ) 2([g11 ]i,j + [g22 ]i,j )
Here [.] denotes approximation of the underlying expression at the node (i, j) at the lth iteration, iterative parameter 0<τ <2. To accelerate convergence of the iterations (4) the Seidel procedure is employed. Iterations are executed until the condition for the nodal coordinates ri,j =(x, y)i,j l max |rl+1 i,j − ri,j | < ε, i,j
i=2, . . . , N1 −1, j=2, . . . , N2 −1,
is satisfied. Here ε>0 is sufficiently small. As an initial guess roi,j one may utilize a grid provided by the inverted Laplace equations.
4 Control Metric Assignment The control metric G is specified so that the grid possesses required properties. Suppose we need to construct a mesh with the j-line (equipotential
40
B. Azarenok
line ξ(x, y)=const) approaching orthogonally the upper part of the boundary ∂Ω (where the nodes (i, N2 ), i=1, 2, . . . , N1 , are located) and, in addition, with prescribed mesh point clustering near this part of ∂Ω. In other words, several upper i-lines (equipotential line η(x, y)=const), say jo , are given by the nodal coordinates ri,j =(x, y)i,j ri,j = ri,j+1 + ni,j+1 hi,j+1/2 , i=2, . . . , N1 −1, j=N2 −1, . . . , N2 −jo , (5) where the spacing hi,j+1/2 is the distance between the nodes (i, j) and (i, j+1), ni,j+1 =(sy , −sx )i,j+1 is the inward unit normal vector towards the i-line. The unit tangent vector towards the i-line is si,j+1 = (ri+1,j+1 − ri−1,j+1 )/|ri+1,j+1 − ri−1,j+1 |.
(6)
This grid block we call boundary cell layers. After calculating the metric tensor components gkl at nodes of the i-lines j=N2 −1, N2 −2, . . . , N2 −jo , we specify components of the control metric tensor Gkl =gkl at those nodes. If jo =N2 −2 (it would imply that we specify all interior nodes), because the system (1) is universal, the numerical solution will reproduce the given mesh (see [10, 11]). This case may be represented as follows. The mesh, given on the domain C in the plane X, Y (see Fig. 2), is reproduced on the domain Ω in the plane x, y. If we specify only some upper part of the grid (jo
where are the nodal coordinates of the initial stencil and rsq m,n are the nodal coordinates of the square stencil of spacing 1, the node m=n=0 is fixed.
Mesh Construction with Prescribed Properties Near Boundary Y 1r
r
r
r
-1
r i-1,j r
i-1,j-1
r
r
i,j+1
i-1,j+1
r
r
Y 1r
i,j r
r
0
r -1
r
i,j r
r
i+1,j 1 X -1 i+1,j r
r
i,j-1
r
r
r
r
0
r
r
r
r
-1
a
i-1,j-1
r
r
r i-1,j
1 X
r
i+1,j+1 i,j+1
i+1,j-1
r i,j-1
i+1,j-1
i+1,j+1
41
i-1,j+1
r
r
b Y 1r
r
i,j+1
r
i-1,j+1
r
r -1
i-1,j-1
i+1,j+1
r
i,j r
r i-1,j r
r
0
r -1
r 1 X
r
i,j-1
r
r
i+1,j
i+1,j-1
r
r
c Fig. 3. Initial stencil transforms to square stencil of spacing 1. Correct location of initial stencil relatively square stencil (a), incorrect (b). Rotated stencil (c).
Because the system (1) is invariant to rotation and scaling of the coordinates X, Y , the mesh constructed will smoothly transform to the grid on the rest of the domain Ω. However, the case depicted in Fig. 3b provokes 9-point stencil folding during transformation (7). To prevent this situation, first we rotate the initial stencil about the origin (0,0), i.e., about the point (i, j), so that the node (i+1, j) lays in the X-axis (see Fig. 3c). We find the rotation angle ϕ between the vector ri+1,j and X-axis 2 2 2 2 cos ϕ = Xi+1,j Xi+1,j + Yi+1,j , sin ϕ = Yi+1,j Xi+1,j + Yi+1,j and update coordinates of 8 nodes
42
B. Azarenok
Xm,n =Xm,n cos ϕ + Ym,n sin ϕ, Ym,n =−Xm,n sin ϕ + Ym,n cos ϕ, m, n=−1, 0, 1.
We obtain the stencil like that of Fig. 3c. Next, the transformation (7) is executed.
5 Mesh Around Airfoil Consider the grid generation problem on the domain Ω around the NACA6409 airfoil represented parametrically with B´ezier curves [18] x(t) = F1 (Z1 (1 − t)), F2 (Z1 (1 − t)) + Z2 (1 − t, th ), upper airfoil branch y ≥ 0 , y(t) = F2 (Z1 (1 − t)) − Z2 (1 − t, th ), lower airfoil branch y < 0 , Z1 (t) =
8
αi Bi (t),
Z2 (t, th ) = th
i=1
F1 (t) =
4 i=1
8
βi Bi (t),
i=1
γi Ci (t),
F2 (t) = δ
3
Ci (t),
i=1
0 ≤ t ≤ 1, th = 0.09, δ = 0.12, α1 = 0, α2 = 0.03571, α3 = 0.10714, α4 = 0.21429, α5 = 0.35714, α6 = 0.53571, α7 = 0.75, α8 = 1, β1 = 0.18556, β2 = 0.34863, β3 = 0.48919, β4 = 0.58214, β5 = 0.55724, β6 = 0.44992, β7 = 0.30281, β8 = 0.0105, γ1 = 0.2, γ2 = 0.4, γ3 = 0.7, γ4 = 1, B1 (t) = 8t(1 − t)7 , B2 (t) = 28t2 (1 − t)6 , B3 (t) = 56t3 (1 − t)5 , B4 (t) = 70t4 (1 − t)4 , B5 (t) = 56t5 (1 − t)3 , B6 (t) = 28t6 (1 − t)2 , B7 (t) = 8t7 (1 − t), B8 (t) = t8 , C1 (t) = 4t(1 − t)3 , C2 (t) = 6t2 (1 − t)2 , C3 (t) = 4t3 (1 − t), C4 (t) = t4 . The outer domain boundary is specified by sides of the square −1.5≤x≤2.5, −2≤y≤2. In Fig. 4, it is presented the O-type 105×51 mesh. The lines i=1, N1 are coincide and go from the trailing edge, line j=1 is the outer domain boundary, line j=N2 is the airfoil contour. In the upper airfoil branch, points are located by using the following distribution for the parameter t within the segment 0≤t≤1 t1 = 0, ti+1 = ti + ti+1/2 , i=1, 2, . . . , Na , Na =(N1 −1)/2, t3/2 =
2(σ − 1) 2σ , ti+1/2 = ti−1/2 − , i=2, 3, . . . , Na , (σ + 1)Na (σ + 1)Na (Na − 1)
where σ=tNa +1/2 /t3/2 =1/11.5 . For the lower airfoil branch points i=Na + 2, . . ., N1 −1, the above formulae are utilized with σ=tNa +3/2 /tN1 −1/2 =0.1.
Mesh Construction with Prescribed Properties Near Boundary
43
i=2 i=1 i=104
Fig. 4. 105×51 mesh with j-lines orthogonal to airfoil contour, mesh point clustering near airfoil and outer boundary
In a neighborhood of the trailing edge, the continuous mapping is unstable that causes grid lines to overlap. To prevent grid folding we imply a constrain. It is that the line i=1 should approach the corner point along the bisectrix of the trailing edge outer angle. Several nodes of the line i=1 lay in the bisectrix, l i.e., at iterations (4) the shift vector rl+1 1,j − r1,j is projected to the bisectrix. To satisfy the conditions of orthogonality and clustering near the airfoil contour we define the control metric G in the following manner. In the plane X, Y we specify nodal coordinates ri,j =(X, Y )i,j of jo cell layers according to the formula (5) with mesh spacings along the j-line 2 hi,j+1/2 = hi,N2 −1/2 + (N2 − 1 − j)/jo (hi,N2 −jo +1/2 − hi,N2 −1/2 ) , i=1, 2, . . . , N1 , j=N2 −1, ..., N2 −jo , where hi,N2 −1/2 , hi,N2 −jo +1/2 are given spacings in the 1st and jo th (from airfoil contour) boundary cell layers. In Fig. 5, the boundary cell layers
44
B. Azarenok
Fig. 5. Boundary cell layers in plane X, Y Table 1. Parameters of mesh on C domain in X, Y plane hi,N2 −1/2
6×10−3 3×10−3 10−3 3×10−4 10−4 3×10−5 10−5
hi,N2 −jo +1/2
0.03
0.02
0.02
0.02
0.02
0.02
0.02
jb
1
3
4
6
8
8
8
are presented in the plane X, Y with parameters jo =20, hi,N2 −1/2 =0.03, hi,N2 −jo +1/2 =6·10−3 . These layers may be considered as a part of the mesh on the domain C. The line i=1 is the bisectrix of the trailing edge outer angle r1,j = r1,j+1 + b h1,j+1/2 , j=N2 −1, ..., N2 −jo .
(8)
Here with j=N2 −1, . . . , N2 −jb the unit vector b=bd specifies the bisectrix and number of gird nodes jb in this bisectrix is changed depending on node clustering toward airfoil, see Table 1. For the rest of nodes in the line i=1 the vector b in (8) specifies the direction which changes smoothly from bd to the vector k=(1, 0) b=
˜ b ˜ = bd + N2 − jb − j − 1 (k − bd ), j=N2 −jb −1, . . . , N2 −jo . , b ˜ jo − jb − 1 |b|
Near the airfoil, direction of the lines i=1, 2 as well as i=105, 104 changes sharply, nearly by 90o . This causes quality of the mesh on Ω deteriorates. We smooth this change of direction by using a vector ti,j+1 , a normalized linear combination of ni,j+1 and b, instead of the normal vector ni,j+1 in the formula (5)
Mesh Construction with Prescribed Properties Near Boundary
ti,j+1 =
45
˜ti,j+1 , ˜ti,j+1 =λi ni,j+1 + b, i=2, . . ., 4, N1 −4, . . ., N1 −1, λ2 =1.5, |˜ti,j+1 |
λ3 =2.7, λ4 =4.5, λ5 =10, λN1 −4 =5, λN1 −3 =3, λN1 −2 =1.2, λN1 −1 =0.5, with indices j=N2 −jb −1, . . ., N2 −jo . With indices j=N2 −1, N2 −2, we use the normal vectors ni,j+1 in the formula (5) with all i=2, . . . , N1 −1. For the lines j=N2 −3, ..., N2 −jb we use a vector pi,j+1 , a normalized linear combination of ni,j+1 and ti,j+1 , instead of the vector ni,j+1 in the formula (5) pi,j+1 =
˜ i,j+1 p , |˜ pi,j+1 |
N2 − 2 − J (ti,j+1 − ni,j+1 ), 5 i = 2, ..., 5, N1 −4, ..., N1 −1. ˜ i,j+1 = ni,j+1 + p
The mesh of Fig. 5 is the boundary cell layers of an initial grid in the iterative procedure (4). The remained part of the initial grid may be produced, for instance, by an algebraic method. Transformation (7) of the tensor Gkl to the identity tensor is executed within j1 =6 cell layers. We calculate the metric tensor Gkl for every new parameters hi,N2 −1/2 , hi,N2 −jo +1/2 of Table 1. After implementing iterations (4), the resulting mesh is used as an initial guess for the grid with new parameters hi,N2 −1/2 , hi,N2 −jo +1/2 except for jo boundary cell layers for which the initial mesh is the grid on the domain C. For the first 1000 iterations (4) we set the iterative parameter τ equal to 0.3 and for the remained iterations τ =1.7. The parameter ε, serving for stopping iterations, is equal to 10−14 . Convergence is attained within 2500 to 3000 iterations. Fig. 6 presents fragments of the grid on Ω (for entire mesh see Fig. 4) with the fifth set of parameters of the Table 1. For the last set of parameters of the Table 1 in all cells of the layer j=N2 −1 (nearest to airfoil), the spacing hi,N2 −1/2 is exactly equal to 10−5 . The angle ϕ between j-line and tangent vector towards the airfoil contour at the node (i, N2 ), i=2, ..., N1 −1, computed via (6), is equal to 90o with a deviation |ϕ|≤0.1o . Thus, the requirements of mesh orthogonality and prescribed node clustering near the airfoil are obeyed. Besides we regulate the cell shape near the outer boundary. The control metric tensor Gkl is specified by the rectangular grid on the domain C with spacing in the X- and Y -axis Xi+1,j − Xi,j = hxi+1/2 = 1, i=1, . . . , N1 −1, j=1, . . . , j2 , j−1 q Yi,j+1 −Yi,j =hyj+1/2 =hyj2 −1/2 + (1−hyj2 −1/2 ), i=1, . . . , N1 , j=1, . . . , j2 . j2 −1 The parameters are j2 =11, q=1.5, hyj2 −1/2 =0.3 for the mesh of Fig. 4. In general, the spacing hyj+1/2 may also depend on the index i.
46
B. Azarenok
a
b
c
Fig. 6. Close-up with magnification factor of 3 (a) and 50 (b),(c)
6 Conclusion We presented the grid construction method by using the quasi-conformal mapping. Existence and uniqueness of a diffeomorphic harmonic mapping is provided by the Rad´ o theorem for the inverted Laplace equations. Next, this mapping is deformed so that to obtain a grid with required properties. The universal elliptic PDEs allow to obey the conditions of orthogonality and
Mesh Construction with Prescribed Properties Near Boundary
47
prescribed mesh point clustering near the domain boundary. The technique of specifying the control metric was considered. For this, two formulations of grid generation problem were used with implementing a local additional mapping and a global additional mapping.
Acknowledgement This work was supported by the Department of Mathematical Sciences of the Russian Academy of Sciences (Program 3) and Russian Foundation for Basic Research (project code 09-01-00173).
References 1. Steger, J.L., Chausse, D.S.: Generation of body-fitted coordinates using hyperbolic partial differential equations. SIAM Journal on Scientific Computing 1(4), 431–437 (1979) 2. Visbal, M., Knight, D.: Generation of orthogonal and nearly orthogonal coordinates with grid control near boundaries. AIAA Journal 20(3), 305–306 (1982) 3. Prokopov, G.P.: Some general issues of grid generation algorithms. VANT. Ser. Mathematical modelling of physical processes 1, 37–46 (1998) (in Russian) 4. Winslow, A.M.: Numerical solution of the quasi-linear Poisson equation in a nonuniform triangle mesh. J. Comput. Phys. 1, 149–172 (1966) 5. Godunov, S.K., Prokopov, G.P.: The use of moving meshes in gasdynamics computations. USSR Comput. Maths. Math. Phys. 12(2), 182–191 (1972) 6. Thompson, J.F., Mastin, C.W., Thames, F.C.: Automatic numerical generation of body-fitted curvilinear coordinate system for field containing any number of arbitrary two-dimensional bodies. J. Comp. Phys. 15, 299–319 (1974) 7. Rad´ o, T.: Aufgabe 41, Jahresber. Deutsche Math.-Verein 35, 49 (1926) 8. Roache, P.J., Steinberg, S.: A new approach to grid generation using a variational formulation. In: AIAA 7th Computational Fluid Dynamics Conference, Cincinnati, OH, AIAA Paper, No. 85-1527-CP (July 1985) 9. Knupp, P., Luczak, R.: Truncation error in grid generation: a case study. Numer. Meth. Part. Dif. Eq. 11, 561–571 (1995) 10. Azarenok, B.N.: Generation of structured difference grids in two-dimensional nonconvex domains using mappings. Comput. Math. Math. Phys. 49(5), 797–809 (2009) 11. Azarenok, B.N.: On 2D structured mesh generation by using mappings. Numerical Methods for Partial Differential Equations. Wiley InterScience, Hoboken (2010), www.interscience.wiley.com, 10.1002/num.20570 12. Thompson, J.F., Thames, F.C., Mastin, C.W.: TOMCAT - a code for numerical generation of boundary-fitted curvilinear coordinate systems on fields containing any number of arbitrary two-dimensional bodies. J. Comp. Phys. 24, 274–320 (1977) 13. Spekreijse, S.P.: Elliptic grid generation based on Laplace equations and algebraic transformations. J. Comput. Phys. 118, 38–61 (1995)
48
B. Azarenok
14. Ivanenko, S.A.: Control of cell shape in the construction of a grid. Comput. Math. Math. Phys. 40(11), 1596–1616 (2000) 15. Sidorov, A.F., Shabashova, T.I.: On one method of computation of optimal difference grids for multidimensional domains. Chisl. Metody Mechaniky Sploshnoy Sredy. 12, 106–123 (1981) (in Russian) 16. Steger, J.L., Sorenson, R.L.: Automatic mesh-point clustering near a boundary in grid generation with elliptic partial differential equations. J. Comp. Physics 33, 405–410 (1979) 17. Kaul, U.K.: New boundary conditions for elliptic systems used in grid generation problems. J. Comp. Physics. 189, 476–492 (2003) 18. Boehm, W.: B´ezier presentation of airfoils. Computer Aided Geometric Design. 4, 17–22 (1987)
A Transfinite Meshing Approach for Body-In-White Analyses Kirk Beatty and Nilanjan Mukherjee Meshing and Abstraction Group Digital Simulation Solutions Siemens PLM Software 2000 Eastman Dr., Milford, Ohio 45150 USA
[email protected],
[email protected]
Summary. A very wide range of finite element analyses required to design car-bodies calls for quadrilateral meshes with austere quality needs. Quadrilaterals being varying strain and non-planar, element quality, in body-inwhite analyses, is virtually impossible to measure with a single parameter. Auto-designers mostly prefer heuristic element quality metrices that catapult the need for predominantly orthogonal meshes. Transfinite or “mapped” meshing thus assumes great importance. The present investigation presents a holistic transfinite meshing approach for body-in-white analyses involving groups of tessellated faces. A new corner detection algorithm is proposed. The concept of “pseudo-edges” is introduced to cluster face edges into four logical sides. “pseudo-edge-clans” are next formed for the purpose of count propagation that does not require traditional LP solves. In the meshing process, we use 2D domain generation from a 3D tessellation at two steps. During corner determination we use a least squares conformal map with free boundaries to find boundary angles in 2D. After pseudo edges are identified, 2D domain for meshing a face is generated using a constrained rectangular boundary. In this second use of our domain generation method, we make use of a mapping type parameter which varies from conformal (angle preserving) solution to an authalic (area preserving) map. Based on practical examples, the best value for the mapping type parameter for the second domain generation step was found to be about 0.7. We present several results to illustrate our process of meshing for body-in-white analyses. Keywords: transfinite, mapped, flattening, pseudo-edge, Guru edge, Protege edge, count propagation, corner detection, parameterization, quadrilateral, mapping type parameter, least squares conformal map.
1 Introduction Transfinite or mapped meshing continues to be of prime importance for automotive body-in-white analyses. Competitive fuel efficiency needs and
50
K. Beatty and N. Mukherjee
stringent vehicle safety requirements have made carbody design a crucial step of automotive design over the years. Body-in-white analyses are done with quadrilateral elements. Quadrilaterals are varying strain and fundamentally non-planar finite elements and thus their quality for a wide range of analysis requirements cannot be measured by a singular parameter. Most car companies use proprietary heuristic quality metrices to evaluate the element quality of finite element meshes of their body panels. Consequently, transfinite or “mapped” meshing that produces structured orthogonal meshes has gained enormous importance over time. A typical body panel component involves hundreds of surfaces more than half of which are single loop and logically four-sided. In order to generate a mapped or transfinite mesh on them, the global problem of distributing element counts on the four logical sides of all map-meshable surfaces needs to be addressed. This involves determination of the three or four corners of the surface, construction of the logical sides and an effective count distribution strategy to solve the problem in a global scale. In the case of a mapped mesh an important criterion for quality is the angles for the quad elements (90 degrees is desirable). Our approach for creating a mapped mesh is to find a 2D parameter space from the 3D tessellation, create a 2D mesh on this domain, then transform the mesh back to the original 3D surface. One might think that the best type of domain to preserve angles in a quad mesh is a conformal, or angle preserving map. But this is not necessarily so! Conformal maps map circles to circles and squares to squares in the infinitesimal. But often we want to allow the mapping of (especially finite size) squares to rectangles as this preserves our 90 degree angles. So it is quite possible other types of maps will perform better for this purpose.
2 Past Research Transfinite meshing is a relatively simplical and well-defined meshing problem that, for singular NURBS geometry, has been thoroughly investigated. However, the amount of research material available in the field of setting up transfinite meshing problems in a global scale is rather limited. Tam and Armstrongs [9] findings are probably the earliest in this field closely followed by Mitchells corner detection [5] and element assignment algorithms [4]. The above approaches targetted NURBS geometry and dont cater very well to all of the complex needs of body panel meshing. Golpalsamy et al. [4] parameterized facetted surface patches for structured meshing. They suggested more work was needed to assess the quality of the results using different parameterizations. Ryskin and Leal [8] addressed the importance of non-conformal maps for structured grid generation. The inability of the LP solve [6, 10] to efficiently and intelligently handle both over-constrained and large problems severely limits the robustness desired to handle body panels. The stringent and diverse quadrilateral quality needs for the wide range of structural and flow analyses performed on body panels add additional complexities. We are
A Transfinite Meshing Approach for Body-In-White Analyses
51
not aware of any report on a complete transfinite meshing approach for bodyin-white analyses.
3 Transfinite Meshing Approach First we give an overview of our transfinite meshing process. The body panels to be meshed are characterized by tessellated surfaces. Each tessellelated surface could be derived from one or more CAD mid-surfaces or other source. Facetted Surfaces with more than one loop are automatically ruled out for transfinite meshing. Our meshing method first requires a procedure to first create a 2D domain for identifying corners of surfaces. A Least Squares Conformal Map type flattening method [1] is used to lay down the 3D surfaces on 2D. Four facet-vertices are identified as corners such that the 4-sided 2D shape produces a Jacobian closest to that of a rectangle of the given corner combinations. Once the corner facet-vertices are identified for each map-meshable face, “pseudo-edges” are constructed for each surface. A pseudo-edge is conceived as a face-bound pseudo-topological entity that represents each side of the 3 or 4 sides of a map-meshable face. The pseudo-edges of all map-meshable surfaces are next clustered into pseudo-edge-clans. Some of these clans have common sub-members [part or whole of a pseudo-edge] while others are not. These colliding clans are merged, collapsed if necessary and prioritized according to their content. An element count propagation algorithm is applied to ensure counts match up on the opposite pseudo-edges for each surface. Instead of traditional LP solve strategies, a new, more user-controlled, semiautomatic, corrector-constrainer solution technique is proposed as a system solution. Associated with the facetted face there is a topology which includes loops and edges. This topology is an important component of our meshing process, which in turn puts requirements on our flattening procedure. The facetted faces consist of triangles defined by facet vertices. The facetted faces to be flattened have loop and edge topology. The edges are defined on edges of facets. The edges can be both on the exterior and interior of the 3D face. Once the face corners are identified and pseudo-edges are constructed, the corner/edge information is used as constraints to solve the domain generation problem. A transfinite mesh is generated in the 2D domain and transformed back to the 3D facetted surface. Many of the details of closely related automated meshing procedures using faceted surfaces have been reported on previously by us and our coworkers. [2, 11, 1].
4 Corner Detection The first task is to identify a polygonal face with a given topology as a map-meshable face. This involves the identification of the 4 corners. Mitchell [5] proposed a practical angle-based approach weighted by other factors.
52
K. Beatty and N. Mukherjee
However, the eventual quality of the mapped-mesh is a strong function of shape-factor (implying orthogonality) of the area. A 4-sided shape closest to that of a rectangle is the most desired configuration. Consider the discretized surface shown below in Figure 1.
Face
(a)
e1
e6
e2 Face
e5
e3 e4 (b)
e2 PE2
PE1 e1 e6 Face
e3
PE4 e5
e4 PE3 (c)
Fig. 1. (a) An m-sided (m facet vertices) CAD derived polygonal surface. (b) Surface with n potential corner vertices and n geometry edge (here n = 6). (c) Surface bounded by 4 pseduo-edges.
Figure 1(a) shows the m facet vertices [m = 9 for this particular face]. Figure 1(b) shows the n CAD-derived edges [n = 6 in this case]. Only geometry vertices are candidates for corners. First, the (2D) included angles, φi , of all n vertices are measured. To find angles in 2D, we solve for facet vertex positions in 2D using a least squares conformal map with free boundaries. A conformal (angle preserving) map solution is a special case of the Weighted Edge Flattening Method (WEFM),[1] where the mapping type parameter, S, is zero. Note it is not necessary to have a 1-1 map as we are interested in angles at the boundary only. So overlaps are quite acceptable as shown in the flattening of a helix shown in Figure 2. The original 3D triangulation is
A Transfinite Meshing Approach for Body-In-White Analyses
53
Fig. 2. On the left is the boundary of a conformal map of a 10 twist helix. Facet vertices near corners of of the surface are marked with triangles and squares. The map mesh of the helical (facet based) surface is given on the right. The final 2D domain for meshing the helix is a rectangle based on pseudo-edges.
sufficiently dense that the corners are readily identifiable. (Usually very few of the facet vertices are possible corner candidates because we make use of edge definition data from the CAD geometry.) A conformal flattening method gives a 2D domain where the the angles between facet edges can be used for the determination of corners. Potential vertices are segregated based on the following heuristics, Vn ≈ 90 − α ≤ φi ≤ 90 + α f or i = n
(1)
180 − β ≤ φp ≤ 180 + β
(2)
where α and β are variable angles in degrees [ 10 ∼ 15 deg.]. The problem is now reduced to a smaller subset of n corners. Any 4 of these n corners are selected and the largest slope deviation of the curves running between them is computed (using the other vertices). These locations are used as mid-points. Curve C = f (x, y, z) Slope of the curve at location i is given by ∂C∂x ∂C∂y ∂C∂z Si (x, y, z) = ∂C/∂S = + + (3) ∂x∂s ∂y∂s ∂z∂s s represents the curve parameter The mid-point must satisfy the following criteria Smid−point = Smax . Now the 8-corner surface is mapped to square or a rectangle in a planar parabolic isoparametric coordinate (ξ, η) system as shown in Figure 3. The shape functions for a 8-noded isoparametric shape is given by Ni = 0.25(1 + ξi ξ)(1 + ηi η)(ξi ξ + ηi η − 1) i = 1, 2, 3, 4
(4)
Ni = 0.5(1 + ξi ξ)(1 + ηi η)(1 − ξ 2 ηi 2 − ξi 2 η 2 ) i = 5, 6, 7, 8
(5)
54
K. Beatty and N. Mukherjee K (-1,1)
(1,1) [
Face (-1,-1)
(1,-1)
Fig. 3. Left diagram is with 4 corners and mid-points identified. On the right is the related isoparameteric coordinate system.
For the shape to be closest to a rectangle/square, the Jacobian Ratio Jr ( a normalized Ratio; 0 ≤ Jr ≤ 1.0 ) of the surface must be as close to 1.0 as possible. In other words, The problem is to determine the corner set that minimizes shape distortion functional λ, where λ = (1.0 − Jr ) and the Jacobian ratio Jr is defined by
Jmin ΣNi,ξ Xi ΣNi,η Xi Jr = and J = Jacobian = (6) ΣNi,ξ Yi ΣNi,η Yi
Jmax where i = 0, 4 and Xi , Yi are the transformed coordinates of the 2D domain at node i such that ⎧ ⎫ ⎨X ⎬ X = [T ] Y (7) Y ⎩ ⎭ Z where [T] is the transformation matrix. The efficiency of this method depends on the number of candidate corners n. The number of combinations to be measured is O( n C4 ) . O( n C4 ) < O(n2 ) ; n ≤ 7
(8)
So when we have 8 or more candidate vertices, this is not an efficient method. However, a face with 8 or more candidate vertices is unlikely to be mapmeshable.
5 Pseudo Topology A known approach, as described by Mitchell [5] and Armstrong and Tam [9], to the problem of assigning element counts to geometric edges is to set up constraint schemes on edges so as to result in a linear integer program which
A Transfinite Meshing Approach for Body-In-White Analyses
55
is solved by using LP solves [10]. The success of this approach is limited by the size of the problem. The LP solve becomes inefficient and lacks the robustness necessary to deal with thousands of surfaces. In many cases, problems are ill-defined in the sense that a solvable system cannot be set up. Requiring map-meshes on all surfaces can lead to no solution or poor quality meshes. To avoid these problems, a more controlled corrector-constrainer solution scheme is proposed that requires a pseudo topology. As a result, for certain problems free meshes are chosen for a select few surfaces. After faces that are 4-sided and thus candidates for transfinite (map) meshing, are identified, the problem needs to be set up in a global sense for proper interval assignment on the edges. To achieve this, the concepts of pseudo-edge and edge clan are introduced. A pseudo-edge is conceived as a face-bound pseudo-topological entity that represents each side of the 3 or 4 sides of map-meshable face. Therefore, one or more geometry edges that form each side of the face between two corners as shown in figure 1. A face has loops formed by CAD-derived geometry edges. The face-loop can now also be defined by these face-bound pseudo-edges. These edges are not strictly Euler-edges. Each pseudo-edge has members which are real geometric Euler edges shared across faces. The pseudo-edges are not directly shared across faces. The solid lines depict topological relationships, while the dotted lines mean non-topological relationships [Figure 4]. Many pseudo edges can be related to one another by requirements of element counts. A group of such pseudo-edges will be refered to as an “edgeclan”. There can be conflicts in the requirements of different edge-clans, a problem which is considered in the next section.
PseudoEdge1
PseudoEdge2
Face
PseudoEdge3
Loop
Edge1
PseudoEdge4
Edge2
Edge3
Edge4
Edge5
Edge6
Fig. 4. The pseudo-topological relational model
6 Pseudo-edge Hierarchy The pseudo-edge has a relational hierarchy with respect to the geometry edges and the edge clan to which it belongs. To explain this, let us consult
56
K. Beatty and N. Mukherjee
Fig. 5. Pseudo-edges for a 7-face assembly
the example depicted in Figure 5. A group of 7 map-meshable faces [F1-F7] are shown with their pseudo-edges [pe1-pe28]. 8 edge clans [EC1-EC8] are set up with these pseudo-edges as listed in Table 1. When some more interclan relationships are defined, intra-clan conflicts resolved, an element count (seeding) can be applied to the edge-clan system, thereby solving the present problem of element count distribution so as to ensure that transfinite meshes can be generated on all faces in the assembly. 6.1
Pseudo-edge Classification
Pseudo-edges are classified into a number of categories depending on how they are prioritized and treated. Guru Edge. A pseudo-edge that decides the element seeding of a clan. The prot´eg´e or follower edges follow the seeding of the Guru. In some special cases of constraint conflict, a follower-edge may not follow the Guru. In Figure 5, pe2 of edge-clan EC1 is a typical Guru pseudo-edge. Prot´ eg´ e Edge. A secondary member of the edge clan that follows or obeys the element seeding of the Guru. Within the context of a face, the prot´eg´eedge is usually the pseudo-edge that is opposite the Guru pseudo-edge. In edge-clan EC1, pe1 is a typical prot´eg´e pseudo-edge of Guru edge pe2 (for face F1).
A Transfinite Meshing Approach for Body-In-White Analyses
57
Shadow Edge. Pseudo-edges that share children geometry-edges. In Figure 5, pe6 and pe9 are shadow-edges and they carry the same member geometry-edge. Shadow edges do not partially overlap. When they share the same children, they are simply called Sister Shadow Edges. Implicit Shadow Edge. A pseudo-edge that own less geometry edges than its explicit shadow pseudo-edge. pe26 is an implicit shadow edge of pe2. Explicit Shadow Edge. A pseudo-edge that owns more geometry-edges than its implicit shadow pseudo-edge. pe2 is an explicit shadow edge of pe26 and pe27. Mirror Edge. A pseudo-edge that belongs to the same face as another pseudo-edge and is directly opposite to it. They need to have the same element seeding in order that the face map-meshes. Usually one of them is a Guru and the other is a Prot´eg´e-Edge. pe12 is the mirror edge of pe11 (face F4 in Figure 5) and vice versa. Mirror and Shadow edges are used to walk the surfaces.
Table 1. List of Edge Clan and their Members
Edge Clan Members Guru Pseudo-Edge Clan Conflict EC1 pe1, pe2, pe5, pe6, pe9, pe2 -pe with most EC8,EC7 pe10, pe11, pe12, pe13, sub-edges pe14, pe15, pe16, pe17, pe18 EC2 pe3, p4 pe3 EC3 pe7, pe8 EC4 pe19, pe20 pe19 or pe20 EC5 pe22, pe21 pe21 EC6 pe23, p2e24 pe23 or pe24 EC7 pe26, pe25 pe26 -implicit shadow edge EC8 pe27, pe28 pe27 implicit EC1 shadow edge EC1
6.2
ALGORITHM I: Resolving Pseudo-edge Clan Conflict
Once the pseudo-edge clans are constructed, we realize that some of them can run into conflict with the others with respect to the element count. To resolve the clan conflict, a merge-logic is used as described by the flowchart given below.
58
K. Beatty and N. Mukherjee
Input Clan X and Y
Do both Clans have frozen members?
N
Y Don’t assign elements to conflicting members
N
Do frozen members have same elem count?
Remove conflicting members from ClanY
Y Merge Clans
Clan X
Clan Y Fig. 6. Algorithm I. Resolving Clan Conflict
7 Element Count Propagation In order to propagate element count to surfaces, the pseudo-edge clans need to be count-constrained. The task begins with prioritizing the pseudo-edge clans. A procedural heuristic algorithm used to prioritize them is described below. 7.1
ALGORITHM II: Prioritizing Clan Constraint Propagation
1. Select clan with longest frozen (completely) edge 2. If no frozen (completely) edges are found, consider clan with longest partially frozen pseudo-edge. A partially frozen pseudo-edge is one that has nodes on some of its member edges but not on all. 3. If no frozen (partially) pseudo-edges are found, consider clan with shortest pseudo-edge. 4. If two or more clans have the same shortest member length, consider the clan with more members. 5. If two or more clans have the same size (i.e. same number of members), the clan with the largest composite face takes precedence. Once clans are prioritized, they are visited in sequence and an element count is applied to each. The determination of the element count is based on the most
A Transfinite Meshing Approach for Body-In-White Analyses
59
influential member of each clan, referred to as the Guru edge. A heuristicdeterministic procedural algorithm for the identification of the Guru pseudoedge is described below. 7.2
ALGORITHM III: Determination of Guru Pseudo-edge
1. The most constrained edge in a clan is the default choice. 2. If no constraints are present, consider the pseudo-edge that has the most number of children. 3. If more than one pseudo-edge has the same number of children (explicit pseudo-edges of the same degree), consider the longest edge among them. 4. As for the Prot´eg´e-edge, it will not follow the Guru if • It is too short or too long compared to the Guru • If its children mesh-edges are incompatible • If it has more children than the specified interval • If it has more hard-points than the specified interval • If is too curved for the given interval Once the Guru edge is identified, an element count is determined on it based on the element size specified and the presence of local constraints (like frozen edges, mesh-points etc.), if any. The same element count of element interval is now assigned to all the other members (prot´eg´e members) of the clan. The algorithm used to assign the intervals on each pseudo-edge is described below. 7.3
ALGORITHM IV: Interval Assignment on a Pseudo-edge
To distribute an interval of N elements on a pseudo-edge comprising m geometry edges, the following equations are used ni = (N − k)Wi
i≥1
(9)
ni denotes the sub-interval on geom-edge i. Wi denotes the weight factor for geom-edge i and can be expressed as Wi =
Li m−p
(10)
Li
i=1
where Li denotes the length of geom-edge i. This assumes the pseudo-edge is partially frozen, with k intervals on p edges. For a free pseudo-edge p = 0, k = 0. 7.4
ALGORITHM V: Corrector-Constrainer Solution
Once all non-conflicting edge clans (EC2-EC6) are element assigned based on ALGORITHM-III and ALGORITHM-IV to the data in Figure 5 and
60
K. Beatty and N. Mukherjee
Fig. 7. Section of Figure 5 showing 3 faces, their geom-edges, pseudo-edges and the overlapping and edge-clan conflicts
Table 1, the problem is reduced to the pseudo-edge and edge clans connected with faces F1, F6 and F7. Figure 7 describes the reduced problem in terms of geom-edges e1-e3 and pseudo-edges pe1, pe2, pe26 and pe27. A constraint equation in matrix form can be set up and rearranged as {Ω} = |Aij |{ρj }
(11)
where positive integers, denote the counts on i pseudo-edges positive integers, denote the counts on j geom-edges and [Aij] is a binary matrix, usually unsymmetric but positive definite Equation 6 for the reduced problem described in Figure 7, can be thus written as ⎫ ⎡ ⎧ ⎤ 110 ⎧ ⎫ Ω2 ⎪ ⎪ ⎪ ⎪ ⎨ ρ1 ⎬ ⎬ ⎢ ⎨ 1 0 0⎥ Ω26 ⎥ ρ2 =⎢ (12) ⎣0 1 0⎦⎩ ⎭ Ω27 ⎪ ⎪ ⎪ ⎪ ρ3 ⎭ ⎩ 001 Ω1 where {Ω} = {Ω2 Ω26 Ω27 Ω1 } denote the counts on pseudo-edges pe2, pe26, T pe27 and pe1 and {ρ} = {ρ1 ρ2 ρ3 } denote the counts on geom-edges e1, e2 and e3. The known constraints in this system are Ω1 and ρ3 . Equation (11) can be underconstrained, balanced or overconstrained. For the latter case it cannot be solved and thus the related faces are free-meshed. If the system is underconstrained, the matrices are permuted or corrected according to clan priority and one unknown count is determined by solving one equation at a time. Missing constraints or edge counts are imposed. These counts are determined based on element size, neighboring counts, minimum element size etc. Each solve reduces the resultant matrices by a dimension of one. The new matrices are again corrected (permuted) based on clan priority and the process is repeated until all unknown variables are solved or an over constrained system, which cannot be solved, is reached. By employing this corrector-constrainer solution scheme, any ill-condition or overconstraint, if present, is relegated to an area of low interest or relative unimportance. Figure 8 shows a transfinite mesh on a small cluster of 13 faces similar in disposition to Figure 5.
A Transfinite Meshing Approach for Body-In-White Analyses
61
Fig. 8. Map mesh on a small group of faces
8 Surface Flattening Methodology for Transfinite Meshing To mesh a three dimension (3D) surface composed of triangles which is bounded by four pseudo edges we first map it to a two dimensional (2D) domain. In this process we use the Weighted Edge Flattening Method (WEFM) [1] with constraints and parameters especially adapted for transfinite meshing. In the WEFM, a vertex in a polygon is associated with two parameters for each edge of the polygon to which it does not belong. In the case of a linear triangle, each vertex has one (opposite) edge for each triangle in which it resides. The first parameter, α, corresponds to a location along the polygon edge. The second parameter, β, relates to a geodesic distance from the point along the (possibly continued) polygon edge to the vertex divided by the length of the edge. Using this 3D characterization, it is possible to find a full range of different 2D solutions. In the WEFM the type of solution is tied to a mapping type parameter, S, which varies from 0 in the conformal (angle preserving) case to 2 in the authalic (area preserving) case. In the WEFM the target location of a vertex based on the α and β parameters of an opposite edge, h, is: Zh = Ph (α) + βTh (α)(ρh )S i
(13)
where P is for position along the polygon edge and T for evaluation of the tangent in 2D. Z is a vertex position in the complex plane. ρh is a scaling for 3D to 2D along the polygon edge, ρh =
|Th,3D (α)| |Th,2D (α)|
(14)
In our previous paper we presented a simplified version for linear triangles.[1] The WEFM minimizes the sum of the least square distance between the positions of vertices and their (weighted) average target positions. For transfinite map meshing the boundary of the domain was constrained to form a rectangle. For each pseudo edge we set its 2D length to the average of the 3D
62
K. Beatty and N. Mukherjee
length of it and its opposing pseudo-edge. We then scaled all of the pseudo edges so that the area of the rectangle in the 2D domain is the same as the area of the 3D triangulation. One pseudo-edge is constrained to be along the x-direction by setting the difference between facet points between facet edge to its new scaled distance. The next pseudo-edges (of the loop) are in the Y direction, then the X direction, then the Y direction. All facet point positions are variables in the solve, and the differences in position are on the right hand side of the solve. Since the constraints are all with vectors, the solution is not unique. To eliminate the translation degree of freedom we add a constraint based a weighting of the points. This procedure, based on Lagrange multipliers, is described in our previous paper. [1] This vector based approach is more flexible than directly fixing the boundary.
Fig. 9. Transfinite mesh of wheel well surface using S = 0.7
The WEFM was used for a 3D triangulation for the surfaces depicted in figures 2 and 9. (The surfaces are presented with the final mesh, not the original 3D facets.) The WEFM map for the surface in figure 9 with S equal to 0 is shown in figure 10. The WEFM map for S equal to 0.7 is shown in figure 11. (The figures are rotated relative to figure 9 for easier comparison to one another.). For both the helix and wheel wheel the final map meshes ( figures 2 and 9) are based on the 2D domains using a mapping parameter value of 0.7. We used an S value of 0.7 for our transfinite meshing process as discussed in the results section of this paper.
9 Transfinite Meshing Algorithm Boundary blended Coons blending functions are traditionally used to generate transfinite or mapped meshes on the flattened 2D domain. [3] The algorithm is standard and is discussed in details in a previous investigation. [7] Presence of constraints, (both internal and external) however, pose challenges to the transfinite blending algorithm requiring inverse-solves and leads to anisotropic transfinite meshes. Much of this is outside the scope of this investigation and has been [7] (and will be) reported separately.
A Transfinite Meshing Approach for Body-In-White Analyses
63
Fig. 10. WEFM map of the wheel well surface with S = 0.0
Fig. 11. WEFM map of the wheel well surface with S = 0.7
10 Results and Discussion Among other quality metrices, the deviation of the extremum quad angle from 90 degrees is often used in the automobile industry to measure the quality of quad meshes for body-in-white analyses. Figure 12 shows the effect of the mapping type parameter, S , on the maximum quad angle for the surface meshed in figure 9. Results for a section of a torus which is a more typical surface in our process are also given. For our transfinite meshing process we chose a value of 0.7 for the mapping type parameter, a value which was nearly optimal for the surfaces we normally encountered. In cases where the elements of the mapped mesh are very small relative to the size of the facets, a WEFM based parabolic triangles or quadrilaterals could be used. Such a map would have a smooth transition in map scaling within the boundaries of the parabolic facets/polygons. Figure 13 shows a cluster of 135 single-loop faces of a body panel, all map-meshed. The extremums of the quad angle for the mesh are 69 degrees to 148 degrees with 98.82% of the elements maintaining a quad angle range of 83 to 98 degrees.
64
K. Beatty and N. Mukherjee
104
Maximum Quad Angle (degrees)
102 100 98 96 94 92 90 0
0.2
0.4
0.6
0.8
1
Mapping Type Parameter S
Fig. 12. Maximum quad interior angle (in degrees) for different WEFM mapping type parameters. Results from the surface meshed in figure 9 are given as squares. Results from a section of a torus are given with circles.
Fig. 13. Tranfinte mesh spanning 135 faces on part of a body panel
Acknowledgement We would like to thank Michael Hancock and all our colleagues in the Meshing and Abstraction Team at Siemens for their help with this work.
References 1. Beatty, K., Mukherjee, N.: Flattening 3d triangulations for quality surface mesh generation. In: Proceedings 17th International Meshing Roundtable, pp. 125–139 (2008)
A Transfinite Meshing Approach for Body-In-White Analyses
65
2. Cabello, J.: Towards quality surface meshing. In: Proceedings 12th International Meshing Roundtable, pp. 201–213 (2003) 3. Faux, I.D., Pratt, M.J.: Computational Geometry for Design and Manufacture. Halsted Press, New York (1979) 4. Gopalsamy, S., Ross, D.H., Ito, Y., Shih, A.M.: Structured grid generation over nurbs and facetted surface patches by reparameterization. In: Proceedings 14th International Meshing Roundtable, pp. 287–300 (2005) 5. Mitchell, S.: Choosing corners of rectangles for mapped meshing. In: Proceedings 13th annual symposium on Computational Geometry, pp. 87–93 (1993) 6. Mitchell, S.: High fidelity interval assignment. In: Proceedings 6th International Meshing Roundtable, pp. 33–44 (1997) 7. Mukherjee, N.: High quality bi-linear transfinite meshing with interior point constraints. In: Proceedings 15th International Meshing Roundtable, pp. 309–323 (2006) 8. Ryskin, G., Leal, L.G.: Orthogonal mapping. Journal of Computational Physics 50, 71–100 (1983) 9. Tam, T.K.H., Armstrong, C.G.: Finite element mesh control by integer programming. International Journal for Numerical Methods in Engineering 36, 2581–2605 (1993) 10. Simple LP solve site (June 2010), http://riot.ieor.berkeley.edu/riot/Applications/SimplexDemo/ Simplex.html 11. Vurputoor, R., Mukherjee, N., Cabello, J., Hancock, M.: A mesh morphing technique for geometrically dissimilar tesselated surfaces. In: Proceedings 15th International Meshing Roundtable, pp. 315–334 (2007)
This page intentionally left blank
Introducing the Target-Matrix Paradigm for Mesh Optimization via Node-Movement Patrick Knupp Sandia National Laboratories
[email protected]
Abstract. A general-purpose algorithm for mesh optimization via nodemovement, known as the Target-Matrix Paradigm, is introduced. The algorithm is general purpose in that it can be applied to a wide variety of mesh and element types, and to various commonly recurring mesh optimization problems such as shape improvement, and to more unusual problems like boundary-layer preservation with sliver removal, high-order mesh improvement, and edge-length equalization. The algorithm can be considered to be a direct optimization method in which weights are automatically constructed to enable definitions of application-specific mesh quality. The high-level concepts of the paradigm have been implemented in the Mesquite mesh-improvement library, along with a number of concrete algorithms that address mesh quality issues such as those shown in the examples of the present paper.
1 Motivation A significant fraction of modeling and simulation software provides numerical solutions to partial differential equations via discretization methods. Not only do the equations themselves need to be discretized, but so does the domain on which the problem is defined. PDE software often uses mesh generation for this task. Sometimes the meshes are generated off-line before the PDE simulation and sometimes the meshes are generated dynamically or adaptively as the calculation proceeds. In either case, the quality of the mesh is an important consideration because poor quality can impact accuracy, efficiency, and in the worst case, can invalidate or prematurely terminate the calculation. There are a variety of mesh generation methods, some giving better quality than others, depending upon the circumstances. Unstructured hexahedral mesh generation is probably the least successful in terms of guaranteeing quality, but tetrahedral and structured methods can also create meshes with quality issues. As a result, a considerable number of post-processing techniques have been devised to improve the quality of an existing mesh. Some of these methods change mesh topology, some change mesh vertex positions,
68
P. Knupp
and some change both. Because the methods for changing mesh topology and for changing vertex positions are quite different, it is wise, in the interest of progress, to investigate the best possible technologies in each of these areas, both separately and together. In the present work, a new paradigm for changing mesh vertex coordinates via numerical optimization is described. The Target-matrix Paradigm has evolved gradually over the past four years; forerunners of the paradigm can be found in [25], [26], and [27]. With funding provided by DOE’s Office of Science, the Paradigm has in the last four years been formalized and has undergone rapid elaboration to ensure that it is well-formulated, complete, and powerful. Unfortunately, there is not space in this paper to describe all of the mathematical details in the Paradigm; this is done elsewhere in a series of reports spanning over two hundred pages [16][24].1 Development of the Paradigm is on-going, with additional emphasis now on demonstrations of its capabilities [28]. Our purpose in this paper is to acquaint the reader with the basic motivation for the Target-matrix Paradigm (this section) and with the high-level concepts it entails (next section). To illustrate the potential of the paradigm, this paper ends with some examples of canonical problems to which it has been applied, with some success. Our research into mesh quality optimization takes into account several aspects of the mesh quality problem, beginning with the fact that the nodemovement algorithms are intended to be permanent fixtures in the Mesquite mesh quality software library [1]. Since Mesquite must be able to deal with a wide variety of mesh types (e.g., structured, unstructured, 2D, 3D, surface, simplicial, non-simplicial, hybrid, meshes with hanging nodes, polygonal or polyhedral elements, and/or high-order nodes), we seek algorithms that are largely independent of mesh type. This avoids having to write a lot of special case code. Moreover, Mesquite must also be able to handle a wide variety of meshing contexts (e.g., as a stand-alone post-processor, as a library linked to either mesh generation software or to a physics application code, both serial and parallel mesh optimization, meshes with or without associated geometry, and so on). It is thus desirable that the optimization algorithms be transparent to these contexts, as far as possible. It is not claimed that the present algorithms (or the Mesquite software) have fully addressed all these mesh types and contexts as yet, but rather that these requirements have been kept in mind during the course of the research and that this has already enabled mesh optimization in a wider variety of contexts than has been previously achieved. Example 3.4, given later in the paper shows, for instance, that it is possible using the new approach to smooth meshes consisting of quadratic finite elements. The draw-back to all this flexibility, of course, is that the implementations in the Mesquite code, while efficient, are not as efficient as they could be if they were to address only a single mesh type or a single context. However, flexibility is consistent 1
Eventually these reports will become either archive journal papers or part of a monograph on mesh optimization.
Introducing the Target-Matrix Paradigm
69
with Mesquite’s dual mission to serve both as a vehicle for mesh optimization research and as a mesh improvement service for applications. In the latter case, it is convenient to have Mesquite available so that potential solutions can be tried quickly. If a Mesquite algorithm proves successful on the application problem, one can either accept the inefficiency and move forward (this happens surprisingly often), or, one can re-code the particular algorithm in their own code, in a more efficient, but less flexible manner (this is possible since Mesquite is open source and because many of its algorithms are or will be documented in various publications). Because meshes are used in many different physical applications such as heat transfer, fluid dynamics, structural mechanics, electro-magnetics, and many others, mesh quality issues can arise within each of these areas. Thus, mesh optimization is a cross-cutting technology in the sense that it can be applied to all of these areas, often with good effect. At the same time, mesh optimization is not a monolithic technology in the sense that there is only one mesh quality issue or only one issue that can potentially be addressed. In fact, mesh optimization can and has addressed a variety of mesh quality issues, either separately or together. For example, while each of the applications mentioned above may benefit from ‘shape improvement,’ they may also benefit from mesh optimization algorithms having different purposes such as ‘smoothness’, size-adaptivity, anisotropic-adaptivity, mesh updating on deforming geometric domains, ALE rezoning, sweep-smoothing, and other such canonical mesh quality issues. Thus, a second aspect of mesh quality that this research considers is how to address the wide variety of canonical mesh quality issues via mesh optimization techniques, within a unified paradigm. Finally, it is evident from the previous paragraphs that to address all of these mesh types, contexts, and canonical problems within a single code such as Mesquite could potentially create a disparate collection of algorithms and data structures, resulting in both a maintenance headache and considerable conceptual uncertainty as to how the algorithms are related, not to mention whether they are all well-posed. The third aspect of this research is thus to alleviate this problem by developing and analyzing a mathematical framework for mesh optimization that develops this subject systematically, and in full generality, so that one has a coherent way of thinking about many of these contexts and problems. Moreover, the framework should enable relatively rapid delivery of solid new algorithms as they are needed. The framework that we propose is called the Target-Matrix (Optimization) Paradigm (or TMOP for short)2 As one might guess from the name, certain matrices called ’targets’ play a central role in the theory. The Target-Matrix Paradigm is closely related to the class of mesh optimization methods known as ’direct methods’. A ’direct optimization’ method is one in which the formulation is made directly in terms of quantities 2
Regrettably, the natural acronym for the Target-matrix Paradigm is TMP, which has the connotation of temporariness, which we hope is not the future of this method.
70
P. Knupp
representing mesh entities: length of edges, area/volume of elements, angles, and so on. Examples of other direct methods include [2], [3], [4], [5], and [6], among others. In contrast, indirect mesh optimization methods are formulated in the continuum, such as variational grid generation and partial differential equation methods (e.g., [7], [8], [9], [10]). There are some advantages to the direct methods which have attracted our attention to this approach. In practice, meshes are never taken to the limit of the continuum; one is always working with entities in a finite dimensional space. This suggests that one construct mesh optimization theories in the space in which the mesh itself lives. Moreover, finite dimensional spaces are much easier to deal with in mathematics than with infinite dimensional spaces; therefore theoretical progress can sometimes be much faster in the former case. As another consideration, while some indirect methods have associated proofs that show the solutions to the continuum equations give mappings which are everywhere invertible (and this is an excellent result) it does not necessarily mean in practice that the finite dimensional meshes that one works with will be non-inverted, because the proof only holds in the asymptotic limit [11]. On the other hand, if an analogous result were to be proved in a finite dimensional space, such as that provided by direct methods, then it would apply to the meshes that are used in practice. Although TMOP can be classified as a direct method, it differs strongly from other direct methods in that it aims at the full spectrum of mesh types, contexts, and canonical problems. As will be seen in the next section, to address this need for flexibility, TMOP has a number of unique features. The term ’paradigm’ is used here in the sense that a certain world-view or way-of-thinking about mesh optimization is taken that involves the use of Target-matrices to describe the optimal mesh. This approach is considerably different from other direct node-movement methods which, for the most part, have failed to fully exploit the idea of target or weighting functions.3 However, there are other optimization methods which can be considered paradigms in the same sense as we use here. Most of these other paradigms come from early papers on the Indirect Methods. Prime examples of other mesh optimization paradigms include Harmonic Maps [13], the elliptic grid generators [14], and Laplace-Beltrami systems [15]. The idea in each of these paradigms is the same: address a variety of canonical mesh quality issues within a single theory, through the use of weighting functions, scalars, and/or matrices. The emphasis in all these paradigms is not on quality metrics (they primarily use only one metric), but on the construction of the weighting functions. TMOP uses the same idea, but differs from these other paradigms in several respects. First, TMOP is a direct method, so that the results hold on discrete meshes, not just in the asymptotic limit. Second, the method is transparent to mesh type. Third, the theory of target-matrix construction is well-developed in TMOP and contains some new ideas on how to do the constructions. Since 3
There also exist methods of mesh adaptation via mesh modification which use metric tensor weightings (see [12] for a general discussion).
Introducing the Target-Matrix Paradigm
71
many of the older paradigms were proposed prior to unstructured meshing, and prior to advances in computer science, they are somewhat out of date with respect to current meshes, contexts, and canonical problems. In contrast, TMOP addresses many mesh quality issues in a modern setting.
2 Review of the Target-Matrix Paradigm The present section constitutes an introduction to the high-level concepts of TMOP, their purpose, how they are related, and how they meet the need for flexibility. As in the Finite Element Method, one begins the theory by defining a set of local mappings from points Ξ in the master element(s) to points X(Ξ) belonging to the elements of the mesh that is to be optimized (the latter is called the active mesh). The mappings are most commonly those from linear finite elements, but can be more general if needed. If the active mesh consists of only one element type, then the mappings can all have the same functional form, e.g., the bilinear map from a square to a quadrilateral. If the active mesh contains more than one element type (e.g., triangles and quadrilaterals) then more than one mapping form is required. Although the form of the mapping may be the same from one element to another, the exact mapping on each element can differ because the mapping depends on the coordinates of the vertices which define the particular element. Non-linear mappings are also allowed, for example, in the case of high-order finite elements. Thus, every element in the mesh has an associated mapping; in Mesquite these mappings are defined by default so that usually the user has very little work to do. The fact that TMOP most often uses finite element mappings to measure and control mesh quality does not mean that the application must be a finite element calculation. In addition to the mappings, TMOP requires that a set of sample points within the master element(s) be defined. Let the sample points within the master element be denoted by {Ξk }, k = 0, 1, . . . , K − 1. The corresponding points in the active mesh elements are {Xk } where Xk = X(Ξk ). Typically, the sample points are located at the corners of the master element if the element is linear, otherwise they may also be located, for example, at mid-edges, mid-faces, and/or mid-elements. TMOP thus requires that, in the formulation stage of the optimization, one define a set of mappings and sample points over all the elements of the mesh. This is not as daunting as it sounds because the mappings are usually of the same form for each element in the mesh (unless it contains more than one element type) and thus there is only one master element that is used for every element in the active mesh. The sample points are usually located at the corners of the master element if the mapping is linear, so most of the time, there is little need for user input here. The mappings are required to be differentiable so that their Jacobian matrix ∂X/∂Ξ exists at the sample points. For short-hand, we denote this Jacobian matrix by the symbol A, which refers to the Jacobian of the map
72
P. Knupp
from the master element to an element in the active mesh. For non-simplicial elements, the Jacobian matrix varies from point to point within the master element, as a function of Ξ. We denote by Ak the Jacobian matrix evaluated at sample point k; thus Ak = A(Ξk ) is the active Jacobian matrix at a sample point. The matrix is indirectly a function of the coordinates of the vertices which define the mapping. The Jacobian matrix also varies from one element to the next; for clarity, the element dependence has been suppressed in the notation used above. Note that these matrices are very small; for a 2D mesh element, the active matrix is just 2 × 2. Mappings, sample points, and the local Jacobian matrix within TMOP are discussed more fully in [16]. Target matrices play a critical role in TMOP because they define the desired Jacobian matrices in the optimal mesh. Target matrices are not optional, but must be constructed prior to the mesh optimization step in order to obtain a well-posed problem. Targets force the user/customer to supply a high-level definition of quality, derived from one of the canonical mesh quality issues (like those mentioned in the previous section). For every sample point k in the mesh, the target paradigm thus requires two matrices, forming a pair: the Jacobian matrix Ak derived from the active mesh and the Target (or reference-Jacobian) matrix Wk . Because every sample point can have a different Target-matrix, supplying this information would seem to constitute an enormous burden on the user. However, TMOP describes various automatic target construction algorithms that take the high-level quality definition and, using other available data, create the low-level target-matrix datasets (see [22]). This is possible, in part, due to the use of the QR-factorization, which enables one to separate out quality into four matrix factors called Size, Orientation, Angle, and Aspect Ratio. As with other mesh optimization paradigms, construction of targets remains somewhat of an art, but in TMOP is made more tractable for two reasons. First, the targets are based on the Jacobian matrix of the desired optimal mesh and thus have a simple geometric interpretation. Second, the target construction method can make partial use of the initial mesh (the one to be optimized). The initial mesh is nearly always available, and, in most other optimization methods, is ignored, even though it often contains valuable information. For clarity, the sample point indices are often suppressed in much of the remainder of this presentation. Let A and W at some sample point be defined. Because the construction of targets is under our control, we can assume that, for every target, det(W ) = 0 and thus W −1 exists. The weighted Jacobian matrix T , defined by T = AW −1 , is heavily used in TMOP because, if the target matrix W has units of length (as does A), then T is non-dimensional and provides a convenient scaling of A. Next, a set of local quality metrics is needed. Let Md be the set of d × d matrices with real numbers as elements. To this point the matrices A, W , and T in the paradigm are either 2×2 or 3×3, reflecting the dimension of the elements in the mesh. A local quality metric μ = μ(T ), which is a function
Introducing the Target-Matrix Paradigm
73
from Md to the non-negative numbers, measures the relationship between A and W . Several particular relationships are of interest •
•
•
A = W or, equivalently, T = I. When the two Jacobian matrices satisfy this relationship, the active matrix matches the target-matrix. In that case, the Size, Shape (i.e., Angle and Aspect Ratio), and Orientation properties of the Target-matrix also reside in the active-matrix. Local metrics which attempt to enforce this relationship, such as μ = |T − I|2F , are thus called Size+Shape+Orientation metrics.4 The relationship is enforced because μ ≥ 0, so that μ = 0 is the ideal value. In fact, μ = 0 if and only if T = I. A = RW or, equivalently, T = R, with R a non-specified rotation matrix. When the Jacobians satisfy this relationship, the Size and Shape properties of the Target-matrix are also found in the active-matrix, while the orientation is not in general. Local metrics which attempt to enforce this relationship, such as μ = |T t T − I|2F + (det(T ) − 1)2 , are thus called Size+Shape metrics. The relationship is enforced because μ ≥ 0, so that μ = 0 is the ideal value. In fact, μ = 0 if and only if T = R. A = sRW or, equivalently, T = sR, with R a non-specified rotation matrix, and s is a non-specified positive scalar. When the Jacobians satisfy this relationship, only the Shape properties of the Target-matrix reside in the active matrix, while Size and Orientation may not. Local metrics which attempt to enforce this relationship, such as μ = |T |F |T −1 |F (condition number), are thus called Shape metrics. The relationship is enforced because μ ≥ d when T ∈ Md , so that μ = d is the ideal value. In fact, μ = d if and only if T = s R.
Depending on which of the canonical mesh quality issues one wants to address, one may want to use a Shape Metric, a Size+Shape metric, or a Size+Shape+Orientation metric. In any case, these are the main quality metrics used in TMOP, along with their barrier forms (which are used to enforce positive Jacobian determinants). Thus TMOP focuses mainly on Target construction and not so much on devising different quality metrics. Properties of these local metrics, such as convexity, are studied in [17], [18], and [19]. Putting this all together, an objective function, typically of the form F =
N 1 μ(Tn ) N n=1
(where n is the sample point index and N is the total number of sample points), is minimized as a function of the coordinates of the free vertices to find the optimal mesh. The optimization is often constrained by fixing the position of some or all of the boundary vertices. In other cases, boundary vertices may be moved in directions tangential to the under-lying geometric curve or surface. The sum in the objective function can include all the sample 4
| · |F is the Frobenius matrix norm.
74
P. Knupp
points in the global mesh or only those within a local patch (if one is doing local patch smoothing). A generalization of the objective function above, based on the Power Mean, permits better scaling, as compared to using an p norm [16]. Part of the generalization includes trade-off coefficients which can be used to emphasize local quality in one location in the mesh more than in another [24]. Surface mesh optimization in TMOP requires special treatment since the active Jacobian matrices are not square (they are 3x2) and thus lack determinants, traces, and other properties used in the 2D and 3D element theories. Research on this topic is found in [23]. The above optimization problem, applied to most meshes, cannot usually be solved without resorting to iterative numerical methods. For the most part, standard methods for large-scale multi-variable optimization of continuous variables are used to solve the TMOP optimization problem. This completes the high-level description of the paradigm. Comparing TMOP to other direct methods for mesh optimization, one sees that 1. The other methods do not use mappings or sample points. Therefore, they cannot easily deal with the wide variety of mesh and element types, nor can they avail themselves of the fundamental object in meshing, namely the Jacobian matrix. 2. The other methods fail to make significant use of target-matrices or weighting functions. Therefore, they cannot easily address more than one canonical mesh quality issue. Most of the previous direct methods were aimed at controlling mesh smoothness, area, and/or angles (or some combination thereof) and cannot be applied to the examples shown in the next section. 3. The other methods do not use matrices and thus cannot take advantage of the extensive mathematical and numerical theories of matrices which have been developed over the past two centuries. In contrast, TMOP uses ideas from matrix factorizations, matrix norms and inequalities, inverses, eigenpairs, special matrix types, and more. 4. The other methods fail to significantly use scaling methods to properly scale their metrics and objective functions, whereas TMOP does this via the Power Mean, the use of AW −1 , and trade-off coefficients. 5. While other direct methods must combine several objective functions together in order to achieve simultaneous control of length, area, and angles, TMOP can do this using only one objective function because it controls all these propoerties via a single target-matrix. Thus TMOP avoids the need to determine the proper weighted combinations of the different objective functions (which remains an open question) in order to properly scale the problem. 6. The other direct methods fail to use trade-off coefficients and thus cannot trade off quality in one part of the mesh against another part. 7. The set of canonical mesh quality issues addressed by TMOP is much broader than in the other direct methods. For example, while the latter
Introducing the Target-Matrix Paradigm
75
mainly focus on smoothness, area, and angles, TMOP can additionally focus on mesh adaptivity, anisotropic smoothing, mesh alignment with vector fields, ALE rezone, and considerably more. Although the other direct methods can sometimes be well-suited to particular problems, they are much less flexible and powerful than TMOP, as one would expect since they do not use the concepts described in this section.
3 Selected Application Examples In this section, numerical examples are given to illustrate some of the diversity of mesh quality issues that TMOP can address. One can also consult [28] for an example involving deforming geometry. 3.1
Shape Smoothing of a Surface Mesh
One of the simplest applications of TMOP is that of improving the shape of mesh elements, shape being a combination of element angles and aspect ratios. The initial mesh shown on the left side of Figure 1, consists of triangular elements on a sphere. The elements of the initial mesh vary in shape and size. The shape-improvement goal is to make all of the elements as close to equilateral as possible. This is accomplished in TMOP by (1) using a Shape metric (such as condition number) and (2) constructing the Target-matrix which represents an equilateral triangle. 1 1 √2 W = 0 23 The target-matrix in this particular problem is the same at each sample point of the mesh and the sample points are located at the centroid of each element. The linear triangle map is used. Because the Shape metric is Size+Orientation invariant, one needn’t consider scaling of the target to achieve any particular edge-length nor does one need to consider orientation. A series of transformations described in [23] converts the 3 × 2 Jacobian matrix A into a 2 × 2 matrix so that it can be combined with W2×2 in order to form T2×2 . The optimal mesh on the right in Figure 1 shows the result of optimization with this target - the elements are nearly equilateral. 3.2
Sliver-Removal for a Viscous CFD Mesh
Figure 2 shows a tetrahedral mesh created by the VGRID code [29] for a CFD problem involving a viscous boundary layer.5 A closeup showing the boundary layer mesh is given on the right side of the picture. The mesh has 5
All figures in this example courtesy of Jan-Renee Carlson, NASA-Langley.
76
P. Knupp
Fig. 1. Triangle Mesh Shape Improvement on a Sphere: Initial Mesh (Left), Optimal Mesh (Right)
good quality in the boundary layer, but unfortunately contains sliver elements in the far-field. The goal in this problem is to improve the shape of the sliver elements while preserving the boundary layer mesh, and retaining the good elements in the size-transition region between the boundary layer and far-field. Elements in the optimal mesh should be non-inverted. Boundary vertices are permitted to move while constrained to their geometry. In this problem there are two goals, one to preserve part of the initial mesh and one to create better-shaped elements in another part of the initial mesh. Target-matrices for preserving the initial mesh are easy to construct: simply set Wk = (Ak )initial and use the metric μ(T ) = |T − I|2F . Likewise, Targetmatrices corresponding to equilateral tetrahedra are easy to construct, and these, along with a Shape metric will tend to create well-shaped tetrahedral elements. The main optimization issue is then: how to blend these two different sets of Target-matrices in various portions of the mesh? Our solution is not to blend the matrices, but rather to blend two quality metrics. Thus, the objective function in this problem was F = F1 + F2 |T1 |3F √ F1 = ck −1 3 3 det(T1 ) k F2 = (1 − ck ) |T2 − I|2F k
T1 = A(W1 )−1 T2 = A(W2 )−1 where F1 is the shape-improvement term and F2 is the preservation term. W1 corresponds to the equilateral tetrahedron and W2 is based on the initial mesh, as described above and ck is a trade-off (or blending) coefficient. To be precise, ck =
1 1 + e−0.4394(dk −135)
Introducing the Target-Matrix Paradigm
77
where dk is the maximum dihedral angle (in degrees) in the k th tetrahedral element (and sample point) of the mesh.6 The trade-off coefficient forms a logistic curve in the dihedral angle; it is nearly zero when the dihedral angle is less than 135 degrees and nearly one when the dihedral angle is greater than 135. Thus, shape improvement will tend to be emphasized in elements with large dihedral angles, while preservation will be emphasized on the others. Figure 3 (left side) explains why this particular functional form was chosen: a histogram plot showing the number of occurrences of the pair (maximum, minimum) dihedral angle within the mesh was created by Carlson. Examination of this plot showed that sliver elements tended to occur when the maximum dihedral angle exceeded 135 degrees, whereas the viscous elements occurred for the combination of small minimum and small maximum dihedral angle. Use of such a plot allowed us to avoid having to construct a blending function based on spatial coordinates of the meshed regions (a considerably more difficult endeavor). With this construction, F1 (shape-improvement) is emphasized on the large max. dihedral angle elements, and F2 (preservation of initial mesh) elsewhere. Figure 3 (right side) shows two scatter plots overlaid, one for the initial mesh, and one for the optimal mesh. The plot shows that the sliver element region is nearly vacant in the optimal mesh. Moreover, the boundary layer mesh was preserved during the optimization. This solution was not hit upon immediately, but the flexibility of TMOP allowed us to try out a number of ideas fairly quickly as the described approach was developed. As this example shows, choosing the blending functions is as much of an art as is constructing target-matrices. Never-the-less, it was possible to find a suitable function after a modest amount of experimentation.
Fig. 2. Initial Tetrahedral CFD Mesh from VGRID: Whole Domain (Left), Zoom to Boundary Layer Mesh (Right)
6
The constant 0.4394 was determined by requiring that ck = 0.9 when dk = 130 degrees.
78
P. Knupp
& Fig. 3. Maximum vs. Minimum Dihedral Angle Scatter Plots: Initial Mesh Showing Viscous and Sliver Regions (Left), Overlay of Initial and Optimal Meshes (Right)
3.3
Optimizing the Quality of Higher-Order Node Meshes
Higher-order finite elements are defined via nodes/vertices located not only at the usual element corners, but also at mid-edge, mid-face, and mid-element locations. The addition of these extra nodes enables the use of quadratic and higher-order mappings that allow greater accuracy for the same number of elements. In terms of mesh generation, higher-order finite element meshes are frequently generated by first creating linear element meshes and subsequently adding the extra nodes. For interior elements, the extra nodes are placed at the geometric mid-point of an edge, face, or element. For boundary elements, however, the extra nodes must conform to the under-lying geometry in order to maintain higher-order accuracy. To do this, mesh generation codes often ’snap’ the extra nodes near the boundary to the geometry via a normal projection operation. Usually this works fine but, if the mesh is coarse compared to the local geometric curvature, so-called ’inverted’ elements can be created by the projection step. An example of this is shown in Figure 4 (left side): all of the triangles have straight sides except those on the boundary. Some of the boundary triangles have curved edges which cross the domain boundary and are thus inverted (see triangle on bottom boundary just to the right of center). Such inverted elements must be removed or fixed before the finite element simulation can proceed. There are various ways to fix the inverted elements in higher-order meshes, including re-meshing, refinement, node-insertion, and element-swapping (see, for example, [30]). Missing from this list, until now, is mesh optimization via higher-order node-movement. In this context, TMOP can attack this problem via the use of sample points. In the example given here, sample points were placed both at the three element corners and at the three mid-edge locations of every element in order to control the active Jacobian matrix at these locations. The goal is to optimize the initial mesh via movement of the mesh node and vertex coordinates at all of the sample points. The result, of course, will be a triangle mesh having curved sides, even in the interior.
Introducing the Target-Matrix Paradigm
79
A two-stage optimization procedure was used. In the first stage we sought to produce a non-inverted mesh. This was accomplished using a Target-matrix corresponding to an equilateral triangle whose area was the same as the area of a triangle in the initial mesh (they all have roughly the same area). The local quality metric, corresponding to equal-area elements, was μ(T ) = 2 [det(T ) − 1] . This metric can often, but not always, untangle a mesh. Luckily, on this problem, the optimization in the first stage did produce a non-inverted mesh (see Figure 4 - Center). The elements in the non-inverted mesh have highly-curved edges and the mesh is probably unsuitable for a finite element calculation. However, since the mesh is non-inverted, this mesh could be used as the input to the second stage of the optimization, in which we used a barrier-based Shape metric (condition number) to improve shape while keeping the mesh untangled. The result is shown on the Right of the Figure. Elements in the optimal mesh in the second stage are well-shaped and the mesh is non-inverted; element sides are slightly curved. This example shows the potential of TMOP to play a role in improving quadratic and higher-order finite element quality. More details on this workin-progress can be found in [31].
Fig. 4. Optimization of Triangle Meshes with Quadratic Finite Elements: Left: Initial ’Inverted’; Center: ’Non-inverted’; Right: Well-shaped
3.4
Rapid Delivery of a Custom-Built Smoother
The Target-matrix Paradigm contains a number of high-level concepts such as active and target matrices, local quality metrics, objective functions and such, that translate nicely into objects and classes within the Mesquite code. These have been implemented in Mesquite without having to provide the low-level details needed to complete any specific mesh optimization algorithm such as the ones mentioned in the examples here. As a result, it is possible to create new mesh optimization methods quite rapidly in response to requests from different application groups. Here, an example is given which came from the Cubit meshing group. Cubit frequently is used to create unstructured quadrilateral meshes via a paving algorithm (see initial mesh on the left of Figure 5). Although this mesh has nice shape-quality, in which the elements are nearly square, the application group complained that the mesh contained unnecessarily short edges. That is, some edges were about half as long as other edges. Because the application group was using an explicit simulation code, these short edges were determining the time-step that was used in
80
P. Knupp
the simulations and thus, the time-step was needlessly small (the Courant condition, which was used to determine the time-step, is proportional to the minimum edge-length in the mesh). To fix this issue, Mesquite was asked to optimize the initial mesh in such a way that these overly short edges were lengthened. No such smoother was available in Mesquite at the time of the request. What was clearly needed was a smoother that created equal-length edges in the mesh (so none would be needlessly small) and, at the same time, maintained the near-square shape of the elements. TMOP was able to provide this capability quite quickly by implementing a concrete target construction algorithm that created the appropriate set of Target-matrices and by selecting the right local quality metric. Sample points were located at the four corners of each quadrilateral and the bilinear map applied. Because each quadrilateral element in the optimal mesh was to be identical (except for orientation), the set of Target-matrices needed to be the same at each sample point. To meet the problem requirements, the Target was selected to have the form W = Λ I, where I is the 2 × 2 identity matrix and Λ is a positive scalar. The identity matrix represents an element whose aspect ratio (length/width) is 1.0 and whose angles are ninety degrees; this corresponds to the shape of a square quadrilateral. The scalar Λ is related to edge-length in the theory of Targetmatrix construction (see [22]); by making it the same at all sample points, the optimal mesh should have equal-length edges. Specifically, the scalar was set to the average edge-length in the initial mesh (this computational capability was already available in Mesquite). Finally, because we did not wish to control the Orientation of the quadrilaterals in the mesh, we used an Orientationinvariant quality metric, namely Size+Shape. A concrete target construction algorithm was added, with minimal effort, to the Mesquite code to create a target of this particular form. The optimal mesh resulting from these choices is shown on the right side of the Figure; as one can see, the edge-lengths in the optimal mesh are nearly equal, the elements nearly square, and the mesh is non-inverted. The new capability was delivered to the customer as a
Fig. 5. Optimization of Paved Mesh To Increase Time-Step: Left: Initial Mesh with ’Short’ Edges; Right: Optimized Mesh with Equal Edges
Introducing the Target-Matrix Paradigm
81
Mesquite wrapper (called from the Cubit code) in a matter of two weeks (of course, it won’t always be this easy).
4 Summary The motivation for the Target-matrix paradigm is derived principally from the desire to create a general purpose mesh optimization library known as Mesquite. A general purpose mesh optimization library must be able to handle the wide variety of mesh types one encounters in computational simulations. It must also be able to provide solutions to the canonical problems in mesh quality, for example, mesh untangling, shape-improvement, sizeadaptation, mesh alignment, and more. Without a general mesh optimization paradigm, these requirements could only be met via an incompatible collection of algorithms that might only be loosely related, resulting in a loss of flexibility and a software maintenance challenge. The Target-matrix paradigm unifies many of these requirements through the sample point concept (to handle mesh type) and via the target-matrix concept (to address different canonical problems). High-level concepts in TMOP were summarized. A rich mathematical theory underlying these concepts is under development. The high-level concepts have been clarified and made more precise, and many important details in target-construction and the like are described in a series of reports. The numerical examples given here illustrate the potential of TMOP to impact many canonical problems in mesh quality improvement via node movement. Future work will expand the list of canonical problems, mesh types, numerical examples, concrete automatic target-construction algorithms, and the set of high-level wrappers in Mesquite. Moreover, important extensions of the mathematical theory will be developed.
Acknowledgments Many thanks to Jan-Renee Carlson, Jason Kraftcheck, and Nick Voshell for their important contributions to Mesquite and to the numerical examples.
References 1. Brewer, M., Diachin, L., Knupp, P., Melander, D.: The Mesquite Mesh Quality Improvement Toolkit. In: Proceedings of the 12th International Meshing Roundtable, Santa Fe NM, pp. 239–250 (2003) 2. Castillo, J.E.: A discrete variational grid generation method. SIAM J. Sci. Stat. Comp. 12(2), 454–468 (1991) 3. Tinoco-Ruiz, J., Barrera-Sanchez, P.: Area functionals in Plane Grid Generation. In: Cross, M., et al. (eds.) Numerical Grid Generation in Computational Field Simulations, Greenwhich, UK, pp. 293–302 (1998)
82
P. Knupp
4. Kennon, S., Dulikravich, G.: Generation of computational grids using optimization. AIAA Journal 24(7), 1069–1073 (1986) 5. Freitag, L.: On combining Laplacian and optimization-based mesh smoothing techniques. In: ASME 1997 Trends in Unstructured Mesh Generation, AMD, vol. 220, pp. 37–43 (1997) 6. Zhou, T., Shimada, K.: An angle-based approach to two-dimensional mesh smoothing. In: Proceedings of the 9th International Meshing Roundtable, pp. 373–384 (2000) 7. Brackbill, J., Saltzman, J.: Adaptive zoning for singular problems in two dimensions. J. Comp. Phys. 46, 342–368 (1982) 8. Steinberg, S., Roache, P.: Variational grid generation. Num. Meth. for P.D.E. 2, 71–96 (1986) 9. Liseikin, V.: On a variational method of generating adaptive grids on ndimensional surfaces. Soviet Math. Docl. 44(1), 149–152 (1992) 10. Winslow, A.: Numerical solution of the quasilinear Poisson equations in a nonuniform triangle mesh. J. Comp. Phys. 2, 149–172 (1967) 11. Knupp, P., Luczak, R.: Truncation error in grid generation. Num. Meth. P.D.E. 11, 561–571 (1995) 12. Frey, P., George, P.: Mesh Generation: Application to Finite Elements. Wiley, Chichester (2008) 13. Dvinsky, A.: Adaptive grid generation from harmonic maps on Riemannian manifolds. J. Comp. Phys. 95, 450–476 (1991) 14. Thompson, J., Warsi, Z., Mastin, C.: Automatic numerical generation of bodyfitted curvilinear coordinate systems. J. Comp. Phys. 24, 274–302 (1977) 15. Liseikin, V.: A computational differential geometry approach to grid generation. Springer, Heidelberg (2004) 16. Knupp, P.: Formulation of a Target-Matrix Paradigm for Mesh Optimization, SAND2006-2730J, Sandia National Laboratories (2006) 17. Knupp, P.: Local 2D Metrics for Mesh Optimization in the Target-matrix Paradigm, SAND2006-7382J, Sandia National Laboratories (2006) 18. Knupp, P., van der Zee, E.: Convexity of Mesh Optimization Metrics Using a Target-matrix Paradigm, SAND2006-4975J, Sandia National Laboratories (2006) 19. Knupp, P.: Analysis of 2D Rotational-invariant Non-barrier Metrics in the Target-Matrix Paradigm, SAND2008-8219P, Sandia National Laboratories (2008) 20. Knupp, P.: Measuring Quality Within Mesh Elements, SAND2009-3081J, Sandia National Laboratories (2009) 21. Knupp, P.: Label-invariant Mesh Quality Metrics. In: Proceedings of the 18th International Meshing Roundtable, pp. 139–155. Springer, Heidelberg (2009) 22. Knupp, P.: Target-matrix Construction Algorithms, SAND2009-7003P, Sandia National Laboratories (2009) 23. Knupp, P., Kraftcheck, J.: Surface Mesh optimization in the Target-Matrix Paradigm (manuscript) 24. Knupp, P.: Tradeoff-coefficient and Binary Metric Construction Algorithms within the Target-Matrix Paradigm (manuscript) 25. Knupp, P.: Algebraic Mesh Quality Measures. SIAM J. Sci. Comput. 23(1), 193–218 (2001)
Introducing the Target-Matrix Paradigm
83
26. Freitag, L., Knupp, P.: Tetrahedral mesh improvement via optimization of the element condition number. Intl. J. Numer. Meth. Engr. 53, 1377–1391 (2002) 27. Knupp, P., Margolin, L., Shashkov, M.: Reference-Jacobian Optimizationbased Rezone Strategies for Arbitrary Lagrangian Eulerian Methods. J. Comp. Phys. 176(1), 93–128 (2002) 28. Knupp, P.: Updating Meshes on Deforming Domains. Communications in Numerical Methods in Engineering 24, 467–476 (2008) 29. http://tetruss.larc.nasa.gov/vgrid/ 30. Luo, X., Shephard, M., Lee, L., Ge, L., Ng, C.: Moving Curved Mesh Adaptatio for Higher Order Finite Element Simulations. Engr. w/Cmptrs, February 27 (2010) 31. Knupp, P., Voshell, N., Kraftcheck, J.: Quadratic Triangle Mesh Untanglng and Optimization via the Target-matrix Paradigm. In: CSRI Summer Proceedings, SAND2010-3083P, Sandia National Laboratories (2009)
This page intentionally left blank
An Analytical Framework for Quadrilateral Surface Mesh Improvement with an Underlying Triangulated Surface Definition Kiran Shivanna1 , Nicole Grosland2 , and Vincent Magnotta3 1 2 3
Center for Computer Aided Design, The University of Iowa
[email protected] Department of Biomedical Engineering, The University of Iowa
[email protected] Department of Radiology, The University of Iowa
[email protected]
Summary. Surface mesh quality plays a very important role in the solution accuracy and in the quality of the ensuing volumetric mesh. Amongst the techniques available, optimization based methods are commonly used for mesh quality improvement. Optimization methods for volumetric and planar surface mesh quality improvement are very well researched. However, this is not true for non-planar meshes. In this manuscript, we focus on quadrilateral non-planar surface meshes obtained during hexahedral mesh generation of anatomic structures. A modified untangling function based on node normals for quadrilateral elements is proposed. A parameterization-based method available is enhanced by giving it an analytical framework. A new projection-based method is proposed and its performance is comparable to the parametric method. The results of the enhanced/proposed methods are superior to the results obtained from Laplacian smoothing. Keywords: finite element method, mesh improvement, optimization, anatomic structures.
1 Introduction Finite element analysis (FEA) is the most commonly used method in numerical simulations due to its wide range of applicability and versatility in representing complex structures. One of the most influential factors governing solution accuracy is mesh quality. Proper care should be taken during mesh generation to ensure that a mesh of high quality is created. As the geometry of the structure becomes more complex, there is an increased probability that elements of poor quality may exist, as is frequently encountered with anatomic structures. Several mesh generation and mesh improvement algorithms for volumetric meshing rely on the surface node definitions to compute
86
K. Shivanna, N. Grosland, and V. Magnotta
the interior node locations. Consequently, in order to achieve a solid mesh of high quality, it is imperative that the quality of the surface mesh be superior. Moreover, these surface nodes are often constrained during volumetric mesh generation and mesh improvement. For example, mesh generation algorithms such as the advancing front method [1] initiate with surface elements to fill the volume. For multiblock meshing methods [2], the surface nodes at the individual block level are constrained while the interior nodes are interpolated. As a result, the quality of the interpolation is directly dependent on the location of the surface nodes. In volumetric mesh improvement methods [3, 4], the surface nodes are generally constrained while the interior nodes are moved to optimal positions. Constraining the surface nodes directly links the overall mesh quality to the surface mesh quality. In addition, boundary conditions are applied at the surface and field variables of interest are often measured at/near the surface, thus further influencing the solution quality. Mesh improvement can be achieved using techniques based on node reconnection [5] and node repositioning/movement [3, 4]. Node reconnection based techniques improve mesh quality by introducing additional nodes, eliminating existing nodes, and altering the element connectivity as required. Simplest amongst the node movement based methods is Laplacian smoothing [6], a heuristic based method in which the node of interest is moved to the geometric center of the connected nodes. Even though Laplacian smoothing distributes the nodes uniformly, it does not guarantee a valid mesh. This led to mesh improvement using optimization techniques [3, 4]. Optimization techniques rely on a systematic approach to achieve optimum mesh quality. During optimization, an objective function is minimized. The minimization may be subject to a given set of constraints. For example, during mesh improvement, a function representing a quality measure is optimized. This optimization process establishes the direction of node movement that ultimately improves the mesh quality. Amongst the various metrics available, the unconstrained minimization of Jacobian based measures are commonly used. The mesh quality metrics and mesh improvement procedures are well established for planar surface [7] and continuum mesh definitions [8]. However, the applicability of the quality metrics and mesh improvement procedures to non-planar surface meshes are still being explored. Various criteria have been reported in the literature to check for the validity of a quadrilateral surface mesh. Chen et al. [9] consider an element to be inverted if the dot product between the normal of the underlying surface and the mesh is less than zero. Yin et al. [10] use the centroid of the volume element (hexahedron) as a guide to determine if the surface quadrilateral is tangled. This method will not be applicable; if we have only a surface mesh or the location of interior nodes of volume meshes are not valid. Hence, a method that depends only on the node normal information would be preferrable in untangling surface meshes. Towards improving the quality of the surface mesh, we have developed a modified untangling function.
Quadrilateral Surface Mesh Improvement
87
Techniques available for non-planar mesh improvement start with the construction of a local space. Knupp [7] and Frey et al. [11] use the tangent plane at the node of interest as the local space for the node movement. Zhang et al. [12] use a plane that encompasses normal and tangent direction at the node of interest. Escobar et al. [13] use a local space obtained by projecting the elements sharing a given node, onto a best fit plane. Yin et al. [10] consider a quadratic surface function obtained by fitting the neighborhood nodes. Each of the aforementioned techniques moves the nodes off the surface. Garimella et al. [14] consider the parametric space of the underlying surface element as the local space, thus tracking the node movement exclusively along the surface. The work in this paper builds upon the concepts described by Garimella et al. [14]. The parametric space method can also be used to improve surface meshes with n-sided polygons [15]. In this paper, we restrict ourselves to quadrilateral surface meshes with an underlying triangulated surface definition encountered while generating all-hexahedral meshes of anatomic structures. For example, the surface nodes in multiblock meshing [2] are projected onto the underlying triangulated surface definition using closest-point projection. The optimality of the projected node distribution is dependent on the curvature of the underlying surface definition. Regions of high curvature generally have sub-optimal node distribution thus necessitating the use of surface mesh improvement techniques. This manuscript is organized as follows. The Jacobian of a non-planar element is computed through rigid transformation (Section 2.1). The mesh improvement method used here consists of two stages: (1) untangling and (2) shape improvement. A modified untangling function that incorporates the node normal is proposed for quadrilateral mesh definitions (Section 2.2) and Jacobian matrix condition number is used for the shape improvement (Section 2.3). The analytic differentiation of the mesh quality metrics in parametric and physical space for optimization direction computation is implemented (Section 2.4 and Appendix). If the underlying surface is triangulated as is the case here, parameterization is not required. Hence, an alternate optimization strategy based on projection has been proposed (Section 2.4). An optimization path computation based on the intersection of the optimization direction with the edges of the underlying surface elements is implemented (Section 2.5). A simple 2D example (Section 2.6) and several 3D examples (Section 3) demonstrating the capability of the proposed methods are presented.
2 Methods The methods used in mesh improvement are described in the subsequent paragraphs. To avoid any confusion in the description, the underlying triangulated surface definition is referred to as the surface, the points defining the surface as vertices, and triangles defining the surface as cells. The quadrilateral
88
K. Shivanna, N. Grosland, and V. Magnotta
surface whose quality needs to be improved will be referred to as the mesh, points defining the mesh as nodes. 2.1
Jacobian of a Triangle in 3D
The Jacobian based quality metrics are used in the quality improvement. The Jacobian of a triangle in 3D/physical space is a 3X2 matrix and that of a triangle in 2D/computational/parametric space is a 2X2 matrix. Hence, the above mentioned mesh quality metrics are easily computed for a triangle in 2D space. To calculate the quality metric of a triangle in 3D, the triangle is rigidly transformed so that all the nodes lie in a 2D plane. This transformation will not change the above mentioned mesh quality metric values, as the determinant and the condition number of the Jacobian are orientation invariant. The transformation is as follows. A triangle in 3D is defined by its three nodes, P1 , P2 and P3 , with edge lengths l1 , l2 and l3 as shown in Fig. 1. The transformed triangle in 2D is defined by nodal positions p1 , p2 and p3 , respectively. The 2D coordinates are defined as follows: p1 = (0, 0), p2 = (l1 , 0) and p3 = (x, y). The values for x and y can be computed in terms of edge lengths as, l32 − l22 + l12 2l1
y = l32 − x2
x=
The Jacobian matrix for the triangle at node p1 is, l1 x JP1 = 0 y
(1) (2)
(3)
The Jacobian matrices at the nodes P2 and P3 are given in Appendix (Equation 14). 2.2
Untangling
For a quadrilateral, the Jacobian based mesh quality metrics are evaluated by decomposing the quadrilateral into four triangles.The mesh quality of the decomposed triangles are evaluated by the method described in Section 2.1. The mesh quality measure used in untangling the planar meshes [3] was modified to untangle non-planar quadrilateral meshes. Consider the quadrilateral shown in Fig.2. Let the node of interest be P3 . Four triangles 1, 2, 3 and 4 can be formed by decomposing the quadrilateral. With the movement of node P3 , the quality of triangles 2, 3 and 4 are affected while triangle 1 (referred to as the dead zone in the literature [9]) is unaffected.
Quadrilateral Surface Mesh Improvement
89
Fig. 1. Physical space to computational space transformation for Jacobian computation. The triangles are obtained by decomposing a quadrilateral into triangles.
Fig. 2. Decomposition of a quadrilateral element into four triangles for the computation of mesh quality metrics
The objective function for triangle 3 with node P3 as the reference node (where mesh quality is measured) is, fP3 = abs(αP3 ) − αP3
(4)
αP3 = (n · nP3 − cos(θ))|JP3 |
(5)
where αP3 is defined as
n is the normal of triangle 1, and nP3 is the normal of triangle 3 given by −−−→ −−−→ nP3 = P2 P3 × P2 P4
(6)
θ is user defined and may vary depending on the curvature of the mesh. The range of θ is between 00 and 1800. |JP3 | is the determinant of the Jacobian. Equations can similarly be written for triangles 2 and 4 whose reference nodes are P2 and P4 respectively. From Equation 5, the decrease in the orientation difference between triangle 1 and triangle 3 increases (n · nP3 ) thus increasing αP3 . The dot product is a measure of the cosine of the angle between the normals of triangle 1
90
K. Shivanna, N. Grosland, and V. Magnotta
and triangle 3. With the decrease in the angle, the co-planarity of the nodes increases. The normals of the triangles are oriented such that the mesh is untangled. It can be shown that for a planar mesh, the term n · nPi is -1 if the triangles are flipped, thus making the method applicable to both planar and non-planar meshes.The mesh is considered when the objective function evaluates to zero at all the nodes of the mesh. 2.3
Shape Improvement
When once the mesh is untangled, the mesh quality is further improved using condition number as the objective function in optimization. The equation for the condition number κ is,
JPi 2 κPi = (7) 2|JPi | where JPi is the Frobenius norm at point Pi . It should be noted that the determinant of the Jacobian is node invariant, but the Frobenius norm is not. Thus, the Frobenius norm varies with the node considered and the values at the nodes of the triangle considered are given in Appendix (Equation 16). The condition number is a function of the included edge lengths of a given node and the area of the triangle considered, thereby making the condition number orientation invariant. With the objective functions computed, the optimization direction and step length need to be computed. The computations are described in Section 2.4 and Section 2.5 respectively. 2.4
Optimization Path Computation
Optimization Direction Computation The Jacobian metrics used in the objective function/mesh quality metrics (Section 2.2 and 2.3) are the determinant of the Jacobian |JPi | and the Frobenius norm JPi . The solution to the optimization problems often require methods that are based on the gradient (e.g., gradient descent and conjugate gradient) of an objective function. Here, optimization direction computation is done using (1) parameterization-based and (2) projection-based methods. Parameterization-based Method In the literature [14], the gradient is computed numerically in the parametric space. Here, an analytic gradient computation for untangling and shape improvement is used. Barycentric mapping is used for parameterization between physical and parametric coordinates. The parameterization of the local space, constrains the node movement to the underlying surface. Consider a triangular cell on which the reference node Pi = (X, Y, Z) lies (Fig. 3). The corresponding location of Pi in the parametric space is ri = (ξi , ηi ). The 3D physical coordinates of the cell are X, Y and Z and the 2D local parametric
Quadrilateral Surface Mesh Improvement
91
space coordinates are ξ and η. The vertices of the cell in the physical coordinates are Q1 = (S1 , T1 , U1 ), Q2 = (S2 , T2 , U2 ) and Q3 = (S3 , T3 , U3 ) and in the parametric space are r1 = (ξ1 , η1 ), r2 = (ξ2 , η2 ) and r3 = (ξ3 , η3 ). The optimization direction in the parametric space for the untangling function is given by, ∂ ∂ ∂X ∂ ∂Y ∂ ∂Z (fPi ) = (fPi ) + (fPi ) + (fPi ) ∂ξ ∂X ∂ξ ∂Y ∂ξ ∂Z ∂ξ
(8)
and for the shape improvement is given by, ∂ ∂ ∂X ∂ ∂Y ∂ ∂Z (κPi ) = (κPi ) + (κPi ) + (κPi ) ∂ξ ∂X ∂ξ ∂Y ∂ξ ∂Z ∂ξ
(9)
Similar equations can be written with respect to η. Computation of derivatives of untangling and shape improvement functions in the physical coordinates is straightforward and the details are given in Appendix (Equations 17 to 22). The barycentric map is computed as, X=
ri , r1 , r2 S3 + ri , r2 , r3 S1 + ri , r3 , r1 S2 r1 , r2 , r3
(10)
where, , , represents the area of the triangle given by the three coordinates of interest. Similar equations can be written for Y and Z coordinates. The derivatives of physical coordinates w.r.t. parametric coordinates are, ∂X 1 (η1 − η2 )S3 + (η2 − η3 )S1 + (η3 − η1 )S2 = ∂ξ 2 r1 , r2 , r3
(11)
∂X 1 (ξ1 − ξ2 )S3 + (ξ2 − ξ3 )S1 + (ξ3 − ξ1 )S2 = ∂η 2 r1 , r2 , r3
(12)
Similar equations can be written for Y and Z coordinates.
Fig. 3. Barycentric mapping of a triangular cell between physical space and parametric space. Reference node Pi lies on the triangular cell.
92
K. Shivanna, N. Grosland, and V. Magnotta
Projection-based Method If the computation of the gradient of an objective function is done in physical space as is the case in the projection-based method, the gradient direction could point away from the underlying surface. To constrain the optimization direction onto the underlying triangulated surface, the original direction vector is projected orthogonally onto the plane containing the triangular cell on which the node of interest lies (Fig. 4a). The projected direction vector would establish the modified direction for the node movement. The orthogonal projection can be computed as, M = D − (D · N )N
(13)
where, M is the projected direction vector on the triangular cell on which the node lies, D is the original optimization direction vector in the physical space and N is the unit normal of the triangular cell on which the node lies. The optimization direction vector D is computed from the equations given in Appendix (Equations 20 to 22). From Fig. 4b, (D · N ) represents the magnitude of the orthogonal projection of D on N . Equation 13 is obtained from vector subtraction (Fig. 4b).
Fig. 4. Projection of optimization direction in physical space: (a) pictorial representing the projection process onto a triangular cell, (b) computation of projection direction using vector subtraction.
2.5
Step Length Computation
Step length need to be determined for the optimization direction computed in Section 2.4 and the procedure is as follows. The distance between the intersection point of the optimization direction with one of the edges of the cell and the current node location would serve as the initial step length. The objective function is evaluated at the intersection point. If the objective function
Quadrilateral Surface Mesh Improvement
93
decreases, the neighboring cell is considered for the minimization direction computation. Otherwise, the step length is decreased until the optimum result is obtained. The starting location of the node to be smoothed or the intersection point obtained during mesh improvement can lie in one of the three locations, (1) on a vertex of the surface (Fig. 5a), (2) on an edge of a cell (Fig. 5b), and (3) interior to a cell (Fig. 5c). If the step length is negligible, it implies that the current location is the optimum location for the node and the cell on which the node lies. To continue mesh improvement, for a node located (1) on a vertex of the surface, the neighboring cells sharing the vertex are checked for the subsequent path computation; (2) on an edge of a cell, the neighboring cell sharing the edge on which the node is located is used for the subsequent path computation; and (3) interior to a cell, the current location is the optimum location.
Fig. 5. Optimization path computation with possible starting and ending locations of a node. Starting location: (a) close to a vertex on the underlying mesh, (b) on an edge of the triangular cell, and (c) interior to a triangular cell.
2.6
2D Example
The parameterization-based and the projection-based methods are evaluated with a simple 2D example. The mesh and the underlying surface are shown in Fig. 6a. The mesh contains 9 nodes (P1 toP9 ) and 4 quadrilateral elements. The underlying surface is triangulated. In Fig. 6b node P5 is intentionally moved to a location making quadrilateral P5 P4 P2 P1 invalid. The modified untangling function proposed cannot be evaluated if any three or more nodes of a quadrilateral are collinear or any two or more nodes of a quadrilateral are coincident. The normal evaluation would not be possible, thus precluding the use of the untangling function. If collinear or coincident nodes are found prior to the mesh improvement, the nodes are perturbed slightly from their position and projected back onto the underlying surface. But if collinear nodes are found during the untangling phase, the following procedure is followed. While untangling, the node is moved to the location of vertex V1 (Fig. 6c (inset)). This makes the nodes P4 , P5 and P2 collinear and hence untangling function cannot be computed for the subsequent iterations. To overcome the
94
K. Shivanna, N. Grosland, and V. Magnotta
Fig. 6. Test example to evaluate parametric and projection-based optimization direction computation with a simple 2D example: (a) valid mesh with nine nodes and four quadrilaterals, (b) initial invalid mesh, (c) untangling path computation, (d) shape improvement path computation, and (e) combined optimization path.
drawback, the node is perturbed in the positive and the negative directions of the coordinates of the neighboring cells (as determined in section 2.5). The perturbation is along the physical coordinates for the projection-based and along the parametric coordinates for the parameterization-based direction computation. The perturbed location that reduces the objective function is chosen for the subsequent iterations (Fig. 6c). The path traversed by the node during shape improvement is shown in Fig. 6d. The complete path taken by the node during optimization is shown in Fig. 6e (inset). 2.7
Evaluation of Mesh Improvement Techniques
For the mesh improvement, local optimization with gradient descent was chosen as the optimization method. Three examples, (1) phalanx bone (Fig. 7), (2) femur (Fig. 8) and (3) posterior portion of sheep vertebrae (Fig. 9) were considered for mesh improvement. The example meshes were smoothed using parameterization-based method, projection-based method and Laplacian smoothing. A value of 900 was assumed for θ (Equation 5) during untangling. The meshes were improved until the solution converged. The solution was deemed to have converged, when the largest displacement of all the nodes 1 th repositioned was less than ( 100 ) of the starting average edge length. The starting average edge length values are given in Table 1. The underlying surfaces for the three examples are shown in Fig. 7a, Fig. 8a and Fig. 9a. The
Quadrilateral Surface Mesh Improvement
95
Table 1. Mesh and surface details Details Phalanx bone Num cells (Underlying surface) 48894 Num elements (Mesh) 1686 Ave edge length 0.918
Femur Sheep vertebra 226024 121605 5986 7564 2.908 1.214
initial meshes (unsmooth) shown in Fig. 7b, Fig. 8b and Fig. 9b were obtained by projecting a rectilinear grid onto the underlying surface using closest point projection [2]. The Verdict library [16] was used in the computation of the mesh quality metrics.
3 Results and Discussion 3.1
Results
The meshes obtained from the Laplacian smoothing are shown in Fig. 7c, Fig. 8c and Fig. 9c. The smoothed meshes using the parameterization-based method are shown in Fig. 7d, Fig. 8d and Fig. 9d. The smoothed meshes using the projection-based method are shown in Fig. 7e, Fig. 8e and Fig. 9e. In the tables given, Unsmoothed, Laplacian, Parametric and Projection meshes are abbreviated as U, L, Pa and Pr respectively. Mesh quality histogram based on minimum scaled Jacobian and maximum condition number
Fig. 7. Phalanx bone: (a) underlying triangulated surface definition, (b) initial unsmooth mesh, (c) smoothed mesh using Laplacian smoothing, (d) smoothed mesh using parametric method, (e) smoothed mesh using projection method, and (f) overlaid meshes from parametric and projection methods.
96
K. Shivanna, N. Grosland, and V. Magnotta
Fig. 8. Femur: (a) underlying triangulated surface definition, (b) initial unsmooth mesh, (c) smoothed mesh using Laplacian smoothing, (d) smoothed mesh using parametric method, (e) smoothed mesh using projection method, and (f) overlaid meshes from parametric and projection methods.
for the unsmoothed and smoothed meshes of phalanx bone, femur and posterior portion of sheep vertebrae are given in Table 2, Table 3 and Table 4 respectively. The minimum scaled Jacobian for a quadrilateral is the minimum of all the values and maximum condition number is the maximum of all the values measured at the four nodes of the given quadrilateral. Mesh quality statistics such as maximum, minimum, mean and standard deviation of the scaled Jacobian and the condition number for unsmooth and smooth meshes of phalanx bone, femur and posterior portion of sheep vertebra are given in Table 5, Table 6 and Table 7 respectively. Table 2. Mesh quality histogram for phalanx bone Min scaled |J| <= 0.0 > 0.0 and <= 0.1 > 0.1 and <= 0.2 > 0.2 and <= 0.4 > 0.4 and <= 0.6 > 0.6 and <= 0.8 > 0.8 and <= 1.0
U L Pa Pr Max κ 2 0 0 0 ≥1.0 and <=1.5 0 0 0 0 >1.5 and <=1.0 7 0 0 0 >2.0 and <=3.0 26 0 0 0 >3.0 and <=5.0 54 0 0 0 >5.0 and <=7.5 118 0 0 0 >7.5 and <=10.0 1479 1686 1686 1686 >10.0
U L Pa Pr 1300 1686 1686 1686 183 0 0 0 130 0 0 0 52 0 0 0 14 0 0 0 1 0 0 0 6 0 0 0
Quadrilateral Surface Mesh Improvement
97
Fig. 9. Posterior portion of sheep vertebra: (a) underlying triangulated surface definition, (b) initial unsmooth mesh, (c) smoothed mesh using Lapacian smoothing, (d) smoothed mesh using parametric method, (e) smoothed mesh using projection method, and (f) overlaid meshes from parametric and projection methods. The mesh improvement is highlighted through insets.
3.2
Discussion
Inverted/invalid elements in planar and volumetric meshes are the elements having non-positive Jacobian [3]. But the definition of inverted elements in a non-planar mesh is not clearly defined in the literature because of the difficulty associated with quantifying what constitutes an inverted element [18]. This is especially true for triangular elements. For quadrilateral elements, various criteria have been used to define an invalid element (as discussed in the Section 1) including the warping factor [17]. These criteria measure the
98
K. Shivanna, N. Grosland, and V. Magnotta Table 3. Mesh quality histogram for femur
Min scaled |J| <= 0.0 > 0.0 and <= 0.1 > 0.1 and <= 0.2 > 0.2 and <= 0.4 > 0.4 and <= 0.6 > 0.6 and <= 0.8 > 0.8 and <= 1.0
U L Pa Pr Max κ 22 0 0 0 ≥1.0 and <=1.5 11 0 0 0 >1.5 and <=1.0 13 0 0 0 >2.0 and <=3.0 50 0 0 0 >3.0 and <=5.0 104 1 2 0 >5.0 and <=7.5 307 12 8 10 >7.5 and <=10.0 5479 5973 5976 5976 >10.0
U L Pa Pr 3841 5960 5970 5980 1733 24 16 6 295 2 0 0 56 0 0 0 14 0 0 0 4 0 0 0 43 0 0 0
Table 4. Mesh quality histogram for sheep vertebra(posterior) Min scaled <= 0.0 > 0.0 and ≤ > 0.1 and ≤ > 0.2 and ≤ > 0.4 and ≤ > 0.6 and ≤ > 0.8 and ≤
|J| U 31 0.1 19 0.2 39 0.4 136 0.6 267 0.8 911 1.0 6161
L 3 3 5 45 118 314 7076
Pa 0 0 2 23 105 339 7095
Pr 0 0 4 22 104 311 7123
Max κ ≥1.0 and ≤1.5 >1.5 and ≤1.0 >2.0 and ≤3.0 >3.0 and ≤5.0 >5.0 and ≤7.5 >7.5 and ≤10.0 >10.0
U 4610 1184 927 556 136 48 103
L 6565 648 236 72 23 11 9
Pa 6445 856 205 50 7 1 0
Pr 6512 785 201 60 3 3 0
Table 5. Mesh quality statistics for phalanx bone Mesh Min U -0.123 L 0.849 Pa 0.848 Pr 0.847
Scaled |J| Max Mean Std dev 1.000 0.904 0.143 1.000 0.993 0.016 1.000 0.993 0.016 1.000 0.993 0.016
Min 1.000 1.000 1.000 1.000
Max ∞ 1.296 1.255 1.242
κ Mean Std dev ∞ ∞ 1.075 0.080 1.071 0.066 1.071 0.063
Table 6. Mesh quality statistics for femur
Mesh Min U -0.808 L 0.516 Pa 0.582 Pr 0.622
Scaled |J| Max Mean Std dev 1.000 0.921 0.137 1.000 0.988 0.022 1.000 0.986 0.023 1.000 0.985 0.022
Min 1.003 1.000 1.000 1.000
Max ∞ 2.256 1.787 1.642
κ Mean Std dev ∞ ∞ 1.211 0.138 1.212 0.135 1.211 0.132
difference in the normal orientation at the nodes of a quadrilateral element. Hence, an untangling function (Equation 5) that minimizes the difference in node normal orientations has been proposed.
Quadrilateral Surface Mesh Improvement
99
Table 7. Mesh quality statistics for vertebra (posterior)
Mesh Min U -0.849 L -0.634 Pa 0.149 Pr 0.138
Scaled |J| Max Mean Std dev 1.000 0.882 0.172 1.000 0.952 0.104 1.000 0.952 0.091 1.000 0.954 0.092
Min 1.000 1.000 1.000 1.000
κ Max Mean Std dev ∞ ∞ ∞ ∞ ∞ ∞ 7.854 1.266 0.382 8.819 1.258 0.405
During the shape improvement, different criteria are used for defining feasible/valid region for a given node. Escobar et al. [13] use the parametric space defined by the projection of sub mesh (elements sharing a given node) onto the best fit plane as the valid region. Garimella et al.[14] use an imaginary plane containing the opposing edge of the node of interest and perpendicular to the normal at the node. If the node crosses the imaginary plane during node movement, the element is considered invalid. In the proposed method, the element is considered invalid if the node movement makes the angles as computed in Equation 6 greater than the user defined value (θ in Equation 5). A simple two dimensional problem (Fig. 6) is solved to compare the two techniques. It is seen from Fig. 6e that the two techniques converge to the same solution, but the optimization path computed is different. The projection-based optimization direction has a much straighter path to the optimal location (Vertex V2 in Fig. 6e) than the parametric method. Three examples with varying degree of curvature change on the underlying surfaces are chosen to test the mesh improvement techniques. Curvature change is a good indicator of the uniformity of the node distribution on the unsmooth mesh and with it the initial mesh quality. In all the three cases, the unsmooth meshes contain elements with negative scaled Jacobian thus implying low mesh quality. Laplacian smoothing improves the overall quality of the meshes shown (Fig. 7c, Fig. 8c and Fig. 9c) as compared to the unsmooth meshes but does not guarantee a valid mesh in all examples. However, the parameterization-based (Fig. 7d, Fig. 8d and Fig. 9d) and projection-based (Fig. 7e, Fig. 8e and Fig. 9e) methods perform better resulting in improved mesh quality (Table 5, 6 and 7) as compared to Laplacian smoothing. For example, negative Jacobians that exist for the posterior portion of sheep vertebrae mesh obtained by Laplacian smoothing are eliminated with the techniques proposed in the paper. The results obtained between projection and parameterization-based smoothing are comparable with both the methods resulting in valid meshes. Laplacian smoothing works well for regions on the surface with low rate of change of curvature as is the case with phalanx bone (Fig. 7). Hence, mesh quality statistics obtained through Laplacian smoothing compare favorably with projection-based and parameterization-based methods (Table 2 and Table 5). For the regions with high curvature (Fig. 8b inset), Laplacian smoothing loses the geometric fidelity (Fig. 8c inset) as compared to
100
K. Shivanna, N. Grosland, and V. Magnotta
parametric (Fig. 8d inset) and projection (Fig. 8e inset) based methods. One more drawback of Laplacian smoothing is that it tends to fold the mesh (Fig. 9c top-inset) in the regions of concave boundaries (Fig. 9b top-inset). The parametric (Fig. 9d top-inset) and projection-based methods (Fig. 9e top-inset) avoid mesh folding thus improving the mesh quality. Hence, mesh quality statistics for optimization methods show dramatic improvement compared with Laplacian smoothing for sheep vertebra (Table 4). Even though parametric and projection-based methods yield valid meshes, the location of nodes in a converged solution is not identical because, the optimization paths for the two methods are not identical (Fig. 6e). The contour of the objective function of an individual node is convex but the local objective function is not [19]. The local objective function can contain multiple local minima and hence the difference in the location of nodes. Fig. 7f, Fig. 8f and Fig. 9f show the overlaid meshes from parametric and projection methods for all the three examples. If the underlying surface definition contains non-triangular elements, the elements can be triangulated and the proposed method applied. If the triangulation is not allowed, the procedure described in the literature can be used [14]. For planar and volumetric meshes, the optimization path is a straight line and can easily be stored as a vector. For non-planar meshes, the optimization path is made of segments of lines that lie on the underlying surface. The implementation of global optimization becomes difficult for non-planar meshes because, the optimization paths for all the nodes have to be stored and the intermediate locations of the nodes for fractional step lengths have to be computed. Here local optimization is used because; every node is moved to its best possible location one by one. If the node moves out of a cell, the optimization starts afresh thus simplifying the implementation.
4 Conclusion Enhancements/new techniques for non-planar quadrilateral surface mesh improvement are presented. A modified untangling function for quadrilateral meshes based on node normals is proposed. Two techniques, (1) parameterization-based and (2) projection-based method for optimization direction computation are presented. The parameterization-based method that improves the surface mesh quality while maintaining the mesh fidelity has been enhanced and presented herein. An analytical framework for, (1) mesh quality metrics and (2) optimization direction computation in physical and parametric space has been presented. A new projection-based optimization direction computation has been devised and implemented and its performance is comparable to that of the parametric method. The proposed methods have been successfully tested on quadrilateral surface meshes with underlying triangulated surfaces. The results are superior to those obtained by the Laplacian smoothing method.
Quadrilateral Surface Mesh Improvement
101
References 1. Blacker, T.D., Meyers, R.J.: Seams and wedges in plastering: A 3D hexahedral mesh generation algorithm. Engineering with Computers 2(9), 83–93 (1993) 2. Grosland, N.M., et al.: IA-FEMesh: An open-source, interactive, multiblock approach to anatomic finite element model development. Computer Methods and Programs in Biomedicine 94(1), 96–107 (2009) 3. Knupp, P.: Hexahedral and tetrahedral mesh untangling. Engineering With Computers 17(3), 261–268 (2001) 4. Knupp, P.M.: A method for hexahedral mesh shape optimization. International Journal for Numerical Methods in Engineering 58(2), 319–332 (2003) 5. Freitag, L.A., Ollivier-Gooch, C.: Tetrahedral mesh improvementd using swapping and smoothing. International Journal for Numerical Methods in Engineering 40(21), 3979–4002 (1997) 6. Field, D.: Laplacian smoothing and delaunay triangulations. Communications in Applied Numerical Methods 4, 709–712 (1988) 7. Knupp, P.M.: Achieving finite element mesh quality via optimization of the Jacobian matrix norm and associated quantities. Part I- a framework for surface mesh optimization. International Journal for Numerical Methods in Engineering 48, 401–420 (2000) 8. Knupp, P.M.: Achieving finite element mesh quality via optimization of the Jacobian matrix norm and associated quantities. Part II- a framework for volume mesh optimization and the condition number of the Jacobian matrix. International Journal for Numerical Methods in Engineering 48, 1165–1185 (2000) 9. Chen, Z., Tristano, J.R., Kwok, W.: Construction of an objective function for optimization based smoothing. Engineering with Computers 20, 184–192 (2004) 10. Yin, J., Teodosiu, C.: Constrained mesh optimization on the boundary. Engineering with Computers 24, 231–240 (2008) 11. Frey, P.J., Borouchaki, H.: Geometric surface mesh optimization. Computing and Visualization in Science 1(3), 113–121 (1998) 12. Zhang, Y., Bajaj, C., Xu, G.: Surface smoothing and quality improvement of quadrilateral/hexahedral meshes with geometric flow. Communications in Numerical Methods in Engineering 25(1), 1–18 (2007) 13. Escobar, J.M., Montero, G., Montenegro, R., Rodriguez, E.: An algebraic method for smoothing surface triangulations on a local parametric space. International Journal for Numerical Methods in Engineering 66, 740–760 (2006) 14. Garimella, R., Shashkov, M., Knupp, P.: Triangular and quadrilateral surface mesh quality optimization using local parametrization. Computer Methods in Applied Mechanics and Engineering 193, 913–928 (2004) 15. Garimella, R.V., Shashkov, M.J.: Polygonal surface mesh optimization. Engineering with Computers 20, 265–272 (2004) 16. Pbay, P., Thompson, D., Shepherd, J., Knupp, P., Lisle, C., Magnotta, V., Grosland, N.: New Applications of the Verdict Library for Standardized Mesh Verification Pre, Post, and End-to-End Processing. In: Proceedings of the 16th International Meshing Roundtable (2007) 17. ANSYS Inc. Theory reference, Release 9.0, Ch. 13 (2004) 18. Knupp, P.M.: Algebraic mesh quality metrics for unstructured initial meshes. Finite Elements in Analysis and Design 39(3), 217–241 (2003) 19. Diachin, L.F., Knupp, P.M., Munson, T., Shontz, S.: A comparison of two optimization methods for mesh quality improvement. Engineering with Computers 22(2), 61–74 (2006)
102
K. Shivanna, N. Grosland, and V. Magnotta
Appendix 1. Jacobian computation (x − l1 ) JP2 = y
− l1 0
,
JP3 =
−x −y
(l1 − x) −y
(14)
2. Determinant of Jacobian and Frobenius norm |JP1 | = |JP2 | = |JP3 | = |J| = l1 y 2
JP1 = l1 2 + l3 2 ,
2
JP2 = l1 2 + l2 2 ,
(15) 2
JP3 = l2 2 + l3 2
(16)
3. Untangling function derivatives ∂fPi ∂αPi abs(αPi ) = ( + 1) ∂X ∂X αPi
(17)
∂αPi ∂nPi ∂|JPi | =n· |JPi | + (n · nPi − cos(θ)) (18) ∂X ∂X ∂X ⎛ ⎞ ⎛ ⎞ ⎛ ⎞ 0 Z1 − Z2 Y2 − Y1 ∂nPi ∂n ∂n P P i i ⎠, 0 = ⎝ Z2 − Z1 ⎠ , =⎝ = ⎝ X1 − X2 ⎠ ∂X ∂Y ∂Z Y1 − Y2 Y1 − Y2 0 (19) 4. Shape improvement function derivatives |JPi | ∂κPi = ∂X
∂JPi 2 X
+
∂|JPi | 2 X JPi 2
2|JPi |
∂|JPi | l1 (X − X1 ) − x(X2 − X1 ) = ∂X y 2
2
2
(20)
(21)
∂ JP1 ∂ JP2 ∂ JP3 = 2(X−X1 ), = 2(X−X2 ), = 2(2X−(X1+X2 )) ∂X ∂X ∂X (22) Similar equations can be written for coordinates Y and Z.
Efficient Solution of Elliptic Partial Differential Equations via Effective Combination of Mesh Quality Metrics, Preconditioners, and Sparse Linear Solvers Jibum Kim, Shankar Prasad Sastry, and Suzanne M. Shontz Department of Computer Science and Engineering The Pennsylvania State University University Park, PA 16802
[email protected],
[email protected],
[email protected]
Abstract. In this paper, we study the effect the choice of mesh quality metric, preconditioner, and sparse linear solver have on the numerical solution of elliptic partial differential equations (PDEs). We smoothe meshes on several geometric domains using various quality metrics and solve the associated elliptic PDEs using the finite element method. The resulting linear systems are solved using various combinations of preconditioners and sparse linear solvers. We use the inverse mean ratio and vertex condition number metrics in addition to interpolation-based, scale-variant and scale-invariant metrics. We employ the Jacobi, incomplete LU, and SSOR preconditioners and the conjugate gradient, minimum residual, generalized minimum residual, and bi-conjugate gradient stabilized solvers. We focus on determining the most efficient quality metric/preconditioner/linear solver combination for the numerical solution of various elliptic PDEs.
1 Introduction Discretization methods, such as the finite element (FE) method, are commonly used in the numerical solution of partial differential equations (PDEs). The accuracy of the computed PDE solution depends on the degree of the approximation scheme, the number of elements in the mesh [1], and the quality of the mesh [2, 3]. In addition, the stability and convergence of the finite element method is affected by poor quality elements [4]. Analytical studies have been performed at the intersection of meshing and linear solvers. For example, mathematical connections between mesh geometry, interpolation errors, and stiffness matrix conditioning for triangular and tetrahedral finite element meshes have been studied [5]. A mesh and solver co-adaptation strategy for anisotropic problems has been developed [6]. Relationships between the spectral condition number of the stiffness matrix and mesh geometry for second-order elliptic problems have been determined [7].
104
J. Kim, S.P. Sastry, and S.M. Shontz
Several computational studies have been performed which examined the connections between finite element meshes and linear solvers in various contexts. For example, the effect of unstructured meshes on the preconditioned conjugate gradient solver performance for the solution of the Laplace and Poisson equations has been examined [8, 9]. In [10], the relative performance of multigrid methods for unstructured meshes was studied on fluid flow and radiation diffusion problems. Trade-offs associated with the cost of mesh improvement in terms of solution efficiency has been examined for fluids [11, 12]. In this paper, we examine the connections between geometry, mesh smoothing, and solution convergence for elliptic PDEs via an engineering approach. In particular, we seek answers to the following questions pertaining to the solution of an elliptic PDE on a given geometric domain. Which mesh quality metric should be used to smoothe the initial mesh? What is the most efficient combination of mesh quality metric, preconditioner, and solver for solving an elliptic PDE? What is the effect of modifying the PDE coefficients and boundary conditions on the answers to the above questions? Our goal is to determine the best quality metric/preconditioner/linear solver combination which results in a small condition number of the preconditioned matrix and fast solver convergence for a given PDE, geometric domain, and initial mesh. To answer the above questions, we use Mesquite [13], a mesh quality improvement toolkit, and PETSc [14], a linear solver toolkit, to perform a numerical study investigating the performance of several mesh quality metrics, preconditioners, and sparse linear solvers on the solution of various elliptic PDEs of interest. The quality metric/preconditioner/linear solver combinations are compared on the basis of efficiency in solving several elliptic PDEs on realistic unstructured tetrahedral finite element meshes. We use Mesquite and PETSc in their native state with the default parameters. Only these two toolkits are employed so that differences in solver implementations, data structures, and other such factors would not influence the results.
2 Finite Element Solution of Elliptic PDEs We consider the solution of second-order elliptic PDEs using the finite element (FE) method. An elliptic PDE on a geometric domain, Ω, is defined as −Δu + au = f on Ω,
(1)
where a and f are given functions. If a = 0, (1) reduces to Poisson’s equation. We consider both Dirichlet and generalized Neumann boundary conditions on the boundary, ∂Ω. The FE method [15] is used to discretize the domain, Ω, and to discretize the PDE resulting in the linear system Aξ = b.
(2)
Triangular and tetrahedral meshes are used to discretize the domain, Ω, in 2D and 3D, respectively. The approximate solution, ξ, of u can be computed
Efficient Elliptic PDE Solution via Mesh Smoothing and Linear Solvers
105
by solving (2). The matrix A is given by A=K+M +N , where K is the stiffness matrix; M is the mass matrix, and N is a matrix containing boundary information. For elliptic PDEs, K is a symmetric positive definite or nonnegative definite matrix, and M is a symmetric positive definite matrix [7]. The vector b is the sum of two vectors, F and G. For a two-dimensional → geometric domain with generalized Neumann boundary conditions, − n · (∇ u)+du=g, on ∂Ω, where d and g are given functions. Furthermore, the K, M , N matrices and the F and G vectors can be computed as follows [15]: " " Ki,j = (φi · φj ) dx dy; Mi,j = (aφi · φj ) dx dy; Ω
Ω
"
" (dφi · φj ) ds; Fi =
Ni,j = ∂Ω
" (f φi ) dx dy; Gi =
Ω
(gφi ) ds, ∂Ω
where φi and φj are piecewise linear basis functions.
3 Mesh Quality Metrics Table 1 provides the notation used to define the following mesh quality metrics: inverse mean ratio (IMR) [16], vertex condition number (VCN) [17], an interpolation-based, scale-variant metric (SV) [5], and an interpolationbased, scale-invariant metric (SI) [5]. Table 2 defines IMR, VCN, SV, and SI. For IMR and VCN, a lower value indicates a higher quality element. For SV and SI, a higher value indicates a higher quality element.
Table 1. Notation used in the definition of mesh quality metrics in Table 2. The above notation is for the 3D case. Similar quantities can be defined in 2D. Notation a, b, c, and d C = [b⎛− a; c − a;⎞ d − a] 1 12 12 ⎜ 0 √3 √3 ⎟ W =⎝ 2 √6 ⎠ 0 0 √23 Ar1, Ar2 , Ar3 , and Ar4 lij Vol Area s1 , s2 , and s3
Definition Position vectors for vertices in a tetrahedral element Jacobian of a tetrahedral element Incidence matrix for an equilateral tetrahedron Areas of the triangular faces in a tetrahedral element Length of the edge common to triangular face i and j in a tetrahedral element Volume of a tetrahedral element Area of a triangular element Edge lengths of a triangular element
106
J. Kim, S.P. Sastry, and S.M. Shontz Table 2. The mesh quality metric definitions Quality Metric
Formula
IMR
% % & &2 %CW −1 %2 / (3 &det(CW −1 )& 3 ) [16] F
VCN
C F C −1 F [17]
SV (2D)
Area/s1 s2 s3 [5]
SV (3D)
(Vol
SI (2D)
Area/(s1 s2 s3 ) 3 [5]
SI (3D)
' 3 ' 4 2 Vol ( 4i=1 Ari )/( 1≤i<j≤4 Ari Arj lij ) [5]
'4 i=1
Ari )/(
' 1≤i<j≤4
2 Ari Arj lij ) [5]
2
4 Mesh Optimization We denote the elements of a mesh and the number of mesh elements by E and |E|, respectively. The overall quality of the mesh, Q, is a function of the individual element qualities, qi , where qi is the quality of the ith element in the mesh. The mesh quality depends on both the choice of qi , which is described in Section 3, and the function used to combine them. For the IMR and VCN quality metrics, we define the overall mesh quality, Q, as the sum of squares of the individual elements’ qualities: Q=
|E|
qi2 .
(3)
i=1
For the SV and SI quality metrics, we define the overall mesh quality, Q, as the sum of the squares of the reciprocal of the individual elements’ qualities: Q=
|E| 1 . q2 i=1 i
(4)
We use the Fletcher-Reeves nonlinear conjugate gradient method [18] in Mesquite [13] to minimize Q (defined by either (3) or (4)). Mesquite employs a line search version of the nonlinear conjugate gradient method.
5 Iterative Linear Solvers Four iterative Krylov subspace methods are employed to solve the preconditioned linear system. The conjugate gradient (CG) solver is a well-known
Efficient Elliptic PDE Solution via Mesh Smoothing and Linear Solvers
107
iterative method for solving systems with symmetric positive definite matrices. It produces a sequence of orthogonal vectors on successive iterations. Let P be the preconditioner (to be described in Section 6). The convergence rate of the preconditioned CG method depends upon the condition number, κ, of P −1 A. In the 2-norm, κ can be approximated as % % % %−1 κ2 (P −1 A) = %P −1 A%2 %P −1 A%2 ≈ λmax (P −1 A)/λmin (P −1 A), where λmax and λmin are the maximum and minimum eigenvalues of P −1 A, respectively. The fastest convergence occurs when eigenvalues are clustered around the same non-null value and, hence, κ is near 1. The minimal residual (MINRES) algorithm solves linear systems with symmetric indefinite matrices. It generates a sequence of orthogonal vectors and attempts to minimize the residual in each iteration. Similar to CG, a small condition number for P −1 A and clustering of eigenvalues around the same non-null value results in fast convergence. For nonsymmetric matrices, the generalized minimal residual (GMRES) method is one of the most widely used iterative solvers. Similar to CG and MINRES, GMRES computes orthogonal vectors on each iteration; however, the entire sequence needs to be stored. Therefore, the version of GMRES which restarts GMRES every m steps, i.e., GMRES(m), is used in practice. It is known that a large value of m is effective in decreasing the convergence time; however, the optimal value of m depends upon the problem [19]. The biconjugate gradient stabilized (Bi-CGSTAB) method is a biorthogonalization technique, which generates two sets of biorthogonal vectors instead of producing long orthogonal vectors. Bi-CGSTAB is known to have comparable or even faster convergence than other biorthogonalization methods such as the conjugate gradient squared method. However, Bi-CGSTAB sometimes shows an irregular convergence rate similar to other biorthogonalization methods [20]. Bi-CGSTAB and GMRES are the most widely-used iterative methods for solving systems based on nonsymmetric matrices.
6 Preconditioners The objective of introducing a preconditioner, P , into the solution of a linear system is to make the system easier to solve, whereby reducing the convergence time of the iterative solver. The reader is referred to [21] (and the references therein) for further information on iterative solvers and preconditioners. In this paper, four preconditioners are employed. The first is the Jacobi preconditioner, which is simply the diagonal of A. The second is the symmetric successive over relaxation (SSOR) preconditioner. SSOR is similar to Jacobi but decomposes A into L (the strictly lower triangular part), D (the diagonal), and U (the strictly upper triangular part), i.e., A=L+D+U . The SSOR preconditioner is given by
108
J. Kim, S.P. Sastry, and S.M. Shontz
P = (D − ωL)D−1 (D − ωU ), where ω represents the relaxation coefficient. The incomplete LU (ILU) preconditioner with level zero fill-in (ILU(0)) and level one fill-in (ILU(1)) are used as the third and fourth preconditioners, respectively. The basic idea of the ILU preconditioner is to determine ˜ and upper triangular (U ˜ ) matrices such that the matrix L ˜U ˜ -A satlower (L) isfies certain constraints [21]. The ILU preconditioner works well for many problems, but it fails when it encounters negative or zero pivots.
7 Numerical Experiments Three experiments are performed to investigate the following questions. (1) Which mesh quality metric should be used to smoothe the initial mesh? (2) What is the most efficient combination of mesh quality metric, preconditioner, and solver for solving an elliptic PDE? (3) What is the effect of modifying the PDE coefficients and boundary conditions on the answers to the above questions? Table 3 summarizes the experiments and corresponding PDE problems to be solved. In Experiments 7.1 and 7.2, we focus on solving Poisson’s equation with Dirichlet boundary conditions in order to obtain insight on the above questions and then extend the results to other PDE problems in Experiment 7.3. The machine employed for this study is equipped with an Intel Xeon x550 processor (2.67 GHz) and 24GB of RAM [22].
Table 3. Listing of numerical experiments. The letters (a) through (e) represent the five PDE problems under consideration. Exp. Exp. No. Name. 7.1 Choice of metric 7.2 Best combination 7.3 Modification of PDE coefficients and boundary conditions
PDE Problems (a) −Δu=1 on Ω, u=0 on ∂Ω −Δu=1 on Ω, u=0 on ∂Ω (b) −Δu+100u=1 on Ω, u=0 on ∂Ω → (c) −Δu+100u=1 on Ω, − n · (∇ u)+100u=1 on ∂Ω → − (d) −Δu=1 on Ω, n · (∇ u)+u=1 on ∂Ω → (e) −Δu=1 on Ω, − n · (∇ u)+100u=1 on ∂Ω
Geometric Domains. The four geometric domains considered in our experiments are shown in Figure 1. Circle and gear are 2D problems, whereas bevel and drill are 3D problems. Triangle [23] and Tetgen [24] were used to generate initial meshes. Half the interior vertices in each mesh were perturbed to create test meshes that were further from optimal. Properties of the test meshes and the corresponding finite element matrices are shown in Table 4. Here, nnz is the number of non-zeros in matrix A.
Efficient Elliptic PDE Solution via Mesh Smoothing and Linear Solvers
(a) Circle mesh
(b) Gear mesh
(c) Bevel mesh
109
(d) Drill mesh
Fig. 1. Coarse initial meshes on the circle, gear, bevel, and drill geometric domains indicative of the actual initial meshes
Table 4. Properties of meshes on geometric domains and matrix A mesh # vertices # elements Circle (2D) 508,173 1,014,894 Gear (2D) 499,842 995,142 Bevel (3D) 492,003 3,001,591 Drill (3D) 500,437 3,084,942
nnz 3,554,395 3,489,810 7,583,137 7,757,509
Mesh Smoothing. In order to improve the quality of each mesh, a local implementation of the nonlinear conjugate gradient mesh smoothing method (described in Section 4) was used in conjunction with the mesh quality metrics (described in Section 3). The minimum, average, and maximum mesh qualities before and after smoothing for the circle, gear, bevel, and drill are shown in Table 5. For our experiments, accurate mesh smoothing corresponds to five iterations of smoothing, as the mesh quality did not improve significantly after five iterations. Similarly, one iteration of smoothing was employed for inaccurate mesh smoothing, as a significant improvement in the mesh quality was observed after just one iteration. The results in Table 5 indicate that, in addition to an improvement in the average mesh quality, the quality of the worst mesh elements improves as accurate mesh smoothing is applied. Finite Element Solution. The FE method described in Section 2 is used to discretize the domain, Ω, and to generate a linear system of the form Aξ=b. PETSc [14] is used to generate the preconditioners, P , and to solve the linear system, P −1 Aξ=P −1 b. We employ the solvers and preconditioners described in Sections 5 and 6, respectively, to solve the preconditioned linear system. Table 6 enumerates the 16 preconditioner-solver combinations used in our experiments. The default parameters for each preconditioner and solver were employed except for the GMRES restart value. We employed a restart value of 100 which was the most effective in preliminary experiments. This is consistent with the fact that larger m values often result in decreased solver time [19].
110
J. Kim, S.P. Sastry, and S.M. Shontz
Table 5. The quality of the initial, inaccurately smoothed, and accurately smoothed meshes for the circle, gear, bevel, and drill geometric domains (a) 2D circle and gear meshes Metric Smoothing IMR
VCN
SV
SI
Initial Inaccurate Accurate Initial Inaccurate Accurate Initial Inaccurate Accurate Initial Inaccurate Accurate
min 1.000 1.000 1.000 1.000 1.001 1.000 5.80e-4 4.21e-4 7.18e-4 1.107 1.113 1.117
Circle avg 1.399 1.123 1.039 1.393 1.113 1.039 3.35e-3 2.87e-3 2.72e-3 1.372 1.198 1.149
max 1916 53.527 4.727 479 10.726 2.920 4.595 0.220 0.028 1709 40.526 3.686
min 1.000 1.000 1.000 1.000 1.000 1.000 2.24e-3 8.30e-4 7.66e-4 1.115 1.108 1.109
Gear avg max 1.570 339025 1.066 153.772 1.043 6.343 1.503 67806 1.063 30.196 1.042 3.535 5.41e-3 1194 3.60e-3 0.736 3.53e-3 0.055 1.589 299877 1.159 87.734 1.145 3.972
(b) 3D bevel and drill meshes Metric Smoothing IMR
VCN
SV
SI
Initial Inaccurate Accurate Initial Inaccurate Accurate Initial Inaccurate Accurate Initial Inaccurate Accurate
min 1.000 1.000 1.000 1.069 1.056 1.031 0.262 0.199 0.200 1.000 1.000 1.000
Bevel avg 1.501 1.320 1.233 1.927 1.367 1.262 3.492 2.505 2.210 2.018 1.471 1.316
max 1235 63.656 26.459 1537 39.244 27.157 65652 322 110.355 38421 243.199 67.963
min 1.000 1.000 1.000 1.067 1.039 1.030 0.208 0.204 0.206 1.000 1.000 1.000
Drill avg max 1.487 2132 1.311 15.568 1.226 12.334 1.887 3767 1.362 5.272 1.258 3.756 0.710 32477 0.518 29.588 0.457 6.492 1.967 86880 1.458 272.944 1.305 17.744
The default stopping criteria in PETSc were employed. For example, the absolute tolerance, abstol, and the relative tolerance, rtol, are set to 1e-50 and 1e-05, respectively. The maximum number of iterations for solving the preconditioned linear system is set to 10,000. When the preconditioned linear system is solved, ξ0 is set to the default value of 0. The preconditioned linear system converges on the ith iteration if the following inequality is satisfied:
ri < max(rtol r0 , abstol), where ri is the residual at the i
th
iteration and r0 is the initial residual.
(5)
Efficient Elliptic PDE Solution via Mesh Smoothing and Linear Solvers
111
Table 6. The sixteen combinations of preconditioners and solvers. For example, 10 refers to using the ILU(0) preconditioner with the GMRES solver. Preconditioner Jacobi SSOR ILU(0) ILU(1)
Solver CG GMRES MINRES 1 2 3 5 6 7 9 10 11 13 14 15
BI-CGSTAB 4 8 12 16
Timing. In our experiments, the total time is defined as the sum of the smoothing time and the solver time. The smoothing time is the time to achieve an accurately smoothed mesh as described in Section 4 except for our preliminary experiments which also included inaccurate mesh smoothing. The solver time is the time the solver takes to satisfy (5) and includes the time to generate P and to solve P −1 Aξ=P −1 b. When the linear system diverges or does not converge, we report failure. Inaccurate Mesh Smoothing. For our preliminary experiments, we consider solving Poisson’s equation with Dirichlet boundary conditions, i.e., problem (a) in Table 3, on inaccurately and accurately smoothed meshes for a given domain. We consider inaccurate mesh smoothing, as engineers often perform inaccurate mesh smoothing in practice. Experimental results for inaccurate and accurate mesh smoothing are shown in Table 7. For this experiment, the SSOR preconditioner with the GMRES solver is employed. These results are representative of the results obtained when other preconditioner-solver combinations are used. Table 7 shows the smoothing time and the solver time when employing various amounts of mesh smoothing for the three mesh quality metrics described in Section 3. We observe the following rank ordering with respect to smoothing time: IMR < VCN < SV < SI. The ranking is in order of fastest to slowest. This rank ordering also holds true when we consider the smoothing and solver time together. The rank ordering between different quality metrics will be discussed in more detail in Section 7.1. Table 7 also shows that accurately smoothed meshes result in matrices with a lower condition number than those of inaccurately smoothed meshes. This results in a lower solver time for accurately smoothed meshes. However, in terms of the total time, inaccurately smoothed meshes result in faster total time than do accurately smoothed meshes for the SV and SI quality metrics because the smoothing time is very high for these two metrics. Because accurately smoothed meshes were observed to result in lower total time than inaccurately smoothed meshes, only accurately smoothed meshes are considered from here onwards.
112
J. Kim, S.P. Sastry, and S.M. Shontz
Table 7. Minimum and maximum eigenvalues, condition number, and timing (sec) as a function of quality metric and amount of mesh smoothing on a circle domain. Smoothing represents the number of smoothing iterations performed. NOS (no smoothing) describes the initial mesh. For this table, the SSOR preconditioner with the GMRES solver was employed. Mesh quality metrics NOS IMR VCN SV SI Smoothing 0 1 5 1 5 1 5 1 5 λmin (P −1 A) 1.8e-05 2.4e-5 2.7e-05 2.5e-05 2.7e-05 2.4e-05 2.7e-05 2.4e-05 2.7e-05 λmax (P −1 A) 1 1 1 1 1 1 1 1 1 κ(P −1 A) 55252 40822 36853 40347 36845 41979 37013 41411 36914 Smoothing 0 8 41 13 67 98 517 142 755 time Solver time 1448 905 630 951 771 1037 773 898 612 Total time 1448 913 671 964 838 1135 1290 1040 1367
7.1
Choice of Mesh Quality Metric
The goal of this experiment is to determine the best mesh quality metric for solving Poisson’s equation with Dirichlet boundary conditions based on efficiency and accuracy. Efficiency of the Solution. The time required to smoothe the test meshes using various quality metrics is shown in Table 8. If we consider the smoothing time alone, the following rank ordering is seen: IMR < VCN < SV < SI. This is because numerical computation of the IMR metric for mesh optimization is highly optimized in Mesquite. Numerical computation of the other mesh quality metrics, i.e., VCN, SV, and SI, are not as optimized and are less efficient to compute. The computation of SV and SI is also more expensive than the other two quality metrics.
Table 8. Mesh smoothing time (sec) for various mesh quality metrics Mesh Circle Gear Bevel Drill
Mesh quality metrics IMR VCN SV SI 41 67 517 755 39 65 523 784 146 208 270 366 159 213 277 377
Table 9 shows typical timing results for smoothing the bevel mesh according to the various quality metrics. In terms of the solver time, there is a significant difference between solving linear systems on smoothed versus nonsmoothed (NOS) meshes. After smoothing, the condition number of
Efficient Elliptic PDE Solution via Mesh Smoothing and Linear Solvers
113
Table 9. Minimum and maximum eigenvalues, condition number, and timing (sec) for the matrix P −1 A for the bevel meshes before and after smoothing. The ILU(0) preconditioner with the GMRES solver was used to solve the resulting linear system. Mesh quality metrics λmin (P −1 A) λmax (P −1 A) κ(P −1 A) Smoothing time Solver time Total
NOS IMR 0.005 0.0063 18.2 1.8 3216 285 0 159 3250 50 3250 209
VCN SV SI 0.0064 0.0063 0.0064 1.8 1.8 1.8 285 285 283 213 277 377 48 54 42 261 331 419
P −1 A decreases significantly, and the minimum and maximum eigenvalues move closer to 1. This results in faster convergence of the linear solution on the smoothed meshes. However, in terms of solver time, as long as the same preconditioner and solver are employed, there is little difference when various mesh quality metrics are used to smoothe the mesh, as the metrics essentially all try to generate equilateral elements, and there are no poorly shaped elements after smoothing. The element shapes in the mesh highly affect both the eigenvalues and the condition number of A. Equilateral elements result in a smaller condition number than do poorly shaped elements. Here, poorly shaped means elements with very small (near 0◦ ) or very large (near 180◦ ) dihedral angles [5]. Thus, when the preconditioner and solver are fixed, the choice of mesh quality metric does not significantly affect the condition number or the solver time. Further information on the relationship between eigenvalues and the condition number can be found in [5]. For the total time, the rank ordering amongst mesh quality metrics is: IMR < VCN < SV < SI. A similar trend was observed for meshes on the other domains when solving Poisson’s equation with Dirichlet boundary conditions, i.e., problem (a) in Table 3. Accuracy of the Solution. The exact solution of Poisson’s equation with Dirichlet boundary conditions (i.e., problem (a) in Table 3) on the unit circle is given by: u = (1 − x2 − y 2 )/4, where x and y denote the x and y vertex coordinates, respectively. We compare our FE solution, uh , with the exact solution to verify the accuracy of our solution. The discretization error, e, between the FE solution and the exact solution is defined as e = u − uh ∞ . Our results show that for all mesh quality metrics, e ≈ 1e − 4, for the unit circle domain in Table 4. Furthermore, the choice of metric does not affect the solution accuracy for meshes of this size (i.e., approximately 1M elements). 7.2
Best Combination of Metric, Preconditioner and Solver
In Section 7.1, we observed that IMR was the most efficient quality metric for smoothing when solving Poisson’s equation with Dirichlet boundary
114
J. Kim, S.P. Sastry, and S.M. Shontz
conditions (i.e., problem (a) in Table 3). In this experiment, we seek to determine the most efficient combination of mesh quality metric, preconditioner, and solver for this problem. The solver time as a function of the different mesh quality metrics for various preconditioner-solver combinations is presented in Table 10 for the circle, gear, bevel, and drill domains. The ’*’ entries in these tables correspond to preconditioner-solver combinations which either diverge or do not converge. In most cases, the best combinations, which have the fastest solver time, are the SSOR, ILU(0), and ILU(1) preconditioners with the CG solver (5, 9, and 13 in Table 6). The ILU(0) or ILU(1) preconditioners with the MINRES solver (7 and 11 in Table 6) show comparable performance. We observe that the best preconditioner varies with respect to the geometric domain and the mesh quality metric. However, the best solvers do not change in most cases. The CG and MINRES solvers consistently show better performance than do GMRES and Bi-CGSTAB. The main reason is that both CG and MINRES take advantage of the symmetry properties of P −1 A, because the solvers are designed for symmetric matrices. Table 10 also shows the number of iterations required to converge, which is an implementation-independent metric. In terms of the number of iterations required to converge, the ILU(1) preconditioner with the MINRES solver (15 in Table 6) outperforms other combinations. In many cases, the MINRES solver requires fewer iterations to converge than does the CG solver although the CG solver has a faster solver time than the CG solver. Note also that the ILU(0) preconditioner has a faster solver time than the ILU(1) preconditioner although the ILU(0) requires more iterations to converge. The least effective combination observed is the Jacobi preconditioner with the Bi-CGSTAB solver (4 in Table 6). In most cases, this combination diverges because the residual norm does not decrease. The Bi-CGSTAB solver shows irregular convergence behavior as was discussed in Section 5. The least efficient preconditioner-solver combination is the slowest combination which satisfies (5). In most cases, the least efficient combination is the Jacobi preconditioner with the GMRES solver (2 in Table 6). This combination sometimes does not converge due to the iteration limit. In terms of the solver time and the number of iterations required to converge, the choice of quality metric matters most when a poor combination of preconditioner and solver are used. For example, if we compare the solver time on the circle mesh for the ILU(0) preconditioner with the GMRES solver (2 in Table 6) amongst quality metrics (i.e., IMR and SV) in Table 10(a), the solver time for SV is 40% higher than it is for IMR. However, if a better combination is chosen (e.g., 5, 9, or 13 in Table 6), the difference between mesh quality metrics is not that significant. This demonstrates that the choice of preconditioner and solver is more significant than the choice of mesh quality metric in the solution of Poisson’s equation with Dirichlet boundary conditions.
Efficient Elliptic PDE Solution via Mesh Smoothing and Linear Solvers
115
Table 10. Linear solver time (sec) and number of iterations required to converge for problem (a) as a function of mesh quality metric for the 16 preconditioner-solver combinations (see Table 6) on the four geometric domains. A ’*’ denotes failure. For each quality metric, the numbers in the top and bottom rows represent the linear solver time and number of iterations to convergence, respectively. (a) Circle. (1-16 denote the preconditioner-solver combinations.) Metric
1 381 1305 377 1303 446 1441 350 1307
IMR VCN SV SI
2 3 * 212 * 921 * 195 * 843 * 262 * 1101 * 187 * 860
4 * * * * * * * *
5 166 593 179 594 165 609 155 594
6 631 2052 772 2349 773 2322 613 1934
7 137 357 154 402 165 392 139 384
8 134 361 144 361 156 407 160 361
9 127 530 128 530 146 541 139 531
10 631 1684 708 2120 911 2885 795 2010
11 174 398 155 381 157 387 216 376
12 * * * * * * * *
13 79 284 75 284 87 284 87 284
14 252 759 263 747 350 757 252 756
15 98 206 114 210 198 212 86 208
16 83 197 98 211 99 204 107 212
(b) Gear. (1-16 denote the preconditioner-solver combinations.) Metric
1 111 606 129 606 118 623 121 604
IMR VCN SV SI
2 913 2411 963 2360 542 2198 757 2352
3 4 142 106 430 428 93 * 381 * 101 * 426 * 102 * 426 *
5 6 62 236 257 475 66 164 257 475 61 143 257 477 65 171 257 475
7 8 67 82 171 153 62 82 169 152 67 33 176 166 81 70 181 153
9 10 71 191 233 426 54 220 233 427 53 161 239 440 49 172 233 427
11 73 146 53 163 61 162 70 154
12 64 174 56 165 * * 68 176
13 59 134 43 134 40 134 43 134
14 102 156 86 156 64 156 54 156
15 73 87 69 85 42 93 44 94
(c) Bevel. (1-16 denote the preconditioner-solver combinations.) Metric IMR VCN SV SI
1 79 190 113 190 64 190 66 191
2 263 343 239 342 169 342 140 343
34 117 * 126 * 106 * 126 * 63 * 130 * 79 * 131 *
5 59 72 64 72 39 72 37 72
6 76 88 65 88 60 88 54 88
7 54 54 91 53 47 52 57 52
8 51 48 71 48 47 48 42 48
9 44 62 37 62 32 62 32 62
10 50 67 48 67 54 67 42 68
11 42 47 39 46 41 47 42 47
12 69 49 77 49 44 49 49 49
13 63 43 59 43 49 43 46 43
14 51 39 55 39 46 39 45 39
15 76 27 61 27 52 27 55 28
16 169 35 85 35 62 36 135 35
(d) Drill. (1-16 denote the preconditioner-solver combinations.) Metric IMR VCN SV SI
1 169 282 110 281 132 281 120 282
2 260 496 260 495 222 495 386 496
3 101 170 95 167 91 179 140 181
4 * * * * * * * *
5 51 103 70 103 61 103 57 103
6 7 8 84 65 66 118 75 62 81 67 94 118 77 62 71 98 64 118 75 62 85 90 49 118 76 62
9 49 93 52 93 63 93 58 93
10 72 100 106 100 76 99 80 100
11 74 64 66 58 60 68 58 57
12 13 14 15 16 128 75 90 53 97 70 49 47 31 41 66 72 64 102 81 69 49 47 32 41 150 118 88 58 73 69 49 47 30 41 53 59 56 67 84 69 49 47 32 41
16 91 113 47 90 45 87 54 104
116
J. Kim, S.P. Sastry, and S.M. Shontz
Table 11 shows the solver time and total time for the most and least efficient preconditioner-solver combinations as a function of geometric domain and mesh quality metric. Combinations which did not converge according to (5) are not considered here. In terms of the solver time, the best mesh quality metric varies with respect to the geometric domain, and there is no clear winner. The results also show the importance of choosing an appropriate combination of preconditioner and solver. For example on the gear domain, the least efficient combination (2 in Table 6) is 94% slower than it is for the most efficient combination (13 in Table 6). We also observe that the rank ordering for mesh quality metrics described in Section 7.1 is consistent with the total time rank ordering. The table shows that IMR with the most efficient (best) combination of preconditioner and solver outperforms the other mesh quality metrics. The total time for IMR is 88% less than it is for SI, for the most efficient (i.e., ILU(1) with CG) combination. For the least efficient combination (i.e., Jacobi with GMRES), IMR is 51% faster than that of the least efficient quality metric, i.e., SI.
Table 11. Solver time (sec) and total time (sec) for problem (a) as a function of the best (most efficient) and worst (least efficient) combination of preconditioner and solver for various mesh quality metrics. Only combinations satisfying (5) are considered. (a) Solver time Mesh Best worst Best Gear worst Best Bevel worst Best Drill worst Circle
Mesh quality metrics IMR VCN SV SI 79 75 87 87 631 772 911 795 59 43 40 43 913 963 542 757 42 37 32 32 263 239 169 140 49 52 61 49 260 260 222 386
(b) Total time Mesh Best worst Best Gear worst Best Bevel worst Best Drill worst Circle
Mesh quality metrics IMR VCN SV SI 120 142 604 842 672 839 1428 1550 98 108 563 827 952 1028 1065 1541 188 245 302 398 409 447 439 506 208 265 338 426 419 473 499 763
Efficient Elliptic PDE Solution via Mesh Smoothing and Linear Solvers
7.3
117
Modifying the PDE Coefficients and Boundary Conditions
In this experiment, we modify both the PDE coefficients and boundary conditions and investigate whether or not the previous conclusions hold true for other elliptic PDE problems (i.e., problems (b)-(e) in Table 3). We first investigate the effect that including the mass matrix, M , has on the best combination of mesh quality metric, preconditioner, and solver for problems (b) and (c) in Table 3. Problem (b) and (c) represent an elliptic PDE with a mass matrix and Dirichlet and generalized Neumann boundary conditions, respectively. Table 12 shows the solver time and the number of iterations required to converge for these two problems. For this experiment, the IMR metric on the bevel domain is employed. Tables 12(a) and 12(b) represent the linear solver time and the number of iterations required to converge for problems (b) and (c), respectively. Similar trends are observed when other mesh quality metrics are employed. Interestingly, in terms of the solver time, the worst combination of preconditioner and solver is different from the previous results obtained for Poisson’s equation with Dirichlet boundary conditions. For Poisson’s equation with Dirichlet boundary conditions, the worst combination was the Jacobi preconditioner with the Bi-CGSTAB or GMRES solver (4 and 2 in Table 6). However, after we add the mass matrix with a=100 in (1), the worst combinations are the ILU(1) preconditioner with the CG or GMRES solver (13 and 14 in Table 6). In most cases, the best combination is the ILU(0) preconditioner with the MINRES solver (11 in Table 6). Different from Poisson’s equation, the solver time of the ILU(1) preconditioner with the CG or MINRES solver on problem (b) is up to 82% larger than it is for the most efficient combination of preconditioner and solver. This trend also occurs for other values of the PDE coefficients, such as a = 10, 50 in (1). This example shows that the best and worst combinations of the preconditioner and solver vary due to the addition of the mass matrix. However, in terms of the number of iterations required to converge, the worst combination (13 and 14 in Table 6) requires only two iterations to converge, mainly due to the slow generation time of the ILU(1) preconditioner for these cases. The observed trends are similar for problems (b) and (c). In terms of the smoothing time, the rank ordering amongst different quality metrics remains the same, i.e., IMR < VCN < SV < SI. In terms of the solver time, the choice of quality metric does not affect the results significantly. The most efficient combination of the mesh quality metric, preconditioner, and solver for solution of these elliptic PDEs is the IMR quality metric with the ILU(0) preconditioner and the MINRES solver. This is consistent with those obtained when solving Poisson’s equation with Dirichlet boundary conditions. However, the least efficient combination is now the ILU(1) preconditioner with the GMRES solver (14 in Table 6). Second, problems (d) and (e) in Table 3, are solved to see the effect of modifying the boundary conditions. Table 12 shows the solver time and the number of iterations required to converge for the IMR quality metric on the bevel domain. The other mesh quality metrics show similar trends. Tables 12(a) and
118
J. Kim, S.P. Sastry, and S.M. Shontz
Table 12. Linear solver time (sec) and number of iterations required to converge as a function of PDE coefficients and boundary conditions on the bevel domain. A ’*’ denotes failure. For this experiment, the IMR quality metric is used. The keys for the PDE problems and the preconditioner-solver combinations are given in Tables 3 and 6, respectively.
PDE problem (b) (c) PDE problem (d) (e)
1 155 185 83 188
1 3 10 6 16
2 193 335 179 349
Preconditioner-Solver 2 34 5 6 7 8 9 10 5 3 3 11 3 4 4 6 4 9 66 5534 3 3 10 9 8 8555 7 8 15 10 9 9955 8 8
Combinations 11 12 13 14 15 5 4 14 32 17 2 2 2 2 2 8 8 19 17 18 4 6 5 5 3
16 17 2 21 3
Preconditioner-Solver Combinations 3 4 5 6 7 8 9 10 11 12 13 74 * 44 162 93 41 57 64 52 85 96 134 * 77 96 58 48 71 90 50 57 37 105 112 47 55 61 52 42 42 62 61 62 131 133 72 88 54 48 60 72 46 51 34
14 98 36 45 34
15 50 27 59 23
16 58 30 71 32
12(b) represent the solver time and the number of iterations required to solve problems (d) and (e) in Table 3, respectively. Experimental results show that the most efficient mesh quality metric is still IMR if smoothing and solver time are considered together. The rank ordering amongst the various quality metrics is as follows: IMR < VCN < SV < SI. The least efficient combination of preconditioner and solver is the Jacobi preconditioner with the GMRES solver (2 in Table 6), which is consistent with previous results. There are multiple best combinations, e.g., the SSOR preconditioner with the CG solver (5 in Table 6). The solver time of the best combination is up to 77% faster than it is for the least efficient combination. However, the best combinations are similar to those seen for the previous PDE problems.
8 Conclusions and Future Work For all elliptic PDEs considered, the IMR metric is the most efficient. The least efficient mesh quality metric is SI. The best preconditioner-solver combination varies with respect to the PDE. For Poisson’s equation, the most efficient preconditioner-solver combinations, which have the fastest solver time, are the SSOR, ILU(0), and ILU(1) preconditioners with the CG solver. The ILU(0) or ILU(1) preconditioner with the MINRES solver shows comparable performance. The least effective combination observed is the Jacobi preconditioner with the Bi-CGSTAB solver, which always diverged. In many cases, the least efficient combination is the Jacobi preconditioner with the GMRES solver. In terms of the total time, IMR is 88% faster than it is for SI if the
Efficient Elliptic PDE Solution via Mesh Smoothing and Linear Solvers
119
most efficient preconditioner-solver combination is employed. For the least efficient combination, IMR is still 51% faster than it is for SI. Modifying the coefficients and boundary conditions of the elliptic PDEs effects the efficiency ranking of the preconditioner-solver combinations. The efficiency rankings are more sensitive to modifications in the PDE coefficients than to modifications in the boundary conditions. Unlike the solution of Poisson’s equation with Dirichlet boundary conditions, the ILU(1) preconditioner with the CG or MINRES solver shows inefficient performance, in terms of the solver time, on elliptic PDEs involving a mass matrix. In addition, the solver time of the ILU(1) preconditioner with the CG or MINRES solver is up to 82% greater than it is for the most efficient combination of preconditioner and solver. However, the rank ordering amongst quality metrics is the same as it is for Poisson’s equation. For future research, we will investigate the relationship between the choice of mesh quality metric and the efficient solution of parabolic and hyperbolic PDEs on anisotropic unstructured meshes.
Acknowledgements The authors would like to thank Anirban Chatterjee and Padma Raghavan for interesting the third author in this area of research and Nicholas Voshell for helpful discussions. This work was funded in part by NSF grant CNS 0720749 and an Institute for Cyberscience grant from The Pennsylvania State University. This work was supported in part through instrumentation funded by the National Science Foundation through grant OCI-0821527.
References 1. Babuska, I., Suri, M.: The p and h-p versions of the finite element method, basic principles, and properties. SIAM Rev. 35, 579–632 (1994) 2. Berzins, M.: Solution-based mesh quality for triangular and tetrahedral meshes. In: Proc. of the 6th International Meshing Roundtable, Sandia National Laboratories, pp. 427–436 (1997) 3. Berzins, M.: Mesh quality - Geometry, error estimates, or both? In: Proc. of the 7th International Meshing Roundtable, Sandia National Laboratories, pp. 229–237 (1998) 4. Fried, E.: Condition of finite element matrices generated from nonuniform meshes. AIAA Journal 10, 219–221 (1972) 5. Shewchuk, J.: What is a good linear element? Interpolation, conditioning, and quality measures. In: Proc. of the 11th International Meshing Roundtable, Sandia National Laboratories, pp. 115–126 (2002) 6. Du, Q., Huang, Z., Wang, D.: Mesh and solver co-adaptation in finite element methods for anisotropic problems. Numer. Methods Partial Differential Equations 21, 859–874 (2005) 7. Du, Q., Wang, D., Zhu, L.: On mesh geometry and stiffness matrix conditioning for general finite element spaces. SIAM J. Numer. Anal. 47(2), 1421–1444 (2009)
120
J. Kim, S.P. Sastry, and S.M. Shontz
8. Ramage, A., Wathen, A.: On preconditioning for finite element equations on irregular grids. SIAM J. Matrix Anal. Appl. 15, 909–921 (1994) 9. Chatterjee, A., Shontz, S.M., Raghavan, P.: Relating Mesh Quality Metrics to Sparse Linear Solver Performance. In: SIAM Computational Science and Engineering, Costa Mesa, CA (2007) 10. Mavripilis, D.: An assessment of linear versus nonlinear multigrid methods for unstructured mesh solvers. J. Comput. Phys. 175, 302–325 (2002) 11. Batdorf, M., Freitag, L., Ollivier-Gooch, C.: Computational study of the effect of unstructured mesh quality on solution efficiency. In: Proc. of the 13th CFD Conference. AIAA, Reston (1997) 12. Freitag, L., Ollivier-Gooch, C.: A cost/benefit analysis of simplicial mesh improvement techniques as measured by solution efficiency. Internat. J. Comput. Geom. Appl. 10, 361–382 (2000) 13. Brewer, M., Freitag Diachin, L., Knupp, P., Leurent, T., Melander, D.: The Mesquite Mesh Quality Improvement Toolkit. In: Proc. of the 12th International Meshing Roundtable, Sandia National Laboratories, pp. 239–250 (2003) 14. Balay, S., Buschelman, K., Gropp, W.D., Kaushik, D., Knepley, M.G., McInnes, L.C., Smith, B.F., Zhang, H.: PETSc Webpage (2009), http://www.mcs.anl.gov/petsc 15. Becker, E.B., Carey, G.F., Oden, J.T.: Finite Elements: An Introduction. Prentice-Hall, Englewood Cliffs (1981) 16. Munson, T.: Mesh Shape-Quality Optimization Using the Inverse Mean-Ratio Metric. Mathematical Programming 110, 561–590 (2007) 17. Knupp, P.: Achieving finite element mesh quality via optimization of the Jacobian matrix norm and associated quantities, Part II - A framework for volume mesh optimization and the condition number of the Jacobian matrix. Internat. J. Numer. Methods Engrg. 48, 1165–1185 (2000) 18. Nocedal, J., Wright, S.: Numerical Optimization, 2nd edn. Springer, Heidelberg (2006) 19. Baker, A.H., Jessup, E.R., Kolev, T.V.: A simple strategy for varying the restart parameter in GMRES(m). J. Comput. Appl. Math. 230, 751–761 (2009) 20. Barrett, R., Berry, M., Chan, T.F., Demmel, J., Donato, J., Dongarra, J., Eijkhout, V., Pozo, R., Romine, C., Van der Vorst, H.: Templates for the Solution of Linear Systems: Building Blocks for Iterative Methods, 2nd edn. SIAM, Philadelphia (1994) 21. Saad, Y.: Iterative Methods for Sparse Linear Systems, 2nd edn. Society for Industrial and Applied Mathematics (2003) 22. Cyberstar Webpage, http://www.ics.psu.edu/research/cyberstar/index.html 23. Shewchuk, J.R.: Triangle: Engineering a 2D Quality Mesh Generator and Delaunay Triangulator. In: Lin, M.C., Manocha, D. (eds.) FCRC-WS 1996 and WACG 1996. LNCS, vol. 1148, pp. 203–222. Springer, Heidelberg (1996) 24. Si, H.: TetGen - A Quality Tetrahedral Mesh Generator and Three-Dimensional Delaunay Triangulator, http://tetgen.berlios.de/
Virtual Control Volumes for Two-Dimensional Unstructured Elliptic Smoothing Steve L. Karman Jr. SimCenter: National Center for Computational Engineering University of Tennessee at Chattanooga Chattanooga TN, USA
[email protected]
Summary. A two-dimensional unstructured elliptic smoothing method is described where the Winslow equations are discretized using a finite volume approach. Virtual control volumes for each node are constructed with element shapes that are nearly ideal. Green-Gauss theorem is used to formulate gradients over an element or a collection of elements for a node, which ultimately leads to a coupled non-linear system of equations. Modifications enable the scheme to reproduce results similar to structured mesh schemes. Results are included that demonstrate basic mesh smoothing and boundary motion. In addition, layers of quadrilateral elements can be added to selected boundaries and the interior point positions are determined via elliptic smoothing. Keywords: Unstructured elliptic smoothing, Winslow smoothing, Finite-volume control volume, Mesh quality improvement.
1 Introduction Elliptic smoothing has been routinely used with structured meshes for many years [1]. It is a very mature technology that allows mesh generation practitioners to create smooth structured meshes. Forcing functions have been developed that can influence the grid spacing and grid line angularity to meet the specific needs of the analysis tool [2, 3, 4]. This technology has been mostly unavailable to the unstructured mesh community, due to the lack of a global mapping from physical space to computational space. Knupp described an approach for smoothing two-dimensional unstructured meshes using a finite difference method where the local logical space was created using trigonometric functions [5]. Finite difference formulae were then derived using Taylor series expansions about the central node. Results in his article show quadrilateral meshes, although the derivation includes an arbitrary number of neighboring nodes, which could be part of triangles and quadrilaterals. Knupp also refers to a proprietary publication by Tipton that is an extension of the method to three dimensions using a finite element approach [6]. Karman et. al described a finite-volume method in two and three dimensions for unstructured meshes comprised of mixed elements [7]. In the finite-volume approach elliptic smoothing of unstructured meshes was possible
122
S.L. Karman Jr.
if an existing valid mesh is available to serve as the computational domain. Virtual control volumes were then introduced where a local computational space for each node is constructed that is independent from a neighboring node’s computational space [8]. These virtual control volumes are the key component of the method and the current paper describes in detail the construction and use of these virtual control volumes for meshes comprised of quadrilaterals and triangles. Aspects of the discretization strategy are explored to allow for the same type of grid control afforded to the structured community. Results for smoothing of static and dynamic problems are included. The cases include hybrid meshes where the quadrilateral elements are added to existing meshes with the points positioned using elliptic smoothing.
2 Winslow Smoothing on Structured Meshes Most elliptic smoothing methods utilize the Winslow equations as the governing equations for mesh distribution [1]. These equations are derived from a Laplacian operator or Poisson operator applied to the computational coordinates. The Laplacian operator form is shown in equations (1). When satisfied, these relationships describe a smooth distribution of computational coordinates (ξ, η) in physical space (X, Y).
∇ 2ξ = ξxx + ξyy = 0 ∇ 2η = ηxx + ηyy = 0
(1)
Theoretically the Laplace equations satisfy the max-min property, which states that the parameter on the interior of the domain will not exceed the values on the boundary. For mesh generation this means the grid lines will not cross. The known variables are the computational coordinates ξ and η. The unknown variables are x and y. So a transformation is necessary to cast the equations in computational space, resulting in the Winslow equations given in equations (2).
αxξξ − 2 βxξη + γxηη = 0 αyξξ − 2 βyξη + γyηη = 0 α = xη2 + yη2
(2)
β = x ξ x η + yξ y η γ = xξ2 + yξ2 Winslow smoothing is not the same as Laplacian smoothing. Many researchers will perform Laplacian smoothing, which is based on the Laplacian operator in equation (1) cast in computational space, shown in equation (3).
∇2 x = xξξ + xηη = 0 ∇2 y = yξξ + yηη = 0
(3)
Virtual Control Volumes for Two-Dimensional Unstructured Elliptic Smoothing
123
Laplacian smoothing for structured meshes is essentially an averaging of surrounding nodes physical coordinates. The same is true when implemented for unstructured meshes. It does not contain the cross derivative term of the Winslow equations and can result in grid crossing, especially for non-convex domains. Finite Difference For structured meshes the Winslow equations are typically solved on an equally spaced Cartesian grid in computational space. The stencil typically used to discretize the first and second derivative terms is shown in Figure 1. The numerical formulae for the first and second derivatives for x in ξ and η directions is shown in equations (4). These are centered difference formulae for the central node. Notice that the derivatives in the ξ direction use only nodes on a constant j line and the derivatives in the η direction using only nodes on a constant i line, while the cross derivative formula uses only the corner nodes. Figure 2 shows the resulting mesh for a spike case where the center of the bottom boundary protrudes into the middle of the domain. The boundary nodes are fixed in position. Winslow smoothing produces a mesh without crossing at the spike. This illustrates that the max-min property of the underlying Laplacian operator is being enforced.
xξ = xη = xξξ = xηη = xξη =
x i+1, j − x i−1, j 2Δξ x i, j +1 − x i, j −1 2Δη x i+1, j − 2x i, j + x i−1, j Δξ 2 x i, j +1 − 2x i, j + x i, j −1
(4)
Δη2 x i+1, j +1 − x i+1, j −1 − x i−1, j +1 + x i−1, j −1 ΔξΔη
3 Virtual Control Volumes for Unstructured Meshes In order to solve the Winslow equations on unstructured meshes a computational domain must be created. A global computational domain is possible if one uses an existing valid mesh. However, this will not provide any real benefit, since a valid mesh already exists. Instead, it is possible to construct a computational domain for each node. These “virtual control volumes” were first introduced in References [8] and [9]. Under the premise that a local computational domain comprised of nearest neighbors is necessary to assemble the global system of equations, it is
124
S.L. Karman Jr.
possible to construct nearly ideal computational stencils for each node. This does assume that the valid global mesh connectivity does exist. These stencils are comprised of the elements connected to the central node. However, instead of using the physical coordinates for each node in the stencil, computational coordinates are constructed. These computational elements can be created to have nearly ideal shape quality or can be manipulated to reflect a desired stretching or clustering, corresponding to a viscous layer distribution or an adaptation spacing field.
Fig. 1. Finite difference stencil
Fig. 2. Structured mesh Winslow solution for spike case
The creation of these computational stencils in two dimensions is relatively straightforward. The stencil for each node will have an arbitrary number of surrounding elements and neighboring nodes; information that is contained in the global mesh connectivity. The process involves distributing directly connected nodes on the unit circle and then positioning any secondarily connected nodes to produced ideal element shapes. Directly connected nodes are those nodes that share an edge with the central node. Secondarily connected nodes do not share an edge with the central nodes, such as the opposite corner of a quadrilateral element. Figure 3 shows a region of a hybrid mesh containing triangular and quadrilateral elements. Figure 4 shows a sample virtual control volume for a node at the edge of the quadrilateral layers (any of the 4 nodes in the center region of the plot with the same element connectivity). The central node is labeled ‘0’. The surrounding nodes are numbered 1 through 7, in order. The directly connected nodes are 1, 2, 3, 4, and 6. The secondarily connected nodes are 5 and 7. The first directly connected node is positioned on the unit circle in a direction that corresponds to the direction of the physical node, although this is not necessary. It could be positioned at computational coordinate (1, 0). The remaining directly connected nodes are then distributed on the unit
Virtual Control Volumes for Two-Dimensional Unstructured Elliptic Smoothing
Fig. 3. Physical mesh containing triangles and quadrilaterals
125
Fig. 4. Sample virtual control volume for node at edge of quadrilateral layers in Figure 3
circle according to the angle distributions, θt, and θq. These angles are determined based on the number of triangles (nt) and the number of quadrilaterals (nq) connected to the central node, given in equations (5). The goal is to produce angles and computational coordinates that reflect the desired element shapes in physical space.
if nt = 0 else if nq = 0 else if nq = 1 and nt > 1 else if nt = 1 and nq > 1 else if nt > 1 and nq > 1
2π nq 2π θt = nt 3π π θt = , θq = 2nt 2 π 3π θt = , θq = 2 2nq
θq =
θt =
π nt
, θq =
(5)
π nq
The secondarily connected nodes are then placed opposite the central node using a vector emanating from the central node in the direction of the midpoint of the diagonal edge of the connected nodes, shown in Figure 4 as edge 4 – 6. That vector is copied to the midpoint of the diagonal edge and the secondarily connected node, node 5 in the figure, is positioned at the end of the vector. The length of that vector is the minimum of the original vector length and 3 2 times the length of the diagonal edge. This will result in perfect squares for the quadrilateral elements when the number of quadrilaterals is equal to 1, 2 or 4. Otherwise, the outer portion of the quadrilateral will be an equilateral triangle. Examples of
126
S.L. Karman Jr.
virtual control volumes for all-triangular stencils and all-quadrilateral stencils are shown in Figure 5.
Fig. 5. Examples of virtual control volumes for different numbers of triangles and an allquadrilateral stencil
Triangles in these virtual control volume will be equilateral only when the triangle angle, θt, is equal to π/3, which occurs with 6 triangles in an all-triangular stencil or 3 triangles in a hybrid stencil, such as the one shown in Figure 4. Changing the lengths of the edges emanating from the central node does not alter the angle relationships. These are the “best” control volumes possible and the physical mesh will attempt to mimic the shapes of these virtual elements. These two-dimensional control volumes are essentially equivalent to the local logical space described by Knupp [5]. The adjacent nodes are ordered in a counter-clockwise fashion and the computational coordinates are distributed on a unit circle. Knupp’s finite difference formulae include cosine and sine functions, which can be computationally prohibitive. The current approach computes and stores computational coordinates. The method could be extended to include general polygons instead of just triangles and quadrilaterals.
5 Finite Volume Formulation of Winslow Equations One approach to solving the Winslow equations is to consider the coefficients, α, β, γ as constant. Then integrate the first equation from (2) over ξ-η space.
α ∫∫ xξξ dΩ − 2 β ∫∫ xξη dΩ + γ
∫∫ xηη dΩ = 0
(6)
Ω represents the area in two dimensions. Examine the first integral and define such that
v = xξ iˆ + 0 ˆj ∇ • v = xξξ
v
(7)
Virtual Control Volumes for Two-Dimensional Unstructured Elliptic Smoothing
127
The divergence theorem can be used to convert the double integral to a line integral.
∫∫
∇ • F dΩ =
∫ F •nˆdΓ
(8)
Γ represents the boundary in two dimensions. Therefore, the first integral becomes
∫∫ xξξ dΩ = ∫ xξ nˆξ dΓ
(9)
A similar operation is used to convert the other double integrals terms. The resulting set of integral equations become
α ∫ xξ nˆ ξ dΓ − 2 β ∫ xη nˆ ξ dΓ + γ
∫ x nˆ dΓ = 0 α ∫ y nˆ dΓ − 2 β ∫ y nˆ dΓ + γ ∫ y nˆ dΓ = 0 ξ
ξ
η ξ
η η
(10)
η η
The numerical representation of these surface integrals is given in equations (11). The summation is over the surrounding elements. This is illustrated in Figure 6 for a hybrid node surrounded by 3 triangles and 2 quadrilaterals for a total of 5 elements. ne
ne
ne
i=1
i=1
i=1
ne
ne
ne
i=1
i=1
i=1
α ∑[xξ ]i (tξ ) i − 2 β∑[xη ]i (tξ ) i + γ ∑[xη ]i (tη ) i = 0 α ∑[yξ ]i (tξ ) i − 2 β∑[yη ]i (tξ ) i + γ ∑[yη ]i (tη ) i = 0
(11)
The normal vectors, t , correspond to the normal vectors of the external edge of the surrounding elements. The first derivative terms in (11) are replaced with a formula for the corresponding component of a gradient calculation of each
Fig. 6. Control volume and external area vectors for a hybrid node
128
S.L. Karman Jr.
element using a Green-Gauss formulation. For instance, the derivative of x with respect to ξ is given by (12).
(x l + x r ) (nξ ) j 2 j =1 ns
∑ xξ =
(12)
A
where A represents the area of the element. The subscripts l and r correspond to the left and right node numbers for edge j. The ξ component of the normal vector for side j is (nξ ) j . The summation is carried out over the number of sides of the element. A similar expression can be developed for the η derivative. Substituting for all the first derivative terms will result in a system of equations for node 0 using nearest neighbor node information. Combining the equations from all nodes in the mesh will result in a sparse matrix linear system of equations that can be solved for new physical coordinates (x,y) using techniques such as point-implicit scheme with under-relaxation. Since the coefficients α, β and γ were assumed frozen, but are actually functions of the physical locations, an outer iteration loop is required to update these coefficient values. When a point-implicit method is used an inner iteration loop is used to converge the linear system. Full convergence of the inner iterations is not necessary. Convergence of the outer iterations is required. Quadrilateral Case A comparison of the finite volume approach with the structured, finite-difference approach is instructive. The structured mesh from Figure 2 was converted to an unstructured collection of quadrilaterals and solved using the finite volume methods described above. The control volume for an interior node is shown in Figure 7. In this case, the first directly connected node is positioned at computational coordinate (1, 0). The resulting unstructured Winslow solution in Figure 8 is different from the structured mesh solution. There is grid crossing at the top of the spike and some kinks in the mesh near the corners on the bottom boundary. An examination of first derivatives using the finite volume approach reveals differences with the finite difference formulae. Assuming unit edge lengths in the control volume, equation (13) shows influence from the corner nodes 2, 4, 6 and 8 in computing the derivative in the ξ direction, whereas the structured finite difference formula uses only information corresponding to nodes 3 and 7.
xξ =
(x 4 + 2x 3 + x 2 ) − (x 6 + 2x 7 + x 8 ) 8
(13)
The finite volume numerical formula for the surface integral of term 1 in equation (10) is shown below, equation (14). Clearly there is influence from all nodes on
Virtual Control Volumes for Two-Dimensional Unstructured Elliptic Smoothing
129
the top and bottom edges of the control volume. This is in direct contrast to the finite difference formula for xξξ in equations (4).
Fig. 7. Control volume for central node in Finite Fig. 8. Result of Winslow smoothing using Volume method Finite Volume method
∫ xξ nˆξ dΓ =
x 4 − 2x 5 + x 6 x − 2x1 + x 8 + x 3 − 2x 0 + x 7 + 2 2 2
Fig. 9. Control volumes for modified FiniteVolume method
(14)
Fig. 10. Winslow solution using modified control volumes
This is a common problem associated with finite-volume solutions to diffusion type equations, such as the Laplace equation. If the structured mesh result is considered “correct” and serves as a guide then the finite volume scheme must be modified to exclude those corner nodes where appropriate. In order to replicate the
130
S.L. Karman Jr.
structured mesh result the control volumes used with the terms involving α and γ (the first and third integral) must be replaced with the collection of triangles shown in blue in Figure 9. This is sometimes referred to as “cutting the corner” and it ignores the influence of the opposite node in the quadrilateral. The first derivatives for the central node, used to compute α, β, and γ, are also computed using this modified stencil. The finite volume result for the second integral correctly uses only the corner nodes, so the full stencil comprised of the 4 quadrilaterals is still used for the β term. The resulting smoothed mesh using this hybrid stencil is shown in Figure 10, which is identical to the structured mesh result. If the “cut the corner” stencil (blue triangles) is used for all three integrals the result is still valid, shown in Figure 11, but different from the structured mesh result. The main difference occurs at the spike. Clearly the discretization strategy used for the β term is influencing the result. In fact, for the stencils comprised of the four blue triangles shown in Figure 9 the β term computes to exactly zero. This was verified by numerically ignoring this term and the result was identical to the Fig. 11. Unstructured Winslow solution using all triangle mesh shown in Figure 11. stencils It is interesting to note that using the hybrid stencil (cut-the-corner for the α and γ terms and full stencil for the β term), but rotating the entire stencil by 45 degrees will also produce the result shown in Figure 11. Apparently the hybrid stencil is not invariant to rotation. This is not a desirable property. For nodes with only four quadrilaterals it is easy to align the stencils with the computational coordinates. For nodes with triangles and quadrilaterals or nodes with more than 4 quadrilaterals it may be difficult to devise a strategy to align the stencil in the computational domain. Triangular Case Diagonalizing, in a symmetric manner, the quadrilaterals from the initial Stransfinite interpolation mesh for Figure 2 produces the mesh in Figure 12. Using the original finite volume scheme described above produces the result in Figure 13.
Virtual Control Volumes for Two-Dimensional Unstructured Elliptic Smoothing
Fig. 12. Quadrilateral mesh diagonalized to produce all triangles
131
Fig. 13. Winslow smoothed triangle mesh for spike
Everything appears valid until one examines the region near the top of the spike, shown in Figure 14. The first interior node above the spike has been moved below the boundary, resulting in grid crossing. The majority of the interior nodes contain six triangles. The virtual control volume for those nodes is shown in Figure 15.
Fig. 14. Magnified view of mesh near spike Fig. 15. Virtual control volume for most of the interior nodes of the triangular spike mesh
Rotating the stencil by 45 degrees does not change the outcome, so the original finite volume scheme appears to be invariant to rotation. All derivatives are computed using a consistent Green-Gauss derived formulation. As the stencil is rotated the gradient components are altered, but the magnitude of the derivative stays constant.
132
S.L. Karman Jr.
5 Augmented Stencil for Triangles Since including the opposite corner node of quadrilaterals in the β term was helpful, it is possible to expand the stencil for triangles to bring in more information. Figure 16 shows an expanded stencil that includes the first neighboring triangle of each directly connected triangle. Also shown in bold red is a quadrilateral comprised of a directly connected triangle and the augmented neighbor. This will serve as the “quadrilateral” in the hybrid stencil described earlier. This is similar to Knupp’s use of the opposite node of the quadrilateral when the number of surrounding neighbor nodes was insufficient to determine the required finitedifference derivatives. The α and γ terms will use only the directly connected triangles and the β term will use the augmented quadrilaterals. For nodes containing a mix of triangles and quadrilaterals in the original stencil, only the triangles will be augmented with neighboring triangles.
Fig. 16. Augmented stencil for nodes with triangular elements
Fig. 17. Triangle mesh with augmented stencils
The smoothed mesh using the augmented triangle stencils is shown in Figure 17. This is a valid mesh with no grid crossing. However, it is not symmetric from left to right, as expected. The cause is believed to be the augmented stencils near the boundary. One of the directly connected triangles of these nodes cannot be augmented with a neighbor because a neighbor does not exist. Instead the stencil will be unbalanced and the “first” node of the stencil may differ from node to node, resulting in arbitrary alignment of the unbalanced-augmented stencil with respect to the computational coordinate directions. Rotating all the stencils by 45 degrees results in a valid mesh, however the asymmetry still exists but is flipped from right to left. If aligning node “1” with the physical edge direction is used it requires constant adjustments to the stencil and still does not produce a completely symmetric mesh.
Virtual Control Volumes for Two-Dimensional Unstructured Elliptic Smoothing
133
Augmenting the stencils with adjacent triangles has provided valid meshes without grid crossing for the spike case. The sensitivity to the rotation of the control volume is bothersome. This is not a desirable trait and further research is required to fully understand the causes and devise an appropriate modification to the discretization strategy. The goal should be to devise a strategy that accurately models all three terms of the equations and is invariant to rotation in computational space. An important point to be made, though, is the augmented stencil approach does provide meshes without grid crossing. And this method can be turned on or off as needed. Even without the augmented stencil the method seems to work extremely well for most cases. The exceptions are cases with extreme sharp edges. If the computational mesh for the structured case were rotated through any angle the original finite-difference formulae would no longer be valid. Taylor series expansions could be re-derived for the new orientation or a least squares method could be used to compute the derivatives. But modified difference formulae have already been used for a structured mesh. The modified scheme described in the previous section was carefully constructed for the all-quadrilateral mesh in order to reproduce the structured mesh result. All stencils were comprised of exactly four quadrilaterals that were carefully aligned with the ξ and η directions. The finite-volume formulation is equivalent to performing a Taylor series expansion about the central node if the higher order terms are ignored. When those stencils were rotated 45 degrees the results were different, but still valid. This demonstrates that the discretization strategy for structured meshes is also not invariant to rotation.
6 Results All cases shown below are computed without any manipulation of the control volumes to account for viscous-type spacing or for solution based adaptation. Some cases are computed using the original finite volume approach outlined in Section 4. For those cases, no augmented stencils were used for the triangles and the “cutthe-corner” approach was used for quadrilaterals. Thus the scheme is invariant to scaling, translation and rotation of the virtual control volumes. Other cases used the augmented stencils to obtain valid meshes where sharp corners exist. Rotating Circle The first case is a simple geometry consisting of an outer circular boundary and an inner circular boundary. The original mesh was created using Pointwise [10]. The mesh contains 2,415 nodes and 4,710 triangles. The inner and outer boundaries are comprised of two sections with 31 equally spaced points each for a total of 61 point for each circle. Views of the original mesh can be seen in Figure 18 and Figure 20. The original finite volume scheme without augmented stencils was used for this case. The Winslow smoothed mesh is shown in Figure 19 and Figure 21. The differences between the meshes are slightly more evident in the magnified views. The original mesh is certainly valid and contains high quality triangles. Pointwise uses a Delaunay method to triangulate the points and the distribution is very smooth. The Winslow smoothed mesh does not attempt to enforce the
134
S.L. Karman Jr.
Delaunay property. Winslow smoothing attempts to make the physical mesh match the “ideal” element shapes in the virtual control volumes. No attempt is made to declare one mesh better or worse than the other. This merely shows that Winslow smoothing can be used with existing tessellations where the boundaries are held fixed. In cases where the initial distribution of points was less smooth the Winslow method will show more variation from the Delaunay-based result.
Fig. 18. Original mesh for circle case
Fig. 19. Winslow smoothed mesh
Fig. 20. Magnified view of original mesh near Fig. 21. Winslow smoothed mesh near inner boundary inner boundary
One of the major benefits Winslow smoothing provides is the ability to perform mesh movement. So for the next demonstration the inner circle is rotated 90
Virtual Control Volumes for Two-Dimensional Unstructured Elliptic Smoothing
135
degrees counterclockwise. The inner boundary points are held fixed at the new location and the outer boundary points remain in their original position. The global mesh is shown in Figure 22. The twisting of the interior mesh is evident in the global view, but is less evident in the magnified view, Figure 23. The shearing of the mesh is minimal for this rotation angle. Additional rotation of the inner boundary is certainly possible and would increase the shearing, unless the points on the boundaries were allowed to float.
Fig. 22. Global view of rotated circle mesh
Fig. 23. Magnified view of inner boundary for rotated circle mesh
The next modification to this rotated mesh is shown in Figure 24. Ten layers of quadrilateral elements were added to the mesh connectivity at the inner boundary. The smoothed quadrilateral elements show evidence of the shearing exhibited by the triangular elements in Figure 22. The basic method was employed without any attempt at controlling mesh spacing or grid line angularity. Winslow is attempting to make the physical mesh match the virtual control volume shapes, which are nearly ideal. When the inner boundary is rotated back to the original position the shearing of the quadrilateral elements disappears, shown in Figure 25. The sequence of smoothing, rotating and adding layers of quadrilateral elements could have been performed in any order. The same mesh would be produced had the rotation never taken place. And the creation of the quadrilateral elements does not require one to distribute the points in the normal direction away from the boundary. The physical points were actually initialized to be coincident with the original boundary points. Winslow smoothing produced the final point distribution, attempting to make the quadrilateral elements perfect squares.
136
S.L. Karman Jr.
Fig. 24. Quadrilateral layers added to rotated mesh
Fig. 25. Hybrid mesh rotated back to original position
NACA0012 Airfoil The second case is the famous NACA0012 airfoil. The original triangular mesh, created in Pointwise, contains 4,392 points and 8,424 triangles. The outer boundary is in two sections with 61 points per section, equally spaced. The airfoil boundary is also defined in two sections, upper and lower, with 121 points per section. The points are clustered toward the leading and trailing edges in a symmetric manner from top to bottom. The augmented stencils were used to smooth this triangular mesh. The global mesh after Winslow smoothing is shown in Figure 26. A magnified view of the region near the airfoil is shown in Figure 27. Ten quadrilateral element layers were added to the connectivity near the airfoil boundary. The β term is discretized with the full quadrilateral and augmented triangle formulations. The smoothed mesh is shown in Figure 28. At first it might seem like this is not the expected outcome. But in fact it is because no grid spacing control is being applied. The virtual control volumes for the quadrilateral elements are perfect squares and the physical mesh is attempting to mimic that shape for the quadrilaterals. So where there is clustering at the leading and trailing edge the local quadrilaterals (squares) are smaller. In the middle of the airfoil, shown in Figure 28, the point spacing along the surface is larger and the neighboring quadrilaterals are nearly perfect squares there, as well. A view of the trailing edge region is shown in Figure 29. Finally, this hybrid mesh is translated one unit in the positive X direction and one unit in the positive Y and rotated 90 degrees. The smoothed mesh is shown in Figure 30. There was some difficulty encountered converging the solution due to
Virtual Control Volumes for Two-Dimensional Unstructured Elliptic Smoothing
137
Fig. 26. Global smoothed mesh for NACA0012 airfoil
Fig. 27. Magnified view of triangular mesh in region near airfoil
Fig. 28. Smoothed mesh with 10 quadrilateral layers added near airfoil
Fig. 29. Magnified view of hybrid mesh near trailing edge of airfoil
Fig. 30. Airfoil translated in X and Y and rotated 90 degrees
Fig. 31. Magnified view of mesh near the trailing edge
138
S.L. Karman Jr.
the skewing of the triangles in the far field. The augmented triangles were turned off and the scheme was able to converge. The full quadrilateral formula was used for the β term in order to accurately handle the sharp trailing edge. Figure 31 shows the magnified view of the trailing edge region. There are no negative areas or skewed elements in the mesh. 30P30N Multi-Element Airfoil The final case is a 3-element airfoil section known as 30P30N. The triangular mesh was created using Pointwise and it consisted of 22,165 points and 42,743 triangles. The outer boundary was defined in four sections with 21 points per section, equally spaced. The slat section was divided into two sections with the sharp points of the section providing the demarcation. One section contained 200 points while the other contained 150 points. The main element was defined in three sections and had three sharp points that defined the sharp trailing edge and the cove region. The largest section contained 600 points and the other two contained 100 points and 50 points. The flap was divided into 3 sections; an upper section with 200 points, a lower section with 200 points and blunt trailing edge section with 7 points. The distributions on each section were clustered toward the sharp points. This initial mesh was smoothed using the augmented triangle stencils. Figure 32 shows the smoothed mesh with the three elements. The slat region is shown in more detail in Figure 33 and the flap is detailed in Figure 34. The gap region between the main airfoil element and the flap is magnified in Figure 35.
Fig. 32. Three-element airfoil mesh
Fig. 33. Magnified view of leading edge slat
The flap was rotated an additional 20 degrees downward and the slat an additional 10 degrees downward. The smoothed meshes are shown in Figure 36 and Figure 37, compared to the meshes in Figure 33 and Figure 34. Some excessive stretching was encountered at the sharp trailing edge of the main airfoil section, Figure 38. The augmented stencils were turned off to produce the mesh in Figure 39, which shows slightly less skewing.
Virtual Control Volumes for Two-Dimensional Unstructured Elliptic Smoothing
139
With the flap rotating the elements in the gap are stretched. The elliptic smoothing is attempting to restore the elements to the ideal shapes provided in the virtual control volumes. The augmented stencil and the β term carried the affect of the skewing around the trailing edge and on to the topside of the airfoil section. Turning off the augmented stencil lessened the effect.
Fig. 34. Magnified view of trailing edge flap
Fig. 35. View of gap between main element and trailing edge flap
Fig. 36. Magnified view of slat rotated 10 degrees downward
Fig. 37. Magnified view of flap rotated 20 degrees downward
140
S.L. Karman Jr.
Fig. 38. Main element trailing edge using augmented triangle stencils
Fig. 39. Main element trailing edge without using augmented triangle stencils
Five quadrilateral element layers were added to the original, un-rotated triangular mesh from Figure 32. The smoothed mesh, computed without augmented triangle stencils and the “cut-the-corner” approach for the quadrilaterals, is shown in Figure 40. A magnified view of the gap between the slat and main element is shown in Figure 41. The mesh near the sharp tip of the slat is smooth and contains no grid crossing. The mesh for the backward-facing step of the cove region is shown in Figure 42. The pulling of the mesh out of the corner is typical for Winslow smoothing with structured meshes. Again, no control of grid spacing was attempted, so this is an expected result. The mesh in the gap between the main element and the flap, shown in Figure 43, shows some skewing at the sharp trailing edge. The quadrilaterals at the sharp corner are skewed, with a slightly inverted corner, but the areas are still positive. Grid spacing control is expected to lessen the skewing in this region since there will be more room between the airfoil sections for the isotropic (triangle) portion of the mesh.
Virtual Control Volumes for Two-Dimensional Unstructured Elliptic Smoothing
141
Fig. 40. Three-element airfoil with five quadrilateral layers added
Fig. 41. Magnified view of hybrid mesh in region between slat and main element
Fig. 42. Hybrid mesh in cove region of main airfoil section
Fig. 43. Hybrid mesh in gap between main element and flap
Conclusions The development of a two-dimensional unstructured elliptic smoothing method has been described. The Winslow equations are discretized using a finite volume approach. Individual control volumes for each node are constructed in a virtual space where the element shapes are nearly ideal. The baseline discretization uses Green-Gauss theorem to formulate gradients over an element or a collection of elements for a node. As coded this formulation would not reproduce the structured mesh elliptic smoothing behavior for a spike problem. A modification to the scheme for quadrilateral elements was successful at producing structured mesh results for the spike problem. The triangulated version of the spike mesh was
142
S.L. Karman Jr.
smoothed resulting in one node near the spike outside the domain. A second modification to the finite-volume method incorporated additional triangles in the virtual control volume stencil that could serve as a basis for incorporating the same discretization used for quadrilateral elements, resulting in a valid mesh for the spike problem. Results were shown for three additional cases. For each case basic smoothing was demonstrated as well as boundary motion. The resulting meshes were smooth and contained no invalid elements. The final demonstration for each case was to add layers of quadrilateral elements to selected boundaries. The points were distributed via the Winslow smoothing. No mesh spacing control was attempted and the resulting meshes were smooth, without grid crossing or invalid elements. The three-dimensional extension has been completed and will be published in the near future.
References 1. Winslow, A.M.: Numerical Solution of the Quasilinear Poisson Equations in a Nonuniform Triangle Mesh. Journal of Computational Physics 2, 149–172 (1967) 2. Thompson, J.F., Thames, F.C., Mastin, C.W.: Boundary-Fitted Curvilinear Coordinate Systems for Solution of Partial Differential Equations on Fields Containing Any Number of Arbitrary Two-Dimensional bodies. In: NASA CR 2729 (July 1977) 3. Thomas, P.D., Middlecoff, J.F.: Direct Control of the Grid Point Distribution in Meshes Generated by Elliptic Equations. AIAA Journal 18, 652–656 (1979) 4. Sorenson, R.L.: A Computer Program to Generate Two-Dimensional Grids About Airfoils and Other Shapes by Use of Poisson’s Equations. NASA TM-81198 (1980) 5. Knupp, P.M.: Winslow Smoothing on Two-Dimensional Unstructured Meshes. Engr. With Computers 15, 263–268 (1999) 6. Tipton, R.: Grid Optimization by Equipotential Relaxation. Lawrence Livermore National Laboratory, 26pp (November 28, 1990) (manuscript) 7. Karman, S.L., Karman Jr., S.L., Anderson, W.K., Sahasrabudhe, M.: Mesh Generation Using Unstructured Computational Meshes and Elliptic Partial Differential Equation Smoothing. AIAA Journal 44(6), 1277–1286 (2006) 8. Sahasrabudhe, M.: Unstructured Mesh Generation and Manipulation Based on Elliptic Smoothing and Optimization. Ph.D. Dissertation, University of Tennessee at Chattanooga (August 2008) 9. Karman Jr., S.L., Sahasrabudhe, M.S.: Unstructured Elliptic Smoothing Revisited. AIAA-2009-1362, Orlando, FL (January 2009) 10. http://www.pointwise.com/
Reconstructing High-Order Surfaces for Meshing Xiangmin Jiao and Duo Wang Department of Applied Mathematics, Stony Brook University, Stony Brook, NY 11794
[email protected]
Summary. We consider the problem of reconstructing a high-order surface from a given surface mesh. This problem is important for many meshing operations, such as generating high-order finite elements, mesh refinement, mesh smoothing and mesh adaptation. We introduce two methods, called Weighted Averaging of Local Fittings (WALF) and Continuous Moving Frames (CMF). These methods are both based on weighted least squares polynomial fittings and guarantee C 0 continuity. Unlike existing methods for reconstructing surfaces, our methods are applicable to surface meshes composed of triangles and/or quadrilaterals, can achieve third and even higher order accuracy, and have integrated treatments for sharp features. We present the theoretical framework of our methods, experimental comparisons against other methods, and its applications in a number of meshing operations. Keywords: mesh generation; curves and surfaces; mesh adaptivity; high-order methods; accuracy.
1 Introduction Surface meshes and their manipulations are critical for meshing, numerical simulations, and many other related problems. Some example problems that involve manipulating surface meshes include mesh generation and mesh enhancement for finite element or finite volume computations [5], mesh smoothing in ALE methods [1], and mesh adaptation in moving boundary problems [11]. In many of these problems, a continuous CAD model may not be available. Instead, only a surface mesh, typically with piecewise linear or bilinear faces, is available. In this paper, we consider the problem of reconstructing a highly accurate, continuous geometric support from a given surface mesh. We refer to this problem as high-order surface reconstruction (or simply high-order reconstruction). Besides meshing, this reconstruction problem also arises in computer graphics [2] and geometric modeling [17]. In general, the high-order reconstruction should satisfy some (if not all) of the following requirements:
Corresponding author.
144
X. Jiao and D. Wang
Continuity: The reconstructed surface should be continuous to some degree (e.g., C 0 , C 1 , or C 2 continuous, depending on applications). Feature preservation: The reconstruction should preserve sharp features (such as ridges and corners) in the geometry. Geometric accuracy: The reconstruction should be accurate and asymptotically convergent to the exact surface to certain order under mesh refinement. Stability: The reconstruction should be numerically stable and must not be oscillatory under noise. Note that different applications may have emphasis on different aspects of the problem. For example, in computer graphics and geometric design, the visual effect may be the ultimate goal, so smoothness and feature preservation may be most important. Therefore, methods proposed for such applications tend to focus on the first two issues, and the numerical issues of asymptotic convergence and stability are mostly ignored. Our focus in this paper is on meshing for finite element or finite volume computations, for which these numerical issues are very important. Indeed, the low order of accuracy of the geometry would necessarily limit the accuracy of the solutions of differential equations, and numerical instabilities and excessive oscillations can have even more devastating effect to numerical simulations. In this paper, we present two methods, called Weighted Averaging of Local Fittings (WALF) and Continuous Moving Frames (CMF), for reconstructing a featurepreserving, high-order surface from a given surface mesh. Both methods are based on the assumptions that the vertices of the mesh accurately sample the surface, and the faces of the mesh correctly specify the topology of the surface, and utilize the numerical techniques of weighted least squares approximations and piecewise polynomial fittings. These methods apply to surface meshes composed of triangles and/or quadrilaterals, and also to curves (such as ridge curves on a surface). Unlike existing methods, which are typically only first or second order accurate, our methods can achieve third- and even higher order accuracy, while guaranteeing C 0 continuity. For its weighted least squares nature, these methods are also tolerant to noise. We present the theoretical framework of our methods. We also present experimental comparisons of our methods against some others, and its applications in a number of meshing operations. The remainder of the paper is organized as follows. Section 2 presents some background knowledge, including local polynomial fittings and weighted least squares approximations. Section 3 describes the new methods for high-order surface reconstruction and compares them with some others. Section 4 applies our methods with a number of meshing operations for triangle and quadrilateral meshes and meshes with sharp features. Section 5 concludes the paper with a discussion.
2 Preliminaries: Vertex-Based Polynomial Fittings Our high-order reconstruction is based on local polynomial fittings and weighted least squares approximations. We have successfully used these techniques previously to compute differential quantities of discrete surfaces (such as normals and
Reconstructing High-Order Surfaces for Meshing
145
curvatures) to high-order accuracy; see e.g. [13, 18]. However, due to their local nature, those approaches for computing differential quantities do not provide a continuous, global reconstruction of a surface. We hereafter briefly review these techniques and then adapt them to high-order reconstruction in the next section. For more details on the theoretical background, readers are referred to [13] and references therein. 2.1
Local Polynomial Fitting
Local polynomial fittings, also known as Taylor polynomials in numerical analysis [8], are based on the well-known Taylor series expansions about a point. We are primarily concerned with surfaces, so the local fitting is basically an interpolation or approximation to a neighborhood of a point P under a local parameterization (say, with parameters u and v), where P corresponds to u = 0 and v = 0. The polynomial fitting may be defined over the global xyz coordinate system or a local uvw coordinate system. In the former, the neighborhood of the surface is defined by the coordinate function f (u, v) = [x(u, v), y(u, v), z(u, v)]. In the latter, assuming the uv-plane is approximately parallel with the tangent plane of the surface at P , each point in the neighborhood of the point can be transformed into a point [u, v, f (u, v)] (by a simple translation and rotation), where f is known as the local height function. Let u denote [u, v]T . Let ϕ(u) denote a smooth bivariate function, which may be the local height function or the x, y, or z component of the coordinate function for j+k a parametric surface. Let cjk be a shorthand for ∂u∂ j ∂vk ϕ(0). Let d be the desired degree of the polynomial fitting, and it is typically small, say ≤ 6. If ϕ(u) has d + 1 continuous derivatives, it can be approximated to (d + 1)st order accuracy about the origin u0 = [0, 0]T by ϕ(u) =
d j+k=p
j+k=d+1 uj v k ∂ j+k u ˜j v˜k + ϕ(˜ u, v˜) , j k j!k! ∂u ∂v j!k! p=0 j,k≥0 j,k≥0 ( )* + ( )* + Taylor polynomial remainder
cjk
(1)
where 0 ≤ u ˜ ≤ u and 0 ≤ v˜ ≤ v. T Suppose we have a set of data points, say [ui , vi , ϕi ] for i = 1, . . . , m − 1, sampled from a neighborhood near P on the surface. Substituting each given point into (1), we obtain an approximate equation , d j+k=p uji vik cjk ≈ ϕi , (2) j!k! p=0 j,k≥0
which has n = (d + 1)(d + 2)/2 unknowns (i.e., cjk for 0 ≤ j + k ≤ d, j ≥ 0 and k ≥ 0), resulting in an m × n rectangular linear system. Note that one could force the polynomial to pass through point P by setting c00 = 0 and removing its corresponding equation, reducing to an (m − 1) × (n − 1) rectangular linear system. This may be beneficial if the points are known to interpolate a smooth surface.
146
X. Jiao and D. Wang
Let us denote the rectangular linear system obtained from (2) as V X ≈ F,
(3)
where X is an n-vector composed of cjk , and V is m × n, known as a generalized Vandermonde matrix. For a local height function, F is an m-vector composed of fi ; for a parametric surface, F is an m × 3 matrix, of which each column corresponds to a component of the coordinate function. The above formulations can be easily adapted to curves in 2-D or 3-D, by using the univariable instead of the bivariable version of Taylor series expansions. For a curve in 3-D, the parameterization has only one parameter (say u), and the local height function has two components. When applied to a surface mesh, the point P is typically a vertex, and its neighborhood are typically some k-ring neighborhood. Following [13], we allow k to have half-ring increments: • • •
The 1-ring neighbor faces of a vertex v are the faces incident on v, and the 1-ring neighbor vertices are the vertices of these faces. The 1.5-ring neighbor faces are the faces that share an edge with a 1-ring neighbor face, and the 1.5-ring neighbor vertices are the vertices of these faces. For an integer k ≥ 1, the (k + 1)-ring neighborhood of a vertex is the union of the 1-ring neighbors of its k-ring neighbor vertices, and the (k + 1.5)-ring neighborhood is the union of the 1.5-ring neighbors of the k-ring neighbor vertices.
Figure 1 illustrates these neighborhood definitions up to 2.5 rings. We typically choose k to be (d + 1)/2 (for non-noisy surface) or d/2 + 1 (for noisy surface), but may also enlarge k if there are fewer than 1.5 times of the required number of points in the k-ring. 2.2
Weighted Least Squares Approximation
Numerically, (3) can be solved using the framework of weighted linear least squares [7, p. 265], i.e., to minimize a weighted norm (or semi-norm), min V X − F Ω = min Ω(V X − F ) 2 , X X
(4)
where Ω is a weighting matrix. Typically, Ω is an m × m diagonal matrix, whose T ith diagonal entry ωi assigns a priority to the ith point [ui , vi ] by scaling the ith row of V . It is desirable to assign lower priorities to points that are farther away from the origin or whose normals differ substantially from the w direction of the local coordinate frame, such as that defined in (8). The formulation (4) is equivalent to the linear least squares problem V˜ X ≈ B, where V˜ = ΩV and B = ΩF .
(5)
In general, V˜ is m × n and m ≥ n. A technical difficulty is that this linear system may be very ill-conditioned (i.e., the singular values of V˜ may differ by orders of
Reconstructing High-Order Surfaces for Meshing
147
1 ring
1.5 ring
2.5 ring
2 ring
Fig. 1. Examples of 1-, 1.5-, 2-, and 2.5-ring vertices for typical vertex in triangle mesh. Each image depicts the neighborhood of the center black vertex.
magnitude) due to a variety of reasons, such as poor scaling, insufficient number of points, or degenerate arrangements of points [14]. The conditioning number of V˜ can be improved by using a scaling matrix S and changing the problem to min AY − B 2 , where A = V˜ S and Y = S −1 X. Y
(6)
˜ i denote the ith column of V˜ . The ith We chose S to be a diagonal matrix. Let v diagonal entry of S is chosen to be ˜ v i 2 , which approximately minimizes the condition number of V˜ S [7, p. 265]. 2.3
Accuracy and Stability of Least Squares Polynomial Fittings
The local least squares polynomial fitting provides us the theoretical foundation for high-order reconstruction of surfaces, established by the following proposition [13]: Proposition 1. Given a set of points [ui , vi , f˜i ] that interpolate a smooth height function f or approximate f with an error of O(hd+1 ). Assume the point distribution and the weighting matrix are independent of the mesh resolution, and the ˜ in (6) is bounded by some constant. condition number of the scaled matrix A = AS The degree-d weighted least squares fitting approximates cjk to O(hd−j−k+1 ). Here, h is a local measure of mesh resolution (such as average edge length of the k-ring neighborhood). We refer to readers to [13] for the proof of the proposition. Note that a necessary condition for the accuracy is that the condition number of the scaled matrix A must be bounded, but it is not automatically the case even if the number of points is greater than the number of unknown coefficients. We achieve
148
X. Jiao and D. Wang
well-conditioning by either expanding the neighborhood or reducing the degree of fitting if the condition number is determined to be large, and in turn guarantee both accuracy and stability.
3 Continuous, High-Order Surface Reconstruction The method described in the previous section applies locally at each individual vertex of a mesh. There was no coordination among the local fittings at different vertices, so the method does not reconstruct a continuous surface. To construct a continuous surface, there are at least three different options: 1. compute multiple local fittings at vertices and then compute a weighted averaging of these fittings; 2. enforce continuity of local coordinate frames and weights for local fittings; 3. introduce additional control points to define continuous/smooth surface patches. Most methods in the literature use the latter two options. For example, the moving least squares [15] uses the second option to construct a C ∞ surface from a point cloud. Walton’s method [17] adopted by Yams [4, 3] uses the third option. In this section, we describe two methods that belong to the first two categories, respectively. We will first focus on triangle meshes for smooth surfaces in this section, and will present the extension to quadrilateral meshes and for meshes with sharp features in the next section when describing their applications in meshing. 3.1
Weighted Averaging of Local Fittings (WALF)
A simple approach to construct a high-order surface is to compute a weighted average of the local fittings at vertices. We refer to this approach as Weighted Averaging of Local Fittings (WALF). To achieve continuity of the surface, the weights used by the weighted averaging must be continuous over the mesh. One such a choice is the barycentric coordinates of the vertices over each triangle. Consider a triangle composed of vertices xi , i = 1, 2, 3, and any point p in the triangle. For each vertex xi , we obtain a point q i for p from the local fitting in the local uvw coordinate frame at xi , by projecting p onto its uv-plane. Let ξi , i = 1, 2, '33 denote the barycentric coordinates of p within the triangle, with ξi ∈ [0, 1] and i=1 ξi = 1. We define q(u) =
3
ξi q i (u)
(7)
i=1
as the approximation to point p. Figure 2 shows a 2-D illustration of this approach, where ξi are the barycentric coordinates of point p within the edge x1 x2 . WALF constructs a C 0 continuous surface, as can be shown using the properties of finite-element basis functions: The barycentric coordinates at each vertex of a triangle corresponds to the shape function of the vertex within the triangle, and the shape function of the vertex in all elements forms a C 0 continuous basis function (i.e., the linear pyramid function for surfaces or the hat function for curves). Let φi
Reconstructing High-Order Surfaces for Meshing
149
q n1
n1
x1
n2
q1
q2
n2
x2
p
Fig. 2. 2-D illustration of weighted averaging of local fitting. The black curve indicates the exact curve. The blue and green curves indicate the fittings at vertices x1 and x2 , respectively. q is the WALF approximation of point p and is computed as a weighted average of the points q 1 and q 2 on the blue and green curves, respectively.
denote the basis function associated with the ith vertex of the mesh, and it is zero almost everywhere except within the triangles incident on the ith vertex. Therefore, q can be considered as a weighted average of the polynomials at all the vertices, q(u) =
n
φi (u)q i (u),
i=1
and then it is obvious that q is C ∞ within each triangle and C 0 over the whole mesh. The idea of WALF is intuitive, but the analysis of its accuracy is by no means straightforward. If the coordinate systems were the same at all vertices, then the analysis would have been easy, as q would have inherited the accuracy of qi . However in our case, the local fittings at the three vertices of a triangle are in different coordinate systems in general, and this discrepancy of coordinate systems can lead to additional error terms. Under the same assumptions as Proposition 1, we obtain the following property of WALF. Proposition 2. Given a mesh whose vertices approximate a smooth surface Γ with an error of O(hd+1 ), the distance between each point on the WALF reconstructed surface and its closest point on Γ is O(hd+1 + h6 ). Note that the above proposition gives an upper bound of the error, so the lower bound of the convergence rate is min(6, d + 1). The bound of h6 is due to the discrepancy of local coordinate systems at different vertices. The proof is given in the Appendix. 3.2
Continuous Moving Frames (CMF)
WALF is a simple and intuitive method, but its order of accuracy may be limited. We now present a method that can overcome this limitation by using local coordinate frames that move continuously from point to point. We refer to such a scheme as continuous moving frame (CMF). The basic idea is to use the finite-element basis
150
X. Jiao and D. Wang
functions to construct continuous moving frames and weights for local fittings. In particular, assume each vertex has an approximate normal direction at input. Conˆ i denote the unit vertex sider a triangle x1 x2 x3 and any point p in the triangle. Let n normal at the ith vertex. We compute a normal at p as % .% 3 3 % % % % ˆ= ˆi % ˆ i% . n ξi n ξi n % % i=1
i=1
ˆ we construct a local uvw coordinate system along axes s ˆ, ˆt, and n, ˆ where Given n, ˆ ˆ and t form an orthonormal basis of the tangent plane. Within this local coordinate s frame, we formulate the weighted least squares as
ΩV X − ΩF 2 , where V again is the generalized Vandermonde matrix, and Ω is the weight matrix. In practice, the Vandermonde matrix for a point p should involve a small stencil in the neighborhood of the triangle. We use the union of the stencils of the three vertices of the triangle. Conceptually, it is helpful to consider the Vandermonde matrix involving all the points of the mesh, but the weight matrix Ω assigns a zero weight for each point that is not in the stencil. For the reconstructed surface to be smooth, it is important that Ω is continuous as the point p moves within the geometric support of the mesh. In addition, it is also important that Ω is invariant ˆ and ˆt). of rotation of tangent plane (i.e., be independent of the choice of s We define the weight as follows. For p within the triangle x1 x2 x3 , we first define a weight for each vertex (say jth vertex) in the mesh corresponding to xi as /
+ 2 2 ˆj ˆ Ti n ξi n e−xj −p /hi if vertex j is in stencil of ith vertex wij = (8) 0 otherwise where
ˆj ˆ Ti n n
+ =
ˆ Ti n ˆ j if n ˆj ≥ ˆ Ti n n 0 otherwise
(9)
for some small ≥ 0 and hi is a local mesh-resolution measure ' at the ith vertex. 3 Then for the weighting matrix, the weight for jth vertex is then i=1 wij . In the actual implementation, for simplicity we list the jth vertex separately for its appearance in the stencil of each vertex of the triangle, and include only the vertices whose weights are nonzeros in V and Ω. Similar to WALF, CMF constructs a C 0 continuous surface, because Ω, V , and F are all C 0 continuous, as long as the resulting linear system is well-conditioned. The accuracy of CMF follows that for weighted least squares approximation in [13], and we obtain the following properties of CMF. Proposition 3. Given a mesh whose vertices approximate a smooth surface Γ with an error of O(hd+1 ), the shortest distance from each point on the CMF reconstructed surface to Γ is O(hd+1 ).
Reconstructing High-Order Surfaces for Meshing
151
Relationship with Moving Least Squares. The idea of using moving frames is not new, and goes back to Élie Cartan for differential geometry. One of the incarnations of the idea of using moving frames for discrete surfaces is the so-called moving least squares (MLS) for point clouds [15]. CMF shares some similarities to MLS. In particular, they are both based on weighted least squares approximations within some local frames. However, they also differ in some fundamental ways. First, moving least squares uses global weighting functions that are exponential in the distance, and theoretically, MLS is C ∞ . However, because global weighting functions are too expensive to compute, practical implementations typically truncate small weights to zeros, leading to a loss of continuity. In contrast, CMF uses only a local support by construction. Second, MLS does not guarantee the order of accuracy, because its weights are global and purely based on Euclidean distance. Although its convergence was conjectured in [15], we have observed that MLS does not converge even for simple geometries such as a torus. In contrast, CMF uses the mesh connectivity as a clue in selecting the stencils, instead of based on Euclidean distance. Third, CMF can take into account the normals in the weighting function, to filter out points across sharp features. This allows CMF to handle surfaces with sharp features in a natural way, which is important for meshing operations. On the other hand, it is difficult to treat sharp features in the framework of MLS. Because of their local supports, CMF is more easily adapted to treat sharp features, as we describe in the next section. 3.3
Experimental Results
We report some experimental results of our two proposed methods, and compare them with some other methods. We first show the mesh convergence study of WALF and CMF. While it is typically unnecessary to use schemes with higher than third or fourth order accuracy, to demonstrate the capabilities and limitations of these two methods, we report results with polynomials of up to degree 6. We performed our experiment using a torus with in-radius of 0.7 and outer-radius of 1.3, with an unstructured triangular mesh. We considered three levels of mesh refinement. The coarsest mesh has 329 vertices and 658 triangles, whereas the finest mesh has 21,156 vertices and 42,312 triangles. In this test, we randomly generated 10 points on each face of the mesh, then project them onto high order surface using WALF or CMF. We compute the error as the shortest distance from each approximate point to the torus. Figure 3 shows the L∞ errors of WALF and CMF for the meshes. In the figure, the horizontal axis corresponds to the level of mesh refinement, and the vertical axis corresponds to the L∞ errors. In the legends, the “degree” indicates the degree of polynomial fittings used, and “linear” indicates the error for linear interpolation within triangles. We show the average convergence rates along the right of the plots for each curve, which was calculated as log (error3 /errorbase ) / log (h3 /hbase ), where errori denotes the L∞ error of all the randomly inserted points for the ith coarsest mesh, and hi is the maximum edge length of the corresponding mesh. We chose the base to be 0 for CMF and 1 for WALF, because the errors for WALF
152
X. Jiao and D. Wang
were large for degrees 5 and 6 for the coarsest mesh, leading to artificially too large convergence rates. From the figures, it is obvious that quadratic and higher-degree fittings produced far more accurate results than linear interpolation. Both WALF and CMF achieved a convergence rate of (d + 1) when d is odd and higher than (d + 2) when d is even. The superconvergence for even-degree fittings is likely due to statistical error cancellations of the leading error terms, which are of odd degrees. However, such error cancellations are not guaranteed when the points are very far from being symmetric, especially near boundaries or sharp features. Some conclusions can be drawn from our comparisons between WALF with CMF. In terms of accuracy, we note that WALF gave smaller errors (up to 50% smaller) than CMF for finer meshes, although they delivered very similar convergence rates. The reason for the smaller errors for WALF was probably that WALF uses a smaller stencil for each polynomial fitting. In terms of efficiency, WALF and CMF are comparable when approximating a single point. However, when approximating many points, WALF allows reusing the polynomial fittings computed at the vertices, and hence it can have smaller amortized cost. Furthermore, WALF is also more versatile, because one can change the polynomial at each vertex in WALF (such as adapting its degree of polynomial) without losing C 0 continuity, but the same cannot be done with CMF. Therefore, we favor WALF over CMF, unless some application requires guaranteed seventh or higher order accuracy. Besides WALF and CMF, some other methods have been developed for high order reconstructions and been used in the meshing community. One method that is worth noting is that proposed by Walton [17] and adopted by Frey for surface meshing [3]. One property of Walton’s method is that it achieves C 1 (or G1 ) continuity for the reconstructed mesh. However, there does not seem to be any analysis of the accuracy of Walton’s method in the literature. Figure 4 shows a comparison of the errors of Walton’s method as well as WALF using quadratic and cubic fittings, with linear interpolation as the baseline of comparison. The two figures show the errors in L∞ and L2 norms for the torus. From the result, it is evident that Walton’s method converges only linearly and is actually less accurate than linear 2
−1
10
10
−2
10
0
10
−3
10
2.0 2.1
−2
10
−4
−4
2.0 2.0
−6
3.5 4.0
10
linear degree 1 degree 2 degree 3 degree 4 degree 5 degree 6
10
−8
10
−10
10
0
L∞ error
L∞ error
10
−5
10
3.7 4.0
−6
10
linear degree 1 degree 2 degree 3 degree 4 degree 5 degree 6
−7
5.9 6.1 7.9
10
−8
10
−9
1
2
level of refinement
3
10
0
6.0 6.3 8.5 1
2
3
level of refinement
Fig. 3. L∞ errors of WALF (left) and CMF (right) under mesh convergence for torus. Both WALF and CMF achieve (d + 1)st or higher order accuracy for degree-d polynomials.
Reconstructing High-Order Surfaces for Meshing −1
153
−1
10
10
−2
10
−2
10
−3
10
L∞ error
L2 error
−3
1.3 2.1
−4
10
1.4
10
2.1 −4
10
−5
10
−7
10
−5
10
linear G1 degree 2 degree 3
−6
10
0
linear G1 degree 2 degree 3
3.7 4.6 −6
1
2
3
10
0
level of refinement
3.5 4.9 1
2
3
npts
Fig. 4. Comparison of errors using linear interpolation, Walton’s method (labeled as G1), and WALF using quadratic and cubic fittings.
interpolation for finer meshes. Our preliminary theoretical analysis also suggests that Walton’s method can be at most second order accurate (i.e., no better than linear interpolation), and its practical accuracy may be worse because its dependence on the tangent directions of the edges, which are in general unavailable and can be estimated only to low accuracy. Therefore, it is obvious that C 1 (and in fact even C ∞ ) continuity does not imply accuracy of the reconstruction, although they may produce smooth looking. On the other hand, as we will show in the next section, high-order methods with C 0 continuity typically produce errors that are too small to cause any noticeable discontinuities.
4 Applications to Meshing and Finite Elements The targeted applications for high-order surface reconstruction for this paper are meshing for finite element analysis. We hereafter further customize our framework for meshing and then apply the resulting techniques to meshing operations. 4.1
Quadrilateral Elements and Sharp Features
To be generally applicable to meshing, the reconstruction techniques should work not only for triangulations of smooth surfaces but also for meshes with quadrilateral elements (including quadrilateral meshes or quad-dominant meshes) and surfaces with sharp features. Generalization to Meshes Containing Quadrilateral. For a quadrilateral element, we need to use the finite element shape functions Ni . Let ξ and η be the two natural coordinates within a quadrilateral element, with 0 ≤ ξ ≤ 1 and 0 ≤ η ≤ 1, then the shape functions associated with the four vertices are N1 = (1 − ξ)(1 − η), N2 = ξ(1 − η), N3 = (1 − ξ)η, N4 = ξη.
154
X. Jiao and D. Wang
1-ring
1.5-ring
2-ring
2.5-ring
Fig. 5. Examples of 1-, 1.5-, 2-, and 2.5-rings of typical vertex in quadrilateral mesh. Each image depicts the neighborhood of the center black vertex.
A key issue is the selection of stencils for a quadrilateral mesh or quad-dominant mesh. The definition of n-ring neighbors in [13] tends to produce too many points for quadrilateral meshes. We redefine the neighborhood of a vertex as follows: • • •
The 0-ring of a vertex is the vertex itself ; The k-ring vertices of a vertex (where k = 1, 2, 3, . . .) is the set of vertices that are share an edge with a vertex in the (k-1)-ring; The (k + 0.5)-ring of a vertex (where k = 1, 2, 3, . . .) is the union of k-ring vertices and the vertices that share elements with an edge between two vertices in the k-ring.
For a triangle mesh, the above definition is equivalent to that in [13]. However, this definition is also well-suited to other types of surface meshes. Figure 5 shows the 1-, 1.5-, 2-, and 2.5-rings of a typical vertex in a quadrilateral mesh or a quad-dominant mesh. In general for degree-d fittings, we find it most effective to use a ring of (d + 1)/2 for a mesh without noise or a ring of d/2 + 1 or larger for meshes with noise. Treatment of Sharp Features. Sharp features, such as ridges and corners, are challenging problems in their own right. We have so far implemented a simple treatment for sharp features. First, we identify feature edges and vertices and connect the feature edges to form ridge curves using an algorithm such as that in [9, 10]. We treat the ridge edges as internal boundaries within the mesh and require the k-ring neighbors of vertices do not go across ridge curves. This is accomplished by virtually
Reconstructing High-Order Surfaces for Meshing
155
splitting the mesh along ridge curves in our mesh data structure. For ridge curves themselves, we separate them into sub-curves that do not have corners in their interior. For each sub-curve, we perform a high-order reconstruction using either WALF or CMF for curves. This treatment is sufficient for most meshing operations. 4.2
High-Order Finite Elements
An application of our method is to construct a high order (in particular, quadratic or cubic) finite element mesh from a given mesh with only linear elements and accurate vertex coordinates. This problem has practical relevance, because some mesh generators produce only a mesh with linear elements from an accurate CAD model, and it may be desirable to reconstruct high-order elements without having to access the CAD model. We formally stated the problem as follows: Given a mesh with linear elements, assume the vertices are sufficiently accurate (e.g., they are exact or are at least third or fourth-order accurate), construct a finite element mesh with quadratic or cubic elements with third or fourth order accuracy. When using high-order surface reconstruction, this problem can be solved in the following procedure: 1. For each element σ, loop through its edges. If there is not an element that is abutting σ and has an ID smaller than that of σ, assign a new node ID to each node on the edge; if a node ID has already been assigned in the adjacent element, retrieve the node ID from that adjacent element; 2. Loop through all elements to assign new nodes IDs for new nodes on faces; 3. Expand the array for nodal coordinates, and evaluate the position for each new vertex using high-order surface reconstruction. We have implemented this procedure for reconstructing quadratic and cubic elements from linear triangles or bilinear quadrilaterals using WALF and CMF. Figure 6 shows an example for meshes generated with quadratic and cubic elements for a torus. The high-order schemes produced notable improvements to the smoothness of the surface to linear approach, and the overall errors are significantly smaller. Note that in actual numerical simulations, not only the geometry but also some field variables defined on the mesh need to be reconstructed to high order. The same highorder reconstruction we presented can be used for that purpose, but it is beyond the scope of this paper. 4.3
Uniform Mesh Refinement
A problem related to generating a high-order mesh is a uniform refinement of a surface mesh. The problem may be stated as follows: given a coarse surface mesh with sufficiently accurate vertex coordinates, construct a finer surface mesh by subdividing the elements. Like the previous problem, uniform mesh refinement introduces additional nodes to edges and/or faces, but in addition it also introduces new edges to subdivide the elements. Figure 7 shows an example of refining a quadrilateral mesh with sharp features, and Figure 8 shows that for a triangular mesh of a dragon
156
X. Jiao and D. Wang
Fig. 6. Illustration of generating high-order finite elements from given mesh. Left: a coarse torus with linear elements; Middle: same mesh but with quadratic elements, visualized by decomposing each triangle into four triangles. Right: same mesh but with cubic elements, visualized by decomposing each triangle into nine triangles.
Fig. 7. Example of refining quadrilateral mesh by subdividing each element into nine quadrilaterals. In left, dark lines show original coarse mesh, and dashed lines show linear subdivision. Right images shows refined mesh using cubic fitting with WALF and feature treatments.
head. Note that if the new points are added onto the linear edges and faces, the refined mesh is not only inaccurate but also nonsmooth, as evident in the left image of the figures. This problem is resolved by using high order reconstructions. The right image of Figure 7 and bottom-right image of Figure 8 show a refinement mesh using WALF and feature treatments. The resulting meshes are much smoother and more accurate. This procedure can be useful for generating high-quality finer resolution meshes from a mesh without requiring access to the CAD model. 4.4
Mesh Smoothing and Mesh Adaptivity
More general meshing applications of our techniques are the smoothing and adaptivity of surface meshes. In these settings, not only new vertices may be added, existing vertices may also be moved. For these meshing operations, a common approach is to keep the original mesh during mesh smoothing/adaptation, and project new vertices onto the faceted, piecewise linear geometries (see e.g., [6]). Such an approach has only second order accuracy. Another approach was taken by Frey [3], who constructed a G1 continuous surface using Walton’s method [17]. However, our experiments have shown that Walton’s method is only about first order accurate, despite its G1 continuity. Other methods have been developed (such as [16]), but none could deliver high order accuracy.
Reconstructing High-Order Surfaces for Meshing
157
Fig. 8. Example of refining triangular mesh by subdividing each element into four triangles. Upper row shows a dragon mesh and the zoom in near the head. Lower left image shows a refined mesh using linear interpolation. Lower right image shows refined mesh using WALF with quadratic fitting and feature treatments.
Fig. 9. Example of applying high-order reconstruction in meshing smoothing. The left image shows the original torus mesh, and the right image shows the smoothed mesh.
Instead of using low-order methods, we propose to use high-order surface reconstructions. As an example, we integrate high-order surface reconstruction with the variational mesh smoothing framework described in [12]. To utilize the high-order surface, we first compute the motion of each point within the tangent plane, and then project the new point onto the high-order surface. Note that the use of the tangent plane is useful, because it introduces an error that is high order compared to the tangential displacement, so the projection onto the high-order surface involves only a high order adjustment. Figure 9 shows an example of a smoothed surface mesh using WALF method compared to the original mesh generated by the isosurface function in MATLAB. The maximum angles were 166.1 and 128.8 degrees before and after smoothing, respectively, and minimum angles were 0.65 and 23.8 degrees, respectively. The smoothing process significantly improved the mesh quality while preserving the geometry to high order.
158
X. Jiao and D. Wang
5 Conclusions and Discussions In this paper, we studied the problem of reconstructing a high-order surface from surface meshes, in the context of meshing for finite element computations. We presented two methods, namely WALF and CMF, which are based on weighted least squares approximations with piecewise polynomial fittings. Unlike the traditional methods used in meshing, these methods can deliver very high order accuracy, independent of the order of the element of the mesh. The end results are high-order reconstructions that are efficient, noise resistant, feature preserving, and well suited for meshing and finite element computations. We demonstrate the high accuracy of our method compared to some other methods, and discussed its application in the context of reconstructing high-order finite elements, mesh refinement, mesh smoothing, and mesh adaptivity. Between WALF and CMF, we favor WALF for its simplicity and versatility (for example, WALF can be interpolatory, but CMF cannot be without sacrificing numerical stability), unless one requires guaranteed seventh or even higher order accuracy. A property of our methods is that it enforces only C 0 continuity. Imposing only 0 C continuity allows us more freedom to achieve higher order accuracy. However, C 0 continuity may be deemed as a limitation of our method in some applications in computer-aided design and geometric modeling, especially when very coarse models with very few control points are used. In such cases, the loss of C 1 or C 2 continuity may lead to noticeable artifacts. We will investigate the reconstruction of C 1 surfaces with high-order accuracy in our future research.
Acknowledgement This work was supported by National Science Foundation under award number DMS-0809285. The first author is also supported by DOE NEUP program under contract #DE-AC07-05ID14517 and by DoD-ARO under contract #W911NF0910306.
References 1. Donea, J., et al.: Arbitrary Lagrangian-Eulerian methods. In: Stein, E., de Borst, R., Hughes, T.J. (eds.) Encyclopedia of Computational Mechanics, ch. 14, Wiley, Chichester (2004) 2. Fleishman, S., Cohen-Or, D., Silva, C.T.: Robust moving least-squares fitting with sharp features. ACM Transactions on Graphics (TOG) 24(3) (2005) 3. Frey, P.J.: About surface remeshing. In: Proc. 9th Int. Meshing Roundtable, pp. 123–136 (October 2000) 4. Frey, P.J.: Yams: A fully automatic adaptive isotropic surface remeshing procedure. Technical report, INRIA, RT-0252 (2001) 5. Frey, P.J., George, P.L.: Mesh Generation: Application to finite elements. Hermes (2000) 6. Garimella, R.: Triangular and quadrilateral surface mesh quality optimization using local parametrization. Computer Methods in Applied Mechanics and Engineering 193(9-11), 913–928 (2004)
Reconstructing High-Order Surfaces for Meshing
159
7. Golub, G.H., Van Loan, C.F.: Matrix Computations, 3rd edn. Johns Hopkins (1996) 8. Heath, M.T.: Scientific Computing: An Introductory Survey, 2nd edn. McGraw-Hill, New York (2002) 9. Jiao, X.: Volume and feature preservation in surface mesh optimization. In: Proc. 15th Int. Meshing Roundtable (2006) 10. Jiao, X., Bayyana, N.R.: Identification of C 1 and C 2 discontinuities for surface meshes in CAD. Comput. Aid. Des. 40, 160–175 (2008) 11. Jiao, X., Colombi, A., Ni, X., Hart, J.: Anisotropic mesh adaptation for evolving triangulated surfaces. Engineering with Computers 26, 363–376 (2010) 12. Jiao, X., Wang, D., Zha, H.: Simple and effective variational optimization of surface and volume triangulations. In: Proc. 17th Int. Meshing Roundtable, pp. 315–332 (2008) 13. Jiao, X., Zha, H.: Consistent computation of first- and second-order differential quantities for surface meshes. In: ACM Solid and Physical Modeling Symposium, pp. 159–170. ACM, New York (2008) 14. Lancaster, P., Salkauskas, K.: Curve and Surface Fitting: An Introduction. Academic Press, New York (1986) 15. Levin, D.: The approximation power of moving least-squares. Mathematics of Computation 67, 1517–1531 (1998) 16. Semenova, I.B., Savchenko, V.V., Hagiwara, I.: Two techniques to improve mesh quality and preserve surface characteristics. In: Proc. 13th Int. Meshing Roundtable, pp. 277– 288 (2004) 17. Walton, D.: A triangular G1 patch from boundary curves. Computer-Aided Design 28(2), 113–123 (1996) 18. Wang, D., Clark, B., Jiao, X.: An analysis and comparison of parameterization-based computation of differential quantities for discrete surfaces. Computer Aided Geometric Design 26(5), 510–527 (2009)
Appendix Proof of Proposition 2 We analyze the accuracy for triangles, but it helps to refer to Figure 2 for a 2-D illustration. Let q ∗i denote the intersection of the exact surface with the direction ni from a point p (i.e., q ∗i is the exact solution for q i in the fitting at vertex xi ). '3 ¯ denote the closest point to point q = Let q i=1 ξi q i on the exact surface. Let ' 3 ∗ ∗ ∗ ¯ be its closest point on the surface. Then, q = i=1 ξi q i and q ¯ ∗ ≤ q − q ∗ + q ∗ − q ¯ ∗ .
q − q¯ ≤ q − q For q − q ∗ , note that q − q ∗ ≤ are used, qi − q ∗i = O(hd+1 ), so
'3
i=1 ξi q i
(10)
− q ∗i . When dth degree fittings
q − q ∗ = O(hd+1 ).
(11)
¯ ∗ , q∗1 − q ∗2 = | cos θ1 | q ∗1 − p + | cos θ2 | q ∗2 − p , where θi is For q ∗ − q ˆ i . Note that cos θi = O(h), since by assumption n ˆi the angle between q ∗1 q ∗2 and n
160
X. Jiao and D. Wang
is at least a first order approximation to the normal at xi , and a first order approximation to the normals at q ∗1 and q ∗2 , whereas the line segment q ∗1 q ∗2 is at least a first order approximation to a tangent direction at q∗1 and q ∗2 . Because p is a point on triangle x1 x2 x3 , whose edge length is O(h) by assumption, p − q ∗i = O(h2 ). Therefore, q∗1 − q∗2 = O(h3 ), and similarly for q∗1 − q ∗3 and q ∗2 − q ∗3 . Because q ∗ is a point on triangle q ∗1 q ∗2 q ∗3 , ¯ ∗ = O(h3 )2 = O(h6 ).
q∗ − q
(12)
Combining (10-12), we conclude that q−¯ q = O(hd+1 )+O(h6 ) = O(hd+1 +h6 ).
Simple Method for Constructing NURBS Surfaces from Unorganized Points Nallig Leal, Esmeide Leal, and John William Branch Universidad Autónoma del Caribe Calle 90 No 46 – 112 Tel. 57-5-3671286 Barranquilla, Colombia, Suramérica {nleal,esleal}@uac.edu.co Universidad Nacional de Colombia, Sede Medellín Medellín, Colombia, Suramérica Carrera 80 No 65-223
[email protected]
Summary. In this paper, a new method for constructing NURBS surfaces from scattered and unorganized points is presented. The method is easy to implement and allows fitting a NURBS surface to a scattered point cloud without constructing either NURBS patches networks or polygon meshes. Based on the projection of the points onto the regression plane of the cloud, the method detects both regions where the cloud lacks points, and regions where the cloud is too dense. Then, by inserting and removing points, the point cloud is regularized and approximated by a NURBS surface. In order to reduce the approximation error, an evolutionary strategy obtains the weights of the NURBS surface so that the distance between the point cloud and the NURBS is minimal. Finally, the points inserted outside the bounds of the point cloud are removed by trimming the NURBS surface. Numerical and graphical results are provided, demonstrating that the method produces valid surfaces with low fitting error. Keywords: Surface fitting, NURBS surfaces, Points regularization, PCA, Evolutionary Strategies.
1 Introduction 3D reconstruction is a process by which objects are reproduced in the computer memory, keeping its physical characteristics (dimensions, volume and shape). 3D reconstruction is a difficult task that covers, in general terms, five stages: data acquisition, registration, integration, segmentation, and surface fitting [1]. The approach presented in this paper deals with the surface fitting stage, in which the computational model of the object is obtained. NURBS is one of the most employed surface fitting models, provided that it is a standard representation of curves and surfaces [2] and is widely supported by modern standards like OpenGL and IGES, which are used for graphics and
162
N. Leal, E. Leal, and J.W. Branch
geometric data exchange [3]. In addition, the NURBS surface model has stability, flexibility, local modification properties and is robust to noise. Yet, the NURBS surface model has a disadvantage: the input data points should be mapped on a regular grid structure [4]. In the 3D reconstruction process, the registration and integration stages produce massive scattered and unorganized point clouds that cannot be mapped on a regular grid structure. Such point clouds cannot be fitted by a NURBS surface and are not suitable for usage in computer-aided design (CAD) systems [5]. In order to fit a NURBS surface to an unorganized and scattered point cloud, several approaches have been presented [4, 5, 6, 7, 8, 9]. Such approaches fit to the cloud a network of NURBS patches with some degree of continuity between them. The construction of the network requires constructing polygon meshes and complicated procedures of refinement, reparameterization and maintainability of the continuity between the patches, which is computationally expensive in terms of memory and processing. In this paper a new method for constructing NURBS surfaces from scattered and unorganized points is presented. In contrast with others, our method does not need to construct a network of NURBS patches. Furthermore, previous construction of polygon meshes, mesh refinement and data reparameterization are not required. Our method first detects the global bias of the point cloud fitting a regression plane to it by using weighted principal components analysis. Then, all the points are projected onto the plane and a two-dimensional regularity analysis of the point cloud is made. The analysis consists of detecting regions with low point density and regions with high point density. By inserting and removing points, based on the two-dimensional analysis, the point cloud is regularized. In order to reduce the fitting error, an evolutionary strategy obtains the weights of the control points that belong to the cloud. Finally, the points inserted outside the cloud boundary are removed by trimming the NURBS surface. The main contribution of our work is that we proposed an automatic, efficient and simple method for constructing a complete NURBS surface from a point cloud. The remainder of this paper is organized as follows. In section 2, related work dealing with reconstruction of NURBS surfaces from scattered and unorganized points is presented. In section 3, the fundamentals of NURBS surfaces are presented. In section 4, a short overview of evolutionary strategies is presented. In section 5, the stages of our method are explained. In section 6, results of our method are provided. In section 7, conclusions and future work are discussed.
2 Related Work Point clouds are considered the main information source in the 3D reconstruction process; unfortunately, such point clouds are not suitable for integration into CAD systems [5]. Constructing NURBS surfaces from point clouds would allow the incorporation of such information source in CAD systems.
Simple Method for Constructing NURBS Surfaces from Unorganized Points
163
Several approaches have been proposed for solving the problem of constructing NURBS surfaces from scattered and unorganized points. Eck and Hoppe [6] solved the problem by generating a network of B-Spline patches. They first construct a triangular mesh over the cloud and project the points onto the mesh to obtain an initial parameterization. Then, a merging process from triangular mesh is carried out for constructing a quadrilateral mesh. Over the quadrilateral domain, a network of B-Spline patches is built. In order to reach a user-specified error tolerance, a refinement process takes place. This process adaptively subdivides the quadrilateral domain producing smaller quadrilateral subfaces. A new network of B-Spline patches is necessary to fit the refined surface. Even though this is an effective method for reconstructing B-Spline surfaces, e.g. NURBS, from point clouds, it is computationally expensive in terms of memory and processing needed. Furthermore, only G1 continuity between the patches is guaranteed. Krishnamurthy and Levoy [7] proposed an approach that constructs a polygon mesh which is resampled to produce a regular grid where NURBS surface patches can be fitted. The performance of the approach is poor when it operates on complex surfaces, and it cannot be applied over surfaces with holes. Park, Yun and Lee [4] presented a two-stage algorithm. The initial stage, named model approximation, employs K-means clustering to obtain regions where polygon meshes are constructed, subdivided in triangular meshes, and blended in quadrilateral meshes. The meshes produced by the initial stage are represented by a hierarchical graph structure. The second stage takes the hierarchical graph structure to construct a NURBS patch network. This method, like Eck and Hoppe's method, is computationally expensive and just guarantees G1 continuity. Furthermore, it assumes the point cloud represents a closed surface. Gregorski, Hamann and Joy [5] proposed an approach that subdivides the set of points into a strip tree structure. This structure is used to fit quadratic surfaces which are degree-elevated and blended into B-Spline patches. This approach cannot be applied either on closed surfaces or on surfaces that are occluded with respect to its principal component analysis regression plane (PCAP), like the surface shown in Figure 1. Bertram, Tricoche and Hagen [8], and Yvart, Hahmann, and Bonneau [10] proposed approaches that use triangular B-Spline patches instead of NURBS patches to fit point clouds. Their approaches, like the aforementioned ones, construct polygon meshes and use expensive processes for fitting a network of triangular B-Spline to the point cloud.
Fig. 1. Occluded surface with respect to its PCAP
164
N. Leal, E. Leal, and J.W. Branch
3 NURBS NURBS, Non Uniform Rational B-Splines, are parametric tensor product curves or surfaces defined by the following expression
∑ ∑ S (u , v ) = ∑ ∑ n
m
i =0 n
j =0 m
i =0
where
N i , p (u ) N j , q (v) wi , j Pi , j
(1)
N i , p (u ) N j , q (v) wi , j j =0
wi, j are the weights, Pi, j are the control points and N i, p (u), N j,q (v) are
p and q respectively, defined over the non periodic node support S u = {u 0 ,...,u r } and S v = {v0 ,..., v r } [11], which can be the B-Spline basis functions of order
calculated in a recursive way by the Cox and de Boor formula [12] according to (2)
N i , p (u ) =
(u − u i ) N i , p −1 (u ) ui+ p − ui
+
(ui + p +1− u ) N i +1, p −1 (u )
(2)
u i + p +1 − ui +1
A NURBS surface is completely determined by its control points
Pi, j , i.e. the
surface changes in a predictable way according to control points movement. This is known as the local support property and allows the surface to be affected, only locally, by the movement of a control point. The main difficulty when fitting NURBS surfaces is to obtain a suitable parameterization and automatically choose the number of control points and their positions to define the surface topology. The weighting factors wi, j of NURBS surfaces play an important role in the fitting process, since these factors determine how much a control point influences the shape of the surface locally. When the weighting factors of NURBS surfaces are assigned in a homogeneous way and their values are one, the NURBS model is reduced to a particular case known as B-Spline surfaces, which are limited in the representation of free-form and conic surfaces. If we want an approximately close enough set of data that represents free-form surfaces using NURBS, it is necessary to manipulate the NURBS parameters, but as previously mentioned such manipulation implies dealing with non linear problems during the fitting process. Furthermore, negative values or zeros in the weighting factors can degenerate the construction of the surface. Figure 2 illustrates the importance of the weighting factors in the NURBS model. The circles represent control points and the line represents a NURBS curve. It is notable how the weighting factors affect the local geometry of the surface. Figures 2a to 2d show the effect over the NURBS curve of assigning the values 0, 0.5, 1 and 2, respectively, to control point 3.
Simple Method for Constructing NURBS Surfaces from Unorganized Points
(a)
(b)
(c)
(d)
165
Fig. 2. Weighting factors effect
When fitting data points using NURBS, we attempt to minimize: n m ⎛ N i , p (u )N j ,q (v )wi , j Pi , j ∑ ⎜ i =0 ∑ j =0 δ = ∑ ⎜ zl − n m l =1 ⎜ ∑i =0 ∑ j =0 N i, p (u )N j ,q (v )wi, j ⎝ np
⎞ ⎟ ⎟⎟ ⎠
2
(3)
where np is the number of control points. If the number of knots and their positions are fixed, the set of weighting factors is known and only the control points
{{P } }
m n i, j i=1 j=1
∈ R are considered during the optimization of (3), we have a linear
problem of least squares. But if the knots or the weights are unknown, it will be necessary to solve a non linear problem. In many applications the knots location is not necessary; therefore, knots values are obtained using some heuristic techniques.
4 Evolutionary Strategies Evolutionary Strategies (ES) were developed in 1964 by Rechenberg and Schwefel at the University of Berlin as an experimental optimization technique [13]. ES try to imitate, in contrast with Genetic Algorithms, the effects of the genetic procedures in the phenotype. ES belong to a kind of probabilistic numerical optimization algorithm, which include Evolutionary Programming (EP), Genetic Algorithms (GA) and Genetic Programming (GP), which are known as Evolutionary Algorithms. The first variant of ES, called (1 + 1) − ES , works based on two only individuals, a parent and a descendant per generation. The descendant is created by applying variations, called mutations, binomially distributed (with mean equal to zero and variance
σ 2 ) to the parent. The descendant can be the parent in the next
166
N. Leal, E. Leal, and J.W. Branch
generation if it is better than the parent;if the opposite is true, the parent will be the survivor for the next generation. (1+ 1) − ES was replaced by ( μ + λ ) − ES and ( μ, λ ) − ES variants, with
μ > 1 parents and λ > 1 descendants per generation. In these new variants, the recombination concept was introduced, in order to create individuals as the cross of the parent attributes. After mutation and the individuals evaluation, the descendants replace the parents if the former are better than the latter. Depending on the selection type, μ new individuals are selected only from the descendant popula-
( μ, λ ) − ES or μ new individuals are selected from the parents and the descendant ( μ + λ ) − ES . Beside mutation and recombination, ( μ + λ ) − ES and ( μ, λ ) − ES control the size of the mutation step by an auto-adaptation process tion
that learns the mutation step size, and optionally the covariance, during the evolutionary searching process [13]. ES use three main operators for changing the population until a stop criterion is reached. Recombination: new individuals are produced by crossing the information contained in the parents. Depending on the individual variable representation some algorithms can be applied for recombination purposes: discrete recombination, local intermediate recombination, global intermediate recombination, point crossover and n-point crossover. The recombination operator allows for the exploration of the searching space. Mutation: After recombination, the descendants are changed with a probability p, by introducing small variations known as mutations. Mutation allows for the introduction of new possible solutions and the exploitation near to a given solution (individual). Mutation follows the scheme given in (4) and (5). Selection: choose the best individuals of the population according to a fitting criterion.
σ i ' = σ i e (τ ⋅N ( 0,1)+τ ⋅N ( 0,1) )
(4)
xi ' = xi + σ i '⋅ N i (0,1)
(5)
0
i
i
N( 0,1 ) is a random variable normally distributed with mean 0 and variance 1, and τ 0 , τ i are constants that control the mutation step. where
5 NURBS Fitting to Unorganized Points Our method for constructing NURBS surfaces from scattered and unorganized point clouds is roughly made up of two stages. The first one regularizes and fits the NURBS surface. The second one optimizes the NURBS surface fitting and trims the surface in order to eliminate points inserted outside the cloud during the regularization process. The following subsections explain each of these stages.
Simple Method for Constructing NURBS Surfaces from Unorganized Points
167
5.1 Point Cloud Regularization The regularity analysis of the point cloud takes place in a two-dimensional space. Such space is given by the principal components analysis regression plane (PCAP), which is expanded along the directions of higher dispersion of the cloud. The regularization process consists of the following steps: 1.
Project the points of the cloud onto the PCAP and obtain the extreme projected points.
2.
Construct a grid from the extreme points with density cording to (6)
ρ=
P A
where P is the number of points and mined by the extreme points. 3. 4.
ρ calculated ac(6)
A is the area of the ellipse deter-
For each grid element, do steps 4 to 5. If no point is present, insert one point in its centroid, according to (7) if the inserted point is inner to the cloud (Figure 3) or according to (8) if the inserted point is outer to the cloud (Figure 4).
Pins = AVGNeigh + Pgrid − Pj(AVGNeigh, PlanePCA)
(7)
G (8) Pins = Pext + λ B where AVG Neigh is the neighborhood mean of the point for inserting, Pgrid is the centroid of the empty element analyzed, PlanePCA is the PCAP,
Pj is the projection function, Pext is the point of the cloud closest
to the point for inserting, λ is the distance between them and PCAP basis vector in the inserting direction. 5.
B is the
If there are two or more points in the element, remove the points located farthest from the centroid.
Once the regularization process has been finished, a NURBS surface can be fitted to the entire cloud. In order to reduce the fitting error of the surface, due to the smoothing properties of NURBS, an optimization process is carried out for preserving the sharp features of the original point cloud.
168
N. Leal, E. Leal, and J.W. Branch
Fig. 3. Insertion of a point inside the cloud
Fig. 4. Insertion of a point outside the cloud
5.2 Surface Optimization The surface optimization process is devised to maintain the influence of the original point cloud stronger than the points inserted, so that the topology of the cloud is not affected. Our optimization process is carried out by a ( μ + λ ) − ES . It can be described as follows. Let P = p1 , p 2 ,..., p n be a set of 3D points sampled from a real object,
{
}
e.g. the regularized points, and proximates by (9).
S = {s1 , s 2 ,..., s m } be a NURBS surface that ap-
P . Our problem consists of minimizing the approximation error given
Simple Method for Constructing NURBS Surfaces from Unorganized Points
E(S)= d P,S < δ
169
(9)
d P,S is the total distance between P and the NURBS approximation surface S . The parameter δ is a given user error tolerance. The evolutionary strategy obtains the control point weights of S , so that (9) is true. where
The evolutionary strategy will only obtain the weights of the points that belong to the point cloud. The weights of the inserted points will be assigned as follows: i) if the point was inserted inside the cloud, its weight will be the mean of the weights of the neighbor points. ii) If the point was inserted outside the cloud, its weight will be zero. Since the influence of the NURBS surface control points is only local, the sampled points P will be divided into clusters where a local optimization process will be carried out, which reduces the computational cost of the proposed method. The optimization process starts with a clustering of the set of points P, such clustering will be achieved by k-means. The objective of the k-means is to find homogeneous regions where the optimization process can be run without distorting the local shape of the surface. By the last run of the k-means clustering algorithm, it is expected to have found the homogeneous regions where the optimization process was run, as shown in Figure 5. Once P is clustered an evolutionary strategy μ + λ − ES will optimize the local fitting of the NURBS in each cluster. At the boundaries of the clusters, the geometry of the surface is not affected since the evolutionary strategy only modified local weights of the NURBS surface control points, it does not modified de points. The evolutionary strategy configuration is as follows:
(
)
Individuals: the individuals of the strategy are conformed by the weights of the cluster points and the mutation steps σ , as shown in Figure 6 (where wi are the
σ i are the mutation step sizes). Mutation operator: uncorrelated mutation with n mutation step sizes σ is ap-
control point weights and
plied to the individuals, according to (4) and (5).
Fig. 5. Clusters found by k-means
170
N. Leal, E. Leal, and J.W. Branch
w1
w2
…
σ1
wn
σ2
…
σn
Fig. 6. Individual of the evolutionary strategy
Recombination operator: the recombination operator is different for object variables wi and parameters σi . A global intermediary recombination is applied to object variables, according to (10), whereas a local intermediary recombination is applied to mutation step sizes σ i , according to (11). Selection operator: the best individuals according to the aptitude function given in (9). In order to perform a fast computation of the distance between the points P and the NURBS surface S , the points of S are stored in a kd-tree structure, so that the searching process for finding the nearest points between
log(n ) order.
b'i =
1
ρ
P and S is of
ρ
∑b k =1
k ,i
b' i = u i bk1 ,i + (1 − u i )bk 2 ,i
(10)
(11)
i is the allele of the individual, bi is the value of the allele, ρ is the size of the recombination pool and μ is a random number uniformly distributed n [0, 1]. where
Table 1. Optimization process Perform a clustering of P by using k-means For each cluster do Set individual size = cluster size Set population size = μ Initialize the population randomly Evaluate the population in the aptitude function (8) While the stop criterion
δ has not been reached do
λ ⋅ 0.9 do Ind i = mut (Populationrand (1,μ ) )
For i = 1 to End for
λ ⋅ 0.1 do Ind i = rec(Populationrand (1,μ ) )
For i = 1 to End for
Population = select from( μ + λ ) End while End for
Simple Method for Constructing NURBS Surfaces from Unorganized Points
171
The algorithm in Table I summarizes the optimization process. After the optimization process, the optimized surface is trimmed to eliminate the points inserted outside the cloud.
6 Experimental Results The proposed method was evaluated in scanned data. Two different models are used to show the method results. The Face model, obtained from Alexander Belyaev's web site from the Heriot-Watt University (www.eps.hw.ac.uk/~belyaev), illustrate the complete NURBS constructing process. The Angel model, obtained from Ohio State University, illustrates the results of the optimization process. The method was implemented in a 1.4GHZ Pentium M with 512MB of RAM. The first stage, point cloud regularization, takes seven seconds to process 15K points. We first project the cloud onto its PCAP, as shown in Figure 7(b); then, the two-dimensional analysis takes place for inserting and removing points where necessary. The two-dimensional regularization is shown in Figure 7(c) (inner and outer inserted points are shown in red and green color respectively), whereas the three-dimensional (point cloud) regularization is shown in Figure 7(d). The NURBS surface fitted to the regularized point cloud is shown in Figures 7(e). The second stage, surface optimization, takes 3 minutes for processing 15K points. After 10 generations average, the evolutionary strategy reached the minimum, i.e. the distance between P and the optimized NURBS surface S reached an average of 14% less than the distance between P and the non optimized NURBS surface. Figure 8 shows the effectiveness of the proposed method application over complex surfaces. The profiles presented in Figures 8(a) – 8(c) show the complexity of the surface. Figure 9 show the improvement of the sharp features obtained with our method. In Figure 9(b) the NURBS surface points follow the control points (red circles) closer than in Figure 9(a), which improves sharp feature representation. To verify that the shape of the original point cloud was not distorted, two metrics were defined. i) The relative error Ebdl between the diagonal length of the bounding box of
P and the diagonal length of the bounding box of S . ii) The
normalized modeling error Eavg , according to (12), is given in [4]. In our tests, the relative error was 0.031% and the modeling error was 0.01,
Davg
∑ =
Eavg =
N −1
i =0
N
Davg L
di (12)
172
N. Leal, E. Leal, and J.W. Branch
Fig. 7. Stages of the proposed method evaluated on scanned data. (a) Original point cloud (b) Point cloud projected onto its PCAP (c) Regularized projection (d) Regularized point cloud (e) NURBS surface constructed from the regularized point cloud (f) Trimmed and optimized NURBS surface
Fig. 8. NURBS fitted over a complex surface applying the proposed method. (a) Right profile of the original dataset (b) Frontal profile of the original dataset (c) Left profile of the original dataset (d) Non optimized NURBS surface (d) Optimized NURBS surface.
Simple Method for Constructing NURBS Surfaces from Unorganized Points
173
Fig. 9. Detail of sharp features. (a) Detail of a Non optimized NURBS surface fitted to a set of control points. (b) Detail of an optimized NURBS surface fitted to a set of control points.
d i and N denote the signed distance from the data xi and the number of the total data, respectively. L is the bounding box length. In Table II, the execu-
where
tion time of our method stages are summarized. In Table III, some statistics of the optimization process are presented. Table 2. Execution time of the method stages Stage Regularization Optimization
Execution Time 7 seconds 3 minutes
Table 3. Statistics of the optimization process Processed images Average points per image Average points per cluster Tests per image Time for clustering Time for optimizing Average generations per test
μ λ
Distance reduction Relative error Modeling error
30 15K 854 12 5 seconds 3 minutes 10 5 35 14% 0.031% 0.01
174
N. Leal, E. Leal, and J.W. Branch
7 Conclusions and Future Work A new simple method for constructing NURBS surfaces from scattered and unorganized point clouds was presented. Both our method applicability in regular and irregular surfaces and the effectiveness of the method improving NURBS surface sharp feature representation were shown. It was demonstrated that it is possible to fit complete NURBS surfaces to point clouds, without previous construction of either polygon meshes or NURBS patch networks; as a result, the proposed method is computationally efficient. Our method cannot be applied over surfaces occluded with regard to its principal component analysis regression plane, like the surface shown in Figure 1. Occluded surfaces with regard to its principal component analysis regression plane generate collisions in step one of the regularization process and such collisions are eliminated by deleting points, which can eliminate a complete segment of the surface. The optimization method could be used for optimizing approaches that use NURBS patches. In those approaches, the clustering process would not be necessary, since the optimization process would be carried out for each NURBS patch. In order to apply our method over occluded surfaces, some future work can point to that direction. The work of Tenenbaum, De Silva and Langford [14] can be used to analyze the cloud regularity in a parametric space without loosing information, which allows constructing the NURBS surface over closed and occluded surfaces. Some additional future work could focus on i) detecting holes in the cloud before regularizing and then trimming them after the regularization process, and ii) improving the optimization process by establishing automatically the number of clusters where the evolutionary strategy is run
References [1] Myers, A.: Introductory literature review surface reconstruction from three dimensional range data. Technical report, The University of Adelaide, Department of Computer Science (1999) [2] Piegl, L., Tiller, W.: The NURBS Book. Springer, Heidelberg (1995) [3] Ristic, M.: Efficient fitting of Non-Uniform Rational B-Spline surfaces using nonorganized 3D data. In: SPIE’S, vol. 11(1) (December 2000) [4] Park, I., Yun, I., Lee, S.: Constructing NURBS Surface Model from Scattered and Unorganized Range Data. In: Second International Conference on 3-D Digital Imaging and Modeling (1999) [5] Gregorski, B., Hamann, B., Joy, K.: Reconstruction of B-spline Surfaces From Scattered Data Points. In: Proceedings of Computer Graphics International (2000) [6] Eck, M., Hoppe, H.: Automatic Reconstruction of B-Spine Surfaces of Arbitrary Topological Type. In: Proceedings of the 23rd annual conference on Computer Graphics and Interactive Techniques, ACM Press, New York (1996) [7] Krishnamurthy, V., Levoy, M.: Fitting smooth surfaces to dense polygon meshes. In: SIGGRAPH 1996 Conference Proceedings. ACM SIGGRAPH, Addison Wesley, Reading (1996)
Simple Method for Constructing NURBS Surfaces from Unorganized Points
175
[8] Bertram, M., Tricoche, X., Hagen, H.: Adaptive Smooth Scattered-data Approximation for Large-scale Terrain Visualization. In: EUROGRAPHICS - IEEE TCVG Symposium on Visualization (2003) [9] Shi, X., Wang, T., Wu, P., Liu, F.: Reconstruction of convergent g1 smooth b-spline surfaces. In: Computer Aided Geometric Design, vol. 21 (November 2004) [10] Yvart, A., Hahmann, S., Bonneau, G.: Smooth Adaptive Fitting of 3D models using hierarchical triangular splines. In: Shape Modeling International (2005) [11] Cordero, J., Parejo, J.: Curvas y Superficies para Modelado Geométrico, 1st edn., Alfa Omega, España (2002) [12] De Boor, C.: On Calculating With B-Splines. J. Approximation Theory 6(1), 50–62 (1972) [13] Bäck, T., Schwefel, H.: Genetic Algorithms in Engineering and Computer Science. John Wiley & Sons Ltd., Chichester (1995) [14] Tenenbaum, J., De Silva, V., Langford, D.: A Global Geometric Framework for Nonlinear Dimensionality Reduction. Science 290 (5500), 2319–2323 (2000)
This page intentionally left blank
Sealing Faceted Surfaces to Achieve Watertight CAD Models Brandon M. Smith1 , Timothy J. Tautges2 , and Paul P.H. Wilson3 1 2 3
University of Wisconsin-Madison
[email protected] Argonne National Laboratory
[email protected] University of Wisconsin-Madison
[email protected]
Summary. Solid modeling engines are capable of faceting CAD models but may facet each face independent of adjacent faces. Regions of the resulting model have gaps between faces of their boundaries. An algorithm is described to seal faceted CAD models such that the boundary of neighboring faces has the same discretization along their shared edges. The algorithm works by sealing skin edges of geometric face faceting to geometric model edge facets, using vertex-vertex and vertex-edge contraction. Ten intricate CAD models of moderate to high complexity are tested with a range of facet tolerances. The algorithm succeeds in creating watertight models in most cases, with failures only at extreme values of facet tolerance and/or in the presence of geometric features which are outside the normal features encountered in most models. Keywords: faceted model, watertight, seal, tessellation.
1 Introduction Computational simulation relies increasingly on valid, accurate representations of the geometry of objects being simulated. Geometric models are most often constructed in Computer-Aided Design (CAD) systems, then transferred to a discretized representation for use in simulation. This discretized representation is often in the form of a Facet-Based Model (FBM), where geometric Vertices, Edges, and Faces are represented by collections of points, edges, and triangles, respectively. FBMs serve a variety of uses in computational simulation. First, they are often the means of transferring geometric models between applications, often in the form of STereo Lithography (STL) files [1]. FBMs are also sometimes used as the basis for generating the 3d discretization, or mesh, for a given geometric model [2, 3]. In other cases, the
178
B.M. Smith, T.J. Tautges, and P.P.H. Wilson
FBM is used directly, for example in monte carlo radiation transport (based on ray-tracing on FBMs)[4], and clash detection for robotic applications. One of the reasons FBMs are used so widely is that they are provided by virtually all geometric modeling systems. Modeling engines such as ACIS [5] and Open.Cascade [6] all provide API functions for getting the triangular facets for each (geometric) Face and facet edges for each (geometric) Edge. Typically, facet edges and faces (triangles) are guaranteed to be within a facet tolerance of the geometric entities they resolve, and this facet tolerance is input to the modeling engine. However, most FBMs provided by geometric modeling systems suffer from a fundamental flaw which prevents their usage as-is for other applications: the FBMs are not watertight. That is, each Face and Edge in the geometric model is faceted independently, with neighboring Faces not sharing facet points with the Edge where they meet nor with each other. While there may be points in each of those facetings that are coincident along the shared Edge, this is not always the case, and for multi-material models, this is almost never true. For example, Figure 1 shows a model where facetings of two Faces bounding an Edge of a cylinder are far from coincident. This flaw must be fixed before FBMs can be used for the other applications mentioned above. There has been a great deal of previous work on the subject of making faceted models watertight. These efforts fall roughly into two groups: one that views the faceted model similar to a point cloud that is the basis of deriving a closed faceted model, and another group that focuses on fixing localized problems in the model, e.g. by filling and closing holes in a faceted surface. None of the efforts reviewed in this work makes use of the topological information often available from geometric models, and few work on models having non-manifold topological features. Furthermore, these approaches vary greatly in their robustness, and few come with guarantees about what kind of FBMs can be made watertight. Implementations of these methods are also not available as open-source software, for use with other geometric modeling packages. A provably reliable solution for fixing FBMs, in an opensource implementation that could be applied in other modeling environments, is a key capability in developing other applications on FBMs. The contribution of this paper is the demonstration of an automatic algorithm for sealing facet-based models. We demonstrate how using topological information that accompanies a certain class of geometric models simplifies this process, and prove that, under certain weakly-restrictive conditions, the method is guaranteed to succeed. Robustness of our method is demonstrated using non-manifold geometric models from a variety of applications, having thousands of Faces and Regions. The algorithm is freely available as opensource software under the LGPL license. The construction of geometric models targeted in this work is a multi-step process. First, geometric Regions are constructed using primitive (sphere, cylinder, etc.) or free-form (spline surface) shapes and boolean operations between them, or more complex modeling operations like lofting or sweeping.
Sealing Faceted Surfaces to Achieve Watertight CAD Models
179
Next, Regions are “imprinted” together; in this operation, any Faces and Edges that are partially coincident in space are made fully coincident, by splitting the original Edges into coincident and non-coincident parts. This process can be viewed as the opposite of regularization, a common operation in most CAD systems. Following this, entities coincident in space and with like topology are merged, such that only one entity remains. This merging step modifies the topology of the geometric model, such that the remaining merged entity is adjacent to all entities bounded by the entities that were merged. Faces bounding multiple Regions have a sense (either forward or reverse) with respect to each of those Regions, with the convention that a forward sense implies the Face normal points out of the Region. The result of this process is a model with some Faces shared between neighboring Regions, and Vertices and Edges bounding multiple Regions. The representation of non-manifold solid models, especially those with multiple 3d Regions sharing Faces between them, varies widely across modeling engines, whereas the representation and evaluation of manifold models is quite standardized. For this reason, most applications using this type of non-manifold geometry usually represent their own topology above the underlying solid modeling engine. This approach also simplifies implementation of “Virtual Topology” [7], facet-based geometry [8] and other specialized representations. This type of model is used to generate contiguous meshes for multi-material models by the Cubit [8] mesh generation code. The Common Geometry Module (CGM)[9] also uses this approach, maintaining its own topology graph for these and other purposes. CGM is used for all geometric modeling operations in this paper. The remainder of this paper is structured as follows. The remainder of this Section discusses previous work in fixing FBMs, and the nomenclature and functions we use for accessing FBMs and geometric models. The algorithm for “sealing” FBMs, along with a proof of its reliability, is given in Section 2. Implementation of the algorithm is described in Section 3, with results given in Section 4. Conclusions and future work are described in Section 5. 1.1
Previous Work
Previous work in converting flawed FBMs into watertight faceted models can be grouped in two categories. Region-based approaches may guarantee watertightness of a solid bounded by triangles, but at the cost of reconstructing the entire region using an intermediate representation. Mesh-based approaches fix faceting errors with small perturbations in the vicinity of the error, but offer no guarantee of watertightness for the overall solid [10]. In a recent survey [11], Ju concludes that mesh-based methods have been most successful at repairing CAD models where errors are localized, while region-based methods are most successful at reconstructing polyhedrons from poor quality data, with loss of detail.
180
B.M. Smith, T.J. Tautges, and P.P.H. Wilson
Fig. 1. A gap exists between faces of the cylinder because each face is faceted independent of bounding edges
Region-based methods [12, 13, 14, 15] reconstruct the model based on point cloud data derived from the faceting. Because they discard the original facets, these methods do not preserve the details of the original geometric topology, at least in cases where those details are not also geometrically distinct. Thus, Faces imprinted on another Face will not be preserved, since they are not geometrically distinct. Although region-based methods are the only option in the case of range-scanned data, they are not applicable to the problems described here, and are not considered further in this work. Bohn and Wozny [16] create a watertight shell by using topology to identify local gaps in the faceting, which they close based in part on heuristics. The algorithm does not move or merge any vertices. Their method begins by identifying free edges, and organizing them into loops, where each loop bounds a region that must be filled in with facets. This filling is done using an “ear clipping” algorithm, where two consecutive edges in the loop are used to form a tringle, with the third edge replacing the two edges in the loop. Edge pairs with the smallest angles are favored in this approach. The algorithm concludes by using edge flips to improve geometric quality of the facets. Barequet and Sharir also approach this problem [17] by idenitfying free edges, but split those edges such that the resulting edges are more consistent in edge length. A distance- and orientation-based heuristic is then used to determine matching groups of edges; gaps between these groups are filled by constructing new facets. In a subsequent effort [18], vertices within a certain distance tolerance are moved to eliminate gaps between triangulated faces. Edges are considered in pairs, rather than by groups forming arcs or loops. Free edges that remain after this process are identified and assembled into loops, and triangulated using [19]. In ambiguous situations, the user is prompted for guidance. Sheng and Meier [20] use a series of increasing distance tolerances, up to a maximum tolerance, to merge vertices then edge pairs whose endpoints have been merged. This ensures that the best candidates will be paired with
Sealing Faceted Surfaces to Achieve Watertight CAD Models
181
each other. One drawback of this approach is that it requires facet edges of similar lengths to close gaps in the faceting; this is often not the case in typical facetings returned from modeling engines. Geuziec et. al [21] also note that Sheng and Meier’s algorithm may create edges adjacent to more than two triangles, when the same end is merged more than once. They avoid this simply by preventing merges that will create edges adjacent to three triangles. Borodin et al. improves on the merge-only approach by introducing a vertex-edge contraction, or t-joint operator [22, 23], where a free edge is split if a corresponding point is too far from either end but close enough to the edge. Vertex-edge contraction allows model repair to proceed using a smaller tolerance than if implemented with vertex merging alone. Kahlesz et al. [24] use a similar approach. An approach by Busaryev et al. [25] represents face boundaries as strings of intersecting balls. Boundaries of adjacent faces are joined by combining balls using a tolerance. Although the watertight output is produced using Voronoi diagram and Delaunay triangulation techniques, the repair phase of combining balls resembles vertex-vertex contraction. The advances in mesh-based watertightness are well summarized in an algorithm by Chong et al. [26]. First vertex-vertex contraction is performed by proximity. Next vertex-edge contraction is used, then large holes are triangulated. Finally skewed elements are removed by edge swapping or node merging. The last step is important because prior vertex-vertex and vertexedge contraction likely create facets with poor aspect ratios. These mesh-based algorithms attempt to restore missing information, in the form of where facets meet to close gaps, using three methods: 1. Perform vertex-vertex contraction by proximity. 2. Perform vertex-edge contraction by proximity. 3. Triangulate a patch across gaps that minimizes area or another heuristic quantity. However, we observe that much of the information they try to restore based on spatial proximity and searching was known at one point, but was lost or thrown away. For example, vertex-vertex and vertex-edge contractions are usually motivated by sealing neighboring geometric Faces at shared Edges. Knowing these topological relationships greatly narrows the search for matching free facet vertices and edges. In the case where the geometric model is still available, new points in the faceting can even be projected to the geometric entities the faceting is supposed to resolve. We believe that methods for repair of FBMs are greatly improved by taking advantage of geometric model information that previously has not been used. Furthermore, we assert that this information is often available when the original faceted model is created, but has not been used because of limitations in file formats used to transfer FBMs to applications. The sealing algorithm described in this paper uses geometric model information to improve the robustness of obtaining watertight FBMs.
182
1.2
B.M. Smith, T.J. Tautges, and P.P.H. Wilson
Notation and Assumptions
In this work, we consider a geometric model described in the form of a Boundary Representation (BRep). This model consists of geometric Vertices, Edges, Faces, and Regions, indicated with script letters V/E/ F /R, respectively. Note that non-manifold topology is allowed; in particular, many of the models we encounter have multiple Regions, with Faces shared between two of those Regions, and Edges and Vertices shared by multiple Regions. The collection of geometric model entities forms a cell complex; that is, the intersection of two entities of like dimension is either empty or corresponds to one or more entities of lower dimension that are also in the cell complex. Each Vertex, Edge, and Face has a corresponding faceting represented by a set, denoted with V, E, F, and R, respectively, with each of these sets containing points p, and possibly edges and faces e and f , depending on the topological dimension (R is empty, since Regions have no facets, but are still represented in the model, to get adjacency relations with other Faces). We assume that the faceting for each geometric Edge with a single Vertex has at least three facet edges. Edge facetings not satisfying this assumption would not be useful for graphics purposes, and in practice this assumption is satisfied in most observed facetings. Each faceting V, E, and F is itself also a d−dimensional cell complex; however, this cell complex does not share points with the facetings of other model entities, even those bounding the model entity in question. This is also typical of faceted models from most modeling engines. A function d(., .) returns the distance between the indicated entities, and Ω(.) represents the boundary of the indicated entity, which is a collection of (d-1)-dimensional facets. There are two tolerances that are important to the algorithm described in this paper. First, the “merge tolerance” is the distance below which two entities are considered spatially coincident; we denote this as g , recognizing that in effect this also serves as the geometric tolerance for those model entities. This tolerance is used in various places during the merging process described earlier. The facet tolerance f is the maximum distance between a facet edge or face and the geometric Edge or face it resolves. We assert certain things about the faceting, based on guarantees provided by the modeling engines constructing them. First, all facet points are within g of the corresponding model entities. While this is typical of faceted models from most modeling engines, it could also be achieved by projecting facet points to the corresponding model entity, using a function provided by virtually all modeling engines. Second, all facet edges and triangles are within f of the corrresponding model entities. Most modeling engines providing facetings take f as an input parameter, though in practice this input is disregarded if it is much larger or smaller than the default value used by the modeling engine. We also assume that f g ; since both these parameters can be changed through user input, this does limit the variations allowed in one parameter after the other has been chosen. Finally, all points on the boundary of a given faceting, Ω(E) or Ω(F ), are within g of some model
Sealing Faceted Surfaces to Achieve Watertight CAD Models
183
entity that bounds the corresponding model entity, though which bounding model entity is not known on input. While not stated explicitly by the modeling engines, in practice this has been found to be the case for both ACIS and Open.Cascade. Each faceting E and F is non-degenerate (all points of d−dimensional facets, d > 0, are distinct), and is oriented and non-inverted (tangent or normal of facet is consistent with that of the underlying model entity in the neighborhood of the facet). Although we have not encountered cases where this assumption is invalid, invalidities of this type could be fixed using preprocessing similar to that discussed in Section 2.1. The local feature size (LFS)[27] at point x is the smallest closed disk centered at x that intersects two Vertices, two non-adjacent Edges, or an Edge and a Vertex that is not adjacent to the Edge. We assume that LFS f . We have observed cases where this assumption is not valid; preprocessing is used to fix these cases, as described in Section 2.1.
2 Sealing Algorithm The requirements of the proposed algorithm are: • • • • • • •
Seal faceted Faces along Edges to create a watertight model. To preserve human efficiency, the algorithm must be automatic. New facets must be owned by exactly one Face. Support non-manifold Faces. Fast enough to use as a preprocessing module. Deformation of input model should be minimized. Creation of new triangles should be minimized.
The input to this algorithm is a set of Vertices, Edges, Faces, and Regions with appropriate topological relationships. Faces and Edges are represented by facets and edge elements that resolve their geometric entities to within the facet tolerance. The boundary of each faceted face is not the same as the face’s adjacent faceted Edges. The endpoints of adjacent faceted edges are the same such that facet edges can be joined to form loops. The boundaries of Regions are represented by the facets of their bounding Faces. The facet tolerance is selected based on the feature size and required accuracy of the faceted representation. The input model is faceted, implying that the facet tolerance has previously been selected. 2.1
Preprocessing and Input to Sealing Algorithm
On input, the geometric model may not satisfy the local feature size assumption; that is, the model may contain features that are smaller than the facet tolerance input to the sealing algorithm. For example, the 40◦ section of the ITER model, discussed in Section 4, has multiple Edges and Faces of nearzero length and area, respectively. These features must be removed before the
184
B.M. Smith, T.J. Tautges, and P.P.H. Wilson
sealing process can start. Edges with length less than the facet tolerance are removed by identifying their endpoints together; Edges that average less than the facet tolerance apart from each other are merged together. Faces can be removed if all of their bounding Edges occur in merged pairs. These faces are approximately one-dimensional and are the result of imprinting neighboring regions in the solid model. Regions are removed if all of their child faces have been removed, though in practice this does not occur for any of the models tested for this work. One additional defect was identified for several faceted models used in this work, where skin vertices were distinct but within geometric tolerance (g ) of each other. This results in exactly two extra skin edges per defect. To remedy this, skin vertices within g of each other are merged. The search for these defects is only within individual facets or facet edges, rather than all geometrically proximate facet points, and therefore is relatively inexpensive, scaling linearly with the number of facet edges. After preprocessing is completed, we have the faceted geometric model V /E/F/R (including toplogical relations between them), along with specification of the geometric and faceting tolerances g and f , respectively. 2.2
Sealing
Given the input described in Section 2.1, the goal is to seal facets in the model together, such that the facetings of the Faces, Edges, and Vertices satisfy the requirements of a cell complex. That is, the intersections of points, edges, and triangle facets should correspond to other points and edges in the faceting. In this section, we present the sealing algorithm that is the primary subject of this paper. The algorithm is presented in its entirety here; proof of its success is discussed in the following Section. The general structure of our algorithm is to work Face by Face, sealing the skin of the Face’s faceting to the faceting of bounding Edges. We take advantage of the known topological relations between Faces and their bounding Edges and Vertices, and the correspondence between a Vertex, Edge or Face and its faceting. The only remaining assumption describes the geometric proximity of facet points, edges, and faces, with the geometric entities they are supposed to resolve. We describe the sealing algorithm in two parts. First, the higher-level algorithm for sealing a Face faceting with that of bounding Edges is given in Algorithm 1. This part of the algorithm has three main parts: a) matching points on the skin of the Face faceting to the Vertex points; b) separating the edges on the skin of the Face faceting into arcs Ω j , using the Vertex points as separators; and c) for each arc Ω j , sealing the edges on that arc to those of a corresponding Edge that bounds the Face; this last step requires an algorithm seal, described in a following Algorithm. Part b) uses a function doriented that computes the average distance between two ordered lists of facet edges. This distance function is computed as the summed distance between
Sealing Faceted Surfaces to Achieve Watertight CAD Models
185
Algorithm 1. Face sealing algorithm. I. ∀F i a. ∀V i ∈a F i 1. f ind e ∈ ΩF i s.t. d(e, V i ) min 2. if d(p ∈adj e, V i ) min, choose p 3. else split e → new p 4. p → V i b. group ΩF i → Ω j F i using p ∈ V k ∈adj F i c. ∀Ω j F i = e 1. f ind E k s.t. doriented (Ω j , E k ) min 2. if E k not sealed yet, E k → Ω j F i 3. else seal(Ω j F i , E k )
parameterized points in both edge sequences normalized for edge length, as the edges are traversed in their respective orders. This traversal directionaware measure will compute a significant distance between two sequences of edges that are exactly spatially coincident but ordered in opposite directions. This algorithm is necessary for distinguishing a number of pathological cases we have observed in the facetings of various real geometric models. In the second part of the algorithm, shown in Algorithm 2, the task is to seal two sequences of facet edges. These sequences are ordered, such that they share the facet point(s) at their start point and, if distinct, their end point. Overall, this algorithm works by considering edges ee and es from the Edge and skin sequences, respectively, that share a point, pc ; and sealing them together, either directly if the edges from either sequence are close enough in length, or by splitting an edge in either sequence then sealing to one of the resulting edges. A graphical depiction of the three cases is shown in Figure 2.
Fig. 2. Three cases for sealing edges from two sequences of facet edges. a) Facet edges are similar in length, and can be sealed directly; b) and c), split skin / edge facets, respectively.
2.3
Proof
Previous methods to obtain watertight faceting have in some cases relied on user guidance. This type of guidance is impractical for the large models
186
B.M. Smith, T.J. Tautges, and P.P.H. Wilson
Algorithm 2. Edge/skin sealing algorithm. otherpoint(e, p) is the point adjacent to e not equal to p; for en , pn = next({e}, e, p), en is the next edge along the ordered sequence of edges {e} that shares p; pn = otherpoint(en , p). Begin: seal arc Ω j = {p}, {e}, E k = {p}, {e} I. Initialize: a. pc = Ωstart (Ω j ) b. es , ps = next(Ω j , −, pc ) c. ee , pe = next(E k , −, pc ) II. while Ω j not sealed a. if pe = ps 1. ee ← es 2. Ω j sealed. b. else if d(ps , pe ) ≤ f 1. pe ← ps 2. ee ← es 3. pc = pe 4. es , ps = next(Ω j , ee , pc ) 5. ee , pe = next(E k , ee , pc ) c. else if d(pe , es ) ≤ f 1. split es with pe , es → e1 (pc , pe ), e2 (pe , ps ) 2. pc = pe 3. ee , pe = next(E k , ee , pc ) 4. es = e2 (ps unchanged) d. else if d(ps , ee ) ≤ f 1. split ee with ps , ee → e1 (pc , ps ), e2 (ps , pe ) 2. pc = ps 3. es , ps = next(Ω j , es , pc ) 4. ee = e2 (pe unchanged)
encountered in our work. Therefore, automation is critical to practical use of this algorithm. Although space does not allow a complete derivation of the proof of reliability of our algorithm, we describe here the general structure of this proof. We develop the proof of reliability of this algorithm in four steps: Can seal Vertices to points on Face skin: By definition, the Vertex facet point p is located on the geometric model, and the facet edges in ΩF i are within f of the geometric Edges on ΩF . Because F i is a cell complex and so is the geometric model itself, each Vertex point p will therefore be within f of ΩF i as well. p will be closest to only one point of ΩF i because LFS f . p can therefore always be sealed to ΩF i , possibly after splitting one of the edges in ΩF i to insert a point closest to p.
Sealing Faceted Surfaces to Achieve Watertight CAD Models
187
Can separate ΩF i into Ω j F i : ΩF i is a cell complex, with points corresponding to Va F i sealed to ΩF i . Because the geometric model is also a cell complex, these points will separate ΩF i into sequences of facet edges Ω j F i , with each sequence bounded by one or two pV, Va F . j i Ω F corresponds to E k , E k a F i : ΩΩ j = V l , and F i and the geometric model are cell complexes, each Ω j F i will correspond to one E k , and E k are distinct because of the preprocessing done before execution of the sealing algorithm. Can seal Ω j F i with E k : The facet points on Ω j F i and E k are within g of the geometric model; the facet edges on Ω j F i and E k are within f of the geometric model; and Ω j F i and E k are ordered consistently with each other. Therefore, similar to sealing the Vertices to ΩF i , the facetings Ω j F i and E k can be sealed together, possibly requiring splitting some of the edges on Ω j F i or E k . When all Face facetings have been sealed to the facetings of their bounding Edges, the whole model has been sealed.
3 Implementation This algorithm is implemented in C++. Geometric models are initialized by reading their faceting and geometric topology through CGM [9] into MOAB [28]. MOAB represents the geometric model entities as entity sets in the mesh, with the entity sets containing the facets defining the entity (Region sets are empty, since there is no 3d mesh), and topological relations between entities represented using parent/child relations between the sets. The sequences of facet edges used in the algorithm described earlier are represented only as ordered lists of facet points. Facet edges are not represented explicitly, since they are being modified frequently as sealing proceeds. Spatial searches are accelerated using MOAB’s k-d tree decomposition. The final results of sealing are represented in MOAB using the same geometric entity sets used for input. This representation can be output to various mesh formats, or can be left in MOAB for subsequent operations (e.g. facet coarsening and refinement to generate FE meshes).
4 Results Test models displayed in Figure 3 and listed in Table 1 were chosen from previous radiation transport simulations. Models vary in complexity, with the most intricate having more than 29 million triangular facets. Before being sealed, five test models were already watertight by proximity. Although not topologically the same, skin points of adjacent faceted surfaces were within the solid modeling engine’s absolute tolerance of each other. These models were created using the ACIS solid modeling engine. Five test models did not
188
B.M. Smith, T.J. Tautges, and P.P.H. Wilson
(a) ITER Module 13
(b) 40◦ ITER Benchmark
(c) FNG Benchmark
(d) UW Nuclear Reactor
Fig. 3. Detailed CAD models were used to test the sealing algorithm Table 1. Geometric entity count and number of triangular facets [millions] as a function of facet tolerance [cm] Model
Geometric Entity Regions Faces Edges UW Nuclear Reactor 2820 30237 65078 Advanced Test Reactor 2132 11827 22402 40◦ ITER Benchmark 902 9834 20485 ITER Test Blanket Module 71 4870 13625 ITER Module 4 155 4155 10255 ITER Module 13 146 2407 5553 FNG Fusion Benchmark 1162 4291 5134 ARIES First Wall 3 358 743 High Average Power Laser 15 139 272 Z-Pinch Fusion Reactor 24 95 143
Facet Tolerance [cm] 10−1 10−2 10−3 10−4 10−5 2.62 2.62 2.98 8.56 29.1 0.44 0.45 0.84 2.44 7.65 0.32 0.78 2.07 8.76 16.3 0.07 0.08 0.12 0.38 1.57 0.29 0.29 0.34 1.07 2.89 0.28 0.29 0.50 2.54 8.65 0.11 0.11 0.14 0.46 1.14 0.17 0.87 1.21 1.55 2.45 0.15 0.47 0.53 0.61 0.88 0.05 0.29 0.99 1.17 1.53
Sealing Faceted Surfaces to Achieve Watertight CAD Models
189
Table 2. Number of face sealing failures as a function of facet tolerance [cm] Model
Facet Tolerance [cm] 10−1 10−2 10−3 10−4 10−5
UW Nuclear Reactor Advanced Test Reactor 40◦ ITER Benchmark ITER Test Blanket Module ITER Module 4 ITER Module 13 FNG Fusion Benchmark ARIES First Wall High Average Power Laser Z-Pinch Fusion Reactor
1019 88 18 0 0 2 63 1 0 3
0 0 9 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 0
0 0 18 0 0 0 0 0 0 0
0 0 191 0 0 0 0 0 0 0
originate in ACIS and were not watertight by proximity, due to file format translation, non-manifold surfaces, and imprecise modeling. Table 2 shows the number of Faces that failed to conform to their bounding Edges after sealing, for various models and facet tolerances. Note that for facet tolerances of 10−2 cm to 10−5 cm all but the ITER Benchmark model were watertight. This includes the default facet tolerance of 10−3 cm. The ITER Benchmark failed to completely seal because it contained many Faces with features smaller than the facet tolerance, created by imprinting. Failures occur if the facet tolerance becomes larger than the feature size, as in the 10−1 cm group. 4.1
Triangle Count
The speed of computations performed on the FBM is affected by the number of triangles in the model. The number of triangles increases due to vertexedge contraction (since triangle facets connected to the edge are split with the edge), but decreases due to vertex-vertex contraction of adjacent skin points of the same face. For the default facet tolerance of 10−3 cm, the change in the number of triangles ranged from 0% to 2%. Across the entire test suite of ten models and five facet tolerances, the change in the number of triangles ranged from -36% to 3%. A decrease in the number of triangles was common for the 10−1 cm facet tolerance, since at that tolerance many facet points on the same Face get merged. During sealing, each Face imposes an additional constraint on adjacent Edges. If the faceted Edge itself were to be sealed, it too would impose an additional constraint on the sealing process. By replacing the faceted Edge with a corresponding skin arc as suggested in Algorithm 1, the number of contraints on the edge is reduced by one. This decreases the number of additional triangles due to vertex-edge contractions.
190
B.M. Smith, T.J. Tautges, and P.P.H. Wilson
Table 3. The number of Faces containing inverted facets after sealing as a function of facet tolerance [cm] Model
Facet Tolerance [cm] 10−1 10−2 10−3 10−4 10−5 UW Nuclear Reactor 272 0 1 0 13 Advanced Test Reactor 30 0 0 0 0 40◦ ITER Benchmark 7 7 4 0 10 ITER Test Blanket Module 0 0 0 0 0 ITER Module 4 0 0 0 0 0 ITER Module 13 2 0 0 0 0 FNG Fusion Benchmark 16 0 0 0 0 ARIES First Wall 0 0 0 0 0 High Average Power Laser 0 0 0 0 0 Z-Pinch Fusion Reactor 2 1 0 0 0
4.2
Inverted Facets
When sealing, facets become inverted if a skin point is moved across an edge of the facet. This typically occurs with long, narrow facets. Each inverted facet is removed along with adjacent facets to create a polygon. The polygon is refaceted using the ear clipping algorithm as implemented in [29], with O(n2 ) time complexity, with n the number of points bounding the polygon. It is possible that the new facets are still inverted. If so, the polygon is iteratively expanded and refaceted until the new facets are no longer inverted. The polygon can only be expanded to the skin of the Face, so that the new facets are constrained to the skin. One can think of the Face skin as being owned by Edges instead of the face. Inverted facets that cannot be fixed by this method are a rare occurrence if the input model conforms to the input assumptions, as suggested by Table 3. Although the ear clipping algorithm is O(n2 ), n is typically small. 4.3
Timing
The implementation was executed on an Intel Xeon 3 GHz processor with 64 bit Linux. The sealing algorithm is intended to be used as a preprocessing step for applications that use FBMs. Timing results are shown in Table 4. Results do not include file reading and writing, because as part of an existing application, the use of this algorithm will not incur additional runtime due to file reading and writing. In general, sealing required less than one minute for most models and facet tolerances. 4.4
Application Example: Particle Tracking
This algorithm was developed, in part, to seal faceted CAD models for Monte Carlo radiation transport. One of the causes of lost particles is leakage between Faces. Figure 4 shows the lost particle fraction for each model before
Sealing Faceted Surfaces to Achieve Watertight CAD Models
191
Table 4. The time [seconds] to seal each model as a function of facet tolerance [cm] Model
Facet Tolerance [cm] 10−1 10−2 10−3 10−4 10−5 UW Nuclear Reactor 136 65 64 156 587 Advanced Test Reactor 93 16 27 76 235 40◦ ITER Benchmark 6 12 38 71 236 ITER Test Blanket Module 15 9 9 14 30 ITER Module 4 10 8 8 23 67 ITER Module 13 6 5 6 19 67 FNG Fusion Benchmark 7 4 4 9 29 ARIES First Wall 1 3 5 13 36 High Average Power Laser 1 1 2 5 25 Z-Pinch Fusion Reactor 1 1 2 4 12
Fig. 4. Lost particle fraction before and after sealing each model. Error bars indicate one standard deviation.
and after sealing. The default facet tolerance of 10−3 cm was used for all models. The ITER Benchmark, Test Blanket Module, Module 4, and Module 13 models lost significantly fewer particles after sealing. Sealing did not significantly affect the UW Nuclear Reactor, Advanced Test Reactor, FNG Fusion Benchmark, ARIES First Wall, High Average Power Laser, and ZPinch Reactor models. This reflects the input models, of which half were already watertight by node proximity.
192
B.M. Smith, T.J. Tautges, and P.P.H. Wilson
Sealing did not eliminate lost particles. The first three lost particles of each sealed model were investigated. In each case the particles became lost because of a specific defect in the particle tracking algorithm, unrelated to watertightness. Improvement of the particle tracking algorithm is an active research topic.
5 Conclusions A tool was developed to make existing faceted models watertight without human intervention. Faces were sealed to their bounding edges using vertexvertex and vertex-edge contraction. Because sealing progresses by Face, this algorithm naturally supports non-manifold geometry. Ten CAD models were tested over a 4 decade range of facet tolerances. Models were successfully sealed if the input assumptions of the algorithm were met. It is assumed that the facet tolerance is less than the feature size and greater than the merge tolerance. On average, sealed models contained more triangles than unsealed models as a result of vertex-edge contraction. Sealing can create inverted facets, with most occurring when input assumptions are not met. Timing results show that the algorithm is fast enough to be used in preprocessing for applications that use faceted geometry. A particle tracking application was used to test models before and after sealing. One cause of lost particles, leakage between unsealed Faces, was eliminated through application of the sealing algorithm. The cause of remaining lost particles was determined to be roundoff and precision issues in the ray-triangle intersect computation; this is the topic of further research.
Acknowledgement The authors thank Jason Kraftcheck for his advice and assistance using MOAB. This work was supported, in part, by Sandia National Laboratories and the US ITER Project through Sandia contracts #579323 and #866756. This work was also supported by the US Department of Energy Scientific Discovery through Advanced Computing program under Contract DE-AC0206CH11357. Argonne National Laboratory (ANL) is managed by UChicago Argonne LLC under Contract DE-AC02-06CH11357. The submitted manuscript has been created in part by UChicago Argonne, LLC, Operator of Argonne National Laboratory (”Argonne”). Argonne, a U.S. Department of Energy Office of Science laboratory, is operated under Contract No. DE-AC02-06CH11357. The U.S. Government retains for itself, and others acting on its behalf, a paid-up nonexclusive, irrevocable worldwide license in said article to reproduce, prepare derivative works, distribute copies to the public, and perform publicly and display publicly, by or on behalf of the Government.
Sealing Faceted Surfaces to Achieve Watertight CAD Models
193
References 1. 3D Systems Inc. Stereolithography Interface Specification (1988) 2. Bhet, E., Cuilliere, J.C., Trochu, F.: Generation of a Finite Element MESH from Stereolithography (STL) Files. Computer-Aided Design 34(1), 1–17 (2002) 3. Rypl, D., Bittnar, Z.: Generation of Computational Surface Meshes of STL Models. Journal of Computational and Applied Mathematics, Special Issue on Computational and Mathematical Methods in Science and Engineering (CMMSE 2004) 192(1), 148–151 (2006) 4. Tautges, T.J., Wilson, P.P.H., Kraftcheck, J.A., Smith, B.M., Henderson, D.L.: Acceleration Techniques for Direct Use of CAD-Based Geometries in Monte Carlo Radiation Transport. In: Proc. International Conference on Mathematics, Computational Methods, and Reactor Physics (2009) 5. Spatial Corporation. Spatial Product Documentation (2009), http://doc.spatial.com/index.php/Refinements#Surface_Tolerance 6. Open CASCADE technology, 3D modeling & numerical simulation, http://www.opencascade.org/ 7. Sheffer, A., Blacker, T.D., Bercovier, M.: Virtual Topology Operators for Meshing. International Journal of Computational Geometry and Applications 10(2) (2000) 8. Sandia National Laboratories. CUBIT Geometry and Mesh Generation Toolkit (2010), http://cubit.sandia.gov 9. Tautges, T.J.: The Common Geometry Module (CGM): a Generic, Extensible Geometry Interface. Engineering with Computers 17(3), 299–314 (2001) 10. Bischoff, S., Kobbelt, L.: Structure Preserving CAD Model Repair. Eurographics 24(3), 527–536 (2005) 11. Ju, T.: Fixing Geometric Errors on Polygonal Models: A Survey. Journal of Computer Science and Technology 24(1), 19–29 (2009) 12. Edelsbrunner, H., M¨ ucke, E.: Three-Dimensional Alpha Shapes. ACM Transactions on Graphics 13(1), 43–72 (1994) 13. Amenta, N., Bern, M., Kamvysselis, M.: A New Voronoi-Based Surface Reconstruction Algorithm. In: Proceedings of the 25th Annual Conference on Computer Graphics and Interactive Techniques, pp. 415–421. ACM, New York (1998) 14. Murali, T.M., Funkhouser, T.A.: Consistent Solid and Boundary Representations from Arbitrary Polygonal Data. In: I3D 1997: Proceedings of the 1997 symposium on Interactive 3D graphics, p. 155. ACM, New York (1997) 15. Ju, T.: Robust Repair of Polygonal Models. In: SIGGRAPH 2004: ACM SIGGRAPH 2004 Papers, pp. 888–895. ACM, New York (2004) 16. Bohn, J.H., Wozny, M.J.: A Topology-Based Approach for Shell Closure. Geometric Modeling for Product Realization, 297–319 (1993) 17. Barequet, G., Sharir, M.: Filling Gaps in the Boundary of a Polyhedron. Computer Aided Geometric Design 12, 207–229 (1995) 18. Barequet, G., Kumar, S.: Repairing CAD Models. In: VIS 1997: Proceedings of the 8th Conference on Visualization. IEEE Computer Society Press, Los Alamitos (1997) 19. Klincsek, G.T.: Minimal Triangulations of Polygonal Domains. Combinatorica 79 (1980)
194
B.M. Smith, T.J. Tautges, and P.P.H. Wilson
20. Sheng, X., Meier, I.R.: Generating Topological Structures for Surface Models. IEEE Computer Graphics and Applications 15(6), 35–41 (1995) 21. Gu´eziec, A., Taubin, G., Lazarus, F., Horn, W.: Converting Sets of Polygons to Manifold Surfaces by Cutting and Stitching. In: VIS 1998: Proceedings of the Conference on Visualization, pp. 383–390. IEEE Computer Society Press, Los Alamitos (1998) 22. Borodin, P., Novotni, M., Klein, R.: Progressive Gap Closing for Mesh Repairing. Advances in Modelling, Animation and Rendering, 201–211 (2002) 23. International Meshing Roundtable. Stitching and Filling: Creating Conformal Faceted Geometry (2005) ´ Klein, R.: Multiresolution Rendering by Sewing 24. Kahlesz, F., Bal´ azs, A., Trimmed NURBS surfaces. In: SMA 2002: Proceedings of the Seventh ACM Symposium on Solid Modeling and Applications, pp. 281–288. ACM, New York (2002) 25. Busaryev, O., Dey, T.K., Levine, J.A.: Repairing and Meshing Imperfect Shapes with Delaunay Refinement. In: SPM 2009: SIAM/ACM Joint Conference on Geometric and Physical Modeling, pp. 25–33. ACM, New York (2009) 26. Chong, C.S., Kumar, A.S., Lee, H.P.: Automatic Mesh-Healing Technique for Model Repair and Finite Element Model Generation. Finite Elements in Analysis and Design 43, 1109–1119 (2007) 27. Ruppert, J.: A Delaunay Refinement Algorithm for Quality 2-Dimensional Mesh Generation. Journal of Algorithms 18(3), 548–594 (1995) 28. Tautges, T.J., Meyers, R., Merkley, K., Stimpson, C., Ernst, C.: MOAB: A Mesh-Oriented Database. Technical report, Sandia National Laboratories, SAND2004-1592 (2004) 29. O’Rourke, J.: Computational Geometry in C, 2nd edn. Cambridge University Press, Cambridge (1998)
A Metric for Automatic Hole Characterization German Sanchez T1, John W. Branch2, and Pedro Atencio3 1
Professor Faculty of Engineering, Systems Engineering Program, Magdalena University, Colombia
[email protected] 2 Professor school of system and informatics, faculty of minas. National University of Colombia - Medellin, Colombia
[email protected] 3 Student of system and informatics school, faculty of minas. National University of Colombia - Medellin, Colombia
[email protected]
Summary. The correct repair of three-dimensional models is still an open research problem, since acquiring processes (methods and technology) still have limitations. Although a wide range of approaches have been proposed, the main limitation is that user intervention is required to decide which regions of the surface should be corrected. We propose an automatic method for hole characterization enabling the classification of real and false anomalies without user intervention by using an irregularity measure based on two geometrical estimations: the torsion contour’s estimation uncertainty, and an approximation of geometrical shape measure surrounding the hole. Keywords: Curve torsion, entropy contour, Integration, surface reconstruction.
1 Introduction The shape reconstruction process requires estimating a mathematical representation of an object’s geometry using a measured data-set from the object [1]. Since there is no an ideal sensor that does not alter the samples obtained, the process should deal with general problems in order to generate models as accurate as possible. In context, there are many measuring drawbacks in the acquisition step: topological characteristic of the objects, sensor structure, physical properties of the object’s material, illumination conditions, among others. These inadequacies represent the main source of anomaly generation, and must be repaired in order to create a valid digital model [2]. The anomalies could be classified into three types: noise, holes artifacts and redundancy. Typically, these anomalies are repaired in a phase called Integration [3]. Whatever the anomaly type is, the process to correct it corresponds to a wide studying area, with many proposed techniques. However, correcting an anomaly is still considered an open problem inside the Computer Vision and Computer
196
G. Sanchez, T.J.W. Branch, and P. Atencio
Graphics Community. The difficulty lies, in some cases, in the fact that exact nature of the anomaly’s source is undetermined or unknown, i.e. the noise distribution function [4], or its modeling is complex and does not have an unique solution, i.e. the filling of holes. The classical reconstruction methods need to apply a post-processing procedure after the final stage of surface-fitting. This is mainly due to the difficulty in differentiating the nature of the discontinuity, that is, whether or not it belongs to the actual surface (see Figure 1).
(a)
(b)
(c) Fig. 1. Examples of surface discontinuity, a-b) real discontinuities, c) false discontinuity
One of the main desirable features in surface reconstruction methods is the ability to fill holes or to complete missing regions. Lack of information is caused mainly by the reflective properties of the material, or by occlusion problems in regions inaccessible to the sensor. Some methods make an implicit correction during the fitting phase by means of global reconstruction [1] [5]. This approach has two disadvantages: First, it does not permit to keep or represent false holes, i.e. those belonging to the object, and second, the quality of the portion generated depends on the technique used and not on the analysis of the intrinsic geometry of the object. While taking the surface as continuum and complete, these techniques reproduce visually appropriate solutions. However, the correction of these anomalies is still limited to particular cases when objects are closed. A wide range of works has been proposed, many of them can be classified according to the representation used in the initial data, such as mesh repair techniques and dispersed data. However, other classifications can be made according to the conceptual nature of the used technique: based on geometry, algebraic methods and implicit functions.
A Metric for Automatic Hole Characterization
197
Hole Detection For the process of identifying holes, the most simple and functional procedure, with great ease of implementation consists in the idea that a discontinuity an the surface is easily defined as a succession of boundary edges. A boundary edge is defined as a triangle edge that is not shared by any other triangle. The procedure begins with a general search on the mesh to find an initial boundary triangle [6]. The search continues with the neighboring triangles looking for the next boundary edge which must shared a vertex with the initial edge. The process goes on, until the initial triangle is reached. Finally, a closed path that defines the hole contour is traced. The most important weakness of this simple procedure is that is limited to detecting any discontinuities but does not differentiate between real and false holes, because it assumes a whole closed object surface. Filling Holes After the identification procedure is applied, the hole-filling procedure continues by means of surface segment generation, for which, different techniques have been proposed [7] [8] [9] [10] [11] [12] [13] [14]. There are two general trends in the group of geometry-based techniques: repair based on triangles meshes and repair based on voxels. Liepa [6] describes a method for filling holes in meshes based on Delaunay Triangulations of the hole, after a refinement approach to mesh optimization by minimizing an energy functional related to the neighbor curvature estimation. Branch J, [14] filled the holes basing on the local interpolation of the radial basis function. A new segment is generated over a regular and symmetric mesh taking the original point-set density. This approach correctly reproduces the general geometry of the neighborhood hole contour but it fails when a planar surface contains the hole. Wei [15] proposed an algorithm for filling holes that starts with a hole identification phase and then applies a triangulation of the hole region using the Advancing Front Method. Finally, by solving a Poisson equation, the vertex of the generated triangles is adjusted. Although adequate visual results are obtained with this procedure, it is time costly and depends on the size of the hole. Voxel-based approaches estimate an initial surface volumetric representation by voxel-set. These voxel units are marked with a sign according to their relative position to the surface, that is, inside or outside the surface. Different techniques have emerged to fill the hole in the volumetric space. Curless [16] proposed a method based on volumetric diffusion consisting of a distance function estimation which is used to mark the voxel, and then diffusion is applied through the volume to find the zero-set that define the surface. A similar approach is proposed by Davis [8]. Ju [17] proposed a method of contour surface reconstruction by marking the voxel using an Octree data structure. The procedure is able to fill small gaps, taking into account geometric characteristics. The main limitation is that the hole size must be smaller than the relative surface size. Similarly, Joshua [10] describes an algorithm for hole-filling based on space decomposition by atomic volume regions and defines the model as the union of inner atomic units using a graph cut. User intervention is required to select the way to fill the hole. Chun [18]
198
G. Sanchez, T.J.W. Branch, and P. Atencio
describes a two-phases approach to 3D model repair. The first phase, a radial basis function interpolation is used to fill the region inside the hole; the second one is a post-processing stage to refine the geometrical detail. In the refinement stage the normals are adjusted to produce adequate visual results. We can conclude that hole-repairing methods are typically part of a pre-process of the surface fitting step, to get an accurate representation of the geometrical characteristics. In order to correctly fill those holes, a manual-assisted correction procedure is needed. Generally, this manual-assisted procedure has been based on both geometric and mathematical concepts. Their most important weakness lies in its application-domain limited nature, mainly due to their narrow flexibility in objects with different topologies. In this paper, we propose a metric for robust hole characterization in 3D models. This metric intends to characterize holes through geometric features measures. Our hypothesis is based on a widely accepted definition [19]: free-form objects are smooth except in regions that represent specific geometric details. Hence, if there are not any problems in the acquisition stage, a false contour anomaly should not have large geometric variations; otherwise, it could be caused by problems in the acquisition stage and constitute an anomaly to be repaired. Thus, if there were any problems during the acquisition process then the data is altered introducing distortion that should not be equal for the segments that define the anomaly. That is, acquisition problems introduce some degree of "contour distortion”. The characterization of each anomaly is based on the quantification of this distortion, which for this particular case is approximated by a quantification of the entropy in the boundary geometry. The paper is organized as follows: section 2 introduces the topic of anomalies characterization; section 3 describes the hole context irregularity measure; section 4 describes the proposed contour’s irregularity; and section 5 presents the experimental design and results.
2 Anomalies Characterization The main problem for the automatic repair of holes is to differentiate whether or not the discontinuity belongs to the object. In this context, the key difference between 3D scattered data and other data types such as images or video, is that 3D scattered data are typically irregularly sampled. The points’ distribution of vertices across the surface is not uniform, so to quantify a measure it must be robust under different distribution of points. In order to get the most accurate estimation of the irregularity of a hole we propose a metric that measures the hole´s most important geometrical features from two points of view: surface irregularity around the hole, and contour curve irregularity measure from the torsion and curvature entropy. A summary of the general diagram is shown in Figure 2.
A Metric for Automatic Hole Characterization
Ž ŽŶƚĞĞdžƚŝƌƌƌĞŐƵ ƵůĂƌŝƚƚLJŵĞ ĞĂƐƵ ƵƌĞ
Ž ŽŶƚŽƵ ƵƌŝƌƌƌĞŐƵůĂƌŝƚLJLJŵĞĞĂƐƵƌƌĞ
y yes
noo
High entroppy?
Is ann ano omally
199
Iss a faalse hole h
Fig. 2. Diagram of hole characterization
3 Hole’s Context Irregularity Measure Initially, it starts making a cluster environment analysis by regions variability quantification around the hole. For each one of clusters, the centroid is taken to estimate a shape description by geometrical-topological properties. Therefore, this stage implements a general technique of clustering by region growing. The algorithm starts calculating a prior estimation of curvature at each point of surface [6]. It is approximated by principal component analysis obtained resolving the covariance matrix, so that: 1
(1)
1 where is the neighborhood size of , and defined following equation:
is the centroid of each cluster and is
1
(2)
The curvature estimation is approximate by eq. 3, like in [26]: , where
(3)
Note that the eigenvector associated with λ indicates the low variation direction of the data, therefore, aims to approximate the normal vector of the surface in the point , so that indicates quantitatively the variation of the surface tangent plane, and it constitutes a measure of the variation of the surface.
200
G. Sanchez, T.J.W. Branch, and P. Atencio
Once the approximation of the curve is obtained, the next step is to compute a clustering of surfaces, so that the variance of each cluster does not exceed a fixed threshold β. The general description of this procedure is presented in Algorithm 1 and an example in Figure 3. Algorithm 1: Clustering and center selection of environment. Center selection ( ) Take a Pk random seed point and create a new cluster Ci. while(Nota ll point are clustering) Add a vertex Vk є Nci successively to C, while Vci < β, where Nci is a radial neighborhood of Ci and Vci is the estimation of variance of cluster Ci. Endwhile
Fig. 3. Cluster contour result
In this work we only use the curvature approximation for clustering the point set around the hole-contour. However, the classical surface curvature measures, such as the Gaussian and the mean curvature at a point of a surface, are not very indicative of local shape. Hence, we used a measured independent of the size of the surface so it is locally described as shape of the surface. The shape index [20] is a measure that describes the second order structure of the surface in the neighborhood of any one of its points. This is thus estimated as follow: 2
arctan
(4)
k are the principal curvatures, and s 1, 1 except for the plaWhere k nar region that has an indeterminate shape index. In order to obtain a global holecontour description, an average shape-index of cluster is estimated, due to the fact that shape-index is a point measure. So, the centroid shape-index of each cluster i is thus: 1
(5)
A Metric for Automatic Hole Characterization
201
Where, is a shape-index of the cluster , and c C is the set of k cluster (see Figure 4). The point-set of size N , such that is the amount of points of the cluster i. In general, this corresponds to a shape-index average, weighted by the amount of points in each cluster.
Fig. 4. Points’ selection for index-shape estimation
4 Measure of Contour’s Irregularity In this step we are interested in measuring the geometrical characteristic of the contour curve. i.e. its means its curvature and its torsion. The aim of these estimations is to quantify its irregularity by means of the uncertainty using the entropy measure. Contours’ Torsion Entropy Measure The two fundamental characteristics of a curve are its curvature and torsion; these allow to measure how a curve bends inside the 3D space, therefore, it constitutes a curve’s particular characteristic. Often, we assumed that discontinuous contour curves in smooth objects without acquisition problem are smooth too. Contour bends give us a measure of irregularity. However, estimating the accurate torsion value of a sample curve, defined by a piecewise linear approximation through an ordered finite collection of points p , is not a trivial task since noise is present. i.e., the points p stay too close to the curve, but not necessarily lie on it. In order to approximate a correct classification of contour curves, we used the τ s N s torsion measure. For spatial curve the torsion is defined by B s where N s r s / r s is the normal vector, s is the arc-length from a specific position r t given by a parametric curve r, to a close position r t and de(see Figure 5). For a non arc-length fined by s t r u rized r t , τ s is thus estimated: (6)
202
G. Sanchez, T.J.W. Branch, and P. Atencio
Fig. 5. Normal, tangent and osculating plane
To estimate the torsion we adopt the weighted least squares approach and local arc-length approximation [22] [23] [24]. It considers a samples-set p from a spatial curve. The estimation of derivates of r at p is performed with a pointsubset of 2q 1 points such that (see Figure 6): ,
,…,
.
Fig. 6. Weight least square curve
Then a parametric curve x s , y s , z s)) is fitted locally, assuming p r and an arc-length s value associated to the samples p : 1 2 1 2 1 2 ̂ Taking
coordinate, the derivates x , x , x E x ,x ,x
1, s Where w trix inversion:
∑
w x
p
p
x s
,p
1 6 1 6 1 6
(7)
are obtained minimizing [21]: 1 x s 2
1 x 6
s
(8)
. It can be written in terms of ma-
A Metric for Automatic Hole Characterization
203
(9) A similar approach is used to estimate the
and
derivates getting the vectors:
From the equations system: (10) here, a a a
a a a
The a values and b
b b b
a a a ,
, ,
b b b
are defined thus:
1 6
,
,
,
,
,
,
1 2
1 4
1 12
1 36
1 2 1 2 1 2
Finally, it defines:
The computation of
,
is straightforward, thus:
,
,
,
1 6 1 6 1 6
, , ,
b b b
, , ,
204
G. Sanchez, T.J.W. Branch, and P. Atencio
Due to their nature, hole-characterization problems suggest solutions based on inference, since it needs a process of drawing conclusions from available information that is partial, insufficient and that does not allow to reach an unequivocal, optimal and unique solution. Then we need to make inferences from the available data assuming it is noisy. Specifically, the topic of hole characterization constitutes a highly ambiguous example to take decisions because there are many possible configurations of irregular contours. Both aspects, noise and ambiguity imply taking uncertainty in account. The adequate way to deal with the presence of uncertainty, related to lack of information, is to introduce assumptions about the problem’s domain or a priori knowledge about the data, by means of the notion of degrees of belief. It should be treated using the classical rules of calculus of probabilities. The rules of probability theory allow us to assign probabilities to some "complex" propositions on the basis of the probabilities that have been previously assigned to other, perhaps more "elementary" propositions. However, in order to estimate a measure to characterize contours, we are not interested in just probability estimation about a geometrical characteristic, but also in its variability. High variability could be measured through entropy. Specifically, conditional entropy is used. Given two variables and , the | quantity that measures the amount of uncertainty about one variable x when we have some limited information about another variable is conditional entropy [25]. It is obtained by calculating the entropy of as if the precise value of were known and then taking the expectation over the possible values of y. |
|
|
log
|
In a similar way, log
|
|
(11)
,
forming the contour of a 3D curve definGiven a sequence of points : ing an anomaly, and a set of geometrical characteristic measured associated to each one in . We want to measure the irregularity in from a prior knowledge of some geometrical characteristic measure. It means, the certainty a point is estimated taken a -set : : 1 1 over a sorted sequence of points used to estimate the next value. The certainty or in inverse form, the unpredictably of all is related to entropy.
A Metric for Automatic Hole Characterization
, Where
:
,
,…,
,
log
|
205
(12)
,, and: .
Contours’ Curvature Measure The principal limitation of a descriptor based on torsion measure is deal with planar curves. Planar curves may appear as a result of occlusions; although these are uncommon the torsion based decision is inappropriate. However, in order to completeness, our metric take into account those cases and use for planar cases a tangent vector variability measure like irregularity. For anomalies in planar cases the tangent variability usually is high, otherwise, real holes show smooth changes between tangents angles (see Figure 7).
a)
b)
c)
d)
Fig. 7. Tangent vector (Red) variability for a) Dragon object and b) eye contour from Mask, c-d) close view of both cases respectively
To estimate this measure, we take the weighted least squares approach and local arc-length approximation made in the section 4. Tangent vector is defines ,, or in derivates terms
. We estimate the entropy
of
angle between successive tangents like the equation 12, replacing the torsions distributions by angle between tangents distribution. And finally quantify the global entropy of the contour by: S
S
S
(13)
206
G. Sanchez, T.J.W. Branch, and P. Atencio
Finally,
For undefined cases of SI it means for planar case, the S measure is an accurate estimation of irregularity.
5 Experiment Design and Result In order to estimate the and | quantity given a continuous variable of torsion measure, we used a bin size to discrete the domain of an experimental set of hole-contour configurations. The experimental set was obtained from 10 images with real hole anomaly and 10 contours of false hole anomaly, in partial and complete 3d models’ range data. Some images were scales to maintain a fixed scale. It was done by subtracting the mean and dividing by the standard deviation. The parameter r was set to 10% of standard deviation and m set to 2. The irregularity was estimated with equation 13. Figure 8 shows the irregularity estimated for both sets. It shows that the irregularity measure is highly sensitive to the irregularities in the contour. Determining if an anomaly is real or false is straightforward because the values are sufficiently separated. The midpoint of the range of separation is 3.1. The experimental threshold for classification was estimated in this value.
Fig. 8. Irregularity values of false (blues) and real anomalies (red)
The irregularity could increase when increased the separation of the data. The method is highly sensitive to noise; small changes in the regularity of the contour show an equal increase in the estimation of entropy. This method can be used as an initial step in the process of correcting anomalies. We aim to complement the method with the filling process to propose an automatic robust method to correct anomalies.
A Metric for Automatic Hole Characterization
207
The proposed method allows to estimate a metric for the automatic classification of anomalies in range images. The purpose of the method is to automate a process that has traditionally required user intervention. The method estimates the most relevant geometric characteristics of curves and surfaces to describe them. The anomalies used as the working set were mostly generated by occlusion.
References [1] Curless, B.: New Methods for Surface Reconstruction from Range Images. Stanford University, Stanford (1997) [2] Kumar, A., et al.: A Hole-filling Algorithm Using Non-uniform Rational B-splines, pp. 169–182. Springer, Heidelberg (2007) [3] Turk, G., Levoy, M.: Zippered polygon meshes from range images, pp. 311–318. ACM, New York (1994) [4] Sun, X., et al.: Noise in 3D laser range scanner data. In: IEEE International Conference on Shape Modeling and Applications, SMI 2008, pp. 37–45 (2008) [5] Carr, J.C., et al.: Smooth surface reconstruction from noisy range data, p. 119. ACM Press, New York (2003) [6] Liepa, P.: Filling holes in meshes, pp. 200–205. Eurographics Association (2003) [7] Dorai, C., et al.: Registration and Integration of Multiple Object Views for 3D Model Construction. IEEE Transactions on Pattern Analysis and Machine Intelligence 20, 83–89 (1998) [8] Davis, J., et al.: Filling Holes in Complex Surfaces Using Volumetric Diffusion, pp. 428–438 (2002) [9] Wang, J., Oliveira, M.M.: A hole-filling strategy for reconstruction of smooth surfaces in range images. In: XVI Brazilian Symposium on Computer Graphics and Image Processing. SIBGRAPI 2003, pp. 11–18 (2003) [10] Podolak, J., Rusinkiewicz, S.: Atomic volumes for mesh completion, p. 33. Eurographics Association (2005) [11] Bischoff, S., Pavic, D., Kobbelt, L.: Automatic restoration of polygon models. ACM Trans. Graph. 24, 1332–1352 (2005) [12] Guo, T., et al.: Filling Holes in Meshes and Recovering Sharp Edges. In: IEEE International Conference on Systems, Man and Cybernetics, SMC 2006, vol. 6, pp. 5036– 5040 (2006) [13] Bendels, G.H., Schnabel, R., Klein, R.: Fragment-based Surface Inpainting. In: Desbrun, M., Pottmann, H. (eds.) The Eurographics Association (2005) [14] Branch, J., Prieto, F., Boulanger, P.: Automatic Hole-Filling of Triangular Meshes Using Local Radial Basis Function, pp. 727–734. IEEE Computer Society, Los Alamitos (2006) [15] Zhao, W., Gao, S., Lin, H.: A robust hole-filling algorithm for triangular mesh. Vis. Comput. 23, 987–997 (2007) [16] Curless, B., Levoy, M.: A volumetric method for building complex models from range images, pp. 303–312. ACM Press, New York (1996) [17] Ju, T.: Robust repair of polygonal models, pp. 888–895. ACM, New York (2004) [18] Chen, C.-Y., Cheng, K.-Y.: A Sharpness-Dependent Filter for Recovering Sharp Features in Repaired 3D Mesh Models. IEEE Transactions on Visualization and Computer Graphics 14, 200–212 (2008)
208
G. Sanchez, T.J.W. Branch, and P. Atencio
[19] Besl, P.J.: The free-form surface matching problem, in Machine Vision for ThreeDimensional Scenes. Academic Press, London (1990) [20] Koenderink, J.J., van Doorn, A.J.: Surface shape and curvature scales. Image Vision Comput. 10(8), 557–565 (1992) ISSN:0262-8856 [21] do Carmo, M.: Differential geometry of curves and surfaces. Prentice Hall, Englewood Cliffs (1976) [22] Lewiner, T., Gomes Jr., J.D., Lopes, H., Craizer, M.: Curvature and torsion estimators based on parametric curve fitting. Computers & Graphics 29(5), 641–655 (2005) [23] Lancaster, P., Salkauskas, K.: Surfaces generated by moving least squares methods. Math. Comp. 37(155), 141–158 (1981) [24] Lancaster, P., Salkauskas, K.: Curve and Surface Fitting: An Introduction. Academic Press, London (2002) [25] Ariel, C.: Lectures on Probability, Entropy, and Statistical Physics. Albany: Department of Physics, University at Albany (2008) 0808.0012 [26] Pauly, M., Gross, M., Kobbelt, L.P.: Efficient simplification of point-sampled surfaces, pp. 163–170. IEEE Computer Society, Los Alamitos (2002)
Receding Front Method: A New Approach Applied to Generate Hexahedral Meshes of Outer Domains Xevi Roca, Eloi Ruiz-Giron´es, and Josep Sarrate Laboratori de C`alcul Num`eric (LaC`aN), Departament de Matem`atica Aplicada III, Universitat Polit`ecnica de Catalunya, Jordi Girona 1-3, E–08034 Barcelona, Spain {xevi.roca,eloi.ruiz,jose.sarrate}@upc.edu
Abstract. Two of the most successful methods to generate unstructured hexahedral meshes are the grid-based methods and the advancing front methods. On the one hand, the grid-based methods generate high quality elements in the inner part of the domain using an inside-outside approach. On the other hand, advancing front methods generate high quality hexahedra near the boundary using an outside-inside approach. In this paper we propose the receding front method, an original approach that combines the advantages of both methodologies: we use an inside-outside mesh generation approach by means of a reversed front advance. We apply this approach to mesh outer domains. To reproduce the shape of the boundaries, we first precompute the mesh fronts by combining two solutions of the Eikonal equation on a tetrahedral reference mesh. Then, to generate high quality elements, we expand the quadrilateral surface mesh of the inner body towards the unmeshed external boundary using the pre-computed fronts as a guide. Further research is under way in order to apply the proposed method to more complicated geometries. Keywords: Mesh generation, unstructured hexahedra, eikonal equation.
1 Introduction During the last two decades several general-purpose algorithms for fully automatic hexahedral mesh generation have been proposed, see [1, 2, 3, 4, 5, 6] for a survey. However, none of the existent algorithms is robust, automatic and generates highquality meshes for any initial geometry. There are two families of methods that almost fulfill all these requirements, the grid-based and the advancing front methods. In fact, these approaches are the most successful methodologies to obtain a generalpurpose hex-meshing algorithm. Furthermore, the grid-based and advancing front methods have advantages and disadvantages that complement each other. Thus, we
This work was partially sponsored by the Spanish Ministerio de Ciencia e Innovaci´on under grants DPI2007-62395, BIA2007-66965 and CGL2008-06003-C03-02/CLI and by Universitat Polit`ecnica de Catalunya (UPC).
210
X. Roca, E. Ruiz-Giron´es, and J. Sarrate
can consider how to obtain a hexahedral meshing approach that presents only the advantages, and avoids the disadvantages, of these two methods. On the one hand, the grid-based methods [7, 8, 9, 10] are the only family of robust and fully automatic hexahedral mesh generation algorithms. In addition, they generate high-quality meshes in the inner part of the mesh. These advantages are possible because the mesh is generated from inside-to-outside. However, the gridbased methods generate low quality hexahedra near the boundary and the final mesh depends on the spatial orientation of the domain. These drawbacks appear because the inner mesh does not have layers of hexahedra that progressively adapt to the boundary shape of the domain. On the other hand, the advancing front methods [11, 12, 13] generate high-quality meshes near the boundary (boundary sensitive) that do not depend on the orientation of the object (orientation insensitive), see details on hex-meshing requirements in [2]. This is possible because the elements are generated layer by layer following the shape of the boundary surface. However, the advancing front methods are less robust and automatic. When the fronts are advanced, from the boundary to the inner part, they collide and can delimit complex voids. Specifically, if the advancing front method starts with a prescribed quadrilateral mesh of the boundary (constrained approach) [11] the resulting void is, in general terms, over-constrained and cannot be meshed. On the contrary, the versions of the advancing front method that start without a prescribed mesh of the boundary (unconstrained approach) [12, 13] can always generate a hexahedral mesh for the void. To this end, usually the unconstrained methods [12, 13, 14, 15] use a tetrahedral mesh to generate a hexahedral one. However, the quality of the mesh of the inner void is not guaranteed because it results from splitting each tetrahedron in four hexahedra. These disadvantages at the inner part are caused because the elements are generated from outside-to-inside. Note that also there are constrained methods that directly transform a tetrahedral mesh into a hex-dominant mesh [16, 17]. Summarizing, by generating elements from inside-to-outside we can avoid the front collisions that lead to unmeshed voids or low-quality inner meshes. Moreover, by generating the elements using fronts (layers of elements) we can obtain meshes that reproduce properly the shape of the domain boundary. In this work we apply these advantages to mesh outer domains. To this end, we propose: • •
To generate layers of elements from inside-to-outside. Hence, we present the first receding front method. That is, a reversed advancing front method. To pre-compute the fronts (or layers of hexahedra) combining two solutions of the Eikonal equation. One solution determines the distance to the inner part and the other the distance to the outer boundary. The level sets of the combination of both solutions determine the fronts.
This work is clearly related to the grid-based and advancing front methods. However, the grid-based methods do not generate layers of hexahedra from insideto-outside that smoothly adapt to the boundary of the domain. In addition, the advancing front methods do not start to generate layers of hexahedra from inside the domain. In this sense, the proposed approach is different to both methodologies.
Receding Front Method: Applied to Outer Domains
211
Furthermore, we propose to pre-compute the fronts by solving the Eikonal equation. It is important to point out that there are other mesh generation works that use the Eikonal equation. In his seminar work, Sethian proposes a method to advance structured meshes by solving the Eikonal equation [18]. Another front propagation method based on the Eikonal equation is presented in [19]. In [20, 21], the authors show how to obtain the medial axis transform (MAT) by means of the Eikonal equation. Nevertheless, this is the first work were two solutions of the Eikonal equation are combined to pre-compute the fronts and obtain an unstructured hexahedral mesh. The remainder of the paper is organized as follows. First, we present a 2D motivation example in Section 2. According to this motivation, in Section 3 we detail the receding front method. Specifically, we present how to pre-compute the fronts, generate the meshes between the fronts and refine the resulting hexahedral fronts. Finally, in Section 4 we present several example meshes that demonstrate the capabilities of the first implementation of the receding front method.
2 2D Motivation To illustrate and clarify the basis of the receding front method in 3D, we consider a 2D example. Specifically, we present a smooth domain with a three-branched skeleton to be meshed with quadrilateral (hexahedral) elements. With the help of this domain we first review the main advantages and disadvantages of the grid-based and advancing front methods. Then, we outline the proposed receding front method which combines the advantages of both methods. Given a domain, the grid-based methods first generate a quadrilateral (hexahedral) mesh in the inner part of the domain, Fig. 1(a). Then, the remaining void between the inner mesh and the boundary, Fig. 1(b), has to be meshed. To this end, several new nodes are created on the boundary. These nodes are connected with the quadrilateral elements of the boundary of the inner mesh to form the last layer of hexahedra, Fig. 1(c). Since the boundary of the inner mesh is not adapted to the shape of the domain boundary, the last layer of hexahedra can present low quality elements. We would like to remark that this approach is robust and can be applied to general geometries to obtain meshes with high-quality elements in the inner part.
(a)
(b)
(c)
Fig. 1. Several steps of a grid-based method: (a) inner mesh; (b) void between boundary and inner mesh; and (c) final mesh
212
X. Roca, E. Ruiz-Giron´es, and J. Sarrate
The advancing front methods generate layers of elements (fronts) that start at the domain boundary and layer by layer reach (advance towards) the inner part of the domain. At the last step, several elements that connect the fronts close the remaining void. There are two families of advancing front methods: the constrained [11] and the unconstrained approaches [12, 13]. The constrained approach generates a first layer of elements, Fig. 2(a), that matches with a prescribed mesh of the boundary. Then, several layers of elements are generated by merging and matching the elements that are in front of the last layer, Fig. 2(b). Since the process starts with a prescribed mesh of the boundary and advance inwards, the last voids in the inner part of the domain can be complex and over-constrained. Specifically, in the 3D case the advance can lead to remaining voids that cannot be meshed, Fig. 2(c). The unconstrained approach relaxes the hex-meshing problem by considering that the domain boundary is not meshed. The meshing process starts at the boundary and provides a decomposition of the domain in several layers, Fig. 3(a). The process stops when the inner void can be discretized with a hex-meshing primitive. Since the inner void results from successive offsets of the boundary, it can be as much difficult to hex-mesh as the initial domain. Thus, there are configurations where the inner void can not be meshed with a high-quality hex-meshing primitive. However, it is always possible to generate a hexahedral mesh. To this end, this approach generates a simplicial mesh of the unrecognized inner void, Fig. 3(b). The simplicial mesh can always be split in quadrilateral (hexahedral) elements, Fig. 3(c). Then, the boundary of this inner mesh is propagated through the layers to the boundary of the domain.
(a)
(b)
(c)
Fig. 2. Several steps of a constrained advancing front method: (a) first front; (b) last front and contours of the previous fronts; and (c) unmeshed void
(a)
(b)
(c)
Fig. 3. Several steps of an unconstrained advancing front method: (a) fronts and final void; (b) simplicial mesh of the void; and (c) splitting simplicial mesh
Receding Front Method: Applied to Outer Domains
213
The quality of the inner elements is not guaranteed because they are originated by a simplicial mesh. Moreover, the boundary of the inner mesh is propagated through the domain to the boundary. Thus, the inner mesh determines the structure and the quality of the inner part of the boundary curves (surfaces). It is important to point out that the element quality close to the boundary features is ensured because it is a front approach, except when the boundary has a very sharp dihedral angle. In addition, this approach is fully automatic and provides high-quality meshes for a wide range of geometries. To combine the advantages of both the grid-based and the advancing front methods, herein we propose the receding front method. To apply this methodology we require an initial mesh (seed) of the inner part of the domain, Fig. 4(a). Note that for the specific case of meshing the outer domain of a given body the initial mesh is a quadrilateral mesh of the body surface. This way, we can decouple the problem of generating the inner seed from the front generation process. The fronts that determine the layers of elements can be pre-computed. Specifically, we generate an offset of the shape of the inner seed towards the boundary, Fig. 4(b), and an offset of the boundary shape inwards, Fig. 4(c). These offsets are obtained as the level sets of two solutions of the Eikonal equation, Section 3.1. One solution is related to the boundary of the inner part and the other one to the outer boundary. To compute these solutions we use an edge-based solver on a triangular (tetrahedral) mesh [22]. Then, we combine both solutions to obtain a function of the domain that reproduces the inner shape in the inner part and the boundary close to the outer part, Fig. 4(d). Then, the fronts are obtained as the level sets of this function. Finally, these fronts can be used as a guide to generate layers of elements starting from the inner seed and finishing in the outer boundary, Fig. 5. To this end, we need to consider a set of templates that determine how to offset the previous layer of elements to
(a)
(b)
(c)
(d)
Fig. 4. Pre-computing the fronts: (a) outer boundary and inner seed; (b) level sets from inside to outside; (c) level sets from outside to inside; and (d) combining inside-to-outside with outside-to-inside level sets
214
X. Roca, E. Ruiz-Giron´es, and J. Sarrate
(a)
(b)
(c)
(d)
Fig. 5. Layers of elements for the receding front method: (a) first layer; (b) second layer; (c) third layer; and (d) final layer
the new front, Section 3.2. Moreover, we have to consider a set of refinement rules that ensure that the element size is not surpassed. The resulting procedure generates layers of elements that progressively morph from the shape of the inner seed to the shape of the outer boundary. Moreover, starting from the inner part we can avoid over-constrained or complex inner voids.
3 The Receding Front Method The receding front method is decomposed into two steps. First, we pre-compute a set of fronts between the inner and the outer boundaries. Second, we expand the quadrilateral mesh of the inner boundary towards the unmeshed outer boundary according to the pre-computed fronts. 3.1
Pre-computing the Fronts
Given a domain Ω ⊂ Rn , the Eikonal equation is the following non-linear partial differential equation
∇d = f in Ω (1) d|U⊂{Ω∪∂Ω} = 0, where f is a known function and · is the euclidean norm. To solve the Eikonal equation, we first generate a tetrahedral mesh of the domain. Then, we obtain the solution for that discretization by means of an edge-based solver [22]. 1 For f = 1 the solution d is the distance from ∂Ω. For f = h(x) the level sets of the solution d follow the size field h(x) defined for each x ∈ ∂Ω. In this work we consider f = 1.
Receding Front Method: Applied to Outer Domains
215
In our applications we consider a domain bounded by an inner object (which defines the inner boundary of the domain, ∂Ωin ) and a smooth outer boundary denoted by ∂Ωout . In order to find a distance field that takes into account the distance from each inner point to both boundaries we first consider the following problem, see Figure 6(a):
∇dout = 1 in Ω (2) dout |∂Ωout = 0, where dout 0. The solution of this problem provides the distance to the outer boundary. Then, we consider the problem, see Figure 6(b):
∇din = 1 in Ω (3) din |∂Ωin = 0, where din 0. The solution of this problem provides the distance to the inner boundary. Note that we use the same tetrahedral mesh to solve Equations (2) and (3). The combined distance field, u, is defined as: u :=
dout . dout + din
(4)
Note that the combined distance field verifies 0 u 1, and at the boundaries of the domain it also verifes that u|∂Ωout = 0 and u|∂Ωin = 1. Moreover, the contours of u close ∂Ωout are similar to dout whereas the contours of u close ∂Ωin are similar to din . That is, the combined distance field reproduces the shapes of the inner and outer boundaries close to them. Finally, we extract m level sets of the combined distance field u. These level sets determine the fronts used to advance the mesh from the meshed inner boundary towards the meshed outer boundary. Algorithm 1 details the proposed procedure to generate the level sets of the distance field.
(a)
(b)
Fig. 6. Solution of the Eikonal equation starting from: (a) the outer boundary (∂Ωout ) and, (b) the inner boundary (∂Ωin )
216
X. Roca, E. Ruiz-Giron´es, and J. Sarrate
Algorithm 1: Generate level sets ordered from inside to outside
2
Input: ∂Ωin , inner boundary; ∂Ωout , outer boundary; m, number of level sets Output: L, level sets ordered from inside to outside Scalar field din ← solve Eikonal equation in Ω starting at ∂Ωin Scalar field dout ← solve Eikonal equation in Ω starting at ∂Ωout
3
Scalar field u ←
4
Level sets L ← extract m iso-surfaces of u from 1 to 0
1
dout dout +din
Algorithm 2: Generate hexahedra between level sets
1 2 3 4 5 6 7 8
Input: L, ordered level sets; Q0 , quad surface mesh of the inner object Output: H, final hexahedral mesh Hex-mesh H ← {∅} foreach level set in L do Quad-mesh Q ← get the quadrilateral mesh on detect geometric features of Q Level set next ← get next level set to Hex-mesh H ← offset Q from to next H ← H ∪ H refine H according to the prescribed element size
3.2
Meshing the Fronts
From a quadrilateral surface mesh of the inner boundary we want to generate an unstructured hexahedral mesh of the domain without prescribing a quadrilateral surface mesh of the outer boundary. To this end, we detail in Algorithm 2 the proposed procedure. Each level-set will delimit a layer of hexahedral elements. Therefore, we have to describe the procedure to expand a quadrilateral mesh on level set to level set + 1. We first detect the geometric features of Q and classify the edges of the quad mesh as corner, reversal and end according to the angles defined by the adjacent faces, φ. An edge is classified as corner if π/4 ≤ φ < 3π/4; as reversal if 3π/4 ≤ φ < 5π/4; and as end if 5π/4 ≤ φ < 7π/4. Otherwise the edge is not a feature and it is classified as side. Once the edges are classified, we proceed to classify the nodes of the quadrilateral mesh. A node is classified as feature node if it belongs to three o more feature edges. Otherwise, the node is classified as nonfeature node. Note that these two classifications will determine the topology of the hexahedral mesh for the considered level. Once the edges and the nodes of the quadrilateral surface mesh are classified, we expand the quadrilateral mesh to the next level set. The expansion process is performed taking into account the topological entities of the quadrilateral mesh. First, we consider the faces of the quadrilateral mesh. Figure 7 illustrates the expansion of a quadrilateral face. Second, we expand the feature edges of the quadrilateral
Receding Front Method: Applied to Outer Domains
217
mesh according to their classification. Figure 8 illustrates the templates used to expand feature edges of the quadrilateral mesh. Third, we expand the feature nodes of the quadrilateral mesh according to the classification of adjacent feature edges. Figure 9 illustrates the templates used to expand feature nodes of the quadrilateral mesh. The size of the new hexahedra may differ from the prescribed element size. For this reason, a local refinement process is performed at each level. The edges of the
Fig. 7. Face template
Fig. 8. Edge templates
Fig. 9. Vertex templates
218
X. Roca, E. Ruiz-Giron´es, and J. Sarrate
new boundary that are longer than the prescribed element size are marked to be refined. Then, each hexahedron is replaced by a given template of hexahedra depending on the marked edges to be refined. To this end, we use the method proposed in [23] where the templates introduced by [9, 10] are adapted to marked edges. At this point, the algorithm of front meshing is iterated until all the fronts are discretized.
4 Examples In this section we present four meshes of the outer domain of a given object created with the receding front method. In all the cases the starting seed is a quadrilateral mesh of the inner surface. The user input is the element size of the quadrilateral mesh and the number of levels of the mesh. 4.1
Long Box
The first example presents a mesh generated on the exterior domain of a long box. The box is located inside a smooth domain. Note that the inner boundary only contains feature edges classified as corner, see Section 3.1. Figure 10(a) presents the tetrahedral mesh used to compute the solution of both Eikonal equations. Figure 10(b) presents the pre-computed fronts as detailed in Section 3.1. Note that we have prescribed four levels in order to generate the mesh. Figure 10(c) shows a general view of the hexahedral mesh while Figure 10(d) illustrates a longitudinal cut of the mesh. Although the quadrilateral surface mesh of the inner box is structured, the final mesh contains unstructured nodes both in the interior and on the boundary of the mesh. For instance, in Figure 10(c) we highlight a node with three adjacent hexahedra and in Figure 10(d) we mark an inner node with six adjacent hexahedra. 4.2
Pentagonal Star
The second example presents the generated mesh for the domain delimited by a star placed inside a sphere. In this case the definition of the domain contains feature edges classified as corner and end. The final mesh is composed by eight levels of hexahedral elements. Figure 11(b) shows a cut of the mesh and Figure 11(c) presents a detail of the unstructured mesh. Note that the expansion of the seed surface mesh generates unstructured elements in order to reach properly the outer boundary. 4.3
Smooth Object with a Reversal Feature
The objective of the third example is to show that using a refinement procedure we can respect the prescribed element size in the final mesh. To this end, we discretize a domain delimited by a flat object inside an ellipsoid. This geometry only contains feature edges classified as reversal. First, we generate a hexahedral mesh without using the local refinement process described in Section 3.1. Figure 12 shows the final mesh. Note that the obtained element size near the outer boundary is greater
Receding Front Method: Applied to Outer Domains
(a)
(b)
(c)
(d)
219
Fig. 10. Hexahedral mesh for the exterior domain of the long box. (a) Tetrahedral mesh used to solve the Eikonal equation. (b) Level sets of the combined distance field. (c) General view of the hexahedral mesh. (d) Longitudinal cut of the hexahedral mesh.
than the obtained element size near the inner boundary. In order to preserve the prescribed element size, in each level we perform a local refinement. Figure 13 illustrates that the final mesh reproduces with more fidelity the prescribed element size. Note that in both cases an unstructured mesh is obtained. 4.4
Space Capsule
One of the advantages of the proposed approach is that it is straightforward to stretch the elements in the normal direction of the fronts. To this end, we use a blending function [24] that modifies the combined distance field u introduced in equation (4): u 0=
eαu−1 , eα − 1
(5)
220
X. Roca, E. Ruiz-Giron´es, and J. Sarrate
(a)
(b)
(c)
Fig. 11. Hexahedral mesh for the exterior domain of the pentagonal star. (a) General view. (b) Vertical cut. (c) Detail of an unstructured region.
where α ∈ R. If α < 0, the levels are concentrated towards the outer boundary. If α > 0, the levels are concentrated towards the inner boundary. To illustrate the behavior of the blending function (5), we present in Figure 14(a) a uniform level set distribution defined on a simple geometry. Figure 14(b) presents the new the level set distribution when equation (5) is applied with α = 5. Note that the level sets are concentrated towards the inner boundary. Figure 15 presents the mesh generated on the exterior domain of a space capsule. In this mesh, we apply a boundary layer by using the blending function (5) with α = 7. The mesh is generated using 28 levels. Figure 15(b) shows a general view of the final mesh while Figure 15(b) shows a detail of the final mesh inner boundary.
Receding Front Method: Applied to Outer Domains
(a)
221
(b)
Fig. 12. Hexahedral mesh without local refinement for the exterior domain of the smooth object with a reversal feature. (a) General view of the outer boundary mesh. (b) Longitudinal cut.
(a)
(b)
(c)
Fig. 13. Hexahedral mesh with local refinement for the exterior domain of the smooth object with a reversal feature. (a) General view of the outer boundary mesh. (b) Longitudinal cut. (c) Detail of the inner levels.
222
X. Roca, E. Ruiz-Giron´es, and J. Sarrate
(a)
(b)
Fig. 14. Distribution of the level sets: (a) uniform; and (b) concentrating towards the inner boundary (α = 5)
5 Concluding Remarks and Future Work In this work we have proposed the receding front method, a new approach for generating unstructured hexahedral meshes applied to generate hexahedral meshes of outer domains. Specifically, the two main contributions of this work are to precompute the meshing fronts by combining two solutions of the Eikonal equation, and to advance unstructured hexahedral elements from inside-to-outside (recede) guided by the pre-computed fronts. The former allows us to obtain meshes that reproduce the domain shape close to the outer boundary. The latter allows us to avoid the collision of constrained meshing fronts. We have implemented the proposed method in the ez4u meshing environment [25]. The first results show the possibilities of the receding front method applied to the unstructured hexahedral mesh generation of exterior domains. Moreover, we show that it is straightforward to obtain stretched meshes along the normal direction of the domain boundaries. Our long-term goal is to obtain a general-purpose unstructured hexahedral mesh generator based on the receding front method. In this sense, the first implementation of the method presents several issues that should be investigated and solved in the near future. First, we are currently including additional advancing and refinement templates. These templates allow us to improve the quality of the meshes obtained by advancing the elements from one layer to the following one. Second, we want to extend the presented approach to mesh the exterior domain of several objects and objects with holes, for instance a torus inside a sphere. Third, we want to apply the exterior domain meshing tool to outer boundaries with feature curves and vertices. To this end, we need to develop an imprinting technique that allows to propagate through the fronts the features of the outer boundary towards the inner boundary. These imprints would determine a decomposition of the domain in sub-volumes that connect the outer boundary with the inner boundary. Then, we can restrict the receding front method to each one of the sub-volumes to advance layerby-layer unstructured hexahedra from the inner mesh to the outer boundary. The
Receding Front Method: Applied to Outer Domains
223
(a)
(b)
(c)
Fig. 15. Hexahedral mesh for the exterior domain of the space capsule. (a) General view of the outer boundary mesh. (b) Longitudinal cut. (c) Detail of the inner levels.
resulting hex-meshing primitive would respect the boundary features and would be equivalent to a fully unstructured sweeping (regular sweeping is semi-structured). Fourth, we will analyze how to deal with narrow regions where the thickness of the part is significantly smaller (for instance one order of magnitude) than the surrounding volume. Since our approach generates the same number of levels in the whole domain, the distance between two consecutive level sets is variable. Therefore, it could be interesting to generate different number of hexahedral layers in different regions bounded by two consecutive level sets. To this end, we will investigate how to discontinue a layer and connect it to the boundary in one part of the model, but continue advancing the fronts in other parts. Fifth, we have to investigate how to automatically generate an inner hexahedral mesh that approximately reproduces the
224
X. Roca, E. Ruiz-Giron´es, and J. Sarrate
skeleton of the domain. To this end, we have considered to use a similar technique to the one proposed in [20, 21]. Then, we can obtain an automatic unstructured hexahedral mesh generator by means of advancing the fronts from inside-to-outside with the receding front method. Finally, we have to analyze how the accuracy of the Eikonal equation solution influences in the resulting hexahedral mesh.
References 1. Owen, S.J.: A survey for unstructured mesh generation technology. In: 7th International Meshing Roundtable, pp. 239–267 (1998) 2. Blacker, T.D.: Automated conformal hexahedral meshing constraints, challenges and opportunities. Engineering with Computers 17(3), 201–210 (2001) 3. Tautges, T.J.: The generation of hexahedral meshes for assembly geometry: survey and progress. International Journal for Numerical Methods in Engineering 50(12), 2617–2642 (2001) 4. Baker, T.J.: Mesh generation: Art or science? Progress in Aerospace Sciences 41(1), 29–63 (2005) 5. Shepherd, F.J.: Topologic and geometric constraint-based hexahedral mesh generation. PhD thesis, The University of Utah (2007) 6. Roca, X.: Paving the path towards automatic hexahedral mesh generation. PhD thesis, Universitat Polit`ecnica de Catalunya (2009) 7. Schneiders, R., B¨unten, R.: Automatic generation of hexahedral finite element meshes. Computer Aided Geometric Design 12(7), 693–707 (1995) 8. Schneiders, R.: A grid-based algorithm for the generation of hexahedral element meshes. Engineering with Computers 12(3), 168–177 (1996) 9. Zhang, Y., Bajaj, C., Sohn, B.S.: 3D finite element meshing from imaging data. Computer Methods in Applied Mechanics and Engineering 194(48-49), 5083–5106 (2005) 10. Zhang, Y., Bajaj, C.: Adaptive and quality quadrilateral/hexahedral meshing from volumetric data. Computer Methods in Applied Mechanics and Engineering 195(9-12), 942–960 (2006) 11. Blacker, T.D., Meyers, R.J.: Seams and wedges in Plastering: a 3-D hexahedral mesh generation algorithm. Engineering with computers 9(2), 83–93 (1993) 12. Staten, M.L., Owen, S.J., Blacker, T.D.: Unconstrained paving and plastering: A new idea for all hexahedral mesh generation. In: 14th International Meshing Roundtable (2005) 13. Staten, M.L., Kerr, R.A., Owen, S.J., Blacker, T.D., Stupazzini, M., Shimada, K.: Unconstrained plastering-hexahedral mesh generation via advancing-front geometry decomposition. International Journal for Numerical Methods in Engineering 81(2), 135–171 (2009) 14. Kowalski, N., Ledoux, F., Staten, M.L., Owen, S.J.: Fun sheet matching - automatic generation of block-structured hexahedral mesh using fundamental sheets. In: 10th USNCCM (2009) 15. Roca, X., Sarrate, J.: Local dual contributions: Representing dual surfaces for block meshing. International Journal for Numerical Methods in Engineering 83(6), 709–740 (2010) 16. Meshkat, S., Talmor, D.: Generating a mixed mesh of hexahedra, pentahedra and tetrahedra from an underlying tetrahedral mesh. International Journal for Numerical Methods in Engineering 49(1-2), 17–30 (2000)
Receding Front Method: Applied to Outer Domains
225
17. Owen, S.J., Saigal, S.: H-Morph: an indirect approach to advancing front hex meshing. International Journal for Numerical Methods in Engineering 49(1-2), 289–312 (2000) 18. Sethian, J.A.: Curvature flow and entropy conditions applied to grid generation. J. Comp. Phys (1994) 19. Wang, Y., Guibault, F., Camarero, R.: Eikonal equation-based front propagation for arbitrary complex configurations. International Journal for Numerical Methods in Engineering 73(2), 226–247 (2007) 20. Xia, H., Tucker, P.G.: Finite volume distance field and its application to medial axis transforms. International Journal for Numerical Methods in Engineering 82(1), 114–134 (2009) 21. Xia, H., Tucker, P.G.: Distance solutions for medial axis transform. In: Proceedings of the 18th International Meshing Roundtable, pp. 247–265 (2009) 22. Sethian, J.A.: Level set methods and fast marching methods. Cambridge University Press, Cambridge (1999) 23. Carreras, J.: Refinament conforme per malles de quadril`aters i hex`aedres. Master’s thesis, Facultat de Matem`atiques i Estad´ıstica. Universitat Polit`ecnica de Catalunya (2008) 24. Thompson, J.F.: Handbook of Grid Generation. CRC Press, Boca Raton (1999) 25. Roca, X., Sarrate, J., Ruiz-Giron´es, E.: A graphical modeling and mesh generation environment for simulations based on boundary representation data. In: Congresso de M´etodos Num´ericos em Engenharia (2007)
This page intentionally left blank
EBMesh: An Embedded Boundary Meshing Tool Hong-Jun Kim1 and Timothy J. Tautges2 1
Argonne National Laboratory, Argonne, IL, U.S.A
[email protected],
[email protected]
Summary. This paper describes a method for constructing Cartesian meshes for embedded boundary algorithms by using a ray-tracing technique. In this approach, each mesh cell is distinguished as being inside, outside, or on the boundary of the input geometry, which is determined by firing rays parallel to x/y/z coordinates. The most expensive process of the embedded boundary mesh generation, an edgegeometry intersection test, is performed for the group of edges on a fired ray line together, which decreases the computational complexity of the whole method significantly. Produced boundary cells also have edge-cut fraction information and volume cut fraction information for each material. This work is implemented to be enable to directly import various CAD-based solid model formats and as an opensource code to be used easily in many engineering simulation fields. Keywords: Embedded boundary mesh, cut-cell, ray-tracing.
1 Introduction The Finite Element (FE), Finite Difference (FD), and Finite Volume (FV) methods solve Partial Differential Equations (PDEs) by using different types of discretization for the spatial domain. FE and FV methods are popular because they can resolve complicated geometric domains through the use of body-fitted grids. FD methods are straightforward to implement, and can achieve higher-order approximations of derivatives on structured grids, at the cost of those grids being difficult to generate for complex domains. Another class of simulations, based on the Embedded Boundary method, splits the difference between these by using structured grids on domain interior, and unstructured polyhedral cells or volume fraction approximation for cells intersecting the domain boundary [1] [2] [3] [4]. For this method, the mesh generation challenge is in generating such “Embedded Boundary” grids. Previous methods for generating EB grids rely on computing the intersection of each cell from a structured Cartesian grid with geometric model boundaries. Various approaches are used, depending on the representation of the geometric model boundaries. In the method by Aftosmis et al. [1], surface triangles of componentbased geometries are preprocessed to remove interior triangle pairs and break
228
H.-J. Kim and T.J. Tautges
intersected triangles to smaller ones. Remaining boundary triangles are stored in a special tree structure to reduce the time to compute cell-boundary intersections. Cartesian cells found to intersect this boundary are converted to polygons using intersection points along cell edges. With no optimization, the cost for whole triangle-cell intersection test, which is usually most expensive task, will be approximately ANtN3, where Nt is the number of triangles on the boundary, N is the number of divisions on each side of the entire Cartesian mesh block. Aftosmis et al. uses optimization to reduce this time; Alternating Digital Tree (ADT) [5] gives a list of intersection candidate triangles for each cell in logNt time and the intersection test is performed for the candidate triangles. However, since the tree search is performed for all N3 cells, the approximate scaling behavior of intersection test for the method will be AN3logNt. Colella et al. [2] generate EB meshes by using implicit functions to represent geometric boundaries of a solid. Interior and exterior regions are indicated by negative and positive values of this implicit function φ, respectively; the function value is zero on the boundary. Colella et al. incorporate the definition of this implicit surface into PDE terms that evaluate fluxes over cell surfaces (or over the boundary, for cells intersecting the boundary). Although not explicitly stated, they use recursive subdivision of the Cartesian space to determine which cell is boundary out of N3 cells and the implicit surface evaluations are performed to them. Therefore, it appears that the scaling for the whole intersection test is AN3logN where each search is performed in logN time. In summary, both approaches reviewed here are bounded below by AN3, with the term either logN or logNt. Aftosmis et al.’s implementation is available under license from NASA, but it is not free for non-government use. Colella et al.’s method is available as part of the Chombo package [6]; however, the user is responsible for providing an implicit surface definition based on their definition of the surface boundary. In addition, it appears that neither method is able to handle domains with multiple materials, though this feature may be straightforward to implement with either method. In this paper, we propose a new EB mesh generation method, with contributions in several aspects. First, our algorithm achieves AN2logNt scaling performance of cell-triangle intersection test; this reduces the constant factor from previous results. Second, our method handles multi-volume assembly models without modification, without repeating cell-surface intersections for surfaces shared by multiple volumes. Third, our method supports EB mesh generation not only for faceted or triangle-based surfaces, but also directly from CAD geometries. We demonstrate the robustness of the method using a variety of geometric models from several simulation applications. The remainder of this paper is organized as follows. Section 2 describes our raytracing technique and how it is accelerated to get better performance. Section 3 describes the overall procedures for constructing EB meshes using our ray tracing method. Section 4 shows performance results of the proposed method with several examples. Section 5 concludes this paper and suggests further future research.
EBMesh: An Embedded Boundary Meshing Tool
229
2 Ray-Tracing Using Hierarchical OBB Trees Triangle-based ray tracing is widely used in graphics applications, since most surfaces are visualized as sets of triangular facets. Recently, we have also used triangle-based ray tracing to support Monte Carlo radiation transport [7], where radiation is tracked as individual particles propagating through absorbing media. Our EB meshing procedure is based on the same ray tracing procedure described in Ref. [7]. This procedure is summarized below. The input to our method is a non-manifold geometric model. The model is specified in the form of a Boundary Representation (Brep), as a collection of Vertices, Faces, Edges, and Regions, with topological relations between those entities. Models are accessed through the Common Geometry Module (CGM) [8], which is the same modeling interface used by the CUBIT mesh generation toolkit [9]. We read the facet-based description of the geometric model, including the topological relationships between the original geometric model entities (represented as groups of facets), into the MOAB mesh database [10]. Ray tracing is implemented in the DagMC library provided with MOAB. Since ray tracing accounts for the overwhelming majority of execution time in Monte Carlo radiation transport, a great deal of effort has been made to optimize that computation. This work has been reported in [7], and is summarized below. Construction of recursive space subdivision structure could be used to optimize ray-triangle intersections. However, axis-aligned boxes would have large volumes for any collection of facets not aligned with coordinate axes, increasing the likelihood of rays intersecting those boxes. In contrast, boxes oriented to minimize the extent in at least one box dimension are much less likely to be hit by a given ray, at the cost of having to transform the ray into the oriented box coordinate system. We have found that in practice the savings in ray-box intersections is well worth the cost of ray transformations. The advantage of the oriented bounding box for ray-tracing is amplified when it is combined with hierarchical tree structure, referred to as an OBB tree. An OBB tree is a binary tree of oriented bounding boxes of polygons. OBB trees were originally developed to accelerate collision detection problem in robot motion planning [11]. Tree construction starts from the root bounding box node encompassing a collection of polygons. The set of polygons is divided geometrically into two subsets, and a bounding box is formed for each subset of polygons. The process is repeated until each leaf box encloses a specified number of polygons. Figure 1 shows an example OBB tree. In MOAB's OBBTree representation, the collection of facets for each original geometric surface forms the starting point of the OBBTree subdivision. Once the OBBTree has been formed for the facets from each geometric surface, the root nodes for all surfaces bounding each geometric region are combined, leaving one OBBTree for each Region in the original geometric model. Ray tracing on a Region is performed by firing the ray first at the root box in the tree, first transforming the ray into the coordinate system of that node. If the ray hits a given node, the procedure is repeated down the tree, transforming the ray in the process. If any leaf nodes are intersected, the ray is tested against all
230
H.-J. Kim and T.J. Tautges
Fig. 1. OBB tree construction
triangles in that node. Valid ray-triangle intersections are returned in order of increasing distance from the ray starting point.
3 Embedded Boundary Mesh by Ray-Tracing Given a facet-based geometric model, and the ability to compute ray-tracing on that model, it is straightforward to construct an EB mesh generation algorithm. This algorithm consists of the following steps: • Initialize the geometric model and hierarchical OBBTree for ray-tracing • Find the Cartesian box that surrounds all Regions of the model, and its subdivisions in cells • Use ray-tracing along cell edges to find cell intersections with geometric boundaries • Store the EB mesh on Cartesian cells These steps are described in the following sub-sections. 3.1 Initializing Geometric Model and Hierarchical OBBTree Geometric models are imported by using the Common Geometry Module (CGM) [8]. CGM provides a common interface for interacting with models stored in a variety of underlying solid modeling engines, including ACIS [12] and OpenCASCADE [13]. Both these engines support import and cleanup of IGES and STEP model exchange formats. CGM provides facet-based representations for each Edge and Face in the geometric model, and functions for evaluating overall model topology. The MOAB mesh library [10] uses a data model consisting of mesh entities (vertices, triangles, etc.), entity sets (arbitrary collections of entities and other sets), the databased instance, and tags (a named datum assigned to the previous
EBMesh: An Embedded Boundary Meshing Tool
231
three data types). Entity sets can have parent/child relations with other entity sets; these are distinct from the “contains” relations described earlier. We import the facet-based geometric model from CGM into MOAB, representing each geometric entity using an entity set, and topological relations between geometric entities using parent/child relations between the corresponding entity sets. This representation provides the basis for ray-tracing on the facet-based model. A hierarchical OBB tree is constructed on the facet-based model in MOAB, with one tree for each geometric Region set. For simplicity, a single tree node is inserted at the top, and linked to the root node for all Regions. The OBB tree provides ray-tracing functions and the coordinates of a box surrounding the entire OBB tree. 3.2 Building a Cartesian Mesh After constructing the OBB tree, the coordinates of the top-level box indicate the geometric extents of the model. These coordinates are used to create a Cartesian mesh encompassing the whole model. The number of divisions of that mesh in each coordinate direction is computed by using the number of facets and the box size, or from user input 1 . The Cartesian mesh is stored in MOAB’s structured mesh representation [10]; this representation requires only about 24MB per million elements in the box, based on double-precision storage of vertex coordinates. 3.3 Firing Rays In order to find intersections between cells and the model Faces, rays are fired along edges of the cells. Since we use an axis-aligned Cartesian mesh, edges in a column of cells line up into straight lines. A ray trace is performed along each of these lines, with the starting position of the ray at the surface of the Cartesian mesh; intersections with the model are returned as distances along that line and surfaces in the model that are intersected. Since we use equal spacing of elements in the Cartesian grid, these distances can be converted to fractional distances along edges in the grid. The surfaces intersected are used to assign the model Regions to sections of edges between intersections, starting with a designation of “outside”, since the ray begins on the boundary of the Cartesian mesh outside any model Regions. Rays are traced in the three coordinate directions, at each interior node on the corresponding coordinate plane. This process results in ray traces along all interior edges of cells in the mesh. If the number of divisions on each side of the box is N, then only a total of 3(N-1)2 ray tracing operations is performed, each operation returning all Face intersections along the ray (Fig. 2). The second figure in Fig 2 shows ray-tracing covers N edge intersection test with a ray.
1
Scaling numbers discussed in this paper assume a single number of divisions on all sides for simplicity only.
232
H.-J. Kim and T.J. Tautges
Fig. 2. Rays fired in three directions along cell edges, A ray covers N edges
If the intersection test is performed edge (cell) by edge (cell) like in other methods, abundant tree searching has to be performed to the non-boundary edges as in Fig 3. The search in the Fig 3 is not stopped until SS (Spatial Search) 4 block dose not have any facet triangles inside and conform that the edge is not on the boundary.
Fig. 3. Spatial search is performed for non-boundary edge
Ray-firing function of our implementation returns intersected triangles and distances from ray starting point. Since OBB tree is constructed for geometry surfaces, it also returns which surface is hit. With these information and previous edge status, each edge and element is easily determined if it is inside, outside or boundary to geometry and edge cut fraction information can be obtained for boundary elements. To avoid cell by cell job such as setting all element status, element status default value is set and only the elements near intersections are considered to the status determination and have real values. In rare cases, ray tracing fails to find correct intersections with surfaces that they should. This failure is due to the use of non-watertight faceting returned by CGM and precision issues detecting ray-triangle intersections. Modifying the faceting of a non-watertight geometric model is outside the scope of this paper, but is reported elsewhere [14] [15]. If the precision issues are detected such that
EBMesh: An Embedded Boundary Meshing Tool
233
ray intersect triangle edges or vertices, the ray is displaced slightly and the ray trace is repeated. This strategy fixes all examples we have seen of this problem. The intersection along this modified ray is moved to the original edge at the appropriate position, with that offset very small relative to the cell edge length. 3.4 Storing Information MOAB allows applications to assign tag values to the entities in a mesh. Tags are uniquely identified by a name, and are referenced by a tag handle for efficiency. MOAB provides tags of three storage types: “sparse” tags, stored in (entity handle, tag value) tuples; “dense” tags, stored as an array of tag values for contiguous sequences of entity handles; and “bit” tags, in which each tag value is a user-defined number of bits. Dense tags are more memory-efficient when assigning a tag to many entities in a mesh. Tags of all three storage types can be created with default values; for cases where the majority of entities will be assigned the same value for a given tag (e.g. all cells on the interior of a solid), a default value eliminates the storage for this value on those entities. The EB mesh generation method described here stores two types of information. First, each cell in the Cartesian mesh is marked as inside (0), outside (1), or boundary (2), using the 2-bit tag ELEM_STATUS_TAG. Second, for cells marked as boundary, the position of intersection along each edge of the cell must be marked. Although each cell is bounded by 12 edges, only three edges for each cell must be marked, corresponding to the left, bottom, and front edges; the other edges are marked by neighboring cells. Edge fractions are measured from the left, front and bottom corner of boundary cell to x/y/z directions as in Fig. 4. If a ray hits the boundary from inside to outside, the fraction value is stored with a negative sign. In contrast, for the case of a ray intersection from outside to
Fig. 4. An example of edge cut fraction tag information on boundary cell
234
H.-J. Kim and T.J. Tautges
inside, the value is marked as positive. Since multiple intersections can exist in each direction, the EDGE_CUT_FRAC_LENGTH_TAG is created to store the numbers of edge fraction values on the x, y, and z edges connected to the bottom/left/front corner of each cell. The EDGE_CUT_FRAC_TAG stores an arbitrary number of double precision values, listing all the intersection points along the x, then y, then z edges of a cell. Edges that are completely outside (inside) the Region are designated with zero (one) for edge intersection fractions. All tags except ELEM_STATUS_TAG are sparse tags, whose default values are chosen to indicate an interior cell. This tag is assigned explicitly to boundary and exterior cells. This approach saves substantial amounts of memory when there is a majority of interior cells, which is usually the case (since the Cartesian box is chosen to fit the geometric model tightly). 3.5 Calculating the Volume Fraction Multiple material compositions are required in each mesh cell for many simulation analyses, such as deterministic radiation transport. As an approximation to volume fractions within a cell, we use a method similar to that of Riper [16] [17], where ray tracing is performed on a subdivision grid over the cell. The volume fraction for a given Region intersected by the cell is equal to the total ray traversal length in that Region, summed over all rays fired over the subdivided cell, normalized by the total ray traversal length over the cell. The volume fraction calculation is performed by firing sub-rays to 3 directions parallel to x/y/z coordinates in boundary cell. All ray lengths inside each material geometry are summed and divided by all fired ray length sum as in equation (1) [17].
FM = ( Mj) / (DJ) FM : fraction of material M in a cell LMj : ray path length in material M for ray j J : total number of rays D : sum of all ray lengths (1) The number of divisions in the subdivision of each boundary cell is equal in our implementation and is assigned by the user. To store these information for boundary cells, MAT_FRAC_ID_TAG and VOL_FRAC_TAG are created as sparse tags for each material. Each tag has an arbitrary number of material ids and volume fractions. 3.6 Export Meshes or Query Function as Library The Cartesian grid, edge intersection data, and (optionally) volume fractions stored on that grid, can be exported from MOAB in a variety of formats. Alternatively, the data can be queried directly from MOAB by using existing functions for accessing mesh and tag information. In addition, in order to avoid the overhead of interacting through files, the EB meshing method can be linked as a library directly to applications. Along with
EBMesh: An Embedded Boundary Meshing Tool
235
functions for specifying the Cartesian box divisions and for requesting the generation of the EB mesh, there are several query functions for retrieving cell inside/outside status, edge-cut fractions and volume fractions of boundary cells. Currently, these functions are planned to be used for electromagnetic analysis [18] and radiation transport simulation [19]. The API specification for these functions appears in the Appendix of this paper.
4 Results The algorithm described in Section 3 has been tested on several example models of varying complexity. Performance data is measured by using a Linux workstation with Xeon 3GHz CPU and 16GB of memory.
Fig. 5. Example model and Cartesian meshes created from many primitives
An example model used to test the method for a model of moderate complexity was created by combining many primitive geometries as in Fig. 5. Cartesian mesh elements, distinguished as different colors by attached element status tags, are also shown in the Fig. 5.
Fig. 6. Timing and memory usage results for multi-primitive model
236
H.-J. Kim and T.J. Tautges
Cartesian meshes were produced with different mesh sizes; their computation times and maximum memory usages are plotted in Fig. 6. Mesh generation took 4.64 seconds including geometry importing time to produce 10.5 million elements with a maximum memory of 432 MB. The next examples are standard STL format files produced by 3D scanning, which have complex boundary representations as in Fig. 7 [20].
Fig. 7. STL 3D “statue” and “horse” models [20]
EBMesh: An Embedded Boundary Meshing Tool
237
Figure 8. shows their Cartesian meshes produced by EBMesh.
Fig. 8. Cartesian mesh elements of 3D STL models
Some performance results are also plotted with different mesh sizes in Fig. 9. It takes 6 seconds to produce 11.8 million elements with a maximum memory of 480 MB for the first statue model and 2.3 seconds for 8.8 million elements with a maximum memory of 360 MB for the second horse model.
238
H.-J. Kim and T.J. Tautges
Fig. 9. Timing and memory usage results for “statue” and “horse” STL models
The last example is an accelerator cavity model for the International Linear Collider (ILC), used to optimize electromagnetic performance of the cavities by adjustment of geometric design parameters [21]. In Fig. 10, the model geometries are shown, including the complex higher-order mode (HOM) coupler region.
Fig. 10. Accelerator cavity models
EBMesh: An Embedded Boundary Meshing Tool
239
Their meshed results are shown with different element status in Fig. 11.
Fig. 11. Cavity model mesh results
In Fig. 12, timing results and maximum memory usages are plotted with different mesh sizes. Mesh generation time is 68.8 seconds for this model, including geometry loading time for 10.7 million elements with a maximum memory of 582 MB. Since the cavity model is very complex, the time for importing, faceting and tree construction takes large portions of the overall computation time.
Fig. 12. Timing and memory usage results for ILC-coupler cavity model
The complexity of our algorithm is estimated to be scaled by N2, as discussed in Section 3. That is, total computation time can be expressed as T = A1N2logNt + A2Nt + A3. The first term corresponds to the EB meshing time. The second term is for triangle faceting and tree construction, and depends mostly on geometric model complexity. The third term is for some constant-time jobs involved. When the same input geometry is used for timing, the second and third terms are
240
H.-J. Kim and T.J. Tautges
constant, with the remaining time proportional to N2. Therefore, a log-log plot of N and meshing time TM is expected to have slope 2. In Fig. 12, the meshing time for the ILC-coupler model is plotted when N is increased; it has a slope of approximately 2, as expected.
Fig. 13. Log-log plot of N and meshing time has a slope of 2
5 Conclusions and Future Work We have presented an embedded boundary Cartesian mesh generation algorithm that produces better performance than traditional EB approaches for complex geometries. It reduces mesh computation time as much as of 1/N compared with the cell-by-cell method by checking intersections edge line by line. As a result, all mesh elements are distinguished as being inside, outside, or on the boundary of the geometry model. Boundary cells also have edge-cut information stored as a tag. Optionally, volume fraction information about each material for boundary cells can be calculated. The mesh and related information can be written to a variety of mesh file formats or used directly by an analysis program. This work is implemented as an open-source code in Ref [22]. We envisioned several avenues of future work. For example, it may be useful to perform adaptive mesh refinement in the region of rapidly changing curvature geometry. The current volume fraction calculation function is similar enough to the refinement that we can approach it as a start. With curvature information directly obtained from geometry, we will produce better refinement meshes. Another future activity is generating a hex-dominant mesh by making polyhedral meshes instead of boundary hexes. Combined with OBB, which makes meshes oriented to natural geometry direction, it may produce good-quality meshes independent of geometry transformation. Lastly, parallel implementation of EBMesh and actual CAD surface intersection test will be considered for faster and more accurate results.
EBMesh: An Embedded Boundary Meshing Tool
241
Acknowledgements This work was supported by the US Department of Energy’s Scientific Discovery through Advanced Computing program under Contract DE-AC02-06CH11357.
References 1. Aftosmis, M.J., Berger, M.J., Melton, J.E.: Robust and efficient Cartesian mesh generation for component-based geometry. AIAA Journal 36(6), 952–960 (1998) 2. Colella, P., Graves, D., Ligocki, T., Trebotich, D., Straalen, B.V.: Embedded boundary algorithms and software for partial differential equations, SciDAC 2008. Journal of Physics, Conference Series 125 (2008) 3. Nieter, C., Cary, J.R., Werner, G.R., Smithe, D.N., Stolz, P.H.: Application of DeyMittra conformal boundary algorithm to 3D electromagnetic modeling. Journal of Computational Physics 228(21), 7902–7916 (2009) 4. Pattinson, J.: A cut-cell, agglomerated-multigrid accelerated, Car-tesian mesh method for compressible and incompressible flow, Ph.D. thesis, University of Pretoria (2006) 5. Bonet, J., Peraire, J.: An Alternating Digital Tree (ADT) Algorithm for Geometric Searching and Intersection Problems. Int. Journal of Numerical Method and Engineering 31, 1–17 (1991) 6. Colella, P., et al.: Chombo Software Package for AMR Applications Design Document, Applied Numerical Algorithm Group. Lawrence Berkeley National Laboratory, Berkeley (April 2009) 7. Tautges, T.J., Wilson, P.P.H., Kraftcheck, J.A., Simth, B.M., Henderson, D.L.: Acceleration Techniques for Direct Use of CAD-Based Geometries in Monte Carlo Radiation Transport. In: Proceedings of International Conference on Mathematics, Computational Methods & Reactor Physics, NY, May 3-7, Saratoga Springs (2009) 8. Tautges, T.J.: CGM: A geometry interface for mesh generation, analysis and other applications. Engineering with Computers 17, 486–490 (2005) 9. Sjaardema, G.D., Tautges, T.J., Wilson, T.J., Owen, S.J., Blacker, T.D., Bohnhoff, W.J., Edwards, T.L., Hipp, J.R., Lober, R.R., Mitchell, S.A.: CUBIT mesh generation environment. Users manual, vol. 1. Sandia National Laboratories (May 1994) 10. Tautges, T.J., Meyers, R., Merkley, K., Stimpson, C., Ernst, C.: MOAB: A MeshOriented Database, Sandia National Laboratories (2004) 11. Gottschalk, S., Lin, M.C., Manocah, D.: OBBTree: a hierarchical structure of rapid interference detection. In: Proceedings of the 23rd annual conference on Computer graphics and interactive techniques, pp. 171–180 (1996) 12. ACIS 3D Modeling, Spatial Technology Inc. (2010), http://www.spatial.com/products/3d-acis-modeling 13. OpenCASCADE Technology (2000-2010), http://www.opencascade.org/ 14. He, X.J., Chen, Y.H.: A Haptics-guided Hole-filling System Based on Triangular Mesh. Computer-Aided Design & Applications 3(6), 711–718 (2006) 15. Boonma, A.: Haptic-Based Sharp Edge Retaining and Gap Bridging Algorithms for Computer Aided Design (CAD) and Reverse Enineering (RE), Master Thesis, North Carolina State University (2006)
242
H.-J. Kim and T.J. Tautges
16. Riper, K.A.V.: Mesh and Volume Fraction Capabilities in Moritz, KAV. In: Workshop on Common Tools and Interfaces for Deterministic Radiation Transport, for Monte Carlo, and Hybrid Codes (3D-TRANS-2003), France, pp. 25–26. Issyles Moulineaux (September 2003) 17. Riper, K.A.V.: Moritz Geometry Tool (2006), http://www.whiterockscience.com/moritz.html 18. Stoltz, P., Veitzer, S., Niether, C., Messmer, P., Amys, K., Cary, J., Lebrun, P., Amundson, J., Spentzouris, P., Kim, H.J., Tautges, T.J. (2010) Recent Progress in Accelerator Physics Simulations with the VORPAL code. In: Sci-DAC (2010) (in preparation) 19. Smith, B., Wilson, P.P.H., Sawan, M.E.: Three dimensional neutronics analysis of the ITER first wall/shield module 13. In: 22nd IEEE/NPSS Symposium on Fusion EngineeringSOFE 2007, Institute of Electrical and Electronics Engineers Inc., Piscataway (2007) 20. STL files, Jelsoft Enterprises Ltd. (2000-2010), http://forum.carvewright.com/showthread.php?t=12452&page=2 21. Ko, K., et al.: Impact of SciDAC on Office of Science Accelerators through Electromagnetic Modeling. In: SciDAC 2005 (June 2005) 22. EBMesh Tool, http://trac.mcs.anl.gov/projects/fathom/wiki/EBMesh
Appendix A Presented here is the API specification for the query functions. • bool get_grid_and_edges ( @return double boxMin[3] : entire grid box minimum @ return double boxMax[3] : entire grid box x maximum @ return int nDiv[3] : number of divisions @ return vector
cutCellIndices: boundary cell index vector @ return vector cutFracLength : number of edge cut fractions for boundary cells @ return vector<double> cutFraction : edge cut fraction vector ); • bool get_volume_fractions ( @ return vector materialID : material id vector @ return vector boundaryCell : boundary cell vector @ return vector<double> volumeFrac : volume fraction double vector ); The submitted manuscript has been created by UChicago Argonne, LLC, Operator of Argonne National Laboratory ("Argonne"). Argonne, a U.S. Department of Energy Office of Science laboratory, is operated under Contract No. DE-AC0206CH11357. The U.S. Government retains for itself, and others acting on its behalf, a paid-up nonexclusive, irrevocable worldwide license in said article to reproduce, prepare derivative works, distribute copies to the public, and perform publicly and display publicly, by or on behalf of the Government.
Sharp Feature Preservation in Octree-Based Hexahedral Mesh Generation for CAD Assembly Models Jin Qian and Yongjie Zhang Department of Mechanical Engineering, Carnegie Mellon University, Pittsburgh, PA 15213, USA Tel.: (412) 268-5332; Fax: (412) 268-3348 [email protected]
Abstract. This paper describes an automatic and robust approach to convert 3D CAD assembly models into unstructured hexahedral meshes that are conformal to the given B-Reps (boundary-representations) with sharp feature preservation. In previous works, we developed an octree-based isocontouring method to construct unstructured hexahedral meshes for manifold and non-manifold domains. However, sharp feature preservation still remains a challenge. In the current algorithm, boundary features such as sharp curves and NURBS (non-uniform rational B-Splines) surface patches are first extracted from the given B-Reps. An octree-based isocontouring algorithm is then carried out to create unstructured hexahedral meshes, detecting and preserving all the sharp features. After this stage, a two-step pillowing technique is adopted to eliminate triangle-shaped quadrilateral elements along the sharp curves and “doublets”. To further improve the mesh quality, a combination of smoothing and optimization is used. The developed algorithm is robust, and it works for single-component manifold domain, as well as multiple component non-manifold domains. We have applied our algorithm to several complicated CAD models and assemblies. Valid meshes are generated and quality statistics are given. Keywords: Hexahedral Mesh, Sharp Feature, Pillowing, Quality Improvement, CAD Assembly, Manifold and Non-Manifold Domain.
1 Introduction Mesh generation for arbitrary 3D CAD models has played an important role in engineering numerical simulations. These complicated 3D domains like
Corresponding author.
244
J. Qian and Y. Zhang
Fig. 1. The resulting hex mesh of a four-component gear assembly. (a) The assembly; (b-c) Zoom-in details of two corners; and (d-f) Three single components.
single-component CAD models or multiple-component assemblies (Fig. 1) need to be discretized into simple tetrahedra or hexahedra , while hexahedral (hex) meshes are more preferred. The 3D CAD models contain sharp features consisting of sharp curves and surface patches. Extracted from BReps (boundary-representations), these features need to be incorporated into hex mesh generation so that the meshes conform to the given CAD model. Traditional methods such as sweeping [4], plastering [18] and whisker weaving [2] attain some success, while fully automatic unstructured hex mesh generation with sharp feature preservation still remains a challenging problem. Among the recent advances, some grid methods prove to be robust and effective. The octree-based isocontouring method analyzes each interior grid, and generates a dual mesh of the grids [21, 22, 23]; The feature embedding method finds an embedding of the geometric topology into a base mesh and then maps the base mesh to the given geometry [9, 16, 6]. While these methods provide important insights in single-component domain meshing, mesh generation for domains with multiple components is still a challenge. In this paper, we develop an automatic and robust method to generate conformal hex meshes with sharp feature preservation for single-component models, as well as multiple-component assemblies. The CAD model is first
Sharp Feature Preservation of CAD Assemblies
245
discretized into a triangle mesh, and then a binary grid data is calculated by distinguishing interior and exterior regions. For domains with multiple components, instead of using a binary data we attach a component index to each grid point. From this data, we use an octree-based isocontouring algorithm to construct all-hex meshes [21, 22, 23]. Based on the generated mesh, sharp features are detected and preserved. Critical points are identified first, considering the curve topology in the given B-Reps. Starting from one ending of each sharp curve, we track the complete path of the curve until the other ending is reached. Then we analyze each boundary quadrilateral (quad) element and decide which NURBS surface patch it belongs to. Having already detected all the boundary features, we classify all the vertices into four groups: critical points, curve vertices, surface vertices and interior vertices, and relocate them to appropriate positions via smoothing. The smoothing process is combined with a feature parametrization so that the features are preserved during vertex relocation. Then the mesh conforms to the B-Reps, however, there are triangle-shaped quads along the sharp curves and “doublets”. To eliminate them, a two-step pillowing technique is developed. Since the mesh still contains a few elements with bad aspect ratios, a modified Laplace smoothing and Jacobian optimization are used to further improve the mesh quality. We have applied our algorithms to several complicated CAD models including two manifold domains with one single component and two non-manifold assemblies with multiple components. The generated meshes are all valid, and the mesh quality statistics are given. The remainder of this paper is organized as follows: Section 2 summarizes related previous work. Section 3 describes the overview of our algorithms. Section 4 talks about sharp feature detection and preservation. Section 5 explains the detailed pillowing algorithm. Section 6 talks about quality improvement based on the constructed mesh. Section 7 presents the results and discussion. Finally, Section 8 draws conclusions and outlines future work.
2 Previous Work Unstructured Hex Mesh Generation: Generally there are two kinds of unstructured all-hex meshing methods: indirect and direct [8]. The indirect methods generate a tetrahedral (tet) mesh first and then convert it into a hex mesh. Compared to indirect methods, the direct method generates hex elements directly. It includes five distinct methods: grid-based, medial axis, plastering, whisker weaving and iso-surface extraction. The grid-based method generates a fitted 3D grid of hexes in the volume, and then adds hex elements at the boundaries to fill gaps [13, 14, 15]. The medial axis algorithms decompose the volume into simpler primitives that can be meshed using a structured algorithm [10, 11]. The plastering algorithm starts with a quad boundary mesh and places hexes onto the quads using the advancing front methods [1, 18]. The whisker weaving method first constructs the dual of a hex mesh then fits the hex elements into the volume [20]. The isosurface
246
J. Qian and Y. Zhang
extraction method extracts the boundary surface and constructs uniform and adaptive hex meshes from volumetric imaging data [22, 21]. Furthermore, this method has been extended to meshing domains with multiple materials [23, 12]. Pillowing: Pillowing is a sheet insertion method that refines the mesh boundary. This method eliminates the situations where two neighboring hexes share two faces, called a “doublet” [7]. The doublet needs to be eliminated because the dihedral angle between these two faces are usually large and it becomes impossible to obtain all positive Jacobians. The pillowing method inserts a new layer of elements over the selected region called “shrink set”, and splits the doublet hexahedron into several. It looks as if the selected quads are inflated to become a new hex. This method is not only useful in removing doublets but also proves to be one powerful tool to insert element layers in existing meshes [16, 17, 19]. Incorporating Sharp Features: The plastering [1], whisker weaving [20, 2] and unconstrained plastering [18] algorithms begin with a well-defined boundary and then progressively propagate inside. Advancing front algorithms are implemented to fill the interior void. Differently, the grid-overlay and octree methods begin with a base mesh and then embed the geometric features into the base mesh. After building the base mesh, vertices are mapped to their appropriate positions according to boundary features. In the octree methods the geometric features are captured using a template-based refinement [14, 3, 21]. The octree-based isocontouring method detects and preserves features during mesh generation, which is especially suitable in meshing volumetric datasets [21, 22, 23]. These methods are effective mostly for biological models where sharp features are not dominant. For models involving critical sharp features, features can be embedded into a non-conforming base mesh and then be preserved through feature embedding [16, 9, 6]. The above mesh generation and feature preservation methods were mainly designed for manifold single-component domains. In this paper, we will talk about an automatic and robust approach for hex mesh generation with sharp feature preservation for both single-component CAD models and multiplecomponent assemblies.
3 Overview Fig. 2 shows the pipeline of our hex mesh generation algorithm with sharp feature preservation. First we extract NURBS curves and surfaces from the given CAD model, and triangulate the model using NURBS sampling. Then a binary grid data is created to distinguish the interior and exterior regions for each component. For domains with multiple components, the binary sign for each grid point is replaced by a component index. Based on the constructed grid data, we use an octree-based method to construct hex meshes
Sharp Feature Preservation of CAD Assemblies
247
[21, 22, 23]. One minimizer point is calculated for each' cell to minimize a predefined Quadratic Error Function (QEF): QEF (x) = (ni · (x − pi ))2 , where pi and ni are the position and normal vectors at the intersection points. We analyze each interior grid point for all-hex mesh generation. In this octree data structure, each grid point is shared by eight cells, and we use the calculated eight minimizers to construct a hexahedron. Sharp curves and surface patches are detected and mesh vertices are classified into four groups: critical points, curve vertices, surface vertices and interior vertices. If the domain consists of multiple components, the common curves and patches shared by multiple components need to be identified as well. Then we relocate each group of vertices to appropriate positions while preserving all the sharp features. Due to the triangle-shaped boundary quads along the sharp curves and “doublet” elements, each surface patch is pillowed individually first, and then the whole boundary is pillowed. Till now the mesh still has some elements with bad aspect ratios, therefore a modified Laplace smoothing and Jacobian optimization are used to make the final mesh valid. In the following, we will talk about sharp feature detection and preservation, a two-step pillowing technique, as well as quality improvement in detail.
Fig. 2. Meshing pipeline. The modules in orange are critical steps involving sharp feature detection and preservation.
248
J. Qian and Y. Zhang
4 Sharp Feature Detection and Preservation Starting from the constructed binary data, we first use the octree-based isocontouring method to generate a base mesh, and then detect sharp features and embed them into the base mesh. Two kinds of features are preserved: sharp curves and surface patches. For multiple-component assemblies, the boundary features may be shared by two or more components. To preserve features, we find the appropriate position of each boundary vertex according to the given B-Reps. 4.1
Sharp Curve Detection
We begin from detecting the endings of each curve and then track the mesh edges to locate the complete curve trajectory. If the two endings of one single curve happen to be the same vertex, this is a closed curve, like a circle. Starting from one ending of the curve, we track its neighboring boundary edges to find the next curve point. To decide which vertex should be chosen, two criteria are considered: how small the distance from the vertex to the curve and how far the vertex “advances” along the curve. Generally the vertex closest to the curve is chosen as the next curve point. However, with a similar distance, the vertex having a greater “advance” is selected. In Fig.3, V0 is one ending point of the red curve, V1 has the minimum distance from the curve, but V2 has greater “advance” along the curve. In this case, V2 is selected as the next curve point. We keep tracking the boundary edges until the other ending point is reached, and these continuous edges form a complete mesh curve. To preserve the correct curve topology, we restrict any two curves can not share any edge segments. There are two special cases violating this restriction. We can change either the non-manifold point or the curve paths to overcome this problem. When three curves share one ending point in the B-Reps topology, it is possible to form the red curves in the constructed hex mesh as shown in Fig. 4(a). Here V0 is the detected non-manifold point, Curve 1 contains V0 − V1 − V2 , Curve 2 contains V0 − V1 − V3 , and Curve 3 contains V0 − V4 . Curve 1 and Curve 2 share one edge V0 − V1 . To preserve the correct topology, V1 is set as the new non-manifold point. Now Curve 1 becomes V1 − V2 , Curve 2 becomes V1 − V3 , and Curve 3 becomes V1 − V0 − V4 , as
Fig. 3. V2 is chosen as the next curve vertex due to its greater advance along the curve. The distances from V1 , V2 to the curve are similar.
Sharp Feature Preservation of CAD Assemblies
(a)
(b)
(c)
249
(d)
Fig. 4. Correct curve topology preservation. Red lines are curve segments, and red dots are non-manifold points. Different colors represent various surface patches.
shown in Fig. 4(b). When four or more curves share one ending point, we may have another special case as shown in Fig. 4(c). Here V0 is the detected nonmanifold point, Curve 1 contains V0 − V1 − V2 , Curve 2 contains V0 − V1 − V3 , Curve 3 contains V0 − V4 , and Curve 4 contains V0 − V5 . Curve 1 and Curve 2 share the common edge V0 − V1 . In this situation, we can not choose V1 as the non-manifold point as what we did for the first special case, because if we do that Curve 3 and Curve 4 will share the edge V0 − V1 . Therefore, we still choose V0 as the non-manifold point, but we change the path of Curve 2. In this way as shown in Fig. 4(d), Curve 2 becomes V0 − V6 − V3 , while Curves 1, 3 and 4 stay the same. After handling these two special cases, the complete path of each sharp curve is identified with the correct topology. 4.2
Surface Patch Detection
In addition to sharp curves, we need to preserve NURBS surface patches as well. Similarly, we need to find out the set of quads corresponding to each NURBS patch. To obtain these sets, we check each boundary quad to see which patch it belongs to. The four vertices of each quad are compared with the triangle mesh generated from the NURBS patch. In order to save the computation time, we set a small visual box around the targeting quad, and only check the quad vertices in that box. We check which triangle the vertex is closest to, and then decide which patch it belongs to. Note that vertices on sharp curves are shared by multiple patches and thus should not be counted. If all the vertices (except the ones on the curve) of one quad belong to one patch, then this quad belongs to that patch. When the four vertices of one quad all lie on sharp curves, we use the quad geometric center to decide which surface patch it belongs to. Following these guidelines we can find the set of quads belonging to each surface patch. These sets can also be identified using a propagation algorithm. From the B-Reps we know all the curves surrounding each patch. Beginning from the quads along these curve vertices we propagate to other elements until the whole set of quads are found. Sometimes the surface patches need to be modified. For example in Fig. 5, the assembly consists of two components: an inner cylinder and an outer ring.
250
J. Qian and Y. Zhang
(a)
(b)
(c)
(d)
Fig. 5. One CAD assembly with an inner cylinder and an outer ring. (a) The two-component assembly; (b) The inner cylinder; (c) The outer ring; and (d) The modified cylinder patch. The pink surface in (b) is divided into three.
The cylinder has a big pink patch. However, the shared surface is only part of it. Therefore the pink surface patch needs to be split into three smaller ones (green, pink and blue) to match the two components. 4.3
Sharp Feature Parametrization and Preservation
Having detected all the vertices on sharp curves and surface patches, we classify them into four categories: critical points, curve vertices, surface vertices and interior vertices. In order to preserve all the sharp features, we relocate each vertex to its appropriate location via smoothing. Critical points are fixed. Curve and surface vertices are smoothed and projected to the given NURBS curves and surface patches. Finally, the interior vertices are smoothed to their volume center via a weighted-averaging method. The critical points are defined as the points where multiple curves meet. Note that open curves are always split if they meet with other curves in the middle, while close curves are not. Therefore all the ending points of open curves are critical points. Following this rule the critical points can be among the following three situations: the shared ending of two open curves (Fig. 6(a)), the intersection of one open curve and one closed curve (Fig. 6(b)), or the joint point of three or more curves (Fig. 6(c)). All critical points are fixed during smoothing. For other curve vertices, they are “interior” in the curve compared to the critical points. During smoothing, we need to calculate a new position for
(a)
(b)
(c)
Fig. 6. Critical points (the red points). (a) The shared ending point of two open curves; (b) The intersection of one open curve and one closed curve; and (c) The joint point of three curves.
Sharp Feature Preservation of CAD Assemblies
251
each curve vertex. Here, we first find its two neighboring vertices on the curve, calculate their middle point, and then project the middle point to the curve via a NURBS curve parametrization. The NURBS curve in the given B-Reps is represented as: n
C(u) =
ωi Pi Ni,d (u)
i=0 n
,
(1)
ωi Ni,d (u)
i=0
where Pi are the control points, ωi are the weights, Ni,d (u) are B-spline basis functions of degree d, and u is the parameter ranging from 0 and 1. In order to find the projection of one curve vertex on the NURBS curve, we need to first find its parameter u on the NURBS curve, and then compute its exact position according to Equation (1). The NURBS curve is first discretized into a series of line segments using equally-spaced parameters u, and then we find the segment closest to the targeting curve vertex. Based on the u values of the two ending points of that segment, we compute the parameter u value for the targeting vertex using a linear interpolation. Then Equation (1) is used to compute its exact position. Finally the curve vertex is moved toward this position iteratively during smoothing. The new position for one surface vertex is calculated as follows: we find the area center of its neighboring boundary quads, and project the area center to the detected NURBS surface patch via a NURBS surface parametrization. The NURBS patch can be represented as: n m
S(u, v) =
ωij Pij Ni,d (u)Nj,d (v)
i=0 j=0 n m
,
(2)
ωij Ni,d (u)Nj,d (v)
i=0 j=0
where Pij are the control points, ωij are the weights, and Ni,d (u), Nj,d (v) are B-spline basis functions of degree d, and (u, v) are the parameters ranging from 0 to 1. To find the projection of one mesh vertex on the NURBS patch, we discretize the NURBS patch into triangles, compute the vertex parameter values (u, v) using a barycentric interpolation, and obtain the exact position using Equation (2). In concave corners, the smoothing algorithm may produce bad aspect ratios. As shown in Fig. 7(a), the quads tend to have large angles, therefore we project them to the corner angular bisector like Fig. 7(b). In addition, some other vertices tend to be very close to the concave corners, see Fig. 7(c), therefore we move them away from the concave corner as in Fig. 7(d). After smoothing and feature parametrization, the mesh is smoothed and all the sharp features are preserved. Fig. 8 shows one example.
252
J. Qian and Y. Zhang
(a)
(b)
(c)
(d)
Fig. 7. Mesh correction near concave corners. (a-b) Nearby quads have large angles, therefore some vertices are projected to the corner angular bisector; and (c-d) Nearby vertices are very close to the corner, therefore they are moved to the middle points of the corner and themselves.
(a)
(b)
Fig. 8. One sharp curve before (a) and after (b) NURBS curve tracking, smoothing and projection for hook2 model. The boundary surface is also smoothed and projected to the given NURBS surface patches.
5 Pillowing to Create Boundary Layers After sharp feature preservation, the constructed hex mesh conforms to the given CAD model. However, some boundary quads may have two edges lying on the same curve, which leads to triangle-shaped quads along the curves. In addition, some hex elements may have two or three faces lying on the same surface patch, which leads to big dihedral angels. These two situations decrease the mesh quality and make it impossible to obtain all positive Jacobians via smoothing and optimization. On the contrary, the desired meshes should have two attributes [16, 23]: each hex element has at most one quad on the boundary, and each boundary quad has at most one edge on the sharp curves. To make the mesh fundamental, we use a two-step pillowing technique
Sharp Feature Preservation of CAD Assemblies
253
to improve the mesh: (1) pillow each individual surface patch, and (2) pillow the overall boundary surface. 5.1
Manifold Domain with Single Component
For single-component domains, the first pillowing step eliminates the triangleshaped boundary quads along sharp curves. As shown in Fig. 9(a-c), the shrink set is defined as the set of quads corresponding to each surface patch. These sets of quads are already identified in the previous steps. Then we duplicate the nodes of each quad belonging to the shrink set, and connect them to the original nodes to form a new layer of hexes. In this procedure, these quads seem to be inflated to form new hex elements. Finally we project these new vertices to the original surface patch. In this case, the original mesh boundary remains unchanged, however, the inserted hex layer now becomes “flat”. This creates elements with multiple faces on the same boundary patch, therefore another layer insertion is necessary. The second pillowing step eliminates the hex elements with multiple quads on the same surface patch. We choose the whole boundary as the shrink set, and then duplicate all the boundary vertices at the original positions. Finally we connect the new vertices to the original ones. Since we keep the new vertices at the original positions while move the old vertices inside, the original mesh boundaries are kept. The effect of these two layer insertions are shown in Fig. 9(d-f). The yellow elements are the original ones, the blue ones are the first pillowed layer and the pink ones are the second pillowed layer. From Fig. 9(f), we can observe that the corner angle is divided into two. If the corner angle is small, the divided angles are smaller and thus decrease the mesh quality. Therefore, we choose not to pillow these small angles to attain better mesh quality. This can be done by modifying the shrink set in the first pillowing step, as shown in Fig. 10. When we define the shrink
(a)
(b)
(c)
(d)
(e)
(f)
Fig. 9. two-step pillowing. (a-c): Inserting one boundary layer for the top surface. The shrink set (yellow) is defined in (a), pillowed in (b) and projected to the top surface patch in (c). (d-f): Inserting two boundary layers. (d) and (e) are the original mesh, and (f) is the resulting mesh. In (f), the yellow elements are the original mesh, the blue and pink ones are the first and second pillowed layers, respectively.
254
J. Qian and Y. Zhang
Fig. 10. Small sharp angle preservation. (a): A meshing result before pillowing; (b): Each surface patch is pillowed and all the sharp angles are split; (c): Sharp angles in (d-f) are preserved by modifying the shrink set, while the sharp angle in (g-i) has to be split because all the four vertices of that quad are on the sharp curves; (d-i): Zoom-in details of two corners.
set, if one quad contains a small angle formed by two sharp curves, the quad is excluded from the shrink set. In this manner, that quad is not pillowed, and the small sharp angle is preserved as shown in (d-f). Note that if all the four vertices of a quad are on the curves, see the sharp corner in (g-i), we cannot exclude that quad and the sharp angle has to be split. Otherwise, the triangle-shaped quad cannot be removed. After two boundary layers are inserted, each boundary quad has at most one edge on the sharp curves while each hex element has at most one quad on the boundary. Fig. 11 shows the pillowing result of the multiaxis model. 5.2
Non-manifold Domain with Multiple Components
For domains with multiple components, patch matching is essential especially for patches shared by multiple components, here we use different matching strategies for the first and second pillowing steps. In multiple-component models there are two kinds of surface patches: patches contained in one component and the common patches shared by two components. During the first pillowing step, we first mark the sets of common patches. Then we pillow the faces that belong to only one component in the same way as the single-component domain, and one layer of elements are inserted at one time. Whenever we come across a common patch, two instead of one hex layers are inserted. If the original nodes on the common patch is Set A (yellow in Fig. 12(a)), we duplicate two different layers, Sets
Sharp Feature Preservation of CAD Assemblies
255
Fig. 11. Meshing results before (a) and after (b) inserting two boundary layers. (c) and (d) show the details.
(a)
(b)
(c)
Fig. 12. The first pillowing step for a common patch. (a) The original two components share one common patch A; (b) Sets B and C are created, then Sets A and B, A and C are connected; and (c) A is projected to B and C.
B (blue) and C (green). Then, we connect Sets A and B, A and C to form two hex layers. Note that Sets B and C have the same vertices on the red boundary curve, so all the curves are automatically conformal to each other. Finally Set A is projected to B and C. For the second pillowing step, patch matching is rather straight-forward. Like what we did for one single component, when pillowing one surface we shrink the original nodes inside while keep the new nodes at the boundary. Therefore, the nodes in other components connecting to the original boundary should be connected to the new boundary. Therefore, the resulting meshes automatically match at the common patch shared by multiple components. Fig. 13 shows an evolution of the two-cylinder assembly. After inserting two pillowed layers, the resulting meshes for the two components automatically match with each other. Fig. 14 shows meshes of the cylinder-ring assembly
256
J. Qian and Y. Zhang
(a)
(b)
(c)
(d)
(e)
Fig. 13. (a-b): A two-cylinder assembly and the resulting mesh; and (c-e): one cross section of the original mesh, the mesh with the first pillowed layer, and the mesh with two pillowed layers, respectively.
(a)
(b)
(c)
(d)
Fig. 14. The resulting meshes of a cylinder-ring assembly. (a) The assembly; (b) The inner cylinder; (c) The outer ring; and (d) One cross section of the assembly.
in Fig. 5. Note that in (b), the mesh is denser around the top and bottom of the cylinder. This is because the cylinder face is divided into three small patches as discussed earlier, and all these three patches are pillowed separately resulting in denser meshes over there.
6 Quality Improvement After preserving sharp features and inserting two boundary layers, the resulting hex mesh conforms to the B-Reps and is free of triangle-shaped quads or doublets. However, the mesh may still have bad aspect ratios along the boundary and negative Jacobians may exist. Therefore a modified Laplace smoothing is carried out to improve the overall quality followed by a Jacobian optimization. We use the same smoothing techniques as developed in Section 4.3 except that the Jacobian is integrated to decide the movement for each interior vertex. The interior vertex is relocated to the weighted volume center of its neighboring elements only when the movement succeeds in improving the local Jacobian. The optimization method starts with looping all the vertices to compute their Jacobians, and then the very vertex with the worst Jacobian is found and improved using a conjugate gradient method, in which
Sharp Feature Preservation of CAD Assemblies
257
the objective function is the Jacobian of that vertex. Then a new loop begins and the new worst region in the improved mesh is found and optimized in the same manner. We keep improving the worst Jacobian until it is greater than a pre-defined threshold. We choose the traditional definition of the Jacobian matrix using the finite element basis functions [23]. Generally if the eight corners of one hex all have positive Jacobians, then the Jacobian inside the hex is usually positive. In order to guarantee that some numerical analysis works properly, we can check the Jacobian at each Gaussian integration point and include it in the loop.
7 Results and Discussion We have applied our algorithms to two single-component CAD models (Figs. 15, 16) and two multiple-component assembly models (Figs. 1, 17). Our techniques generate quality meshes with all sharp features preserved. All the computations are performed on a PC equipped with an Intel Q9600 CPU and 4GB DDR-II memories. The resulting meshes are valid with conformal boundaries and sharp feature preservation. Table 1 shows the statistics before and after quality improvement of the meshes. Note that during optimization, we use the Jacobian defined in the finite element method as the objective function; while in the statistics, we measure the mesh quality with the Jacobian defined by three edge vectors
Fig. 15. The resulting mesh for the hook model. (a-b) Snapshots from two view angles; and (c-d) Zoom-in details of the boundary layer and one corner.
258
J. Qian and Y. Zhang
Fig. 16. The resulting mesh for the varco3 model. (a-b) Snapshots from two view angles; and (c-e) Zoom-in details of three corners. Table 1. Statistics of meshes before and after quality improvement Mesh Size Jacobian Condition Inverted Time (Vert , Elem ) (Worst, Best) (Worst, Best) Elem (s)
Model
Mesh
Multiaxis
Original Improved
(1755, 1187) (4505, 3707)
Hook
Original Improved
(2556, 1663) (6327, 5121)
0 0
29
(-0.0003, 1.0) (20553.31, 1.0) (0.029, 1.0) (34.48, 1.0)
3 0
49
Original (6130, 4658) (-0.0004, 1.0) (25659.53, 1.0) Improved (13627, 11448) (0.016, 1.0) (61.23, 1.0)
21 0
84
Bearing Original (4252, 2979) (-0.0005, 1.0) (8509.72, 1.0) Assembly Improved (12208, 10231) (0.016, 1.0) (63.34, 1.0)
21 0
92
Gear Original (7434, 4938) (0.0003, 1.0) (3084.63, 1.0) Assembly Improved (23671, 19454) (0.021, 1.0) (46.18, 1.0)
0 0
152
Varco3
(0.014, 1.0) (0.24, 1.0)
(73.05, 1.0) (4.10, 1.0)
Sharp Feature Preservation of CAD Assemblies
259
Fig. 17. The resulting hex mesh of a three-component bearing assembly. (a) The bearing assembly; (b-c) Zoom-in details of two corners; and (d-f) Three single components
[5, 21, 23]. After quality improvement, all the negative Jacobians are removed, and the worst Jacobian as well as the worst condition number are improved significantly. The success of sharp feature detection relies on a good base mesh. Fortunately the octree-based isocontouring method provides us such meshes. Even though the base mesh has some bad elements on the boundary, it is improved through the two-step pillowing. In the pillowing, the number of elements increases sharply, which leads to large memory and CPU requirements. The mesh generation computing time is optimized so that generating 10,000 elements (after pillowing) takes about 90 seconds. In the pipeline, sharp feature detection and pillowing are fast, the most time-consuming part is the overall smoothing, which is linear in complexity. From Table 1 we can also tell that the computational time is nearly proportional to the element number (after pillowing).
260
J. Qian and Y. Zhang
8 Conclusion and Future Work We have developed an automatic and robust approach to generate unstructured hex meshes with sharp feature preservation for single-component CAD models and multiple-component assemblies. The base mesh is generated using the octree-based isocontouring method. Features such as sharp curves and surface patches are detected first, and then the mesh is smoothed while incorporating these features. After this stage, a two-step pillowing technique is used to eliminate triangle-shaped quads along the sharp curves and doublets. Then a modified Laplace smoothing and Jacobian optimization are used to improve the mesh quality. Several CAD models are tested and statistics of the resulting meshes are given. For large datasets, the required memory and CPU time increase significantly. In the future, we will optimize our data structure and develop parallel meshing algorithms to construct non-manifold hex mesh efficiently for very large datasets. To reduce the rapid increase in the element number, we will implement local refinement algorithms instead of pillowing two whole boundary layers. In the future, we will also apply the algorithm to more applications, and include material properties into our mesh generation and quality improvement procedure.
Acknowledgement We would like to thank Wenyan Wang for useful discussions on NURBS curve and surface path parametrization, and Matt Staten for providing the multiaxis, hook2, hook and varco3 models. The research was supported in part by Y. Zhang’s ONR-YIP award, an ONR grant N00014-08-1-0653 and a NRL contract N00173-08-C-6011 as part of the HPCMP CREATE program.
References 1. Blacker, T., Myers, R.: Seams and Wedges in Plastering: A 3D Hexahedral Mesh Generation Algorithm. Engineering With Computers 2(9), 83–93 (1993) 2. Folwell, N., Mitchell, S.: Reliable Whisker Weaving via Curve Contraction. Engineering With Computers 15(3), 292–302 (1999) 3. Ito, Y., Shih, A., Soni, B.: Octree-based Reasonable-quality Hexahedral Mesh Generation using a New Set of Refinement Templates. International Journal for Numerical Methods in Enginnering 77(13), 1809–1833 (2009) 4. Knupp, P.: Next-generation Sweep tool: A Method for Generating All-hex Meshes on Two-and-one-half Dimensional Geometries. In: Proceedings of 7th International Meshing Roundtable, pp. 505–513 (1998)
Sharp Feature Preservation of CAD Assemblies
261
5. Knupp, P.: Achieving Finite Element Mesh Quality via Optimization of the Jacobian Matrix Norm and Associated Quantities. Part II–A Framework for Volume Mesh Optimization and the Condition Number of the Jacobian Matrix. International Journal for Numerical Methods in Engineering 48(8), 1165–1185 (2000) 6. Marcha, L.: Advances in Octree-Based All-Hexahedral Mesh Generation: Handling Sharp Features. In: Proceedings of 18th International Meshing Roundtable, pp. 65–84 (2009) 7. Mitchell, S., Tautges, T.: Pillowing Doublets: Refining a Mesh to Ensure That Faces Share at Most One Edge. In: Proceedings of 4th International Meshing Roundtable, pp. 231–240 (1995) 8. Owen, S.: A Survey of Unstructured Mesh Generation Technology. In: Proceedings of 7th International Meshing Roundtable, pp. 26–28 (1998) 9. Owen, S., Shepherd, J.: Embedding Features in a Cartesian Grid. In: Proceedings of 18th International Meshing Roundtable, pp. 117–138 (2009) 10. Price, M., Armstrong, C.: Hexahedral Mesh Generation by Medial Surface Subdivision: Part I. International Journal for Numerical Methods in Engineering 38(19), 3335–3359 (1995) 11. Price, M., Armstrong, C.: Hexahedral Mesh Generation by Medial Surface Subdivision: Part II. International Journal for Numerical Methods in Engineering 40(1), 111–136 (1997) 12. Qian, J., Zhang, Y., Wang, W., Lewis, A., Qidwai, M., Geltmacher, A.: Quality Improvement of Non-manifold Hexahedral Meshes for Critical Feature Determination of Microstructure Materials. International Journal for Numerical Methods in Enginnering 82(11), 1406–1423 (2010) 13. Schneiders, R.: A Grid-based Algorithm for the Generation of Hexahedral Element Meshes. Engineering with Computers 12(3-4), 168–177 (1996) 14. Schneiders, R., Weiler, F.: Octree-Based Generation of Hexahedral Element Meshes. In: Proceedings of 7th International Meshing Roundtable, pp. 205–216 (1996) 15. Shephard, M., Georges, M.: Three-Dimensional Mesh Generation by Finite Octree Technique. International Journal for Numerical Methods in Engineering 32(4), 709–749 (1991) 16. Shepherd, J.: Conforming Hexahedral Mesh Generation via Geometric Capture Methods. In: Proceedings of 18th International Meshing Roundtable, pp. 85–102 (2009) 17. Shepherd, J., Zhang, Y., Tuttle, C., Silva, C.: Quality Improvement and Boolean-like Cutting Operations in Hexahedral Meshes. In: The 10th ISGG Conference on Numerical Grid Generation, FORTH, Crete, Greece, September 16-20 (2007) 18. Staten, M., Kerr, R., Owen, S., Blacker, T.: Unconstrained Paving and Plastering: Progress Update. In: Proceedings of 15th International Meshing Roundtable, pp. 469–486 (2006) 19. Staten, M., Shepherd, J., Ledoux, F., Shimada, K.: Hexahedral Mesh Matching: Converting non-conforming hexahedral-to-hexahedral interfaces into conforming interfaces. International Journal for Numerical Methods in Enginnering 82(12), 1475–1509 (2009)
262
J. Qian and Y. Zhang
20. Tautges, T., Blacker, T., Mitchell, S.: The Whisker-Weaving Algorithm: a Connectivity Based Method for Constructing All-hexahedral Finite Element Meshes. International Journal for Numerical Methods in Engineering 39(19), 3327–3349 (1996) 21. Zhang, Y., Bajaj, C.: Adaptive and Quality Quadrilateral/Hexahedral Meshing from Volumetric Data. Computer Methods in Applied Mechanics and Engineering 195(9-12), 942–960 (2006) 22. Zhang, Y., Bajaj, C., Sohn, B.: 3D Finite Element Meshing from Imaging Data. The special issue of Computer Methods in Applied Mechanics and Engineering on Unstructured Mesh Generation 194(48-49), 5083–5106 (2005) 23. Zhang, Y., Hughes, T., Bajaj, C.: An Automatic 3D Mesh Generation Method for Domains with Multiple Materials. Computer Methods in Applied Mechanics and Engineering 199(5-8), 405–415 (2010)
Pen-Based User Interface for Geometric Decomposition for Hexahedral Mesh Generation Jean Hsiang-Chun Lu1 , Inho Song1 , William Roshan Quadros2, and Kenji Shimada1 1 2
Carnegie Mellon University, Pittsburgh, PA [email protected], {songphd,shimada}@cmu.edu Sandia National Laboratories , Albuquerque, NM [email protected]
Summary. In this work, we present a pen-based user interface (UI) that makes manual geometry decomposition easier and helps reduce user time spent on geometry decomposition for hexahedral meshing. This paper presents the first attempt to apply a pen-based UI for geometry preparation for mesh generation. The proposed UI is more natural, intuitive, and easier to use than existing interfaces such as Window-Icon-Mouse-Pointer and commandline interfaces. The pen-based UI contains the following features: (1) drawing freeform strokes, (2) fitting and aligning strokes to CAD geometry automatically, (3) creating cutting surfaces, and (4) performing various tasks including webcutting through gestures. The proposed pen-based UI has been tested on a few models to demonstrate its effectiveness in decomposition, defeaturing and controlling mesh orientation. Keywords: pen-based interface, decomposition, hexahedral meshing.
1 Introduction Manual geometry decomposition is one of the most time-consuming steps in the mesh generation process. As shown in Fig. 1, geometry decomposition dominates time spent during hex-meshing tasks at Sandia National Lab. In order to perform geometry decomposition in existing preprocessing / meshgeneration tools (e.g. CUBIT, TurboMesh), users have to either select an appropriate command via a Window-Icon-Mouse-Pointer (WIMP) Graphical User Interface (GUI), or type the command in the command-line interface
Sandia is a multiprogram laboratory operated by Sandia Corporation, a Lockheed Martin Company for the United States Department of Energy’s National Nuclear Security Administration under contract DE-AC04-94AL85000.
264
J.H.-C. Lu et al.
Fig. 1. The user time spent for various tasks in mesh generation process at Sandia National Laboratories [1]
(CLI). Though these traditional interfaces are powerful, they are cumbersome to a novice user. The decomposition of models into meshable geometries has received a great deal of attention due to the limitations of current hexahedral meshing algorithms. The practical approach is to manually decompose the complex geometry into meshable regions. These meshable regions are then imprinted and merged before performing surface and volume meshing. The surfaces of these regions are meshed using existing algorithms such as paving, mapping, and sub-map [2]. Then volume meshing schemes such as sweeping (which requires specifying source and target surfaces) and mapping are used to mesh the sub-domains. The pen-based UI proposed in this paper improves the interface of decomposition operation in order to make the manual decomposition process more efficient. A recent trend in computer-aided engineering software is moving toward more natural and accessible interfaces, of which pen-based interfaces are a prime example. In the early design stage, pen-based interfaces that use a stylus pen and tablet have already been playing an important role and have been used in freeform styling design. However, deposit its potential, pen-based UI has not been commonly utilized in the engineering analysis. In this paper, the benefits of pen-based interfaces are brought to engineering analysis tasks by developing a new UI for easier and faster manual geometry decomposition for hexahedral meshing as shown in Fig. 2. This work is the first attempt to apply pen-based interface in mesh generation and is in its early development stage. More pen-based functions will be implemented in the future. The overview of the proposed UI is as follows. The program first takes freehand input as sequences of screen coordinates. The freehand inputs are then re-sampled and smoothed. The processed input point set are then identified as one of the three types: lines, circles, or splines.
Pen-Based User Interface for Geometric Decomposition
265
Fig. 2. Decomposing a model with the proposed pen-based UI
The program then fits appropriate 1D geometry entity to each input according to the type. Cutting surfaces are created by sweeping the 1D geometry entity in a given sweeping direction. The solid model is then decomposed using the cutting surfaces. The rest of the paper is organized as follows: Section 2 discusses the previous related works. Section 3 covers the beautification and snapping algorithms to process the freehand inputs. In Section 4, we describe how to create cutting surfaces for webcutting [3]. Section 5 includes results that illustrate decomposition targeting better mesh quality, controlling orientation of mesh and defeaturing for hex meshing.
2 Related Work 2.1
MARK-IT
The approach of Yang et al. to improve user interface (UI) with MARK-IT [4] successfully simplifies the WIMP GUI as shown in Fig. 3 and saves user time by avoiding switching among different panels in a conventional GUI interface. Decomposition commands are executed by selecting entities and drawing a corresponding mark with the mouse. MARK-IT covers over 50 CUBIT operations with different marks. To help users in drawing a correct mark, a label appears by the cursor to display the associated command. When
266
J.H.-C. Lu et al.
Fig. 3. Commands shown in MARK-IT interface [4]
a user needs to input a value, MARK-IT provides a “virtual slider” that can be dragged to adjust the value. MARK-IT shows the potential of a marking interface that is integrated with a complex meshing system such as CUBIT. MARK-IT avoids unnecessary movement of the mouse by improving access to commands and operations. However, it does not reduce the time spent in the manual decomposition process. 2.2
ITEM
CUBIT offers the Immersive Topology Environment for Meshing (ITEM) [5], a wizard-like environment that uses the approach used by [6] to determine the possible cutting surfaces. First, all the curves that form a dihedral angle less than an input value (default is 135 degrees) were collected. Second, a graph-based algorithm was used to determine all the closed loops or the open loops that can be closed using a boundary edge. Third, all the surfaces that bound the loops were collected. Fourth, extensions of the collected surfaces were used in defining the cutting surfaces. The extensions of the surfaces are presented as suggest cutting surfaces to users. Fig. 4 shows some of the cutting surfaces suggested by ITEM. However, those suggested cutting surfaces might not result in a meshable model. The user has to search through the available options and make meaningful selections if exists. If there are no meaningful cutting surfaces, then the user has to use CLI or GUI to manually create the desired cutting surfaces. Thus, time-consuming manual decomposition operations are still required. 2.3
Pen-Based Interface
Numerous researches have focused on using pen-based interface to create 3D models. Free-form surface generation or model creation systems such as [7, 8, 9] reconstruct a 3D model or surface from 2D sketch inputs. The template-based system proposed by Yang et al. [10] applies sketch recognition algorithms to match points and curves to the given 2D templates. Kara
Pen-Based User Interface for Geometric Decomposition
267
Fig. 4. Suggested cutting locations provided by ITEM
and Shimada [11] use computer vision techniques to align a template with an input sketch for users to deform a model. By tracing over the sketch, user can simply draw the new shapes on the model for deformation. Kho et al. [12] use strokes to define a free-form skeleton and the region of the model to be deformed. Nealen et al. [13] first detect an object’s silhouette, and then let the user create new features or modify the existing one by sketching an approximate shape onto the model. Cheutet et al. [14] allow the user to directly operate on an object by modifying strokes with a stylus pen. The gesture based interface used by Teddy [7] and [15] uses user strokes for operations such as extension, bending, and other modification functions. An optimization-based algorithm is used to determine the depth of 2D sketch vertices in the work presented by Masry et al. [16]. It constructs a 3D wireframe shape from a 2D freehand input for a physical simulation. Though pen-based interfaces have many contributions in the CAD modeling field, their advantages have not been applied in geometry preprocessing for hex meshing.
3 Drawing, Beautification and Snapping of Freehand Inputs The proposed UI interprets the user’s freehand input as a “hint” in order to guess the intention and suggests the best matching result. It solves the problems of inaccuracy and repeatability of freehand input strokes by beautifying them with re-sampling, smoothing filters and geometric fitting to 1D entities, and then snapping the 1D entities by offsetting and overlapping algorithms. The user draws a freehand input P , then the input is re-sampled and smoothed to P˜ . P˜ is represented as a 1D geometric entity C(t) such as a line, a circle, or a spline. In the future implementation, the system will search on the object surface for edges of the same geometry type and calculate the
268
J.H.-C. Lu et al.
distance between the matching edge and C(t). C(t) will then be snapped as an offset or overlap of the closest edge. Another feature of the proposed UI is using gestures for easily access commands. Currently, ten gestures can be recognized by the systems. The user can draw gestures to execute the linked commands. 3.1
Drawing on Object Surfaces
The users intentions are either to create 1) a geometric entity, or 2) to specify an operator that works on the geometry entity. In the case of geometric entities, the intensions are to create 1D entity of one degree (e.g. line, polyline), two degrees(e.g. arc, circle, ellipse, parabola), or higher degrees(e.g. cubic splines, Bezier, NURBS). However, currently only lines, arcs, circles, and splines can be identified. The intended operators generally work on the 1D entities or can operate on 2D entities (e.g. cutting surface). The operators that work on 1D entities include alignment, trimming, offsetting, extending, sweeping. The operators that work on 2D entities include webcutting using a cutting surface. These operators are specified via gestures as shown in Fig. 5 (the dots on the gestures indicate the starting points) or key shortcuts. As shown in Fig. 6, the gesture can still be recognized even the directions and sizes are different from the template. Currently, a subset of operators are implemented and linked with the gestures, and rest of the gestures will be linked in the future with other advanced operators. 3.2
Beautification: Resampling, Smoothing and Geometric Fitting
The proposed interface uses three steps to beautify freehand inputs: 1) resampling, 2) smoothing, and 3) geometric fitting. Resampling will uniformly distribute the points carried by the freehand input. Smoothing removes noise while geometric fitting matches the freehand input to an intended shape such as a line, circle, and spline.
Fig. 5. Gesture set
Pen-Based User Interface for Geometric Decomposition
269
Fig. 6. An example of alpha gesture recognition. The program is able to recognize the incurrate alpha gestures correctly though they are in different sizes and drawing directions.
A freehand input is noisy due to the hand control of a user as well as sampling errors caused by stylus and tablet. The number of samples in a given input stroke depends on the pen speed (i.e. point density is inversely proportional to the users pen speed) and varies among devices. The system needs to re-sample the input to obtain data points uniformly spaced along the stroke before Laplace smoothing [17] can be applied to remove noise from the inputs. The noisy freehand input is replaced with a re-sampled and smoothed stroke, shown in Fig.7(a) and (b), respectively. The third step is to fit the smoothed inputs to common predefined shapes, such as line segments (Fig. 8(a)), circles (Fig. 8(b)), and splines (Fig. 8(c)), if they match. We define a set of tolerances to determine how a stroke should fit to each predefined shape. This tolerance is defined as the ratio of the length between the endpoints of the stroke, Llength and the actual curve length of the stroke Lo . If the tolerance is greater than 0.99, then the stroke is fit to a line segment. If the tolerance is less than 0.06, then the stroke is fit to a closed circle. We assume that when the user would like the freehand input be fit to a circle with radius r, the length of the input Lo is close to 2πr and Llength is within 0 to r/3 as shown in Fig. 9. Otherwise, the stroke is returned as a spline as shown in Fig. 8(c). 3.3
Identifying Candidate Edges and Snapping
In this section, we describe how to snap 1D input entities to fit the object edges of the same type. It is important to identify the 1D entities types before snapping to reduce the search space. In order to snap the 1D entities correctly to the closet edges on the object surfaces, we first identify the 1D entities as different types: lines, circles and splines, then the system can search
(a) Before smoothing.
(b) After smoothing.
Fig. 7. Smoothing the freehand input
270
J.H.-C. Lu et al.
(a)
(b)
(c)
(d)
Fig. 8. Freehand inputs are fitted to (a) a line segment; (b) a circle; (c) an arc; (d) a spline
Fig. 9. Snap a freehand input to a circle. Thick solid line represents a freehand input, which will be fitted to a circle shown with a dash line.
Fig. 10. The algorithm to identify candidate edges
on the object surfaces for candidate edges which have the same type. Next the system compares the average distances between different candidate edges and the 1D entity. If the average is within the tolerance TL , the edge will be selected as a candidate. The algorithm for identification is shown in Fig. 10. To snap a 1D entities to edges on object surfaces, we apply the method proposed by Song and Shimada [18] as shown in Fig. 11. After the system
Pen-Based User Interface for Geometric Decomposition
271
Fig. 11. The snapping algorithm if candidate edges exist
identify the candidate edges of the same type as the 1D entity, it calculates the average distance davg shown in Fig. 12(a), between the 1D entities and those edges. The davg is then compared with the overlapping tolerance To and parallel tolerance Tp . When davg is less than the overlap tolerance To , the 1D entity will be trimmed to its closest edge length. When davg is within To and Tp , the 1D entity will be offset davg from the edge displayed in Fig. 12(b) as the result shown in Fig. 12(c). The offsetting result to the circle edge is shown in Fig. 13. If davg is greater than Tp , the 1D entities will not be offset to the edge.
4 Creating Cutting Surfaces and Decomposition The user can sweep a beautified and snapped 1D entity to create a cutting surface. The system first picks a surface of the given model by the midpoint of the entity then projects the stroke on the surface. The entity will be swept to create a cutting surface in one of the following directions: 1) the object’s surface normal direction; or 2) the current viewing direction. More sweeping directions will be implemented in the future. Next, the system determines the target volume with the midpoint of the stroke. Then the stroke is swept along the sweeping direction until it reaches
272
J.H.-C. Lu et al.
(a) The original input stroke
(b) The snapped stroke
(c) The distances from strokes (1) and (2) to the upper edge are smaller than TP so they are offset to the upper edge. Stroke (3) is not offset to any edges. The distance between (4) and the lower edge is greater than TP thus (5) is not offsett to the lower edge. (6) is offsett to the lower edge.
Fig. 12. Offset snapping illustration
Fig. 13. Concentric circle snapping
(a) Sweeping along normal direction
(b) Sweeping along current viewing direction
Fig. 14. Creating cutting surfaces for webcutting
Pen-Based User Interface for Geometric Decomposition
273
the bounding box size of the target volume. Fig. 14(a) and (b) show the cutting surface and the decomposition along the surface normal direction and the viewing direction, respectively.
5 Results and Discussions The first example demonstrates the geometry decomposition using freeform strokes to obtain better mesh quality. The second example demonstrates the use of the proposed UI on defeaturing to obtain a meshable model. In the last example we show the potential of using the proposed interface to control the orientation and the size of the mesh. 5.1
Decomposition with Pen-Based Interface for Hexahedral Meshing
The hexahedral mesh generation is a hard problem even for simpler geometries and generally requires geometry decomposition as a pre-process. For example, hex meshing algorithms such as sweeping and mapping fail to mesh the model shown in Fig. 16(a) since the model contains two holes in orthogonal direction. The model can be meshed via a sweeping algorithm if it can be decomposed so that the two holes are in two different sub-domains. As shown in Fig. 15, the ITEM does not provide any cutting surfaces in ideal region between the two holes as there are no geometric features in this ideal region. Using the CLI user will be able to webcut the volume using a planar surface; however, the mesh quality will not be good because of the bad angles. The cutting surface in the ideal region should be orthogonal to the sweeping source and target surfaces (see Fig. 16(b)). Using the pen-based interface the user can draw a stroke in the desired direction orthogonal to the source and the target surface in the ideal region as shown in Fig. 16(b). Fig. 16(c)
Fig. 15. None of the suggested cutting surfaces by ITEM locate in the ideal region
274
J.H.-C. Lu et al.
(a) The original model
(b) Create the desired cutting surface with a freeform stroke in the ideal region
(c) The decomposition result via pro-(d) The hex mesh quality result uses the Scaled posed pen-based interface Jacobian matrix
Fig. 16. Decomposition with freefrom stroke via pen-based interface
shows the meshed model and the mesh quality is shown in Fig. 16(d). The decomposition via the proposed interface has given a min Scaled Jacobian of 0.7255. While cutting with a planer surface using the command line the min scaled Jacobian was 0.6513. 5.2
Defeaturing via Pen-Based Interface
In the last couple of decades the CAD technology has evolved significantly and has enabled the users in creating detailed CAD models; however, this has brought new challenges to the mesh generation phase. In order to obtain a conformal high-quality hex mesh with a small number of mesh element, irrelevant detailed features should be removed. Though much focus on automatic defeaturing has been given [19], user interactions are still required in many cases, especially during hexahedral mesh generation. In this example, we demonstrate an application of the proposed pen-based UI in the area of defeaturing. Fig. 17(a) shows a typical industrial model containing two small features: threads and slots. Fig. 17(a) also shows the two input strokes marked on the model surface to indicate the regions that need to be defeatured. Fig. 17(b) shows that the small threads and slots are decomposed from the main solid and in Fig. 17(c) those features are removed.
Pen-Based User Interface for Geometric Decomposition
(a) The original model: unmeshable due to small features, the slot and threads
(b) The defeatured model
(c) The decomposed and defeatured model
(d) All hex mesh output Fig. 17. Defeaturing to achieve a meshable model
275
276
J.H.-C. Lu et al.
Fig. 17(c) and Fig. 17(d) show the meshable sub-domains and the final mesh obtained by combining the proposed UI with other existing tools in CUBIT. 5.3
Controlling Mesh Orientation and Size via Freeform Stroke
In this example, we show the potential of our pen-based interface in controlling mesh orientation and size. Currently, there are no general automatic hex meshing algorithms that can utilize tensor fields [20] based on physical parameters such as temperature distribution, stress contours, or streamlines in flow problems. With the proposed UI, the user can draw freeform strokes along the contours based on domain knowledge. Fig. 18(a) shows a typical streamline pattern in the flow around an airfoil. To generate a hex mesh that aligns with the flow pattern, the user can draw strokes along typical streamlines. The
(a) A flow pattern around an airfoil [21]
(b) Drawing strokes along the streamlines to decompose the model. The strokes are marked as orange
(c) The oriented mesh along the streamlines
(d) The oriented hex mesh along the streamlines
Fig. 18. Controlling mesh orientation
Pen-Based User Interface for Geometric Decomposition
277
model is then decomposed along the strokes as shown in Fig. 18(b). Fig. 18(c) shows that mesh is oriented along the streamlines and the mesh size at the boundary layer at the bottom of the airfoil can be controlled by maintaining a required spacing between the freeform strokes. A smaller spacing produces finer elements at boundary layers and a larger spacing produces coarser elements.
6 Conclusions This paper proposes a new application of pen-based UI in the area of geometric processing for mesh generation. The proposed UI makes the manual geometry decomposition for hexahedral meshing very intuitive, easier, and faster. The proposed approach beautifies and snaps the freehand input strokes (drawn directly on the CAD model) and uses gestures to create cutting surfaces to decompose the CAD model into meshable sub-domains. The pen-based UI can also be used in controlling the size and orientation of the hex mesh and in defeaturing irrelevant small features. Work is underway to add more features to the UI and to apply it to related areas in pre-processing stage.
Acknowledgement We would like to thank Dr. Soji Yamakawa, Mr. Ved Vyas and Mr. Erick Johnson for their valuable advises. We would also like to thank Cubit users, in particular Kristin Dion and Ricardo Garcia, for their valuable feedback.
References 1. Hardwick, M.: DART System Analysis Presented to Simulation Sciences Seminar (2005) 2. Owen, S.J.: A survey of unstructured mesh generation technology. In: Proceeding of the 7th International Meshing Roundtable, Sandia National Laboratories, pp. 239–267 (1998) 3. Sandia National Laboratories, Cubit 12.1 on-line user’s manual: Web cutting, http://cubit.sandia.gov/help-version12.1/cubithelp.htm 4. Yang, N., Forsberg, A., Shepherd, J., Garcia, R., Merkley, K.: Mark-it: A marking user interface for cutting decomposition time. In: Proceeding of the 13th International Meshing Roundtable, Sandia National Laboratories, pp. 231–242 (2004) 5. Owen, S.J., Clark, B.W., Melander, D.J., Brewer, M., Shepherd, J.F., Merkley, K., Ernst, C., Morris, R.: An immersive topology environment for meshing. In: Proceeding of the 16th International Meshing Roundtable, Sandia National Laboratories, pp. 553–578 (2007)
278
J.H.-C. Lu et al.
6. Lu, Y., Gadh, R., Tautges, T.: Volume decomposition and feature recognition for hexahedral mesh generation. In: Proceeding of the 8th International Meshing Roundtable, Sandia National Laboratories, pp. 269–280 (1999) 7. Igarashi, T., Matsuoka, S., Tanaka, H.: Teddy: A sketching interface for 3D freeform design. In: Proceeding of the 26th annual conference on Computer graphics and interactive, pp. 409–416 (1999) 8. Tsang, S., Balakrishnan, R., Singh, K., Ranjan, A.: A suggestive interface for image guided 3D sketching. In: Proceeding of the SIGCHI conference on Human factors in computing systems, pp. 591–598 (2004) 9. Bae, S., Balakrishnan, R., Singh, K.: Ilovesketch: As-natural-as-possible sketching system for creating 3D curve models. In: Proceeding of the 21st annual ACM symposium on User interface software and technology, pp. 151–160 (2008) 10. Yang, C., Sharon, D., van de Panne, M.: Sketch-based modeling of parameterized objects. In: Proceeding of the SIGGRAPH 2005: ACM SIGGRAPH 2005 Sketches, p. 89 (2005) 11. Kara, L., Shimada, K.: Construction and modification of 3D geometry using a sketch-based interface. In: Proceeding of the EUROGRAPHICS Workshop on Sketch-Based Interfaces and Modeling, pp. 59–66 (2006) 12. Kho, Y., Garland, M.: Sketching mesh deformations. In: Proceeding of the Symposium on Interactive 3D Graphics and Games, pp. 147–154 (2005) 13. Nealen, A., Sorkine, O., Alexa, M., Cohen-Or, D.: A sketch-based interface for detail-preserving mesh editing. In: Proceeding of the ACM SIGGRAPH 2005 (2005) 14. Cheutet, V., Catalano, C., Pernot, J., Falcidieno, B., Giannini, F., Leon, J.: 3D sketching for aesthetic design using fully free-form deformation features. Computer Graphics 29(6), 916–930 (2005) 15. Eggli, L., Br¨ uderlin, B.D., Elber, G.: Sketching as a solid modeling tool. In: Proceeding of the 3th ACM symposium on Solid modeling and applications, pp. 313–322 (1995) 16. Masry, M., Kang, D., Lipson, H.: A freehand sketching interface for progressive construction of 3D objects. Computers and Graphics 29(4), 563–575 (2005) 17. Taubin, G.: Curve and surface smoothing without shrinkage. Computer Vision, 852–857 (1995) 18. Song, I., Shimada, K.: Sketch-based computer-aided design tool for configuration design of automobile instrument panel. Computer Aided Design and Application 6(5), 585–594 (2009) 19. Quadros, W.R., Owen, S.J.: Defeaturing CAD models using a geometry-based size field and facet-based reduction operators. In: Proceeding of the 18th International Meshing Roundtable, Sandia National Laboratories, pp. 301–318 (2009) 20. Vyas, V., Shimada, K.: Tensor-guided hex-dominant mesh generation with targeted all-hex regions. In: Proceeding of the 18th International Meshing Roundtable, Sandia National Laboratories, pp. 377–396 (2009) 21. Massachusetts Institute of Technology, Marine hydrodynamics, http://web.mit.edu/13.021/13021003/Lifting20surfaces/lectureC.htm
Particle Systems for Adaptive, Isotropic Meshing of CAD Models Jonathan R. Bronson, Joshua A. Levine, and Ross T. Whitaker Scientific Computing and Imaging Institute, Salt Lake City, UT, U.S.A {bronson,jlevine,whitaker}@sci.utah.edu
Summary. We present a particle-based approach for generating adaptive triangular surface and tetrahedral volume meshes from CAD models. Input shapes are treated as a collection of smooth, parametric surface patches that can meet non-smoothly on boundaries. Our approach uses a hierarchical sampling scheme that places particles on features in order of increasing dimensionality. These particles reach a good distribution by minimizing an energy computed in 3D world space, with movements occurring in the parametric space of each surface patch. Rather than using a pre-computed measure of feature size, our system automatically adapts to both curvature as well as a notion of topological separation. It also enforces a measure of smoothness on these constraints to construct a sizing field that acts as a proxy to piecewise-smooth feature size. We evaluate our technique with comparisons against other popular triangular meshing techniques for this domain. Keywords: Adaptive meshing, particle systems, tetrahedral meshing, CAD.
1 Introduction Tetrahedral mesh generation is a key tool in the computer-aided design (CAD) pipeline. In particular, the conversion of shapes presented by the output CAD systems and solid modeling geometry kernels is necessary to provide input meshes for structural analysis, CFD and other CAE applications. The data from these systems is usually in the form of a boundary representation (B-Rep) made up of hierarchical connectivity (topology) and associated geometric entities. When the B-Rep is manifold and topologically closed, shapes of arbitrary geometric complexity can be produced. Care must be taken to provide accurate representations of these inherently piecewisesmooth solids while robustly preserving the curved features defined by the input topological description [18]. While many types of meshes are suitable for visualization and simulation, simplicial meshes have emerged as one of the dominant forms. Their popularity
280
J.R. Bronson, J.A. Levine, and R.T. Whitaker
can be attributed to both the ease at which simplicial meshing algorithms can be implemented as well as the guarantees of termination and quality that can often be shown. Technologies to construct simplicial meshes vary greatly. Some of the most important paradigms include advancing-front [19, 20, 26], Delaunay refinement [10, 25, 29], and particle systems [22, 33]. However, to build meshes that are adaptive, many variants of these techniques require an input oracle that evaluates a sizing field over the domain [4, 8, 23, 27, 32]. An early exception is the approach of Dey et al. [12] that uses Delaunay refinement for meshing smooth domains. Using the dual Voronoi diagram and the concept of poles [2], this algorithm automatically refines based on a simultaneously computed approximation of the local feature size (distance to the medial axis) of the shape whose accuracy increases as mesh density increases. Local feature size of smooth shapes is a natural choice to use as a field to adapt to; however, most CAD models are inherently non-smooth. A notion of local feature size for piecewise-smooth shapes has been defined [8] by coupling local feature size for the smooth regions with a topological condition called gap size [9]. Computing this measure robustly is a significant challenge. The approach in this work aims to automatically infer a global sizing field of equivalent expressivity to [8] while using only locally available information as done by [12]. Such a technique must force a compromise, ours is to construct a proxy for feature size that is Lipschitz continuous by coupling curvature adaptivity with a topological separation condition. Particle systems are an ideal framework for sampling parametric domains since they only require local calculations. We can minimize energy by movements solely within the parameter space of each surface patch while knowing each particle stays within the confines of the surface in world space. Computing good quality triangulations from these samples can leverage the same benefits. We directly build triangulations on the particles in parameter space using 2D Delaunay triangulations (implemented by Triangle [28]). As 3D Delaunay triangulations can be expensive to compute, this provides a significant savings when only surface meshes are required. While this approach cannot immediately build triangles that are 3D Delaunay, we can improve their quality significantly by local modifications (e.g. edge flipping) that consider the world space positions of vertices. The resulting surfaces meshes make ideal inputs for volumetric meshing approaches, such as TetGen [30]. 1.1
Contributions
This work focuses on automatic techniques for building triangular meshes of the boundary surface, and ultimately tetrahedral representations of the interior solid. We also improve the state-of-the-art for particle system-based techniques; our contributions can be summarized as the following:
Particle Systems for Adaptive, Isotropic Meshing of CAD Models
• • • • •
281
An automatic technique for constructing isotropic surface meshes by minimizing a world-space energy through parameter-space movements. Hierarchical sampling of features in increasing dimension, inspired by weighted Delaunay-based approaches [8, 11]. Algorithmic control for both uniform and adaptive sampling, without requiring a pre-computation of global feature size needed by similar particlebased approaches [23]. Fast mesh generation of these samples through the use of the 2D Delaunay triangulation in parameter space and 3D Delaunay edge flipping [6]. Experimental evaluation that compares our approach to existing techniques [7, 15] for mesh generation of CAD domains.
2 Related Work and Background While the history of tetrahedral mesh generation began much earlier, a shift in the emphasis of techniques has become popular within the past decade. In particular, variational approaches, i.e. based on energy minimization, have become one of the most important tools for mesh generation. Alliez et al. [1] describe a variational technique for mesh generation that couples Delaunay refinement with a relaxation process for vertex locations. This algorithm and later variants [31, 32, 34, 37] base their energy minimization on a sizing field for particle density coupled with an energy minimization grounded in the notion of a centroidal Voronoi diagram [14] and its dual, the optimal Delaunay triangulation [5]. Consequently, these meshing algorithms can generate nearly isotropic elements, as a byproduct of the centroidal Voronoi condition, as well as leveraging many of the benefits of Delaunay refinement techniques. However, one deficiency is the need for knowledge of an element sizing field a priori. Computing a sizing field is considered expensive. Often, approaches for computing sizing fields are based on the medial axis [13] or quadratures of mesh elements [3], and thus can require O(n2 ) computations of dense point clouds to build accurate results. One recent solution of Tournois et al. [32] solves this problem by alternating a variational phase with a refinement phase. After each level of refinement, the sizing function is updated before switching back to variational phase. This interleaving allows the available information to drive the computation of a sizing field instead of necessitating a preprocessed computation. We aim to improve upon this theme by allowing an energy minimization based on particle systems to automatically improve its approximation of the sizing field. A second thrust of recent algorithms is to provide provably algorithms for meshing piecewise-smooth shapes. This general class describes shapes with a topological description in the form of a piecewise-smooth complex of kcells that are compact subsets of k-manifolds. We use the same definition as Cheng et al. [8]. In summary, surface patches (2-cells) can meet non-smoothly at curves (1-cells) bounded by points (0-cells). Two k-cells are adjacent if one is on the boundary of the other.
282
J.R. Bronson, J.A. Levine, and R.T. Whitaker
Similar to the B-Rep definition, each k-cell has an associated geometric description. Recent Delauany-based approaches [8, 24] for meshing this domain have been able to provide topological correctness guarantees using either weighted Delaunay triangulations [8] or bounding the angle deviations between smooth patches [24]. A missing piece to the implementations of these algorithms is the ability to adapt to a sizing field, primarily because there is no consensus on what is the correct sizing field for non-smooth shapes and how best to compute it. However, they do show that a careful sampling of points on sharp creases can preserve the features of a shape. Our approach is a natural extension of this work, but instead of requiring an accurate sizing field to guarantee topological correctness, our scheme will build watertight meshes provided a few easily satisfied conditions are met by the particle system (described in Section 4.3). 2.1
Particle Systems
At the core of our meshing scheme is a paradigm for sampling shapes using particles. The idea of using repulsive point clouds to (re-)sample a mesh was first introduced by Turk in the context of polygonal remeshing [33]. The first full particle system for meshing was later developed by Witkin and Heckbert [35]. Their technique was primarily used as a mechanism to sample and control implicit surfaces, which was notoriously difficult under other schemes at the time. The key idea behind their work was the introduction of a Gaussian energy function to control the interaction between particles. Improvements to their scheme were made by Hart et al. [17]. Yamakawa and Shimada proposed a meshing scheme similar to particles by using packings of ellipsoidal bubbles [36]. Meyer et al. [21] formulated a more robust and stable solution for evolving particle systems. The new energy kernel was a modified cotangent function, with finite support. By falling off to a finite range, the resulting particle systems were more stable and more quickly lead to ideal packings. Additionally, this kernel was nearly scale invariant. Meyer et al. [23] later introduced a hierarchical scheme for particle-based sampling multi-material surfaces. For such datasets, the boundaries between the different materials can be represented as a piecewise-smooth complex. While without the formal guarantees of [8], they use a similar strategy of hierarchically sampling topologically features in increasing dimension to build consistent, watertight meshes.
3 Particle System Formulation In this section we provide the mathematical formulation behind our particle system. We define the total energy in the system as the sum of each energy Ei calculated with respect to particle pi . Each particle pi has a corresponding σi value representing the radius of its ball of influence Bi centered at pi . It is the varying of σi that provides adaptivity. Each energy Ei is the sum of the
Particle Systems for Adaptive, Isotropic Meshing of CAD Models
283
energies between particle pi and all neighboring particles pj . Particles pi and pj are considered neighbors if either pj falls within Bi or if pi falls within Bj . We use a variation of the modified cotangent for the energy (1) between any two particles, Eij . By varying σi , the potential function must be scaled to account for this new lopsided interaction between particles. Thus, we scale both the modified cotangent function and its derivative (2) by σi . Eij = σij cot(
|rij | π |rij | π π )+ − σij 2 σij 2 2
dEij π |rij | π = 1 − sin−2 rij 2 σij 2
(1)
(2)
In this form, |rij | is the distance between particles pi and pj and the value σij is taken to be the max of σi and σj . The hexagonal packings that result from this and related particle systems requires the particles to reach a critical density on the surface being sampled. For any surface and any set of σ values, there will always be an ideal number of particles, but calculating this number is not tractable. Like previous systems, we use splitting and deleting to control energy densities. Particles follow the rules: Ei∗ = Ei (1 + ) if if
Ei∗ Ei∗
< 0.35Eiideal > 1.75Eiideal
Split Delete
(3) (4) (5)
Using a hexagonal packing as our notion of an ideal distribution, the ideal energy Eiideal for a particle pi is six times the energy felt between pi and pj at the characteristic distance of approximately 0.58 [21]. Given that a tworing particle pj is at distance 1.0, Equation (6) describes this relationship. Additionally, we scale this value by σi to match the scaling of actual energies. Eiideal = σi 6E(β), with
|rij | 0.5 =β= ≈ 0.58 σij cos(π/6)
(6)
Since one cannot predict what an ideal neighborhood will look like in the adaptive case, the ideal energy is less precise than in the constant case. This leads to more frequent splits and deletes for higher local variation, but ultimately provides much better packings than if the original energy was not scaled proportional to σ. An alternative to this approach would be to use a notion of scaled distance d = σd , and forego the σi scaling. Then, to still achieve the high quality packings, a different scheme for deletion of poorly configured particles would need to be devised. To allow the system to adapt to splits and deletes, Ei is biased by a small random number, 0 ≤ ≤ 1, in Equation (3). This makes the discrete energy jumps have less of an impact on the speed at which the system stabilizes, by allowing time for the system to adapt between jumps. Additionally, this
284
J.R. Bronson, J.A. Levine, and R.T. Whitaker
can help resolve any regions which are stuck in bad configurations. As the solution to the system converges, this bias can be adjusted to stop splits and deletes all together, ensuring termination. To find the ideal packing of particles, we use a Newton-Raphson scheme, updating particle information after each movement (Equations (7), (8), and (9)). Each particle maintains its position in both worldspace (xxyz ) and pai rameter space (xuv ). Particles move with a velocity v generated by interi i particle forces between neighbors. Though the energies between particles are computed in 3D world space, particles move strictly in parametric space (9), avoiding the error-prone projection onto the surface that results from 3D movements. Taking these steps in parametric space only requires a change of coordinates, using the inverse Jacobian, J −1 . rij vxyz = dEij · (7) i |rij | vuv i xuv i
= =
j∈N vxyz · J −1 i uv xuv i + vi
(8) (9)
As mentioned earlier, we use a hierarchical sampling scheme, which works well for parametric models. First, we place particles on the 0-cells, the intersection of edges on the models. Next, particles are placed on the 1-cells and are optimized. Finally, particles are placed on the surface patch interiors and the final optimization proceeds. At each phase, the new optimization uses the fixed positions from the previous phase, ensuring consistency across surface patch boundaries. 3.1
Inferred Sizing Field
We recognize that there are several factors that often determine good sizing fields: local curvature, some notion of feature size, and a desired level of adaptivity. Additionally, users may have desires for mesh resolution limits, both minimum and maximum triangle or edge size. Other domain-specific factors also often come into play. In this section, we illustrate the constraints we would like to place on a sizing field. We show that these constraints can be inferred in a reliable way and used to form a smooth sizing field during energy minimization. We aim for meshes that provide arbitrary levels of geometric accuracy and adaptivity, using high quality isotropic elements. In order to provide high quality elements, particle systems require enough spatial freedom to be able to move to lower energy states. Thus, the distance between nearby k-cells imposes its own sizing constraint on the particles. Thus, in order to determine the sizing field value σi at a particular point pi on a model, we must consider the constraints placed on this location by curvature, topological distance, and desired level of adaptive continuity. We refer to these constraints as σκ , στ , and σL , respectively. The actual sizing field value at a particle location is
Particle Systems for Adaptive, Isotropic Meshing of CAD Models
285
resolved by finding the σi that respects all constraints. This can be expressed compactly as: σi = max {σmin , min {σmax , σκ , στ , σL }}
(10)
Curvature Since the curvature at a point is defined as the inverse of the radius of the osculating circle at that point, a reasonable default sizing field value is the radius of that circle itself. Thus, we use σκ = κ1 , which can be easily computable for parametric surfaces, or queried by middleware packages. To increase or decrease the field relative to this radius, a scaling factor sκ is exposed as a user parameter. Given a unit system, this value can be used to provide constraints to re spect geometry to arbitrary levels of accuracy. Finally, κmin and κmax values are user parameters used to handle straight edges and arbitrar ily high curvature, respectively. These form the total bounds for the sizing field as: σmin = 1/ (sκ κmax )
(11)
σmax = 1/ (sκ κmin )
(12)
Fig. 1. Default curvature constraint on sizing field
For 2-cells, we use the maximum principal curvature, since this size will dominate an isotropic sampling. For 1-cells, using the curvature of the edge itself is insufficient. The maximum principal curvature on both intersecting surfaces must also be considered, since the curve may either be a trim or a boundary curve, and there is no way of knowing which curvature will dominate. Last, 0-cells use the maximum curvature of all 1-cells terminating at its point. Gap Size If available, using the distance to the model’s medial axis would provide a sizing field constraint that generates good samplings in a particle system. However, computing the medial axis on parametric models is a difficult task and still an active area of research. Instead, we use the notion of gap size, introduced by Chang & Poon [9] in the context of piecewise linear mesh generation. For a point p on a k-cell c, its gap size is the distance to the nearest non-adjacent (i.e. not on the boundary of c) cell. This measure also preserves topological features inherent to the model’s decomposition into parametric patches. Depending on the model and the way it was created, this measure may sometimes be equivalent to definitions of local feature size. Figure 2 shows an example where the two are equivalent by a factor of one half. We make the assumption that the topological representation provided as input for the CAD model should be respected in an output mesh. A byproduct of this approach is that some models have adaptivity in regions that
286
J.R. Bronson, J.A. Levine, and R.T. Whitaker
are of little benefit to representing the geometry of the model. One could remove adaptivity in regions that do not actually need it by taking a pass over the model and detecting topological junctions that are G1 continuous, and flagging them to be ignored. The remaining geometrically discontinuous junctions could then be preserved using our sampling scheme. Gap size is approximated directly from inter-particle relationships. Particles store which k-cell they lie on, and each k-cell stores which particles lie on it. We define the topological constraint στ to be the shortest distance from particle pi to another particle pj lying on a non-adjacent feature. That is, a 0cell particle interacting with another 0cell particle, a 1-cell particle interacting Fig. 2. Gap size constraint on siz- with another 1-cell particle, or a 0-cell ing field. In this case, the gap size is particle interacting with a 1-cell particle equivalent to the distance to the me- that does not terminate at that 0-cell. dial axis by a factor of two. This notion can be extended to 2-cells as well. We further provide a scaling factor sτ as a user parameter to allow for higher densities of particles within these regions. This proves useful when sampling highly elongated surfaces, with parallel k-cells. Scaling the distance στ allows more rows of particles, allowing for better energy minimization, and ultimately better triangulations. Lipschitz Continuity In order to provide finer control over the adaptivity of the particle samples, the system adheres to a Lipschitz constraint σL that enforces the Lipschitz continuity L on the sizing field. The Lipschitz condition can be expressed in terms of our formulation as: |xi − xj | ≤ L |σi − σj |
(13)
The σL induced by this constraint is simply the minimum allowable value that satisfies this condition: σL = min {|rij | L + σj } j∈N
(14)
Respecting this Lipschitz continuity provides more gradual adaptivity between areas of high and low particle densities. Lower values of L produce samplings that result in more isotropic triangles, while large values provide increased levels of adaptivity, at the cost of isotropy. In the limit when L goes to zero, a uniform sizing field is produced, fitting the smallest constraint on the model. We found a default value of 0.3 provides a good trade-off between triangle quality and adaptivity.
Particle Systems for Adaptive, Isotropic Meshing of CAD Models
287
It is worth noting that the Lipschitz continuity is not satisfiable for arbitrary surfaces. Since we place samples hierarchically, it is possible the sizing field may need to adapt more quickly on the interior of the surface than it does on the edges. In these situations, the Lipschitz constraint needs to be relaxed to allow the sizing field to adjust.
4 Algorithm Our implementation takes as input a parametric model and outputs a triangular mesh. We use the middleware package CAPRI [16] to provide us direct geometry access to shapes generated by CAD software. It also gives access to the topology of the model, including access to the 0-cells, 1-cells, and 2-cells, and their boundary adjacencies. In this section, we elaborate only on the parts of the update algorithm that are independent from the middleware. 4.1
Particle Optimization
The sampling algorithm consists of three phases: Phase 1 optimizes 0-cell and 1-cell samples based strictly on the curvature and the Lipschitz constraints, σκ and σL . Phase 2 continues the 0-cell/1-cell optimization, but includes the topological constraint στ . Finally, Phase 3 optimizes samples with surface patches. A phase is considered complete when the change from one iteration to the next drops below some threshold. We initialize Phase 1 by placing one particle on each 0-cell, and one particle on the midpoint of each 1-cell. Along the 1-cells, splitting happens to increase particle density as the sizing field is inferred. Similarly, if user parameters make any 1-cell particle unnecessary, it will be deleted. Phase 3 is initialized by placing k random samples in the parameter domain of the surface. Each iteration of the optimization, a particle updates both its position as well as its sizing field value σi . A scaling factor λi is used to increase stability. Pseudocode for the updates of particle positions is shown in Algorithm 1. 4.2
Corner Cases
The motivation for splitting the optimization of 0-cells and 1-cells into two phases is illustrated in Figure 3. When it comes to enforcing the topological condition, just as feature size goes to zero in discontinuous corners, so does our notion of topological feature size. Left unchecked, particles in corners would continually shrink their στ , split and move in closer to the corner. To curtail this response, we detect and label corners in the first phase. Figure 3(a) shows what one corner might look like after Phase 1 has completed. Notice only the curvature and Lipschitz constraints have been met. The σi value of the particle on the 0-cell is saved as the size of the 0-cell’s corner ball. This is similar to the protecting ball idea in Delaunay meshing [9]. Figure 3(b)
288
J.R. Bronson, J.A. Levine, and R.T. Whitaker
Algorithm 1. Position Update 1: for all particles do 2: Compute energies Ei , dEi (Equations 1,2) 3: Compute velocity vxyz (Equation 7) i 4: Transform to parameter space, obtain vi∗ (Equation 8) 5: Compute scaling vi∗new = λi vi∗ 6: Compute new particle position unew (Equation 9) i 7: Transform to world space xnew i 8: Compute the new energy value, Einew 9: if Einew >= Ei then 10: if λi <= λmin then 11: skip to next particle on list 12: end if 13: decrease λi by a factor of 10 and go back to Step 3. 14: end if 15: end for
shows the same corner have Phase 2 has completed. The topological constraint is satisfied for all particles that lie outside of the corner ball. The particles inside adapt smoothly and guarantee the sampling terminates. An alternative approach would be to fix the position of particles laying on this corner ball boundary. The downside to such an approach is that it could easily violate the Lipschitz constraint. With corner cases considered as part of the σi constraint, the pseudocode for the sigma update is shown in Algorithm 2.
(a)
(b)
Fig. 3. (a) Phase 1, respecting only curvature and Lipschitz constraints. (b) Phase 2, additionally respecting topology constraints outside the corner ball.
4.3
Triangulation in Parameter Space
Our formulation builds a distribution of samples in 3D. To construct a mesh from these samples, one alternative would be to directly build a 3D Delaunay triangulation of the point cloud. Through pruning and filtration one could construct the surface triangulation and interior tetrahedralization. However, because of the parametric nature of the system, we can instead construct triangulations for each 2-cell and its boundary in the parameter space. This
Particle Systems for Adaptive, Isotropic Meshing of CAD Models
289
Algorithm 2. Sigma Update 1: for all particles do 2: if pi ∈ 1-cell then 3: for all pj ∈ N do 4: if edge(pi ) = edge(pj ) and not in corner then 5: Update topology constraint στ = min {στ , |xi − xj |} 6: end if 7: Update Lipschitz constraint σL = min {σL , |rij | L + σj } 8: end for 9: end if 10: Satisfy Eq. 10: σi = max {σmin , min {σmax , sκ σκ , sτ στ , σL }} 11: end for
dimensional reduction gains us speed in terms of building the triangulation. However, particles distributed well in 3D may be in poor configurations in their corresponding parameter space, we account for this using local modifications after constructing an initial triangulation. Since the parameter space set of samples may be highly distorted, we first perform an affine scaling to regularize the 2-cell as much as possible. We obtain this transform by solving the least squares solution to the transform that best preserves Euclidean distances. This constraint can be expressed as: A |ui − uj | = |rij |
(15)
Next, for each 2-cell we construct the 2D Delaunay triangulation of its particle samples as well as the samples on its boundary curves using Triangle [28]. This triangulation has two problems which we address. (1) This triangulation includes extra triangles (within the convex hull) that may in fact be trimmed portions of the uv-space. (2) The quality of the triangles lifted back in 3D may be poor. Our hierarchical sampling scheme is devised in part to correct for the first concern. The samples of the 1-cells create a dense sample of each curve, in both spaces. Moreover, the particle energies on these samples repel particles within neighboring 2-cells away. As a result, these samples act in a role similar to a weighted sample used in recent Delaunay refinement schemes [8]. If each curve is sampled dense enough so that in the 2D triangulation each pair of adjacent 1-cell particles has a Delaunay edge, then we can recover the 1-cell. While an explicit proof is out of the scope of this work, we note that our experimentation indicates we can handle arbitrarily sharp edges, without the need for a weighted Delaunay. If we were using a full 3D Delaunay triangulation without weights, we would suffer from angle limitations, as noted by [24]. Having the 1-cells recovered as a sequence of edges in the 2D Delaunay triangulation is sufficient to prune away triangles that are exterior to trims. Once we have pruned these triangles, the remaining triangles are lifted to form the surface triangles of the 2-cell in 3D. However, because of the
290
J.R. Bronson, J.A. Levine, and R.T. Whitaker
distortion of the 2-cells parameterization, they may be of poor surface quality. A recent result of Cheng and Dey [6] discusses a scheme to use edge flipping to recover Delaunay surface triangulations. A Gabriel property is enforced for each triangle, requiring that each triangle’s diametric ball is empty (a stronger version of the Delaunay property). We use a similar scheme, for each edge, we check if two triangles that share that edge have diametric balls that do not contain the opposite, unshared vertex. If they do not, we flip. The recent theoretical result of Cheng and Dey showed this property would only work for -dense surface triangulations; however, we found our point sets to be flippable in nearly all cases. A few rare edges could flip indefinitely. To break these ties, we selected the triangle pair that maximize the minimum circumradius (similar to the Delaunay property). 4.4
Tetrahedralization
The resultant triangulations are not true 3D Delaunay as we do not ensure that each triangle has a circumball empty of all other points. However, we found they still had two desirable properties. First, nearly all triangles had excellent aspect ratio (shown in the experimental results). Second, these meshes were quite suitable for a constrained Delaunay triangulation that preserves each triangle. We use TetGen [30] to generate high quality tetrahedralizations of these surface meshes.
5 Evaluation We break the evaluation of this meshing technique into two parts. First, we compare it with two other popular triangular meshing techniques for this domain. Then, we evaluate the technique for its own sake, including: strengths, weaknesses, and convergence properties. 5.1
Method Comparison
We compare our particle system technique (PSYS) to DelPSC [7] and CAPRI’s meshing algorithm [15]. We chose these methods because they were both readily available, and actively used in practice. We evaluate the three methods using surface triangle aspect ratio and volume tetrahedra aspect ratio. To provide a fair test environment, we hand tuned the parameters of each algorithm to generate surface meshes of approximately the same number of vertices. PSYS uses default settings of sκ = 2, sτ = 0.5, and L = 0.3 for all input models. Figure 6 shows the output volume meshes of PSYS while Figure 4 shows a comparison of the surface meshes for each of the three algorithms. In the insets in Figure 4 we show close up views of mesh to highlight how PSYS’s adaptivity can build superior geometric approximations using the same number vertices. While the shape of elements is good for all meshes, PSYS can be
Particle Systems for Adaptive, Isotropic Meshing of CAD Models
291
Fig. 4. Various models meshed. From top to bottom we show the Block, Disk, Hanoi, Screw, Table, and WingNut meshes for PSYS. Insets show comparison between CAPRI, DelPSC, and PSYS. For some inputs (such as the Block and WingNut) DelPSC approximated smooth regions without sampling topological curves.
especially isostropic triangles. Even in areas of high variability for curvature, PSYS was able to adapt especially well without sacrificing element quality. To investigate this aspect further, we report the geometric quality of elements on both the surface triangulation as well as the volume tetrahedra. We use the aspect ratio (circumradius to shortest edge length ratio) as a criteria
292
J.R. Bronson, J.A. Levine, and R.T. Whitaker DelPSC
PSYS
CAPRI Tetrahedra Aspect Ratio
Triangle Aspect Ratio
CAPRI 4 3 2 1.5 1 0.8 0.6 Block
Disk
Hanoi Screw Table WingNut
(a)
DelPSC
PSYS
6 4 3 2 1.5 1 0.8 0.6 Block
Disk
Hanoi Screw Table WingNut
(b)
Fig. 5. Box plots of the aspect ratios (circumradius/shortest edge length) on a log scale. We show for triangles (a) and tetrahedra (b) of each output mesh of each algorithm. These plots show the minimum, 25th percentile, median, 75th percentile, and maximum aspect ratio over all elements in each mesh.
for mesh element quality. Figure 5 shows plots of both mesh quality statistics for the mesh of each model using each algorithm. For triangle quality, in Figure 5(a), it is interesting to note that PSYS did exceptionally well in the median case. DelPSC has a user parameter to bound triangle quality, the conservative theoretical bounds to guarantee termination require it to be set near 1.0. In addition, DelPSC does improve element quality near sharp features. As a result, it outperforms CAPRI’s surface meshing scheme (which has no refinement parameters for triangle quality), but its median behavior is slightly worse than PSYS. For volume meshing, the algorithms all behave quite similarly in the median case as shown by Figure 5(b). Since TetGen is used for two of the algorithms, this is not an unexpected result. The full 3D Delaunay refinement used by DelPSC also achieves results on par with the other algorithms. We remark that setting na¨ıve parameters to CAPRI’s meshing algorithm would build surfaces meshes not suitable to TetGen. Since CAPRI provides no direct control over the quality of surface triangles, if their angles are too sharp TetGen’s refinement could require an impossible number of insertions. We found that PSYS’s good quality triangles always lead to suitable inputs for TetGen. 5.2
Evaluating PSYS
For most models, we are able to obtain good distributions in only a few hundred iterations total. The convergence rates for the particle system to find optimal distributions are based primarily on the number of particles needed and the level of adaptivity. Thus, most iterations take place in Phase 3 of the algorithm. It should be clear why more samples require more iterations, as information has a longer path to travel before reaching equilibrium. How adaptivity comes into play is more subtle. We enforce the Lipschitz condition
Particle Systems for Adaptive, Isotropic Meshing of CAD Models
293
Fig. 6. From left to right, top to bottom: the output volume meshes of PSYS for the Block, Disk, Hanoi, Screw, Table, and Wingnut models
at every iteration, which means boundary values pull down local σ values very quickly. This change propagates outward to areas that can otherwise tolerate a larger σ. This means surfaces may become oversampled prior to fitting the Lipschitz continuous field. As the field values increase, so do energies, and particles begin to delete to make room for particles of larger σ values. Relaxing the Lipschitz condition towards the beginning of the energy minimization could provide improved converge rates. Additionally, relaxing the energy requirements for insertion and deletion can improve convergence rates, but at the cost of less ideal packings.
294
J.R. Bronson, J.A. Levine, and R.T. Whitaker
6 Conclusions and Future Work The high quality results generated from our algorithm illustrate how wellsuited such particle systems are for sampling parametric domains. Compared to the other methods we evaluated, our system was able to generate better quality triangle meshes with the added benefit of adaptively sized elements. Moreover, the sizing field we adapt to can be inferred directly from the point samples, removing the need for model preprocessing. The success of this technique indicates that there are many unexplored avenues to take with respect to particle meshing. The approach in this paper is centered around generating quality isotropic surface meshes, which happen to be good inputs to a constrained 3D Delaunay solution. However, optimizing a particle system directly in 3D space from the start may allow for high-quality, isotropic tetrahedral meshes similar to other variational techniques [1]. An interesting direction would be to infer the tetrahedralization without requiring computing a 3D Delaunay triangulation. Another avenue we believe could prove fruitful is the introduction of anisotropic kernels to the energy formulation. Doing so could provide an easy and powerful method for generating anisotropic surface and volume meshes. Coupled with adaptivity, these meshes could provide ideal inputs to simulations across many application areas. The work in this paper was motivated by quality, and our implementation is not optimized for speed. There have been various acceleration strategies for other particle systems that can greatly reduce the running times. Recent work in GPU algorithms have also showed that n-body systems can achieve massive performance gains over what would otherwise be an O(n2 ) algorithm.
Acknowledgements This work was supported by the National Institute of Health grant 2-P41RR12553-08, and National Science Foundation grant CCF-073222. We would also like to thank Bob Haimes for the valuable discussions on CAD modeling and mesh generation.
References 1. Alliez, P., Cohen-Steiner, D., Yvinec, M., Desbrun, M.: Variational tetrahedral meshing. ACM Trans. Graph. 24(3), 617–625 (2005) 2. Amenta, N., Bern, M.W.: Surface reconstruction by Voronoi filtering. Discrete & Computational Geometry 22(4), 481–504 (1999) 3. Antani, L., Delage, C., Alliez, P.: Mesh sizing with additively weighted Voronoi diagrams. In: 16th IMR, pp. 335–346 (2007) 4. Boissonnat, J.-D., Oudot, S.: Provably good sampling and meshing of surfaces. Graphical Models 67(5), 405–451 (2005)
Particle Systems for Adaptive, Isotropic Meshing of CAD Models
295
5. Chen, L.: Mesh smoothing schemes based on optimal Delaunay triangulations. In: 13th IMR, pp. 109–120 (2004) 6. Cheng, S.-W., Dey, T.K.: Maintaining deforming surface meshes. In: 19th Symp. on Discrete Algorithms, pp. 112–121 (2008) 7. Cheng, S.-W., Dey, T.K., Levine, J.A.: A practical Delaunay meshing algorithm for a large class of domains. In: 16th IMR, pp. 477–494 (2007) 8. Cheng, S.-W., Dey, T.K., Ramos, E.A.: Delaunay refinement for piecewise smooth complexes. Discrete & Computational Geometry 43(1), 121–166 (2010) 9. Cheng, S.-W., Poon, S.-H.: Three-dimensional Delaunay mesh generation. Discrete & Computational Geometry 36(3), 419–456 (2006) 10. Chew, L.P.: Guaranteed-quality triangular meshes. Technical Report TR-89983, Comp. Science Dept., Cornell University (1989) 11. Dey, T.K., Levine, J.A.: Delaunay meshing of piecewise smooth complexes without expensive predicates. Algorithms 2(4), 1327–1349 (2009) 12. Dey, T.K., Li, G., Ray, T.: Polygonal surface remeshing with Delaunay refinement. In: 14th IMR, pp. 343–361 (2005) 13. Dey, T.K., Sun, J.: Normal and feature approximations from noisy point clouds. In: Found. of Soft. Tech. and Theor. Comp. Sci., pp. 21–32 (2006) 14. Du, Q., Wang, D.: Tetrahedral mesh generation and optimization based on centroidal Voronoi tessellations. Intl. J. Numerical Methods in Engr. 56(9), 1355–1373 (2003) 15. Haimes, R., Aftosmis, M.J.: On generating high quality watertight triangulations directly from CAD. In: Intl. Soc. for Grid Gen. (2002) 16. Haimes, R., Follen, G.J.: Computational analysis programming interface. In: 6th Intl. Conf. Num. Grid Gen. in Comp. Field Sim., pp. 663–672 (1998) 17. Hart, J.C., Bachta, E., Jarosz, W., Fleury, T.: Using particles to sample and control more complex implicit surfaces. In: SIGGRAPH 2005 Courses, New York, NY, USA, p. 269 (2005) 18. Jones, W.T.: Toward a global parameterization for quilted CAD entities. In: 42nd AIAA Aerospace Sciences Meeting and Exhibit, AIAA Paper 2004-0611 (January 2004) 19. Karkanis, T., Stewart, A.J.: Curvature-dependent triangulation of implicit surfaces. IEEE Computer Graphics and Applications 21(2), 60–69 (2001) 20. Lohner, R.: Surface gridding from discrete data. In: 4th IMR, pp. 29–44 (1995) 21. Meyer, M.D.: Dynamic particles for adaptive sampling of implicit surfaces. PhD thesis, Salt Lake City, UT, USA (2008) 22. Meyer, M.D., Kirby, R.M., Whitaker, R.T.: Topology, accuracy, and quality of isosurface meshes using dynamic particles. IEEE Trans. Vis. Comput. Graph. 13(6), 1704–1711 (2007) 23. Meyer, M.D., Whitaker, R.T., Kirby, R.M., Ledergerber, C., Pfister, H.: Particle-based sampling and meshing of surfaces in multimaterial volumes. IEEE Trans. Vis. Comput. Graph. 14(6), 1539–1546 (2008) 24. Rineau, L., Yvinec, M.: Meshing 3d domains bounded by piecewise smooth surfaces. In: 16th IMR, pp. 443–460 (2007) 25. Ruppert, J.: A Delaunay refinement algorithm for quality 2-dimensional mesh generation. J. Algorithms 18(3), 548–585 (1995) 26. Scheidegger, C.E., Fleishman, S., Silva, C.T.: Triangulating point set surfaces with bounded error. In: Symp. on Geom. Proc., pp. 63–72 (2005) 27. Schreiner, J.M., Scheidegger, C.E., Fleishman, S., Silva, C.T.: Direct (re)meshing for efficient surface processing. Comput. Graph. Forum 25(3), 527–536 (2006)
296
J.R. Bronson, J.A. Levine, and R.T. Whitaker
28. Shewchuk, J.R.: Triangle: Engineering a 2D quality mesh generator and Delaunay triangulator. In: Lin, M.C., Manocha, D. (eds.) FCRC-WS 1996 and WACG 1996. LNCS, vol. 1148, pp. 203–222. Springer, Heidelberg (1996) 29. Shewchuk, J.R.: Tetrahedral mesh generation by Delaunay refinement. In: 14th Symp. on Comp. Geom., pp. 86–95 (1998) 30. Si, H., G¨ artner, K.: Meshing piecewise linear complexes by constrained Delaunay tetrahedralizations. In: 14th IMR, pp. 147–163 (2005) 31. Tournois, J., Alliez, P., Devillers, O.: Interleaving Delaunay refinement and optimization for 2d triangle mesh generation. In: 16th IMR, pp. 83–101 (2007) 32. Tournois, J., Wormser, C., Alliez, P., Desbrun, M.: Interleaving Delaunay refinement and optimization for practical isotropic tetrahedron mesh generation. ACM Trans. Graph. 28(3) (2009) 33. Turk, G.: Re-tiling polygonal surfaces. In: SIGGRAPH 1992, pp. 55–64 (1992) 34. Valette, S., Chassery, J.-M., Prost, R.: Generic remeshing of 3d triangular meshes with metric-dependent discrete Voronoi diagrams. IEEE Trans. Vis. Comput. Graph. 14(2), 369–381 (2008) 35. Witkin, A.P., Heckbert, P.S.: Using particles to sample and control implicit surfaces. In: SIGGRAPH 1994, pp. 269–277 (1994) 36. Yamakawa, S., Shimada, K.: High quality anisotropic tetrahedral mesh generation via ellipsoidal bubble packing. In: 9th IMR, pp. 263–274 (2000) 37. Yan, D.-M., L´evy, B., Liu, Y., Sun, F., Wang, W.: Isotropic remeshing with fast and exact computation of restricted Voronoi diagram. Comput. Graph. Forum 28(5), 1445–1454 (2009)
A Study on Using Hierarchical Basis Error Estimates in Anisotropic Mesh Adaptation for the Finite Element Method Lennard Kamenski Department of Mathematics, The University of Kansas [email protected]
Summary. A common approach for generating an anisotropic mesh is the M -uniform mesh approach where an adaptive mesh is generated as a uniform one in the metric specified by a given tensor M . A key component is the determination of an appropriate metric which is often based on some type of Hessian recovery. This study discusses the use of a hierarchical basis error estimator for the development of an anisotropic metric tensor needed for the adaptive finite element solution. A global hierarchical basis error estimator is employed to obtain reliable directional information. Numerical results for a selection of different applications show that the method performs comparable with existing metric tensors based on Hessian recovery and can provide even better adaptation to the solution if applied to problems with gradient jumps and steep boundary layers. Keywords: mesh adaptation, anisotropic mesh, finite element, a posteriori estimate, hierarchical basis, variational problem, anisotropic diffusion
1 Introduction A common approach for generating an anisotropic mesh is the M -uniform mesh approach based on generation of a quasi-uniform mesh in the metric space defined by a symmetric and strictly positive definite metric tensor M . A scalar metric tensor will lead to an isotropic mesh while a full metric tensor will generally result in an anisotropic mesh. In this sense, the mesh generation procedure is the same for both isotropic and anisotropic mesh generation. A key component of the approach is the determination of an appropriate metric often based on some type of error estimates. Typically, the appropriate metric tensor depends on the Hessian of the exact solution of the underlying problem, which is often unavailable in practical computation, thus requiring the recovery of an approximate Hessian from the computed solution. A number of recovery techniques are used for this purpose, for example the gradient recovery technique by Zienkiewicz and Zhu
298
L. Kamenski
[34, 35], the technique based on the variational formulation by Dolejˇs´ı [17], or the quadratic least squares fitting (QLS) proposed by Zhang and Naga [33]. Generally speaking, Hessian recovery methods work well when exact nodal function values are provided (e.g. interpolation problems), but unfortunately they do not provide an accurate recovery when applied to linear finite element approximations on non-uniform meshes, as pointed out by the author in [28]. Recently, conditions for asymptotically exact gradient and convergent Hessian recovery from a hierarchical basis error estimator have been given by Ovall [31]. His result is based on superconvergence results by Bank and Xu [7, 8], which require the mesh to be uniform or almost uniform: assumptions which are usually violated by adaptive meshes. Hence, a convergence of adaptive algorithms based explicitly on the Hessian recovery cannot be proved in a direct way, even if their application is quite successful in practical computations [17, 26, 29]. This explains the recent interest in anisotropic adaptation strategies based on some type of a posteriori error estimates. For example, Cao et al. [12] studied two a posteriori error estimation strategies for computing scalar monitor functions for use in adaptive mesh movement; Apel et al. [5] investigated a number of a posteriori strategies for computing error gradients used for directional refinement; and Agouzal et al. [1, 2, 3] and Agouzal and Vassilevski [4] proposed a new method for computing metric tensors to minimize the interpolation error provided that an edge-based error estimate is given. Recently, Huang et al. [24] presented a mesh adaptation method based on hierarchical basis error estimates (HBEE). The new framework is developed for the linear finite element solution of a boundary value problem of a secondorder elliptic partial differential equation (PDE), but it is quite general and can easily be adopted to other problems. A key idea in the new approach is the use of the globally defined HBEE for the reliable directional information: globally defined error estimators have the advantage that they contain more directional information of the solution; error estimation based on solving local error problems, despite its success in isotropic mesh adaptation, do not contain enough directional information, which is global in nature; moreover, Dobrowolski et al. [16] have pointed out that local error estimates can be inaccurate on anisotropic meshes. The objective of this article is to study the application of this new anisotropic adaptation method to different problems. A brief description of the method is provided in Sect. 2. An example of its application to a boundary value problem of a second-order elliptic PDE is given in Sect. 3 for heat conduction in a thermal battery with large and orthotropic jumps in the material coefficients.1 Section 4 presents an anisotropic metric tensor for general variational problems developed by Huang et al. [25] using the HBEE and the underlying variational formulation and gives a numerical example for a nonquadratic variational problem. The metric tensor is completely a posteriori: 1
A Sandia National Laboratories benchmark problem.
Using Hierarchical Error Estimates for Anisotropic Mesh Adaptation
299
it is based solely on the residual, edge jumps, and the a posteriori error estimate. The third example is an anisotropic diffusion problem. The exact solution of this problem satisfies the maximum principle and it is desirable for the numerical solution to fulfill its discrete counterpart: the discrete maximum principle (DMP). Recently, Li and Huang [29] developed an anisotropic metric tensor based on the anisotropic non-obtuse angle condition, which provides both mesh adaptation and DMP satisfaction for the numerical solution: the mesh alignment is determined by the main diffusion drag direction, i.e. by the underlying PDE, and the Hessian of the exact solution determines the optimal mesh density. In Sect. 5, the Hessian of the exact solution is replaced with the Hessian of the hierarchical error estimator to obtain a new, completely a posteriori, metric tensor accounting for both DMP satisfaction and mesh adaptation. Concluding remarks on the numerical examples and some key components of the hierarchical basis error estimator are given in Sect. 6.
2 Anisotropic Mesh Adaptation Based on Hierarchical Basis Error Estimator Consider the solution of a variational problem: find u ∈ V such that a(u, v) = f (v)
∀v ∈ V
(P )
where V is an appropriate Hilbert space of functions over a domain Ω ∈ R2 , a(·, ·) is a bilinear form defined on V × V , and F (·) is a continuous linear functional on V . The linear finite element approximation uh of u is the solution of the corresponding variational problem in a finite dimensional subspace Vh ⊂ V of piecewise linear functions: find uh ∈ Vh such that a(uh , vh ) = f (vh ) ∀vh ∈ Vh .
(Ph )
For the adaptive finite element solution, the mesh Th is generated according to the behaviour of the error of the approximation uh . This study follows the M -uniform mesh approach [23] which generates an adaptive mesh as a uniform mesh in the metric specified by a symmetric and strictly positive definite tensor M = M (x). Such a mesh is called an M -uniform mesh. Once a metric tensor M has been chosen, a sequence of mesh and corresponding finite element approximation are generated in an iterative fashion. (0) (i) An adaptive algorithm starts with an initial mesh Th . On every mesh Th (i) the variational problem (Ph ) with Vh is solved and the obtained approxi(i) mation uh is used to compute a new adaptive mesh for the next iteration (i+1) step. The new mesh Th is generated as a M -uniform mesh with a metric (i) (i) tensor Mh defined in terms of uh . This yields the sequence (0)
(0)
(0)
(0)
(1)
(1)
(1)
(1)
(Th , Vh ) → uh → Mh → (Th , Vh ) → uh → Mh → . . .
300
L. Kamenski
The process is repeated until a good adaptation is achieved. In the computation, the mesh generation software bamg (bidimensional anisotropic mesh generator developed by F. Hecht [21]) is used to generate new adaptive meshes. The mesh adaptation quality is characterized by the alignment and equidistribution quality measures introduced in [22]; more details can be found in [24, Sect. 4.1]. 2.1
Adaptation Based on a Posteriori Error Estimates
Typically, the metric tensor Mh depends on the Hessian of the exact solution of the underlying problem [19, 23]. As mentioned in Sect. 1, it is not possible to obtain an accurate Hessian recovery from a linear finite element solution in general [28], so there is no way to prove a convergence of an adaptive algorithm based on the Hessian recovery in a direct way, even if its application is quite successful in practical computations [17, 26, 29]. An alternative approach developed in [24] employs an a posteriori error estimator for defining and computing Mh . The brief idea is as follows. Assume that an error estimate zh is reliable in the sense that
u − uh ≤ C zh .
(1)
for a given norm · and that it has the property Πh zh ≡ 0
(2)
for some interpolation operator Πh . Then the finite element approximation error is bounded by the (explicitly computable) interpolation error of the error estimate zh , viz.,
u − uh ≤ C zh = C zh − Πh zh .
(3)
Now, it is known from the interpolation theory [27] that the interpolation error for a given function v can be bounded by a term depending on the triangulation Th and derivatives of v, i.e.,
v − Πh v ≤ C E(Th , v), where C is a constant independent of Th and v. Therefore, we can rewrite (3) as
u − uh ≤ C E(Th , zh ). In other words, up to a constant, the solution error is bounded by the interpolation error of the error estimate. Thus, the metric tensor Mh can be constructed to minimize the interpolation error of the zh and does not depend on the Hessian of the exact solution.
Using Hierarchical Error Estimates for Anisotropic Mesh Adaptation
2.2
301
Hierarchical Basis a Posteriori Error Estimate
One possibility to achieve the property (2) is to use the hierarchical basis error estimator. The general framework can be found among others in the work of Bank and Smith [6] or Deuflhard et al. [15]. The approach is briefly explained as follows. Let eh = u − uh be the error of the linear finite element solution uh ∈ Vh . Then for all v ∈ V we have a(eh , v) = f (v) − a(uh , v).
(E)
Let V¯h = Vh ⊕ Wh be a space of piecewise quadratic functions, where Wh is the linear span of the quadratic edge bubble functions (a quadratic edge bubble function is defined as a product of the two linear nodal basis functions corresponding to the edge endpoints). If Πh is defined as the vertex-based, piecewise linear Lagrange interpolation then it satisfies (2) since the edge bubble functions vanish at vertices. The error estimate zh is then defined as the solution of the approximate error problem: find zh ∈ Wh such that a(zh , wh ) = f (wh ) − a(uh , wh ) ∀wh ∈ Wh .
(Eh )
The estimate zh can be viewed as a projection of the true error onto the subspace Wh . Then, if assumption (1) holds, the finite element approximation error can be controlled by minimizing the interpolation error of zh , i.e., the right-hand side in (3). Note that this definition of the error estimate is global and its solution can be costly. To avoid the expensive exact solution in numerical computation, only a few sweeps of the symmetric Gauss-Seidel iteration are employed for the resulting linear system, which proves to be sufficient for the purpose of mesh adaptation (see [24] for more details).
3 Boundary Value Problem of a Second-Order Elliptic PDE Consider two-dimensional heat conduction in a thermal battery with large orthotropic jumps in the material coefficients. This is an example provided in [24]; the mathematical model considered here is taken from [30, 32] and described by / ∇ · (Dk ∇u) = f k in Ω, (4) k i i D ∇u · n = g − α u on ∂Ω, with Ω = (0, 8.4) × (0, 24) and k Dx 0 . D = 0 Dyk k
302
L. Kamenski
Table 1. Heat conduction in a thermal battery: material coefficients Dk and boundary conditions (clockwise starting with the left-hand side boundary) Region k Dxk Dyk f k 1 25 25 0 2 7 0.8 1 3 5 0.0001 1 4 0.2 0.2 0 5 0.05 0.05 0
Boundary i αi g i 1 0 0 2 1 3 3 2 2 4 3 0
k=5 k=4
k=2
k=3
k=2 k=5 k=1
(a)
(b)
(c)
Fig. 1. Heat conduction in a thermal battery: (a) device geometry, (b) contour and (c) surface plots of a linear finite element solution
Material coefficients Dk and the boundary conditions starting with the lefthand side boundary and ordering them clockwise are provided in Table 1. The analytical solution for this problem is unavailable, but the geometry and the contour and surface plots of a numerical approximation obtained with adaptive linear finite elements are given in Fig. 1. For this problem, we follow the approach described in the previous section and employ the metric tensor developed in [24] for a boundary value problem of a second-order elliptic PDE. In two dimensions and for the error measured in the L2 -norm, the metric tensor MHB,K based on the HB error estimator is given element-wise by
MHB,K
1 = det I + |HK (zh )| αh
− 16
1 I+ |HK (zh )| , αh
(5)
101
Hessian recovery-based HBEE-based regular Delaunay
global L -error estimate
100 10-1
2
global L2-error estimate
Using Hierarchical Error Estimates for Anisotropic Mesh Adaptation
10-2 10-3
4
10
5
10 number of elements
10
(a) With interface edges.
6
101
303
Hessian recovery-based HBEE-based regular Delaunay
100 10-1 10-2 10-3 10
4
5
10 number of elements
10
6
(b) Without interface edges.
Fig. 2. Heat conduction in a thermal battery: a comparison of the error estimate for adaptive finite element solutions
where HK (zh ) is the Hessian of the quadratic hierarchical basis error estimate zh on element K and αh is a regularization parameter to ensure that MHB is strictly positive definite (see [24] for more details on the choice of αh ). Figure 2 shows global error estimates (obtained by solving exactly the approximate error problem (Eh )) for finite element solutions on adaptive meshes controlled by the HBEE or quadratic least squares Hessian recovery (QLS) and having all or no predefined interface edges. Both methods provide comparable results. Typical adaptive meshes with predefined interface edges for the HBEE and the QLS are shown in Fig. 3. When the mesh contains all the information of the interface, the QLS-based method produces a mesh with strong element concentration near all internal interfaces (Fig. 3a), whereas the HBEE leads to a mesh (cf. Fig. 3b) that has higher element concentration in the corners of the regions, has a proper element orientation near the interfaces between the regions 2 and 3, and is almost uniform in regions where the solution is nearly linear (cf. Fig. 1c for the surface plot of a computed solution). The maximum aspect ratio2 of the mesh obtained by means of the HBEE is slightly larger. When the interface edges are not present in the mesh, both methods provide similar results: the interfaces are recognized by both methods and the obtained adaptive meshes are dense near the interfaces, in order to resolve the gradient jumps. This example result shows that Hessian recovery can lead to over-adaptation for non-smooth solutions. HBEE-based method, on the other hand, produces only necessary concentration and is also able to catch the directional information of the solution required for proper mesh alignment. This example particularly demonstrates that the HBEE-based method can be advantageous if applied to problems with jumping coefficients and strong anisotropic features. 2
In this paper, aspect ratio is defined as the longest edge√divided by the shortest altitude. An equilateral triangle has an aspect ratio of 3/2 ≈ 0.87.
304
L. Kamenski
(a) QLS Hessian recovery: 6781 triangles, max. aspect ratio 39.2.
(b) HBEE: 6750 triangles, max. aspect ratio 54.8.
Fig. 3. Heat conduction in a thermal battery: adaptive meshes obtained with (a) quadratic least squares Hessian recovery and (b) the HBEE
Using Hierarchical Error Estimates for Anisotropic Mesh Adaptation
305
4 Variational Problems While it has attracted considerable attention from many researchers and been successfully applied to the numerical solution of PDEs, anisotropic mesh adaptation has rarely been employed for variational problems, especially when combined with a posteriori error estimates. Often, a variational problem can be transformed into a boundary value problem of partial differential equations (PDEs) and solved by methods designed for PDEs. Unfortunately, these methods do not take structural advantage of variational problems and many researchers argue that the variational formulation should be used as a natural optimality criterion for mesh adaptation. Recently, Huang and Li [26] developed a metric tensor for the adaptive finite element solution of variational problems. In the anisotropic case, it is semi-a posteriori: it involves residual and edge jumps, both dependent on the computed solution, and the Hessian of the exact solution. In [25], this result was improved to provide a metric tensor for variational problems based on the HBEE and the underlying variational formulation. The new metric tensor is a posteriori in the sense that it is based solely on residual, edge jumps, and HBEE. This is in contrast to most previous work where M depends on the Hessian of the exact solution and is semi-a posteriori or completely a priori; e.g., see [10, 11, 13, 20, 23, 26]. 4.1
General Variational Problem and the Anisotropic Metric Tensor
Consider a general functional of the form " I[v] = F (x, v, ∇v)dx,
∀v ∈ Vg
Ω
where F (·, ·, ·) is a given smooth function, Ω ⊂ Rd (d = 1, 2, 3) is the physical domain and Vg is a properly selected set of functions satisfying the Dirichlet boundary condition v(x) = g(x) ∀x ∈ ∂Ω for a given function g. The corresponding variational problem is to find a minimizer u ∈ Vg such that I[u] = min I[v]. v∈Vg
A necessary condition for u to be a minimizer is that the first variation of the functional vanishes. This leads to the Galerkin formulation " (Fu (x, u, ∇u) v + F∇u (x, u, ∇u) · ∇v) dx = 0 (6) δI[u, v] ≡ Ω
for all v ∈ V0 , where V0 = Vg with g = 0 and Fu and F∇u are the partial derivatives of F with respect to u and ∇u, respectively.
306
L. Kamenski
Given a triangulation Th for Ω and the associated linear finite element space Vgh ⊂ Vg , the finite element solution uh can be found by solving the corresponding Galerkin formulation: find uh ∈ Vgh such that " δI[uh , vh ] = (Fu (x, uh , ∇uh ) vh + F∇u (x, uh , ∇uh ) · ∇vh ) dx = 0 Ω
for all vh ∈ V0h . The a posteriori metric tensor MV P,K for general variational problems developed in [25] for the error measured in the H 1 -semi-norm is given elementwise by ⎛ ⎛ ⎞⎞ 12 1 ⎝ 1/2 1/2 MV P,K = ⎝1 + |K| rh L2 (K) + |γ| Rh L2 (γ) ⎠⎠ αh |K| γ∈∂K
− 14 1 1 × det I + |HK (zh )| I+ |HK (zh )| αh αh
(7)
with the residual rh (x) = Fu (x) − ∇ · F∇u (x)
x∈K
and the edge jump / (F∇u (x) · nγ )|K + (F∇u (x) · nγ )|K Rh (x) = 0
∀K ∈ Th
x∈γ x∈γ
∀γ ∈ ∂Th \∂Ω, ∀γ ∈ ∂Ω.
Note, that δI[u, v] in (6) is linear in v but is nonlinear in u in general. Thus, a modification of the error problem (Eh ) for zh in Sect. 2.2 is required. For this purpose, denote by ah (uh ; ·, ·) a bilinear form resulting from a linearization of δI[·, ·] about uh with respect to the first argument. The error estimate zh is then defined as the solution of the approximate linear error problem: find zh ∈ W h such that ah (uh ; zh , wh ) = −δI[uh , wh ] for all wh ∈ W h [6]. 4.2
Numerical Example
Consider an anisotropic variational problem defined by the non-quadratic functional "
3/4 2 I[u] = 1 + |∇u| + 1000u2y dx Ω
with Ω = (0, 1) × (0, 1) and the boundary condition / u = 1 on x = 0 or x = 1, u = 2 on y = 0 or y = 1.
Using Hierarchical Error Estimates for Anisotropic Mesh Adaptation
307
Fig. 4. Variational problem: surface plot of the numerical solution
This example is discussed in [25, 26] and is originally taken from [9]; the analytical solution is not available, but a computed solution in Fig. 4 shows that the mesh adaptation challenge for this example is the resolution of the sharp boundary layers near x = 0 and x = 1. Adaptive meshes obtained with both metric tensors (Hessian recoverybased and HBEE-based) are given in Fig. 5. The both methods have correct mesh concentration and provide good alignment with the boundary layers. Anisotropic meshes are comparable, although mesh elements near the boundary layer in the HBEE-based adaptive mesh have a larger aspect ratio than elements of the mesh obtained by means of the Hessian recovery. This could be due to the smoothing nature of the Hessian recovery: usually, it operates on a larger patch, thus introducing an additional smoothing effect, which affects the grading of the elements’ size and orientation. The global hierarchical basis error estimator does not have this handicap and, in this example, the mesh obtained by means of HBEE is slightly better aligned with the steep boundary layers.
5 Anisotropic Diffusion Problems and the DMP Anisotropic diffusion problems arise in various areas of science and engineering, for example image processing, plasma physics, or petroleum engineering. Standard numerical methods can produce spurious oscillations when they are used to solve these problems. A common approach to avoid this difficulty is to design a proper numerical scheme or a mesh so that the numerical solution satisfies the discrete counterpart (DMP) of the maximum principle satisfied by the continuous solution. A well known condition for the DMP satisfaction by the linear finite element solution of isotropic diffusion problems is the nonobtuse angle condition that requires the dihedral angles of mesh elements to be non-obtuse [14]. In [29], a generalization of the condition, the so-called anisotropic non-obtuse angle condition, was introduced for the finite element solution of heterogeneous anisotropic diffusion problems. The new condition
308
L. Kamenski
(a) Metric based on residual, edge jumps, and Hessian recovery: 1160 triangles, max. aspect ratio 15.
(b) Metric based on residual, edge jumps, and HBEE: 1143 triangles, max. aspect ratio 51. Fig. 5. Variational problem: adaptive meshes obtained by means of Hessian recovery-based and HBEE-based metric tensors; close-up views at (0,0)
is essentially the same as the existing one except that the dihedral angles are measured in a metric depending on the diffusion matrix of the underlying problem. Based on the new condition, a metric tensor for anisotropic mesh adaptation was developed, which combines the satisfaction of the DMP with mesh adaptivity. The obtained metric tensor is based on the diffusion matrix and the Hessian of the exact solution. As in previous sections, we can improve the obtained metric tensor by replacing the (unknown) Hessian of the exact solution by the Hessian of the HBEE as shown in the following example.
Using Hierarchical Error Estimates for Anisotropic Mesh Adaptation
309
2
u
1.5
Γin
1
Γout 0.5
u=2
0 1 1
0.5 0.5 y
u=0 (a) Boundary conditions.
0 0
x
(b) Numerical solution.
Fig. 6. Anisotropic diffusion: boundary conditions and numerical solution
Consider the BVP discussed in [29]: / ∇ · (D ∇u) = f u=g
in Ω, on ∂Ω,
(8)
with f ≡ 0,
Ω = [0, 1]2 \
4 5 , 9 9
2 ,
g = 0 on Γout ,
g = 2 on Γin ,
where Γout and Γin are the outer and inner boundaries of Ω, respectively (Fig. 6a). The diffusion matrix is given by cos θ − sin θ 1000 0 cos θ sin θ D= , θ = π/4, sin θ cos θ 0 1 − sin θ cos θ where θ is the angle of the primary diffusion direction (parallel to the first eigenvector of D). This example satisfies the maximum principle and the solution stays between 0 and 2 and has sharp jumps near the inner boundary. The analytical solution is not available, but the numerical solution is provided in Fig. 6b. The goal is to produce a numerical solution which also satisfies DMP and stays between 0 and 2 and has a good adaptation. In two dimensions and for the error measured in the H 1 -semi-norm, the DMP-compliant anisotropic metric tensor MDMP,K developed in [29] is given element-wise by MDMP,K = where
12 1 1 1+ BDMP,K det (DK ) 2 D−1 K , αh
(9)
310
L. Kamenski − 12
BDMP,K = det (DK )
% −1 % 1 %D % · K |K|
" 2
DK |H(u)| dx.
(10)
K
The diffusion matrix D in (9) provides the correct mesh alignment whereas the Hessian of the exact solution in (10) is responsible for the appropriate mesh density. As noted in Sect. 2, if the finite element solution error can be bounded by the interpolation error of the hierarchical basis error estimator, the Hessian of the exact solution in (10) can be replaced by the Hessian of the HBEE zh : " % % 1 −1 2 %· BHB,K = det (DK ) 2 %D−1
DK |H(zh )| dx. (11) K |K| K
(a) Isotropic: 4170 triangles, min uh ≈ −5.9 × 10−2 , max. aspect ratio 2.7.
(b) MHB : 4353 triangles, min uh ≈ −3.2 × 10−4 , max. aspect ratio 37.2. Fig. 7. Anisotropic diffusion: meshes and contour plots of the numerical solution for the (a) isotropic and (b) HBEE-based MHB metric tensors
Using Hierarchical Error Estimates for Anisotropic Mesh Adaptation
311
(a) MDM P : 4253 triangles, no undershoots, max. aspect ratio 76.5.
(b) MDM P +HB : 4381 triangles, no undershoots, max. aspect ratio 84.2. Fig. 8. Anisotropic diffusion: meshes and contour plots of the numerical solution for the (a) Hessian recovery-based MDM P and (b) HBEE-based MDM P +HB metric tensors
With this choice, the mesh will still satisfy the DMP, but this time the mesh density is determined by the a posteriori error estimate zh . To emphasize the compliance with the DMP, the metric tensors MDMP and MDMP +HB based on (10) and (11), respectively, are also compared to a uniform mesh and the anisotropic metric tensor MHB based solely on the HBEE (Sect. 3). Figures 7 and 8 show meshes and solution contours. No overshoots in the finite element solutions are observed for all cases, but Fig. 7 shows that undershoots and unphysical minima occur in the solutions obtained with the uniform mesh (min uh ≈ −0.059) and MHB (min uh ≈ −0.0032). No undershoots can be observed for MDMP and MDMP +HB (Fig. 8). The results confirm the prediction that the solutions
312
L. Kamenski
obtained with MDMP and MDMP +HB satisfy DMP and no unphysical extrema occur. As for MDMP and MDMP +HB , the solution contours for both metric tensors are almost undistinguishable and, although not as smooth, still quite comparable to the one obtained with MHB (cf. Figs. 8 and 7b), thus providing a good adaptation to the sharp solution jump near the interior boundary (cf. the somewhat smeared solution jump for the isotropic mesh in Fig.7a, right). The mesh computed by means of HBEE is fully comparable with the mesh obtained using Hessian recovery. Again, the maximum aspect ratio of the mesh obtained by means of the HBEE has a slightly larger aspect ratio.
6 Concluding Remarks Numerical results show that a global HBEE can be a successful alternative to Hessian recovery in mesh adaptation: in all three examples both methods provide very similar results. However, as observed in the heat conduction example in Sect. 3, Hessian recovery could result in unnecessarily high mesh density for problems with discontinuities. Also, it can cause a light mesh smoothing: meshes obtained by means of Hessian recovery-based method have a slightly smaller maximum aspect ratio than meshes obtained with HBEE and therefore seem to be slightly worse in terms of alignment with the steep boundary layers. The global HBEE seems to be less affected by these issues and, depending on the underlying problem, can provide a more robust solution. A key component of the HBEE-based method is to find the solution zh of the error problem (Eh ). This is a global problem. Hence, finding its exact solution can be as costly as for computing a quadratic finite element approximation to the original problem. However, a fast approximate solution is as fast as Hessian recovery and proved to be sufficient to provide enough directional information for the purpose of the mesh adaptation. Another key component of the method is the reliability of the error estimator on anisotropic meshes: error estimation with hierarchical bases is usually based on the saturation assumption, which basically states that quadratic approximations provide finer information on the solution than linear ones. Existing results on its validity require bounds on the elements’ aspect ratio [18]. It is still unclear if similar results can be achieved for general adaptive meshes, but numerical results suggest that aspect ratio bounds are not necessary if the mesh is properly aligned. Moreover, it seems that good mesh adaptation does not require an accurate Hessian recovery or an accurate error estimator, but rather some additional information of global nature, although it is still unclear which information exactly is necessary.
Using Hierarchical Error Estimates for Anisotropic Mesh Adaptation
313
Acknowledgements This research was supported in part by the German Research Foundation (DFG) through the grant KA 3215/1-1. The author is grateful to the anonymous referees for their valuable comments.
References 1. Agouzal, A., Lipnikov, K., Vassilevski, Y.: Generation of quasi-optimal meshes based on a posteriori error estimates. In: Proceedings of the 16th International Meshing Roundtable, pp. 139–148 (2008) 2. Agouzal, A., Lipnikov, K., Vassilevski, Y.: Anisotropic mesh adaptation for solution of finite element problems using hierarchical edge-based error estimates. In: Proceedings of the 18th International Meshing Roundtable, pp. 595–610 (2009) 3. Agouzal, A., Lipnikov, K., Vassilevski, Y.: Hessian-free metric-based mesh adaptation via geometry of interpolation error. Comput. Math. Math. Phys. 50(1), 124–138 (2010) 4. Agouzal, A., Vassilevski, Y.V.: Minimization of gradient errors of piecewise linear interpolation on simplicial meshes. Comput. Methods Appl. Mech. Engrg. 199(33-36), 2195–2203 (2010) 5. Apel, T., Grosman, S., Jimack, P.K., Meyer, A.: A new methodology for anisotropic mesh refinement based upon error gradients. Appl. Numer. Math. 50(3-4), 329–341 (2004) 6. Bank, R.E., Kent Smith, R.: A posteriori error estimates based on hierarchical bases. SIAM J. Numer. Anal. 30(4), 921–935 (1993) 7. Bank, R.E., Xu, J.: Asymptotically exact a posteriori error estimators, Part I: Grids with superconvergence. SIAM J. Numer. Anal. 41(6), 2294–2312 (2003) 8. Bank, R.E., Xu, J.: Asymptotically exact a posteriori error estimators, Part II: General unstructured grids. SIAM J. Numer. Anal. 41(6), 2313–2332 (2003) 9. Bildhauer, M.: Convex variational problems. Linear, nearly linear and anisotropic growth conditions. Lecture Notes in Mathematics, vol. 1818. Springer, Heidelberg (2000) 10. Borouchaki, H., George, P.L., Hecht, F., Laug, P., Saltel, E.: Delaunay mesh generation governed by metric specifications. Part I. Algorithms. Finite Elements in Analysis and Design 25(1-2), 61–83 (1997) 11. Borouchaki, H., George, P.L., Mohammadi, B.: Delaunay mesh generation governed by metric specifications. Part II. Applications. Finite Elem. Anal. Des. 25(1-2), 85–109 (1997) 12. Cao, W., Huang, W., Russell, R.D.: Comparison of two-dimensional r-adaptive finite element methods using various error indicators. Math. Comput. Simulation 56(2), 127–143 (2001) 13. Castro-D´ıaz, M.J., Hecht, F., Mohammadi, B., Pironneau, O.: Anisotropic unstructured mesh adaption for flow simulations. Int. J. Numer. Meth. Fluids 25(4), 475–491 (1997) 14. Ciarlet, P.G., Raviart, P.A.: Maximum principle and uniform convergence for the finite element method. Comput. Methods Appl. Mech. Engrg. 2(1), 17–31 (1973)
314
L. Kamenski
15. Deuflhard, P., Leinen, P., Yserentant, H.: Concepts of an adaptive hierarchical finite element code. Impact Comput. Sci. Engrg. 1(1), 3–35 (1989) 16. Dobrowolski, M., Gr¨ af, S., Pflaum, C.: On a posteriori error estimators in the finite element method on anisotropic meshes. Electron. Trans. Numer. Anal. 8, 36–45 (1999) 17. Dolejˇs´ı, V.: Anisotropic mesh adaptation for finite volume and finite element methods on triangular meshes. Comput. Vis. Sci. 1(3), 165–178 (1998) 18. D¨ orfler, W., Nochetto, R.H.: Small data oscillation implies the saturation assumption. Numer. Math. 91, 1–12 (2002) 19. Formaggia, L., Perotto, S.: New anisotropic a priori error estimates. Numer. Math. 89(4), 641–667 (2001) 20. Frey, P.J., George, P.-L.: Mesh Generation, 2nd edn. John Wiley & Sons, Inc., Hoboken (2008) 21. Hecht, F.: BAMG: Bidimensional Anisotropic Mesh Generator (2006), Source code: http://www.ann.jussieu.fr/~ hecht/ftp/bamg/ 22. Huang, W.: Measuring mesh qualities and application to variational mesh adaptation. SIAM J. Sci. Comput. 26(5), 1643–1666 (2005) 23. Huang, W.: Metric tensors for anisotropic mesh generation. J. Comput. Phys. 204(2), 633–665 (2005) 24. Huang, W., Kamenski, L., Lang, J.: A new anisotropic mesh adaptation method based upon hierarchical a posteriori error estimates. J. Comput. Phys. 229(6), 2179–2198 (2010) 25. Huang, W., Kamenski, L., Li, X.: Anisotropic mesh adaptation for variational problems using error estimation based on hierarchical bases. Canad. Appl. Math. Quart. (to appear, 2010) arXiv:1006.0191 26. Huang, W., Li, X.: An anisotropic mesh adaptation method for the finite element solution of variational problems. Finite Elem. Anal. Des. 46(1-2), 61–73 (2010) 27. Huang, W., Sun, W.W.: Variational mesh adaptation II: error estimates and monitor functions. J. Comput. Phys. 184(2), 619–648 (2003) 28. Kamenski, L.: Anisotropic Mesh Adaptation Based on Hessian Recovery and A Posteriori Error Estimates. PhD thesis, TU Darmstadt (2009) 29. Li, X., Huang, W.: An anisotropic mesh adaptation method for the finite element solution of heterogeneous anisotropic diffusion problems. J. Comput. Phys. (to appear, 2010) arXiv:1003.4530 30. Ovall, J.S.: The dangers to avoid when using gradient recovery methods for finite element error estimation and adaptivity. Technical Report 6, Max Planck Institute for Mathematics in the Sciences (2006) 31. Ovall, J.S.: Function, gradient, and Hessian recovery using quadratic edgebump functions. SIAM J. Numer. Anal. 45(3), 1064–1080 (2007) 32. Pardo, D., Demkowicz, L.: Integration of hp-adaptivity and a two-grid solver for elliptic problems. Comput. Methods Appl. Mech. Engrg. 195(7-8), 674–710 (2006) 33. Zhang, Z., Naga, A.: A new finite element gradient recovery method: Superconvergence property. SIAM J. Sci. Comput. 26(4), 1192–1213 (2005) 34. Zienkiewicz, O.C., Zhu, J.Z.: The superconvergent patch recovery and a posteriori error estimates. Part 1: The recovery technique. Int. J. Numer. Methods Engrg. 33(7), 1331–1364 (1992) 35. Zienkiewicz, O.C., Zhu, J.Z.: The superconvergent patch recovery and a posteriori error estimates. Part 2: Error estimates and adaptivity. Int. J. Numer. Methods Engrg. 33(7), 1365–1382 (1992)
Bisection-Based Triangulations of Nested Hypercubic Meshes Kenneth Weiss1 and Leila De Floriani2 1 2
University of Maryland, College Park, USA [email protected] University of Genova, Genova, Italy [email protected]
Abstract. Hierarchical spatial decompositions play a fundamental role in many disparate areas of scientific and mathematical computing since they enable adaptive sampling of large problem domains. Although the use of quadtrees, octrees, and their higher dimensional analogues is ubiquitous, these structures generate meshes with cracks, which can lead to discontinuities in functions defined on their domain. In this paper, we propose a dimension–independent triangulation algorithm based on regular simplex bisection to locally decompose adaptive hypercubic meshes into high quality simplicial complexes with guaranteed geometric and adaptivity constraints.
1 Introduction Hypercubes are the basis for many adaptive spatial subdivisions, such as quadtrees in 2D, octrees in 3D and their higher dimensional analogues. Due to their simple definition in arbitrary dimension – any hypercube can be decomposed into 2d hypercubes covering its domain – such decomposition schemes are widely implemented and have been successfully applied to problems across many different application domains [20]. However, hypercubic meshes do not generate conforming, i.e. crack-free, adaptive decompositions. This can be problematic, for example, when values are associated with the vertices of a mesh defining a discrete scalar function, since such cracks can lead to discontinuities in the function defined over the domain. In contrast, simplicial decompositions admit highly adaptive conforming meshes but can require many more cells to cover the same domain. Downstream applications of these meshes, such as finite element analysis and scalar field modeling and visualization, often require mesh elements to satisfy certain quality constraints related to the shapes of the elements as well as the rate of adaptivity within the mesh. Geometric quality constraints can be enforced by using refinement rules that only generate mesh elements from a small set of acceptable modeling primitives [4]. A common adaptivity constraint is to ensure that neighboring elements differ in resolution by at
316
K. Weiss and L. De Floriani
most one refinement level, i.e. that the ratio of edge lengths between neighboring elements can be at most 2:1. This constraint has been considered in several problem domains, including computational geometry [3, 6], scientific visualization [9, 32] and computer graphics [26] under various terms such as restricted [26, 23], smooth [15] and balanced [16, 24]. At the same time, there has been an increasing interest in the research on geometric modeling and scientific visualization to deal with data in medium and high dimensions [14, 5]. This is facilitated by the development of dimension–independent algorithms and data structures. Examples include time-varying volume data sets, which can be viewed as 4-dimensional data sets, and in general applications in four-dimensional space-time, when we consider 3D spatial entities moving over time. Another example is given by applications in six-dimensional phase-space, where data are characterized by three spatial coordinates and three momentum variables. In this paper, we are concerned with the relationship between nested meshes formed by hypercubes, and their decompositions into high quality simplicial complexes. Specifically, we propose a simplicial decomposition for nested hypercubic meshes generated by applying a regular simplex bisection rule to locally triangulate each hypercube in the mesh. Due to the properties of this bisection scheme [13, 25, 4, 29, 31], our algorithm generates adaptive simplicial complexes composed of high quality simplices from a small set of geometric primitives. Furthermore, compatibility between adjacent triangulated hypercubes is implicitly enforced and the complexity of the mesh increases by a dimension–dependent multiplicative constant. Our algorithm depends only on local properties of the edges of the hypercubes in the mesh and can be easily incorporated into existing meshing systems based on nested hypercubic meshes, such as quadtrees, octrees and their higher dimensional counterparts. The remainder of this paper is organized as follows. After a review of relevant background notions in Section 2, we discuss prior work on balanced hypercubic meshes and their triangulations in Section 3. In Section 4, we review properties of the regular simplex bisection scheme which will be relevant for our triangulation algorithm in Section 5. We discuss empirical results of our algorithm in the context of a 3D isosurfacing application in Section 6 and compare the meshes generated by our algorithm to those of an alternate 3D triangulation algorithm. Finally, we draw some concluding remarks in Section 7.
2 Background Notions In this Section, we review concepts related to polytopic meshes and to nested mesh refinement that we will use in the remainder of the paper.
Bisection-Based Triangulations of Nested Hypercubic Meshes
2.1
317
Polytopic Meshes
A convex polytope is a subspace of Rn bounded by a set of half-spaces. Polytopes generalize line segments (1-polytopes), polygons (2-polytopes) and polyhedra (3-polytopes). We define a d-cell as a convex polytope in some d-dimensional subspace of Rn . Let γ be a d-cell. Then, an i-dimensional face γi of γ, 0 ≤ i ≤ d, is an i-cell on the boundary of γ. We refer to a 0-cell as a vertex, a 1-cell as an edge, and a (d − 1)-cell as a facet. A polytopic mesh P is a finite collection of polytopic cells such that (a) if γ is a cell in P, then all faces γi of γ also belong to P (b) the interiors of cells in P are disjoint. The dimension, or order, of a polytopic mesh is the maximum of the orders of the cells forming it. In a polytopic mesh, cells that are not on the boundary of any other cells are called top cells. Also, in a polytopic mesh of order d with a manifold domain, as we will consider here, all top cells are d-cells. Such meshes are referred to as pure. If, additionally, the intersection of any two cells γ1 , γ2 ∈ P is a lower dimensional cell on the boundary of γ1 and γ2 , then P is said to be conforming, or compatible. Conforming meshes are important in many applications since they ensure that there are no cracks or T-junctions between adjacent cells. Hypercubic meshes Hypercubes are the higher dimensional analogues of line segments (1-cubes), squares (2-cubes) and cubes (3-cubes). An interesting property of hypercubes is that all faces of a d-cube are lower dimensional hypercubes. Given a d-cube h, an i-face of h is any i-cube on the boundary 1 2 of h, where 0 ≤ i ≤ d. The number of i-faces of a d-cube is given by 2d−i di . Unless otherwise indicated, we refer to axis-aligned hypercubes, where all faces are aligned with the Euclidean coordinate axes. A hypercubic mesh is a polytopic mesh containing only hypercubes. Note that a hypercubic mesh can only be conforming if all hypercubes are uniform in size. Two d-cubes h1 and h2 in a hypercubic mesh are k-neighbors if their intersection (h1 ∩ h2 ) defines a k-cube. Simplicial meshes Another family of cells that has members in arbitrary dimension is defined by the simplices, which generalize the line segment (1-simplex), the triangle (2-simplex) and the tetrahedron (3-simplex). A d-dimensional simplex, or d-simplex, is the convex hull of (d + 1) affinely independent points in the n-dimensional Euclidean space. An i-face of a d-simplex σ is the i-simplex defined 1 by2 any (i + 1) vertices of σ. The number of i-faces of a d-simplex is thus d+1 i+1 .
318
K. Weiss and L. De Floriani
A simplicial mesh Σ is a polytopic mesh containing only simplices, that is, all faces of a simplex σ ∈ Σ belong to Σ, and the interiors of simplices from Σ are disjoint. Similarly, a simplicial complex is a simplicial mesh that is conforming. A simplicial complex of order d is referred to as a simplicial d-complex. As with cubes, all faces of a simplex are simplices. However, in contrast to hypercubic meshes, simplices in a conforming simplicial mesh do not need to have uniform size. 2.2
Nested Mesh Refinement
A mesh refinement scheme consists of a set of rules for replacing a set of cells Γ1 with a larger set of cells Γ2 , i.e. |Γ1 | < |Γ2 |. In a nested refinement scheme, Γ1 and Γ2 cover the same domain. In this paper, we are concerned with nested mesh refinement schemes in which the vertices are regularly distributed, that is, the vertices of Γ2 are located at the midpoints of the faces of the cells of Γ1 . The two predominant types of such refinement schemes are regular refinement and bisection refinement [25, 4]. In regular refinement schemes, a single cell γ is replaced by 2d cells. Figure 1 illustrates the regular refinement of a square (i.e., a 2-cube) and of a cube (i.e., a 3-cube). When applied to a hypercubic domain, this rule generates quadtrees, octrees and their higher-dimensional counterparts. Similar schemes have been developed for the regular refinement of simplices, leading to data structures referred to as simplicial quadtrees [17]. Alternatively, in bisection refinement schemes, a single cell γ is replaced by the two cells obtained by splitting γ along a hyperplane. When applied to meshes composed of hyper-rectangles, and the splitting hyperplane is aligned with one of the bounding facets, this leads to kD-trees. When applied to simplices, this operation is referred to as simplex bisection. In this case, the splitting hyperplane cuts through the midpoint vm of a single edge e of the simplex σ and all vertices of σ not incident to e (see Figure 2).
(a) Regular refinement of 2-cube
(b) Regular refinement of 3-cube
Fig. 1. Regular refinement of a d-cube generates 2d cubes
Bisection-Based Triangulations of Nested Hypercubic Meshes
e
e
vБ
vБ
(a) Triangle bisection
319
(b) Tetrahedron bisection
Fig. 2. A simplex is bisected along the hyperplane defined by the midpoint vm (red) of an edge e (green) and all vertices (blue) not adjacent to that edge.
3 Related Work In this Section, we are primarily concerned with work related to balanced nested hypercubic meshes and their conforming decompositions over a regularly sampled domain. A comprehensive survey of irregular triangulations can be found in [2]. Adaptive domain decompositions often impose rules on the allowed degree of decomposition among neighboring elements and thus are obtained by refining neighboring elements until the level of subdivision meets certain balancing requirements. Von Herzen and Barr [26] propose the restricted quadtrees for modeling parametric surfaces and define triangulation rules for rendering them. A restricted quadtree is a quadtree in which two edge-adjacent squares differ by at most one level in the decomposition. Sivan and Samet [23] first use such decompositions as a spatial data structure, specifically, for terrain modeling, and study different rules for subdividing the squares into triangles. Bern and Eppstein [3] define a balanced quadtree as a mesh in which orthogonally adjacent nodes cannot be more than one level of refinement apart, and prove that a balanced quadtree in dimension d is at most a constant factor larger than its unbalanced counterpart. They also prove that simplices generated by using a Delaunay triangulation of a balanced hypercubic mesh have bounded angles. Moore [16] identifies different types of neighbors on which to balance a nested hypercubic hierarchy and uses this to find optimally tight bounds on the cost of balancing quadtrees, with an upper bound of O(3d ). Specifically, a nested hypercubic mesh C is said to be k-balanced if all k-neighbors differ in refinement level by at most one [16]. Our triangulation algorithm (Section 5) depends on edge-balanced nested hypercubic meshes, where hypercubes adjacent along an edge can differ by at most one refinement. In applications where conforming meshes are important, restricted quadtree meshes can be triangulated into simplicial complexes [26, 22, 33]. Such meshes can be triangulated based on red-green rules [33] or on simplex bisection rules [26, 22]. In the former case, which we refer to as Delaunay-based
320
K. Weiss and L. De Floriani
triangulations, cases are explicitly defined, for example, based on a Delaunay triangulation of the cube vertices. Figure 3a illustrates a complete set of triangulation cases (up to symmetry) for a square domain [18]. An alternate set of cases can be found in [33]. An advantage of Delaunay-based triangulation (in 2D) is that it does not require additional vertices, referred to as Steiner vertices, to triangulate the mesh. However, in higher dimensions these would likely be required. In contrast, bisection-based triangulations, such as the one proposed in Section 5, do not require explicit triangulation cases, but can require additional vertices along the faces of the hypercube adjacent to a higher resolution neighbor. A complete set of bisection-based triangulation cases for a square domain (due to [22]) is illustrated in Figure 3b. An alternative bisection-based approach (in 2D) is to remove unmatched vertices from higher resolution neighbors [19]. Plantinga and Vegter [18] propose triangulation cases for edge-balanced 3D octrees through the use of a Delaunay-based triangulation of the cube faces. Each cube is then tetrahedralized by connecting the face triangulations to the cube centers. We compare tetrahedral meshes generated by our algorithm to those generated by [18] in Section 6. A bisection-based triangulation has been suggested for balanced octrees [11], but details of this triangulation are not provided. In higher dimensions, Weigle and Banks [27] propose a simplicial decomposition of hypercubes that recursively adds a vertex to the midpoint of each cell. This algorithm generates (non-adaptive) regular simplex bisection meshes, but has not been proposed in an adaptive setting. Alternatively, conforming representations have been proposed for adaptive quadrilateral or hexahedral meshes based on explicit decomposition rules for neighboring cells of different sizes [21]. These rules are based on bisection (2:1) or trisection (3:1) of the hypercube edges. Recent work has focused
(a) Delaunay-based triangulations of a square
(b) Bisection-based triangulations of a square Fig. 3. Unique triangulation cases (up to symmetry) for squares (2-cubes) based on Delaunay triangulation (a) and bisection triangulation (b)
Bisection-Based Triangulations of Nested Hypercubic Meshes
321
on simpler decompositions and implementations for quadrilateral [10] and hexahedral meshes [12]. To the best of our knowledge, such decomposition rules have not been generalized to higher dimensional domains. Compared to simplicial decompositions, such as the approach presented in this paper, conforming adaptive quadrilateral meshes and hexahedral meshes can be generated using fewer cells. However, in cases where values must be interpolated within each cell, the latter require multi-linear interpolation (based on 2d values) while the former admit linear interpolation (based on only (d+1) values).
4 Regular Simplex Bisection Meshes A popular class of nested simplicial meshes over a regularly sampled hypercubic domain Ω is generated by the Regular Simplex Bisection (RSB) scheme. The initial mesh is a d-dimensional cube that has been refined along one of its diagonals into d! simplices of order d. This refinement is the canonical simplicial decomposition of a hypercube, and is often referred to as Kuhn’s subdivision [4] (see the left images in Figures 4a and 4b). One of the nice properties of a Kuhn-subdivided cube is that its lower dimensional faces are compatibly subdivided Kuhn cubes [7], and thus space can be tiled by translated (or reflected) Kuhn cubes. Each simplex in this scheme is generated by bisecting an existing simplex along a predetermined edge, which is implicitly determined through a consistent ordering of the vertices [13, 25, 1]. In dimension d, this generates at most d similarity classes of simplices [13] that we refer to as RSB simplices. A recent survey on the RSB scheme and its applications can be found in [31]. 4.1
Simplex Hierarchies
The containment relation among simplices generated by the RSB scheme defines a nested hierarchy of simplices, which can be represented as a forest of binary trees in which each parent simplex has two child simplices. We refer
vЇ
vЇ
0-diamond
1-diamond
(a) 2D diamonds
vЇ
0-diamond
vЇ
1-diamond
vЇ
2-diamond
(b) 3D diamonds
Fig. 4. The two classes of 2D diamonds (a) and the three classes of 3D diamonds (b)
322
K. Weiss and L. De Floriani
to any mesh generated by the RSB scheme over an initially Kuhn-subdivided mesh as an RSB mesh. 4.2
Diamond Hierarchies
RSB meshes can be non-conforming. Thus, a conforming variant of the RSB scheme has been defined, in which the set of all RSB simplices sharing the same bisection edge, typically referred to as a diamond, must be bisected concurrently. Since all simplices in a diamond share the same bisection edge, the d classes of RSB simplices correspond to d classes of diamonds. The bisection edge of a diamond of class i, where 0 ≤ i < d, which we refer to as the spine of the diamond, is aligned with the diagonal of an axis-aligned (d− i)-cube. The domain of a diamond can be decomposed as a cross product of two hypercubes that intersect at the midpoint of the diamond’s spine [29]. In particular, we note that 0-diamonds correspond to Kuhn-subdivided dcubes. Also, the spine of a (d − 1)-diamond is aligned with an edge of a hypercube (see the right images in Figures 4a and 4b). Furthermore, a single vertex, which we refer to as the diamond’s central vertex, is introduced during diamond refinement, at the midpoint of its spine. The containment relation of all simplices within a diamond defines a direct dependency relation among the diamonds. Thus, the parents of a diamond δ are those diamonds whose refinement generates a simplex belonging to δ, and without which δ cannot be refined. The direct dependency relation can be modeled as a Directed Acyclic Graph (DAG) whose nodes are diamonds and whose arcs connect a diamond with its children. The diamonds, together with the dependency relation, define a multiresolution model that is referred to as a hierarchy of diamonds. A hierarchy of diamonds is used to efficiently extract variable-resolution conforming RSB meshes, which we refer to as diamond meshes, satisfying the direct dependency relation of the hierarchy. Since each simplex σ in a diamond mesh Σd can be uniquely associated with a single diamond, Σd can be compactly encoded in terms of its diamonds. An efficient encoding for diamonds has been proposed in [29] based on the observation that each of the O(d) parents of a diamond δ contributes O(d!) simplices to δ upon its refinement. Thus, each diamond in Σd can be encoded using only O(d) space.
5 Triangulating Nested Hypercubic Meshes In this Section, we introduce a simple dimension–independent algorithm to triangulate a nested hypercubic mesh C. Our triangulation algorithm is based on the observation that 0-diamonds cover a hypercubic domain, and thus, nested hypercubic meshes can be considered as a special case of (nonconforming) diamond meshes consisting of only 0-diamonds. Our triangulation is based on a local bisection refinement within each hypercube of C. This converts C into a conforming RSB mesh Σ covering the domain of C, i.e. Σ
Bisection-Based Triangulations of Nested Hypercubic Meshes
323
is a simplicial complex defined by a collection of Regular Simplex Bisection (RSB) simplices. The properties of RSB simplices [13, 31] ensure the quality of the triangulation. Specifically, the simplices in the mesh belong to at most d similarity classes of well-shaped simplices, and the valence of a vertex is at most 2d d!. Our algorithm consists of three stages. First, we edge-balance the mesh (Section 5.1). This ensures that each face of a hypercube within C is refined by at most one internal vertex (see Figure 6). Next, we iterate the vertices of the edge-balanced mesh and cache them (Section 5.2). This replaces potentially expensive neighbor-finding operations with a single vertex lookup on each edge of the hypercube. Finally, we triangulate each hypercube locally using a diamond-based bisection refinement (Section 5.3). We conclude with a proof that the generated mesh Σ is a simplicial complex and find bounds on the complexity of Σ with respect to C. Our algorithm is summarized in Figure 5.
(a) Unbalanced
(b) Edge-balanced
(c) Triangulated
Fig. 5. Overview of triangulation algorithm (in 2D). Given an arbitrary nested hypercubic mesh (a), we first edge-balance the mesh (b) and then apply a local bisection-based triangulation to each hypercube (c).
5.1
Mesh Balancing
Let C be a (variable-resolution) nested hypercubic mesh obtained through regular refinement of an initial hypercubic domain Ω. For our triangulation algorithm, we require C to be an edge-balanced nested hypercubic mesh. This ensures that the faces of each hypercube need to be refined at most once, as well as the quality of the generated elements. Otherwise, the edges of its cubes might require more than one refinement, as can be seen in Figure 6b, where the edge of the blue cube (at level − 1) adjacent to the orange cube (at level + 1) has more than one internal vertex. If the input mesh Cin is not edge-balanced, we can convert it to an edgebalanced mesh C using, e.g., Moore’s greedy algorithm [16]. Note that this increases the number of hypercubes in the mesh by at most a constant factor (assuming a fixed dimension d) [28, 16].
324
K. Weiss and L. De Floriani
(a) Edge-balanced
(b) Not edge-balanced
Fig. 6. The refinement level of edge-neighbors in an edge-balanced hypercubic mesh (a) can differ by at most one. Otherwise, faces of hypercubes within the mesh can contain more than one internal vertex (b).
(a) Unrefined
(b) Refined edge
(c) Refined face
(d) All edges refined
Fig. 7. Bisection-based triangulation of a hypercube (shown in 3D) depends entirely on its refined edges
5.2
Vertex Caching
Our local triangulation algorithm only refines hypercube edges that have at least one smaller edge-neighbor. Since hypercubes can have many edgeneighbors, neighbor-finding operations can be cost-prohibitive at runtime. However, since C is edge-balanced, any refined neighbors of a hypercube h along an edge e will contain a vertex located at the midpoint vm of e (see Figures 6a and 5b). Once we determine if vm exists in C, we no longer require these neighbor-finding operations. We therefore cache the vertices of C in a hash-table, (see Algorithm 1). Since each d-cube contains 2d vertices, the cost of this step on a mesh with |h| hypercubes is O(2d · |h|), and the average cost of each vertex lookup is O(1). 5.3
Hypercube Triangulation
Our triangulation algorithm (see Algorithm 2) generates a globally conforming RSB mesh Σ through a local triangulation Σh of each hypercube h ∈ C. This triangulation is entirely determined from a hypercube’s refined edges.
Bisection-Based Triangulations of Nested Hypercubic Meshes
325
Algorithm 1 CacheVertices(C) Require: C is an edge-balanced nested hypercubic mesh. Ensure: Vertices(C) is a spatial index on the vertices of cubes in C. 1. Vertices(C) ← ∅. 2. for all hypercubes h ∈ C do 3. for all vertices v ∈ h do 4. Insert v into Vertices(C).
Algorithm 2 TriangulateHypercubicMesh(C) Require: C is an edge-balanced nested hypercubic mesh. Require: Vertices(C) contains all vertices of hypercubes in C. Require: Σh is3an RSB mesh covering hypercube h ∈ C. Ensure: Σ = {Σh } is a conforming RSB mesh covering C. h∈C
1. for all hypercubes h ∈ C do 2. Σh ← ∅. 3. Let δh be the 0-diamond corresponding to h. 4. Insert δh into Σh . 5. for all edges e ∈ h do 6. Let vertex v be the midpoint of e. 7. if v ∈ Vertices(C) then 8. Let δe be the (d − 1)-diamond associated with edge e. 9. Insert δe into Σh . 10. LocalRefineDiamond(δe , Σh , h).
Algorithm 3 LocalRefineDiamond(δ, Σh , h) Require: The domain of diamond δ intersects h. Require: Σh is a conforming RSB mesh restricted to the domain of hypercube h. Ensure: δ is refined in Σh . 1. for all diamonds δp ∈ Parents(δ) do 2. Let vp be the central vertex of δp . 3. if δp is not refined and vp ∩ h = ∅ then 4. LocalRefineDiamond(δp , Σh , h). 5. // Refine δ by bisecting all of its simplices within Σh 6. RefineDiamond(δ, Σh ).
We first convert each hypercube h ∈ C to an RSB mesh Σh defined by the 0-diamond associated with h (lines 2–2 of Algorithm 2). Since this is a Kuhn-subdivision of h (see Section 4), it contributes d! simplices to Σh . See Figure 7a for an example in 3D. For each edge e ∈ h that is refined in a neighboring hypercube, we add the (d − 1)-diamond δe associated with edge e to Σh , and locally refine δe within Σh . As mentioned in Section 5.2, we can determine the refined edges
326
K. Weiss and L. De Floriani
of a hypercube by checking if the midpoint of each edge is a vertex in C (lines 2–2). The function LocalRefineDiamond(δe , h) (Algorithm 3) ensures that all diamond ancestors of δe whose central vertex intersects h (up to δh ) are added to Σh . This satisfies the transitive closure of the diamond dependency relation, restricted to the domain of h, of each refined edge of h (see [29] for more details). Figure 7 shows some possible triangulations Σh of a 3-cube h. In Figure 7a, none of the edges of h are refined, so Σh is defined by the 0-diamond associated with h and contains d! simplices. This implies that all edge-neighbors of h in C are at the same level of refinement or one level higher in the hierarchy. In Figure 7b one of the edges (red) of h is refined. The two facets of h adjacent to this edge are refined in Σh , as is the center of h. This triangulation occurs when a single edge-neighbor of h that is not a facet-neighbor, is refined. Figure 7c illustrates the triangulation Σh when all four edges along a facet of h are refined. This corresponds to the case where a facet-neighbor of h is refined. Figure 7d illustrates the triangulation Σh of h when all edge-neighbors of h are refined. Σh is a fully-subdivided hypercube [29], and is defined by 2d · d! simplices. Observe that all faces of h in Σh are refined. The following Theorem proves that Algorithm 2 always produces a simplicial complex. Furthermore, the complexity of the generated mesh Σ with respect to the input hypercubic mesh C is bounded by a constant that depends only on the dimension d of the domain. Theorem 5.1 Given an edge-balanced hypercubic mesh C defined 3 by |h| hy{Σh } and percubes, Algorithm 2 generates a conforming RSB mesh Σ = h∈C
is defined by |σ| RSB simplices, where |h| · d! ≤ |σ| < |h| · 2d · d! Proof. To show that Σ is conforming, we need to prove that (a) the triangulation Σh of each hypercube h is locally conforming, and (b) the boundaries Σh ∩ Σh between neighboring hypercubes h and h are also conforming. The first constraint is satisfied since diamond refinement always generates a conforming RSB mesh. The function LocalRefineDiamond(δe , h) can be viewed as the triangulation of the root diamond in a hierarchy of diamonds after some of its edges have been refined. The second constraint relies on the edge-balancing constraint of the input mesh C, as well as the properties of Kuhn-subdivided and fully-subdivided hypercubes (see [29, 31]). Note that, vertex-adjacent hypercubes that are not edge-adjacent are always conforming since their intersection is a vertex. We first consider the case where the two neighboring hypercubes h and h are at the same level of refinement. Since opposite pairs of lower dimensional faces of a Kuhn-subdivided hypercube are conforming, unrefined faces of neighboring hypercubes at the same resolution are conforming. Next, since
Bisection-Based Triangulations of Nested Hypercubic Meshes
327
our refinement rule in Algorithm 2 depends on the closed refinement of the edges, the lower dimensional faces in h ∩ h are guaranteed to bisect in Σh and Σh , i.e. the parents of a diamond δe associated with edge e, restricted to h ∩ h will be identical for Σh and Σh . Finally, if h and h are not the same size, assume, without loss of generality, that the level of h is and that of h is ( + 1). Due to the edge-balancing constraint on C, it is not possible for faces of h that belong to h ∩ h to be refined. Thus, the only cases we need to consider are the refinement of faces of h in h ∩ h . Since the edges in h ∩ h are refined by Algorithm 2, all higher dimensional faces are refined as well. We conclude the proof by discussing the complexity of Σ. Let |h| be the number of hypercubes in C and |σ| be the number of simplices in Σ. Since Σh minimally contains the d! simplices obtained through a Kuhn-subdivision of h (i.e. the simplices in its corresponding 0-diamond), the lower bound on |σ| is |h|·d! simplices. This lower limit is obtained when C is a uniform resolution hypercubic mesh. Similarly, since each edge (i.e. the (d − 1)-faces) of a hypercube in C can be refined at most once, all j-faces, j < (d − 1), can be refined at most once. Thus, each local triangulation Σh , in the worst case, is a fully-subdivided hypercube. Σh therefore contributes at most 2d · d! simplices. This gives an upper bound on |σ| of |h| · 2d · d!. This upper bound is not tight since it is not possible for all edges of all hypercubes within a hypercubic mesh to be refined at the same time.
6 Results As a proof of concept, we demonstrate the bisection-based algorithm of Section 5 in an adaptive 3D isosurfacing application. We compare triangulations extracted from edge-balanced cubical meshes using bisection-based and Delaunay-based triangulations as well as triangulations extracted from a corresponding hierarchy of diamonds (see Table 1). In each case, C is a nested hypercubic mesh (in 3D), Σh is its associated bisection-based triangulation (extracted using Algorithm 2), Σp is its associated Delaunay-based triangulation (using the Algorithm of Plantinga and Vegter [18]) and Σd is a diamond-based RSB mesh extracted from a corresponding hierarchy of diamonds using the same extraction criteria. In all cases, the error associated with a cube or a diamond is the maximum interpolation error (computed using barycentric interpolation on its simplicial decomposition) among the points within its domain. Recall that in the Delaunay-based triangulation of [18], Steiner vertices are inserted at the midpoint of every cube, but no additional vertices are added to their faces. In contrast, our bisection-based triangulation only adds Steiner points to cubes that have a smaller edge-neighbor, but can also add Steiner points to a hypercube’s faces. As we can see from Table 1, the overhead of our algorithm in the 3D case compared to the Delaunay-based triangulation
328
K. Weiss and L. De Floriani
Table 1. Number of vertices |v|, primitives (cubes |h| or diamonds |δ|), and tetrahedra |σ| in variable resolution meshes extracted from scalar fields of maximum resolution N (i.e., datasets defined by (2N + 1)3 samples). For each dataset, C is an edge-balanced nested hypercubic mesh, Σh is a conforming diamond mesh generated from C using Algorithm 2, Σp is the tetrahedral mesh extracted from C using the Delaunay-based triangulation algorithm of Plantinga and Vegter [18] and Σd is a diamond mesh extracted from the corresponding hierarchy of diamonds.
N
Mesh type
Vertices |v|
Fuel
6
C Σh Σp Σd
20.0 37.5 35.3 26.7
Hydrogen
7
C Σh Σp Σd
82.2 156 147 108
Dataset
Bunny
Engine
Tooth
Bonsai
Head
Armadillo
Primitives |h| or |δ|
Tetrahedra |σ|
K K K K
15.3 K 43.7 K 23.2 K
218 K 206 K 87.5 K
K K K K
62.4 K 187 K 93.0 K
928 K 853 K 357 K
8
C Σh Σp Σd
627 K 1.20 M 1.09 M 848 K
467 K 1.45 M 735 K
7.20 M 6.43 M 2.73 M
8
C Σh Σp Σd
1.11 2.06 1.97 1.60
M M M M
850 K 2.52 M 1.40 M
12.7 M 11.6 M 5.29 M
8
C Σh Σp Σd
241 461 421 325
K K K K
181 K 556 K 281 K
2.76 M 2.48 M 1.05 M
8
C Σh Σp Σd
1.69 2.97 3.0 2.20
M M M M
1.31 M 3.54 M 1.94 M
17.9 M 17.6 M 7.57 M
8
C Σh Σp Σd
1.04 1.99 1.82 1.38
M M M M
784 K 2.39 M 1.20 M
11.9 M 10.7 M 4.20 M
8
C Σh Σp Σd
262 513 458 349
K K K K
195 K 621 K 301 K
3.0 M 2.70 M 1.12 M
Bisection-Based Triangulations of Nested Hypercubic Meshes
329
(in terms of the number of vertices and tetrahedra) is approximately 10%. However, since the bisection-based algorithm generates conforming RSB meshes that satisfy the direct dependency relation of a hierarchy of diamonds, they can be efficiently encoded as diamond meshes, requiring O(|δ|) space, rather than as irregular simplicial meshes, requiring O(|σ|) space [30]. Furthermore, while our bisection-based algorithm is defined in a dimension– independent manner, there would be difficulties in generalizing the Delaunaybased algorithm to higher dimensions. For example, a four-dimensional version of the Delaunay-based algorithm would require explicit triangulation cases for the different edge refinement configurations of the cubical faces of a 4-cube. From Table 1, we see that nested cubical meshes C require approximately 66% the number of primitives (hypercubes) as their corresponding diamond meshes Σd to satisfy the same constraints. However, their triangulations Σh generate approximately 2.5 times as many tetrahedra as Σd . We can see this in Figure 8, which illustrates a cubical mesh extracted from the 2013 Bunny dataset (Figure 8a) as well as its bisection-based triangulation (Figure 8b), and the diamond mesh extracted from a corresponding hierarchy of diamonds (Figure 8c), for the isosurface depicted in Figure 8d.
7 Concluding Remarks In this paper, we introduced a dimension–independent algorithm for triangulating nested hypercubic meshes. This triangulation was motivated by the observation that 0-diamonds have a hypercubic domain, and thus nested hypercubic meshes can be viewed as (non-conforming) diamond-meshes composed of only 0-diamonds. We compared our bisection–based triangulation to the Delaunay-based triangulation of Plantinga and Vegter in the 3D case. Although our 3D triangulation has a slight overhead with respect to the number of simplices and vertices, it admits an efficient representation as a diamond-based RSB mesh, which can significantly reduce the storage costs. Furthermore, since our algorithm is defined in arbitrary dimensions, it can be easily incorporated into existing implementations of nested hypercubic meshes to generate high-quality triangulations for use in downstream applications. We are currently working on a 4D implementation of our algorithm to explore the benefits of this approach for the analysis and visualization of time-varying volumetric datasets. As future work, we are investigating the relationship between meshes generated by hierarchies of simplices, which can be non-conforming, those generated by hierarchies of diamonds, which are always conforming, and those generated by a bisection-based triangulation of a nested hypercubic mesh. Let us call the family of meshes generated by simplex bisection as S, the family of meshes generated by diamond refinement as D and the family of meshes generated by triangulating nested hypercubic meshes according to
330
K. Weiss and L. De Floriani
(a) Nested cubical mesh, C
(b) Bisection-based triangulation, Σh
(c) Diamond mesh, Σd
(d) Extracted isosurface
Fig. 8. Decompositions of the 2013 bunny dataset (a-c) associated with isovalue κ = 0 (d), colored by level of resolution. An edge-balanced cubical mesh (a) with error less than 0.3% contains 156K cubes. Its bisection-based triangulation Σh (b) contains 691K diamonds. A diamond-based mesh Σd (c) contains 166K diamonds.
Algorithm 2 as H. It has previously been observed [8] in the 2D case that H ⊂ D. Since each diamond refinement is defined in terms of several simplex bisection operations, and since the hypercube triangulation scheme is defined in terms of diamond refinements, the following relationship holds in arbitrary dimension: H ⊂ D ⊂ S. (1)
Bisection-Based Triangulations of Nested Hypercubic Meshes
(a) Σh ∈ H
(b) Σd ∈ D
331
(c) Σs ∈ S
Fig. 9. Minimal RSB triangulations to generate a given RSB simplex (blue triangle) for nested hypercubic mesh (a), hierarchy of diamonds (b) and hierarchy of simplices (c). Note that Σd ∈ / H since it does not correspond to an edge-balanced hypercubic / D since it is not conforming. mesh, and Σs ∈
Note that each relationship defines a proper subset. I.e. there exist RSB meshes that are not conforming (i.e. Σ ∈ S, but Σ ∈ / D), as well as conforming RSB meshes that are not extractable from a triangulated edge-balanced hypercubic mesh. (i.e. Σ ∈ D, but Σ ∈ / H, see Figure 9 for examples in 2D).
Acknowledgments The authors would like to thank the anonymous reviewers for their helpful suggestions. This work has been partially supported by the National Science Foundation under grant CCF-0541032. We would also like to thank Michael Kazhdan for providing us with the software used to generate the Armadillo distance field, and Ramani Duraiswami and Nail Gumerov for the Bunny dataset. All other datasets are courtesy of volvis.org.
References 1. Atalay, F., Mount, D.: Pointerless implementation of hierarchical simplicial meshes and efficient neighbor finding in arbitrary dimensions. International Journal of Computational Geometry and Applications 17(6), 595–631 (2007) 2. Bern, M., Eppstein, D.: Mesh generation and optimal triangulation. In: Du, D., Hwang, F. (eds.) Computing in Euclidean geometry, vol. 1, pp. 23–90. World Scientific, Singapore (1992) 3. Bern, M., Eppstein, D., Gilbert, J.: Provably good mesh generation. Journal of Computer and System Sciences 48(3), 384–409 (1994) 4. Bey, J.: Simplicial grid refinement: on freudenthal’s algorithm and the optimal number of congruence classes. Numerische Mathematik 85(1), 1–29 (2000) 5. Bhaniramka, P., Wenger, R., Crawfis, R.: Isosurface construction in any dimension using convex hulls. IEEE Transactions on Visualization and Computer Graphics 10(2), 130–141 (2004)
332
K. Weiss and L. De Floriani
6. Br¨ onnimann, H., Glisse, M.: Octrees with near optimal cost for ray-shooting. Computational Geometry 34(3), 182–194 (2006) 7. Dahmen, W.A., Micchelli, C.A.: On the linear independence of multivariate b-splines, i. triangulations of simploids. SIAM Journal on Numerical Analysis 19(5), 993–1012 (1982) 8. De Floriani, L., Magillo, P.: Multiresolution mesh representation: models and data structures. In: Floater, M., Iske, A., Quak, E. (eds.) Principles of Multiresolution Geometric Modeling. Lecture Notes in Mathematics, pp. 364–418. Springer, Berlin (2002) 9. Evans, W., Kirkpatrick, D., Townsend, G.: Right-triangulated irregular networks. Algorithmica 30(2), 264–286 (2001) 10. Garimella, R.: Conformal refinement of unstructured quadrilateral meshes. In: Proceedings of the 18th International Meshing Roundtable, pp. 31–44. Springer, Heidelberg (2009) 11. Greaves, D.M., Borthwick, A.G.L.: Hierarchical tree-based finite element mesh generation. International Journal for Numerical Methods in Engineering 45(4), 447–471 (1999) 12. Ito, Y., Shih, A., Soni, B.: Efficient hexahedral mesh generation for complex geometries using an improved set of refinement templates. In: Proceedings of the 18th International Meshing Roundtable, pp. 103–115 (2009) 13. Maubach, J.M.: Local bisection refinement for n-simplicial grids generated by reflection. SIAM Journal on Scientific Computing 16(1), 210–227 (1995) 14. Min, C.: Local level set method in high dimension and codimension. Journal of Computational Physics 200(1), 368–382 (2004) 15. Moore, D.: Simplicial mesh generation with applications. Ph.D. thesis, Cornell University, Ithaca, NY, USA (1992) 16. Moore, D.: The cost of balancing generalized quadtrees. In: Proc. ACM Solid Modeling, pp. 305–312. ACM, New York (1995) 17. Moore, D., Warren, J.: Adaptive simplicial mesh quadtrees. Houston J. Math 21(3), 525–540 (1995) 18. Plantinga, S., Vegter, G.: Isotopic meshing of implicit surfaces. The Visual Computer 23(1), 45–58 (2007) 19. Roettger, S., Heidrich, W., Slusallek, P., Seidel, H.: Real-time generation of continuous levels of detail for height fields. In: Proceedings Central Europe Winter School of Computer Graphics (WSCG), pp. 315–322 (1998) 20. Samet, H.: Foundations of Multidimensional and Metric Data Structures. The Morgan Kaufmann series in computer graphics and geometric modeling. Morgan Kaufmann, San Francisco (2006) 21. Schneiders, R.: Refining quadrilateral and hexahedral element meshes. In: 5th International Conference on Grid Generation in Computational Field Simulations, pp. 679–688. Mississippi State University (1996) 22. Sivan, R.: Surface modeling using quadtrees. Ph.D. thesis, University of Maryland, College Park (1996) 23. Sivan, R., Samet, H.: Algorithms for constructing quadtree surface maps. In: Proc. 5th Int. Symposium on Spatial Data Handling, pp. 361–370 (1992) 24. Sundar, H., Sampath, R.S., Biros, G.: Bottom-up construction and 2:1 balance refinement of linear octrees in parallel. SIAM Journal of Scientific Computing 30(5), 2675–2708 (2008) 25. Traxler, C.T.: An algorithm for adaptive mesh refinement in n dimensions. Computing 59(2), 115–137 (1997)
Bisection-Based Triangulations of Nested Hypercubic Meshes
333
26. Von Herzen, B., Barr, A.H.: Accurate triangulations of deformed, intersecting surfaces. In: Proceedings ACM SIGGRAPH, pp. 103–110. ACM, New York (1987) 27. Weigle, C., Banks, D.: Complex-valued contour meshing. In: Proceedings IEEE Visualization, pp. 173–180. IEEE Computer Society, Los Alamitos (1996) 28. Weiser, A.: Local-mesh, local-order, adaptive finite element methods with a posteriori error estimators for elliptic partial differential equations. Ph.D. thesis, Yale University (1981) 29. Weiss, K., De Floriani, L.: Diamond hierarchies of arbitrary dimension. Computer Graphics Forum (Proceedings SGP 2009) 28(5), 1289–1300 (2009) 30. Weiss, K., De Floriani, L.: Supercubes: A high-level primitive for diamond hierarchies. IEEE Transactions on Visualization and Computer Graphics (Proceedings IEEE Visualization 2009) 15(6), 1603–1610 (2009) 31. Weiss, K., De Floriani, L.: Simplex and diamond hierarchies: Models and applications. In: Hauser, H., Reinhard, E. (eds.) EG 2010 - State of the Art Reports, pp. 113–136. Norrk¨ oping, Sweden (2010) 32. Westermann, R., Kobbelt, L., Ertl, T.: Real-time exploration of regular volume data by adaptive reconstruction of isosurfaces. The Visual Computer 15(2), 100–111 (1999) 33. Zorin, D., Schroder, P.: A unified framework for primal/dual quadrilateral subdivision schemes. Computer Aided Geometric Design 18(5), 429–454 (2001)
This page intentionally left blank
Optimizing Voronoi Diagrams for Polygonal Finite Element Computations Daniel Sieger1 , Pierre Alliez2 , and Mario Botsch1 1 2
Bielefeld University, Germany {dsieger,botsch}@techfak.uni-bielefeld.de INRIA Sophia-Antipolis, France [email protected]
Summary. We present a 2D mesh improvement technique that optimizes Voronoi diagrams for their use in polygonal finite element computations. Starting from a centroidal Voronoi tessellation of the simulation domain we optimize the mesh by minimizing a carefully designed energy functional that effectively removes the major reason for numerical instabilities—short edges in the Voronoi diagram. We evaluate our method on a 2D Poisson problem and demonstrate that our simple but effective optimization achieves a significant improvement of the stiffness matrix condition number.
1 Introduction The finite element method (FEM) is an indispensable tool for solving partial differential equations in applied mathematics, computational physics, medical simulations and computer animation. The simulation domain is typically discretized into triangle and quadrangle elements in 2D, or tetrahedral and hexahedral elements in 3D, respectively. These conventional elements are well established and allow for simple and efficient implementations. However, they require complex remeshing when it comes to adaptive refinement, merging, cutting, or fracturing, i.e., general topological changes of the simulation domain [26, 27, 46, 45, 8, 44]. As a consequence, generalizations of FE methods to arbitrary polygonal or polyhedral meshes have gained increasing attention, both in computational physics [34, 36, 37] and in computer graphics [43, 25]. For instance, when cutting a tetrahedron into two pieces, polyhedral FEM can directly process the resulting two elements, while standard FEM has to remesh them into tetrahedra first. Polygonal FEM was also shown to yield good results in topology optimization, since the resulting meshes are less biased to certain principle directions than the typically employed regular tessellations [37]. Independent of the employed element type, the accuracy and stability of numerical computations crucially depend on a high quality mesh consisting
336
D. Sieger, P. Alliez, and M. Botsch
Fig. 1. A centroidal Voronoi tessellation (CVT) generated by interleaving refinement and Lloyd relaxation [38] (left). Most elements are well-shaped quasi-regular hexagons. The dual constrained Delaunay triangulation is shown on the right.
of well-shaped, non-degenerate elements only. A single bad element may be sufficient to destroy the numerical conditioning [30]. For triangular and tetrahedral meshes quality criteria for element shapes are well understood [30], and successful mesh generation and optimization techniques based on Delaunay refinement [28, 29, 7] or variational optimization [38, 39, 41] have been proposed. In contrast, research on similar criteria and optimization techniques for general polygonal meshes has not yet reached a mature state. Most polygonal FE methods use Voronoi tessellations to discretize the simulation domain [35, 32, 37]. The corresponding mesh generation and optimization is then typically based on centroidal Voronoi tessellations (CVTs, see Figure 1). However, the resulting element quality and numerical conditioning is not yet comparable to high quality triangle or tetrahedral meshes. In this paper we show that even high-quality CVT meshes can contain numerically ill-conditioned elements, which is due to very short edges in the Voronoi diagram. We present a simple variational mesh optimization that effectively removes short edges from a CVT input mesh by minimizing a suitable energy functional. We evaluate our method on a 2D Poisson problem by comparing the stiffness matrix condition number before and after optimization. Our method reliably improves the numerical condition—up to several orders of magnitude for complex examples.
2 Background The numerical robustness of solving a partial differential equation (PDE) depends on the condition number of the resulting linear system, which itself is strongly influenced by the shape of the finite elements [30]. Our goal is to optimize the mesh in order to improve the numerical conditioning. The relation between the element shape and the resulting matrix condition number cannot be answered in general as it depends on the type of PDE to
Optimizing Voronoi Diagrams for Polygonal FE Computations
337
be solved. In this paper we follow [30] and focus on the Poisson equation −Δu = f , since this problem has a large number of applications and is very similar in structure to linear elasticity computations. In the following we briefly review the basic concepts of (polygonal) finite element methods, and refer the reader to the textbooks [4, 20] and the survey [34] for more details on classical FEM and polygonal FEM, respectively. For a 2D Poisson problem we find a function u : IR2 → IR such that −Δu = f in Ω ⊂ IR2 u = u¯ on ∂Ω.
(1)
We choose f = Δ¯ u such that u ¯ is the (known) solution of the PDE, to which we can compare our approximation. The function u is approximated by n basis functions Ni interpolating the nodal degrees of freedom ui u(x) ≈
n
ui Ni (x).
(2)
i=1
This approximation is inserted into the weak form of the problem (1), which leads to a linear system to be solved for the nodal values ui : ⎛ ⎞ ⎛ ⎞ 4 u1 f1 Ki,j = Ω ∇Ni · ∇Nj dΩ ⎜ .. ⎟ ⎜ .. ⎟ (3) K⎝ . ⎠ = ⎝ . ⎠ with 4 f i = Ω f Ni dΩ. un fn How difficult it is to numerically solve (3) depends on the condition number κ(K) = λmax /λmin of the stiffness matrix K [15]. A large condition number causes iterative solvers, such as conjugate gradients [3], to converge very slowly and direct solvers, such as sparse Cholesky factorizations [6], to suffer from round-off errors. For extreme condition numbers the linear system cannot be solved at all. While the smallest eigenvalue λmin mainly depends on the size of the smallest element, the largest eigenvalue λmax may become arbitrarily large already for a single badly-shaped element [30]. As a consequence, one bad element is sufficient to spoil the numerical robustness. For triangle or tetrahedral meshes it is well known what makes up a numerically robust linear element [30]: Both small and large angles must be avoided. To this end, a number of very successful mesh improvement approaches have been proposed, being based on either Delaunay refinement [28, 29, 9] or some variational optimization [1, 38, 22, 39, 10, 41]. So-called pliant methods, which combine local topological changes (e.g., Delaunay refinement) and vertex relocation (e.g., Laplacian smoothing or Lloyd relaxation) have been found to be superior over methods involving one of the techniques only [5, 22, 38]. When general polygonal or polyhedral elements are to be used for FE computations, the Ni are no longer the classical linear barycentric coordinates, but are replaced by generalized barycentric coordinates [33]: These functions
338
D. Sieger, P. Alliez, and M. Botsch
interpolate nodal values ' (Ni (xj ) = δij ), are linear on element edges, form a partition of unity ( i Ni ≡ 1), are bounded non-negative (0 ≤ Ni ≤ 1), are C 0 across and C ∞ within elements, and have linear precision. Examples of generalized barycentric coordinates are Wachspress coordinates [42], mean value coordinates [12, 13, 18, 43], Laplace interpolants [17], harmonic coordinates [21, 25], and maximum entropy coordinates [31, 19]. For general polygonal or polyhedral meshes quality criteria for their numerical robustness are not well-established. One can observe, however, that short edges, small angles, and concave corners lead to numerical problems. As a consequence, Voronoi tessellation of the simulation domain are frequently used, since they guarantee convex elements. Well-shaped, isotropic Voronoi cells can be achieved by Lloyd clustering [38] or energy minimization [23], leading to centroidal Voronoi tessellations (CVTs, see Figure 1). While CVTs guarantee convex elements and lead to well-behaved angles, they do not explicitly penalize short edges. Consequently, even “nice” CVT meshes may contain a number of very short Voronoi edges (see Figure 2). Since on a short edge (xi , xj ) the shape function Ni decreases from 1 (at xi ) to 0 (at xj ) over the very short distance xi − xj , the gradient ∇Ni becomes extremely large. These large gradients enter the stiffness matrix 4 through the products ∇Ni · ∇Nj and lead to a large maximum eigenvalue λmax , and thus to a high condition number κ = λmax /λmin . Note that this is independent of the generalized barycentric coordinate employed, since they all satisfy the Lagrange property Ni (xi ) = δij and are linear on edges, i.e., they are actually identical on edges of the tessellation. Note also that a single short edge (a single bad element) may destroy the numerical robustness of the FE computation.
3 Mesh Optimization We now describe a mesh improvement scheme that effectively removes short edges from a CVT, while keeping all the beneficial properties of a Voronoi
Fig. 2. While providing isotropic cells, centroidal Voronoi tessellations may still contain elements with short edges. Voronoi cells incident to an edge shorter than 5% of the specified edge length are depicted in red.
Optimizing Voronoi Diagrams for Polygonal FE Computations
339
Fig. 3. Short edges in the Voronoi diagram (left) correspond to triangle circumcenters of the dual Delaunay mesh (right) being spatially close to another
tessellation. Since the Voronoi diagram is fully defined by the vertices vi of its dual (constrained) Delaunay triangulation, the m Delaunay vertices (v1 , . . . , vm ) are the degrees of freedom of our optimization. Let us first investigate the relationship between the Delaunay vertices vi and short edges (xi , xj ) in the Voronoi diagram. The Voronoi vertices xi are circumcenters of Delaunay triangles. A short Voronoi edge (xi , xj ) corresponds to two spatially close circumcenters xi and xj (see Figure 3). While a CVT maximizes the compactness of Voronoi cells [23] and yields well-shaped dual Delaunay triangles, it does not prevent short Voronoi edges. As depicted in Figure 3, four almost co-circular Delaunay vertices lead to two almost coincident circumcenters, i.e., to a short Voronoi edge. We propose to prevent circumcenters from coming close to each other by shifting them as much as possible into the interior of their corresponding triangles. The point that is “as interior as possible” is the triangle’s incenter, which maximizes the distance from the triangle’s edges. The question is therefore how to relocate the Delaunay vertices vi such that the triangles’ circumcenters are shifted towards their incenters. To this end we setup an energy that measures the (squared) distances of circumcenters to incenters and minimize this energy with respect to the Delaunay vertices vi . The squared distance d2 from a triangle’s circumcenter to its incenter can elegantly be computed from its circumradius R and inradius r through Euler’s triangle formula as d2 = R (R − 2r). Our energy simply accumulates the squared distances of all triangles t ∈ T : E(v1 , . . . , vm ) =
1 Rt (Rt − 2rt ) . 2 t∈T
For a triangle with edge lengths a, b, c and area A (see Figure 4) the circumradius R and inradius r can be computed as R =
abc 4A
and
r =
2A . a+b+c
The simple form of E allows us to evaluate and minimize the energy easily and efficiently. The energy landscape is very steep, such that it turned out to
340
D. Sieger, P. Alliez, and M. Botsch
vc b va
A R
r c
a vb
Fig. 4. Left: A triangle (va , vb , vc ) with edge lengths a, b, c, area A, circumradius R, and inradius r. Right: For equilateral triangles circumcenter and incenter coincide.
be sufficient to minimize E by a simple iterative gradient descent [14]. The resulting mesh optimization algorithm is sketched in the pseudo-code below and described in more detail in the following. Algorithm 1. Mesh Optimization Input: Constrained Delaunay Triangulation with vertices vi ∈ V and faces T 1
// Flip edges to improve vertex valences T = improve valences(T )
2
// Initialize vector of vertices V(0) = (v1 , . . . , vm )
3
// Iteratively minimize energy for k = 0, 1, 2, . . . do
4 5 6 7 8 9 10 11 12 13
// Compute gradient G = ∇E(V(k) ) // Determine step size for h = 1, 12 , 14 , . . . , ε do if E(V(k) − h G) < E(V(k) ) then // Update vertex positions V(k+1) = V(k) − h G end end // Convergence check if h == ε then // Re-establish Delaunay property return Delaunay(V(k) , T ) end end
For the iterative optimization we stack all degrees of freedom, i.e., the positions of the Delaunay vertices, into a 2m-dimensional vector V(0) = (vT1 , . . . , vTm )T . In each iteration k all vertices are shifted in the direction of the negative gradient −∇E(V(k) ) by a step size h:
Optimizing Voronoi Diagrams for Polygonal FE Computations
V(k+1) ← V(k) − h ∇E(V(k) ).
341
(4)
Gradient Computation (Line 4): In order to construct the gradient, we have to compute the partial derivatives of E with respect to all vertices va , which thanks to the simple energy can be done analytically: ∂E ∂Rt ∂rt = (Rt − rt ) − Rt . ∂va ∂va ∂va t∈T
The ingredients are the partial derivatives of circumradius and inradius, which also have a simple analytical form. For a triangle (va , vb , vc ) the derivatives of circumradius and inradius are ∂R 1 1 1 ⊥ = R 2 (va − vb ) + 2 (va − vc ) − (vc − vb ) , ∂va c b 2A ∂r −2 A A a+b+c ⊥ = (v − v ) + (v − v ) − (v − v ) , a b a c c b ∂va (a + b + c)2 c b 2 where (x, y)⊥ = (−y, x) denotes rotation by 90◦ . Step Size (Lines 5, 6): After computing the gradient, we determine the step size h by a simple bisection line search. Starting with h = 1 we successively halve h until the step decreases the energy. Once we found a step size h to reduce the energy we perform the step. In our experiments, we chose ε = FLT MIN. In order to prevent triangles from inverting during the optimization we return an infinite energy value as soon as a triangle has negative area. We stop the iterative optimization if even the minimum step size h = ε does not manage to further decrease the energy. Vertex Update (Line 7): After computing the gradient and determining a step size all vertex positions are updated at once. Unconstrained vertices vi in the interior of the domain Ω are simply moved in the direction of their negative gradient as described by (4). Constrained vertices on the boundary δΩ need special treatment, where we consider two different cases: Boundary vertices representing constrained corners of the boundary polygon are not moved. Vertices on straight boundary edges (that have been refined by the initial CVT computation) are optimized along the constrained edge by projecting their gradients onto that edge. Boundary Weighting: The Voronoi cells on the domain boundary are clamped against the input boundary polygon using a bounded Voronoi diagram [38] (see Figures 1, 2). As a consequence, Voronoi edges that are dual to the domain boundary are clipped, thereby roughly halving the lengths of these Voronoi edges. The optimization therefore has to try about twice as hard to keep their interior edge endpoints (which are circumcenters of boundary triangles) away from the domain boundary in order to avoid short
342
D. Sieger, P. Alliez, and M. Botsch v3
v4
v2
v1
Fig. 5. In a pre-process we flip edges to reduce the deviation from valence 6
Voronoi edges. We therefore give boundary triangles twice the weight by multiplying their contributions to both the energy and the gradient by 2. This simple heuristic effectively avoids situations where interior triangles push the circumcenters of boundary triangles towards (or even across) boundary edges. Preprocessing (Line 1): As shown in Figure 4, minimizing the distance between circumcenter and incenter also optimizes for equilateral triangles, since those are minima of the energy. Perfectly equilateral triangles, however, can only be achieved around vertices of valence 6. In a pre-process we therefore modify the input triangulation in order to bring the valences closer to the optimal valence 6 (respectively 4 on the boundary). In particular, we repeatedly iterate over all edges and flip an edge if this decreases the squared deviation from the optimal valences of the four affected vertices v1 , . . . , v4 : 4
2
(valence(vi ) − optimal valence(vi ))
i=1
This simple topological preprocessing allows for significantly better results of the geometric optimization of vertex positions. Delaunay Update (Line 11): After flipping edges in a pre-process and changing all vertex positions during the optimization, the resulting triangulation might no longer be a Delaunay triangulation. Since in the end we rely on the Delaunay property in order to obtain a valid Voronoi diagram with convex elements, we finally reconstruct a (constrained) Delaunay triangulation (V(k) , T ). To this end, we simply check each edge of the triangulation and flip it if the Delaunay property is not satisfied. A more efficient implementation would be possible by filtering Delaunay relocations, as described in [24]. Note that even before this step the mesh is already almost a Delaunay triangulation, since the geometric optimization leads to very regular triangulations with well-shaped faces. Consequently, only very few edge flips are necessary, which therefore hardly affects the energy.
Optimizing Voronoi Diagrams for Polygonal FE Computations
343
Fig. 6. Polygonal FEM approximation with Voronoi meshes of increasing degrees of freedom: 187 (left), 712 (middle), 4760 (right)
4 Results In this section we evaluate our mesh improvement technique based on the 2D Poisson problem (1) with the constraint function u ¯(x, y) = xy sin(3πx) sin(3πy). For the numerical experiments we employ mean value coordinates [18] as the shape functions Ni in (2). We also compared to harmonic coordinates [21] and maximum entropy coordinates [19], but found that the choice of the shape function does not make a significant difference. We solve the linear system (3) using the sparse Cholesky factorization of CHOLMOD [6]. Figure 6 shows the resulting approximations for several resolutions. Our mesh optimization technique is implemented in C++ using the CGAL library [11]. It requires less than one second for the smaller examples and about one minute for the complex mesh of Figure 10 (Mac Pro, 2.66 GHz Intel Xeon, single-threaded). In order to evaluate the numerical improvement we compare the condition numbers before and after the mesh optimization. Our experiments indicate that edges in the range of 1%–5% of the mean edge length start to severely hurt the numerical robustness. In the following figures we therefore highlight elements with edges shorter than 5% of the target edge length specified by the sizing field. As depicted by Figure 7 a CVT of a trivial shape may already contain arbitrarily short edges. Our mesh improvement technique removes all edges shorter than 5% of the specified edge length and decreases the condition number from 2943 to 407. On the slightly more complex A-shape shown in Figure 8 the optimization also removes all the short edges below 5% and thereby reduces the condition number from 421 to 75. Mesh sizing is an important aspect of high quality mesh generation, for instance for complex input shapes or if higher accuracy is required in certain regions of the simulation domain. Although our simple energy does not explicitly take the sizing field into account, the grading is nicely preserved while short edges are removed. We experimented with an explicit incorporation of the sizing function as well as with a normalization of the squared distance of
344
D. Sieger, P. Alliez, and M. Botsch
Fig. 7. Comparison between a CVT (left) and an optimized mesh (right) for the unit square. The underlying Delaunay triangulation contains 1722 triangles. The condition number decreases from 2943 to 407.
Fig. 8. CVT (left) and optimized mesh (right), corresponding to a dual Delaunay triangulation of 1799 triangles. The condition number decreases from 421 to 75.
circum- and incenter by the triangle’s area, but did not notice any significant difference, such that we kept our simple energy formulation. Optimization results for graded meshes are shown in Figure 9 for the Lake Superior and in Figure 10 for a strongly graded mesh generated from a graylevel photograph. Note that the extreme condition number for the CVT of the Lake Superior is not necessarily a typical example, but it demonstrates that the chance for degenerate edges in complex CVT meshes increases significantly. The high condition number in Figure 10 is mainly due to the high number of elements and the extreme grading field.
Optimizing Voronoi Diagrams for Polygonal FE Computations
345
Fig. 9. CVT (top) and optimized mesh (bottom) for Lake Superior using a KLipschitz sizing function [2] with K = 0.7. The underlying Delaunay triangulation contains 4036 triangles. The condition number reduces from 371877 to 190.
We compared the results of our mesh optimization to two other methods capable of removing short edges from Voronoi diagrams, namely (1) collapsing the 10% shortest edges and (2) Laplacian smoothing of the Voronoi vertices (see [10] for an overview). Table 1 compares the condition numbers resulting from the different optimization techniques. While edge collapses and Laplacian smoothing improve the conditioning on the smaller examples, they do not work reliably on the more complex meshes. In contrast, our optimization manages to improve the condition number for all examples. It is important to note that both alternative methods no longer maintain the dual relationship to the underlying Delaunay triangulation and might lead to non-convex elements. Furthermore, they suffer from another disadvantage: The resulting elements in the polygonal mesh are not as well-shaped as in the original CVT
346
D. Sieger, P. Alliez, and M. Botsch
Fig. 10. CVT (left) and optimized mesh (right) for a complex highly-graded mesh generated from a photograph. The underlying Delaunay triangulation contains 113196 triangles. The condition number reduces from 354630 to 44208. Table 1. Comparison of the stiffness matrix condition number for different mesh improvement techniques. From left to right: initial Centroidal Voronoi Tessellation (CVT), our energy minimization, collapsing short edges (EC), and Laplacian smoothing (LS).
Unit Square A-Shape Lake Superior Photo
CVT 2943 421 371877 354630
Ours 407 75 190 44208
EC 401 66 200797 352170
LS 274 43 1.2288e06 39976
or as in our method, which leads to a decrease in approximation accuracy. The L2 errors for the Poisson problem (1) on the different Unit Square meshes (Figures 6 and 7) are 3.2e-6 for our method, 2.4e-5 for edge collapses, and 4.4e-6 for Laplacian smoothing.
5 Discussion Our mesh optimization technique avoids short Voronoi edges by moving each triangle’s circumcenter towards its incenter. Despite its simplicity this approach reliably improves the numerical conditioning in all our experiments.
Optimizing Voronoi Diagrams for Polygonal FE Computations
347
Although motivated by a different downstream application, we realize that our energy is closely related to the concept of well-centered triangulations [41]. A triangulation is called well-centered if each of its triangles contains its circumcenter, a property important for simulations based on discrete exterior calculus [16]. VanderZee and colleagues compute well-centered triangulations by iteratively maximizing the (signed) distance of mesh vertices to the opposite edges of their incident triangles, normalized by circumradii [41]. This pervertex measure is minimized with respect to an Lp -norm, with p typically being 4, 6, 8, or 10, or a combination thereof. The minimization is performed by a nonlinear conjugate gradients solver with carefully tuned line-search and using numerically approximated gradients. In a recent comparison to other mesh improvement schemes [10], the wellcentered optimization (its earlier but equivalent 2D version [40]) was rated as complicated to implement and computationally rather slow. In contrast, our simple L2 energy can be successfully minimized with an easy-to-implement gradient descent based on analytical gradients. For the smaller examples (Unit Square, A-Shape, Lake Superior) the optimization took less than a second, for the complex Photo-mesh it took about one minute. In all examples our method led to a significant improvement in numerical conditioning. Although not our primary goal, we tested our optimized meshes for wellcenteredness. Besides situations where the mesh connectivity simply does not allow for well-centered triangles (e.g., around vertices with valence 3 or 4), almost all triangles are well-centered. An interesting direction for future work would therefore be to combine our simple energy minimization with the more sophisticated topological preprocessing proposed in [40], which could lead to a simpler optimization for well-centered triangulations. Furthermore, our energy can be generalized to 3D in a straightforward manner, which is another promising direction for further investigations.
Acknowledgments The authors are grateful for N. Sukumar for inspiring discussion about polygonal FEM and for providing source code for Maximum Entropy Coordinates. Daniel Sieger and Mario Botsch are supported by the Deutsche Forschungsgemeinschaft (Center of Excellence in “Cognitive Interaction Technology”, CITEC). The authors thank Jonathan R. Shewchuk for providing the various input shapes used throughout this paper. We thank Jan for growing a mustache and providing the awesome photo used for Figure 10.
348
D. Sieger, P. Alliez, and M. Botsch
References 1. Alliez, P., Cohen-Steiner, D., Yvinec, M., Desbrun, M.: Variational tetrahedral meshing. ACM Transactions on Graphics 24(3), 617–625 (2005) 2. Antani, L., Delage, C., Alliez, P.: Mesh sizing with additively weighted Voronoi diagrams. In: Proceedings of the 16th International Meshing Roundtable, pp. 335–346 (2007) 3. Barrett, R., Berry, M., Chan, T.F., Demmel, J., Donato, J., Dongarra, J., Eijkhout, V., Pozo, R., Romine, C., Van der Vorst, H.: Templates for the Solution of Linear Systems: Building Blocks for Iterative Methods, 2nd edn. SIAM, Philadelphia (1994) 4. Bathe, K.J.: Finite Element Procedures, 2nd edn. Prentice Hall, Englewood Cliffs (1995) 5. Bossen, F.J., Heckbert, P.S.: A pliant method for anisotropic mesh generation. In: Proceedings of 5th International Meshing Roundtable, pp. 63–74 (1996) 6. Chen, Y., Davis, T., Hager, W., Rajamanickam, S.: Algorithm 887: Cholmod, supernodal sparse cholesky factorization and update/downdate. ACM Transactions on Mathematical Software 35(3), 1–14 (2008) 7. Cheng, S.W., Dey, T.K., Levine, J.: A Practical Delaunay Meshing Algorithm for a Large Class of Domains. In: Proc. of the 16th Int. Meshing Roundtable, pp. 477–494 (2007) 8. Chentanez, N., Alterovitz, R., Ritchie, D., Cho, L., Hauser, K.K., Goldberg, K., Shewchuk, J.R., O’Brien, J.F.: Interactive simulation of surgical needle insertion and steering. ACM Transactions on Graphics 28(3), 1–88 (2009) ¨ or, A.: Triangulations with locally optimal steiner points. In: 9. Erten, H., Ung¨ SGP 2007: Eurographics Symposium on Geometry Processing, pp. 143–152 (2007) ¨ or, A., Zhao, C.: Mesh smoothing algorithms for complex ge10. Erten, H., Ung¨ ometric domains. In: Proceedings of 18th International Meshing Roundtable, pp. 175–193 (2009) 11. Fabri, A., Giezeman, G., Kettner, L., Schirra, S.: On the design of CGAL a computational geometry algorithms library. Software Practice and Experience 30(11), 1167–1202 (2000) 12. Floater, M.S.: Mean value coordinates. Computer Aided Geometric Design 20(1), 19–27 (2003) 13. Floater, M.S., Kos, G., Reimers, M.: Mean value coordinates in 3D. Computer Aided Geometric Design 22, 623–631 (2005) 14. Gill, P.R., Murray, W., Wright, M.H.: Practical Optimization. Academic Press, London (1981) 15. Golub, G.H., Van Loan, C.F.: Matrix Computations. Johns Hopkins University Press, Baltimore (1989) 16. Hirani, A.N.: Discrete Exterior Calculus. PhD thesis, California Institute of Technology (2003) 17. Hiyoshi, H., Sugihara, K.: Two generalizations of an interpolant based on Voronoi diagrams. International Journal of Shape Modeling 5(2), 219–231 (1999) 18. Hormann, K., Floater, M.S.: Mean value coordinates for arbitrary planar polygons. ACM Transactions on Graphics 25(4), 1424–1441 (2006) 19. Hormann, K., Sukumar, N.: Maximum entropy coordinates for arbitrary polytopes. Computer Graphics Forum 27(5), 1513–1520 (2008)
Optimizing Voronoi Diagrams for Polygonal FE Computations
349
20. Hughes, T.J.R.: The Finite Element Method. Dover Publications, Mineola (2000) 21. Joshi, P., Meyer, M., DeRose, T., Green, B., Sanocki, T.: Harmonic coordinates for character articulation. ACM Transactions on Graphics 26(3), 71 (2007) 22. Klingner, B.W., Shewchuk, J.R.: Agressive tetrahedral mesh improvement. In: Proceedings of the 16th International Meshing Roundtable, pp. 3–23 (2007) 23. Liu, Y., Wang, W., L´evy, B., Sun, F., Yan, D.-M., Lu, L., Yang, C.: On centroidal voronoi tessellation—energy smoothness and fast computation. ACM Trans. on Graphics 28(4), 1–17 (2009) 24. Manh˜ aes de Castro, P.M., Tournois, J., Alliez, P., Devillers, O.: Filtering relocations on a delaunay triangulation. Computer Graphics Forum (Symp. on Geometry Processing) 28(5), 1465–1474 (2009) 25. Martin, S., Kaufmann, P., Botsch, M., Wicke, M., Gross, M.: Polyhedral finite elements using harmonic basis functions. Computer Graphics Forum 27(5), 1521–1529 (2008) 26. O’Brien, J.F., Bargteil, A.W., Hodgins, J.K.: Graphical modeling and animation of ductile fracture. ACM Transactions on Graphics, 291–294 (2002) 27. O’Brien, J.F., Hodgins, J.K.: Graphical modeling and animation of brittle fracture. In: Proceedings of ACM SIGGRAPH 1999, pp. 137–146 (1999) 28. Shewchuk, J.R.: Delaunay Refinement Mesh Generation. PhD thesis, Carnegie Mellon University, Pittsburg (1997) 29. Shewchuk, J.R.: Delaunay refinement algorithms for triangular mesh generation. Computational Geometry 22, 21–74 (2002) 30. Shewchuk, J.R.: What is a good linear finite element? Interpolation, conditioning, anisotropy, and quality measures. Unpublished Preprint (2002) 31. Sukumar, N.: Construction of polygonal interpolants: A maximum entropy approach. International Journal for Numerical Methods in Engineering 61(12), 2159–2181 (2004) 32. Sukumar, N., Bolander, J.E.: Voronoi-based interpolants for fracture modelling. Tessellations in the Sciences; Virtues, Techniques and Applications of Geometric Tilings (2009) 33. Sukumar, N., Malsch, E.A.: Recent advances in the construction of polygonal finite element interpolants. Archives of Computational Methods in Engineering 13(1), 129–163 (2006) 34. Sukumar, N., Tabarraei, A.: Conforming polygonal finite elements. International Journal for Numerical Methods in Engineering 61(12), 2045–2066 (2004) 35. Sukumar, N., Tabarraei, A.: Numerical formulation and application of polygonal finite elements. In: Proceedings of the Seventh International ESAFORM Conference on Material Forming, pp. 73–76 (2004) 36. Tabarraei, A., Sukumar, N.: Application of polygonal finite elements in linear elasticity. International Journal of Computational Methods 3(4), 503–520 (2006) 37. Talischi, C., Paulino, G., Pereira, A.: Polygonal finite elements for topology optimization: A unifying paradigm. International Journal for Numerical Methods in Engineering 82(6), 671–698 (2010) 38. Tournois, J., Alliez, P., Devillers, O.: Interleaving Delaunay refinement and optimization for 2D triangle mesh generation. In: Proceedings of the 16th International Meshing Roundtable, pp. 83–101 (2007) 39. Tournois, J., Wormser, C., Alliez, P., Desbrun, M.: Interleaving Delaunay refinement and optimization for practical isotropic tetrahedron mesh generation. ACM Transactions on Graphics 28(3), 1–75 (2009)
350
D. Sieger, P. Alliez, and M. Botsch
40. VanderZee, E., Hirani, A.N., Guoy, D., Ramos, E.: Well-centered planar triangulation – an iterative approach. In: Proceedings of the 16th International Meshing Roundtable, pp. 121–138 (2007) 41. VanderZee, E., Hirani, A.N., Guoy, D., Ramos, E.: Well-centered triangulation. SIAM Journal on Scientific Computing 31(6), 4497–4523 (2010) 42. Wachspress, E.L.: A Rational Finite Element Basis. Academic Press, London (1975) 43. Wicke, M., Botsch, M., Gross, M.: A finite element method on convex polyhedra. Computer Graphics Forum 26, 355–364 (2007) 44. Wicke, M., Ritchie, D., Klingner, B., Burke, S., Shewchuk, J.R., O’Brien, J.F.: Dynamic local remeshing for elastoplastic simulation. ACM Transactions on Graphics 29(3) (2010) (to appear) 45. Wojtan, C., Th¨ urey, N., Gross, M., Turk, G.: Deforming meshes that split and merge. ACM Transactions on Graphics 28(3), 76:1–76:10 (2009) 46. Wojtan, C., Turk, G.: Fast viscoelastic behavior with thin features. ACM Transactions on Graphics 27(3), 47:1–47:8 (2008)
Creating Geometry and Mesh Models for Nuclear Reactor Core Geometries Using a Lattice Hierarchy-Based Approach Timothy. J. Tautges1 and Rajeev Jain2 Argonne National Laboratory, Argonne, IL 60439, USA [email protected], [email protected]
Summary. Nuclear reactor cores are constructed as rectangular or hexagonal lattices of assemblies, where each assembly is itself a lattice of fuel, control, and instrumentation pins, surrounded by water or other material that moderates neutron energy and carries away fission heat. We describe a system for generating geometry and mesh for these systems. The method takes advantage of information about repeated structures in both assembly and core lattices to simplify the overall process. The system allows targeted user intervention midway through the process, enabling modification and manipulation of models for meshing or other purposes. Starting from text files describing assemblies and core, the tool can generate geometry and mesh for these models automatically as well. Simple and complex examples of tool operation are given, with the latter demonstrating generation of meshes with 12 million hexahedral elements in less than 30 minutes on a desktop workstation, using about 4 GB of memory. The tool is released as open source software as part of the MeshKit mesh generation library. Keywords: Reactor Core, Mesh Generation, Lattice-Based Geometry.
1 Introduction Reactor cores can be described as a two-level hierarchy of lattices; the first level of the hierarchy corresponds to fuel assemblies, formed as a lattice of cylindrical pins, while in the second level assemblies of various types are arranged in a lattice to form the reactor core. Generation of geometry and mesh models for reactor cores can be a difficult process. While the structure inherent in this two-level hierarchy could be used to automate parts of this generation process, experience shows that user interaction is often required at key points of this process as well. The ideal geometry and mesh generation process for these models would balance both lattice-guided automation and opportunities for user interaction at key points in the process. This paper describes a system for generating reactor core geometry and mesh models that balances automation and user interaction in this way. Nuclear reactor cores are formed by arranging cylindrical pins in a lattice of surrounding material. Pins contain uranium-based fuel, absorbing material for controlling the nuclear chain reaction, or instrumentation. The surrounding material functions as
352
T.J. Tautges and R. Jain
coolant or neutron energy moderator. These materials can be arranged in either a rectangular lattice, used in water-cooled reactors, or a hexagonal lattice, more common in sodium- and gas-cooled reactors. Assemblies vary by degree of uranium enrichment in the fuel material, type of control rod material or function, or other parameters. Assemblies are arranged in a lattice to form the reactor core, either filling space (typical in water- and gas-cooled reactors) or with an interstices material (common in sodiumcooled reactors). Examples of typical assembly and core types are shown later in this paper. Domain-specific mesh generation tools have been described for various application areas; a few are mentioned here for comparison. The CUBIT meshing toolkit has been used to design tire-specific meshing systems for tire design [1]. Designers are permitted to enter a prescribed list of parameters describing tire and tread model, after which the geometry and mesh are generated automatically. Using external tools such as Distmesh, an open source mesh generator, Fung et al. [2] reported a similar system for electrical impedance tomography. Tools to generate finite element meshes suitable for CFD calculations of blood flow in arteries have been demonstrated by Cebral et al. [3]. Several systems for grid generation for turbo-machinery configurations have been reported [4][5]. Some other domain-specific mesh generation tools can be found at the mesh software website [6]. These systems all follow the general idea reported here, where a system allows limited variations in prescribed parameters, from which a geometry and mesh are generated for a specific type of analysis. However, relatively little advantage is taken of repeated structures in the geometric model or of the automation possible through the repeated structures. In lattice-based model generation, two specific works are similar to our approach: the PSG2 code, which allows specification of model geometry using a unit cell-based approach [7], and the Sabrina and Moritz tools, developed to support radiation transport calculations [8]. However, the models constructed from these descriptions are limited in that they support only a CSG-based representation of the domain, used solely to perform ray tracing for Monte Carlo–based radiation transport calculations. We assert that this general approach has far broader applications, not only in geometry construction but also to support mesh generation. Hansen and Owen [9] present a general overview of the challenges and opportunities in meshing reactor cores. They mention the need to “develop the tools that are easier to use keeping the user informed about what is occurring inside the tool.” They study the current state of meshing and examine various requirements for generating high-quality reactor meshes. They also discuss issues and considerations for creating meshes for multiphysics simulations. However, there is no mention of taking advantage of lattice-type configurations found in most reactor cores. Before embarking on the effort reported here, we explored generation of reactor core geometry and mesh using the more general CUBIT meshing tool. However, these efforts met challenges in multiple areas. Various methods were explored. In the first method tried, constructing the whole reactor core geometry and meshing it afterwards required a great deal of user interaction to fine-tune the mesh scheme and intervals in the various assembly types. The process was also brittle: small
Creating Geometry and Mesh Models for Nuclear Reactor Core Geometries
353
changes to meshing parameters caused the overall meshing process to fail or generate unexpected results. Generating geometry and mesh for individual assemblies, copy/moving them into the overall core model, and then merging geometry and mesh for the whole collection proved more robust; however, this approach also required large amounts of memory (6 GB for a model of < 1 million hexahedral elements) and execution time (several hours on a desktop Linux-based workstation). From this experience, we conclude that while it might be possible to use tools such as CUBIT for this type of problem, we can probably do better by considering the inherent structure of the hierarchy of lattices present in reactor core models. We believe that the results later in this paper show this to be the case. In this paper, we describe a three-stage process for generating core lattice geometry and mesh. First, assembly models of various types are generated, based on input describing the content of unit cells, the arrangement of unit cells in the lattice, and the extent of the lattice and any surrounding material. This stage also outputs two CUBIT journal files that can be used to automatically mesh the assembly model. Second, the assembly geometry is meshed with CUBIT, either automatically based on the journal files output in the first stage, or after interactive modifications of that meshing procedure. The first two stages are repeated for each assembly type in the core model. Third, after all assembly meshes have been constructed, they are arranged in a core model using a copy/move/merge process operating on the mesh only. The resulting mesh has material assignments and boundary condition groupings that can be used in typical reactor core analysis. In many cases, the three-stage process described here is fully automatic, resulting in a meshed core model (the most significant barrier to automation is reliable meshing of the cross section of each assembly; this is discussed Section 3.2). At the same time, the user has several opportunities for making targeted adjustments to the process, while being able to execute the process as before for unmodified parts. In this way, both automation and the opportunity for interactivity are balanced. This approach offers several advantages to the analyst: (1) the time required to update the model parameters and create a new model is considerably lower compared to traditional approaches; (2) creation of different meshes for sensitivity analysis is very easy; (3) some non-lattice-based features are incorporated in this methodology to support specific needs in rectangular and hexagonal core geometries; (4) the same set of tools can be used to accommodate different types of reactors; and (5) the process can be automatically re-executed by a makefile automatically created by the tools described in this paper, regenerating only those parts of the model depending on the specific changes. The primary contribution of this paper is the demonstration of a method for constructing geometry and mesh models for problems appearing as a two-level hierarchy of lattices. Using the lattice information simplifies input, improves automation, and is more efficient in both time and memory. Our implementation of this method maintains a careful balance between automation and interactivity. Moreover, the method used to propagate material and boundary condition information through the copy/move process, based on the entity set abstraction used to access mesh, is a demonstration of how to handle application-specific metadata
354
T.J. Tautges and R. Jain
abstractly; this approach will prove useful in other meshing contexts, for example, adaptive mesh refinement and topological mesh improvement. The remainder of this paper is organized as follows. Section 2 describes the types of lattices addressed by the tools in this paper. Section 3 describes in detail the tools for generating assembly geometry and core meshes. Section 4 gives implementation details. Section 5 describes the propagation of mesh metadata during the core mesh generation stage. Section 6 describes example core models created using these tools, along with performance data. Section 7 discusses our conclusions.
2 Reactor Core Lattices The term “lattice” refers to a collection of shapes arranged in some regular pattern. The shapes composing the lattice are called unit cells; in this work we also refer to these as pin cells. In the fully general case, a lattice can be formed from unit cells of varying shape; for example, the surface of a soccer ball is formed from a collection of pentagons and hexagons. Here, we restrict ourselves to lattices with a single unit cell shape. The internal structure of unit cells is allowed to vary, however, resulting in assembly/core models composed of multiple unit cell/assembly types, respectively. Nuclear reactor cores have been designed with a wide variety of fuel pin and assembly arrangements. Two lattice types are most common: rectangular and hexagonal lattices. Rectangular or square lattices are used mostly in light water reactor designs, while hexagonal lattices are most common in gas- and sodium-cooled reactors. The geometry of a lattice can be fully described by three types of parameters: the unit cell shape or lattice shape; the lattice pitch, which is the distance between unit cell centers in the pattern determined by the lattice shape; and the lattice dimension, which is a measure of the extent of the lattice, or how many unit cells form the lattice. The description of rectangular and hexagonal lattices in terms of these parameters is discussed in the following sections. 2.1 Rectangular Lattice In a rectangular lattice, both the unit cells and the graph formed by joining unit cell centers with straight lines are rectangular. There are two lattice pitches, Px and Py, one each in the logical X and Y directions. The extent of a rectangular lattice is given by the number of unit cells in the X and Y directions, Nx and Ny. The total number of unit cells in a rectangular lattice is NxNy. The specification of unit cell types is as a vector of integer types; by convention, these integers identify unit cell types starting at the top left and proceeding right and down in the lattice. We place the origin of a rectangular lattice at the centroid of the bottom left cell. Fig. 2 shows an example specification of a rectangular lattice in these terms, defining its pitches, dimensions, and unit cell types. This method for specifying rectangular lattices is used as input to the tools described Section 3.
Creating Geometry and Mesh Models for Nuclear Reactor Core Geometries
355
Fig. 1. Rectangular lattice with three unit cell parameters required for its specification
Hexagonal , Symmetry = 1 N rings = N r = 3 P = 1.0 NTOT = 3 N r ( N r − 1) + 1 = 19 Celltypes = ABC.. Fig. 2. Full hexagonal lattice with three unit cell parameters required for its specification
2.2 Hexagonal Lattice In a hexagonal lattice, the unit cells are hexagonal, while the lines joining unit cell centers form triangles. We restrict ourselves to a single hexagonal lattice pitch, P. The dimension of a hexagonal lattice is indicated by the number of rings, Nr, formed around a central unit cell, with the central cell identified as the first ring. The number of unit cells in a hexagonal lattice of Nr rings is 3(Nr)(Nr-1) + 1. By convention, the central unit cell hexagon is oriented such that two of its vertices are placed on the +y and –y axes, and the +x and –x axes intersect two edges or “flats” of the unit cell. The unit cell types for a full hexagonal lattice can be specified similar to the specification of a rectangular lattice, starting with the top left unit cell and proceeding right and down. Fig. 3 shows an example specification for a hexagonal lattice. For hexagonal lattices, a “full” lattice specifies a full 360 degrees; partial lattices can also be defined, where some whole-number division of 360 degrees is defined. We refer to these as “symmetry=x” lattices, where x is the number of divisions of the 360-degree lattice into the partial lattices. Both 60-degree (symmetry=6) and 30-degree (symmetry=12) partial lattices are supported. These are the two common types often used in reactor core simulations. Two symmetric 60-degree sections can be described for a hexagonal lattice, depending on the orientation of the central unit cell. A “HexFlat” type has the central unit cell oriented in the conventional manner, with the +x axis bisecting a hexagon edge, while in a “HexVertex” type lattice a vertex of the central unit cell
356
T.J. Tautges and R. Jain
falls on the +x axis. HexFlat and HexVertex type lattices are shown in Figs. 4 and 5, respectively. The two types differ in the number of unit cells appearing in the partial lattice and in their arrangement around the central unit cell. For partial lattices, unit cell types are more easily specified by ring, starting from +360/x to zero degrees, from the central unit cell outward. Therefore, the unit cells for the lattice in Fig. 3 are specified in order of increasing letter. Only one symmetric 30-degree section can be described for a hexagonal lattice. Both the HexFlat and HexVertex schemes result in the same model with rotational symmetry. The HexFlat lattice type is used to describe a 30-degree or 1/12th symmetry of hexagonal lattice. Ni represents the number of unit cells in the ith ring. Unit cell types are specified from +30 to zero degrees, from the central unit cell outwards. Unit cells are specified as before, in order of increasing letter for the lattice in Fig. 5.
HexFlat , Symmetry = 6 Ni = i NTOT = N ( N + 1) / 2 Celltypes = ABC..
Fig. 3. HexFlat lattice type and specification
HexVertex, Symmetry = 6 N i = i − ( i + 1) 2
NTOT = N ( N + 1) / 2 − floor ( N / 2 ) Celltypes = ABC.. Fig. 4. HexVertex lattice type and specification
HexFlat , Symmetry = 12 N i = i / 2 + i %2
NTOT = ( N 2 + 2 N ) / 4 + N %2 Celltypes = ABC.. Fig. 5. HexFlat type describing a 30-degree (symmetry=12) lattice type and specification
Creating Geometry and Mesh Models for Nuclear Reactor Core Geometries
357
3 Generation of Assembly and Core Models A mesh of a reactor core is produced by generating assembly geometry and mesh models for each unique assembly type, then copying/moving these assembly meshes into place in a core lattice. Our approach uses a sequence of tools to accomplish these tasks, so that the user can manually adjust output of one tool and input of the next tool at each stage of the process. The workflow for running these tools is depicted in Figs. 6 and 7. The first stage of this process uses the AssyGen tool, which generates an assembly geometry based on an assembly input file. This file describes the assembly as a lattice of cylindrical pins, annular regions surrounding each pin (e.g., for pin cladding), and overall assembly dimensions and surrounding duct wall characteristics. AssyGen also generates a meshing script for meshing the assembly. In the second stage of execution, the meshing script and geometry output from AssyGen are used by CUBIT to generate a mesh for that assembly type. In many cases, this process is automatic, requiring no further input from the user. If users desire custom modifications to the mesh or if the geometry cannot be meshed automatically, the user can modify the mesh script to tailor the mesh generation to their individual needs or substitute their own script for generating the assembly mesh. This approach may be desirable, for example, if the user wants more mesh concentrated around fuel pins with the mesh size transitioning to the coarser mesh on the assembly boundary. The only explicit requirement on the resulting mesh is that the mesh on outer boundaries of the assembly match that of neighboring assemblies, or of the interstices material in cases where assemblies do not completely fill the core space. In the final stage, shown in Fig. 7, the CoreGen tool reads an input file describing the arrangement of assemblies in the core lattice and locations of meshes for each assembly type; this information is used to generate the overall core mesh. CoreGen also produces a makefile, which can be used to automatically rerun parts of the process affected by changes to any of the input files.
Fig. 6. First two stages of the geometry/mesh process, where AssyGen and CUBIT are executed for each assembly type
358
T.J. Tautges and R. Jain
Fig. 7. Third stage of the geometry/mesh process, where CoreGen is executed
3.1 Generating Assembly Models A reactor core assembly is a lattice of unit cells. Each unit cell has zero or more concentric cylindrical layers of material, cut from a background material defined for each unit cell or for the assembly as a whole. The assembly can be surrounded by one or more layers of duct wall material. Information is input in a simple text-based language. An example input file for AssyGen is shown in Fig. 8. The lines with the GeometryType, Materials, and Dimensions keywords give the type and extent of the assembly and the material types used in unit cells. Multiple pincell types can be defined, each with one or more concentric cylinders of material and a background material for the cell. Following pincell input, the Assembly keyword line gives the overall lattice extents, followed by the pincell alias for each unit cell in that lattice. The overall assembly model can be modified based on the Center, Rotate, and Section keywords, and mesh sizes can be specified by using the RadialMeshSize and AxialMeshSize keywords. The top assembly in Fig. 7 was generated based on this input. For a full description of the AssyGen input language, see [10]. A few other options allow variations in the assembly model. The CellMaterial keyword results in unit cell boundaries being generated explicitly in the geometric model of the assembly; this allows finer control of the mesh in each unit cell. Cylinders input for individual pin cells can be larger than the unit cell dimensions; these volumes will overlap neighboring pincell regions when present. The Intersect keyword can be used to request that pincell contents be intersected with the pincell region, such that they do not overlap neighboring regions. Empty pin cells can be specified in the assembly lattice by using the X or XX pincell alias; these are useful in regions neighboring those with overlapping contents. AssyGen names the surfaces at the top, bottom, and sides of the assembly. They are named by using the material name with “_top,” “_bot,” and “_side” suffixes. This naming can be useful to the analyst. For example, for an assembly with upward flow, surfaces whose names end in “_bot”/”_top” can be placed in groups for application of inlet/outlet boundary conditions, respectively. Surfaces can be filtered by containing the volume using set Booleans, for example, to select fluid regions outside of cylindrical fuel pins.
Creating Geometry and Mesh Models for Nuclear Reactor Core Geometries
359
Geometry Volume GeometryType Rectangular Materials 3 PWR_FC_F_01 M1 Mat_Block G1 Mat_Coolant C1 Dimensions 2 0.0 0.0 0 124.0 18.0 18.0 23.5 23.5 G1 C1 Pincells 1 ! Standard fuel pin cell PWR_FC_01 FC 2 Pitch 9.0 9.0 124.0 Cylinder 1 0.0 0.0 0.0 124.0 3.0 M1 ! Assembly 2 2 FC FC FC FC Center RadialMeshSize 2.0
Fig. 8. Example AssyGen input file
3.2 Meshing Assembly Geometric Models In addition to generating the geometric model, AssyGen writes two meshing scripts. The first contains the basic commands necessary to mesh the assembly model and define various material groups and boundary condition sets. The second defines several parametric variables used in the first meshing file; parameters are defined for mesh sizes and various user-selectable mesh schemes. In many cases, the user will need only to specify a mesh size in the AssyGen input file, after which the meshing process for an assembly will be completely automatic. In other cases, for example, if a relatively coarse mesh size is requested or finer-grained control over mesh density or quality is required, users can modify the meshing scripts file as necessary before running CUBIT on that file. The syntax used with these journal files can be found in [10]. This process of constructing assembly meshes, while somewhat automated, can be sensitive to mesh size input by the user. This problem is manifested particularly in the generation of unstructured quadrilateral meshes for the top surface in an assembly, which is cut by large numbers of cylindrical rods. The test problem input for the more complex example in this paper contains a carefully chosen radial mesh size that, if made larger (giving a coarser mesh), will cause mesh generation for that surface to fail. This situation is common in mesh generation technology, where mesh generation robustness grows worse for coarser meshes. This is one of the reasons for splitting the core mesh generation process into several steps: to allow user intervention midway through the process. The general solution for this type of failure would be either to make the mesh size finer (producing many more elements), or to perform geometry decomposition of the assembly top surface such
360
T.J. Tautges and R. Jain
that the resulting smaller, less-complex surfaces are meshable with more primitive algorithms. Because CUBIT is a closed-source code, efforts are being made to support lattice-type mesh generation with the MeshKit library described in Section 4. 3.3 Generating Core Model A reactor core is formed by placing various assembly types in a lattice, possibly surrounded by material in the interstices regions. CoreGen supports construction of full rectangular, full hexagonal, 60-degree hexagonal, and 30-degree hexagonal lattices. Two 60-degree hexagonal variants, HexVertex and HexFlat, are supported; these lattice types are described in Section 2. Input for defining a core is similar to that of an assembly. An example input file for the CoreGen program is shown in Fig. 9. CoreGen uses Geometry and GeometryType to specify the dimension and the type of core model specified, respectively. The symmetry keyword is used to indicate the desired symmetry. Assemblies and Lattice keywords provide information about the assembly meshes and dimensions and the arrangement of the assemblies forming the core, respectively. The CoreGen program also generates a makefile. If AssyGen, CoreGen, and CUBIT are in the user’s path, this makefile automates generation of the overall mesh; after making changes to either of the AssyGen or CoreGen input files, the user can rerun “make” to rebuild the entire core model. We note here that CoreGen operates on mesh and makes no use of the geometric models produced by AssyGen; those models are for the sole purpose of generating the mesh model for each assembly type. After the assembly meshes have been copied/moved into the core lattice, coincident nodes are merged, resulting in a contiguous mesh. Syntax and keywords used to specify input to CoreGen and the makefile can be found in the MeshKit repository [10].
Geometry Volume GeometryType Rectangular Symmetry 1 Assemblies 2 23.5 23.5 s1.cub S1 s2.cub S2 Lattice 3 3 S2 S1 S2 & S1 S1 S1 & S2 S1 S2 END
Fig. 9. Example CoreGen input file
Creating Geometry and Mesh Models for Nuclear Reactor Core Geometries
361
4 Implementation The tools described in this paper rely on geometry and mesh libraries developed as part of the Interoperable Tools for Advanced Petascale Simulations project. The Common Geometry Module (CGM) [11] provides functions for constructing, modifying, and querying geometric models in solid model-based and other formats. While CGM can evaluate geometry from several underlying geometry engines, this work relies mostly on ACIS [12], with an Open.Cascade-based [13] version under development. Finite-element mesh and mesh-related data are stored in the Mesh-Oriented datABase (MOAB) [14]. MOAB provides query, construction, and modification of finite-element meshes, plus polygons and polyhedra. Mesh generation is performed by using a combination of tools. The CUBIT mesh generation toolkit [15] provides algorithms for both tetrahedral and hexahedral mesh generation. MeshKit, an open-source mesh generation library under development at Argonne National Laboratory, provides efficient algorithms for mesh copy/move/merge [16]. CGM and MOAB are accessed through the ITAPS iGeom and iMesh interfaces, respectively. The iMesh concept of sets and tags is important to the implementation of these tools. A set is an arbitrary collection of entities and other sets; a tag is data annotating entities, sets, or the interface itself. The combination of sets and tags is a powerful mechanism used to describe boundary conditions, material types, and other types of metadata commonly found with mesh.
5 Metadata Handling Mesh files for any simulation contain boundary condition, material type and other user-specified information. When different assembly meshes are copied/moved to form the core, the metadata associated with individual assembly meshes must be correctly propagated to the core model. For example, if an assembly mesh defines materials for elements in the mesh, these definitions should be propagated with the copies of those elements. MeshKit abstracts the handling of metadata by using the concepts of “copy set” and “expand set.” For any set designated as a copy set, a copy of that set is made and populated with element copies whose original element was in the original set. Any set designated as an expand set receives copies of original entities already in that set. Together, these abstractions simplify the implementation of meshing algorithms such as copy/move. The application just needs to identify characteristics used to identify each set type; the copy/move implementation then finds sets with those charac\teristics and acts accordingly. The abstraction enables this behavior without requiring the copy/move implementation to understand the semantics of those sets, for example, what purpose a material set fills for an application. The copy/expand set concept also could be used in other meshing applications, for example, adaptive mesh refinement or topological mesh improvement.
362
T.J. Tautges and R. Jain
6 Examples In this section we present two examples; one a simple hexagonal assembly and the other a more complex core model. 6.1 Single Hexagonal Assembly Our first example, a single Very High Temperature Reactor (VHTR) assembly, has six pincell types, with three sizes of pins representing fuel, burnable poison, and coolant regions; a structure at the center describes a fuel handling hole, and a larger hole in the lower half of the assembly represents a control rod and guide tube. Empty pin cells are specified in cell positions surrounding these larger holes. The resulting geometric model is shown in Fig. 10 (left). We note that generating an all-hexagonal mesh for this model is difficult because of the many cylindrical pins cut out of the top surface of the block. A fine mesh can be generated without too much difficulty; however, generating a coarse mesh for this model would require substantial effort to make targeted modifications to the assembly geometry and mesh parameters. The model generated by AssyGen was used as input to UNIC, a neutron transport code [17] developed at Argonne National Laboratory. Fig. 10 (right) shows the thermal neutron flux computed. The flux is much lower in the region of the large control rod and slightly lower around the six burnable poison pins (located at corners of the hexagonal assembly), as expected. Note that in this case a tetrahedral mesh was used, which was generated by modifying input to the CUBIT journal file output by AssyGen.
Fig. 10. Hexagonal assembly geometry and mesh constructed by AssyGen (left); thermal neutron flux computed by the UNIC neutron transport calculation for this hexagonal assembly (right)
6.2 Complex Core Model Fig. 11 and Fig. 12 show a more complex example, a core model created using the three-stage process described in this paper. Fig. 11 shows four of the 11 assembly types used in this model. Keyword-based input files were used with AssyGen to generate the assembly geometry. CUBIT was then used to mesh the assemblies
Creating Geometry and Mesh Models for Nuclear Reactor Core Geometries
363
Fig. 11. Four assembly types produced by AssyGen
Fig. 12. One sixth of a VHTR core model generated using CoreGen (left); a closeup of several assemblies in this model (right)
using the journal files created by AssyGen. The 1/6 core model in Fig. 12 was generated by CoreGen. This model has approximately 12 million hexahedral elements and 14 million mesh vertices. The tools were run on a desktop Linux-based workstation with a clock speed of 2.5 GHz and 11.8 GB RAM. It took 4 minutes to generate the geometries, 5 minutes to create the assembly meshes, and 20 minutes to copy/move and merge the assemblies and create the core.
7 Conclusions An input-file-based methodology has been developed that can generate a latticebased reactor core mesh with minimal user input. The methodology operates in three stages. First, assembly models of various types are generated by the AssyGen tool, based on input describing the content of pin cells, the arrangement of pin cells in the lattice, and the extent of the lattice and any surrounding material. The assembly model or models then are meshed with the CUBIT mesh generation toolkit, optionally based on a journal file output by AssyGen. After one or more assembly model meshes have been constructed, they are arranged in a core model
364
T.J. Tautges and R. Jain
by using the CoreGen tool. Although this approach is ideally suited for latticebased core geometries, it also offers flexibility to incorporate non-lattice-based features.
Acknowledgments We thank M. A. Smith, A. Wollaber, and J. H. Thomas in the Nuclear Engineering Division at Argonne National Laboratory for helpful discussions and feedback for creating the input file language used in these tools. We also thank the Fathom group at Argonne, who maintain the libraries required by this tool. This work is sponsored by the U.S. Dept. of Energy Office of Nuclear Energy GenIV Program; by the U.S. Dept. of Energy Office of Scientific Computing Research, Office of Science, and by the US Department of Energy’s Scientific Discovery through Advanced Computing program, under Contract DE-AC02-06CH11357.
References 1. Sandia news notes (2005), http://www.cs.sandia.gov/newsnotes/2005newsnotes.html# Goodyear 2. Fung, S., Adler, A., Chan, A.D.C.: Using Dismesh as a mesh generating tool for EIT. Journal of Physics, Conference Series (2010) 3. Cebral, J.R., Lohner, R.: From medical images to CFD meshes. In: Proc. 8th International Meshing Rountable, pp. 321–331 (1999) 4. Sony, B.K., Shih, M.H.: TIGER: Turbomachinery Interactive Grid GenERation. In: Proc. Third International Conference of Numerical Grid Gen-eration in CFD, Barcelona, Spain (1991) 5. Chima, R.V.: TCGRID website (2008), http://www.grc.nasa.gov/WWW/5810/rvc/tcgrid.htm 6. List of meshing software website, http://www-users.informatik. rwth-aachen.de/~roberts/software.html 7. PSG2 / Serpent website (2010), http://montecarlo.vtt.fi/ 8. Riper, K.A.V.: SABRINA: Three-dimensional geometry visualization code system. PSR-242, ORNL-RSICC, Oak Ridge, TN (1993) 9. Hansen, G., Owen, S.: Mesh generation technology for nuclear reactor simulation; Barriers and opportunities. Journal of Nuclear Engineering and Design, 2590–2605 (2008) 10. MeshKit README website (2010), http://trac.mcs.anl.gov/projects/fathom/browser/MeshKit/ trunk/rgg/README 11. Tautges, T.J.: CGM: A geometry interface for mesh generation, analysis and other applications. Engineering with Computers 17, 486–490 (2005) 12. Spatial website (2010), http://www.spatial.com/ 13. Open CASCADE Technology website (2000-2010), http://www.opencascade.org
Creating Geometry and Mesh Models for Nuclear Reactor Core Geometries
365
14. Ollivier-Gooch, C., Diachin, L.F., Shephard, M.S., Tautges, T.: A languageindependent API for unstructured mesh access and manipulation. In: Proc. 21st International Symposium on High Performance Computing Systems and Applications, p. 22. IEEE, Los Alamitos (2007) 15. Sjaardema, G.D., Tautges, T.J., Wilson, T.J., Owen, S.J., Blacker, T.D., Bohnhoff, W.J., Edwards, T.L., Hipp, J.R., Lober, R.R., Mitchell, S.A.: CUBIT mesh generation environment, Users manual, vol. 1. Sandia National Laboratories, Albuquerque (1994) 16. MeshKit website (2010), http://trac.mcs.anl.gov/projects/fathom/browser/MeshKit 17. Smith, M.A., Rabiti, C., Palmiotti, G., Kaushik, D., Siegel, A., Smith, B., Tautges, T., Yang, W.S.: UNIC: Development of a new reactor physics analysis tool. In: Proc. Winter Meeting on International Conference on Making the Renaissance Real, American Nuclear Society, pp. 565–566 (2007)
This page intentionally left blank
Multi-tissue Mesh Generation for Brain Images Yixun Liu1,2 , Panagiotis Foteinos1,2 , Andrey Chernikov2 , and Nikos Chrisochoides2 1 2
Department of Computer Science, The College of William and Mary, {enjoywm,pfot}@cs.wm.edu Department of Computer Science, Old Dominion University, {andrey.n.chernikov,npchris}@gmail.com
Abstract. We develop a multi-tissue mesh generation method that is suitable for finite element simulation involved in non-rigid registration and surgery simulation of brain images. We focus on the following four critical mesh properties: tissue-dependent resolution, fidelity to tissue boundaries, smoothness of mesh surfaces, and element quality. Each mesh property can be controlled on a tissue level. This method consists of two steps. First, a coarse multi-tissue mesh with tissue-dependent resolution is generated according to a predefined subdivision criterion. Then, a tissue-aware point-based registration method is used to find an optimal trade-off among fidelity, smoothness, and quality. We evaluated our method on a number of images ranging from MRI, visible human, to brain atlas. The experimental results verify the features of this method.
1 Introduction Multi-tissue mesh generation of medical images is a necessary procedure for building a heterogeneous biomechanical model, which has numerous applications such as physical model-based non-rigid registration, segmentation and surgery simulation. However, there is little literature addressing this issue so far. Several groups [1, 2, 3] presented multi-tissue mesh generation methods based on Delaunay refinement. However, elements with small dihedral angles (a.k.a, slivers) are likely to occur in Delaunay meshes, because elements are removed only when their radius-edge ratio is large; their dihedral angle quality is completely ignored. Meyer et al. [3] showed at least 0.6% slivers occurred in their experiments on frog data. Boltcheva et al. [1] and Pons et al. [2] employed sliver exudation postprocessing technique [4] to remove slivers and showed very good quality mesh (minimal dihedral angle is larger than 4 degrees).
This work is supported in part by NSF grants: CCF-0916526, CCF-0833081, and CSI-719929 and by the John Simon Guggenheim Foundation.
368
Y. Liu et al.
Unlike these Delaunay-based methods, Zhang et al. [5] presented an octreebased method to generate a tetrahedral and hexahedral mesh. This method first identifies the interface between two or several different tissues and nonmanifold nodes on the boundary. Then, all tissue regions are meshed with conforming boundaries simultaneously. At last, edge-contraction and geometric flow schemes are used to improve the quality of the tetrahedral mesh. In our work, we incorporate mesh quality, smoothing and fidelity into one point based registration (PBR) framework. Molino et al. [6] presented a crystalline, red green strategy for mesh generation. This method starts with a Body-Centered Cubic (BCC) mesh and then deforms it to match the object boundary. The geometry is represented by signed distance function and the refinement is performed by a red green strategy. This BCC-based approach shows a very good quality of the mesh, because the quality of BCC mesh is high and its regular refinement still leads to a BCC mesh. However, this approach is limited to a single tissue. The contribution of this paper is a novel mesh generation method which is characterized by 1) multi-tissue mesh, 2) tissue-dependent resolution, 3) natural control of the trade-off among quality, fidelity, and smoothness on tissue level.
2 Method Our approach requires multi-label images as input, in which label 0 denotes the background, and positive integers indicate different tissues. The approach consists of two steps: coarse mesh generation (CMG) and tissue-aware PBR as shown in Fig. 1. CMG includes two substeps, 1. BCC mesh. Use BCC mesh to subdivide the object space into connected tetrahedra. Note that this step does not distinguish different tissues. All tissues with label larger than zero belong to the same object (non-background object). The resulting BCC mesh is homogeneous. 2. Coarse tissue dependent resolution multi-tissue mesh generation (CMesh). This step specifies which tissue each tetrahedron belongs to and then yields a submesh for each tissue. Each tissue is capable of automatically adjusting its resolution based on its geometrical complexity and the predefined subdivision criterion. The resulting coarse multi-tissue mesh of step I includes different submeshes and each submesh has its own resolution. The discrepancy between the surface of the submesh and its corresponding boundary in the multi-label image is corrected by a tissue-aware PBR method. This step includes three substeps. 1. detect edges for each tissue in the multi-label image to obtain target point set.
Multi-tissue Mesh Generation for Brain Images
369
2. extract surface nodes for each submesh to obtain source point set. 3. deform the surface of each submesh to its corresponding boundary based on PBR. The framework of this approach is shown in Fig. 1. Each step listed in this framework will be discussed in detail in the following sections.
Fig. 1. Multi-tissue mesher framework
2.1
Coarse Mesh Generation
The purpose of the coarse mesh generation is to obtain the source points, which will be used in the tissue-aware PBR method. The coarse mesh needs to take into account the following criteria: 1) multi-tissue input, 2) good conditioning for the subsequent PBR, and 3) fewer tetrahedra. This part includes two steps as shown in Fig 1. Body-Centered Cubic provides an initial lattice, which has been well documented in [7, 6]. For the completeness of this paper, we will briefly describe its properties and red green subdivision, and then focus on how CMesh generates and refines submeshes.
370
Y. Liu et al.
BCC Mesh BCC mesh is an actual crystal structure ubiquitous in nature. It is highly structured and easily refined initially or during the simulation. The nodes of BCC are grid points of two interlaced grids like the blue grid and the green grid in Fig. 2(a). The edges of BCC consist of edges of the grid and additional edges between a node and its eight nearest neighbors in the other grid.
(a) A portion of the BCC lattice.
(b) Red-greed subdivision Fig. 2. BCC lattice and red green subdivision (These two figures come from [6])
The refinement of BCC mesh is performed by a red green strategy. Initially, all BCC lattice tetrahedra are labeled with red. A red tetrahedron can be subdivided into eight children (1:8 refinement) and each child is labeled with red as shown in Fig. 2(b). There are three choices for the internal edge of the tetrahedron. If the shortest one is selected, the resulting eight child tetrahedra are exactly the BCC tetrahedra except the size is one half of the original BCC. So, the quality of the refined mesh can be guaranteed using this red (regular) subdivision. This is the reason that we select BCC as the initial tetrahedral mesh, although our method is general enough to start from any tetrahedral mesh. This red subdivision will lead to T-junctions at the newlycreated edge midpoints where neighboring tetrahedra are not refined to the same level. To remove the T-junctions, green subdivision, including three cases, is performed. These three cases are, 1. there is one edge with T-junction 2. there are two opposite edges with T-junctions 3. there are three edges of a face with T-junctions The green subdivision according to these three cases is shown in Fig. 2(b). All the child tetrahedra of the green subdivision are labeled with green. This
Multi-tissue Mesh Generation for Brain Images
371
irregular green subdivision will reduce the quality of the tetrahedron, so all the child tetrahedra will be removed and red subdivision is performed on their red parent when higher resolution is desired. CMesh CMesh is used to identify the submesh for each tissue in BCC mesh and subdivide it if necessary. We define a label operation table, based on which label redistribution method is used to produce different submeshes. A predefined subdivision criterion is used to determine which submesh needs to be further subdivided. If a submesh needs to be subdivided, in order to reduce the number of the tetrahedra, only its boundary tetrahedra are further subdivided (multi-resolution). In Fig. 3, we illustrate how CMesh identifies and subdivides submeshes. First, CMesh assigns each tetrahedron with a label of the tissue, to which most part of the tetrahedron belongs (Fig. 3(a)). As a result, an initial multi-tissue mesh is produced. However, this multi-tissue mesh is not well conditioned for subsequent deformation, because more than one face, i.e., four nodes of one tetrahedron are probably on the interface. We term this kind of tetrahedron as a bad conditioned tetrahedron. In this case, deforming four nodes easily crushes this tetrahedron. We prefer a submesh only with two kinds of tetrahedra: inner tetrahedron (no faces on the interface) and boundary tetrahedron (only one face on the interface). To reach this end, we redistribute the label of the bad conditioned tetrahedra according to the operations defined in Table 1 to generate a well conditioned multi-
Initiate labels
Redistribute labels
Subdivide
Redistribute labels
Criterion: and
L1
L2
L1
L2
L2 L2
L2
L1
L2
L1
> 0.85
L2
Satisfy N Criterion?
...... S2
Y
L2
L1
L2
L2
a
L2 L2
L2 L1
> 0.85
L2
L2 L1
|S1 ∩S2 | |S1| |S1 ∩S2 | |S2 |
b
S1
Stop
c
d
e
Fig. 3. Coarse multi-tissue mesh generation. (a) L1 and L2 are tissue labels, the dash line is the real boundary and the blue line is the submesh interface. (b) Redistribute labels according to operation table 1. (c) Subdivide if not satisfy the resolution criterion defined in (e). (d) Redistribute labels again. (e) Resolution criterion: 0.85 is the subdivision threshold, an experiment value evaluated on MRI ,visible human and brain atlas. Points represent voxels and colors represent different tissues. S1 is the voxel set within the blue submesh (blue dash lines) and S2 is the voxel set within the blue tissue (blue curves).
372
Y. Liu et al. Table 1. Operation case table for tetrahedron T with label L
Case 1 2 3 4 5 6 7 Configuration 4L 3L,1L1 2L,2L1 2L,1L1,1L2 1L,3L1 1L,L1,2L2 1L,1L1,1L2,1L3 Operation T=inner tetra T=boundary tetra T.label=L1 T.label=L1 T.label=L1 T.label=L2 T.label=L1
Table 2. Quantitative evaluation for the multi-tissue mesh on the brain atlas. The atlas is regularized as spacing: 1mm × 1mm × 1mm, size: 240 × 240 × 259. The parameters are: subdivision threshold=0.85, λ = 1.0. Nerve structures RCN LCN RAHLV LAHLV CC Other (brain) Aspect ratio (Quality) [1.03,3.75] [1.07,3.01] [1.02,6.84] [1.03,4.07] [1.03,3.96] [1.02,8.80] Dihedral angle (Quality) [13.36,79.80] [24.7,72.60] [10.06,79.12] [17.74,78.40] [13.56,78.14] [4.57,84.15] Average distance (Fidelity) 0.80 0.91 0.79 0.82 0.82 0.99 Number of tetras 2944 612 9480 3849 14937 109466 Number of nodes 814 220 2589 1136 3766 21407
tissue mesh (Fig. 3(b)). After label redistribution, we check if each submesh needs to be further subdivided. If it satisfies the criterion for the resolution, defined in Fig. 3(e), the algorithm stops, otherwise subdivides (Fig. 3(c)) and redistributes labels (Fig. 3(d)). Repeat the above procedures until the desired resolution is reached. The submesh produced by this label redistribution method not only has good conditioning, but also reaches conformity with its neighboring submeshes. Operation table The operation table decides how to redistribute the label of a tetrahedron based on its relation, termed as configuration, with face-adjacent tetrahedra. The purpose of the operations defined in Table 1 is to move the bad conditioned tetrahedra to its neighboring submeshes. If all the bad conditioned tetrahedra are removed from one submesh, this submesh and its neighboring submeshes will reach good conditioning at the same time. We clarify this point by taking case 5 defined in table 1 as an example. If the four face-adjacent tetrahedra of a given tetrahedron T have labels: < L, L1, L1, L1 >, denoted as < L, 3L1 > for simplicity, the label of T will be reassigned with L1 because its three faces are on the interface between submesh L and L1. Fig. 3 uses case 5 for redistribution. Because we use 2D triangles instead of 3D tetrahedra in Fig. 3, case 5 is degenerated from < L, 3L1 > to < L, 2L1 >. In summary, the operations defined in Table 3 move a tetrahedron to its face-adjacent submesh if this tetrahedron is not an inner (case 1) or boundary tetrahedron (case 2). As a result, no tetrahedra with more than one face on the boundary exist, which leads to a well conditioned mesh for the subsequent deformation. Criteria for subdivision In multi-label image, a tissue is defined with a set of voxels with the same intensity, say L. Heuristically, the closer the surface of a submesh is to the boundary of a tissue, the more voxels of the tissue are located in the submesh and the more voxels with label L this submesh has. To quantitatively evaluate the similarity between the sbumesh and the tissue region, we define two voxel sets,
Multi-tissue Mesh Generation for Brain Images
373
1. S1: all the voxels in the submesh (the points within two dash lines in Fig. 3 (e)). 2. S2: all the voxels in the tissue region (the points within the curve in Fig. 3 (e)). S1 ∩ S2 define the point set shared by the submesh and the tissue region. We expect the common region to be similar with the submesh and the tissue 1 ∩S2 | region. We use |S|S to measure the similarity between the common region 1| 1 ∩S2 | and the submesh, and |S|S to measure the similarity between the common 2| region and the tissue region. So, the subdivision criterion can be defined as,
|S1 ∩ S2 | < threshold and |S1 |
|S1 ∩ S2 | < threshold |S2 |
(1)
1 ∩S2 | 1 ∩S2 | where threshold is an input parameter. 0 ≤ |S|S ≤ 1.0 and 0 ≤ |S|S ≤ 1| 2| 1.0, so 0 ≤ threshold ≤ 1.0. The reason that we simultaneously use two values as the criterion is to 1| avoid case a and case b in Fig. 4. Moreover, that we do not simply use |S |S2 | is in order to avoid case c in Fig 4.
a
b
c
Fig. 4. Three special cases. The circle represents the tissue region and the polygon represents the submesh. For simplicity, the voxels are not shown. All these three cases show a big discrepancy between the tissue boundary and the submesh boundary. However, for case (a), because the tissue is totally covered by the submesh, |S1 ∩S2 | has the highest value 1.0. For case (b), because the submesh is totally cov|S2 | 1 ∩S2 | 1| ered by the tissue region, |S|S has the highest value 1.0. For case (c), |S can be |S2 | 1| equal to be 1.0, if the submesh and tissue region have the same number of voxels.
The criterion relies on the number of the voxels, and therefore it is susceptible to the resolution of the multi-label image. For instance, if the resolution is very low, we cannot find any voxels in a tetrahedron. To overcome this difficulty, the up-sampling is performed automatically if no voxels are detected in a tetrahedron. To improve the performance, we do not perform up-sampling in the whole image, but restrict it to the bounding box of the tetrahedron.
374
2.2
Y. Liu et al.
Tissue-Aware PBR
This step is used to 1) deform the coarse mesh close to the boundary, 2) maintain the quality of the coarse mesh, and 3) generate a smooth mesh. The coarse mesh needs to be deformed to the boundary. Unlike the interpolation method used in [6], we treat the deformation as a point based registration. This method iteratively deforms the mesh towards the boundary of the multilabel image. In each iteration, the deformation will be viewed as a point based registration problem. Each surface of the submesh will be registered with its corresponding boundary in the image. The advantage of this approach is the quality, smoothing and fidelity can be incorporated into the same registration framework. Source Point Set and Target Point Set Two point sets are needed in this registration framework: source and target point sets. The source points are the surface nodes of the mesh and the target points are the edge points in the multi-label image. The source point set is obtained by extracting the surface nodes of each submesh. The target point set is obtained by canny edge detection, which is facilitated by ITK implementation [8]. For each source point, the target point closest to it will be viewed as its potential correspondence. It is computationally intensive to search the closest point in all the target points. We associate each source/target point with a label to denote which tissue it belongs to, and therefore the search is only restricted to the target points, which have the same label with the source point. Figure 5 shows the source point set and the target point set produced by visible human data. These intermediate results for other data will not be shown in Section results.
(a) Coarse tissue mesh
multi- (b) Source point set (c) Multi-label im- (d) Target point set age
Fig. 5. Point sets. The source point set (b) include all the surface nodes of the coarse mesh (a) and the target point set (d) are the edge points in the multi-label image (c).
Multi-tissue Mesh Generation for Brain Images
375
Register Source Points with Target Points The classic PBR [9] is used to register two images, floating image and reference image. The PBR is based on the concept of energy minimization. A sparse set of registration points within the floating image are identified. The displacement between the floating and the reference images is estimated using Block Matching [10] at each registration point. These displacements are applied as boundary condition on a biomechanical model to derive the entire brain deformation. In our work, we extend this PBR method and use it in the mesh generation field. In our mesh generation, the registration points will be fixed to the nodes of the mesh instead of the feature points. The displacement of these registration points is estimated by taking fidelity, smoothing and quality into account. The homogeneous biomechanical model used in [9] is generalized with a more flexible tissue-aware model as shown below, W (U ) =
n
(U T Ki U + λi (Hi U − Di )T (Hi U − Di )),
(2)
i=1
where n is the number of the tissues; Ki is the global stiffness matrix assembled by the tetrahedra within i-th tissue. Ki is related with two biomechanical attributes of i-th tissue: Young’s modulus and Possion’s ratio. The building of Ki has been well documented in [11]. Hi is the global linear interpolation matrix assembled by registration points. Each registration point ok with number k contained in tetrahedron with vertex numbers ci , i ∈ [0 : 3] has contribution to four 3 × 3 submatrices: [H]kc0 , [H]kc1 , [H]kc2 , [H]kc3 . [H]kci is defined as: [H]kci = diag(hi , hi , hi ). The linear interpolation factor hi is calculated as: ⎡ ⎤ ⎡ x h0 vc0 ⎢h1 ⎥ ⎢vcy ⎢ ⎥ = ⎢ z0 ⎣h2 ⎦ ⎣vc 0 h3 1
vcx1 vcy1 vcz1 1
vcx2 vcy2 vcz2 1
⎤−1 ⎡ x ⎤ vcx3 ok ⎢oy ⎥ vcy3 ⎥ k⎥ ⎢ ⎥ vcz3 ⎦ ⎣ozk ⎦ 1 1
(3)
where vci is the node with number ci . Because we use the node as the registration point, which means ok is same with one of the four nodes, equation 4 is reduced to, / 1 for ok = vci hi = (4) 0 for ok = vci U is the global unknown displacement vector at the mesh nodes; Di is the distance vector at the i-th surface nodes. The first term of the energy function represents the biomechanical strain energy, a measure of the mesh deformation. The second term represents the matching error between source point set and target point set, a measure of the fidelity.
376
Y. Liu et al.
We term energy function (2) as a tissue-aware model, because it is able to use λi to balance the quality and fidelity for i-th tissue no matter this model is homogeneous (same Young’s modulus and Possion’s ratio for all tissues) or not. Distance vector D, for simplicity omitting subscript i, reflects the fidelity between source points and target points. To incorporate smoothing into the registration framework, we calculate D according to the relaxed target position by classic Laplacian smoothing. Generally, mesh smoothing is performed as a postprocessing after the mesh generation. However, this will lead to the smoothing out of control of the biomechanical model, so we reflect the smoothing as we calculate D and therefore naturally incorporate it into the energy function (2). The i-th entry di of distance vector D is calculated as follows. Let the source point corresponding to di be s, its normal be n and the set of its neighboring nodes be S. The normal n is calculated by averaging the normals of the surface faces, which share the source point s. For each point pi ∈ S, calculate its closest target point ti , i = 1 . . . m. For s, calculate its ' k=m ti +q closest target point q. The relaxed (smoothed) position of s is s = k=1 . |S|+1 Projecting s − s onto the normal of s leads to 'k=m di = (
tk + q − s) · n | S | +1
k=1
(5)
We illustrate the calculation of di in Fig. 6.
t1
p1
s q s
p2
di
n
t2
Fig. 6. The calculation of di of node s. p1 and p2 are two neighboring nodes of s. t1 , t2 and q are the closets points corresponding to p1 , p2 , s respectively. Their average position is s . Project s − s on unit normal n of node s to produce di .
We minimize W (U ) by solving ∂W =0⇒ (Ki + λi HiT Hi )U = λi HiT Di ∂U i=1 i=1 i=n
i=n
(6)
Multi-tissue Mesh Generation for Brain Images
377
Once we obtain U , we can update the positions of the nodes of the mesh. This procedure will be repeated until the average error between source points and target points is below a predefined tolerance or the iteration reaches maximum number. The average error is evaluated by, '
si − ti ¯ d= , (7) |S| where si is a source point; ti is the closest target point of si , and S is source point set. This average error is also used to evaluate the fidelity in Section 3. The whole method including coarse mesh generation and PBR based deformation is presented in Algorithm 1.
Algorithm 1 multi-tissue mesh generation M =MultiTissueMesher(M ultiLabelImage, tolerance) Require: M ultiLabelImage, tolerance Ensure: M : tissue dependent resolution multi-tissue mesh 1. Coarse Mesh Generation: 2. Generate BCC mesh M 3. Assign label for each tetrahedron in M 4. repeat 5. Label redistribution according to Table 1 to yield multi-tissue mesh M 6. for each subMesh do 7. if satisfy the subdivision criterion (equation (1)) then 8. Subdivide M along the boundary using red green strategy 9. end if 10. end for 11. until no subdivision 12. PBR Deformation: 13. Generate source point set by surface extraction from M 14. Generate target point set by edge detection from M ultiLabelImage 15. repeat 16. Calculate Di using equation (5) 17. Assemble Ki 18. Assemble Hi using equation (4) 19. Solve U using equation (6) 20. Deform M using M ⇐ M + U 21. Calculate error d¯ using equation (7) 22. until reach maximum iteration or d¯ < tolerance 23. Remove the tetrahedra with label 0 from M
3 Results To fully evaluate this method, we first conduct experiment on MRI, which includes two tissues: brain and ventricle. Then, we use two nerves in visible
378
Y. Liu et al.
human data to evaluate the tissue-aware quality control. At last, we qualitatively and quantitatively evaluate this method on a non-manifold data, brain atlas. 3.1
Real MRI
The ventricle has different biomechanical attributes from other tissues in the brain, and so it is often used to build a heterogeneous biomechanical model [12]. We evaluate our method on this simple heterogeneous model: the ventricle and the rest of the brain, in which the Young’s modulus E = 10P a, Poisson’s ratio ν = 0.1 for ventricle, and E = 3000P a, ν = 0.45 for the rest of the brain [12]. The results are shown in Fig. 7. Fig. 7(a) is the multilabel image, in which label 128 and 255 denote the ventricle and the brain respectively. Fig. 7(b) is the coarse multi-tissue mesh and Fig. 7(c) is the final (deformed) multi-tissue mesh. The deformed mesh is cut through and zoomed in as Fig. 8(a). Fig. 8(b) is the wireframe view of two submeshes and Fig. 8(c) is the extracted ventricle. The subdivision threshold we used to produce Fig. 7(b) is 0.85. With this parameter, the outer boundary of the brain is not further subdivided, but its inner interface with the ventricle is subdivided twice. Fig. 8(b) clearly shows that the ventricle has higher resolution than the brain.
(a) Multi-label image
(b) Coarse mesh
(c) Final mesh
Fig. 7. Multi-tissue mesh generation for MRI data. (a) is the multi-label image. The coarse multi-tissue mesh (b) is generated with subdivision threshold 0.85. (c) is the deformed multi-tissue mesh. The numbers of source points and target points are 4497 and 31241 respectively.
From Fig. 7(a), we can see that the segmented brain and ventricle are not smooth, but the brain submesh (Figure 7(c)) and the extracted ventricle submesh (Figure 8(c)) are very smooth. It demonstrates that this method has a low requirement for the segmentation due to the incorporation of the smoothing into the PBR framework.
Multi-tissue Mesh Generation for Brain Images
(a) Closeup
(b) Wireframe view
379
(c) Extracted ventricle
Fig. 8. (a) is the closeup of the inner. (b) is the wireframe view of the two submeshes and (c) is the extracted ventricle.
(a) Ventricle hole
(b) Ventricle Surface
(c) Hole frame
wire-
Fig. 9. (a) is the brain with a ventricle hole. (b) is the extracted ventricle surface. (c) is the wireframe view of the hole. The front surfaces of the brain are culled to show the hole.
(a) Conformity
(b) Closeup
Fig. 10. (a) shows the conformity of the interface. The part in the rectangle is enlarged in (b).
380
Y. Liu et al.
To show the conformity of the interfaces, we first extract two submeshes: the brain and the ventricle. The extracted brain is shown in Fig. 9(a), in which the hole is induced by the extracted ventricle. The extracted ventricle is shown in Fig. 9(b). We want to insert the ventricle into the hole to show the conformity on the interface between the ventricle surface and the hole surface, so the ventricle surface should not be too smooth to distinguish surface triangles, otherwise the conformity is not easily to be observed. To show the conformity, we need to visualize the two surfaces on the interface simultaneously. So, the hole should be visualized in a different way from the ventricle. We use wireframe to show the hole as Fig. 9(c). Note that the front surface of the brain in Fig. 9(c) is culled to clearly show the hole. Fig. 10(a) is the result by inserting the ventricle into the hole. Fig. 10(b) is the closeup of the interface of the two surfaces. We conducted our experiment on Dell PowerEdge (2 x dual-core Opteron 2218, 2.6 GHz CPU) and the runtime is about 5 minutes. 3.2
Visible Human
We also evaluate our method using visible human data1 . Its multi-label image is shown in Fig. 11(a). This data includes three tissues: two nerves (dorsal thalamus (DT) with label 50 and caudata nucleus (CN) with label 100) and the brain with label 255. Fig. 11 and Fig. 12 show the results of this data. We use the same subdivision threshold 0.85 for this data. Fig. 12(b) and Fig. 12(c) clearly demonstrates the tissue-dependent resolution: nerve CN with resolution 1 (subdivided once), nerve DT with resolution 2 and the brain with resolution 0.
(a) Multi-label image
(b) Coarse mesh
(c) Final mesh
Fig. 11. Multi-tissue mesh generation for visible human data. (a) is the multi-label image. The coarse multi-tissue mesh (b) is generated with subdivision threshold 0.85. (c) is the deformed multi-tissue mesh. The numbers of source points and target points are 5828 and 26060 respectively.
1
http://www.nlm.nih.gov/
Multi-tissue Mesh Generation for Brain Images
(a) Closeup
(b) Wireframe view
381
(c) Extracted two nerves
Fig. 12. (a) is the closeup of the inner. (b) is the wireframe view of the three submeshes and (c) is the extracted two nerves.
We use this data for the evaluation of the tissue-aware control of the quality. The results are shown in Fig. 13. The top three figures are the closeup of DT and CNP (λDT = λCN P = 1.0), the dihedral angle distribution of the tissue DT and the dihedral distribution of the tissue CNP. The bottom three figures are the results as we fix λCN P , but reduce λDT to 0.25. The left two figures do not show big difference, but the two middle figures clearly show the quality of DT improves from [13.6,76.1] to [15.1,80.6], because we pay more attention to the quality of DT. The two right figures do not show any big difference because we do not change λCN P . Compared to MRI experiment, more time is needed (9 minutes), because more tissues are involved.
Fig. 13. Tissue-aware quality control. The two values in the bracket are minimum and maximum dihedral angles.
3.3
Brain Atlas
We use brain atlas2 to evaluate this method on non-manifold surfaces. The multi-label image is shown in Fig. 14(a) and the final multi-tissue mesh, 2
http://www.spl.Harvard.edu/publications/item/view/1265
382
Y. Liu et al.
produced with the same trade-off parameters (λ1 = λ2 = ...λ6 = 1.0), is shown in Fig. 14(b).
(a) Brain atlas
(b) Final multi-tissue mesh
Fig. 14. Multi-tissue mesh for brain atlas. Five tissues along with the rest of the brain (a) are discretized. 43: right caudata nucleus (RCN), 53: left caudata nucleus (LCN), 98: right anterior horn of lateral ventricle (RAHLV), 99: left anterior horn of lateral ventricle (LAHLV), 140: corpus callosum (CC). The numbers of source points and target points are 6225 and 39136 respectively.
We zoom in the interfaces of these tissues to show the conformity in Fig. 15 in a different point of view from Fig. 10. Fig. 16 has three subfigures and
Fig. 15. Conformity of interfaces
Multi-tissue Mesh Generation for Brain Images
383
Fig. 16. The evaluation of fidelity, tissue dependent resolution and quality on the brain atlas
shows the fidelity, tissue-dependent resolution, and quality respectively. The fidelity part shows the comparison of the fidelity before PBR (left) and after PBR (right). The figure is generated by cutting through the mesh and overlapping it with the same slice of the multi-label images. The black arrows point to the places where bigger improvement of the fidelity occurs. Compared with the inner structures, the brain shows bigger improvement of the fidelity. The reason is, compared with the inner structures, the brain has lower resolution and therefore lower fidelity. Since we do not pay more attention to the inner structures (the same λi for all tissues), the tissue with lower fidelity improves fidelity more. The fidelity is evaluated using equation (7) and listed in Table 2. In resolution part, the mesh is cut through to show the tissue-dependent resolution. In quality part, we present the distribution of the dihedral angle and aspect ratio under different trade-off parameter λ (λ1 = λ2 = ...λ6 = λ). The values in brackets are the minimum and the maximum values for the whole mesh. The values for each submesh are listed in Table 2. As we increase λ from 1.0 to 1.5, i.e, paying less attention to the quality, the minimum dihedral angle reduces from 4.57 to 3.96 and the maximum aspect ratio increases from 8.80 to 15.83. It takes about 14 minutes to generate the final multi-tissue mesh. A good quality mesh is characterized by the absence of slivers, i.e., tetrahedra with a very small dihedral angle, or aspect ratio close to 1. One observation from quality part is the number of the tetrahedra with ratio around 1
384
Y. Liu et al.
increases from 20000 to 40000 even when we pay less attention to the quality (increase λ from 1 to 1.5). This can be explained by the reason that lots of tetrahedra happen to improve their quality as deformed to the boundary.
4 Conclusion This paper presents a BCC-based multi-tissue mesh generation approach. This method inherits the advantages of BCC lattice mesh and extends it to a multi-tissue mesher by dealing with conformity using label redistribution based on a predefined operation table. This method can reach tissuedependent resolution by using red-green subdivision under the guide of a subdivision criterion. The flexible control of the quality, fidelity and smoothing is obtained by incorporating these properties into a PBR framework. The experiments on the data ranging from MRI, visible human, to brain atlas demonstrate the effectiveness of this method.
References 1. Boltcheva, D., Yvinec, M., Boissonnat, J.D.: Mesh generation from 3d multimaterial images. In: Yang, G.-Z., Hawkes, D., Rueckert, D., Noble, A., Taylor, C. (eds.) MICCAI 2009. LNCS, vol. 5762, pp. 283–290. Springer, Heidelberg (2009) 2. Pons, J.P., S´egonne, F., Boissonnat, J.D., Rineau, L., Yvinec, M., Keriven, R.: High-quality consistent meshing of multi-label datasets. In: Karssemeijer, N., Lelieveldt, B. (eds.) IPMI 2007. LNCS, vol. 4584, pp. 198–210. Springer, Heidelberg (2007) 3. Meyer, M., Whitaker, R., Kirby, R.M., Ledergerber, C., Pfister, H.: Particlebased sampling and meshing of surfaces in multimaterial volumes. IEEE Transactions on Visualization and Computer Graphics 14(6), 1372–1379 (2008) 4. Cheng, S.W., Dey, T.K., Edelsbrunner, H., Facello, M.A., Teng, S.H.: Silver exudation. J. ACM 47(5), 883–904 (2000) 5. Zhang, Y., Hughes, T.J., Bajaj, C.L.: An automatic 3d mesh generation method for domains with multiple materials. Computer Methods in Applied Mechanics and Engineering 199(5-8), 405–415 (2010) 6. Molino, N., Bridson, R., Teran, J., Fedkiw, R.: A crystalline, red green strategy for meshing highly deformable objects with tetrahedra. In: International Meshing Roundtable, pp. 103–114 (2003) 7. Glazer, A.M., Burns, G.: Space Groups for Solid State Scientists, 2nd edn. Academic Press, Inc., Philadelphia (1990) 8. Kitware, http://www.itk.org/ 9. Clatz, O., Delingette, H., Talos, I.F., Golby, A., Kikinis, R., Jolesz, F., Ayache, N., Warfield, S.: Robust non-rigid registration to capture brain shift from intraoperative MRI. IEEE Trans. Med. Imag. 24(11), 1417–1427 (2005) 10. Bierling, M.: Displacement estimation by hierarchical block matching. In: Proc. SPIE Vis. Comm. and Image Proc., vol. 1001, pp. 942–951 (1988) 11. Bathe, K.: Finite Element Procedure. Prentice-Hall, Englewood Cliffs (1996) 12. Wittek, A., Miller, K., Kikinis, R., Warfield, S.K.: Patient-specific model of brain deformation: Application to medical image registration. Journal of Biomechanics 40(4), 919–929 (2007)
A Toolkit for Parallel Overset Grid Assembly Targeting Large-Scale Moving Body Aerodynamic Simulations George Zagaris1, Michael T.Campbell1 , Daniel J. Bodony1 , Eric Shaffer1 , and Mark D. Brandyberry2 1 2
University of Illinois at Urbana-Champaign, IL, 61801, USA {gzagaris,mtcampbe,bodony,shaffer1}@illinois.edu IllinoisRocstar LLC, IL, 61801, USA [email protected]
Summary. The Overset (Chimera) Grid approach has many practical benefits for unsteady moving grid simulations. However, an inherent requirement and challenge is the need to establish the inter-grid communication and donor-receiver pairs where the solution must be exchanged between overlapping grids via a process formally known as overset grid assembly. Furthermore, in the context of large-scale unsteady simulations, grid assembly is performed at each time-step and typically must operate on a set of already distributed grids. We call this problem the distributed overset grid assembly problem. The implementation of techniques to efficiently handle the distributed overset grid assembly problem is the primary topic of this paper. In particular, this paper makes the following technical contributions. First, we formulate the distributed overset grid assembly problem and present its challenges. Second, we present techniques that can handle both 2-D and 3-D, structured, unstructured, or mixed element, distributed, overset grids. Finally, we present preliminary performance results using a Wing-Store Separation configuration.
1 Introduction The simulation of aerodynamically driven, moving body problems, such as, store separation, fluid-structure interaction, aircraft maneuvering and flapping-wing flight dynamics, to name a few, are some of the current challenges facing Computational Fluid Dynamic (CFD) practitioners. The Overset (Chimera) grid approach provides additional flexibility for such problems by allowing the moving and non-moving parts of the domain to be meshed separately. This enables motion to occur more naturally without the otherwise required, grid stretching and re-meshing. However, an inherent requirement and challenge is that at each time-step the composite grid system must
386
G. Zagaris et al.
be processed to form the donor-receiver pairs where the solution is exchanged from one grid to another. This step is formally known as overset grid assembly and is one of the primary focus points of the paper. This paper builds on top of our previous work [16] wherein the feasibility of our approach was demonstrated using a 2-D linear cascade model of the NASA Glenn Source Diagnostic Test fan (SDT) consisting of a rotor-stator system at realistic flow conditions. Here, we present recent enhancements to our algorithms with an emphasis on aspects of parallel overset grid assembly. Modern flow solvers typically partition the composite grid system and distribute the work to several processors to take advantage of all the available computing resources. Static problems have no motion and thus overset grid assembly is performed only as pre-processing step. For moving body simulations however, overset grid assembly is an integral part of the solution process and must be performed at each time-step. This complicates further the overset grid assembly process by requiring the handling of a distributed composite grid system. To distinguish from the typical overset grid assembly step, we call this problem the distributed overset grid assembly problem and its solution constitutes the main contribution of this paper and unique aspects of this work. The technical contributions of this paper are the following. First, we formulate the distributed overset grid assembly problem and the associated requirements and challenges. Second, we present techniques to efficiently handle a distributed composite grid system that can consist of structured, unstructured, and mixed element grids in both 2-D and 3-D. Finally, we show preliminary parallel performance results of our approach using a wing-store separation configuration. The remainder of this paper is organized as follows. Section 2 formulates the distributed overset grid assembly problem and presents the associated challenges and requirements. Section 3 presents a brief survey of related work on parallel overset grid assembly. Our algorithms and techniques for parallel overset grid assembly are presented in Section 4 and preliminary performance results using the Wing-Store Separation example are shown in Section 5. Finally, we conclude in Section 6 with final remarks and future directions.
2 The Distributed Overset Grid Assembly Problem The overset grid approach has inherent coarse-level parallelism since 3Nthe domain of interest, Ω, is defined by a composite grid system, S(Ω) = i=0 (Gi ), consisting of N independent grids, Gi , with N ≥ 2, that can be distributed to N processors. However, this coarse level decomposition is not sufficient for two main reasons. First, there is not enough parallelism to harness all of the compute resources available in modern production settings; and second, viable solutions to the current CFD challenges generally require more parallelism than what is inherently offered by the overset grid approach. Typically, each grid, Gi ∈ S(Ω), is distributed to P processors by first partitioning into
Parallel Overset Grid Assembly
387
Mi smaller sub-grids, g(i,j) , where i ∈ {0, N } denotes the global grid ID and j ∈ {0, Mi} denotes the partition ID. In this context, we formulate the distributed overset grid assembly problem as follows: Definition 1. Given a distributed composite grid system which discretizes ˆ the domain of interest, Ω, defined as the super-set, S(Ω) = {Gˆ0 , Gˆ1 ...GˆN }, ˆ ˆ ˆ where, ∀Gi ∈ S(Ω), Gi = {g(i,0) , g(i,1) , ..., g(i,Mi ) } determine the set of donorj,m receiver 5 pairs (r ∈ g(i,k) , d ∈ g(j,m) ) within the overlapping region Ri,k = g(i,k) g(j,m) , where i, j ∈ {0, N }, i = j and k ∈ {0, Mi}, m ∈ {0, Mj }. Techniques to handle the distributed overset grid assembly problem as stated above are necessary for moving body simulations. In addition, there are also three more general requirements which we enumerate below: R1 Fully automated: the complexity of unsteady problems typically requires many iterations and the execution times are on the order of days or weeks. Thus, grid assembly must be fully automated for the method to be viable. R2 Robust solution transfer: accumulation of errors in the interpolation of the solution to the receiver points can degrade the quality of the simulation and often leads to a fatal state. Thus, interpolation accuracy is crucial. R3 Efficiency: the overset grid assembly is a processing step necessary for the flow-computation at each timestep, hence, its performance must not deteriorate the parallel performance of the flow-solver. Given the above formulation of the distributed grid assembly problem, and the general requirements, the primary challenges for a parallel methodology to the solution of the distributed overset grid assembly problem are the following: C1 Algorithms must account for the internal boundaries or separators ∂Si of the distributed composite grid system. C2 Heuristics for dealing with regions where multiple grids overlap and handling of orphan points are not always clear. C3 Load balancing is difficult for three main reasons: 1. Overset grid assembly is a multi-phase algorithm. At each phase, the workload is characterized differently. Therefore, it is difficult to determine a strategy for distributing the load. 2. Load-balancing is rarely optimal since the partitioning is done with respect to the flow-solver parameters. 3. As the grids are moving the load is dynamically changing which may negatively affect the performance. Addressing these challenges and satisfying these requirements are on-going, long-term goals of this work. In this paper, we present our current progress towards that goal and our preliminary performance results.
388
G. Zagaris et al.
3 Related Work A number of grid assembly codes are currently available. PEGASUS[15, 14] is the seminal grid assembly code and has a demonstrated track record of robustness and flexibility. PEGASUS has been applied to moving grid simulations[5, 13], with data exchange between the fluid solver and PEGASUS occuring through the file-system. While these simulations were successful, reliance of file IO for communication, which entails high overhead, is less than ideal for moving grid simulations due to the repeated communication requirements. Recall, overset grid assembly is invoked at each time-step as the grids are moving. SUGGAR[7] provides a general overset grid assembly capability that supports both node-based and cell-centered structured or unstructured flowsolvers and has been employed to solve moving grid problems where the grid motion is known a priori[7], or prescribed by a 6DOF library as demonstrated in [2]. Moreover, SUGGAR++ [8], the successor of SUGGAR, features improved automation and efficiency. However, like PEGASUS, the SUGGAR++ mechanism for integrating with an existing flow-solver is currently out-of-core, for example [2, 9], which entails further overheads per time-step. Overset capability has also been successfully added directly within a flowsolver. Notably, Overflow[6] and Beggar[1] are perhaps among the most popular examples. The benefit of this approach is that it is easier to hide the latencies of the overset grid assembly with the flow solver computation using function overlapping as indicated by Prewit et al. [10]. However, this capability is not easily accessible to third party flow-solvers and so this approach does not provide a general-pupose solution to the grid assembly problem. A unique aspect of the work presented herein is the development toward a solution to the distributed overset grid assembly problem as formulated in Section 2. While tools like SUGGAR and PEGASUS provide parallel overset grid assembly capability, their use within a moving body simulation framework is primarily out-of-core and so requires a merge-and-repartition step at each time-step. Algorithms for handling an already distributed composite grid system are needed to alleviate this overhead. Motivated by the application to moving body simulations, we developed algorithms for parallel overset grid assembly that can handle arbitrarily partitioned and distributed grids. Our algorithms are in library-form which enables an in-core and tightly-coupled integration with the flow-solver.
4 Techniques for Parallel Overset Grid Assembly The first step in processing a distributed composite grid system is computing the set of overlapping regions = {R0 , R1 , ...Rk }. Each overlapping region Ri ∈ is associated with a pair of overlapping sub-grids, such that, 5 Ri = Rj,m = g . Fig. 1 illustrates this step using two overlapping g (i,k) (j,m) i,k airfoils.
Parallel Overset Grid Assembly
389
Fig. 1. The overlap region Ri , shown with a boldface black wireframe, for the two overlapping airfoils
The overlapping region, Ri serves two main purposes. First, it provides the auxiliary data-structure used in establishing the inter-process and intergrid communication links; and second, it defines the search region wherein the donor-receiver pairs are identified and the solution is exchanged. In this context, we summarize our parallel overset grid assembly algorithm for the solution to the distributed overset grid assembly problem in the following four main steps: 1. Compute by overset collision detection: The enclosing bounding boxes of each sub-grid are used as auxiliary data-structures to detect collisions. When collisions are detected, the resulting bounding box intersection is used to approximate the overlap region and form Ri . 2. Hole-Cutting: Within Ri the mesh points of a component sub-grid that are within a solid body, e.g., a store, are identified and marked for exclusion from the flow-solver calculations and data-transfer operations. 3. Donor-Search: Identifies the donor-receiver pairs and forms the interpolation stencil for exchanging the solution between overlapping grids. 4. Interpolation: Interpolates data to a receiver point, in one sub-grid, from the corresponding donor interpolation stencil members and weights of in the overlapping donor grid. The first step is a straightforward pairwise bounding-box collision of the bounding boxes of all the sub-grids. The bounding boxes are distributed to all processes using a collective operation and each process computes its intergrid and inter-process communication links independently. There are two types of communication links that we distinguish: (a) local, for sub-grids that
390
G. Zagaris et al.
reside on the same process, and (b) remote, for links that reside on different processes and require additional data communication. The two most crucial and time-consuming operations of the algorithm are the hole-cutting and donor-receiver search operations. Both operations rely heavily on searching the donor grid for the cell that contains a receiver point and they are best described by first presenting the underlying searching operations followed by their application to the hole-cutting and donor-receiver search procedures respectively. 4.1
Rapid Point-Searching Procedure on Arbitrary Grids
Given a grid G, and the region of interest Ri , we want to find the cell C ∈ G that contains the query point q = (x, y, z). Grid G can be either structured, unstructured or a mixed element grid. Therefore, a generalized methodology for checking whether point q is inside the cell C is required. The Natural Coordinate System which, is used extensively in the Finite Element Method [3], provides a mathematically sound foundation that enables the implementation of such a generalized procedure for basic mesh element shapes, e.g., quadrilaterals and triangles in R2 , and terahedra, hexahedra, prisms and pyramids in R3 . Natural Coordinates 3 For a cell C = ki=1 pi , where k is the total number of nodes of the cell and pi = (xi , yi , zi ), i ∈ [1, k], the natural coordinates define a local coordinate system, Φ = (ξ, η, ζ) with respect to the given cell with the following properties: 1. The coordinate range within the element is [0, 1]. 2. One particular coordinate, φi , has unit value at one cell node, pi , and zero value at all other nodes. 3. The variation between nodes is linear. Based on these properties, an exterior/interior relationship for a query point q and a cell C can be defined as follows. Definition 2. Given a query point q = (x, y, z) and the corresponding natural coordinates Φq = (ξq , ηq , ζq ) with respect to a cell C, q is in the cell C if and only if the relationship (0 − ε) ≤ φi ≤ (1 + ε) ∀φi ∈ {ξq , ηq , ζq } holds, where ε is a prescribed geometric tolerance. To use the above definition a coordinate transformation from the cartesian coordinates of point q to the natural coordinates Φq with respect to the given cell C is required. The local coordinates are mapped to global cartesian coordinates using the following transformation: ⎞ ⎛ k xˆ(ξ, η, ζ) F (ξ, η, ζ) = ⎝ yˆ(ξ, η, ζ) ⎠ = Ni (ξ, η, ζ)pi (1) i=1 zˆ(ξ, η, ζ)
Parallel Overset Grid Assembly
391
where, Ni are the shape functions for the cell C from finite element analysis, e.g., the Lagrange interpolation functions. The inverse transformation, i.e., from the cartesian coordinates q to the natural coordinates Φq , requires solving the system of interpolation functions, Ni , for the natural coordinates Φq . For some elements the interpolation functions are linear and therefore the system can be solved analytically. However, in other cases, e.g., for quads or hexahedra elements, the interpolation functions are non-linear and thus, numerical techniques must be employed. A simple and common technique for solving the non-linear system is the Newton-Raphson method [3]. In this context, equation 1, yields the jacobian matrix, J for the cell C shown below: ⎛ ∂ xˆ ∂ xˆ ∂ xˆ ⎞
∂ξ ∂η ∂ζ ⎜ ∂ yˆ ∂ yˆ ∂ yˆ ⎟ ∂F ∂F J = ∂F = (2) ⎝ ∂ξ ∂η ∂ζ ∂ξ ∂η ∂ζ ⎠ ∂ zˆ ∂ zˆ ∂ zˆ ∂ξ ∂η ∂ζ
From Eqs. 1 and 2 a general iteration to solve for the natural coordinates Φq corresponding to point q, i.e., to minimize F(Φq ) − q, can be formulated as follows: m −1 Φm+1 = Φm F(Φm (3) q q − [J ] q ) where, m is the Newton iteration counter. The Newton-Raphson method converges quadratically but, requires a good initial guess. The parametric center Φc = (ξc , ηc , ζc ) of the cell C provides a reasonable starting point, hence, Φ0q = Φc . Table 1 summarizes the values of Φc for common mesh elements. Table 1. Listing of initial guesses for the Newton-Raphson method for common mesh elements Cell Type ξc Quad 0.5 Triangle 0.33 Tetrahedron 0.25 Hexahedron 0.5 Prism(6-node) 0.33 Pyramid 0.4
ηc 0.5 0.33 0.25 0.5 0.5 0.4
ζc N/A N/A 0.25 0.5 0.5 0.2
Virtual Grid The naive approach of visiting each cell of grid G within the region of interest Ri and checking if the query point q is inside the cell can become prohibitively expensive. Instead, accelerated searching techniques are employed which are based on spatial decomposition. The main idea is to minimize the search space of the algorithm by further subdividing the space of Ri such that for a given point query q only a subset of the cells is visited. This is achieved
392
G. Zagaris et al.
(a)
(b)
Fig. 2. Virtual Grid example. (a) Topology of the Virtual Grid in 2-D (b) Virtual Grid in 3-D enclosing of a store grid.
using spatial data-structures such as an oct-tree [11, 12], used in an earlier implementation [16], or a virtual grid. An example of a virtual grid is shown in Fig. 2. 3 A Virtual Grid, V(Ri ) = ki=1 bi , is essentially a 2-D or 3-D hash table which divides the space of Ri in several buckets, bi . It is virtual in the sense that a grid is not actually constructed in practice. Instead, it is given by: 1. its bounds, Cmin = (xmin , ymin , zmin ) and Cmax = (xmax , ymax , zmax ), which are provided by Ri , and 2. the sampling step-size Δ = (δx , δy , δz ) defined as a factor of the largest edge-length within region Ri The dimensions of V(Ri ), denoted by (Δx , Δy , Δz ), can be computed as follows: 6 7 6 7 8 9 xmax − xmin zmax − zmin ymax −ymin Δx = , Δy = , Δz = (4) δy δx δz Given this implicit definition and a query point q = (x, y, z) the corresponding structured coordinates, (i, j, k) are computed using the following transformations: : ; : ; < = x − xmin z − zmin i= , j = y−yδymin , k = (5) δx δz Then, a hashing function, H(i, j, k), is used to compute the linear bucket index, i, which is used as an entry point into an abbreviated list of cells of grid G, within the bucket bi . H(i, j, k) = (k − 1)Δx Δy + (j − 1)Δx + i
(6)
The cells of Grid G within region Ri are first mapped to the corresponding buckets using Eqs. 5, 6. Similarly, each query qi is mapped to the corresponding bucket bi in constant time. Then, within each bucket bi , the abbreviated
Parallel Overset Grid Assembly
393
list of cells of Grid G is searched for the cell C containing q using the Natural Coordinate transformation described earlier. Spatial Sorting of Query Points and Caching Usually, multiple donor-receiver queries are required for a given problem. One strategy to improve the performance for multiple queries is to exploit the problem’s spatial locality. This can be accomplished by pre-fetching the results for the next query, qi+1 , in a cache which can yield faster access times. Remark 1. By observation, it is easy to see, that for query points that are geometrically close, their respective enclosing cells are also close. In this context, once a cell Ci is encountered, its neighbors are inserted into a cache for the next query, qi+1 . Then, the search for the cell containing qi+1 starts from the cache and reverts to the virtual grid if there is a cache miss, i.e., the cell was not found in the cache. Remark 2. This strategy works best with datasets consisting of spatially ordered query points qi . In the context of overset grid assembly the receiver points are extracted from a grid which allows for extracting the points such that two points close in order are also close geometrically. The present cache implementation employs a Least-Recently-Used (LRU) cell insertion/eviction policy implemented using a doubly linked-list. New cache entries are always placed in the beginning of the cache. Moreover, if there is a cache hit, it is moved to the beginning of the cache. By this approach, the most recently encountered cells and their neighbors are always in the beginning of the cache. Using a doubly linked-list as the underlying datastructure enables the use of pointers to implement in constant time all cache insertion and eviction operations. However, searching the cache is currently an O(N ) operation and care must be taken in choosing the cache size.
(a)
(b)
(c)
Fig. 3. Sample results from the Wing-Store separation moving grid configuration. (a) Initial state of the Wing-Store configuration (b) Wing-Store after two iterations. (c) Wing-Store after four iterations.
394
G. Zagaris et al.
(a)
(b)
Fig. 4. Performance plots illustrating the benefits of caching. (a) Graph of execution times per iteration. The red, the blue and orange curves indicate the execution times for each iteration when the algorithm is executed with no caching, a cachesize-factor: 0.0025 and a cache-size-factor: 0.00015 respectively. (b) Comparative bar-plot depicting the ratio of cache hits versus cache misses with respect to the total number of queries.
The performance benefits from caching are illustrated using a three-grid system of the Wing-Store configuration, shown in Fig. 3. The store undergoes vertical motion in the negative-z direction relative to the wing. The total number of iterations was 10. A plot of the execution time to find cells containing the points in the outer-boundary of the store grid, for each iteration, is show in Fig. 4(a). When no caching is employed the execution time increases at each iteration since no previous history is used and more cells are searched. Notably, the execution time only decreases when the store moves to the coarser regions of the background grid, in the last couple of iterations. In contrast, when caching is employed, the performance is drastically improved even for the first iteration and for consecutive iterations it is drastically reduced. Moreover, as it is shown in Fig. 4(b) almost every query is a cache-hit and a very low miss-ratio is observed. 4.2
Hole-Cutting for Distributed Grids
Each grid in the composite grid system Gi ∈ S is classified as either a background grid or a feature grid. Feature grids consist of solid boundaries that cut a background grid. The cells of a background grid that are within or intersecting with the solid boundaries of a feature grid need to be marked as invalid. This process is formally known as hole-cutting. Definition 3. More precisely, 3 i let Σ denote the cutting surface of a solid boundary and let Gi = M k=1 g(i,k) be a a background grid distributed to P processors. Then, hole-cutting identifies all the cells ci ∈ g(i,k) ∀k ∈ {1, Mi} that are enclosed in Σ. In this context, a suitable definition of the cutting surface Σ is required to satisfy geometric queries. The present implementation employs a discrete, explicit, representation of Σ, that can be automatically extracted from the
Parallel Overset Grid Assembly
395
feature grids based on boundary condition information, or alternatively, supplied by the user during the problem setup stage for handling more complex cases. Under this scenario, hole-cutting is a three-stage process: 1. Extract and distribute the cutting surface Σ to all connecting processes. 2. Outline the cutting surface Σ on the background grid. This step essentially flags all the cells that intersect the cutting surface by employing rapid point searching techniques described earlier. 3. Flood/Fill the interior of the outline by marking all the cells for exclusion. Remark 3. A water-tight representation of the cutting surface Σ is required on all overlapping processes to ensure the flood/fill process does not leak out. Remark 4. Recall, that since the background grid is distributed, the outline of the hole could span several processors. Consequently, the flood/fill process must also account for the partition interface boundaries when detecting if a point is in the interior of the hole. Definition 4. A point p is in the interior of a hole, if it is surrounded by either cells that are marked as the hole outline or a partition boundary.
(a)
(b)
(c)
(d)
Fig. 5. Sample results from distributed hole-cutting using the Cylinder-In-Box configuration. (a) Cutting surface overlayed on partition 1 of the background rectangular grid. (b) Planar-cut along the x-direction and view of the IBLANK field on partition 1. (c) Cutting surface overlayed on partition 2 of the background rectangular grid. (d) Planar-cut along the y-direction and view of the IBLANK field on partition 2.
396
G. Zagaris et al.
Results for a Cylinder-In-Box configuration are shown to illustrate the functionality of the present implementation for 3-D configurations under a distributed setting where the grid(s) are further partitioned.The results after the hole-cutting process are shown in Fig. 5 where the background grid is distributed in two processes. The cutting surface, Σ (e.g., Figs. 5(a) and 5(c)), is distributed to all processes that own a background grid. Figs. 5(b) and 5(d) illustrate the results after hole-cutting is complete on both processes. 4.3
Donor-Receiver Search
After all hole-points are excluded, the next step is to identify the donorreceiver pairs, r ∈ g(i,k) and d ∈ g(j,m) , within the associated overlapping region Ri . The process begins by extracting the candidate receiver points in grid g(i,k) and the candidate donor cells in grid g(j,m) . Further, if the overlapping grids do not reside on the same process, the candidate receiver points are sent to the process that owns the donor grid. Definition 5. A candidate receiver point r ∈ g(i,k) is any point that is within a user-supplied fringe distance, δf , from the outer-boundary or a hole-outline identified during hole-cutting. Definition 6. A candidate donor cell d ∈ g(j,m) is any cell that is within the overlap region Ri that does not have any hole-points. Let R, D denote the candidate receiver and candidate donor lists respectively. For every receiver r ∈ R the list of donors D is searched to identify the cell, d, that contains r. Searching the donor list employs spatial decomposition techniques and caching, as described earlier, to improve the performance of this operation. The present implementation targets node-centered flow solvers, hence after the cell d is identified, the nodes of d and the flow data associated with them form the interpolation stencil members required for interpolating the solution to the receiver r. Extension, to cell-centered schemes or higher-order stencil can be accomplished by encompassing the neighbors of the cell d, denoted by N (d). Remark 5. For higher order, or cell-centered schemes, forming the interpolation stencil based on N (d) may require further communication if d is on a partition boundary. Once, the stencil is formed, the grids that own the receiver points ri are updated to indicate to the flow-solver that these points are receivers, and the solution at these points will be interpolated from another grid. 4.4
Interpolation
Finally, after the donor-receiver pairs are identified and the interpolation stencil is formed, interpolation of the solution to the receiver point is a
Parallel Overset Grid Assembly
397
straightforward linear combination. The stencil information provides the following information: 1. the data values at each of the donor stencil members, fi , and 2. the corresponding interpolation functions, Wi (ξ, η, ζ), that relate the donor values fi to the enclosed receiver point r. Then, the interpolated value finterp can be expressed as the result of a weighted average of the data values at each stencil member as follows: finterp =
N
Wi fi ,
(7)
i=1
where, N , denotes the total number of points in the stencil. Lagrange interpolation is used in the current implementation to define the interpolation weight functions Wi .
5 Wing-Store Separation In this section we report our current performance results using a Wing-Store configuration. The composite overset grid system consisted of three grids. A background structured grid and two unstructured feature grids for the wing and the store. A summary of the respective grid sizes is given in Table 2. The two feature grids are moving relative to each other by applying translation and rotation to each of the feature grids at each iteration. Table 3 gives a summary of the displacement vector and rotation angles used. For our evaluation, we performed 10 iterations and measured the execution time of the donor search using P ∈ [1, 64] processes on a linux based cluster. Each cluster node is equipped with two quad-core Intel XEON CPUs @2.50 GHz and 16GB of shared memory. The background grid was partitioned using Recursive Bisection and METIS [4] was used for partitioning the two Table 2. Summary of grid sizes for the Wing-Store composite, overset grid system Grid Background Wing Store
Grid Type Number of Nodes Number of Cells Structured 1.69M 1.64M Unstructured 4.8K 9.5K Unstructured 4.4K 8.8K
Table 3. Summary of the displacement vector and rotation angles applied to the Wing and Store grids at each timestep Grid Displacement (dx , dy , dz ) Rotation Angle Rotation Axis Wing (−2.5, 0.0, 1.0) 2◦ Y Store (−3.0, 0, −0.5) −2◦ Y
398
G. Zagaris et al.
Fig. 6. Partitioned composite grid system of the Wing-Store configuration. The background grid was partitioned using recursive bisection and the store and wing grids were partitioned using METIS. Each grid was partitioned in 32 partitions.
Fig. 7. The overlap region Ri , shown with a boldface black wireframe, for the two overlapping airfoils
Parallel Overset Grid Assembly
399
unstructured, feature grids. A sample partitioning of the composite grid system is illustrated in Fig. 6. The overlapping grid partitions were distributed to the number of processes using a simple cyclic-mapping strategy such that each process has at least one partition of each of the three grids. We measure the execution time for three levels of decomposition ∀P ∈ [1, 64] processors: • • •
coarse-grain: Each grid was partitioned to M = P partitions. mid-grain: Each grid was partitioned to M = 2 × P partitions. fine-grain: Each grid was partitioned to M = 4 × P partitions.
Figure 7 shows plots of the execution times for each level of decomposition and quantitative performance data are summarized in Table 4. Table 4. Summary of the execution times and corresponding speedup for each level of decomposition, coarse-grain, mid-grain, fine-grain using up to 64 processors. Execution Time Tp (s) Speedup T1 /Tp P Coarse Mid Fine Coarse Mid Fine 1 554 491 561 N/A N/A N/A 2 410 342 459 1.35 1.43 1.22 4 317 315 367 1.74 1.55 1.53 8 308 289 364 1.8 1.69 1.54 16 223 239 248 2.48 2.05 2.26 32 201 211 229 2.75 2.32 2.44 64 196 182 224 2.82 2.69 2.51
As the number of processors increases the overall parallel efficiency, given by Eq. 8, T1 Ep = (8) P × Tp decreases. This significant scalability issue is attributed to the severe load imbalance of the problem. The load distribution for 8 processors, depicted in Fig. 8, shows that only processes {2, 4, 7} do work while the rest of the processes are IDLE waiting for the donor-search to complete. This happens because the background grid partition on process 4 is the only partition that overlaps with most of the feature grid partitions. In an attempt to address this issue we tried to apply over-decomposition. Although mid-grain decomposition generally appears to help fine-grain decomposition made the problem worst. A better partitioning strategy, such as the Cartesian Spatial Decomposition Volume, employed in SUGGAR++ [8] can achieve a much better load balancing but, does not solve the problem entirely due to the inherent complications of overset grid assembly that we outline in Section 2, item C3. Furthermore, since the grids are already arbitrarily partitioned and distributed, this
400
G. Zagaris et al.
Fig. 8. Workload distribution on 8 processors for a single iteration
would necessarily require some sort of dynamic re-partitioning. Efficient loadbalancing in dynamic simulations is a long-standing and still active research area. Further research on how dynamic re-partitioning can be employed to improve the performance is a promising direction for future work. In addition, exploiting the locality of the problem by caching and pre-fetching the grid assembly results across different time-steps is a promising strategy. In the present implementation caching algorithms only benefit the searching operations within a single time-step. However, a similar argument for caching can be made for the grid assembly results across iterations. Typically, the flowsolver time-step, dt, is small. Consequently, the grid assembly results do not drastically change in comparison to the previous iteration. Development of a caching algorithm to exploit this feature of overset grid assembly is currently in progress.
6 Conclusion and Future Work Techniques for parallel overset grid assembly are presented. The methods presented herein are capable of handling arbitrarily partitioned and distributed composite overset grid systems. To our knowledge, this is the first in-core, parallel overset grid assembly implementation that deals with the distributed overset grid assembly problem directly, as formulated in Section 2. Our preliminary performance evaluation resulted in a better understanding of the performance of parallel overset grid assembly in a distributed environment. Future efforts will be focused on improving the performance by improved the load balance and caching of previous results across iterations.
Parallel Overset Grid Assembly
401
References 1. Belk, D., Maple, R.: Automated assembly of structured grids for moving body problems. In: Proceedings of the 12th AIAA Computational Fluid Dynamics Conference, AIAA Paper 1995-1680-CP (1995) 2. Biedron, R.T., Thomas, J.L.: Recent enhancements to the fun3d flow solver for moving-mesh applications. In: Proceedings of the 47th AIAA Aerospace Sciences Meeting, AIAA Paper 2009-1360 (2009) 3. Huebner, K.H., Dewhirst, D.L., Smith, D.E.: The Finite Element Method For Engineers. John Wiley & Sons, Chichester (2001) 4. Karypis, G., Kumar, V.: A fast and high quality multilevel scheme for partitioning irregular graphs. SIAM Journal on Scientific Computing 20, 359–392 (1998) 5. Meakin, R.L., Suhs, N.: Unsteady aerodynamic simulaton of multiple bodies in relative motion. In: Proceedings of the 9th AIAA Computational Fluid Dynamics Conference, Buffalo, NY, pp. 643–657 (June 1989) 6. Meakin, R.L., Wissink, A.M.: Unsteady aerodynamic simulation of static and moving bodies using scalable computers. In: 14th Computational Fluid Dynamics Conference, June 28-July 1, AIAA paper 1999-3302 (1999) 7. Noack, R.W., Boger, D.A.: Improvements to suggar and dirtlib for overset store separation simulations. In: Proceedings of the 47th AIAA Aerospace Science and Exhibit, Orlando, FL (January 2009) 8. Noack, R.W., Boger, D.A., Kunz, R.F., Carrica, P.M.: Suggar++: An improved general overset grid assembly capability. In: Proceedings of the 47th AIAA Aerospace Science and Exhibit, Orlando, FL (January 2009) 9. Pandya, M.J., Fring, N.T., Noack, R.W.: Progress toward overset-grid moving body capability for usm3d unstructured flow solver. In: Proceedings of the 17th AIAA Computational Fluid Dynamics Conference, AIAA Paper 20055118 (June 2005) 10. Prewitt, N.C., Belk, D.M., Shyy, W.: Parallel computing of overset grids for aerodynamic problems with moving objects. Progress in Aerospace Sciences 36, 117–172 (2000) 11. Samet, H.: The Design and Analysis of Spatial Data Structures. AddisonWesley, Reading (1990) 12. Samet, H.: Applications of Spatial Data Structures: Computer Graphics, Image Processing, and GIS. Addison-Wesley, Reading (1995) 13. Sickles, W.L., Denny, A.G., Nichols, R.H.: Time-accurate cfd predictions for the jdam separation from an f-18c aircraft. In: Proceedings of the 38th AIAA Aerospace Science and Exhibit, Reno, NV (January 2000) 14. Suhs, N., Rogers, S., Dietz, W.: Pegasus 5: An automated pre-processor for overset-grid cfd. American Institute of Aeronautics and Astronautics 41(6), 1037–1045 (2003) 15. Suhs, N., Tramel, R.: Pegasus 4.0 user’s manual. Technical Report TR 91-8 (1991) 16. Zagaris, G., Bodony, D.J., Brandyberry, M.D., Campbell, M.T., Shaffer, E., Freund, J.B.: A collision detection approach to chimera grid assembly for high fidelity simulations of turbofan noise. In: Proceedings of the 48th AIAA Aerospace Sciences Meeting, Orlando, FL (January 2010)
This page intentionally left blank
A Dimension-Independent Data Structure for Simplicial Complexes Leila De Floriani1 , Annie Hui2 , Daniele Panozzo1, and David Canino1 1 2
Department of Computer Science, University of Genova, Italy [email protected], [email protected], [email protected] Department of Computer Science, University of Maryland, MD, USA [email protected]
Summary. We consider here the problem of representing non-manifold shapes discretized as d-dimensional simplicial Euclidean complexes. To this aim, we propose a dimension-independent data structure for simplicial complexes, called the Incidence Simplicial (IS) data structure, which is scalable to manifold complexes, and supports efficient navigation and topological modifications. The IS data structure has the same expressive power and exibits performances in query and update operations as the incidence graph, a widely-used representation for general cell complexes, but it is much more compact. Here, we describe the IS data structure and we evaluate its storage cost. Moreover, we present efficient algorithms for navigating and for generating a simplicial complex described as an IS data structure. We compare the IS data structure with the incidence graph and with dimension-specific representations for simplicial complexes.
1 Introduction Simplicial complexes are commonly used to represent objects in many applications, including finite element analysis, solid modeling, animation, terrain modeling and visualization of scalar and vector fields [7, 8, 15, 19, 20]. Informally, a manifold (with boundary) M is a compact and connected subset of the Euclidean space such that the neighborhood of each point of M is homeomorphic to an open ball, or to an open half-ball. Objects, that do not fulfill this property at one or more points, are called non-manifold, while they are called non-regular if they also contain parts of different dimensions. Existing modeling tools are generally designed to handle only shapes with a manifold domain, since they are topologically simpler. However, non-manifold and non-regular objects arise in several applications. For instance, they are produced through the idealization process when preparing an object for finite element analysis. To guarantee acceptable computation times, not only details having a low impact on the object behavior are removed, but also subparts of the object are idealized. For instance, parts presenting a beam
404
L. De Floriani et al.
behavior may be substituted with 1-dimensional entities, and parts presenting a plate behavior may be replaced by 2-dimensional surfaces. Thus, the resulting object will contain non-manifold singularities and parts of different dimensions. In the literature, both dimension-specific and dimension-independent data structures have been developed for cell and simplicial complexes: many of them have domains that are limited to manifold shapes [7]. A widely used data structure is the Incidence Graph (IG) [10], developed for cell complexes in arbitrary dimensions. However, if restricted to simplicial complexes, the incidence graph results in a verbose representation, which also does not scale well to the manifold case, i.e., it has a large overhead when representing a manifold shape. Scalability is an important property for data structures for cell and simplicial complexes, since non-manifold objects often present few non-manifold singularities. Here, we propose a dimension-independent data structure for simplicial complexes, that we call the Incidence Simplicial (IS) data structure. The IS data structure encodes all the simplices of a simplicial complex and a subset of the relations encoded by the incidence graph. We show that this information is sufficient to retrieve all the relations among the elements of a simplicial d-complex efficiently. The algorithms for retrieving such relations are the basic traversal tools for navigating in a complex. The ability to navigate is essential to any modeling and update operations, as such operations require the knowledge of the local neighborhood of every simplex. We show that the IS data structure scales well to the manifold case. It has the same representation power and comparable performances in querying operations as the incidence graph, but it is much more compact. It represents all the simplices explicitly and uniquely, as required in applications where attributes must be attached to all the simplices. Thus, novel contributions of this paper are: • • •
the Incidence Simplicial data structure, a dimension-independent and scalable data structure for encoding d-dimensional simplicial complexes; efficient navigation algorithms for retrieving topological relations from the IS data structure; an algorithm for generating an IS data structure from a non-topological representation of a d-dimensional simplicial complex.
The remainder of this paper is organized as follows. In Sect. 2, we summarize some background notions on simplicial complexes and on topological relations. In Sect. 3, we review related work. In Sect. 4, we describe the IS data structure, while in Sect. 5 we discuss the implementation of the IS data structure and its storage cost. In Sect. 6, we describe an algorithm for generating an IS data structure from an unstructured collection of simplices, while in Sect. 7 we present navigation algorithms for efficiently retrieving topological relations among the simplices of a complex. In Sect. 8, we compare the IS data structure with the incidence graph and with dimension-specific data
A Dimension-Independent Data Structure for Simplicial Complexes
405
structures for simplicial complexes. Finally, in Sect. 9, we draw some concluding remarks and discuss future work.
2 Background Notions 2.1
Simplicial Complexes
A Euclidean simplex σ of dimension d is the convex hull of d + 1 linearly independent points in the n-dimensional Euclidean space E n , with d ≤ n. We simply call a Euclidean d-simplex a d-simplex : a 0-simplex is a vertex, a 1-simplex an edge, a 2-simplex a triangle, and a 3-simplex a tetrahedron. d is called the dimension of σ and is denoted dim(σ). Any Euclidean k-simplex σ , with k < d, generated by a set Vσ ⊆ Vσ of cardinality k+1 ≤ d, is called a k-face of σ. Where no ambiguity arises, the dimension of σ can be omitted and σ is simply called a face of σ. A finite collection Σ of Euclidean simplices forms a Euclidean simplicial complex when (i) for each simplex σ ∈ Σ, all the faces of σ belong to Σ, and (ii) for each pair of simplices σ and σ , either σ ∩ σ = ∅ or σ ∩σ is a face of both σ and σ . The maximal dimension d of the simplices in Σ is called the order, or the dimension of complex Σ. The domain, or carrier, of a ddimensional Euclidean simplicial complex (also called a simplicial d-complex) Σ embedded in E n , with d ≤ n, is the subset of E n defined by the union, as point sets, of all the simplices in Σ. The (combinatorial) boundary of a simplex σ is the set of all the faces of σ in Σ, different from σ itself. The star of a simplex σ is the set of simplices in Σ that have σ as a face. Any simplex σ such that the star of σ contains only σ is called a top simplex. The link of a simplex σ is the set of all the faces of the simplices in the star of σ which are not incident in σ. Two simplices are incident to each other if one of them is a face of the other, while they are k-adjacent if they share a k-face: in particular, two vertices are called adjacent if they are both incident at a common edge. An h-path is a sequence of (h + 1)-simplices (σi )ki=0 in a simplicial complex Σ such that two consecutive simplices σi−1 and σi in the sequence are h-adjacent. Two simplices σ and σ ∗ are h-connected when there exists an h-path (σi )ki=0 such that σ is a face of σ0 and σ∗ is a face of σk . A subset Σ ∗ of a complex Σ is called h-connected if and only if any two simplices of Σ ∗ are h-connected. Any maximal h-connected sub-complex of a complex Σ is called an h-connected component of Σ. A d-complex Σ in which all top simplices are d-simplices is called regular. A regular (d−1)-connected d-complex in which the star of all (d−1)-simplices consists of one or two simplices is called a (combinatorial) pseudo-manifold. Note that a carrier of a pseudo-manifold is not necessarily a manifold object. We will call a manifold simplicial complex a pseudo-manifold such that the link of any 0-simplex, with k < d−1, is homeomorphic to the (d − 1)-sphere. In a simplicial d-complex Σ, a p-chain c (with'0 ≤ p ≤ d) is a linear p combination of p + 1 simplices σi , defined as c = i=0 ai σi , where ai ∈ Z.
406
L. De Floriani et al.
A 0-simplex can be expressed as a 0-chain, while a p-simplex σ (with p > 0) can be expressed as a p-chain, generated by its faces λi' , with i = 0, . . . , p. p We can define the boundary of a p-simplex σ as δp (σ) = i=0 ai δp−1 (λi ) by recursively computing the boundary of each λi , with i = 0, . . . , p since λi is a (p − 1)-chain by definition. The coefficients ai of a p-chain do not have a geometric interpretation, except when ai = ±1. In this case, we can relate them to the orientation of the simplices: a formal definition of this concept is available in [1]. If ai = 1, then we can consider the positive orientation of a simplex σi , otherwise we can consider the opposite one. Hence, we can define the 'poriented boundary of a p-simplex σ, generated by its faces λi , as δp (σ) = i=0 (−1)i δp−1 (λi ). 2.2
Topological Relations
The connectivity information among the entities in a cell or in a simplicial complex is expressed through topological relations. Data structures for cell and simplicial complexes can be described formally in terms of the topological entities and relations they encode. We define topological relations for the case of a cell complex (since a simplicial complex can be seen as a special case of a cell complex). Informally, a cell complex is a collection of cells, homeomorphic to a closed or an open k-ball, such that the boundary of each cell is the union of lower-dimensional cells. We consider a cell d-complex Γ and a p-cell γ ∈ Γ , with 0 ≤ p ≤ d. We can define topological relations as follows: Boundary relation Rp,q (γ), with 0 ≤ q ≤ p−1, consists of the set of q-cells which are faces of γ. • Coboundary relation Rp,q (γ), with p + 1 ≤ q ≤ d, consists of the set of q-cells incident in γ. • Adjacency relation Rp,p (γ), with p > 0, consists of the set of p-cells in Γ that are (p−1)-adjacent to γ. • Adjacency relation R0,0 (γ), where γ is a vertex, consists of the set of vertices that are adjacent to γ through a 1-cell (an edge). •
We call constant any relation which involves a constant number of entities, while relations which involve a variable number of entities are called variable. In general, coboundary and adjacency relations are variable, while boundary relations are constant in simplicial complexes. We consider an algorithm for retrieving a topological relation R to be optimal if it retrieves R in time linear in the number of the involved entities. If the retrieval of a relation requires examining the star of all the cells adjacent to or on the boundary of the query cell, then we say that the data structure offers a local support for the retrieval of that relation. If the retrieval of a relation requires examining all the cells of a specific dimension, then the data structure does not support an efficient retrieval of that relation.
A Dimension-Independent Data Structure for Simplicial Complexes
407
3 Related Work Dimension-independent data structures have been proposed for encoding ddimensional manifold cell complexes. Examples are the cell-tuple [2], and the n-G-map [16]. The incidence graph [10] represents a cell complex by encoding all the cells of the complex and a subset of their boundary and coboundary relations. It provides a complete and verbose description of the complex. The simplified incidence graph [5] is a simplified version of the incidence graph for simplicial complexes, but it is not suitable for supporting efficient updates of the complex. The indexed data structure with adjacencies [20] is a dimensionindependent data structure for pseudo-manifold simplicial d-complexes embedded in the d-dimensional Euclidean space. It encodes only the d-simplices together with boundary relation Rd,0 and adjacency relation Rd,d . Several dimension-specific data structures have been developed for manifold 2-dimensional cell complexes [7], whereas some of them are specific for triangle meshes, e.g. the Corner table [23] and the star vertex [13] data structures. Data structures for non-manifold, non-regular, 2-dimensional cell complexes have been proposed for modeling non-manifold solids. The partial entity data structure [15] is the most scalable to the manifold case, but it is still verbose when applied to simplicial 2-complexes [7]. Dimension-specific data structures have been also proposed for encoding simplicial 2-complexes [3, 5, 19]. The loop edge-use [19] and the directed edge [3] data structures are for regular simplicial complexes in which non-manifold singularities occur only at edges. The former is a specialization of the partial entity data structure, and the latter is an extension of the half-edge data structure [18] to non-manifold shapes. The Triangle-Segment (TS) data structure [8] is a compact data structure for non-manifold simplicial 2-complexes embedded in 3-dimensional Euclidean space, encoding only the top simplices and the vertices of the complex. A comparison among such data structures, presented in [7], shows that the TS data structure requires about half of the space required by the loop edge-use and by the directed edge data structures. To the extend of our knowledge, very few representations have been proposed in the literature for 3-dimensional manifold complexes, i.e., the facetedge [9] and the handle-face [17] data structures. Both of them describe 3-dimensional cells implicitly by encoding the manifold complexes that form their boundary. The handle-face structure is an extension of the handleedge data structure [4] for 2D complexes. In [14], a scalable data structure for manifold tetrahedral complexes has been proposed, which extends the Corner table [23] to the 3D case. An efficient extension of the Corner table to tetrahedral meshes has been recently proposed in [11]. In [6], we have proposed a compact and scalable data structure for arbitrary 3-dimensional simplicial complexes embedded in the 3-dimensional Euclidean space, called the Non-Manifold Indexed data structure with Adjacencies (NMIA), which extends the indexed data structure with adjacencies to arbitrary complexes.
408
L. De Floriani et al.
An alternative approach to the design of non-manifold data structures consists of decomposing a non-manifold object into simpler and more manageable parts [7]. Such techniques deal with the decomposition of the boundary of a regular object into two-manifold parts, and all of them are for cell complexes. The representation in [21] deals with non-regular objects as well. In [12], we have proposed a data structure for simplicial 3-complexes, called the Double Level Decomposition (DLD) data structure, based on a decomposition for 3-dimensional non-manifold and non-regular objects into nearly manifold components. The DLD is a two-level representation in which the higher level encodes the decomposition, and the lower level encodes each component as an indexed data structure with adjacencies. We have shown that the DLD has similar performances as the NMIA data structure. Unfortunately, it is more complex to update, since the decomposition of the complex needs to be reconstructed at each update.
4 The Incidence Simplicial Data Structure In this section, we introduce a new dimension-independent data structure for representing Euclidean simplicial complexes in arbitrary dimensions, that we call the Incidence Simplicial (IS) data structure. The IS data structure encodes all the simplices of a d-dimensional simplicial complex Σ embedded in the n-dimensional Euclidean space (with d ≤ n) and the following relations: • the boundary relation Rp,p−1 (σ) for each p-simplex σ, where 0 < p ≤ d; ∗ • the partial coboundary relation Rp,p+1 (σ), denoted as Rp,p+1 (σ), for each p-simplex σ, with 0 ≤ p < d: it consists of one arbitrarily selected (p + 1)simplex for each connected component in the link of σ. The IS data structure stores the orientation of the simplices forming it. Given a p-simplex σ generated by the ordered set of vertices V = [v0 , . . . , vp ], a face λi of σ is expressed as λi = [v0 , . . . , vˆi , . . . , vp ], where we discard the vertex vi with i = 0, . . . , p. ∗ In general, the partial coboundary relation Rd−1,d (σ) is the same as the coboundary relation Rd−1,d (σ) for each (d − 1)-simplex σ. If the domain of ∗ Σ is a manifold, then Rp,p+1 (σ) contains just one (p+ 1)-simplex since the link of σ consists of one single connected component. When d = n, any d-dimensional simplicial complex is a pseudo-manifold in the d-dimensional Euclidean space. Consequently, every (d−1)-simplex is shared by at most two d-simplices. Fig. 1 shows two examples of partial coboundary relations in the IS data structure. In Fig. 1(a), the link of vertex v consists of two connected ∗ (v) components, as shown in Fig. 1(b). Thus, partial coboundary relation R0,1 consists of {we, e}, where e is an edge of triangle df . In Fig. 1(c), the link of an edge e (shown in Fig. 1(d)) is composed of three connected components corresponding to the triangle df and to the tetrahedra t1 and t2 , incident in e. ∗ Thus, the partial coboundary relation R1,2 (e) consists of just three elements, namely {df, f1 , f2 }, where f1 is a face of t1 and f2 is a face of t2 .
A Dimension-Independent Data Structure for Simplicial Complexes
v
we
v
df
e t
f1 t1
df (a)
(b)
e
e
v2
409
f2 v1
(c)
t2
(d)
Fig. 1. (a) An example of a non-manifold vertex v, whose link is shown in (b) with thick lines. (c) An example of a non-manifold edge e, whose link is shown in (d).
5 Implementation of the IS Data Structure In the IS data structure describing a simplicial d-complex Σ, all simplices of the same dimension p (with 0 ≤ p ≤ d) are stored in a dynamic array, that we call SimplexesContainer, where each location stores a simplex. The SimplexesContainer array supports a garbage collector mechanism and, thus, update operations (such as simplex insertion or removal). Each p-simplex σ has an unique identifier in the IS data structure, formed by the pair (p, i), where p is the dimension of σ and i is the position of σ in the SimplexesContainer where it is stored. This identifier is called SimplexPointer and allows accessing a simplex in constant time. A flag is associated with each simplex for marking it as visited during traversal algorithms. Some application-dependent attributes, like Euclidean coordinates and field values, can be associated to each simplex. In order to encode the simplex orientation, we order the list of vertices in the simplicial complex Σ according to the lexicographic order on their identifiers. Given two vertices vi and vj , respectively identified by the SimplexPointers (0, i) and (0, j), then we say that vi < vj if and only if i < j. Consequently, the orientation of the simplices is imposed by the input list of vertices in a simplicial complex and it must be enforced when building the data structure (see Sect. 6). For each p-simplex σ, we store boundary relation Rp,p−1 (σ). We use an array of dimension p+1, where each element stores the index of a (p−1)-face in the corresponding SimplexesContainer array. We also encode the orientation of the simplex boundary. The index of a face λi of a p-simplex σ is stored as the i-th element in boundary relation Rp,p−1 (σ). Recall that a face λi is the simplex defined by all the vertices of σ with the exception of vertex vi , and that a face λi precedes a face λj in Rp,p−1 (σ) if and only vertex vi precedes vertex vj in the lexicographic order of the vertices of Σ. For each p-simplex σ, we also store partial coboundary relation R∗p,p+1 (σ), formed by one arbitrarily-selected (p + 1)-simplex for each connected component in the link of σ. We use a variable-sized array, where each element stores the index of the coboundary simplex in the corresponding SimplexesContainer. In what follows, we evaluate the storage cost of the IS data structure representing a simplicial d-complex Σ. We consider only the cost of encoding
410
L. De Floriani et al.
the topological information and we assume that both indices and pointers are described through an integer value. In our analysis, we denote: • • •
the number of p-simplices in Σ (where 0 ≤ p ≤ d) as np ; the total number of connected components in the link of a simplex σ (where dim(σ) < d) as k(σ); the total number of connected'components summed over the links of all the p-simplices in Σ as Kp = σ|dim(σ)=p k(σ) with 0 ≤ p ≤ d.
In order to encode all the p-simplices, np pointers to the records describing the simplices and ' a pointer for each SimplexesContainer are required. This results in d + 1 + p np integer values, with 0 ≤ p ≤ d. For each p-simplex (with 0 < p ≤ d), 'there are p + 1 simplices of dimension p − 1 in Rp,p−1 (σ). Thus, we need (p + 1)np integer values in order to store the boundary relations for all simplices in Σ. Moreover, for each p-simplex (with 0 ≤ p < d), ∗ there are k(σ) simplices of dimension p + 1 in Rp,p+1 (σ). Thus, we need ' Kp integer values in order to store all partial coboundary relations for all simplices in'Σ. In summary, ' the storage cost of 'the IS data structure is equal to d + 1 + 0≤p≤d np + 0
6 Building an IS Data Structure The most common exchange format for a d-dimensional simplicial complex Σ consists of a collection of top simplices described by their vertices. This representation is known as a soup of top simplices. In this section, we describe how to generate the IS data structure from such representation. The input format provides the list of the vertices of the simplicial complex Σ. Each top p-simplex of Σ is described by the indexes of its (p + 1) vertices in the input vertex list. The orientation of the simplices in Σ is well defined by the input vertices, as described in Sect. 5, since a vertex is identified by its position in such list. Since a soup of simplices describes only the top simplices, we first need to generate all the simplices in Σ and to establish the topological relations among them. This is achieved in four steps by analyzing all the p-simplices in decreasing order of their dimension: 1. For each p-simplex σ, all the p+1 faces σi of dimension p−1 are generated and stored in an auxiliary data structure. Each face λi is defined by all the vertices of σ with the exception of the vertex in position i. 2. All the (p−1)-simplices generated at step 1 are sorted by lexicographic order of their vertices. In this way, duplicated simplices are removed.
A Dimension-Independent Data Structure for Simplicial Complexes
411
Each simplex σ is stored in the corresponding SimplexesContainer array and is given a unique identifier, i.e., its SimplexPointer. 3. All the (p−1)-faces λi of a p-simplex σ are considered in order to compute the boundary relation Rp,p−1 and the complete coboundary relation Rp−1,p . The identifier of σ is added to the coboundary relation Rp−1,p (λi ), while the identifier of λi is stored in the i-th position in the boundary relation Rp,p−1 (σ). ∗ 4. Partial coboundary relation Rp−1,p (σ) is computed for each (p−1)-simplex σ from the corresponding complete coboundary Rp−1,p (σ) relation, as detailed below. The computation of the partial coboundary relation of a p-simplex σ in Step 4 is based on the topological information available in the intermediate structure obtained at Step 3, i.e., boundary relations Rp,p−1 (σ) and coboundary relations Rp,p+1 (σ), for each p-simplex σ. For a p-simplex σ, with p < d − 1, we identify the connected components of the link of σ and we encode a (p + 1)-simplex incident in σ for each component of the link. Fig. 2(a) shows an example of the star of a vertex v, where there are two connected components in the link. We consider the graph, that we call the star-graph of σ, in which the nodes are the simplices in the star of σ and the arcs correspond to the boundary Rp,p−1 and coboundary Rp,p+1 relations between the simplices in the star, restricted to the nodes in the star-graph. Figs. 2(b) and 2(c) show the boundary and coboundary arcs of the star-graph associated with vertex v (see Fig. 2(a)). The two sets of arcs are shown separately, for the sake of clarity. It can be easily seen that the connected components of the link of a p-simplex σ are the same as the biconnected components of the star-graph. For instance, the star-graph of vertex v in Fig. 2 has two biconnected components. We also call the nodes in the star-graph corresponding to j-simplices nodes at level j. In order to identify all biconnected components in the star-graph, we traverse the nodes belonging to levels (p + 1) and (p + 2) in the star-graph, by using the arcs corresponding to relations Rp,p+1 , Rp+1,p+2 and Rp+2,p+1 . We attach a unique label to each biconnected component. We start the traversal from an unmarked node representing a (p + 1)-simplex τ incident in σ and we assign node τ to a new component by marking it with a new label. For each node representing a (p + 2)-simplex θ in Rp+1,p+2 (τ ), we retrieve the nodes corresponding to the (p+1)-simplices in its boundary and we continue the traversal. In this way, all the nodes corresponding to the (p+1)-simplices μ in Rp+2,p+1 (θ), that are incident at σ, are marked with the same label. The graph traversal is recursively repeated for all nodes corresponding to simplices in Rp+1,p+2 (μ) until all nodes associated with the (p+1)-simplices incident at σ and belonging to the same biconnected component of the stargraph are visited. Then, for each biconnected component in the star-graph, ∗ one (p+1)-simplex is selected as an element of Rp,p+1 (σ). Fig. 2(d) shows the traversal of one biconnected component of the star-graph of vertex v for the complex depicted in Fig. 2(a), while Fig. 2(e) shows the traversal of the other
412
L. De Floriani et al. f1
f2 f 1 e2 e1
e3 e4 v
f3
e1
e5
f2 e2
f3 e3
e4
f1 e5
e1
f2 e2
e3
(b) f1 e1
f2 e2
e4
f1 e5
e5
(c)
f3 e3
e4
v
v
(a)
f3
e1
v
f2 e2
f3 e3
e4
e5
v
(d)
(e)
Fig. 2. The topological relations of simplices in the star of vertex v encoded as a star-graph: (a) the star of vertex v; (b) the boundary relations R1,0 and R2,1 ; (c) the coboundary relations R0,1 and R1,2 computed as intermediate results in the IS construction; (d) a traversal of one component in the star of v by using only the relations R0,1 , R1,2 and R2,1 ; (e) a traversal of the other component in the star of v.
biconnected component in the same star-graph. We note that we do not need to compute the complete star-graph of σ, but only the nodes at levels (p + 1) and (p + 2) and their boundary and coboundary arcs in the star-graph. We can evaluate the time complexity of the IS construction as follows. At step 1, at any level p, the total number of (p−1)-simplices is (p+1) · np , where np is the number of p-simplices in complex Σ. Thus, the creation of the (p−1)-simplices is linear with respect to the number of p-simplices. The time required for sorting all the (p−1)-simplices at step 2 is O(np log(np )). The computation of boundary and coboundary relations at step 3 requires time linear in the number of p-simplices, since boundary relations are constant. At step 4, the traversal of the star-graph of a simplex σ visits every arc and every node of the star-graph exactly once. Each q-simplex is in the stars of (q+1) simplices of dimension (q−1) and in the stars of (q+2)·(q+1) simplices of 2 dimension (q −2). Thus, the computation of partial relations for all (q − 2)simplices has time complexity proportional to (q+2)·(q+1) nq + (q+1)nq , which 2 is O(nq ).
7 Retrieving Topological Relations 7.1
Retrieving Boundary Relations
All boundary relations Rp,p−1 are directly encoded in the IS data structure, while boundary relations Rp,q with q < p can be easily retrieved through relations Rp,p−1 , Rp−1,p−2 , . . ., Rq+1,q . For instance, the vertices of a
A Dimension-Independent Data Structure for Simplicial Complexes
413
tetrahedron σ, i.e., R3,0 (σ), are retrieved by applying R3,2 (σ), then R2,1 (τ ), for each triangle τ in R3,2 (σ), and then R1,0 (γ), for each edge γ in R2,1 (τ ). The time complexity of this process is equal to Πr=q+1,p+1 c, where c is a constant. This quantity is bounded by a constant which depends on the dimension p of the simplex and on the dimension q of its faces. For instance, retrieving Rd,0 (σ) relation requires O((d+1)!) time. 7.2
Retrieving Coboundary Relations
Coboundary relation Rd−1,d (σ) for each (d−1)-simplex σ is directly encoded ∗ in the IS data structure, since Rd−1,d (σ) is the same as Rd−1,d (σ). Since only partial coboundary relations are encoded in the IS data structure, the challenge is to retrieve the complete coboundary relations efficiently. The q-simplices incident in a p–simplex σ are either top simplices or faces of top simplices in the star of σ having dimension greater than q. Thus, in order to compute the Rp,q (σ) relation, we need to retrieve the top simplices of dimensions q and above in the star of σ. This because all q-simplices that are faces of higher-dimensional simplices incident in σ can only be retrieved by considering the boundary simplices of the top simplices incident in σ. For a p-simplex σ, we consider the graph describing the topological relations encoded in the IS data structure among the simplices in the star of σ. We call this graph the IS star-graph. The nodes of the IS star-graph are the simplices in the star of σ, while the arcs represent the boundary and partial coboundary relations between such nodes encoded in the IS data structure. Fig. 3(a) shows an example of the star of a vertex v, while Figs. 3(b) and 3(c) show the arcs of the IS star-graph representing the boundary and the partial coboundary relations for this complex, respectively. Since the retrieval algorithm performs a breadth-first traversal of the IS star-graph, each node and each arc are visited exactly once. The number of arcs is linear in the number of nodes in the IS star-graph since each simplex is bounded by a constant number of simplices. Moreover, the total number of simplices in the star of a simplex is linear in the number of top simplices in the star. Thus, the time complexity of the algorithm for retrieving coboundary relation Rp,q (σ) is linear in the number of top simplices in the star of σ and, thus, it is local. Fig. 4 shows how the traversal of the star of vertex v (from the example of Fig. 3(a)) is performed for retrieving R0,1 (v). The traversal starts from ∗ v and it is initialized by using R0,1 (v), which leads to edge e2 . Through ∗ ∗ partial coboundary relations R1,2 (e1 ) and R2,3 (f1 ), tetrahedron t1 is visited (as shown in Fig. 4(a)). Through boundary relation R3,2 (t1 ), all faces of t1 are visited. Similarly, all the edges of faces f1 , f2 and f3 are visited through their boundary relations R2,1 (see Fig. 4(b)). Partial coboundary relation ∗ R1,2 (e3 ) of edge e3 leads to dangling-face df1 . Boundary relation R2,1 (df1 ) for df1 leads to edge e4 (as shown in Fig. 4(c)). Through edge e4 , all the faces and edges of tetrahedron t2 are visited in a similar fashion as those of
414
L. De Floriani et al. t1 t2 f1 f2 f3 f4 f5 f6 df 1
3 4
5
6
2 7
1
= (1,2,3,4) = (1,5,6,7) = (1,2,3) = (1,2,4) = (1,3,4) = (1,5,6) = (1,5,7) = (1,6,7) = (1,4,5)
e1 e2 e3 e4 e5 e6 v
= (1,2) = (1,3) = (1,4) = (1,5) = (1,6) = (1,7) =1
(a) t1 f1
f2
t2 f 3 df1
f4
f5
e4 e5 e6
e1 e2 e3
t1 f6
f1
f2
t2 f3
df1
(b)
f5 f6
e4 e5 e6
e1 e2 e3
v
f4
v
(c)
Fig. 3. Example (part 1) of retrieving R0,1 (v) through a traversal of the star of vertex v using boundary and partial coboundary relations encoded by the IS: (a) the star st(v) of a vertex v; (b) boundary relations encoded by the IS among simplices in st(v); (c) partial coboundary relations encoded by the IS among simplices in st(v).
tetrahedron t1 (see Fig. 4(d)). At the end of the traversal, all the edges that are in the coboundary relation R0,1 (v) are retrieved. 7.3
Retrieving Adjacency Relations
Adjacency relation Rp,p (σ) for a p-simplex σ with p > 0, is simply retrieved by first extracting all the faces τ in the boundary relation Rp,p−1 (σ) and then retrieving coboundary relation Rp−1,p (τ ) for each τ . If p = 0, then adjacency relation R0,0 (v) for a vertex v is obtained by first retrieving the set of edges in coboundary relation R0,1 (v), and then retrieving the other extreme vertex of each edge e in R0,1 (v) through boundary relation R1,0 (e). For p > 0, the running time of the algorithm for retrieving Rp,p (σ) is dominated by the time required to retrieve the coboundary relations for the (p−1)-faces of σ. Thus, the complexity of the algorithm is linear in the total number of top simplices incident at the (p − 1)-faces of σ. Similarly, the time complexity of the algorithm for retrieving R0,0 (v) is linear in the number of top simplices incident at vertex v.
A Dimension-Independent Data Structure for Simplicial Complexes t1 f1
f2
t2 f3
df1
f4
f5
t1 f6
e4 e5 e6
e1 e2 e3
f1
f2
t2 f 3 df1
f6
(b)
t1
t2 f3
f5
v
(a)
f2
f4
e4 e5 e6
e1 e2 e3
v
f1
415
df1
f4
f5
t1 f6
e4 e5 e6
e1 e2 e3
f1
f2
t2 f 3 df1
(c)
f5
f6
e4 e5 e6
e1 e2 e3
v
f4
v
(d)
Fig. 4. Example (part 2) of retrieving R0,1 (v) through a traversal of the star of vertex v using boundary and partial coboundary relations encoded by the IS: (a) to (d) are four stages of the traversal of st(v).
8 Analysis and Comparisons 8.1
Comparison with the Incidence Graph
The Incidence Graph (IG) [10] stores all simplices and the same boundary relations as the IS data structure, but it encodes all coboundary relations of consecutive index Rp,p+1 . In our tests, we have implemented the incidence graph for simplicial in this case, the storage cost of the IG is ' complexes: ' equal to d + 1 + 0≤p≤d np + 2 0
416
L. De Floriani et al.
v
v e
(a)
(b)
∗ Fig. 5. A comparison between R0,1 (v) and R0,1 (v) in the manifold case: (a) the IG encodes all the edges that are incident at v, while (b) the IS encodes only edge e in the star of v.
only relations R0,1 and R1,0 are encoded. In this case, the IG and the IS data structures have the same storage cost. Retrieving boundary relations is performed in the same way on the IG and on the IS data structure, and requires constant time. Retrieving coboundary relation Rp,q (σ), with p < q + 1, from the IS data structure requires time linear in the number of top simplices in the star of σ, as shown in Sect. 7.2. In the IG, coboundary relation Rp,r (γ) (p < r) is obtained by retrieving the encoded coboundary Ri,i+1 relations of all the i-cells for i = p, . . . , r−1 in the star of γ. The retrieval of such relations can be performed in time linear in the number of involved cells. Thus, such algorithm is always optimal. In the case of simplicial 2- and 3-complexes, coboundary relations can be retrieved in optimal time from both data structures. In the case of simplicial d–complexes with d > 3, coboundary relations can be retrieved in optimal time only from the IG. For both the IS data structure and the IG, the time required for retrieving adjacency relations depends on the retrieval of boundary and coboundary relations. In Sect. 8.2 we present some comparisons between the IS data structure and 2D and 3D instances of the IG. 8.2
Comparison with Dimension-Specific Data Structures
In this subsection, we compare the IS data structure with dimension-specific data structures proposed for 2-dimensional and 3-dimensional simplicial complexes. For the sake of brevity, we do not compare with data structures which are specific for manifold complexes. In the 2-dimensional case, we consider the Directed Edge (DE) [3] and the Triangle-Segment (TS) [8] data structures. The DE data structure is an edge-based data structure extending to the non-manifold case the half-edge data structure [18], proposed for 2-dimensional cell complexes with a manifold domain. We have shown in [7] that the DE data structure is the most space-efficient data structure among edge-based ones for encoding simplicial 2-complexes. The TS data structure is an adjacency-based data structure which extends the indexed data structure with adjacencies to arbitrary simplicial 2-complexes embedded in the 3-dimensional Euclidean space. The DE data structure encodes edges and vertices explicitly and triangles implicitly. The TS data structure encodes only the vertices and the top simplices of the complex, i.e., wire-edges and triangles. The IG and the IS data structure
A Dimension-Independent Data Structure for Simplicial Complexes
417
Table 1. The storage costs required by the NMIA, the IG and the IS data structures in order to encode 3D non-manifold models. Data set Bucket Wheel Ballon Flasks Teapot
n0 53 402 1108 1301 4658
n1 167 2093 3913 6307 17.9k
n2 160 2728 3616 8465 17.0k
n3 48 1148 856 3455 5666
nt1 6 96 64 0 2944
nt2 32 32 1632 460 3930
NMIA 591 10.2k 13.1k 30.4k 73.8k
IG 2012 33.9k 44.2k 104k 219k
IS 1105 17.7k 23.4k 53.2k 120k
encode all simplices in the input complex. In this case, topological relations can be retrieved in optimal time, i.e., in time linear in the number of output simplices, from such data structures. In [7], we have compared the DE, the TS and the 2D instance of the IG data structures on several complexes. In accordance with our results, edgebased data structures require more space than the 2D instance of the IG. For example, the DE data structure is 1.3 to 1.5 times larger than the IG. Our experiments on the same sets of complexes have shown that the IG is about 1.25 the size of the IS data structure. The specific results are not reported here for brevity. We have also compared the IS data structure and the IG with the NonManifold Indexed data structure with Adjacencies (NMIA) [6] for simplicial 3-complexes embedded in the 3-dimensional Euclidean space. The NMIA data structure is an adjacency-based data structure which extends to the non-manifold domain the indexed data structure with adjacencies. The extension is performed by encoding the multiple connected components of the star at non-manifold vertices and non-manifold edges implicitly. The NMIA data structure encodes only vertices and top simplices in the input simplicial complex. Table 1 shows the results of the comparison with the NMIA data structure and the 3D instances of the IG and of the IS data structure. Columns n0 , n1 , n2 and n3 show the number of vertices, edges, faces and tetrahedra, while columns nt1 and nt2 provide the number of wire-edges and dangling faces in the input model. The last three columns provide the storage cost of these data structures. In this case, the NMIA data structure is the most compact one as it encodes only top simplices and vertices explicitly. Thus, it is not suitable for applications requiring explicit encoding of all simplices. The incidence graph is at least three times the size of the NMIA data structure, because it encodes all simplices and a large number of incidence relations. The IS data structure is more compact than the IG (which uses about 1.38 times as much storage as the IS) because it only encodes a subset of coboundary relations. All topological relations can be retrieved in optimal time from the IS data structure and from the IG. Coboundary relations R1,3 and R0,3 can be retrieved from the NMIA data structure in time linear in the number of top simplices incident at an edge or at a vertex. Thus, they are not optimal.
418
L. De Floriani et al.
All the other relations can be extracted from the NMIA data structure in optimal time.
9 Concluding Remarks We have presented the Incidence Simplicial (IS) data structure, a new dimension-independent data structure for representing d-dimensional simplicial complexes in the n-dimensional Euclidean space. The IS data structure has the same representation power as the widely-used incidence graph, but it is more compact. Furthermore, the IS data structure has the same performances in traversal and manipulation algorithms of the IG. We have presented algorithms for building the IS data structure from a soup of top simplices and for retrieving all topological relations. We have also compared the IS data structure with the incidence graph and with dimension-specific data structures, also on the basis of an experimental evaluation of their storage costs. We are developing the IS Library, a robust and effective implementation of the IS data structure. This platform-independent library, written in C++, will be distributed in the public domain. Currently, the IS library contains methods for building the IS data structure from a soup of simplices, as described in Sect. 6, and methods for navigating the data structure by extracting boundary, coboundary and adjacency relations, as described in Sect. 7. All the internal data structures are already suitable for supporting update operations. We have designed and developed an implementation of the vertex-pair collapse update operator [22], which we are currently testing. A common issue in representing and manipulating non-manifold objects is the availability of large-size simplicial representations for describing such objects. Their complexity can easily exceed the capability of computational tools for analyzing them. In these cases, adaptively simplified meshes, i.e., simplicial complexes in which the level of detail varies in different parts of the object they describe, are often required. On the other hand, accurate mesh simplification algorithms are too time consuming to be performed on-line. Thus, a multi-resolution model, which encodes the modifications performed by a simplification algorithm in a compact representation, is an effective solution. Dimension-independent non-manifold representations can be integrated with a multi-resolution framework, giving rise to a powerful tool for modeling non-manifold objects at variable resolutions. A natural way to deal with non-manifold objects consists of decomposing them into nearly manifold components by cutting at non-manifold simplices. We are developing a decomposition algorithm based on the IS data structure and we are planning to use the resulting decomposition as the basis for performing geometric reasoning on non-manifold shapes. In particular, we are interested in computing topological invariants from the decomposition as signatures for efficient shape analysis and retrieval and in identifying non-manifold form features based on the structure of the decomposition.
A Dimension-Independent Data Structure for Simplicial Complexes
419
Acknowledgements This work has been partially supported by the MIUR-FIRB project SHALOM under contract number RBIN04HWR8, and by the National Science Foundation under grant CCF-0541032.
References 1. Agoston, M.: Computer Graphics and Geometric Modelling. Springer, Heidelberg (2005) 2. Brisson, E.: Representing geometric structures in d dimensions: topology and order. In: Proc. of the 5th ACM Symp. on Computational Geometry, pp. 218–227. ACM Press, New York (1989) 3. Campagna, S., Kobbelt, L., Seidel, H.-P.: Directed Edges - a scalable representation for triangle meshes. Jour. of Graphics Tools 3(4), 1–12 (1998) 4. Castelo, A., Lopes, H., Tavares, G.: Handlebody representation for surfaces and Morse operators. In: Warren, J. (ed.) Proc. on Curves and Surfaces for Computer Vision and Graphics III, SPIE, Boston, pp. 270–283 (1992) 5. De Floriani, L., Greenfieldboyce, D., Hui, A.: A data structure for non-manifold simplicial d-complexes. In: Kobbelt, L., Schroder, P., Hoppe, H. (eds.) Proc. of the 2nd Eurographics Symp. on Geometry Processing, Nice, France, July 8-10, pp. 83–92 (2004) 6. De Floriani, L., Hui, A.: A scalable data structure for three-dimensional nonmanifold objects. In: Kobbelt, L., Schroder, P., Hoppe, H. (eds.) Proc. of the 1st Eurographics Symp. on Geometry Processing, Aachen, Germany, June 23-25, pp. 72–82 (2003) 7. De Floriani, L., Hui, A.: Data structures for simplicial complexes: an analysis and a comparison. In: Desbrun, M., Pottmann, H. (eds.) Proc. of the 3rd Eurographics Symp. on Geometry Processing, Vienna, Austria, July 4-6, pp. 119–128 (2005) 8. De Floriani, L., Magillo, P., Puppo, E., Sobrero, D.: A multi-resolution topological representation for non-manifold meshes. CAD Journal 36(2), 141–159 (2004) 9. Dobkin, D., Laszlo, M.: Primitives for the manipulation of three-dimensional subdivisions. Algorithmica 5(4), 3–32 (1989) 10. Edelsbrunner, H.: Algorithms in Combinatorial Geometry. Springer, Heidelberg (1987) 11. Gurung, T., Rossignac, J.: SOT: a compact representation for tetrahedral meshes. In: Proc. of the SIAM/ACM Joint Conference on Geometric and Physical Modeling, San Francisco, USA, pp. 79–88 (2009) 12. Hui, A., Vaczlavik, L., De Floriani, L.: A decomposition-based representation for 3D simplicial complexes. In: Proc. of the 4th Eurographics Symp. on Geometry Processing, Cagliari, Italy, pp. 101–110 (June 2006) 13. Kallmann, M., Thalmann, D.: Star Vertices: a compact representation for planar meshes with adjacency information. Jour. of Graphics Tools 6(1), 7–18 (2001) 14. Lage, M., Lewiner, T., Lopes, H., Velho, L.: CHF: a scalable topological data structure for tetrahedral meshes. In: Proc. of the 18th Brazilian Symp. on Computer Graphics and Image Processing, pp. 349–356 (2005)
420
L. De Floriani et al.
15. Lee, S.H., Lee, K.: Partial-entity structure: a fast and compact non-manifold boundary representation based on partial topological entities. In: Proc. of the 6th ACM Symp. on Solid Modeling and Applications, Ann Arbor, USA, pp. 159–170. ACM Press, New York (June 2001) 16. Lienhardt, P.: Topological models for boundary representation: a comparison with n-dimensional generalized maps. CAD Journal 23(1), 59–82 (1991) 17. Lopes, H., Tavares, G.: Structural operators for modeling 3-manifolds. In: Proc. of the 4th ACM Symp. on Solid Modeling and Applications, pp. 10–18. ACM Press, New York (May 1997) 18. Mantyla, M.: An Introduction to Solid Modeling. Computer Science Press (1987) 19. McMains, S.: Geometric Algorithms and Data Representation for Solid Freeform Fabrication. PhD thesis, University of California at Berkeley (2000) 20. Paoluzzi, A., Bernardini, F., Cattani, C., Ferrucci, V.: Dimension-independent modeling with simplicial complexes. ACM Trans. on Graphics 12(1), 56–102 (1993) 21. Pesco, S., Tavares, G., Lopes, H.: A stratification approach for modeling two dimensional cell complexes. Computers and Graphics 28, 235–247 (2004) 22. Popovic, J., Hoppe, H.: Progressive simplicial complexes. In: Proc. of the ACM Computer Graphics, pp. 217–224. ACM Press, New York (1997) 23. Rossignac, J., Safonova, A., Szymczak, A.: 3D compression made simple: EdgeBreaker on a Corner table. In: Proc. of the Shape Modeling International, Genova, Italy. IEEE Computer Society, Los Alamitos (May 2001)
Index of Authors and Co-authors
Alliez, Pierre 335 Atencio, Pedro 195 Azarenok, Boris 35 Beatty, Kirk 49 Bodony, Daniel J. 385 Botsch, Mario 335 Branch, John William 161, 195 Brandyberry, Mark D. 385 Bronson, Jonathan R. 279 Campbell, Michael T. 385 Canino, David 403 Chernikov, Andrey 367 Chrisochoides, Nikos 367 De Floriani, Leila Dey, Saikat 23
Magnotta, Vincent 85 Mestreau, Eric 23 Mukherjee, Nilanjan 49 Panozzo, Daniele
23
Foteinos, Panagiotis
367
Hui, Annie
Leal, Esmeide 161 Leal, Nallig 161 Levine, Joshua A. 279 Liang, Xinghua 1 Liu, Yixun 367 Lu, Jean Hsiang-Chun 263
315, 403
Ebeida, Mohamed S.
Grosland, Nicole
Kamenski, Lennard 297 Karamete, Kaan 23 Karman Jr., Steve L. 121 Kim, Hong-Jun 227 Kim, Jibum 103 Knupp, Patrick 67
85
403
Jain, Rajeev 351 Jiao, Xiangmin 143
403
Qian, Jin 243 Quadros, William Roshan Roca, Xevi 209 Ruiz-Giron´es, Eloi
263
209
Sanchez T., German 195 Sarrate, Josep 209 Sastry, Shankar Prasad 103 Shaffer, Eric 385 Shimada, Kenji 263
422
Index of Authors and Co-authors
Shivanna, Kiran 85 Shontz, Suzanne M. 103 Sieger, Daniel 335 Smith, Brandon M. 177 Song, Inho 263 Tautges, Timothy J.
177, 227, 351
Wang, Duo 143 Weiss, Kenneth 315 Whitaker, Ross T. 279 Wilson, Paul P.H. 177 Zagaris, George Zhang, Yongjie
385 1, 243
Reviewers
Name
Affiliation
Anne, Laurent Beatty, Kirk Benzley, Steven Betro, Vincent Burgreen, Greg Chernikov, Andrey Clark, Brett Cuilliere, Jean-Christophe Francois, Vincent Garimella, Rao Guoy, Damron Ito, Yasushi Jiao, Xiangmin Jones, William Karman, Steve Kawaharada, Hiroshi Knupp, Patrick Lague, Jean-Francois Levin, Joshua Mukherjee, Nilanjan
Distene S.A.S., France Siemens PLM Software, USA Brigham Young Univ., USA U. of Tennessee, Chattanooga, USA Mississippi State University, USA C. of William and Mary, VA, USA Sandia Nat. Labs, USA Universit du Quebec a Trois-Rivieres, Canada Université du Québec à Trois-Rivières, Canada Los Alamos Nat. Labs, USA U. of Illionois, Urbana-Champaign, USA U. of Alabama, Birmingham, USA State U. of New York, Stony Brook, USA NASA Langley Research Center, USA U. of Tennessee, Chattanooga, USA Unknown Sandia Nat. Labs, USA Distene S.A.S., France University of Utah, USA Siemens PLM Software, USA Owen, Steve Sandia Nat. Labs, USA MSC Software, USA Sandia National Laboratories, USA Universitat Politecnica de Catalunya, Spain MAGMA Giessereitechnologie GmbH, Germany U. of Illionois, Urbana-Champaign, USA Rensselaer Polytechnic Institute, USA University of Iowa, USA Pennsylvania State Univ., USA Weierstrass Institute of Applied Analysis and Stochastics, Germany U. of Waterloo, CA Sandia Nat. Labs, USA M.B. Stephenson & Associates, USA Argonne National Laboratory, USA
Patel, Paresh Quadros, William Sarrate, Jose Schneiders, Robert Shaffer, Eric Shephard, Mark Shivanna, Kiran Shontz, Suzanne Si, Hang Simpson, Bruce Staten, Matthew Stephenson, Michael Tautges, Timothy J.
424
Thompson, David Thompson, David Verdicchio, John Weill, Jean-Christophe Weiss, Kenneth Wyman, Nick Yamakawa, Soji Yvinec, Mariette Zhang, Yongjie (Jessica)
Reviewers
Mississippi State University, USA Unknown Rolls-Royce, UK CEA, France University of Maryland, USA Pointwise, USA Carnegie Mellon U., PA, USA Inria-Prisme, France U. of Texas, Austin, USA
19th IMR Conference Organization
Committee
Suzanne Shontz (Committee Chairman) Pennsylvania State University, University Park, PA [email protected] Yasushi Ito University of Alabama, Birmingham, AL [email protected] John Verdicchio Rolls-Royce, London, UK [email protected] Laurent Anne Distene, Bruyeres le Chatel, FR [email protected] Bill Jones NASA Langley Research Center, Hampton, VA [email protected] Jessica Zhang Carnegie Mellon University, Pittsburgh, PA [email protected] Nilanjan Mukherjee Siemens PLM Software, Milford, OH [email protected] Roshan Quadros Sandia National Laboratories, Albuquerque, NM [email protected]
Coordinators
Jacqueline A. Hunter Sandia National Laboratories, Albuquerque, NM [email protected]
Web Designer
Jacqueline A Hunter Sandia National Laboratories, Albuquerque, NM [email protected]
Web Site
http://www.imr.sandia.gov