Delaunay Triangulation and Meshing
© Editions HERMES, Paris, 1998 Editions HERMES 8, quai du Marche-Neuf 75004 Paris ...
222 downloads
1780 Views
19MB Size
Report
This content was uploaded by our users and we assume good faith they have the permission to share this book. If you own the copyright to this book and it is wrongfully on our website, we offer a simple DMCA procedure to remove your content from our site. Start by pressing the button below!
Report copyright / DMCA form
Delaunay Triangulation and Meshing
© Editions HERMES, Paris, 1998 Editions HERMES 8, quai du Marche-Neuf 75004 Paris ISBN 2-86601-692-0 Catalogage Electre-Bibliographie George, Paul-Louis*Borouchaki, Houman Delaunay Triangulation and Meshing : Application to Finite Elements. Paris : Hermes, 1998 ISBN 2-86601-692-0 RAMEAU : grilles (analyse numerique) triangulation elements finis, methode des DEWEY : 516 : Geometric. Trigonometric 624.1 : Genie Civil. Techniques de la construction Le Code de la propriete intellectuelle n'autorisant, aux termes de 1'article L. 122-5, d'une part, que les "copies ou reproductions strictement reservees a 1'usage prive du copiste et non destinies a une utilisation collective" et, d'autre part, que les analyses et les courtes citations dans un but d'exemple et d'illustration, "toute representation ou reproduction integrate, ou partielle, faite sans le consentement de 1'auteur ou de ses ayants droit ou ayants cause, est illicite" (article L. 122-4). Cette representation ou reproduction, par quelque proc6d6 que ce soit, constituerait done une contrefacon sanctionnee par les articles L. 335-2 et suivants du Code de la propriete intellectuelle.
Delaunay Triangulation and Meshing Application to Finite Elements
Paul-Louis George Hournan Borouchaki
HERMES
Web Site : http://www.editions-hermes.fr
Contents 1 Triangle, tetrahedron, triangulation, mesh 1.1 Introduction 1.2 About the triangle 1.3 About the tetrahedron 1.4 Simplex 1.5 Triangulation 1.6 Mesh 1.7 Useful element sets 1.7.1 Element sets 1.7.2 About the construction of such sets 1.7.3 About the construction of the edges of a triangulation 1.7.4 About the construction of the faces of a triangulation 1.7.5 About set membership 1.8 Notes
5 5 5 9 13 13 20 23 23 25 30 32 32 32
2 Delaunay triangulation 2.1 Introduction 2.2 From Dirichlet to Delaunay 2.3 Delaunay lemma 2.4 Incremental method 2.5 Other methods 2.5.1 Method by edge swapping in two dimensions . . . . 2.5.2 Divide and conquer 2.5.3 Sweeping algorithm 2.6 Computational aspects 2.6.1 Robustness and complexity 2.6.2 Reduced incremental method scheme 2.6.3 Cavity correction 2.6.4 Using the kernel 2.6.5 Access to the base
33 33 34 38 41 46 46 47 49 50 50 51 52 57 57
II
CONTENTS 2.6.6 Inheritance 2.6.7 Computational background 2.6.8 Dynamic management of the background 2.7 About some results 2.8 Applications 2.9 Notes
58 61 62 63 68 71
3 Constrained triangulation 73 3.1 Introduction 73 3.2 Constraints and triangulation 74 3.2.1 Some definitions 74 3.2.2 Constrained triangulation problems 76 3.3 The two-dimensional case 76 3.3.1 Construction of a Delaunay admissible constraint . . 76 3.3.2 Method by constraint partitioning 79 3.3.3 Method by enforcing the constraints 80 3.4 Constrained Delaunay triangulation 85 3.5 The three-dimensional case 86 3.5.1 Construction of a Delaunay admissible constraint . . 86 3.5.2 Method by constraint partitioning 87 3.5.3 Method by enforcing the constraints 89 3.6 Higher dimensions 99 3.6.1 Constraint partitioning method 99 3.7 Computational aspects in three dimensions 103 3.7.1 Searching the missing constraints 103 3.7.2 Local configurations 103 3.7.3 Tentative scheme for an algorithm 103 3.8 Some application examples 104 3.9 Applications 110 3.10 Notes Ill 4 Anisotropic triangulation 4.1 Introduction 4.2 Notion of a metric 4.2.1 Metrics and distances 4.2.2 Multiple metrics 4.3 Incremental method 4.3.1 Euclidean space 4.3.2 Riemannian space 4.3.3 Discrete approximations in two dimensions 4.3.4 Discrete approximations in three dimensions
113 113 114 115 116 119 120 121 123 125
CONTENTS
III
4.4 Computational aspects 4.5 Some results 4.6 Applications 4.7 Notes
128 129 129 130
5 Meshing in two dimensions 5.1 Introduction 5.2 The empty mesh construction 5.3 Field points (creation) 5.3.1 Several methods for field point creation 5.4 Control space 5.5 Creation along the edges, classical case 5.6 Creation along the edges, isotropic case 5.7 Creation along the edges, anisotropic case 5.8 Advancing-front type creation 5.9 Field points (insertion) 5.10 Optimization 5.11 General scheme for the mesh generator 5.12 Some results 5.13 Notes
131 131 132 136 136 138 140 143 147 149 151 151 152 154 159
6 Parametric surface meshing 6.1 Introduction 6.2 The fundamental forms and related metrics 6.2.1 Metric of the tangent plane 6.2.2 Metric related to the main curvatures 6.2.3 Physically-based metric 6.3 Surface meshing " 6.3.1 General scheme 6.3.2 Construction of a metric in 6.3.3 Classification of the useful metrics 6.3.4 Boundary meshing 6.3.5 Domain meshing 6.3.6 Surface mapping 6.4 Some results 6.5 Applications 6.5.1 Cylindrical meshing 6.5.2 Sampled surface meshing 6.5.3 Arbitrary surface meshing 6.5.4 Adaptive meshing 6.6 Notes
161 161 163 164 166 172 173 174 174 175 176 176 177 177 187 187 190 190 192 192
fi
IV
CONTENTS
7 Meshing in three dimensions 7.1 Introduction 7.2 The empty mesh construction 7.3 Field points (creation) 7.3.1 Several methods for field points creation 7.4 Control space 7.5 Creation along the edges, classical case 7.6 Creation along the edges, isotropic case 7.7 Creation along the edges, anisotropic case 7.8 Advancing-front type creation 7.9 Field points (insertion) 7.10 Specified internal edges and faces 7.11 Optimization 7.12 General scheme of the mesh generator 7.13 About some results 7.14 Notes
195 195 196 199 199 201 201 203 203 204 206 207 207 208 209 213
8 Optimizations 8.1 Introduction 8.2 Mesh quality 8.2.1 Shape and size qualities 8.2.2 Classification 8.2.3 Other (isotropic) quality measures 8.3 Topological operators 8.3.1 Edge swapping in two dimensions 8.3.2 Ball remeshing in two dimensions 8.3.3 Shell transformation in three dimensions 8.3.4 Entity suppression by local remeshing 8.3.5 Suppression by means of reduction 8.3.6 Edge splitting 8.3.7 Valance relaxation 8.4 Geometric operators 8.4.1 Local geometric operator 8.4.2 Global geometric operators 8.5 Remarks on surface optimization 8.6 Algorithmic aspects 8.6.1 How to use an optimization operator 8.6.2 How to control an optimization operator 8.6.3 How to control an optimization process 8.7 Some results 8.8 Applications
215 215 215 216 220 221 222 223 223 223 227 227 229 229 230 230 234 234 235 236 236 237 238 242
CONTENTS 8.9
Notes
V 242
9 Mesh adaptation 243 9.1 Introduction 243 9.2 Mesh adaptivity methods 244 9.2.1 The r-method 244 9.2.2 The /i-method 245 9.2.3 The p-method 245 9.2.4 The ftp-method 247 9.3 Modification versus reconstruction 247 9.3.1 Adaptivity based on local modifications 248 9.3.2 Adaptivity based on a complete reconstruction . . . 250 9.4 General scheme for an adaptation loop 251 9.5 Control space 252 9.5.1 Definition of the successive control spaces 252 9.5.2 Control space construction 253 9.6 Boundary meshing (or remeshing) 256 9.6.1 Curve meshing (or remeshing) 256 9.6.2 Surface meshing (or remeshing) 256 9.7 Domain meshing 256 9.8 Solution interpolation 259 9.9 General scheme of an adaptive loop 264 9.10 Some results 265 9.10.1 An isotropic example 266 9.10.2 An anisotropic example 272 9.11 Notes 276 10 Data structures 277 10.1 Introduction 277 10.2 Useful information (tentative list) 278 10.2.1 Recalling the notion of a mesh 278 10.2.2 For a (static) problem using a P1 approximation . . 278 10.2.3 For a (static) problem using a P2 approximation . . 283 10.2.4 For an adaptive computational process 286 10.2.5 Constraining a mesh 287 10.3 A general data structure 288 10.3.1 A general data structure 288 10.4 A geometric data structure 296 10.4.1 The two-dimensional case 296 10.4.2 A few remarks about three dimensions 299 10.5 Geometric representation 302
VI
CONTENTS 10.5.1 The two-dimensional case 10.5.2 The three-dimensional case 10.6 Mesh data structure 10.6.1 The two-dimensional case 10.6.2 The three-dimensional case 10.7 Notes
302 304 311 311 313 315
11 Boundary meshing 317 11.1 Introduction 317 11.2 Boundary meshing in two dimensions 317 11.2.1 CAD definition of a boundary 318 11.2.2 Related (discrete) database 318 11.2.3 Construction of a polygonal discrete line 318 11.2.4 Meshing 319 11.3 Boundary meshing in three dimensions 327 11.3.1 Curve meshing 328 11.3.2 Meshing of a surface consisting of several patches . . 328 11.3.3 Surface remeshing using optimization 335 11.4 Results 336 11.4.1 Planar curve mesh 336 11.4.2 Mesh of a surface defined by several patches 339 11.4.3 Surface mesh (remeshing via optimization) 341 11.5 Notes 342 12 Finite element applications 12.1 Introduction 12.2 Metric definition and metric construction 12.2.1 Hessian computation 12.2.2 Remark about the metric computation 12.2.3 Metric associated with the usual norms 12.2.4 Relative error metric 12.2.5 Intersection of several metrics 12.2.6 Transfer of the solution from one mesh to the other 12.3 Three CFD examples 12.3.1 General presentation 12.3.2 Supersonic scramjet 12.3.3 Viscous transonic flow for a Naca-0012 12.3.4 Viscous supersonic flow around a cylinder 12.4 Notes
345 345 345 348 349 349 350 350 351 352 352 354 357 360 365
CONTENTS
VII
13 Other applications 13.1 Introduction 13.2 Medial axis and medial surface 13.2.1 Medial axis 13.2.2 Medial surface 13.2.3 Several applications based on the skeleton 13.3 Parallel computing 13.3.1 A posteriori partitioning 13.3.2 A priori partitioning 13.3.3 Partitioning by inductive Delaunay triangulation . . 13.3.4 Partitioning a set of points by induction from the Delaunay triangulation of the convex hull 13.3.5 Partitioning from the domain boundary 13.4 Minimal roughness of a surface 13.5 Notes
367 367 367 367 368 369 370 370 371 371
.
Appendix
383
.
Bibliography
393
Index
411
373 374 380 381
This page intentionally left blank
Preface A wide range of engineering applications uses triangulations or meshes as spatial support. Given a set of points in Rd (d > 2), a triangulation of this cloud of points fills the corresponding convex hull with a set of elements which are, in general, simplicial in nature (triangle for d = 2 and tetrahedron for d = 3), such that some properties are satisfied. Conversely, given a polygonal domain (d — 2) or a polyhedral domain (d = 3), a mesh of this domain covers the domain with simple geometric elements (triangle, quadrilateral, in two dimensions and tetrahedron, pentahedron, hexahedron, in three dimensions) such that some adequate properties hold. Numerous computational geometry papers and books are devoted to the algorithms used to construct triangulations, with special attention paid to those resulting in Delaunay triangulations. These algorithms, in a suitable way, are an important part of the algorithms used to construct meshes. To this end, triangulation algorithms are of great interest for defining meshing algorithms. A large portion of scientific computing in engineering is the solution of partial differential equations of various type (for solid mechanics, fluid mechanics, thermal modeling, ...) by means of the finite element method. This method requires a mesh of the domain upon which the equations are formulated. Thus, meshing algorithms are of major importance in every numerical simulation based on the finite element method. In particular, the accuracy and even the validity of a solution is strongly tied to the properties of the underlying mesh of the domain under consideration. The aim of this book is to describe, in the first chapters, the different algorithms suitable for constructing a triangulation and, more precisely, a Delaunay triangulation. Then, the following chapters will indicate the way in which triangulation methods can be extended to develop meshing algorithms. Only Delaunay type methods are discussed here while observ-
ing that a large variety of meshing algorithms exists. To this end, the book is divided into three parts. The first part, devoted to triangulations, comprises the first four chapters. The second part dealing with meshing algorithms is made up of the five following chapters and the third part discusses several applications in the four last chapters. A technical appendix and an index are also included in the book. In Chapter 1, general definitions relative to elements, triangulations and meshes are given. Algorithmic hints are given regarding some key-issues that will be used extensively in the algorithms and methods developed throughout the book. In Chapter 2, several methods are discussed that result in the construction of a Delaunay triangulation. Given a set of points in Rd with d = 2 or d = 3, we propose several methods that make the construction of the Delaunay triangulation possible. The definition of a Delaunay triangulation is first given and then several construction methods are presented. A "popular" method, referred to as the incremental method, is emphasized and a reduced version of it is discussed in detail. Other approaches are also given. Algorithmic or computational aspects of the reduced method are mentioned, while indicating the numerical difficulties that can be expected along with some proposed solutions. Chapter 3 deals with constrained triangulations. A Delaunay triangulation is given along with a set of constraints. These constraints are indeed a set of edges in two dimensions and a set of edges and faces in three dimensions. The question is then how to enforce these entities into the triangulation so that they exist, in some sense, as entities of the resulting triangulation. The case of higher dimensions is also mentioned. Chapter 4 is devoted to the way in which anisotropic triangulations can be obtained. Given a set of points and a specified metric field, the purpose is to construct a triangulation which satisfies the given field. The metric specifies the properties that the triangulation should enjoy, in terms of prescribed sizes and directional information. The following chapters discuss the way in which arbitrarily shaped domains can be meshed. Algorithms developed to this end are derived from triangulation algorithms as described in the previous chapters. A chapter is devoted to two dimensions, another deals with parametric surfaces, while a third one discusses the three-dimensional case. The two-dimensional case is detailed in Chapter 5. A domain in R2 is given via a discretization of its boundary, where this boundary is given as a
list of segments. The problem then is how to construct a mesh of the given domain. This construction involves mainly two steps, one being related to the triangulation problem (as described previously), the other dealing with the the way in which a suitable set of internal points can be created. The notion of a control space is introduced as a way to govern the creation of the relevant field points, as well as to specify the nature of the expected point to point connections. This framework in discussed for a classical case, where the boundary discretization is the only input data available, for the isotropic case, where desired sizes are specified and, for the pure anisotropic situation, where both directional and size specifications are given. Chapter 6 indicates how to mesh a parametric surface. A field of metrics is constructed following the fundamental forms of the surface. This field serves to control the mesh construction. In particular, we show how to construct a so-called geometric mesh that is a close approximation of the surface. Chapter 7 follows the same steps as Chapter 5 while discussing the meshing problem of a domain in R*. This domain is defined by a discretization of its boundary, in other words, a surface mesh. Chapter 8 is devoted to mesh optimization, the meshes in question being composed of triangles (in two dimensions) or tetrahedra (in three dimensions). Several local tools are introduced and we propose a strategy that makes the development of a global optimization algorithm possible. In Chapter 9, mesh adaptivity is discussed by focusing on the computational aspect of this topic. Two approaches are proposed. The first one, which is only discussed briefly, relies on local modifications of an existing mesh. The other approach which is discussed in more depth, relies on the construction of the entire mesh. The general scheme of a fully automatic adaptivity loop is given. The last chapters show how to use the previous materials and methods in a true application of the finite element method in two dimensions. Chapter 10 introduces some data structures which enable us to develop a meshing theoretical background. A conceptual data structure is proposed and two applications are discussed. The first one is related to a data structure suitable for describing the geometry of the domain of interest while the second structure corresponds to the mesh representation. In Chapter 11 some details are given concerning the way in which a R2 or R3 domain boundary can be meshed or remeshed. The resulting
mesh serves as input for the meshing methods applied in the corresponding domain. In Chapter 12, significant mesh examples are given. To this end, several two-dimensional C.F.D. applications are used. In Chapter 13, several applications of triangulation methods are described which are not necessarily related to the finite element context. Software packages are listed in the appendix that are mainly devoted to mesh generation or mesh management for finite element purposes. These packages deal with mesh generation for two or three dimensions (most of them are issued from INRIA). The book ends with an index and a bibliography. As a conclusion, we would like to thank here those who contributed, in one way or another, to this book. Among these are the members of the Gamma group at INRIA, P.J. Frey, P. Laug, F. Hecht and E. Saltel who have contributed in various ways to this book. We would also like to thank B. Mohammadi and J. Galtier for their help. We are indebted to M. Desnous, P. Joly, A. Marrocco, A. Perronnet and J.D. Boissonnat, whose fruitful comments helped us to improve several aspects of the book. This text is translated from "Triangulation de Delaunay et Maillage. Applications aux elements finis", first published in french by Hermes, Paris, in 1997. The first translation, done by the authors with the help of P.J. Frey, has been greatly improved by Scott A. Canann, whom we would like to thank here.
Chapter 1
Triangle, tetrahedron, triangulation, mesh 1.1
Introduction
This chapter has several goals. First of all, the different notions that will be used have to be precisely defined, then some sets of elements that will be used in most of the algorithms described furthermore will be introduced. In this respect, triangles and tetrahedra as basic elements of the topic are briefly described. To be more general, indications regarding simplices in any dimension are given. Afterwards, some basic notions are introduced concerning triangulations, conforming triangulations, Delaunay triangulation and general meshes. The last part of the chapter deals with some sets of elements that will be used intensively in the following. These sets are defined and indications regarding how they can be constructed are mentioned. The aim of this part is to introduce some basic data structures and to show how they can be used in the present context. It can be noticed that these aspects are discussed in detail in numerous specialized references and are just presented in this chapter to make the framework precise. In principle, only two and three dimensions are described. However some of the definitions, formula or proposed constructions extend without major difficulties to higher dimensions.
1.2
About the triangle
Elementary definitions. While the triangle is a well-known entity, we would like to be clear with respect to some aspects about it.
6
CHAPTER 1. TRIANGLE, TETRAHEDRON, ...
Roughly speaking, a triangle is a 3-sided polygon. It is defined by a triple, namely the ordered list of its three vertices, denoted as P;, which are given counterclockwise A'= (^1,^2,^3). There are six ways (or permutations) for expressing the triple defining a triangle. In the case where an orientation is defined, only three permutations are relevant. Thus, for a triangle in a plane, the orientation is implicitly defined (using the normal of the plane) and the three possible definitions imply that its surface, denoted as SKI is signed. Thus, the triangles we will consider will have a strictly positive surface. For a triangle on an arbitrary surface, introducing the notion of an orientation is not always possible (except if the surface is orientable, which is where all the triangles can be oriented by adjacency starting from a given oriented triangle). Therefore, except for this case, the surface area SK is positive and given
by (1.1)
or
(1.2)
where x,, yi are the coordinates of vertex Pi (i = 1, 3) and |.| stands for the determinant. Moreover, this definition enables us to explicitly define the sides (or edges) of a given triangle. Indeed, edge i, (i — 1,3), denoted as a t , is the edge1 joining (in this order) vertex P{+\ to vertex P{+i (while Pj = Pj-3 if j > 3 is assumed). Additional information can be associated with each triangle (in a triangulation or in a mesh (see below)). This information can be of geometric or physical nature and will be used in the following chapters. Circumcircle. As will be seen later, the circumcircle of a triangle will play an important role in the triangulation algorithms. This circle is defined by its center (circumcenter) and its radius (circumradius). The computation of these two entities can be achieved in two different ways. Solving a linear system is a first solution while using the equation of the circle is an is the numbering convention chosen, while other choices are possible.
1.2. ABOUT THE TRIANGLE
7
alternate way to define the circumcircle. The equation of the circumcircle is then given by with
where I2 — z 2 + y2 and / 2 = z 2 + y 2 , (i = 1, 3); by expanding this determinant, the coordinates, xc et yc, of the circumcenter are explicitly obtained as well as r#, the circumradius. Exercise 1.1.
Establish expression (1.4) and relation (1.3).
The second method comes from finding the intersection of the perpendicular bissectors associated with two edges of triangle K and the circumradius is then obtained as the distance between this intersection point and any of the vertices of the triangle. This can be achieved by solving the following linear system \
/
\
1 / / 2 i
2\
f 2 _i_
2\
2
£3 - #2 ys - y2 J \ yc ) ~~ 2 y (z§ + y|) - (z , + y|) A formula which gives the circumradius, without using the circumcenter, is as follows r
K =
*
2
(1-6)
where Li is the length of edge az and SK is the surface area of triangle K. Exercise 1.2.
Establish relation (1.6).
Inscribed circle. The inscribed circle or incircle associated with a triangle will be also used in the following. In fact, its radius, the inradius, will be of great interest. This quantity, denoted as px, is defined by SK PK = — PK
where p% is the half-perimeter of K.
/, ^ (1.7)
CHAPTER 1. TRIANGLE,
TETRAHEDRON,
Figure 1.1: About the triangle (vertex numbering, edge numbering, incircle and circumcircle). Exercise 1.3.
Establish relation (1.7).
Quality. The quality or aspect ratio of a given triangle K is a value measuring the shape of the element. Our concern with element quality is due to the fact that the accuracy of a finite element computation is strongly dependent of the quality of the elements in the mesh serving as support. In practice, other measures of element quality are possible. Only two of them will be be used here as will be seen below. Furthermore other definitions will be introduced to take specific constraints into account, for example, in the case where sizes or directional properties are required. The first quality measure of an element K can be defined as /^
QK = ••••, Pn De these points, • introduce the edges APi,P\P2, ...,PnB in the triangulation, • remesh the triangles while maintaining this list of edges. Each missing edge a, with endpoints A and B, can be then retrieved in the triangulation as the edges AP\, P\P2, •», PnB.
Figure 3.4: Initial pipe and partition of the constrained edges. While quite obvious, this algorithm extends to higher dimensions, see [Borouchaki-1993]. In practice, a unique operator is required, used recursively if needed. Given a triangle and a point lying on one of its edges, this operator remeshs the triangle with two sub-triangles having this point as vertex. 2
Return to Chapter 1 where the definition as well as the construction of a pipe are detailed.
80
CHAPTER 3. CONSTRAINED
TRIANGULATION
As before, this method ensures the constraint in terms of Definition 3.3 and the resulting triangulation is not Delaunay. 3.3.3
Method by enforcing the constraints
In this case, we start with a triangulation that does not include the given constraints. Thus, there are some edges in Const which are not element edges in the triangulation. After discussing the existence of a solution, we would like to propose a method which enforces the constraints in terms of Definition 3.2. Existence of a solution. Before discussing the existence of a solution for this problem, we establish a preliminary result which can be seen as a complement of Theorems 2.2 and 2.3 of Chapter 2. Keep in mind that these results show, on the one hand, that it is possible to modify an arbitrary triangulation so as to obtain a Delaunay triangulation by means of edge swapping only and, on the other hand, that it is possible to modify any arbitrary triangulation so as to complete a different arbitrary triangulation. Theorem 3.1. There is a triangulation without internal vertex covering any domain with a non self-intersecting polygonal boundary. Proof. Let Pt be the endpoints of the edges defining the polygonal domain in question. We assume the P;'s to be ordered in such a way that the points P t _i, Pi and Pi+i are successively encountered when the boundary of the domain is visited counterclockwise with respect to its exterior component. We denote the triple (P,-_i, Pj, Pj+i) by (kj). Then, there is at least one triple (kj) such that the corresponding triangle, K{ — (kj),j = i — 1, i, i + 1, has a strictly positive surface. This result is established by contradiction. A polygon (or a domain with a polygonal boundary) cannot be properly defined if all the triple associated with three consecutive boundary vertices are either null or strictly negative. If (kj) is such a triple, then only two states can exist. Either the triangle associated with the triple is empty (this is the case of triangle K8 = (P7P8P9) associated with the triple (ks) in Figure 3.5) or the corresponding triangle is not empty (on the same figure, see the triangle K4 = (PaPiPs), whose triple is (k4), which encloses point Pi2). The first state enables us to construct as a triangle of the triangulation the empty element associated with the actual triple. The initial domain is then modified by removing this triangle and the process is repeated after having reordered (formally speaking) the points of the new boundary. The second state leads to
3.3. THE TWO-DIMENSIONAL
CASE
81
Figure 3.5: The initial domain and the ordered vertices. • picking all of the edges having at least one endpoint enclosed in the current triangle A't, • constructing the convex hull of these edges, • replacing P;+i (or P;_i) by one of the points of this convex hull, say P;, by choosing the point that ensures that the triangle associated with the triple P;_iPjP; (or P/PjPj+i) is empty. Hence, we return to the first state and its construction rules are applied.
Figure 3.6: Creation of two triangles and resulting domain. In the second case, three steps are required to show that the triangle Pi-iPiPl (or P/PiPi+i) is empty. First, the fact that the initial triangle has three consecutive points on the domain boundary implies that all edges intersecting this triangle have at least one endpoint included in this triangle. Indeed, if the last property does not hold, then the edge under consideration has a non-empty intersection
82
CHAPTER 3. CONSTRAINED
TRIANGULATION
Figure 3.7: Convex hull of the edges intersecting a triangle. with one of the edges P;_iP; or P;P;+i. This is not permitted as the boundary of the domain is not supposed to be crossed. Second, since every point of the convex hull sees at least one of the edges Pj_iP; or P^P J+ i, then the triangle formed by joining such a point and the visible edge has a strictly positive surface. The Figure 3.7 depicts a configuration in which the triangle Pj_iP z Pj+i is non empty. The convex hull of the edges having a non empty intersection with this triangle encloses the points P/i and P/2. The triangles PiPi+\Pn and P;Pl+iP;2 have a positive surface area. Third, the closest point of the convex hull to the selected edge (Pt-_iP2- or PjPj'+i) ensures that the formed triangle is empty. The triangle PjPj+iP^ in the Figure 3.7 is empty. D The set of theorems used here provides a theoretical support for the following. Thus, discussing about how to enforce an edge in a triangulation is equivalent to discussing about how to mesh a polygon. We consider a triangulation and a set of constrained edges, Const, whose endpoints are vertices of the triangulation. Assuming that some constrained edges are missing in the current triangulation, we show that it is possible to modify the current triangulation so as to complete a (non-Delaunay) triangulation including these edges as element edges. Therefore, the existence of a solution for the given problem will be established. To this end, a constructive method3 is developed. Let a be an edge of Const currently missing in the triangulation. We denote also by a the segment joining A and B, the endpoints of a. We construct the pipe Ta 3
One can observe that the proof of the above theorem can be used to define a method, although it can have a poor complexity.
3.3. THE TWO-DIMENSIONAL
CASE
83
associated with the constraint a, and we denote by P the corresponding polygon. For sake of simplicity, we assume that P is a simple4 polygon and we would like to triangulate the polygon P in such a way as to ensure the existence of a. By definition, a separates P into two sub-polygons PI and P% (each of them being located on one side of a). Let us consider, for instance, PI and let us define by PQ = A, PI, PI, •••, Pn-\, Pn = B the vertices of this polygon. We search among the Pj, (j = 1, n — 1) for the point closest to a. This point exists (if it is not unique, the first encountered can be selected), we called this point Pk. Then, APk and BPk separate P\ into at the most three sub-polygons, one is the triangle ABPk, the two others are polygons whose number of sides is now less than that of the initial polygon. So, the polygon P is replaced by the triangle ABPk and, in the worst case, by two sub-polygons constituting the new triangulation problem. To complete this triangulation, it is only necessary to repeat the same method for all sub-polygons having more than three vertices (i.e. more than three sides) while replacing the edge a by the relevant edge (say APk and in the first recursion).
Figure 3.8: Initial polygon and first recursion. This process converges. Upon convergence, a triangulation of Ta is completed and a = AB exists. This method, as applied to all edges of 4
A polygon is said to be simple, if it is not self-intersecting.
84
CHAPTER 3. CONSTRAINED
TRIANGULATION
Const, implies the existence of a solution, and, moreover, completes the latter (assuming non self-intersecting edges in Const}. Exercise 3.1. Give a proof of this algorithm (Hint: the proof is based on the fact that the initial polygon has a finite number of vertices. It also uses the fact that the complexity of the sub-problems recursively defined is strictly less than that of their parent problems. Notice, on the one hand, that since the initial polygon is simple (as supposed at first), then the series of polygons involved in the process maintains this feature, and, on the other hand, that a polygon with three sides stops the recursion). Exercise 3.2. Discuss how to handle the case of a non-simple polygon (Hint: find a method to return to the case of a simple polygon). Method using edge swapping. According to the previous material, a solution of the problem exists. Consequently, it is sufficient to apply Theorem 2.3, meaning that the solution can be achieved by means of edge swapping. Note that this result has been established in two dimensions only. The method consists of locally modifying the triangulations of some relevant polygons (cf. Definition 3.4), taking advantage of the equivalency of such triangulations. It is now possible to propose the algorithm that follows. Other examples include those presented in [Hecht,Saltel-1989] and [Dyn,Goren-1993] where a slightly different approach is involved. Let a be the segment corresponding to a missing edge, whose end points are vertices of the triangulation, then • determine the pipe associated with the segment a, • apply edge swapping, as long as possible, to every edge of the triangulation intersected by a, while avoiding an infinite loop. The following algorithm is quite elegant : • determine the pipe associated with the segment a, • randomly apply edge swapping to every edge of the triangulation intersected by a.
3.4. CONSTRAINED
DELAUNAY
TRIANGULATION
85
Figure 3.9: Initial pipe and first three edge swaps. The convergence of these algorithms is ensured since a solution exists by means of edge swapping operations and since the number of required edge swapping is necessarily bounded. As no (infinite) loop is possible (as a consequence of an explicit check or due to the random aspect in the second algorithm), the convergence is guaranteed. On Figure 3.9, one may notice that the number of elements in the pipe does not necessarily decrease when an edge is swapped. Nevertheless, the number of elements in the pipe tends globally to two so that an ultimate edge swap achieves the solution.
3.4
Constrained Delaunay triangulation
This notion, briefly introduced in Chapter 1, is specific to twodimensional space. It leads to the extention of the concept of a Delaunay triangulation in the case where one or several edges (forming the constraint) are specified. Definition 3.6. Tr is said to be a constrained Delaunay triangulation of Q if the open circumdiscs (circumballs) of its elements do not include any point visible5 from the vertices of these elements. Constructing a constrained Delaunay triangulation can be achieved in three steps. First, the given points and the endpoints of the constrained 5
A point is said to be visible by an other point in the mesh if the segment joining these two points does not intersect any constrained edge.
86
CHAPTER 3. CONSTRAINED
TRIANGULATION
edges are inserted. Then, the specified edges are enforced and finally, edge swapping is applied to all created edges if the Delatmay criterion is violated according to the above definition. This kind of triangulation can be used in several different applications, including computer vision, CAD and many others. On the other hand, this type of triangulation is not useful in the meshing context for finite element purposes, as will be seen in Chapter 5.
3.5
The three-dimensional case
While the two-dimensional problem is successfully solved, the corresponding three-dimensional problem is still not fully treated. Numerous problems are still open and, specifically, the existence of a solution, according to Definition 3.2, is not clearly established. Nevertheless, this does not mean that more or less heuristic methods have not been developed, which aim at constructing a suitable solution. In practice, several authors have shown that it is possible to achieve a constrained triangulation in most of the cases. Within the discussion, we will split the problem into two phases. The first phase concerns the regeneration of the edges in the constraint field, in some sense. The other is devoted to the enforcement of the faces specified in the given constraint. Indeed, it must be noticed that a specified face may be missing while its three (specified) edges are present in the current triangulation. In what follows, a discussion similar to the two-dimensional case is made and we indicate, with respect to the different approaches of satisfying the specified constraints, the existence of a solution if any.
3.5.1
Construction of a Delaunay admissible constraint
Delaunay admissible edges. Dealing with the non Delaunay admissible edges included in the constraints leads to the same result as in two dimensions. Such an edge can be split using Method 1, detailed in two dimensions. Similar reasons ensure the convergence; indeed, the spheres involved in the construction are strictly enclosed in the former spheres they replace. Remark. Extending the two dimensional Method 2 previously discussed is a more tedious problem. It is actually not so easy to guarantee the Delaunay criterion for a given edge by analyzing all the tetrahedra that can be formed from this edge.
3.5. THE THREE-DIMENSIONAL
CASE
87
Delaunay admissible faces. The construction of a set of Delaunay admissible faces, given a set of arbitrary faces, seems to be an open problem. In fact, we think that even the existence of a solution not always holds. Splitting a face into sub-triangles by introducing a point inside the given face, does not lead to obtain spheres strictly included in the sphere they replace. Similarly, introducing the edge midpoints on the current face leads to the same negative conclusion. Moreover, dealing with a face may result in the need to modify adjacent faces, contrary to the case of the edges. To avoid such a propagation, one solution consists of constructing a uniformly refined mesh leading to a large size problem. Exercise 3.3. Construct an example of the above situation (Hint: splitting a triangle face into four may result in repeating the same pattern at infinity). Nevertheless, the following proposition can be used to decide if a given face is Delaunay admissible. Proposition 3.2. Let f = ABC be a face and Cf be the smallest ball passing through A, B and C. The plane through f partitions the space into two half-spaces, denoted by Hf and HJ. Then, the face f is Delaunay admissible if • Cf is empty (no vertex is included in it), or • Cf fl Hf (resp. C/ fl HJ) encloses some points but Cf (resp. Cj) is empty, Cf (resp. CJ) being the circumball of the tetrahedron formed by f and the point in C/ D H* (resp. Cf n HJ ) such that Cf (resp. Cj) does not include any other point of Cf D #f (resp.
3.5.2
Method by constraint partitioning
Splitting the edges. In this type of solution, the method proposed in two dimensions can be extended without difficulty. We search the pipe associated with the segment a corresponding to the missing edge. This pipe is actually a general pipe (cf. Chapter 1). The intersection points of a with the elements fall into two categories, • a intersects one or two faces of a given tetrahedron,
88
CHAPTER 3. CONSTRAINED
TRIANGULATION
• a intersects one or two edges of a given tetrahedron, • a intersects one face and one edge of a tetrahedron of the pipe. The algorithm consists of finding the intersection points and of defining the required operators, • an operator that splits an element having a face intersected by a into three sub-tetrahedra. This is the operator OP? described later (see Figure 3.10), • an operator which deals with the intersection through an element edge (where the corresponding shell is considered). Recursively applied, these operators enable us to manage all the possible configurations and result in ensuring the existence of a (non Delaunay) solution which is completed at the same time.
Figure 3.10: Operator
Splitting the faces. In principle, the face problem can be solved in a similar way. The method consists of directly enforcing the sub-faces resulting from the intersection of the constrained face and the tetrahedra of the current triangulation.
Exercise 3.4. Prove that an algorithm enforcing the sole edges of the sub-faces does not lead to the desired result (Hint: analyze the case where a sub-face is a four-sided polygon).
3.5. THE THREE-DIMENSIONAL
CASE
89
Exercise 3.5. Develop the algorithm which directly enforces the subfaces (Hint: take care to preserve a conforming triangulation). The reader will find hereafter the description of this algorithm for arbitrary dimensions. 3.5.3
Method by enforcing the constraints
Satisfying the constraint in terms of Definition 3.2 results in a problem for which the existence of a solution is not proved. We will now point out the reason of this lack of solution. Nevertheless, we will propose an heuristic method suitable for most cases. Existence of a solution ? The Schonhart polyhedron (at bottom of Figure 3.11), is a rather simple polyhedron for which it is not possible to find a triangulation (consisting of strictly positive volume tetrahedra) without introducing internal point(s). Such points are called Steiner points. Theorem 3.1 does not extend to three dimensions. In this example, this results from the fact that the triangulation without any internal points contains a tetrahedron whose volume is exactly zero. On the other hand, a point located anywhere in the interior of the polyhedron belongs to the (visibility) kernel of this set. Consequently, joining the faces of the polyhedron and this point results in a valid triangulation. This example, while rather obvious, points out a fundamental difference between the two-dimensional and the three-dimensional problem. In twodimensions, a solution without (Steiner) points always exists. The example also leads us to expect some difficulties in detecting this type of problem as well as in determining the adequate Steiner points. Thus, an open problem is the determination of the minimum number of Steiner points required to make the constrained triangulation possible. Another open question is that of finding appropriate locations for these points, in a polynomial complexity.
Exercise 3.6. "Twist" the Schonhart polyhedron (i.e. reduce the size of its kernel) and find the location of the Steiner point making its triangulation possible (To play this game, one can use construction paper to construct a model. This is a good way to develop some insight into the difficulty of this problem).
90
CHAPTER 3. CONSTRAINED
TRIANGULATION
Figure 3.11: Possible prism and Schonhart polyhedron. To conclude, it has not been proved that an algorithm with a polynomial cost can be exhibited to ensure the existence of a solution for the given problem (see [Ruppert,Seidel-1992]). As this does not rule out the existance of a solution, we would like to propose an heuristic method suitable for most cases. This method is detailed hereafter. Method by means of local transformations The key-idea is to use local transformations to regenerate the missing members of Const. Its principle is based on the equivalency of polyhedral triangulations (cf. Definition 3.4). In practice, operators will be defined so as to remove an edge or a face intersected by any missing entity of the constraint. Useful local operators. The number of operators dealing with an (elementary) polyhedra is reduced. Indeed, one can • introduce a point along an edge and remesh the corresponding shell (cf. Chapter 1). This operator is denoted by • introduce a point on a face and remesh the shell formed by the two elements sharing this face, OP?,
3.5. THE THREE-DIMENSIONAL
CASE
91
• create a point inside a tetrahedron and subdivide it into four elements, OP3, • introduce two points on two faces of a tetrahedron and remesh it into five tetrahedra, • remove the edge defining a shell, • remove the face common to two tetrahedra, • relocate a point, The operators OPi, OP?, OPs and OPj are rather simple and apply without restriction. On the other hand, the operators OPs, OPe do not apply in all situations as the resulting triangulation can be made invalid. These tools, suitable for optimization purposes, will be described in detail in this context (see Chapter 8). Finally, the operator OPr, also described later, can be used without any difficulty 6 , at least in theory. In summary, • OP\ operates on a shell and a point, denoted as OPi(C,P). This operator results in two half-shells, operates on two elements and a point, denoted as OPp. Then, we introduce the R+ as Ri = UiP + (1 — Ui)Qi such that a proper choice of u>; ensures that the distance between AB and Ri decreases while going away from A (the Figure 3.14 illustrates this construction using a cutting plane). The first and the last element of Vp are remeshed in three [OP^] while the intermediary elements are remeshed in five (OP^). Thanks to the location of the points Ri, the step (/?) is reached when dealing sequentially with the resulting pipes (Ri being considered, then Ri+i becomes visible by A). As we have
Ta =r + iv
at each step of the algorithm, the initial pipe is retriangulated and, moreover, the desired edge a now exists. Proof. This algorithm constructs a sequence nt- strictly decreasing in spite of step (7). Indeed, if (7) is performed, the next step will necessarily involves the step (/?). D
Figure 3.12: Operator OP& applied to K\ and K^In practice, the proposed algorithm uses only the operators OP^, and OPe> while in a computational implementation, other operators can be considered. In the second case, i.e. if there is at least one shell corresponding to the edge a, we will try to remove the shell(s) leading to the general pipe configuration and, consequently, retrieve the previous case.
3.5. THE THREE-DIMENSIONAL
CASE
Figure 3.13: The polyhedron (K\,K 1 and OiM^p^(P^K] > 1, simultaneously. As a consequence, the proof of Proposition 4.1 can be argued. n The Figure 4.4 displays a point P, the ellipses £p and £pl circumscribing the given triangle K according to the metrics of P and of PI . In the depicted case, only £p encloses the point P. A third approximation. The last solution consists of involving the metrics of the four points induced when inserting the point P to analyze the triangle K with vertices Pi,p2 and P3. The proximity criterion is then aM(P)(P,K) + aM(pv)(P,K)+aM(p^(P,K)+aM(p^(P,K)(t) is a segment AB of Q, we have (6.6)
166
CHAPTER 6. PARAMETRIC SURFACE
MESHING
Geometric interpretation of M\. Let O be the point of fi (i.e. the pair (-u, v}} and Mi(cr(O)) be the tangent plane metric in o(O}. Let e be an arbitrary real value, then the locus of the points X of 17 such that
is an ellipse, centered at O, denoted by £(O,e). In the R2 space provided with the Euclidean metric defined by Ati(cr(O)), £(O,e) is a circle centered at O whose radius is e. Assuming that £(O,e) C fi, for every X € £(O,e} we consider the curve TX = cr([OX]) plotted on S, image by a of the segment [OX] of fi. Then the length of TX is given by i
L(TX) =
ytQMiWO + tO))Odt .
(6.8)
o
For e small enough, irrespective of the parameter t, we have
Mi((T(O + to3))&Mi(= 0. These two vectors define two directions, the soVi V2 called principal directions. Let us define W\ = .. and W2 = 'HI
ll"2|
This pair of vectors (W\, W2) forms an orthonormed base of Tp and Bp = (W\, W2, v) is a base called the local principal base at P. Let us define the principal curvature and the principal radius of curvature corresponding to V\ (respectively V2) by KI and define p\ = — (resp. K2 and p2 — — ). KI
K2
Then the following result holds, see [Lelong,Arnaudies-1977j. Lemma 6.3. Let V = \\V\\(WiCosO-\- W2sinO) be an arbitrary vector ofTp and let p(V) —
be the corresponding radius of curvature. If
= \/p(V)cosO and if x2 = \/p(V] sin 9 then
In other words, the square root of the radii of curvature follows a conic section in the tangent plane. From the above results, it will then be possible to define a metric. A metric related to the principal curvatures Let P be a point on E. Let W\ and W2 be the two principal directions and let p\ and p2 be the corresponding radii of curvature. Provided that Pi < P2i we have the following lemma. Lemma 6.4. Let V = \\V\\ (Wi cos# + W2 sin 9} be an arbitrary vector of Tp of origin P and let p(V) be the radius of curvature corresponding to the normal section. Let Y be the intersection point of the half-line A whose origin is at P, aligned with vector V with ellipse £ plotted on Tp and defined by % +% =! Pi Pi
(6-11)
where (z1} z2] = PZ is a point of this ellipse, then we have (see Figure 6.3) \\P?\\ (P), is the smaller of the principal radii of curvature pi and P2 then the metric map
(6.23)
is called the isotropic map related to the minimal radius of curvature and, according to Formula (6.16) and Proposition 6.1, this map enables us to obtain an isotropic mesh with a second order approximation of the surface.
172
CHAPTER 6. PARAMETRIC SURFACE MESHING
Anisotropic metric based on the principal curvatures Similarly, assuming p\ < p% (where p\ and pi are functions of P), the metric map
where A is an arbitrary scalar value, is called the anisotropic map based on the principal radii of curvature and, according to Formula (6.16) and Proposition 6.1, this map allows us to obtain an anisotropic mesh with a second order approximate of the surface. 6.2.3
Physically-based metric
The metric maps as defined above are directly related to the intrinsic properties of the considered surface. In an adaptive analysis of a given (physical) problem, the analysis of the corresponding solution may result in a metric map which is purely physical in nature (apart of the surface geometry). Constructing a surface mesh by using such a metric solely does not result, in general, in a mesh that closely approximate the surface. Hence, a new metric map must be defined so as to combine both the physical metric map and the geometric metric map. Such a metric, referred to here as the intersection metric, can be achieved by either two approaches. Let M^(P] be the physical metric and, let Ats(P,piipi] for instance be the geometric metric we have chosen. Then the intersection of these two maps (cf. Chapter 4) can be created by either • maintaining the aspect of the initial metric map, • approaching at the best the two metrics in question. The first solution consists in defining a scalar value a such that the unit ball corresponding to the intersection metric aM^P] is the largest ball included in the unit ball of the metric Mz(P,p\,p2). The second solution results in the definition of the metric based on the largest ball included in both the unit ball A^s(P) and that of A1s(P, /?i, p^)-
6.3. SURFACE MESHING
6.3
173
Surface meshing
In this section we propose a general scheme for parametric surface mesh construction. We show how to define a controlling metric map and we give one possible classification of the different metrics that can be used. Then, we discuss how to mesh the surface boundaries. Given the surface boundary discretization, we indicate how to create a mesh of the parametric domain which in turn allow us to obtain the desired surface mesh by applying the mapping function. 6.3.1
General scheme
Let Q be the domain of R2 corresponding to the parametrization of a given surface E. After defining a Riemannian structure on this space, the meshing problem can be formulated as the construction of a mesh of Q in such a way that unit length edges are created in accordance with the Riemannian structure. This structure, used to govern the mesh construction of Q, is defined in terms of the expected result (isotropic mesh, anisotropic mesh, mesh with specified sizes, and so on). In particular, the above control space may rely on the first fundamental form (through its metric map) and even on the second fundamental form (via its metric) of the surface E. From a practical point of view, the metric map is defined, by means of interpolation, using the discrete metric map associated with the vertices of a given mesh of Q (thus serving as a background mesh). The pair constituted by the background mesh and the discrete map is the control space of our mesh construction problem, as introduced in the previous chapter. Meshing the domain, based on this control space, is achieved in two stages by 1. meshing the boundaries of fi, 2. meshing £7 using the previous boundary mesh. In what follows, we will summarize the outline of this algorithm, discussed in detail in [Borouchaki et al. 1997a] and [Borouchaki et aL 1997b]. This algorithm enables us to achieve a governed mesh of 17 so as to obtain a mesh of E conforming (as much as possible) the input specified properties (given via the control space). 6.3.2
Construction of a metric in fi
The mesh of E, based on the given metric map A^s, is deduced from the mesh of fi. The mesh of fi is governed by the metric map j\A) intersected with the given uniform or arbitrary metric map Physico-geometric mesh based on the principal radii of curvature. We take into account the metric map M.%(P,p\,p2) intersected with the given uniform or arbitrary metric map Thus, there are six different possible situations that will be depicted in the application examples provided in a following section.
6.3.4
Boundary meshing
The geometry of the domain f2 is described by a discretization of its boundaries. This discretization is used to defined a support by means of an adequate mathematical representation. The boundary mesh is governed by the metric map MI and is a discretization of the above support into unit length arc segments (according to the control space). To achieve this
176
CHAPTER 6. PARAMETRIC SURFACE MESHING
boundary mesh, the support is approached by polygonal segments which are in turn subdivided into unit length polygonal segments, resulting in a unit boundary mesh. Chapter 11 will discuss this boundary meshing process in more detail.
6.3.5
Domain meshing
The boundary mesh of Q is a set of edges constituting a set of constrained edges where these edges have a set of points denoted by S(Q) as vertices. To achieve the mesh of the domain Q, we first construct, by means of the Delaunay method, [Borouchaki,George-1997], an empty mesh of fi, [George-1991], containing only the points of 5(fi) as vertices . Then, by adding the relevant points inside this empty mesh, a new mesh is constructed which is then optimized to obtain the final mesh of Q. The internal points are created and then inserted in the domain iteratively. Indeed, at the first step of the process, the domain mesh is the empty mesh and then, at each step, the internal edges of the current mesh are analyzed and the internal points are • constructed along the edges so as to, on the one hand, subdivide a given edge in unit length segments and, on the other hand, ensure that the so-created points are not too close (less than 1) to any already existing points (with respect to the control space), and • inserted in the current mesh using the constrained Delaunay kernel in a Riemannian context. This process is repeated as long as the current mesh is affected. The set of processes and procedures required to the effective construction of a unit mesh has been described in the previous chapters to which the reader is referred.
6.3.6
Surface mapping
Mapping the mesh of fi onto the surface S is rather obvious, in fact one has just to apply the function a.
6.4
Some results
In this section, we will show some meshes resulting from the proposed method. Specifically, we will pay attention to the metric effect on the
6.4. SOME RESULTS
111
resulting mesh. The selected example is a surface, analytically given by the equation (x,y,z = 3sin(2z)cos(2y)) (6.29) where the parametric domain is a circle of origin O = (0,0) and of radius r = 3, the circle being in the plane XY. Uniform isotropic mesh in the parametric domain. At first, the parametric domain is meshed in a uniform isotropic way and most of its elements have a size h = 0.2 (Figure 6.6, left-hand side on top). This mesh includes 876 points and 1,746 triangles. Using cr, this mesh is mapped onto the surface (Figure 6.6, right-hand side on top), an arbitrary surface mesh is then obtained which does not conform a priori the geometry of the surface.
178
CHAPTER 6. PARAMETRIC SURFACE MESHING
Figure 6.6: Uniform mesh (h = 0.2^ in fi and its mapping onto S (top). Uniform mesh (h = 0.4,) onto £ and the governed mesh o/fi supporting the construction (bottom).
6.4. SOME RESULTS
179
General metrics. To clarify the different categories of surface meshes obtained by specifying a metric map of the type M,(P] =
/ a(P) b(P) b(P) d(P) \ c(P) e(P)
c(P) \ e(P] f(P) )
(6.30)
with a(P) > 0, a(P)d(P) - 62(P) > 0 and Det(A43(P)) > 0, in R3, we recall how to find the metric in R2 governing the process from the above metric in R3. The metric map M.i,/t>2). These two maps are subjected to the constraint Pmin < P < Pmax
(6.35)
with Pmin — 0.05 and pmax — 2.0 so as to avoid any degeneracy in terms of element sizes. The resulting meshes are displayed in Figures 6.8 and the corresponding statistics are reported in Table 6.2. By definition, these meshes conform to the geometry and give a second order approximation of the surface. Metric map
M3(P,p) M3(P,Pl,P2)
ne
tcpu
15,464 30,922 2,243 4,480
12. 2.
np
e 6.
8.
Table 6.2: Statistics related to the geometric metric maps. One may notice that the second mesh adequately approaches the surface with only 4,480 triangles, i.e., with almost one seventh the number of elements in the first mesh.
6.4. SOME RESULTS
181
Figure 6.7: Uniform meshes (h = 0.2, top and h — 0.1 bottom) onto E and the governed meshes of Q which support the construction.
182
CHAPTER 6. PARAMETRIC SURFACE MESHING
Figure 6.8: Isotropic geometric mesh (top), anisotropic mesh (bottom) o/E (right) and the governed meshes in Q (left) which support the construction.
183
6.4. SOME RESULTS Arbitrary meshes. We now consider two metric maps, the first is isotropic and defined by
(6.36)
where /(r) = 0.05 (1-fr2) with r 2 = x 2 +y 2 , and the second map M$(P, aniso), an anisotropic map, is defined by
where 0(z) = 0.1|^ 2 - 2.25) + 0.01. The first map leads to a quadratic increase in sizes with respect to x and y corresponding to an increasing desired size as we move away from the origin. Elsewhere, a minimal size of 0.05 is specified. The second map specifies more element stretching as we approach the two planes z = 1.5 and 2 = —1.5, with a maximal stretching factor of 20. Figures 6.9 top ( 6.9 bottom resp. ) depict the meshes corresponding to the map A^-P, iso) P, aniso), resp.) and Table 6.3 reports the corresponding statistics. Metric map <M3(P,iso) Ais(-P, aniso)
np 6,065 9,279
ne 12,124 18,552
tcpu 6. 17.
e 6. 95.
Table 6.3: Statistics related to the arbitrary maps. In both cases, the resulting meshes conform to the specified metric maps but not to the geometry.
184
CHAPTER 6. PARAMETRIC SURFACE MESHING
Figure 6.9: Arbitrary governed meshes, isotropic (top) anisotropic (bottom) of £ (right) and the governed meshes of Q (left) which support the construction.
185
6.4. SOME RESULTS
Geometric arbitrary meshes. We again consider the above two metric maps A^3(P, iso), A^s(P, aniso) which are now modified to include the metric maps Ats(P, />) and A1s(P, pi^pi] respectively, so as to produce a metric map which approximates the geometry more accurately. Thus, the first metric map "intersection", M.z(P, iso,geom), is deduced from A^s(P, iso) by replacing /(r) by min(/(r),/f>) where P = (x,y, 2 = 3sin(2a;)cos(2y)) and p is the minimal radius of curvature in P. The second map, M$(P, aniso,geom), is obtained by intersecting the initial metric map A1s(P, aniso) with the metric Ms(P,p\,p2) which is the anisotropic metric map of the radii of curvature. Figure 6.10 shows the resulting meshes, while the statistics for these meshes are given in Table 6.4. Metric map X3(iso,geom) Af3(aniso,geom)
np
ne
ICPU
17,192 32,212
34,378 64,418
14. 45.
e 6. 97.
Table 6.4: Statistics related to the combined geometric metric maps. One may observe that the specified conditions are not satisfied everywhere due to geometric features which constrain the construction.
186
CHAPTER 6. PARAMETRIC SURFACE MESHING
Figure 6.10: Geometric governed meshes, isotropic (top) anisotropic (bottom) of E (right) and the governed meshes in J7 (left) which support of the construction.
6.5. APPLICATIONS
6.5
187
Applications
Numerous applications of this mesh generation method can be exhibited.
6.5.1
Cylindrical meshing
A surface with a cylindrical topology is well-suited for the proposed mesh generation method. We assume that this surface, S, is defined by a set of values p = f(0, z) or z = g(0, p) where z is the altitude, p is the radius and 0 is the corresponding angle. Such a surface can then be mapped onto a rectangle and the mesh generation method applies to this rectangle. Nevertheless, this first solution does not result in an optimal mesh. Indeed the vertical sides of the cylinder (or the horizontal sides according to the way the mapping is defined), and more precisely the mesh segments corresponding to these sides will be mesh edges lying on the surface S, after mapping. Thus, an "artificial" line may be observed and the resulting mesh is no longer a periodic mesh. Figure 6.12 illustrates this method. The input data is a set of values associated with a uniform grid 120 X 69 (courtesy of ENST). The resulting geometric isotropic mesh includes 24,847 triangles and 12,569 points. To overcome the non-periodic nature of the mesh, a simple transformation is possible which relies on mapping the cylinder onto a ring, instead of a rectangle, to define the planar parametric domain ft to be meshed. Indeed, it is possible to find a new space by applying a stereographic projection to a point Q — (0,0,Z/), where L > d, d being such that 0 < z < cf, on the plane z — 0 (Figure 6.11). The new parameters are then defined
by Lr
x' =
cos(d) , LrZ y' = _ sin(0) . L
(6-38)
The new parametric domain is thus a ring (see Figure 6.13 where the input data is a uniform grid 180 X 144 (courtesy of ENST) where the resulting geometric anisotropic mesh has 20,374 triangles and 10,190 points) Lr defined by the two circles centered at O whose radii are r and resL —d pectively and the cylinder is defined, through this domain, by the following
188
CHAPTER 6. PARAMETRIC SURFACE MESHING
Figure 6.11: Projection onto the plane z = 0. equations
(6.39)
This projection trick allows for the creation of the mesh in Figure 6.13 which can be compared, to some degree, with the mesh in Figure 6.12 which was obtained using the classical approach.
6.5. APPLICATIONS
189
Figure 6.12: Uniform isotropic geometric mesh of a cylinder created by the first approach (where the domain Q, is a rectangle).
190
6.5.2
CHAPTER 6. PARAMETRIC SURFACE MESHING
Sampled surface meshing
For some types of surfaces (for example, surfaces with a cylindrical topology), a scanning device can provide (as a function of the used technology) a set of values z = /(w, v) based on a uniform grid. It is then possible to exploit this grid so as to complete a parametric representation of £ along with a discrete metric map. Thus, we return to a case where the mesh generation method described in this chapter applies.
6.5.3
Arbitrary surface meshing
CAD-CAM software packages define surfaces as a set of patches and construct triangular meshes (or quadrilateral or mixed meshes) from the mesh of these patches using a specific method. The process is performed on a patch basis (patch-dependent meshing) or by combining several patches together if possible (patch-independent meshing). The problems encountered in this kind of process include the following, among others • the tedious case where the surface is defined by a large number of patches, • the case where the sizes of the patches vary widely, • the case where the patch size is "small", so that the patch mesh is the patch itself (if it conforms to a triangular or quadrilateral shape), • the fact that the patches do not form, in general, a (coarse) conforming mesh of the surface. Indeed, overlapping regions and gaps may exist, • the non-uniqueness of the mathematical basis for each patch (i.e., the description may be different from one patch to the other), • and several others. Thus, the mesh generation method as described in this chapter cannot be applied by itself. Nevertheless, we think that some of the ideas and concepts developed in this discussion can be used fruitfully for many general situations.
6.5.
APPLICATIONS
191
Figure 6.13: Anisotropic geometric mesh of a cylinder using the second approach (where the domain Q is a ring).
192 6.5.4
CHAPTER 6. PARAMETRIC SURFACE MESHING Adaptive meshing
We consider a cycle of computations, for instance using the finite element method. At each iteration step, it is necessary to mesh the surface of the computational domain. This mesh is governed by a metric map deduced from the solution of the problem under consideration analyzed via an a posteriori error estimate. We return then to the previous situation where the geometric metric map associated with the intrinsic properties of the surface and a physical metric map derived from the solution analysis must be combined.
6.6
Notes
Surface meshing, in the context of a finite element applications (i.e., surface meshing so as to provide the input to a R3 domain meshing method), has been investigated using several different approaches. Octree approach. Based on the combination of the octree decomposition technique with a local meshing process at the octant level, the "octree"type methods are probably among the oldest and the simplest methods for surface mesh generation (see [Yerry,Shephard-1984], [Kela-1989] and [Perucchio et al 1989]). For every domain whose surface shall be meshed, a size map is given either known in advance or user-specified (for instance to take into account the curvature of the geometric model). The mesh generation method proceeds in two steps. In a first stage, using a bounding box, a tree is constructed by recursive subdivision such that all the model entities are present at the octant level ([Shephard,Georges-1991]). At every boundary octant level the vertices, edges and faces of the mesh are successively created (to maintain a valid representation) after analyzing the intersection of the model with the current octant. The part of the model surface intersected by an octant is explicitely known using an interface with the geometric modeler supporting the domain representation. The pattern analysis as well as the neighborhood analysis corresponding to these intersections enable us to achieve the surface mesh at the octant level. The resulting surface mesh is then the union of all these local meshes. A common feature of all these techniques is that every entity resulting from the interaction of the domain boundary with an octant boundary is present in the final mesh. In some cases, this feature may lead to ill-shaped elements. Thus, mesh optimization algorithms are needed.
6.6. NOTES
193
We think that such a method (i.e., a tree-dependent method) is rather difficlut to use if anisotropic meshes are desired. Voxel approach. This approach follows the same idea as the octree method but differs in the way the model is described ([Lorensen,Cline-1987], [Frey-1993], [Frey et al 1994]). The method consists of triangulating an implicit surface (thus, a parametric surface) using a tetrahedral or hexahedral partitioning of the domain. From every cell of this partitioning is extracted a set effaces resulting in an iso-surface (via a "marching-cube" algorithm). Advancing-front approach. Using an advancing-front method in twodimensions ([A.George-1971]) in the case of surface meshing has been investigated in several papers ([Lo-1985], [Marcum-1996], [Rypl,Krysl-1994] and, [M611er,Hansbo-1995]). The optimal points constructed from the edges in the current front are located on the surface mesh and then their locations can be corrected according to the curvature of the real surface. The merging (or shocks) between two fronts are dealt with using the geometry.
This page intentionally left blank
Chapter 7
Meshing in three dimensions 7.1
Introduction
We consider R3 space and assume that a given domain, Q, is known through its boundary discretization. This discretization is a list of faces (assumed to be triangular) defining a constraint (according to Chapter 3). The problem is to construct a mesh of ft using only this input data. In fact, the resulting mesh will be a mesh of the polyhedral approximation of Q defined by the given discretization. This mesh is expected to be well-suited for the expected application (e.g., for finite element computations). From a practical point of view, the data may include faces other than the boundary faces and, in addition, it may contain specified edges or points. The given internal faces and edges are added to the boundary faces and edges so as to define the actual constraint. On one hand, the specified points enrich the list of points formed by the endpoints of all the given faces and edges, meaning that after the point insertion process, the specified points will be mesh vertices without any special treatment. On the other hand, internal faces or edges will require a specific treatment. This chapter follows exactly the same framework as that in Chapter 5. Similarly several situations are discussed, leading to different ways of considering the mesh generation problem. In the first case, the so-called classical case, the sole data available is formed by the constrained faces and edges (specifically, the faces and edges defining the domain boundary) and, if any, some additional internal points. The second case, also called the governed isotropic case corresponds to the data of a size map defined everywhere in the domain that completes the previous type of (classical) data. This size specification is a way to define the desired size of the elements to be created. The last case, also referred to as the anisotropic case,
196
CHAPTER 7. MESHING IN THREE DIMENSIONS
assumes that a similar map is specified, including both size and directional information. In any case, the mesh generation methods will follow the same scheme as in two dimensions and thus include an initial creation stage resulting in a mesh without internal points1. A major difference with the two dimensional case is that the above mesh may be not an empty mesh in some cases, as will be seen. Nevertheless, for sake of simplicity, such a mesh is also referred to as the empty mesh. It can be achieved using the results and algorithms discussed in Chapters 2 and 3. Afterwards, the methods differ in the way the required internal points are created. These steps constitute the main issues discussed in this chapter. As mentioned previously, this chapter follows in principle the same discussion as that used for the two-dimensional case. This is essentially due to the fact that the internal point creation methods, used in two dimensions, also apply in three dimensions without major changes. This is a feature which shows a posteriori the power of these methods, specifically the edge support method applies in any dimension. Despite the similarity between this chapter and Chapter 5, we will give a description which is detailed enough so as to permit an independent reading. Nevertheless, less detail will be given, except in the case where are conceptual differences between two and three dimensions.
7.2
The empty mesh construction
Let us recall the definition of the so-called empty mesh. Definition 5.1. The empty mesh of a given domain fi is a mesh whose vertices are the sole boundary points of this domain. From a practical point of view, in three dimensions, Theorem 3.1 (Chapter 3) does not apply. In other words, polyhedra exist with a valid boundary (in particular, a non crossed boundary) for which it is not possible to construct a mesh without introducing a few internal points, also called Steiner points. An example of such points is made clear in the simple configuration in Figure 3.11, where it is not possible to construct three tetrahedra with positive volume lying on the given boundary faces. Nevertheless, assuming that such impeding configurations can be successfully dealt with, it is possible to obtain a mesh of the given domain. 1
Apart the specified points, if any.
7.2. THE EMPTY MESH CONSTRUCTION
197
Since, except for the eventual specified points and the Steiner points required to achieve it, this mesh does not include any internal points, it is not generally well-suited for computational purposes. Nevertheless, this is the first mesh we can construct to cover the domain. In addition, this mesh will be used to identify this domain. Moreover, the empty mesh can serve as a geometric background, at the time the required field points will be created.
Bounding box construction. The construction of a box enclosing all the points known at this stage (basically the boundary points of the domain under consideration) is made for sake of simplicity. This trick does not limit the range of applications of the mesh generation method. Using the enclosing box, the reduced incremental method can be used, as seen in Chapter 2. The bounding box is defined according to the extrema of the given point coordinates. For instance, it can be chosen as a cuboid or a rectangular parallelepiped such that it encloses these extrema. The bounding box is then divided into five (or six) tetrahedra, the resulting mesh being the mesh denoted by TO (one may notice, as in two dimensions, that a few points can be added to this box. While optional, it can improve the efficiency of the method.
Inserting the boundary points. The boundary points (actually, all the points known at this stage) are inserted in To by means of the reduced Delaunay kernel (used in its constrained extension, cf. Chapter 3) Ti+i = Ti - Cp + Bp where P denotes the i + 1st point (i.e. -P;+i) of the set of known points (i = 0,1,2,...), Cp is the cavity associated with P, and Bp is the ball of P. Upon completion of these insertions, we have a mesh, TBOXI of the box enclosing the domain, whose element vertices are the P,'s and a few points added to define the box. This mesh complertely fills the box and, therefore, is not a mesh of the domain fi. To obtain a domain mesh, we have to first check that the boundary discretization entities are also mesh entities. Indeed, this is the only way to determine, by adjacency, if a tetrahedron belongs to the domain or its exterior.
198
CHAPTER 7. MESHING IN THREE
DIMENSIONS
Boundary enforcement. In general, the mesh TBOX does not include, in its list of edges and faces, all of the input boundary edges and faces. This means that an edge or a face whose endpoints are mesh vertices is not necessarily present in the current mesh. It should be noted that, in three dimensions, this drawback is encountered almost all the time irrespective of the boundary mesh quality (especially when the domain is not convex). Thus, the materials described in Chapter 3 are used to retrieve at first the missing boundary edges and then the missing faces (and, more generally, all the initial edges and faces, i.e. the boundary edges and faces and the internal edges and faces, if any). Starting from TBOX, we apply local modifications so as to achieve a new mesh TBox including the given boundary discretization2 exactly. After removing the elements exterior to the domain by means of one of several possible algorithms, we obtain the desired empty mesh. Contrary to the two-dimensional case, this empty mesh may include some internal points (i.e. Steiner points introduced so as to successfully recover the missing boundary entities3). Remark. The algorithm for boundary enforcement allows for the detection of some invalid boundary configurations and thus provides a means of verifying that the given boundary discretization is correct. Therefore, overlapping entities, crossing entities and various inconsistencies can be detected. Connected components. As the boundary faces defining the domain have been enforced, it is now possible to define the empty mesh related to this domain. More precisely, we determine the internal tetrahedra and then define the various connected components of the domain. To this end, we return to one of the algorithms used in two dimensions in its extension to the three dimensions 1. Assign the value v = — 1 to all elements of the box mesh, TBox and set c = 0 (c can be thought of a color); 2. Find an element having one vertex identical to one of the box corners and set it to the value v = c; 2
We consider the case where the (boundary) constraint is exactly satisfied, according to Definition 3.2. 3 As a bounding box is used, the problem related to determining the existence of a mesh of the domain whose element vertices are solely the boundary face points is not relevant.
7.3. FIELD POINTS (CREATION)
199
3. Visit the elements by means of face neighborhood relationships: • if the color of the current element is not — 1, GO TO 3 (the element has been colored previously); • else if the face crossed when reaching the current tetrahedron is not a boundary entity, assign the value v = c to this tetrahedron and GO TO 3; • else if the face crossed when reaching the current tetrahedron is a boundary member, GO TO 3; 4. Set c = c+ 1, and GO TO 3 as long as a tetrahedron exists such that u=-l. D Using this algorithm, the tetrahedra are sorted into the various connected components of the domain, c being the component number. The tetrahedra with color 0 are outside the domain, it is thus possible to remove them. Nevertheless, this operation is not completed at this time in order to preserve a convex background allowing us to maintain, as in two dimensions, a simple context for the field point creation. Remark. As in two dimensions, the analysis of the colors enables the detection of some improperly defined configurations (like a boundary with a hole in it).
7.3
Field points (creation)
Due to element quality concerns, it is generally necessary to insert points inside the domain, especially for finite element computations. Numerous methods to perform this step are feasible, just as in two dimensions. 7.3.1
Several methods for field points creation
Formally speaking, again we find that some of the methods discussed in two dimensions apply without change to three dimensions while others require some modification to extend them. Tentative list of methods. As mentioned before, numerous methods are suitable for internal point creation. In fact, two questions need to be considered. The first question concerns the field point location and the second question is related to the number of requested points. The principal methods proposed in the literature are based on
200
CHAPTER 7. MESHING IN THREE
DIMENSIONS
• circumcenter creation for every tetrahedron that violates certain criteria related to volume computation, inradius length, aspect ratio (or quality), etc., • centroid creation (weighted or not) for tetrahedra judged too large, • creation of points along the edges of the current mesh, • creation using other meshing techniques, for instance — using an octree4 method. — using an advancing-front method5. — using a given point distribution, which is created by another meshing method. • a creation by by means of a "variogram". For a discussion of this, see Chapter 5 where this method has already been discussed for two dimensions. Thus, the general principle is either to create a point and to insert it immediately by means of the Delaunay method (using the the so-called Delaunay kernel), repeating the process as long as points can be created, or to generate a set of points, to insert them and to iterate the process as long as a non empty set is created. Classical case. The only goal here is to locate the points so as to obtain nearly equilateral elements in the resulting mesh or, at least, elements with the best possible quality. In this context (in three dimensions), all the methods briefly mentioned lead to suitable results at the expense of more or less optimization applied to the mesh resulting from the field point insertion. This feature, typical in three dimensions, is due to the possible creation of tetrahedra whose edges have satisfactory lengths and whose faces enjoy a nice aspect ratio but whose volume can be close to 0. This situation, already mentioned in Chapter 1, implies that the mesh constructed 4
A octree is a data structure based on a recursive subdivision scheme. In this context, this approach consists in constructing a cuboid or a rectangular paraJlelepipedon enclosing the domain. This box forms the parent cell of a recursive subdivision scheme, every current cell in the structure being subdivided into eight similar cells as long as the considered cell contains more than one boundary point. This method results in a set of cells whose size is directly related to the boundary discretization density. 5 An advancing-front technique consists in constructing the "optimal" set of points associated with a current front. The initial front is formed by the boundary faces input as data. Then, the front is updated after each operation.
7.4. CONTROL SPACE
201
from a set of nicely located points is not necessarily a mesh with nicely shaped elements. This points out a difficulty specific to three dimensions which makes point insertion quite different to that of two dimensions. Isotropic case with size prescription. The aim here is to locate the points so that the resulting mesh consists of nearly equilateral tetrahedra (or element with the best possible quality) and, in addition, such that the tetrahedra size is as close as possible to a pre-specified size. For this case, all the above methods are feasible, keeping in mind that elements with degenerated volume may be created. Anisotropic case. The goal here turns to locate the points so that the resulting mesh consists of tetrahedra whose sizes in each directions are as close as possible to the pre-specified data. For this, the method based on edge point creation leads to satisfactory results. The method using an advancing-front approach probably leads to similar results. With regard to the other methods, the question is more difficult than it was in two dimensions and is not yet decided6.
7.4
Control space
The background introduced in two dimensions for the internal point creation stage clearly applies in three dimensions. The notion of a control space appears to be well suited so as to govern this stage. As given in Chapter 5, the control space definition is still valid and we assume in what follows that an "ideal" control space is given (see Chapters 9 and 12 for realistic mesh generation situations).
7.5
Creation along the edges, classical case
In this case, the sole data is the discretization of the domain boundaries. Hence, it means that we don't have an explicitely defined control space. Nevertheless, to return to the general framework, we would like to construct, as best we can, such a control space. To this end, the edges of the current mesh, say the empty mesh, are used. 'Clearly, this advice can be refuted.
202
CHAPTER 7. MESHING IN THREE
Control space.
DIMENSIONS
The control space is then
• A the current mesh, i.e. the initial empty mesh and, in case of iterations, as will be seen later, the mesh corresponding to the previous iteration, along with • H defined by means of a P1 interpolation, using the sizes, denoted as /IJTOC, associated with the points of the domain boundaries, and, furthermore, in an iterative process, by using the hioc assigned to the vertices of A. The initial sizes can be computed by averaging the lengths of the edges emanating from a boundary point or by considering an average of the surface areas of the faces sharing a given vertex. One may observe that it is a tedious task to assign a size for a Steiner point; this is why, in certain cases, these points7 will be ignored meaning that every edge with such points as endpoints will not be considered in the point creation process. After a few iterations through the mesh edges, these artificially rigid edges are usually removed due to the side effect of inserting points along neighboring edges. Point creation. With this control background, we can now develop the point creation method discussed in two dimensions. It is based on edge subdivision and it applies without modification in three dimensions. The current mesh edges (see the remark about the Steiner points) are examined and their lengths are compared with the stepsizes related to their endpoints, hioci and /i/0c2- The objective of the method is to decide if one or more points must be created along each edge. If so then, both the number of required points and their location must be determined. The objective is, on the one hand, to saturate the edge, and on the other hand, to obtain a smooth point distribution. The required algorithm is similar to its two-dimensional counterpart given in Chapter 5. Once all the current mesh edges have been processed, a series of points is obtained, and then filtered, by simply using a grid (cf. Chapter 2). This filtering, as in two dimensions, is needed due to the fact that the vertices are well-positioned along each edge but may be ill-spaced globally. For instance, one may observe the case where all of the edges emanate from a given point. The retained points are then inserted using the Delaunay kernel and the entire process is repeated as long as any mesh edges need to be subdivided. 7
Removing the Steiner points is not always possible. This task can be successful for some cases but, in general, not for all.
7.6. CREATION ALONG THE EDGES, ISOTROPIC CASE
7.6
203
Creation along the edges, isotropic case
We now return to the method described in Chapter 5. Here, the control space is based on a metric map provided as a matrix map, where a matrix is ( a(x,y,z) 0 0 \ M(x,y,z)= 0 a(x,y,z) 0 (7.1) V 0 0 a(ar,y,z)7 or, when a straight line is considered, as supposed in the discussed method
C
a(t) 0
0 a(t)
0
0
0 0
\
(7.2)
a(t) }
with M(t) being the point ( x , y , z ) and t being the parameter. Where, we also ha,ve
with h(t) denoting the expected size at the point with parameter value t. This size is the desired length of all edges emanating from this point. The internal point creation stage is done as it was in two dimensions. The targeted elements are unit length tetrahedra according to the control space meaning that unit length edges are expected in the control space, while edges of length h are locally expected in the usual space. This means that the unit sphere in the control space is the sphere of radius h in the usual space. Hence, the point creation method is done as in two dimensions. The edge lengths are computed and the edges are subdivided, if needed, by creating a number of points equal, as closely as possible, to these lengths — 1. Then the points are located in such a way that the distance between points is at least 1 in the control space.
7.7
Creation along the edges, anisotropic case
Just as with the method described in Chapter 5, the control space is now related to a metric map (or matrix map) whose matrices are of the form
I
a(x,y,z) b(x,y,z) b(x,y,z) d(x,y,z) (ar,y,z) e(ar,y,z)
c(x,y,z) e(x,y,z) \ f(x,y,z)
(7.4)
204
CHAPTER 7. MESHING IN THREE
DIMENSIONS
or, when a straight line is considered, as assumed in the discussed method M(M(t))=
/ a(t) b(t) b(t) d(t)
c(t) \ e(t)
(7.5)
^ c(t) e(t) f(t) ) with M(t) the point (x, y, z] and t being the parameter. The aim, as in two dimensions, is to construct nearly equilateral tetrahedra of unit size (i.e. with unit length edges) according to the metric defined in the control space. In terms of the usual space, it implies that the tetrahedra enjoy a size (h1, h2, h3), i.e., their edges have a length (h1,h2, h3), where hi denotes the desired length in the directions di, i = 1,3. This means, formally speaking, that the unit sphere in the control space is locally the ellipsoid of principal directions (d1,d2,d3) with length h\ mapping to d1, length h-2 following d2 and h3 mapping to d3 in the usual space. The di's, as well as the /i;'s, are the eigen-elements (eigenvalues and eigenvectors) of the matrix A4. Again, the point creation method is done as it was in two dimensions. The edge lengths are computed and the edges are subdivided as needed by creating a number of points equal, as closely as possible, to these lengths — 1. Then the points are located in such a way that the distance between points is at least 1 in the control space.
7.8
Advancing-front type creation
The method, introduced in Chapter 5, combining the advancing-front point placement strategy and the Delaunay approach to connect them, can be extended to three dimensions, provided that some modifications are made. Control space. The control space is similar to that of the previous case • A is the current mesh, the initial empty mesh or, in case of an iterative scheme (as will be seen), the mesh corresponding to the previous iteration, • H is defined by means of a Pl interpolation, starting from the sizes associated with the boundary points, hioc, and then from the h\oc assigned to the vertices of A. The initial sizes are computed as the average of the lengths of the edges emanating from a boundary point (different methods can be used to evaluate these quantities, for instance, by considering the surface areas of the faces sharing the boundary point under examination).
7.8. ADVANCING-FRONT TYPE CREATION
205
Point creation. Given this control background, we introduce a point creation method based on an advancing-front point-placement strategy. The front represents the interface between an "acceptable" element and an "unacceptable" element with respect to a quality measure. Starting from the empty mesh, a list of tetrahedra is determined based on the intrinsic properties of the elements (in-radius). Thus, the tetrahedra are divided in suitable tetrahedra (i.e. having a size conforming the control space) and tetrahedra that must be processed. By default, every tetrahedron exterior to the domain is classified as suitable. The active tetrahedra, neighbors to the suitable tetrahedra, are those where a point can be created. The interface between the retained elements and the elements that must be processed is a set of triangular faces defining a front which form the basis for the internal point creation. The points to be inserted are located for a given front face so as to permit the construction of an optimal tetrahedron, according to the control space. The set of the so-created points is filtered resulting in a set of points that must be effectively inserted. The goal is to discard all points that dont result in mesh improvement. To complete this task, we shall use the circumspheres of the elements within which the points fall. If the visited point is interior to such a sphere, it is retained, otherwise it is removed from the list (in fact, inserting a point in this situation by a Delaunay method does not result in including this element in the corresponding cavity).
Figure 7.1: Retained point.
Figure 7.2: Rejected point.
The set of retained points at this step is then globally filtered so as to discard any point too close to an already existing point coming from the
206
CHAPTER 7. MESHING IN THREE
DIMENSIONS
analysis of a neighbouring face. The Figures 7.3 and 7.4, respectively, show the initial front and the front after the fourth iteration of this mesh generation process. The example depicted is the domain exterior to an airplane (courtesy of DA).
Figure 7.3: Initial front.
Figure 7.4: Front after 4 iterations.
The proposed algorithm, including some control processes, as presented in [Frey et al. 1996], converges and produces good quality isotropic meshes (without requiring any optimization process).
7.9
Field points (insertion)
Any point construction method can be used to create a set of points. These points can be then inserted by means of the adequate Delaunay kernel. • In a classical context, we consider the constrained Delaunay kernel as described in Chapters 2 and 3. • For the governed isotropic case, the same kernel is well-suited. • For the anisotropic case, one must consider one of the constrained Delaunay kernels described in Chapter 4. The point insertion process is completed in successive waves. The first wave results from the empty mesh edge analysis (edge method) or from the empty mesh front analysis (advancing-front method). The following waves correspond to the analysis of the edges of the previous mesh or to that of the front associated with the current mesh. This front is the interface between
7.10. SPECIFIED INTERNAL EDGES AND FACES
207
the suitable elements and the active elements, which are the candidate elements for point placement.
7.10
Specified internal edges and faces
Once the empty mesh is constructed, the set of specified edges and faces (i.e. the boundary discretization (notice that a boundary edge is necessarily a boundary face edge) as well as the internal edges and faces, if any) exist as mesh entities. When using the point insertion process, it is possible to remove, unless specific attention is paid to them, one or more specified internal edges or faces. This happens in three dimensions, but is not a problem property in two dimensions. This is due to the way in which the cavities are defined, these cavities being the support of the point insertion. Indeed, as discussed in Chapter 2, the cavities are constructed by adjacency starting from the base. As such, it is impossible to flip an edge in two dimensions (every edge inside a cavity separates it into two parts with a disjoint interior). However, in three dimensions, it is common to flip a specified internal edge or face8. In such cases, even the constrained version of the Delaunay kernel does not avoid this drawback. In fact, a specified internal face can be an internal face of the cavity while never being explicitely crossed when visiting the elements by adjacency. As a result, an internal edge or face existing at some step of the process (for instance, after enforcing the constraints) can be removed when inserting a point in some neighborhood. Thus, the resulting mesh will no longer satisfy the initial constraint. There are several ways to solve this problem. One solution consists of explicitely checking if any specified internal edge or face may be removed when a point is proposed for insertion. That is a constraint that must be added in the cavity construction so as to avoid this problem.
7.11
Optimization
In three dimensions, as will be detailed in Chapter 8, there are several mesh optimization operators. In fact, one can • remove a free face9, 8
While it is not possible to turn around a boundary face since the boundary has been enforced (otherwise, it means that the boundary is not a closed boundary). 9 cf. supra about this notion of a free point, edge or face.
208
CHAPTER 7. MESHING IN THREE
DIMENSIONS
• remove a free edge by means of shell modifications, • collapse an edge by merging its two endpoints (when it is topologically valid), • move a free vertex, • remove a free vertex. In our experience, mesh optimization is very useful in the classical meshing case. In fact, the purpose is, in this case, to obtain a mesh with a nice quality (in terms of the element aspect ratio, see Chapter 8) and while the two point creation methods discussed in this chapter result in a good pointplacement, their insertion may lead to rather poor connections resulting in poor-shaped elements. In the governed isotropic case as well as in the anisotropic case, some extent of mesh optimization proved to be useful to achieve a certain level of improvement. Specifically, the few "ill-shaped" elements that are constructed anyway, are widely improved or are removed. In addition, even the nicely shaped elements are globally improved. One may notice that, in these cases, the mesh optimization is governed by the quality based on the provided metric map (for more details, refer to Chapter 8).
7.12
General scheme of the mesh generator
In this section, we collect the materials discussed throughout this chapter so as to propose a general scheme for a mesh generation method. Seven steps can be identified as follows. • Preparation step. — Data input: point coordinates, boundary faces as well as internal faces and edges (if any), - Construction of the bounding box, — Meshing of this box with a few tetrahedra. • Construction of the box mesh. - Insertion of the given boundary and specified internal points in the box mesh using the Delaunay kernel. • Construction of the empty mesh.
7.13. ABOUT SOME RESULTS
209
— Search for the missing specified edges, — Enforcement of these edges, - Search for the missing specified faces, — Enforcement of these faces, - Definition of the connected components of the domain. • Internal point creation and insertion - Control space definition, - (1) Internal edge analysis, point creation along these edges. — Point insertion via the Delaunay kernel and return to (1). • Domain definition. — Removal of the elements exterior to the domain, — Classification of the elements with respect to the connected components. • Optimization. — local modification, — point relocation, ... • File output. When using the advancing-front approach described in this chapter, one has to replace the step denoted by (1) of the general scheme. The analysis of the edges of the current mesh is then replaced by the front analysis. It is possible to develop a somewhat different scheme as proposed by other authors. One is referred to the remarks given in the two-dimensional discussion in Chapter 2..
7.13
About some results
Here we will present four classical mesh examples for three-dimensional domains. The mesh generation process is based on the edge method. The input data is simply the discretization of the domain boundary. The goal is to obtain, on the one hand, a maximum number of good elements, i.e. with a quality as close as possible to 1 and, on the other hand, to have the worst elements having a quality as close as possible to a target value
CHAPTER 7. MESHING IN THREE
210
DIMENSIONS
imposed by the worst data faces (while checking that the worst elements have these faces as entities). We present examples that were previously (partially) dealt with. The examples include the domain enclosed in the box of Figure 2.15 as first example. The next examples (2, 3 and 4) correspond to Figures 3.27, 3.28 and 3.29, to which the reader is referred to have a feeling of the geometries. The statistics related to these examples are reported in Table 7.1 where the following values are reported • ne, the number of tetrahedra, • np, the number of vertices, • target, the quality target value (cf. Chapters 1 and 8) which is that of the best tetrahedron that can be constructed using the worst input face, I the global quality of the mesh, i.e. that of its worst element (to be compared with the value target], • 1 — 2, the percentage of elements that are well-shaped (i.e those whose the quality values range between 1 and 2), • t, the required CPU time (in seconds using a HP 9000/735) for the mesh generation (including i/o).
case 1 case 2 case 3 case 4
ne 286
2,658 7,230 369,304
np 105 880 1,917
62,495
target 7.38 6.01 10.24 38.06
QM 9.61 7.05 11.65 42.06
1-2 66 78 76 91
t 0.36 1.19 2.75 53.30
see the figure 2.15 or 2.17 3.27 3.28 3.29
Table 7.1 : Statistics related to the four classical examples (isotropic mesh constructed using only the boundary discretization of the domain as input). These results demonstrate several characteristics of the meshes. First, is indeed close to the target. Second, the proportion of nicely shaped elements increases with the domain size. Finally, the meshing time per element created decreases for larger domains. This is because the proportion of the pure triangulation stage of the algorithm as compared with the other stages (boundary integrity recovering, internal point construction, and so on) increases for larger meshes.
7.13. ABOUT SOME RESULTS
211
To more clearly appreciate the efficiency of the mesh generation algorithm, we also give Table 7.2, in which v is the number of elements constructed per minute, for six examples10 with different sizes. Moreover, we denote by Del the percentage, of the mesh generation time devoted solely to the triangulation process (the point insertion).
Example Example Example Example
1 2 3 4
-
Example 5 Example 6
np 1,014 36,252 62,495 214,184 np 518,759 1,452,192
ne t ( sec., HP 9000/735) 1.54 3,601 191,279 28.26 369,304 53.30 1,243,871 179. ne t ( sec., HP PA 8000) 373.62 3,067,937 8,700,574 1125.
Table 7.2: Mesh generation algorithm
V
140,000 406,000 415,000 417,000 V
492,000 464,000
Del 17 49 44 46 Del 54 49
efficiency.
One may observe that v is linearly proportional to Del and, as previously mentioned, v is less important for small meshes than for large ones. It should also be noted that the efficiency of the mesh generation method is about three times less important than the efficiency of a triangulation method (as seen in Chapter 2). For the isotropic case with size control and the purely anisotropic case, we don't have, at this time, anything other than academic examples where the geometries are quite simple (sphere, cuboid). Thus we don't give any concrete examples related to these mesh generation situations. The examples depicted in Figure 7.5 and in the following figures show a simple sphere. Figure 7.5 shows a cut of the classical mesh obtained using only the uniform mesh of the domain boundary as input. Figures 7.6 and 7.7 show, by means of a cut again, the mesh resulting from a given size specification. In the first case, the sizes vary linearily from the centroid to the boundary with a repulsive effect of the centroid of the sphere. Conversely, the other figure corresponds to the same kind of data where an attractive effect at the centroid. Table 7.3 reports the statistics related to these two examples of controlled meshing. 10
The last two examples have been run using a different computer due to memory resource considerations.
212
CHAPTER 7. MESHING IN THREE
DIMENSIONS
Figure 7.5: A classical mesh without any specific control (cut). As the boundary is uniformity meshed, the expected mesh must be as uniform as possible. This mesh includes 11,957points and 65,257 elements.
213
7.14. NOTES
Figure 7.6: Size control (repulsion Figure 7.7: Size control (attraction towards the centroid). towards the centroid).
-
ne
np
case 1 65,257 11,957 case 2 11,681 2,991 case 3 227,883 39,019
target 1.13 1.13 1.13
QM 2.71 2.32 2.70
1-2 99 93 99
see Figure 7.5 7.6 7.7
Table 7.3 : Statistics related to three examples of isotropic meshes without size control (case 1) or with size control (cases 2 and 3).
7.14
Notes
Periodic mesh. Periodic mesh construction is required for numerical simulations for some specific problems. The periodic nature is either related to both the equations that must be solved and the geometry acting as computational support or it is only related to the geometry. Medial surface. Given an empty Delaunay mesh of a domain in .R3, it is possible to compute its medial surface. This surface is the locus of
214
CHAPTER 7. MESHING IN THREE
DIMENSIONS
the centers of the spheres of maximal radius inscribed in the domain; this surface is also referred to as the skeleton of the domain. A description of a method for medial surface construction can be found in Chapter 13 along with some applications for such constructions.
Chapter 8
Optimizations 8.1
Introduction
The quality of a finite element solution is strongly related to the quality of the underlying mesh. Mesh optimization can be characterized in two ways, either as part of a mesh generation algorithm (see the previous chapters) or as an a posteriori process (applied to a mesh resulting from a given construction method). Irrespective of the characterization, optimization techniques rely on some basic operators. Mesh optimization is governed by a notion of quality, which is based on the context (isotropic or anisotropic) and on the problem requirements. The purpose of this chapter is to define the notion of quality and to introduce the various optimization algorithms that can be used for triangular or tetrahedral meshes. The topological operators, which act on the vertex connections, and the geometric operators which act on the vertex locations will be described. One may notice that most of the operators have a local effect and therefore defining a global mesh optimization method is a rather cumbersome task, both for strategy and efficiency reasons.
8.2
Mesh quality
In Chapter 1, the notion of mesh quality based on element quality, was introduced. Based solely on geometric criteria, this measure only quantifies the element shapes. These results will be reviewed and the notion of quality will be extended to various pertinent situations encountered in finite element simulations.
216 8.2.1
CHAPTERS.
OPTIMIZATIONS
Shape and size qualities
Isotropic case, aspect ratio. The value1
Let K be an element in a given mesh M.
QK = a
max
PK
(81) (8.1)
where a is a normalization factor, hmax is the element diameter2 and px is the inradius (the radius of the in-circle (or the in-sphere) related to the element), represents a measure of the element aspect ratio (cf. Chapter 1) and is called the element shape quality. The quality of a set of elements, E, is defined as that of its worst element. This quantity, QE, is defined by QE = maxQtf .
(8.2)
t\ t-C*
The shape quality, Qp, of a point P is measured through the quality of the elements forming its ball Bp as QP = max QK.
(8.3)
Similarly, the shape quality, Qa, of a given edge a is that of its shell. Finally, the quality of a mesh, 7/n is defined as QM = max QK.
(8.4)
In this context, the sole purpose of an optimization process is to minimize the quality of the elements and, specifically, the value QM- To this end, one has to locally improve the values of the Qp's so as to improve the values Qa, QE and finally, QMIsotropic case, element size. Provided a size map given everywhere in the space, this map specifies the desired size expected in the vicinity of a point. In other words, this map indicates the desired lengths of the edges sharing this point. Let a be a given edge. We denote by la its current J The inverse of this quantity is also used, its range of variation being the interval [0,1]. The aim is then to maximize the quality. The worst element in a given set of elements is the element whose quality is the closest to 0. We would prefer to use the quality expressed in the Relation 8.1, as the variation ranges from one to infinity, thus having a larger amplitude of variation (instead of the above interval [0,1]). In this way, a fast discrimination of the elements is made possible. 2 The diameter of a simplicial element is the longest edge length.
8.2. MESH QUALITY
217
length and by ha its desired length as specified by the size map. Then the size quality of edge a is defined by Oi = max (£-, M \«a
(8.5)
'a/
and consequently the mesh size quality is, as in the above case, the quality value associated with the worst edge in the mesh. According to this definition, the size quality ranges from 1 to infinity. The objective is ultimately to minimize QM (the mesh shape quality), while conforming to the required size quality for the mesh edges. To this end, it is sufficient to minimize Q'a, i.e., to ensure that this value tends towards 1 for all of the edges in the mesh, while preserving an acceptable shape quality. In this way, a control for the element size is obtained by means of the edge length control. This control clearly induces the grading variations over the mesh elements. It may be observed that a triangle having three approximately unit length edges is necessarily a well-shaped element (in terms of aspect ratio) . However, this does not apply for a tetrahedron. In other words, optimizing the edge lengths in three dimensions may not result in a mesh where the elements are well-shaped. To retrieve such a mesh, two solutions can be used • successively apply a size optimization and a shape optimization (and iterate) , • define as a quality function a function controlling both the size and the aspect ratio (cf. hereafter). Anisotropic case. Let us consider a metric map given everywhere in the space. This map induces the classical shape quality relation /-\ QK = aPK
10max
(86)
(8.6)
held in an Euclidean space to be replaced by a similar relation in the Riemannian case. As seen in Chapter 4, only an approximation can be developed to handle this notion. Let us consider the two-dimensional case. Let K be a triangle and let PI, PI and P3 be its vertices. The shape quality of K can then be defined as QK = max . Qfc
(8.7)
218
CHAPTERS.
OPTIMIZATIONS
where Q1K is the triangle quality in Euclidean space related to the metric specified at any vertex Pi of K. To evaluate the quality Q1K of A', one just has to transform the Euclidean space associated with the metric specified at any vertex Pi to classical Euclidean space and then consider the quality of the triangle Ki (which is the triangle image of K). This means that
(8-8)
3 and depicted in Figure 8.2. It allows us to replace the two initial elements with three tetrahedra.
Figure 8.2: Transformation Tr2_>3. The reverse operator seems to be that illustrated in Figure 8.3 which replaces three elements with two elements and is denoted by Tr3_).28- Actually, this operator is only a special case of a more general operator that consists of remeshing a shell made of an arbitrary number of elements by removing its defining edge. For instance, for a four element shell, the related operator Tr^^ is depicted on Figure 8.4. Formally speaking, this kind of operators considers all of the possible triangulations for a pseudo-polygon. The vertices of this polygon are defined by the shell vertices other than a and /?, the two endpoints of the edge defining the shell. Figure 8.5 shows the possible retriangulations for the case of a five element shell, where every triangulation is created by joining all the triangles of the polygon with both a and (3 (so as to define the pair of tetrahedra part of the sought triangulation). The Catalan number of order n
Cat(n) = 8
(2n-2)! n\(n- 1)!
One may notice that this operation is not always possible. For instance, the case where the two vertices of the defining edge are not in the same half-plane related to the triangle associated with the other three vertices of the shell is a typical example of an invalid triangulation. Such a shell is called a firtree ("sapin" in french). This type of configuration may exist for a shell with an arbitrary number of elements.
8.3. TOPOLOGICAL OPERATORS
Figure 8.3: Transformation
Figure 8.4: Transformation
225
226
CHAPTERS.
OPTIMIZATIONS
Figure 8.5: The 5 triangulations related to a 5 points polygon. gives the maximal number of topologically possible triangulations, JVn, of a shell9 of n elements. Indeed, we have Nn = Cat(n - 1)
n Nn
Trn
11 12 3 4 5 6 7 9 8 10 13 1 2 5 14 42 132 429 1,430 4,862 16,796 58,786 1 4 10 20 35 56 84 165 120 220 Table 8.1: Number of topologically valid triangulations.
Table 8.1 reports Nn, the number of possible triangulations as a function of n. It also indicates Trn the number of different triangles in each possible triangulation. In this enumeration, the validity of the triangulations is not considered (only the topological aspect is taken into account). Exercise 8.6. Show that the maximum number of possible triangulations for a shell with n (n > 3) elements verifies the relation
9
The topologically possible solutions in three dimensions are constructed by enumerating all the two-dimensional geometrically valid retriangulations of a convex (planar) polygon with n vertices.
8.3. TOPOLOGICAL OPERATORS
227
with A^2 = 1 and thus reduce it to the Catalan number. To conclude this section, the operator acting on a shell based on the retriangulation of its outer polygon is a powerful and inexpensive basic operator for tetrahedral mesh transformation.
8.3.4
Entity suppression by local remeshing
Edge removal in two dimensions. A simple edge swap results in an edge removal (see also, hereafter, edge removal by reduction). This operation is valid if the polygon made up of two triangles sharing the edge is convex. Edge removal in three dimensions. This is a different way to view the shell transformation operator described previously (Again, this operation is valid if the polyhedron is convex, otherwise, it may be invalid). Vertex suppression in two dimensions. The main idea is to consider the ball associated with the vertex under consideration as a cavity. Then a triangulation algorithm without internal point creation is applied to this cavity. One may also (as explained later) apply edge swap(s) so as to obtain a ball having only three triangles (or four triangles in a degenerated configuration) as shown in Figure 8.7. Vertex suppression in three dimensions. First of all, this operation is not always possible, with the Schonhart polyhedron as an example. Nevertheless, the key-idea is, as before, to process the ball of the point so as to reduce its number of elements to four (except for degenerated configurations) .
8.3.5
Suppression by means of reduction
Removing a free edge or a free vertex in a triangulation can also be done by means of a reduction. In the case of an edge, this process consists of replacing this edge with only one point connected to all the vertices formerly connected to the initial edge. In the vertex case, two methods can be considered, either a ball retriangulation or an adequate application of edge swaps.
CHAPTERS.
228
OPTIMIZATIONS
Edge suppression. Let us consider an edge, aft. We replace this edge with only one point A. Formally speaking, this results in locating a on /?, ft on a or again locating the merged vertex between a and j3. Figure 8.6 shows the three possible solutions for this example. From a practical point of view, it is sufficient to check if the ball of point A, resulting from the reduction, is valid. To this end, we examine the shell aft and we check the validity of the balls of a and ft when these two vertices are replaced by the point A. This operator may be classified as a geometric operator since it maintains the connectivities. That is the new connections to A can be seen as the "union" of the former connections to a and ft.
Figure 8.6: Edge removal by reduction.
Vertex suppression. Obviously, a vertex whose ball is composed of d-\-l elements (d being the spatial dimension) can be removed by replacing these elements with only one element. In general, the vertex degree (see above) is greater than d-\-1. Thus, edge swaps (in two dimensions) or shell transformations applied to the edges emanating from this vertex (Figure 8.7) can be used to reduce to this case. A different method which is more robust10 in practice, is .to consider 10
I.e. successful in most of the situations.
8.3. TOPOLOGICAL OPERATORS
229
all the edges emanating from this vertex and to apply to one of the edges (for instance to the shortest edge) the edge reduction process previously described.
Figure 8.7: Removing a vertex A by modifying its ball. Notice that a vertex removal is always possible in two dimensions while not always being so in three dimensions. 8.3.6
Edge splitting
Splitting a free mesh edge aft consists of creating a point, P, along this edge and of replacing the original edge by the two edges aP and P/3. Hence, edge splitting, in two dimensions, reduces in replacing the two initial triangles, sharing edge a/3, with four triangles. In three dimensions, we have the same effect on the initial shell which is then replaced by the shells of the two edges aP and Pfi. 8.3.7
Valance relaxation
Definition 8.1 The valance of a mesh vertex is the number of edges11 emanating from this point. d For a two-dimensional isotropic mesh, a valance of six is an optimal value. A vertex with valance lesser than six is said to be under-connected, while a vertex with valance larger than six is said to be over-connected. 11
It is also, in two dimensions, the number of elements sharing the point.
230
CHAPTERS.
OPTIMIZATIONS
Relaxing the valance of a two-dimensional mesh consists in modifying the vertex valances, by means of topological operators, so as to tend towards a value of six in average, see [Frey,Field-1991]. In three dimensions, the targeted value is 12, due to the fact that a ball with 20 optimal elements corresponds to the triangulation by a regular icosahedron of the space centered at the point defining this ball. A similar notion applies to shells (in three dimensions), the valance of a shell (the number of its elements) can be relaxed. The ideal value12 is 6, while a shell with a lower valance is said to be under-connected, while a shell with a larger value is said to be over-connected.
8.4
Geometric operators
A geometric operator preserves the mesh connectivities. Thus, such operators basically modify the point locations. Several methods may be used to perform this type of operation, by means of a local or a global approach and by considering different types of constraints.
8.4.1
Local geometric operator
Local geometric operators modify the location of the mesh points so as to optimize a given criterion. The proposed process is iterative and results in each free vertex being processed, one at a time, so as to finally relocate all of them. So, we consider a vertex P and its ball Bp. We then construct, using any method, an "optimal" point denoted by P*. Irrespective of the method used, a sub-relaxation is introduced, governed by a parameter u; which ranges from 0 to 1. This process enables us to define a new point P as P= (l-u)P + uP* .
(8.13)
The point P is then replaced by P if the quality of B-p is improved as compared with that of Bp. Afterwards, the process is repeated. The relaxation is a good way to keep P in the kernel of Bp . Different methods are possible related to a given choice for defining the "optimal" point P*. The possible choices are now discussed. In what follows, we denote by n the number of elements in the ball of the point P under consideration. 2
A value like 5 may also be a suitable objective.
8.4. GEOMETRIC OPERATORS
231
Classical barycentric smoothing.
Let Pj be the vertices of Bp, other n
than P. The method consists in minimizing ^ ||PP,-||2 with respect to P. 3=1 This results in the definition of P* as (8.14) or
This operation minimizes the gap between the lengths of the edges emanating from P, it is well-known as Laplacian smoothing and presents an analogy with elasticity problems (such as a set of springs). The efficiency of this process holds when there are no size constraints (or, more generally, no metric constraints) that must be honored. A mechanical application without an explicit surface area check (volume check in three dimensions) leads to a valid mesh, as every ball is convex. Conversely, for a non-convex ball, such explicit checks are strictly required.
Weighted barycentric smoothing. The relation .£ J. Numerous choices of the weight coefficients are possible. For instance, if a size I _ is specified, one can define aj — ^, where hj is the average of the expected h i sizes at point P and at point Pj. Exercise 8.7.
Justify the choice of aj described above.
Exercise 8.8. Consider the case where a metric is specified everywhere and find the corresponding «j's.
232
CHAPTERS.
OPTIMIZATIONS
Isotropic and anisotropic optimal shape relocation. As opposed to the previous cases, we now use points other than the vertices of the ball Bp to define the optimal point P*. Let the /j's be the external edges (faces in three dimensions) of Bp and let the Kj's be the elements of this ball formed by the /j's and P. Let Ij be the "ideal" location with respect to the external edge j of Bp in two dimensions, and, in three dimensions, with respect to the external face j. The above location is said to be ideal as it ensures an optimal quality for the element defined by fj and Ij. Then, the proposed method consists of defining P* by, cf. [Briere,George-1995], n V*
T
P* = i=±
.
(8.17)
£ °i
Several different choices for the coefficients aj are possible in a scheme of this type, among which, the following can be considered • aj = 1, the weights are constant and it reduces to the classical barycentric smoothing method, • aj; = 0, for every element of the ball except for the worst one (in terms of quality) for which we set aj = 1, • aj = QK}I i-6., the weight is related to the quality of element A'j, • aj = Q?K ; the weights are related to the square of the element qualities, • or, more generally, aj — g(QKj), meaning that the weights are related to a certain function g of the quality of the elements in Bp. This method can be applied to an anisotropic case by using a relevant definition of quality, each of which result in locating the points Ij differently. Isotropic optimal size relocation. In this case, we also used points other than those of the ball Bp to define the optimal point P*. The main idea of the point moving method is based on the length of the edges emanating from the point. The edge lengths are evaluated in an average metric related to the sizes specified at the edge endpoints. The process consists of trying to obtain a unit length (for the considered metric) for all of the
8.4. GEOMETRIC OPERATORS
233
affected edges. Thus, the new locations, Pj, are defined by
Pj = Pj + -3=r-hj
(8.18)
where hj is the average size associated with edge PjP and the optimal point P* is the barycenter of the points Pj . Anisotropic optimal size relocation. The same method can also be applied in this case by generalizing the definition of Pj. We take
where /A/I (Pj, P) is the length of the edge PjP evaluated in the metric A1 associated with the edge. The lengths are then measured in the metric associated with the anisotropic control space and the point relocation trys to obtain unit length edges for all the edges emanating from the point. One may observe that this formula is more general than the previous one (isotropic case) where the length of the edge PjP in the specified metric has been approximated by a more simple expression, i.e. (8.20) Relocation by local remeshing. We consider the ball of the points to be moved. Any mesh generation method is applied to the polygon (polyhedron) which would have resulted in creating a new point in the ball (for instance, an advancing-front method, cf. [Rassineux-1995]). The so-created point is then considered as the new location of the initial point. Actually, this method is a different way of expressing the same previous method. Relocation subjected to topological constraints. to relocate a vertex and, in addition, to • move it away from a given edge, • move it away from a given plane, • move it along a given edge,
The objective is
234
CHAPTERS.
OPTIMIZATIONS
• etc.
Any method of the above type can be used by adding the constraint during the analyzis of the criterion that must be optimized.
8.4.2
Global geometric operators
All of the previous geometric operators are local, but a global approach can be also envisioned, at least formally speaking. The idea is to solve a global system over the entire mesh. In this respect, one can imagine a spring analogy, the mesh edges are replaced by springs and the resulting system is brought to equilibrium. The general principle is to define a cost function and to optimize it, for instance by means of a gradient method, cf. [Kohli,Carey-1993] among other references. Another type of global system can be developed considering quantities related to various types of energies (where one analogy could be based on solid mechanics problems). An example of such a construction is proposed by [Jacquotte-1992] for which the distortion of the elements with respect to an optimal element is considered. A cost function is then defined that can be interpreted in terms of a non-linear elasticity problem.
8.5
Remarks on surface optimization
We consider a surface mesh composed of triangles only. Any purely twodimensional optimization method can be applied while checking that the initial geometry is preserved. The two main tools for surface optimization are point relocation and edge swapping. Point relocation. Moving a free point must ensure that the new location remains on the surface and that the new triangles remain close to this surface (at least as close as before the optimization). A (free) point lying on a first order discontinuity (a ridge), must remain on this discontinuity. Edge swapping. Similarly, edge swapping must be controlled so as to avoid the situation depicted in Figure 8.8. A topological particularity related to the swap of a surface edge occurs when the ball associated with one of the endpoints of the candidate edge consists of only three elements. Actually, in the initial configuration of
8.6. ALGORITHMIC
ASPECTS
235
Figure 8.8: Edge swapping on a surface mesh. Figure 8.9, the edge P^P^ exists as entity in the triangle P\P^P^ and swapping the edge in the triangles P\P^P^ and P\P^P^ results in constructing the edge PS/^, thus resulting in an invalid topology. Although this configuration is a simple example, more complex configurations may obviously result in the same pathology. Thus, in general, before performing an edge swap, it is necessary to check that the resulting edge does not already exist in the initial mesh. Once the validity of the operation is established, one must ensure that the quality has improved in the resulting mesh (with regard to the given criterion). To this end, one may use the usual quality measure or, by analogy to the Delaunay criterion (cf. Chapter 1), one may base the decision on the angles formed by the triangle edges. The configurations composed of two adjacent triangles are analyzed by evaluating the six possible angles and, a swap is applied if the smallest angle of the new configuration is larger than that of the initial pattern.
8.6
Algorithmic aspects
At this time, we have defined a toolbox of (local) operators that must be adequately used so as to obtain the desired result, i.e., the optimization of a given mesh. An operator will be considered as successful if, on the one hand, the resulting mesh is still valid and, on the other hand, the mesh quality is improved. We will now discuss a way to control this mesh improvement; the notions of quality associated with a mesh will also again be visited. In this respect, we shall discuss mesh quality, in terms of the quality of a set of elements as well as that of any given element.
236
CHAPTERS.
OPTIMIZATIONS
Figure 8.9: Edge swapping in a three element ball. 8.6.1
How to use an optimization operator
Using an optimization operator is quite simple. First, its result is simulated in terms of both the validity and the quality evolution of the concerned elements. In the case where an improvement is achieved, the simulated output is retained. In the case where several solutions are possible, the best one is selected (or the first possible solution which has been observed). When the simulation includes a large number of possible solutions, CPU cost consideration require that we optimize the pair simulation-effective application. The operations used in the simulation are of a purely geometric nature (surface area or volume computations, element quality evaluations, before and after the process in question has been applied), while the effective application of the operator leads to the definition of the new elements and the new neighborhood relationships that can be affected in the process. A tricky computer procedure of these two phases allows us to minimize the overall CPU cost of the process. 8.6.2
How to control an optimization operator
Classical optimization. First we compute the initial quality of the point, edge, element or set of such entities included in the initial configuration. We then compute the same quality for the affected entities for the proposed solution (s). Finally, we determine if we should apply the optimization process, based on the quality results. Several strategies can be
8.6. ALGORITHMIC ASPECTS
237
chosen to govern the decision. The process is applied if • the resulting configuration is improved, • the resulting configuration is improved to some extend, • in the case of multiple possible solutions, by selecting the first solution occuring in the simulation or by chosing the best solution among all, • and so on.
Another issue consists of defining the way in which the operator is used, one can decide to process • all of the mesh entities starting from the first and going to the last, • only some entities properly selected (using a stack based on a relevant criterion, edge length if edges are proceeded, or using a quality threshold, ...), • all the entities, or only some of them, randomly picked, • and so on.
The question is now to design an automatic and global optimization method by deciding on a strategy for both the choice of the local operators and the order in which to use them (described hereafter), assuming that the strategy related to a given local operator is fixed. Constrained optimization. In this case, a similar discussion can be given, only the quality notion must be changed, accordingly. 8.6.3
How to control an optimization process
A mesh optimization method by means of a sequence of the available local operators requires the definition of a strategy on how to order them, the local strategy for all of them being fixed. Several observations can be helpful in defining such a strategy. Assuming that a local operator sequence is given, a stopping criterion has to be defined first. In fact, several classes of criteria are possible, including the following ones. The process is repeated until • the mesh is affected by one operation, • the mesh is affected by one or many operations,
238
CHAPTERS.
OPTIMIZATIONS
• a given threshold (in terms of quality) is not achieved, • and so on.
Provided this, a strategy must be defined. One has some flexibility in ordering the possible choices. Indeed, one can • apply every local operator to all the entities concerned by its application, and then turn to a different operator, • consider a given mesh entity and apply all the local possible operators before turning to a different entity, • combine the two above approaches. It is also possible to classify the pathologies (cf. the above classification section) and to deal with the mesh entities accordingly. As a reasonable example, we have developed a three dimensional optimization algorithm, whose scheme can be formally written as follows • the mesh elements are classified in terms of element qualities, • the "bad" elements (for a given threshold) are identified with respect to their pathology, • with each pathology is associated a specific sequence of local operators developed so as to get rid of the actual pathology, • once the worst elements have been processed, we then consider all of the mesh elements and — shell modifications are applied to each mesh edge, — the free vertices are relocated and the actual process is repeated as long as a significative modification is encountered. This strategy has proven to be efficient although its justification relies on experimental tests. That is, no theoretical results can be presented to justify the choices.
8.7
Some results
Classical optimization in two dimensions. We show in Figures 8.10 and 8.11 an example of node relocation by barycentris smoothing. The mesh on the left-hand side is the initial mesh, while that on the right-hand side is the mesh resulting from the barycentric smoothing of all the free vertices. Improved regularity of the elements can be observed.
8.7. SOME RESULTS
Figure 8.10: Initial mesh.
239
Figure 8.11: Mesh resulting from node relocation.
Governed optimization in two dimensions. We now consider a disc of radius 6 centered at the origin. The provided size map specifies that the sizes be approximately of 0.01 along the perimeter line of a circle centered at the origin with a radius of 3, that the size increase linearly towards the interior of the circle and that the size be 1.5 in its exterior region (thus, the size varies widely in the range from 0.01 to 1.5). Figure 8.12 displays a mesh of this domain which respects, more or less, the given metric map, this mesh being created by a given mesh generation method. The goal of the optimization step is then to obtain a new mesh, cf. Figure 8.13, as a modification of the previous mesh by means of a process governed by both the size and the aspect ratio parameters. The initial mesh has a quality of 83 (where this value is that of an element adjacent to the circle towards its exterior). The mesh consists of 13,264 triangles, 7% having a quality (aspect ratio) worse then 2. There are 19,865 edges whose lengths vary from 0.34 to 26 in the metric map. Among these edges, 5% have a quality (in terms of size) worse than 2. The optimized mesh has a quality of 6 (in the same region). Among the 13, 264 triangles, 4% have a quality (aspect ratio) worse than 2. The edge lengths vary from de 0.4 to 13 in the metric. 7% of edges have a quality (size) worse than 2. One may notice in this example that it is difficult to satisfy two mutually opposite constraints (size and aspect ratio) at the same time, especially if the specified control is strongly discontinuous. Nevertheless, a gain factor of about 2 has been obtained with respect to the size constraint.
240
CHAPTERS.
OPTIMIZATIONS
Figure 8.12: Initial mesh.
Figure 8.13: Mesh resulting from size and aspect ratio optimization.
241
8.7. SOME RESULTS
Remark. The simple observation, in two dimensions, of a mesh (see the figures) is not always a good way to appreciate the element qualities or the evolution of these qualities. It appear to be more fruitful and faster to give some pertinent numerical values, curves, histograms, or distribution diagrams. This is strictly required in three dimensions where simple visualization, even using powerful graphic facilities, is a rather poor way of investigation. Classical optimization in three dimensions. In this case, we consider two mesh examples. The following tables report the mesh statistics before and after optimization. In the first line is given the distribution, in terms of element percentage, of the elements falling in the quality range from 1 to 2, from 2 to 3, from 3 to 10 and then greater than 10 (the second line reports the corresponding number of elements), target is the quality of the best tetrahedron that can be constructed using the worst boundary face, QM is the global quality of the mesh, ne denotes the number of elements while np is the number of points in the mesh. The rest of the table reports the same information for the optimized mesh.
Q before after •
1-2 2-3 3-10 > 10 target 21 12 63 8.30 3 824 2,475 486 132 72 21 6 8.30 0 224 2,620 759 5
QM
ne
755 3,917
np 1,004
11.44 3,608 1,015
Table 8.2: Aspect ratio before and after optimization (example 1).
Q before • after •
1-2 76 58,248
85 61,215
np ne 2-3 3-10 > 10 target QM 15 7 0 38.06 4,471 75,816 12,872 11,611 5,251 706 12 2 0 38.06 53.80 71,510 12,903 8,695 1,524 76
Table 8.3: Aspect ratio before and after optimization (example 2). The histogram is now better centered around 1 and a large reduction in poorly shaped elements can be observed. The value QM is also closer to the target value.
242
CHAPTERS.
Governed optimization in three dimensions. refer the reader to [Briere,George-1995].
8.8
OPTIMIZATIONS
For such examples, we
Applications
Basically, three types of applications for an optimization algorithm can be envisioned. • The optimization algorithm is a standalone, i.e., a software package which processes a given mesh so as to achieve an optimized mesh (according to the desired objectives). The program reads the data, constructs the necessary "tables", chains the local operators and saves the output. • The optimization algorithm is a part of a mesh generation algorithm (cf. Chapters 5 and 7, for instance). The program takes advantages of the internal data structures of the mesh generation program (for example, neighborhood relationships can be easily used by any local operator). • The optimization algorithm is a part of a local adaptation process which serves at at adapting a region of the mesh with respect to some criteria (a posteriori error estimate), cf. Chapter 9.
8.9
Notes
Some specific applications of the optimization operators can be developed, not to improve a criterion but for topological purposes. In what follows, we give two such examples. The first such application is the generation of non-obtuse meshes, in two dimensions. A (triangular) mesh is said to be non-obtuse if the element angles formed by the pairs of edges are non-obtuse. Such meshes can be requested for some specific computations. The second example deals with the suppression of over-constrained elements or over-constrained edges in a mesh. In two dimensions, such an element has two boundary edges. In three dimensions, it has three boundary faces. An over-constrained edge is an internal edge whose endpoints are both located on the boundary. These elements and edges with this feature are processed by either one or the other adequate operators so as to obtain a suitable configuration of edges or elements (in terms of the mentioned constraint).
Chapter 9
Mesh adaptation 9.1
Introduction
Using mesh adaptivity to conform to the physical properties of a given problem is a promising method that is rapidly becoming commonplace. Its purpose is to obtain better results by adapting the mesh to the physical behavior of the problem. This technique serves at controlling the accuracy of the computed solution and is a key-issue in developing a fully automatic computational process. The proper (or incorrect) adaptation of a mesh to a given problem can be envisaged in many different ways (possibly competing). It is based on the number of mesh nodes, and then to the number of mesh elements, as well as the nodal locations and element shapes. Thus, mesh adaptivity may affect several properties including the nodal density, the element density (i.e., the level of mesh refinement in certain regions), the element shapes (isotropic meshes or anisotropic meshes where the elements are aligned in the directions of some relevant curves or surfaces) and also the presence of various element characteristics. An example of one such property is element orthogonality1 with respect to curves or surfaces in some regions. The key-issue is that an adapted mesh leads to an accurate solution of the computational process. This means that the fine level phenomena (rapid solution variations, boundary layers, shocks, ...) are expected to be well captured while minimizing the number of elements so as to reduce the computational cost. There are numerous mesh adaptivity methods. Formally speaking, the *In two dimensions, a triangle is said to be orthogonal with respect to a curve if it has two orthogonal edges, one of them following the given curve. In three dimensions, we can infer a similar definition involving two faces.
244
CHAPTER 9. MESH
ADAPTATION
adaptivity discussed here relies on an a posteriori error estimate. It is an iterative process; starting from an initial mesh, a first solution is computed. This solution is analyzed using the given a posteriori error estimate and the result of this analysis is translated into criteria directly usable to govern the mesh generation process. A new mesh is then constructed (by means of a local or a global process) and the entire process is repeated. Indeed, mesh adaptivity methods can be classified into two categories. The first category relies on local processes which locally or globally modify a current mesh so as to adapt it. On the other hand, the second category corresponds to a quite different approach, the mesh is entirely reconstructed at each iteration step of the adaptation process. It is also possible to combine these two approaches. Mesh adaptivity using local modifications is performed during some iteration steps, afterwhich an entire mesh reconstruction is done and the process is repeated. Irrespective of the classification, mesh adaptivity can be implemented using several different ways. Some of the methods available include the r-methods2, the /i-methods, the p-methods and a combination of the last two, the so-called /ip-methods. In this chapter, we will discuss these different approaches. We assume that a constraint field is given (including size and directional specifications) which enable us to govern the adaptive process. Thus, we assume an ideal or academic situation and, more specifically, we are not directly interested in the way the control field has been constructed (in general using an error estimate, ...). We consider also that a suitable geometric description of the domain boundaries is provided (in a future chapter, the non-trivial problem of constructing such a description will be discussed).
9.2
Mesh adaptivity methods
In this section, we introduce the main ideas used in some classical adaptive methods. Mesh adaptive methods are not the purpose of this book, thus only the mesh generation aspect of these methods is considered, while theoretical issues related to convergence, accuracy, ..., will not be covered. 9.2.1
The r-method
Using the r-method, the mesh connectivity is unchanged. Instead, node relocation is used to move the mesh nodes either by means of a weighted barycentric smoothing based on the location and the weight of the nodes 2
Also referred to as the s-methods.
9.2. MESH ADAPTIVITY METHODS
245
in some neighborhood (cf. Chapter 8), or by means of element distortion. The criteria (weights) governing these operations are obtained by analyzing the current solution. In this method, the connections remain unchanged, it is only by node location modifications that the adaptivity can be achieved thus insinuating some sense of rigidity. Nevertheless, some problems, where for instance the point locations are a function of a "source" (a point, a straight line, a curve, a surface), can be successfully addressed by an r-method. The principal difficulty of the r-methods is that of ensuring that the resulting elements do not degenerate (very small or even negative surface areas or volumes) and that the node relocations do not result in overlapping elements. A solution to control these phenomena is to move the points step by step, checking the validity of the solution at each step and then to iterate the process (cf. Chapter 8). In this way, deformations that are too large are avoided although such large displacements can nevertheless be still obtained. Every point is moved with a reasonable stepsize but, as a consequence of the global iteration steps, the mesh can be widely modified after a while. 9.2.2
The ^-method
H-method adaptivity is defined in terms of local or global mesh enrichment by means of refining (by partitioning) or coarsening selected elements or all the elements in a mesh. A complete regeneration of the mesh based on the analysis of the solution obtained is another more flexible form of /i-method. This method will be discussed in more detail hereafter. 9.2.3
The p-method
This approach is based on an invariant mesh (in terms of points (nodes) and elements) and adjusts the degree (in terms of the interpolation functions) of the finite elements constructed on the mesh elements as a function of the current solution analysis. Considered as an a priori elegant approach, this method is anything but easy to implement for complex geometries. The main difficulty consists in properly defining the nodes that must be created on the domain boundaries as the degree of the interpolation increases since such construction needs to result in • properly located nodes, • satisfactory elements in terms of aspect ratio, positive jacobian, ...
246
CHAPTER 9. MESH ADAPTATION
Figure 9.1: Creation of a P2 finite element (simple case). This node construction implicitely assumes that the initial mesh, i.e. the mesh obtained by a mesh generation method, is compatible, in some sense, with the required order p approximation. This requirement is to ensure that the initial mesh is compatible with the domain geometry and, in particular, that this mesh conforms to the boundary curvatures accurately. When the geometry is "straight" (in two dimensions) or planar (in three dimensions), the requested compatibility automatically holds and the pmethod is a widely efficient method to handle problems that would be rather difficult to consider elsewhere (for instance, a problem where (linear or planar) cracks must be followed accurately). Conversely, considering an arbitrary domain geometry (i.e., an arbitrary boundary), a practical computer implementation of the p-method leads to some difficulties. Figure 9.1 illustrates a two-dimensional case where a P1 element of vertices Paft has an edge a/3 discretizing the boundary F. Three edge "midpoints" must be created so as to translate the P1 interpolation in a P2 interpolation. The midpoints of the two edges connected to P are clearly well suited for the P2 construction while the edge aft must be replaced by two sub-edges after introducing a suitable point ai on F. As in the depicted configuration, F and the edge aft are close enough, so that the point ai location can be easily found. The following figure, Figure 9.2, presents a more difficult configuration where the initial mesh is not compatible. Indeed, the edge aft is not close enough to F and thus the point ai is such that the P2 triangle that will be constructed will be poorly shaped. This situation is clearly related to the fact that the P1 mesh is a bad geometric approximation of the boundary F. One may easily imagine other configurations where the P2 triangle is such that the sub-edges are selfintersecting or such that the point a\ falls in a triangle other than the triangle Pa ft (then a more complex process will be required, for instance using the /ip-method).
9.3. MODIFICATION VERSUS RECONSTRUCTION
Figure 9.2: Creation of a P2 finite element (for a more difficult tion).
247
configura-
Notice that these difficulties are also present in three dimensions in many cases and that finding a suitable solution is a rather tedious task. A possible solution for this problem relies on first constructing a compatible mesh for which we need to use a technology similar to that used for enforcing constraints in a given mesh (cf. Chapter 3). In conclusion, there are no major difficulties in two dimensions. However, the same problem in three dimensions requires more subtle care. 9.2.4
The ftp-method
The ftp-method combines the ft-method and the p-method. This solution could be a nice complement to the p-method since some extent of flexibility is added. Returning to the example of Figure 9.2, we first create the point cti, then we define the triangle ota\(5 and finally we consider the two boundary edges ota\ and a\j3. Hence, a reasonable situation is encountered where the presumed boundary edges are close enough to the boundary F. The final remark of the previous section remains valid in general. Indeed, it is a tedious task to develop an ftp-method algorithm for complex geometries.
9.3
Modification versus reconstruction
In what follows, we consider an ft-type adaptivity method. As previously mentioned, two approaches can be envisaged to obtain (or at least to try to obtain) an adapted mesh. The first approach modifies the current mesh
248
CHAPTER 9. MESH ADAPTATION
to create the adapted mesh while the second one constructs a new mesh using a governed mesh generation method. Whatever the case, constructing a mesh relies on the data of the domain geometry and of a specified field (which serves as a control space). This map specifies the expected characteristics of the mesh everywhere in the space.
9.3.1
Adaptivity based on local modifications
An adaptive scheme which employs local modifications can be envisioned in two ways. Either by applying mesh refinement and mesh derefinement tools or by using the local transformations included in an optimization algorithm. Before discussing a modification-based adaptivity scheme, we will establish the list of the tools suitable for this purpose. As a preliminary comment, one may notice that these tools are well-suited for mesh refinement purposes and conversely, that it is usually rather delicate to derefine a given mesh (more specifically, derefining a mesh in a region where it has been previously refined is possible in some cases but it can be tedious elsewhere). Several local tools. These local tools are applied to the elements that have been selected based on the error estimate (through the control space). The refinement process splits a given element and may also result in splitting some elements in the neighborhood so as to maintain mesh conformity3. There are several ways to refine an element based on the simple patterns shown in Figures 9.3 (in two dimensions) and 9.4 (in three dimensions). Used recursively, these operators allow us to refine one or more times a given element or a set of elements. In two dimensions, the basic constructions consist either of introducing a point on an edge, dealing with two edges (the same operator is applied twice) or three edges or by creating a point inside the triangle (for instance the centroid of the element). This series of operators results in refining the mesh. On the other hand, derefining a mesh is not trivial except if these operators can be used reversely. This means that the derefinement operator can be used only in a region previously refined. This specificity is obviously a weakness related to this type of adaptive method. Nevertheless, such a method can be governed 3
One may notice that some solution methods do not require a conforming mesh, thus removing this constraint.
9.3. MODIFICATION VERSUS
RECONSTRUCTION
249
Figure 9.3: Local splitting in two dimensions. by a strategy enabling the selection of the elements to be processed so as to lead to the desired result, while avoiding the creation of poor-shaped elements. Numerous authors have proposed such strategies and the reader is referred to [Rivara-1986], [Bai,Brandt-1987] and [Bansch-1991]. In three dimensions, there are also a few basic operators (see Figure 9.4). Three basic tools exist that can be used recursively so as to obtain all of the desired configurations. Indeed, it is possible to define a point along an edge, on a face or inside a tetrahedron. As before, it is more difficult to obtain a derefinement effect.
Figure 9.4: Local partitioning in three dimensions. Elements other than simplices are not discussed in this paper, nevertheless it is also possible to define some local operators capable of handling such elements. A global tool. The only operator which results in a uniform processing of all the elements in a given mesh consists of partitioning each mesh element by adding n points along its edges. Then (n + l)d geometrically identical elements are obtained (d being the spatial dimension), as in Figure 9.5. This process results in a uniform refinement of the given mesh. This type of
250
CHAPTER 9. MESH ADAPTATION
operations is useful for comparing against the mesh adaptivity method with variable and local stepsize with a "reference" solution which is computed on a fine uniform mesh.
Figure 9.5: Global partitioning of a triangle.
Tentative scheme. The general scheme of a local adaptivity method based on mesh modification includes the following steps • The initial mesh construction resulting in Tj, with j' = 0, • (1) The computation of the solution Uj associated with this support, • The error estimation and its formulation as a list of elements to be processed, • The modification, if required, of the current mesh so as to obtain the new mesh Tj, with j = j + 1, • The adequate transfer of the current solution on Tj so as to permit, after going back to (1), for the whole process to be repeated. Local modification relies on either using the one or more local tools to refine (derefine) the selected elements or in optimizing the current mesh. Adaptivity by means of mesh optimization can use the same tools as well as the set of optimization procedures described in Chapter 8. We refer the reader again to the above references for a more exhaustive investigation of this type of scheme. Nevertheless, one may read the following to find more details about the steps of the general scheme that will be found in the approach proposed hereafter. 9.3.2
Adaptivity based on a complete reconstruction
The /i-adaptivity method that we will present now does not rely on local or global modifications of the current mesh but instead requires an entire reconstruction of the mesh for each iteration step of an iterative process.
9.4. GENERAL SCHEME FOR AN ADAPTATION LOOP
251
The main idea then is to define an iterative process by using an automatic mesh generation method governed by a control space, the latter resulting from the error estimate included in the computational process. Constrained mesh generation methods. In two dimensions, the required meshing operations affect the domain boundaries and the domain itself. Thus, two types of mesh generation methods must be envisaged. The first is a boundary mesh generation method, basically a method adapted to curve or surface meshing. The second one is a domain mesh generation method using the boundary mesh previously created so as to create the mesh elements of the domain, accordingly. In three dimensions, one will successively need a curve meshing operator, a surface meshing operator and a domain meshing operator (based on the discretization of the domain surface resulting from the previous operator). Whatever the entity to be meshed (a curve, a planar domain, a surface or a volume), the expected mesh shall conform the set of criteria (size, direction) specified via a control space; thus the required mesh generation operators must necessarily be governed or constrained so as to conform to the specifications defined in the control space. Before giving a detailed description of these algorithms, we would like to propose a general scheme which allows for the development of an automatic computational loop based on mesh adaptation.
9.4
General scheme for an adaptation loop
A solution computation in an automatic adaptive process includes the stages described in the following formal scheme. • Initial mesh construction (using any classical method), • (1) Computation of the solution based on the current support, • Analysis of the solution quality using an error estimate and construction of the related control space, — If the current solution has "converged" (discussed hereafter), then we have reached the end of the computational process. — If the current solution has not converged, construct the related control map which will serve as meshing specifications and GO TO (1).
252
CHAPTER 9. MESH
ADAPTATION
As previously mentioned, the construction of a new mesh governed by a control map so as to iterate the process includes several aspects that will be discussed in the following. We will successively discuss the (formal) way to construct a control space, then we will focus on the boundary meshing (or remeshing), before detailing how to mesh the domain. We will also mention the problem of transferring the solutions from one mesh to the other so as to preserve the suitable properties (for instance without introducing any numerical dissipation). Indeed, such a transfer step can be a crucial point, in particular when the solution method is iterative.
9.5
Control space
As seen in Chapter 5 and in the following, the control space is a convenient way to govern an automatic mesh generation algorithm. In an adaptive scheme, the notion of a control space is clearly a useful requirement.
9.5.1
Definition of the successive control spaces
We denote by Tj the mesh constructed at step j of the mesh generation process, TO being the initial mesh. We denote by CSj the control space used to govern the construction of the mesh Tj. Hence, • in principle, CSo is not defined at the time the initial mesh TO must be constructed. Nevertheless, the discretization (the mesh) of the domain boundaries is made according to user-provided specifications (specified sizes, constant sizes, sizes automatically derived from the geometric features of the boundaries (radius of curvature, etc.), ...). Thus, once the boundary mesh is created, it is possible to define the control space CSo which can be used to govern the construction of the domain mesh TQ. The initial mesh is related to the given boundary discretization. • C<Sj, the control space used in the following iteration steps to govern the construction of the mesh Tj, (.;"= 1,2,...), is automatically defined
by CSj = (Tj.1,Hj-l)
(9.1)
where the pair (Tj, Hj) represents the mesh at step j and the control map supplied to this mesh. This map results from the error estimate used to analyse the solution Uj related to Tj. This construction gives HJ as a metric map which is a matrix map from a practical point of view. Thus, £Cj is by essence a discrete field, where the function Hj
9.5. CONTROL SPACE
253
is only known at the element vertices of the mesh Tj. This is one of the expected difficulties in any adaptive process and constitutes a major difference with any purely academic problem (where Hj is assumed to be well-defined everywhere in the space).
9.5.2
Control space construction
We will present in this section several issues related to the construction of the control spaces associated with each iteration step of the adaptive process. The purpose is to define the pair (Tj, Hj) which in practice only requires that we define Tfj, since Tj is simply the current mesh. At first, we assume that the a posteriori error estimate used in the computational part of the global scheme provides the values defining Hj. The realistic case of a finite element situation will be discussed in Chapter 12. Here we would like to emphasize two difficulties • the field Hj is a discrete field and so it is necessary to define an interpolation operator so as to know Hj everywhere, • the error estimate may be made up of several unknowns and then may define several fields Hj that must be combined in some way. We will summarize the notions of a metric interpolation and that of a metric intersection in what follows. Metric interpolation. This operation enables us to find the metric related to any point in the domain from the metrics defined at the vertices of the current mesh. Several situations are relevant depending on the position of the point under investigation. This point can be located along an edge for which the metric is known at the endpoints and this point can fall within an element for which the metric is available at the vertices. Let us consider the first situation and for the sake of simplicity let us assume a two-dimensional problem. Let a = AB be an edge and let P be a point along this edge. We assume that the metrics are given at A and B, let MA and MB be these metrics. The question is then to find a metric MP at P. The solution is trivial in an isotropic context. Indeed, if the first metric is simply A/2 and the second is /x/2, then the expected sizes are h^. = l/\/A for the first metric and HB = l/\/A* f°r tne sec°nd °ne- Then the interpolation function, assuming that an arithmetic size distribution is expected
254
CHAPTER 9. MESH
ADAPTATION
is defined by M(t}=
*-r-^/a
(hA + t(hB - tiA))
0* , i =— 4 : OQuad, J i=l, NbOfSubDomain)
290
CHAPTER 10. DATA STRUCTURES • Corners (I) NbOfCorners ( OVertex, , i=l , NbOfCorners ) •
Ridges (I) NbOfRidges ( CEdge; , i=l , NbOfRidges ) RequiredVertices (I) NbOfRequired Vertices ( CVertex, , i=l , NbOfRequired Vertices j
•
RequiredEdges (I) NbOfRequiredEdges ( CEdge, , i=l , NbOfRequiredEdges )
•
RequiredTriangles (I) NbOfRequiredTriangles ( CTria, , i=l , NbOfRequiredTriangles )
•
RequiredQuadrilaterals (I) NbOfRequiredQuadrilaterals ( CQuad, , i=l , NbOfRequiredQuadrilaterals J
• TangentAtEdges (I) NbOfTangent At Edges ( CEdge, , (I) VertexInEdge , ( (R) xf , j=l,dim) , i=l , NbOfTangent AtEdges ) • Normal At Vert ices (I) NbOfNormal At Vertices ( CVertex, , ( (R) xj,j=l,dim) , i=l , NbOfNormal At Vertices ) • NormalAtTriangleVertices (I) NbOfNormalAtTriangleVertices ( CTria,- , (I) VertexInTrian. , ( (R) xf , j=l,dim) , i=l , NbOfNormal AtTriangle Vertices ) • NormalAtQuadrilateral Vert ices (I) NbOfNormalAtQuadrilateral Vertices ( OQuad,- , (I) VertexInQuad. , ( (R) x{ ,j-l,dim) , i=l , NbOfNormalAtQuadrilateral Vertices J • AngleOf CornerBound (R) 8 • Geometry (O) FileNameOfGeometricSupport - VertexOnGeometricVertex (I) NbOfVertexOnGeometric Vertex ( CVertex, , CVertexf 60 , i=l , NbOfVertexOnGeometric Vertex ) — EdgeOnGeometricEdge (I) NbOfEdgeOnGeometricEdge ( CEdge, , CEdgef 60 , i=l , NbOfEdgeOnGeometricEdge ) - TriangleOnGeometricTriangle (I ) NbOfTriangleOnGeometricTriangle ( OTria,- , CTriaf 60 , i=l , NbOfTriangleOnGeometricTriangle)
10.3. A GENERAL DATA STRUCTURE
291
- TriangleOnGeometricQuadrilateral (I) NbOfTriangleOnGeometricQuadrilateral ( OTria;, OQuadf 60 , i=l, NbOfTriangleOnGeometricQuadrilateral) - QuadrilateralOnGeometricTriangle (I) NbOfQuadrilateralOnGeornetricTriangle ( Oquadj, OTriaf60 , i=l, NbOfQuadrilateralOnGeometricTriangle) — quadrilateralOnGeometricQuadrilateral (I) NbOfQuadrilateralOnGeometricQuadrilateral ( Oquad,, OQuad?60 , i=l, NbOfQuadrilateralOnGeometricQuadrilateral J • MeshSupportOfVertices (C*) FileNameOfMeshSupport
— VertexOnSupportVertex (I) NbOfVertexOnSupportVertex ( OVert ex,-, OVertextsupp , i=l, NbOfVertexOnSupport Vertex ) — VertexOnSupportEdge (I) NbOfVertexOnSupportEdge ( OVertex;, OEdge*upp , (R) u*upp , i=l, NbOfVertexOnSupportEdge ) - VertexOnSupportTriangle (I) NbOfVertexOnSupportTriangle (oVertex t -,CTria, supP , (R) u?pp , (R) < upp 7 i=l, NbOfVertexOnSupportTriangle ) — VertexOnSupportquadrilateral (I) NbOfVertexOnSupportQuadrilateral (oVertexi.Oquad^, (R) u*upp , (R) «?"» , i=l, NbOfVertexOnSupportQuadrilateral) - VertexOnSupportTetrahedron (I) NbOfVertexOnSupportTetrahedron (oVertex^OTetra*^, (R) u™pp , (R) t,,stw , (R) w?" , i=l, NbOfVertexOnSupportTetrahedron ) - VertexOnSupportPentahedron (I) NbOfVertexOnSupportPentahedron (oVertexi,OPenta,* upp , (R) u?™ , (R) t;,supP , (R) t",-UPP ? i—1, NbOfVertexOnSupportPentahedron ) - VertexOnSupportHexahedron (I) NbOfVertexOnSupportHexahedron r^, (R) n?" , (R) v?" , (R) w?" , i=l, NbOfVertexOnSupportHexahedron )
292
CHAPTER 10. DATA STRUCTURES • CrackedEdges (I) NbOfCrackedEdges ( CEdgeJ, CEdge? , i=l, NbOfCrackedEdges ) • CrackedTriangles (I) NbOfCrackedTriangles ( CTriaJ , CTria? , i=l, NbOfCrackedTriangles ) • CrackedQuadrilaterals (I) NbOfCrackedQuadrilaterals ( CQuad^ , OQuad? , i=l, NbOfCrackedQuadrilaterals ) • EquivalentEdges (I) NbOfEquivalentEdges ( CEdgeJ, CEdge? , i=l, NbOfEquivalentEdges ) • EquivalentTriangles (I) NbOfEquivalentTriangles ( CTria^ , CTria? , i=l, NbOfEquivalentTriangles ) • EquivalentQuadrilaterals (I) NbOfEquivalentQuadrilaterals ( CQuad* , OQuad? , i=l, NbOfEquivalentQuadrilaterals ) • PhysicsReference (I) NbOfPhysicsReference ( (I) Reffa , (C*) CommentOnThePhysic , i=l, NbOfPhysicsReference j • IncludeFile (C*) filename • BoundingBox ( (R) Mm, (R) Max,,, i=l , dim)
Remarks. In the following, we give some comments concerning the different fields. At first, one may notice that some fields are strictly required while some others are optional7. The comments and remarks are given according to their introduction order in the above description. The string MeshVersionFormatted indicates the release identificator and the type of the file. MeshVersionUnf ormatted is an alternative case for this field. The edge table, Edges, includes only, a priori, the edges with a significant reference number Ref4>. The elements are given with respect to their geometric nature (triangle, quadrilateral, etc.). In this way, when several types of elements exist in the mesh, it is not required to manage a table of element types. The sub-domains are defined using one edge in two dimensions or one face in three dimensions combined with the orientation information, 7
In this way, it will be possible to add some fields that are not yet defined.
10.3. A GENERAL DATA STRUCTURE
293
(Orientation;), indicating on which side of this entity the sub-domain lies. The sub-domain number is Ref(f)s. A corner point, Corners (for a support type structure), is a point where there is a C° continuity between the edges sharing the point. Thus, a corner will necessarily be a mesh vertex. A ridge is an edge where there is a C° continuity between the faces sharing it. Thus, a ridge will necessarily be a mesh edge. The required vertices, RequiredVertices, are the vertices of the support that must be present in the mesh as element vertices. Similarly, some edges or (triangular or quadrilateral) faces can be required. The tangent vector to an edge, TangentAtEdges, gives the tangent vector (with respect to the surface) for this edge at the indicated endpoint. Giving the tangent vector of an edge by means of the tangent vector at a point enables us to deal with the case where several edges (boundary lines) emanate from a point. The normal at a vertex, NormalAtVertices, gives the normal vector (with respect to the surface) at this vertex. The normal at a vertex of a triangle (in practice, a triangular face), NormalAtTrianglesVertices, gives the normal vector at the vertex of the specified triangle, as these values may change between neighbouring triangles. The corner threshold, AngleOfCornerBound, is a value which enables us to determine the continuity type between two edges or two faces that was not clearly defined or not explicitely specified. The mesh vertices are related to the type of support in which they exist. There are two categories of supports, a geometric support and a current mesh. If the support is of a geometric nature, Geometry, defined by a file, it gives the relationships between the vertices, boundary edges and boundary faces of the current mesh with the geometric entities. Thus, a mesh vertex can be identical to a geometric vertex, a mesh edge can have a geometric edge as support and, in three dimensions, a face (a triangle or a quadrilateral) can have a geometric face as support. These relationships allow us to classify the entities of the current mesh with respect to an entity defining the domain geometry (this information will be particularly useful when constructing finite elements of order greater than one).
294
CHAPTER 10. DATA STRUCTURES
If the support is a (usual) mesh by itself, MeshSupportOf Vert ices, defined by a file, gives the relationships between the current mesh and the above mesh. A vertex of the current mesh belongs to an entity8 of the support mesh (this information may be relevant when interpolating or transferring a solution from one mesh to another in an adaptive iterative process for instance) . Hence, in an iterative computational process, the support for the mesh at a given iteration step is the mesh of the previous step. In this way, we indicate that a vertex, z, of the current mesh • is identical with a vertex of the support, • lies on an edge of the support at abcissa w, • falls within a triangle of the support, w, v being the coordinates in the reference element, • falls within a quadrilateral of the support, w, v (idem), • falls within a tetrahedron of the support, «, f , w (idem), • falls within a pentahedron of the support, u,v,w (idem), • falls within an hexahedron of the support, w, u, w (idem). A vertex not in this "table" is considered to be a free vertex. The relationships defined in this way enable us to know the location of a vertex using the reference element related to the support entity which includes this vertex. To use the reference element to arrive to the current element, one must use one of the following relations based on the geometric type of the element : • for an edge with endpoints ki and k^
• for a triangle with vertices ki ,
/ = 1 ,3
• for a quadrilateral with vertices &/,
/ = 1,4
'For a boundary element, a projection will be needed to obtain the desired location.
295
10.3. A GENERAL DATA STRUCTURE
Figure 10.3: Canonical numbering. • for a tetrahedron with vertices fc/, / = 1,4
• for a pentahedron with vertices fc/, / = 1,6
for an hexahedron with vertices A;/,
/ = 1,8
Figure 10.4: Canonical numbering.
296
CHAPTER 10. DATA
STRUCTURES
Remark. This information is naturally known by the mesh generation algorithm and is relatively easy to obtain (cf. Chapter 9). Moreover, when simplicial elements are used, the bary centric coordinates are trivial to obtain and thus do not strictly need to be stored. Crack definition is the purpose of three fields, CrackedEdges, CrackedTriangles and CrackedQuadrilaterals; we specify then that an edge (a face, respectively) is identical in terms of geometry to another edge (face). The three fields, EquivalentEdges, EquivalentTriangles and EquivalentQuadrilaterals indicate that two edges (resp. faces) must be meshed the same way (for instance, in periodic meshes). A comment about the meaning of the physical reference numbers is provided in the field PhysicsRef erence. It is possible to include a file in the data structure, IncludeFile. This inclusion will be made without ensuring any compatibility. For some applications, it is useful to know the size of the domain, i.e., the extrema of its point coordinates. This will be stored in the field BoundingBox.
10.4
A geometric data structure
The general structure allows us to specify a mesh describing the geometry of the given domain. This mesh is used to define both the geometry and the physical conditions of the problem under consideration. In this case, some of the above fields are not relevant. We would like to give some indications about this geometric structure in two dimensions and add specific comments related to three dimensions. One is referred to latre in this chapter to see how such a structure can be effectively used to construct a geometric representation and to Chapter 11 to see how to use this representation for boundary meshing (remeshing) purposes.
10.4.1
The two-dimensional case
We give the list of the fields used in this case by first indicating the required fields • MeshVersionFormatted 0 • Dimension (I) dim
10.4. A GEOMETRIC DATA STRUCTURE • Vertices (I) NbOfVertices ( ( (R) xj ,j=l,dim) , (I) Reftf
,i=l, NbOfVertices )
• Edges (I) NbOfEdges ( CVertex}, OVertex? , (I) Reftf
, i=l,NbOfEdges )
297
• SubDomain (I) NbOfSubDomain ( (I) typei,
{ typei == 2 : OEdge, } , (I) Orientation, , (I) Reftf i=l, NbOfSubDomain)
,
and then the optional fields • Corners (I) NbOfCorners ( OVert ex;, i=l, NbOfCorners ) • RequiredVertices (I) NbOfRequiredVertices ( OVert ex, , i=l, NbOfRequiredVertices ) • RequiredEdges (I) NbOfRequiredEdges ( OEdge,-, i=l, NbOfRequiredEdges ) • EdgesTangent (I) NbOfEdgesTangent ( OEdgej, (I) VertexInEdge , ( (R) x£ ,j=l,dim) , i-1, NbOfEdgesTangent) • MaximalAngleOfCorner (R) 0 • CrackedEdges (I) NbOfCrackedEdges ( OEdgeJ , OEdge? , i=l, NbOfCrackedEdges ) • EquivalentEdges (I) NbOfEquivalentEdges ( OEdge} , OEdge? , i=l, NbOfEquivalentEdges ) • PhysicsReference (I) NbOfPhysicsReference ( (I) Reffa ,(C*) CommentOnThePhysic , i=l, NbOfPhysicsReference J • IncludeFile (C*) filename • BoundingBox ( (R) Mm,- (R) Max, ,i=l ,dimj The geometric representation of a boundary in two dimensions will be detailed hereafter. At this time, we will use the edges provided in the data structure so as to define some curves of order three in the following way 9 • an edge whose endpoints are corners and if no additional information is provided will be represented by a straight segment, 9
A different choice is clearly possible which would lead to the modification of the type of representation and thus the way in which the related information is used later on.
298
CHAPTER 10. DATA
STRUCTURES
• an edge whose endpoints are corners but whose tangent is provided at one end point will be represented by a curve of degree two, • an edge whose endpoints are corners but whose tangents are provided at both corners will be represented by a curve of degree three, • an edge whose endpoints are not corners and with no additional information will be represented by a curve of degree three. Indeed, we use in this case the adjacent edges so as to evaluate the tangents at the edge endpoints, • etc.
In short, an edge defined by two pieces of information will be approximated by a straight line, three items allow us to obtain a curve of degree two and four items allow for an approximation10 of degree three. Now that this means of constructing the geometric support from a geometric support mesh has been briefly established, we would now like to give an example. We consider the rather simple domain of Figure 10.5 where F denotes (with no more precise information at this stage) the boundary associated with the segments CF and FD. We will discuss the different ways to construct a mesh data structure by observing in each case the resulting geometric definition.
Figure 10.5: The domain to be defined. Hence, if we provide the following information as input data 10
One also may say that an approximation of degree three is constructed, in some cases, when some data is missing, where the tangents can be defined by the edge itself.
10.4. A GEOMETRIC DATA STRUCTURE
299
• MeshVersionFormatted 0 • Dimension 2 • Vertices 6
(xA,yA,i), (xB,yB,l), (a?c,yc,l), (*D,yD,l), (xE,yE,l), (xF,yF,l) • Edges 6
(A, B, I), (B, C, 1), (A, E, 1), (E, D, 1), (F, D, 1), (F, C, 1)
• SubDomain 1 2 4 - 1 10 • Corners 5 ABC DE Six points have been implicitely defined11, as well as six edges, the domain is on the "right side" of the edge number 4, alias ED and its material number is 10. The edges AB, BC, AE and ED will be approximated by straight lines, the "curve" F is the union of the segments FD and FC with a tangent defined at F due to DC (as F is not a corner) and, at D (resp. at C), a tangent supported by FD (resp. FC) as D (resp. C) is a corner, thus F will be a piecewise curve of degree two. Remark. If the edge number 4 is DE (instead of ED), the sub-domain must be described by the sequence 1 2 4 1 10 instead of 1 2 4 - 1 10. How do we define the geometric data structure so that F can be a circle (at least a curve closely approximating a circle)? It is only necessary to enrich the structure by providing more points along F, then an approximation of degree two will be obtained for each terminal sub-segment and of degree three elsewhere. One may also define the tangents at the endpoints so as to obtain an approximation of degree three everywhere. One may notice that we do not explain how to construct the desired data structure from a practical point of view. Clearly a CAD type preprocessor will be in charge of this task. 10.4.2
A few remarks about three dimensions
In this dimension, the required fields are the following • MeshVersionFormatted 0 • Dimension (I) dim 11
In this example, a point and its number stand for the same thing, for instance the point A is the same as the point with number A.
300
CHAPTER 10. DATA
STRUCTURES
• Vertices (I) NbOfVertices ( ( (R) x? ,j=l,dim) , (I) RefVi ,i=l , NbOfVertices )
• Triangles (I) NbOfTriangles ((«VertexJ,j=l,3), (I) Reftf
, i=l , NbOfTriangles)
• Quadrilaterals (I) NbOfQuadrilaterals ((overtexf ,j=l,4) , (I) Reftf , i=l .NbOfQuadrilaterals) • SubDomain (I) NbOfSubDomain ((I>*«pe,-,
l^;":^
cSuad! } > (^Orientation,, (I)
i=l , NbOfSubDomain ) then, the optional fields are • Corners (I) NbOfCorners ( ©Vertex; , i=l , NbOfCorners ) • Ridges (I) NbOfRidges ( QEdge, , i=l , NbOfRidges ) • RequiredVertices (I) NbOfRequired Vertices ( QVert ext , i— 1 , NbOfRequired Vertices ) • RequiredEdges (I) NbOfRequired Edges ( QEdge; , i=l , NbOfRequiredEdges ) • RequiredTriangles (I) NbOfRequired Triangles iaj , i=l , NbOfRequiredTriangles ) • RequiredQuadrilaterals (I) NbOfRequiredQuadrilaterals ( OQuadj , i=l , NbOfRequiredQuadrilaterals ) • Tangent AtEdges (I) NbOfTangentAtEdges ( @Edget , (I) VertexInEdge , ( (R) x{ , j=l,dim ) , i=l , NbOfTangentAtEdges ) • Normal AtVert ices (I) NbOfNormal At Vertices ( ©Vertex; , ( (R) xj , j=l,dim ) , i=l , NbOfNormalAt Vertices ) • NormalAtTrianglesVertices (I) NbOfNormalAtTrianglesVertices ( QTria,- , (I) VertexInTrian. , ( (R) xj , j=l,dim ) , i=l , NbOfNormalAtTrianglesVertices )
10.4. A GEOMETRIC DATA STRUCTURE
301
• NormalAtQuadrilateralsVertices (I) NbOfNormalAtQuadrilateralsVertices ( QQuad;, (I) VertexInQuad., ( (R) x^ , j=l,dim ) , i=l, NbOfNormalAtQuadrilateralsVertices ) • AngleOfCornerBound (R) 0 • CrackedEdges (I) NbOfCrackedEdges ( flEdgeJ , QEdge? , i=l, NbOfCrackedEdges ) • CrackedTriangles (I) NbOfCrackedTriangles ( QTriaJ, QTria? , i=l, NbOfCrackedTriangles ) • CrackedQuadrilaterals (I) NbOfCrackedQuadrilaterals ( QQuad*, QQuad? , i=l, NbOfCrackedQuadrilaterals ) • EquivalentEdges (I) NbOfEquivalentEdges ( OEdgeJ, ©Edge? , i=l , NbOfEquivalentEdges ) • EquivalentTriangles (I) NbOfEquivalentTriangles ( QTriaJ , OTria? , i=l , NbOfEquivalentTriangles ) • EquivalentQuadrilaterals (I) NbOfEquivalentQuadrilaterals ( QQuadJ, QQuad? , i=l , NbOfEquivalentQuadrilaterals ) • PhysicsRef erence (I) NbOfPhysicsReference ( (I) Reffa , (C*) CommentOnThePhysic , i=l, NbOfPhysicsReference ) • IncludeFile (C*) filename • BoundingBox ( (R) Mini (R) Max; ,i=l ,dim ) The geometric representation of a surface in three dimensions will be detailed hereafter. At this time, one may keep in mind that the triangles (quadrilaterals) provided in the structure will be used to obtain quadratic surfaces using the available information. In particular, it is crucial to find the ridges and the corners, if any. An approximate definition of these two types of entities will not result in a proper definition of the surface near these entities. As will be seen, every element of the data structure will serve as support for constructing a G1 representation of the domain surface by using only the normals (i.e., the tangent plane) at the points defined in the structure; these normals, aim of the construction, must be known as accurately as possible.
302
CHAPTER 10. DATA STRUCTURES
10.5
Geometric representation
A geometric support characterized by a mathematical representation is derived from the geometric data structure.
10.5.1
The two-dimensional case
As previously mentioned, the given geometric mesh is interpreted so as to construct a geometric support used furthermore for boundary meshing purpose, prior to the domain meshing step. The key-idea is to use the edges in the structure for defining a mathematical form 12 of degree three (with possible degeneracies). The construction is completed edge by edge using the available information (tangent, corner, ...). Constructing the representation function. First, we consider an edge, AB, and we assume that we know the tangents at A and at 5, IA and IB, then the edge allows us to define the following curve f ( s ) =o 0 -|- ais + a2s2 + a3s3 where ai € R2 We have
(10.4)
(i = 0, 3) and s is the parameter ranging from 0 to 1.
f'(s) - ai + 2a2s + 3a3s2 .
(10.5)
Hence, the four known pieces of information result in the system :
Whose solution is
12
The mathematical representation described in the following is only an example of what we can do, other forms are possible leading in principle to a similar discussion.
10.5. GEOMETRIC
REPRESENTATION
303
When one or the other tangent is not provided, we look for a function of degree two, i.e., we fix «s = 0, then, if tA is known, we have (10.8)
while if is is known, we obtain a0
A
=
ai =
2(B - A) - CB
a2
-(B-A)+t~B.
=
(10.9)
When no tangent is provided, we look for a function of degree one, i.e., a3 = 0 and «2 = 0 and we obtain
a0 = A ai = B — A ,
(10.10)
meaning that f(s) = A + s(B - A). Another kind of situation is where A and/or B are not corner(s) but we know a point "before" A, denoted as A_i, and/or a point "after" 5, denoted as J5+i, then we can define a function of degree three or two by returning to the previous cases. The tangents at AB in A and/or B are evaluated by using the points A-\ and/or B+\. The final type is determined once the data is combined. Table 10.1 indicates the degree that can be expected for the approximation of AB as a function of the data categories. degree tA tA
A-i tA
A-i A-i
A A A A A A A A A
B B B B B B B B B
tB
tB tB B+i B+i
B+i
3 2 2 1 3 3 3 2 2
Table 10.1 : Degree of the approximation based on the data type.
CHAPTER 10. DATA STRUCTURES
304
Remarks. In general, the function /(s) constructed from two points and the two related tangents may offer different aspects. Some of these may have obviously undesirable characteristics for the envisioned applications. For example, the presence of a loop, i.e., if there are two different values si and 52 for which /(si) = /(s2), corresponds necessarily to a ill-suited input. In fact, we assume that • g(x] is an application. where g(x) denotes the function which associates with every x of the segment AB the value of the function / taken for the s value whose projection on AB is x (cf. Figure 10.6 where AB is horizontal, s, is a value of s and Xi is the related value on AB).
Figure 10.6: f(s) and g ( x ) . The assumed property implies that • the curve has no loop, • the tangent keeps the same sign (if AB is not horizontal, this property must be satisfied after a rotation such that AB becomes horizontal). From a practical point of view, we can also assume that the distance between AB and the curve is bounded by a reasonably small threshold. In other words, the segment AB is close to the curve meaning that the edges in the data structure already correspond to a reasonable approximation of the geometry. 10.5.2
The three-dimensional case
Several methods have been proposed for the construction of composite G1 surfaces starting from a polyhedral triangular representation of this surface,
10.5. GEOMETRIC REPRESENTATION
305
where every triangle defines a patch. In other words, this leads to the construction of a geometric support based on a (discrete) mesh that provides a reasonable description of the surface. To this end, adjacent patches must induce tangency continuity between patches. The initial stage of these methods relies on defining a network of boundary curves (around the boundary of each patch). Then, each patch is constructed from its boundary so as to ensure the desired continuity for the corresponding tangent plane. The method proposed in [Walton, Meek- 1996] defines the tangent planes at each patch boundary independently, i.e., using only the patch boundary curves. Then, to ensure the geometric continuity inside each patch, the classical scheme of [Gregory- 1974] is used. The construction scheme is then as follows (assuming that the surface is G1 everywhere (no ridges or corners)) : • a curved segment of degree 3 passing through the edge endpoints is associated with each mesh edge. It is defined such that the principal normals at the curve endpoints are parallel to the unit normals specified at these points (thus ensuring tangent plane continuity at each mesh vertex), • for each patch, the tangent plane associated with its boundary curve (as described above) is then based on the curve tangent vector and the bi-normal vector (normal to the plane defined by the tangent vector and the principal normal of the Frenet frame system), • for each patch, a Gregory polynomial surface of degree 4 is constructed by increasing the degree of the boundary curves. Before detailing the steps of the scheme, we will review the definition of Bernstein-Bezier polynomials. Then, these steps are described and some examples are given. Bernstein polynomials and Bezier curves. The Bernstein polynonmials
where Cf = in^\\.i\ constitute a basis for the polynomials of degree n defined on the interval [0, 1]. They allow for the construction of Bezier curves that can be written as i=0
with Pi being the control points for the curve.
306
Bezier patches.
CHAPTER 10. DATA STRUCTURES The polynomials
with i + j + k = n allow for the construction of patches whose form is
where the /^,j,jt's are the control points for the patch under consideration. Gl patch associated with each triangle. We consider a triangle K with vertices PI, PI and P% and we suppose that the normals nt (i = 1, 3) at the surface at these points13 are given.
Figure 10.7: T/ie boundaries of the patch associated with the triangle K (example shows edge number 2 of this triangle). The first part of the construction deals with the definition of cubic curves modelling the edges of K. Then, one will turn to the construction of the surface associated with K having these curves as boundaries. With every edge of K is associated a cubic curve. Hence, for the first edge (cf. Chapter 1 for the numbering convention, edge i is opposite to vertex i), if C^(t) denotes this curve, we have
13
In the following formula, P* is the same as PI and PS as PI. The same convention applies to the indices at the normals.
10.5.
GEOMETRIC REPRESENTATION
307
with Vi?o = PI, Vi,3 = PS, the edge endpoints, and V\,\,V\,i computed as indicated hereafter. More generally, we define the three curves Cf~ (t) related to the three edges of K, with Vi,Q = />•+!
(10.13)
Vi,3 = Pi+2
(10.14)
Vi,i = K',0 + otdi (67, - 2yw + (nni+i)
(10.15)
Vi,2 = V-,3 + adi (67,- + Pini - 2c7t-nt-+i)
(10.16)
where i is the number of the edge under treatment, a = ^, pt ; = 6 "''^"a"*'1 ^ a a> ^ _ 6 a''*4-a. s '° , with, at last a,- = n t -.n t -+i, a;o' = ^-.7,- and a t '1 = nt-+i.7,-
where we have 7,- = following property.
*'3^ '|0 and rfj- = IJV^a — Vi^oll- The result is the
Proposition 10.1. The curve C^ joins the two endpoints of the edge i of triangle K and the curve's normal at t = 0 is parallel to nt-+i as its normal at t = 1 is parallel to n t+2 . This proposition is proved in [Walton, Meek- 1996]. The vector tangent to the curve Cf" (t) is a quadratic Bezier curve of the form
with Witk = Vi,k+i - Vijk for k = 0, 1, 2. At this time, we have defined the curves for the edges of K. We still need to define the corresponding surface. Figure 10.7 shows the construction for edge number two of the triangle. For this task, the required data is the two endpoints, PS and PI, i.e., the values of 1/2,0 and V^,3 respectively and the two normals 713 and n\. We define thus V2,i and ^2,2 and obtain the three tangents W^i , i — 0,2 (plotted using arrow lines in the figure). A degree four patch can be associated with the triangle A', whose expression is
where the /^,j,&'s are respectively defined now. First we have P4)0,0 - PI ,
(10.18)
308
CHAPTER 10. DATA STRUCTURES
Figure 10.8: The patch associated with the triangle K (the control points are used to define the desired representation). ^0,4,0 = ^2,
(10.19)
Po,o,4 = Ps-
(10.20)
To obtain the Pi,j,k's of the formula other than these, we use a technique to increase the degree of a curve so as to obtain a degree four for the above C^ (i)'s curves starting from the current degree three curves. To this end, we introduce the following control points
for i = 1, 2, 3 and j = 1, 2, 3 (for j = 0 we meet the definitions for the three vertices above). These points allow us to obtain the Pjj^'s by means of the relationships : PO^-J = L0jJ , (10.21) Pj|4-,-,o - LIJ ,
(10.22)
P4-j,o,j — L2,j • (10.23) We still need to define the control points inside the patch, i.e., the points PI, 1,2) Pi,2,i and P2,i,i so a sto complete the definition of S A (r, s, t). This construction is rather technical and is given in several steps. The Cf" (£)"s are known, thus the Wij's are known. If
10.5. GEOMETRIC REPRESENTATION
309
where the A,-j's are
One can prove that the Cf" (£)"s and the H* (£)'s allow us to define a suitable continuity between the patches. One constructs the values Dij for i = 1,2,3 and j = 0,1,2,3.
Using these D,-j's and the C^ (£)'X we obtain the A^-'s, for z = 1,2, 3.
Using the Dijs and the //(^)'s, we obtain the /Wj-j's, for i = 1,2,3.
From the A l?J 's, the //;,j's, the Z/ij's, the At-j's and the W,-,j's, we deduce the Gt-j's, for z = 1,2, 3 and j = 1, 2.
310
CHAPTER 10. DATA STRUCTURES Then, one may obtain the desired control points. This gives successively
The patch is then well defined via the expression 10.17 and the relations 10.18 to 10.26. Proposition 10.2. The resulting surface is Gl. This property results from the fact that the edges, patch interfaces, defined only by the endpoints and normals, allow us to define a unique tangent, thus ensuring the desired transition from one patch to the next. Moreover, the constructed curves depend only on one triangle (thus a patch can be dealt with independently from the others) and do not require other information. For instance, they are independent from the third vertex of the triangle. A simple example. On Figure 10.9 a surface is displayed (by means of a mesh) resulting from the above process for a single triangle given through its three vertices and the normals at these points. The case of a complex domain with no singularities. On the righthand side of Figure 10.10 is shown a surface (via a mesh) which was obtained by using the previous method applied to the surface of a geometry described by the triangular mesh as shown on the left-hand side of the same figure. Two plots are given for each case, the entire surface (on top) and an enlargement (bottom). The case of a realistic domain. For such realistic geometry (a mechanical part for instance), there are, in general, several singularities (corners and ridges). Thus, the above method does not directly apply everywhere. The resulting surface will be G1 except in the neighborhood of these singularities that will be considered using the same algorithm while prescribing the tangent values so as to locally be G°. Indeed, applying this method to compute the tangents will result in small gaps between patches.
10.6. MESH DATA STRUCTURE
311
Figure 10.9: G1 patch associated with a triangle.
10.6
Mesh data structure
The mesh data structure, which is the output of a mesh generation algorithm, refers to the geometric data structure and in some cases to another mesh data structure. 10.6.1
The two-dimensional case
In this case, the fields are : • MeshVersionFormatted 0 • Dimension (I) dim • Vertices (I) NbOfVertices ( ( (R) xj ,j=l,dim) , (I) Reftf
, i=l,NbOfVertices )
• Edges (I) NbOfEdges ( evertexj, CVertex? , (I) Ref^ , i=l, NbOfEdges ) • Triangles (I) NbOfTriangles ( (\ , i=l,NbOfQuadrilaterals) • Geometry (O) FileNameOfGeometricSupport
312
CHAPTER 10. DATA STRUCTURES
Figure 10.10: Definition mesh andG1 representation.
10.6. MESH DATA STRUCTURE
313
- VertexOnGeometricVertex ;i) NbOfVertexOnGeometricVertex CVertex,, CVertexf 60 , i=l, NbOfVertexOnGeometric Vertex ) - EdgeOnGeometricEdge (I) NbOfEdgeOnGeometricEdge ( CEdge,, CEdgef60 , i=l.NbOfEdgeOnGeometricEdge ) • CrackedEdges (I) NbOfCrackedEdges ( CEdge} , CEdge? , i=l, NbOfCrackedEdges ) When the current mesh refers to a previous mesh, we also have : • MeshSupportOfVertices (O) FileNameOfMeshSupport — VertexOnSupportVertex (I) NbOfVertexOnSupportVertex ( OVert ex,, CVertex*upp , i=l, NbOfVertexOnSupport Vertex ) — VertexOnSupportEdge (I) NbOfVertexOnSupportEdge (cVertexi,CEdge* upp , (R) u?pp ,i=l,NbOfVertexOnSupportEdge) — VertexOnSupportTriangle (I) NbOfVertexOnSupportTriangle ( CVertex,-, CTria* upP , (R) u\npp , (R) v*upp , i=l, NbOfVertexOnSupportTriangle ) - VertexOnSupportQuadrilateral (I) NbOfVertexOnSupportQuadrilateral ( CVertex,-, CQuadrPP, (R) u-" pp , 00 $upp , i=l, NbOfVertexOnSupportQuadrilateral ) 10.6.2
The three-dimensional case
In this case, the fields are • MeshVersionFormatted 0 • Dimension (I) dim • Vertices (I) NbOfVertices ( ( (R) xj ,j=l,dim) , (I) Reffl
, i = l , NbOfVertices )
• Edges (I) NbOfEdges ( CVertex} , CVertex? , (I) Reftf
, i=l, NbOfEdges )
314
CHAPTER 10. DATA STRUCTURES
• Triangles (I) NbOfTriangles ^ , j = l , 3 ) , (I) Ref$
, i=l , NbOfTriangles)
• Quadrilaterals (I) NbOf Quadrilaterals ((oVertex^',j=l,4), (I) Reftf , i=l , NbOfQuadrilaterals ) • Tetrahedra (I) NbOfTetrahedra ((€VertexJ,j=l,4), (I) Reftf , i=l , NbOfTetrahedra) • Pentahedra (I) NbOfPentahedra ((oVertexf ,j=l,6), (I) Ref r2 and /2 > T\. In our example, r\ = 1, r-z — 1.1 and /!« = /2 = 2. The intersection of the surfaces Si and £2 gives the equation of the curve {1,2} of domain QI as u = t v
— r-
efl 2 ,
from which the coordinates of the points 1 and 2 of domain Q\ are obtained, respectively as (0,r 2 ) and (|,r 2 yl - % ). Similarly, the equation of curve {1,2} of domain ^2 is : u = t
t G [0, arcsin — ] C R
v =
from which the coordinates of the points 1 and 2 of domain ^2 are obtained to be (0,r!) and (arcsin(p-),0) respectively. To achieve the surface meshes in the space (Figure 11.14), we apply the following steps. • We consider the domains 17i and ^2 along with the functions a\ and 01 to be given as input. The domains are defined by a certain number of points which are the control points for their boundaries, while the functions a\ and 02 are specified (see Figure 11.7).
330
CHAPTER 11. BOUNDARY
MESHING
• Applying the function a\ (resp. cr^) to the control points of the boundary of QI (resp. ^2)5 results in control points in R3. Notice that the control polygon of the curve {1,2} in R3 may be obtained in two different ways (as the image of QI by a\ or as the image of f^ by a^). Here we retain the first definition (see Figure 11.8). • From the control points in R3, we deduce piecewise cubic curves passing through these points, and obtain a polygonal geometric support (see Figure 11.9) using a method similar to the two-dimensional method. • We define a discretization of the geometric support based on the curvature radii. The minimum and maximum edge lengths are prescribed as hmin — 10~6 and hmax = 0.2 to avoid any degeneracy. In addition, a relative threshold, e = 10~3, is given to control the gap between the mesh surface and the surface (see Figure 11.10). • The curve discretization in R3 is mapped onto the domains QI and ^2 in R2. To this end, we first compute a piecewise cubic curves passing through these points and then deduce the polygonal geometric support of the two domains (see Figure 11.11). Then, we sample these supports and relate the support discretization in R2 with the corersponding one in R3. This enables us to construct the discretization of the boundary of the planar domains (see Figure 11.12). • We can now create the triangular mesh of the domains QI and fi2 by means of the process described in Chapter 6. Every mesh relies on the previous boundary discretization and matches the curvatures of the corresponding surfaces (in R3} (Ei or £2), see Figure 11.13. • Finally, the image of the domains QI and f^ gives a mesh of the surfaces in the space (see Figure 11.14) by means of a\ and a?..
11.3. BOUNDARY MESHING IN THREE DIMENSIONS
Figure 11.7: Control polygons in R2.
Figure 11.8: Control polygons in R3.
331
332
CHAPTER 11. BOUNDARY
Figure 11.9: Polygonal geometric supports in R"1
Figure 11.10: Discretization of the curves in
MESHING
11.3. BOUNDARY MESHING IN THREE DIMENSIONS
Figure 11.11: Polygonal geometric supports in R2.
Figure 11.12: Discretization of the curves in R2.
333
334
CHAPTER 11. BOUNDARY
Figure 11.13: Surface meshes in R2.
Figure 11.14: Surface mesh in R3.
MESHING
11.3. BOUNDARY MESHING IN THREE DIMENSIONS
11.3.3
335
Surface remeshing using optimization
In this section, we consider a general case and assume that the surface is provided geometrically either directly or by means of an (adequate) mesh. The case where the surface is known directly infers that we are able to obtain the information required for the remeshing process in some way (for example by means of a relevant series of "queries"). When the surface is defined by means of a mesh, this mesh is used to construct a mathematical support as indicated in Chapter 10. This support permits us to again be able to query the surface so as to obtain the necessary information. In addition, we assume that an arbitrary mesh (which may be the mesh serving as geometric support, in the second case) is provided and we aim to propose a method which creates a new mesh. The problem then becomes a problem of remeshing. The information we need for such a remeshing process is the following : • how to locate a point on the surface, • the surface geometry at a given point (minimal curvature radius, principal curvature radii, ...). Then, we define a few local operators so as to • create a point, • remove a point, • swap an edge. These logical operators use local operators, most of them having been described in the previous chapters. More precisely, from a topological point of view, we need to • swap an edge, • remesh a polygon (in order to remove a point). Using this set of tools, it is possible to remesh a surface. The main idea is always the same, we define a metric map and remesh so as to obtain unit length edges in the resulting mesh while maintaining good element quality. The metric reflects the surface geometry. Notice that the surface ridges are processed first. The three entities that are encountered during the remeshing process are the initial mesh, the support mesh which serves as geometric support and the related mathematical representation (or the CAD software) and, finally, the mesh under construction.
336
CHAPTER 11. BOUNDARY
MESHING
Pure geometric remeshing. The metric governing the process is only based on the surface geometry. When the CAD system can be accessed to define the metric, it will be used. However when a discrete definition held, the associated support (cf. Chapter 10) is used. Remeshing according to a physic related map. The metric governing the process is based on both the surface geometry and a (physical) map defined on the initial mesh. To obtain the desired metric from the two given metrics, the metric intersection method is applied to the geometric metric and the physical metric. A remeshing method suitable for surface which is already meshed . The given surface mesh initializes the new mesh. The singularities of the mesh are then found (corners and ridges). Corners are points that must remain unchanged through the process. The ridges are meshed first. To this end, their lengths are computed and, if necessary, points are added so as to form unit length edges. Thus, the mesh of these (peculiar) edges is established. Inserting a point along an edge is done by splitting all of the triangles sharing this edge by joining the point with the vertices opposite to the edge. Edge swapping is then applied if the element quality is improved and the swapped edge still conforms to the geometry. Now, we simply have to analyze the lengths of the current mesh edges. Thus, • an edge with a length greater than one is split into sub-edges that are as close to unit length as possible, • an edge considered too short is removed (if possible). To this end, several methods can be utilized as indicated in Chapter 8.
11.4
Results
To illustrate the methods described within this chapter, we will give some boundary mesh examples. First, the case of a planar curve (isotropic or anisotropic mesh of a segment and an anisotropic mesh of a curved segment) is shown. Then we give some surface examples.
11.4.1
Planar curve mesh
We first consider the simple case of a straight segment and then the case of a curved segment. The isotropic case (the given specification only gives the
11.4. RESULTS
337
lengths) as well as the anisotropic case (the given specification indicates both directions and lengths) are considered. Isotropic mesh of a segment. We consider a straight segment whose endpoints are Q\ and Q$ along with a discrete size map specified at each of the different points Q,. These expected sizes are denoted as hi and we want to mesh the initial segment so as to obtain a set of sub-segments which conform as closely as possible to the given specification. This input specification is displayed in Figure 11.15 and the related values are reported in Table 11.1.
Figure 11.15: Size (isotropic) specification.
Qi Qi
Q2
Q3
Q*
0.0 1.5
3.0 0.5
4.0 2.0
8.0 0.1
Si
hi
Qs 10.0 0.7
Table 11.1: Discrete isotropic specifications at the points Qi. Figures 11.16, 11.17 and 11.18 display the resulting meshes based on the different types of interpolation functions (linear, geometric or sinusoidal). This choice results in the definition of the size variation between two points whose sizes are known. Each figure shows the previously defined points {Qi}, the interpolation function h(s) and the resulting mesh. The latter is the set of segments having the points {#;} as endpoints. The histogram provided with each figure is composed of rectangles for which one side is an edge [Ri,Ri+i]. The intersection points of the curve h(s) with this histogram show that the obtained sizes conform to the expected values. One may notice, as a function of the interpolation selection, the differences
CHAPTER 11. BOUNDARY
338
MESHING
between the different meshes based on the way the size varies from one specified point to the next. Thus, the final mesh is a function of this choice and results in both a different number of elements and a faster or slower size variation from one element to the next.
Figure 11.16: Mesh resulting from a linear interpolation.
Figure 11.17: Mesh resulting from a geometric interpolation.
Anisotropic mesh of a segment. The second example shows the mesh of a segment where a (discrete) anisotropic map is provided. The metrics are specified at the points reported in Table 11.2 (also see Figure 11.19 where the "unit circles" associated with these metrics are shown).
Qi
Qi
Si
0.0 30° 0.70 0.25
Qi 2.0 90° 1.10 0.15
Qs 3.0 0° 0.30 0.30
Q4 6.0 -60° 1.50 0.40
,-, proportional to the Hessian of ibi, in a weak manner for each node is
where w;ts is the finite element P1 base function at node is and CJS is the surface area of the dual cell of node is. L defines the edge length in the metric M.{. Thus, all the edges have a length of L in the metric. •
correcting the Hessian at the boundary nodes in the normal direction by using an average of the values at the internal nodes.
• limiting the eigenvalues by \min = l/h?max and Xmax = \jtiimin where hmin and hmax are the extremal edge lengths that are expected in the mesh. • intersecting the metric M.{ with M.^ for k / i\ following the algorithm described in Chapter 4. The computational scheme includes • the construction of an initial mesh (Figure 12.2, top) which is fine enough to capture the physical behavior of the problem, • a first solution with this mesh as spatial support, • (1) the construction, via the solution Hessian, of the metric maps related to the various variables, • the construction of the global control map by intersecting the previous maps, • the construction of a new mesh which conforms to the metric map above, • the solution of the problem with the current mesh and if the solution is not stable, the whole process is repeated (GO TO (1)).
354
CHAPTER 12. FINITE ELEMENT
12.3.2
APPLICATIONS
Supersonic scramjet
This case regards an Euler type computation for a scramjet at Mach 3. Although the geometry is symmetric, the computation has been performed on the whole domain so as to determine if a symmetric solution can be obtained despite the use of an unstructured mesh. The upper wall is defined by the following 6 points (the dimensions are in meters) : (0.0,3.5), (0.4,3.5), (4.9, 2.9), (12.6, 2.12), (14.25,1.92) and (16.9,1.7). The upper obstacle is defined by the 5 points : (4.9,1.4), (12.6,1.4), (14.25,1.2), (9.4, 0.5) and (8.9, 0.5). The axis of symmetry is defined by the segment joining the points (0.0,0.0) and (16.9, 0.0). Six adaptive loops have been processed separated by 400 iteration steps in the Navier-Stokes solver. The resulting solution is symmetric even though the mesh is an arbitrary mesh. One may notice that the solver handles the large distortions included in the mesh and does not produce any oscillations. The adaptation coefficients are the following ""min — ^5.10
,
hmax = 2.,
L — 10
Due to the complexity of the configuration, a similar computation with a uniform structured mesh should require the use of about 107 points so as to obtain he same accuracy for a regular discretization of the domain consisting of elements sized as hmin. In our case, the finest mesh includes 30, 000 points (i.e., a gain of a factor 300 w.r.t. the number of points). Moreover, the mesh adaptivity reduces the cost of the computation because of its multigrid effect. In this respect, only 2,400 explicit iteration steps were needed for the convergence. On the other hand, as a local time-steping strategy has been used, the adapted mesh method leads to great advantage as using a regular grid cannot result in such an effect. Figures 12.2 and 12.3, respectively, depict the meshes and the isodensity contours at different iteration steps including the step 0 (initial configuration), the steps 2 and 6 (final configuration). The initial mesh includes about 4,000 points, at iteration step 2, it includes about 23,000 points and, finally, at step 6, it has about 30,000 points. Thus the number of points remains almost constant between steps 4, 5 and 6. At iteration step 6, the maximal stretching is in the range of 120 and the CPU time to construct the mesh is about 30 seconds on an HP735/99Mhz workstation (i.e.,^ibout 1% of the total cost).
12.3. THREE CFD EXAMPLES
Figure 12.2: Meshes of the Scramjet at iteration steps 0,2 and 6.
355
356
CHAPTER 12. FINITE ELEMENT
APPLICATIONS
Figure 12.3: Iso-density contours at iteration steps 0,2 and 6.
12.3. THREE CFD EXAMPLES 12.3.3
357
Viscous transonic flow for a Naca-0012
This application example deals with a viscous computation around a Naca0012 profile at Mach 0.95 with a Reynolds number of 5,000. A fishtail configuration is obtained including a region of unsteadiness due to the interaction of the straight shock and the wake. One can observe that the intersection of the metrics of the different variables enables us to capture phenomena of different nature such as shocks, boundary layers and wakes. The adaptation coefficients are as follows h"min — O.1U
,
""max
=
!•>
^ ~ O.1U
The adaptive loop includes six steps. For the first three steps, 500 iteration steps of the Navier-Stokes solver have been processed. In this configuration, the region of unsteadiness is located in the wake. Thus, we have first obtained a good description of the flow nature before capturing the unsteadiness feature. For the last three steps, 3,000 iteration steps have been used to capture the unsteadiness feature. Figures 12.4 and 12.5 illustrate the meshes and the iso-density contours at steps 0 (initial step), 2, 4 and 6 (the final step). The initial mesh includes 2,282 points, at iteration step 2, there are 7,697 points, at iteration step 4, we have 17,850 points and at the final iteration, we have 18,003 points. This last mesh is completed in 20 seconds and its maximal stretching factor is about 50.
358
CHAPTER 12. FINITE ELEMENT
APPLICATIONS
Figure 12.4: Fish Tail, meshes and iso-density contours.
12.3. THREE CFD EXAMPLES
Figure 12.5: Fish Tail, meshes and iso-density contours
359
(following).
360
12.3.4
CHAPTER 12. FINITE ELEMENT
APPLICATIONS
Viscous supersonic flow around a cylinder
The final application example is a supersonic simulation around a cylinder with a unit diameter at Mach 2 and Reynolds number 5,000. The cylinder is in a channel of length 30 and width 10 with slip boundary conditions on the lateral walls. This case appears to be a complex one since it includes some unsteadiness related both to the wake and to the location of the expected shocks. The goal then is to illustrate the capability of the method to follow the shock fronts as the unsteadiness is not limited to only one region as opposed to the previous example. The adaptation coefficients are : hmin = 5.10~3,
hmax = 2.,
L = 3.10'3.
The complexity of the configuration again would require a uniform structured mesh to contain elements of size hmin in order to obtain a similar accuracy. This would require about 6 X 107 (i.e. 30 X 10/(5 X 10~3)2) points. On the other hand, the unstructured mesh requires only about 50,000 points. The adaptive loop includes 110 iteration steps. At each step, 500 iteration steps of the Navier-Stokes solver have been applied. Figures 12.6 to 12.12 depict the meshes and the iso-density contours after 60 and 110 adaptive loops. It can be noted that the locations of the shocks change from one step to the next and that the adaptive process follows this movement. While the complexity of these configurations does not permit such a computation with a uniform structured mesh. The metric intersection enables us to capture shocks, boundary layers as well as wakes and contact discontinuities. The mesh at iteration step 60 has 50,883 points while at iteration step 110, it includes 54,460 points, the time required for the mesh construction is about 74 seconds and the maximal stretching factor is about 170.
12.3. THREE CFD EXAMPLES
Figure 12.6: The cylinder mesh at iteration step 60.
Figure 12.7: Mesh enlargement.
361
362
CHAPTER 12. FINITE ELEMENT
APPLICATIONS
Figure 12.8: The cylinder mesh at iteration step 110.
Figure 12.9: Mesh enlargement.
12.3. THREE CFD EXAMPLES
Figure 12.10: Mesh enlargement at iteration step 60.
Figure 12.11: Mesh enlargement at iteration step 110.
363
364
CHAPTER 12. FINITE ELEMENT
APPLICATIONS
Figure 12.12: Iso-density contours at iteration step 60. ll/WiljJJlLLiJ
Figure 12.13: Iso-density contours at iteration step 110.
12.4. NOTES
12.4
365
Notes
The application examples depicted in this chapter merit a few comments. One can notice that the given examples are CFD problems and that only the two-dimensional cases have been considered. One can also remark that the metrics involved in the adaptive loops have been obtained by means of the Hessian of the various variables of the problem. Regarding the spatial dimension, there is currently no automatic mesh generation method fully available for anisotropic mesh creation purpose. This does not mean that no adaptive computations have been performed. In this respect, the construction of anisotropic boundary layers for CFD problems can be envisioned using an advancing front approach. This approach allows for the creation of several boundary layers (in general by means of pentahedra) that are furthermore joined with the elements resulting from an automatic mesh generator applied to the rest of the computational domain. Another way for constructing an (isotropic) adaptive mesh is to use a classical mesh generation method by introducing several control points (or sources) which govern the sizing in the mesh algorithm. Another approach can be adopted which starts with a mesh resulting from a given method and applies some form of mesh optimization (cf. Chapter 8). We refer the reader to [Ladeveze et al, 1991] for the construction of adaptive meshes for structural mechanics applications and, in particular, for the error estimates. In this paper, different applications (static or dynamic) are considered for linear or non-linear problems. With respect to the construction of the required metric maps, we have described one way to obtain such maps by means of the Hessian of the problem variables (when a P1 approximation is used). Obviously other methods can be advocated for obtaining these metric maps. The relevant literature is highly recommended concerning a posteriori error estimates (for instance, one may consult [Babuska,Rheinboldt-1978], [Verfurth-1996] and, for a comprehensive overview of the more recent papers, see [Bernardi-1996]). In this respect, methods based on residual analysis, local problem solution, hierarchical approaches or average-based methods are mainly found. On the other hand, in some cases a priori error estimates may be involved to define the metric map serving at governing the process. Anyway, the purpose of this book is not to thoroughly cover the area of error estimates and thus we refer the reader to the above references.
This page intentionally left blank
Chapter 13
Other applications 13.1
Introduction
Delaunay triangulations and Delaunay-type meshes have proven to be useful in several fields of application, some of them being more or less related to finite element problems, while others concern other areas of application. This chapter does not claim to exhaustiviely cover all applications of the Delaunay triangulation method. However the objective is to show that this type of triangulation can be used for several specific applications. To this end, several examples are selected and described in the following sections.
13.2
Medial axis and medial surface
Let fi be a domain of Rd where the problem of interest is to find the medial axis (d = 2) of the domain or its medial surface (d — 3), also referred to as the skeleton of Q. From a practical point of view, we assume that the domain is described by means of a discretization of its boundary, i.e., a polygonal line in two dimensions or a polyhedral surface in three dimensions.
13.2.1
Medial axis
Let us first briefly give the definition of the medial axis of a polygon. Definition 13.1. The medial axis of a polygonal domain is the locus of the centers of the circles of maximum radius that can be inscribed in the domain. Actually, we are interested in a discrete approximation of this "line". We denote with F the boundary of fi and we assume that F is discretized
368
CHAPTER 13. OTHER
APPLICATIONS
by a set of edges. Then, the following theorem holds. Theorem 13.1. If h tends to 0, where h is the length of the longest edge of the discretization of the boundary F and ifM is the empty Delaunay mesh of ft, then the union of the segments formed by joining the centers of the circumscribing circles associated with the elements of M, considering each pair of elements sharing an edge, approaches the skeleton of ft. Proof. This proof is given as an exercise. Notice that as h —> 0, the boundary discretization is Delaunay admissible, then it is sufficient to prove that the centers of the circumcircles are inside ft and belong to the desired skeleton. D Remark.
An empty mesh of ft exists as shown in Theorem 3.1.
One can refer to [Armstrong et al. 1995] for a detailed description of a medial axis extraction method starting from an empty Delaunay mesh. From a practical point of view, the boundary discretization is not, in general, infinitively fine and the previous construction is not realistic. A similar idea relies on analyzing the elements of the mesh M using adjacency relationships. This results in a series of segments constructed as follows • (1) if an element includes one boundary edge a, we define the segment whose endpoints are the midpoints of the edges others than a, • (2) if an element includes two boundary edges ai and 02, we define the segment joining the endpoint shared by ai and a? with the midpoint of the third edge, • (3) if an element does not include any boundary edge (or includes three such edges), we define the point G, centroid of the triangle and we define the three segments joining G with the midpoints of the three edges. The union of the so-defined segments forms a polygonal line denoted by P which does not correspond to the exact skeleton of the domain but is easy to obtain and may be used for many applications.
13.2.2
Medial surface
First, we give the definition of the medial surface of a polyhedron. Definition 13.2. The medial surface of a polyhedral domain is the locus of the centers of the spheres of maximal radius inscribed in the domain.
13.2. MEDIAL AXIS AND MEDIAL SURFACE
369
Theorem 13.1 can be formally applied in three dimensions. The difficulty results from the fact that it is tedious to construct an empty Delaunay mesh for an arbitrary polyhedron (see Chapter 3). The existence itself of such a mesh is in general not well established. Nevertheless in the case where the discretization of the domain boundary is Delaunay admissible (cf. Chapter 3), a solution exists that can be used to construct the desired surface.
13.2.3
Several applications based on the skeleton
We assume that the domain skeleton (medial axis in two dimensions, medial surface in three dimensions) is provided. This skeleton provides a topological knowledge of the domain and thus can be used for several interesting applications. Domain partitioning. In this case, the skeleton acts as a support for the partitioning of the domain into sub-domains. Idealization. The skeleton is analyzed so as to determine local topological properties of the geometry (these properties concerning either small or local features). Hence, under some conditions, it is possible to • identify the principal characteristics of the geometry (inertial axis, branch detection, ...), • simplify the geometry by removing some details while preserving the general shape of the domain. Dimension reduction. The skeleton is considered as a dimensional reduction of the domain on which it is based. In two dimensions, a polygonal domain is replaced by a series of lines, while in three dimensions, a polyhedral domain is replaced by a series of surfaces. Quadrilateral meshing. Using the skeleton and the partition of a domain ft of R2 it is possible to obtain several sub-sets of f2 which are polygons with a limited number of sides. For a three-sided or a four-sided polygon, applying an algebraic mesh generation method (for instance, see [Cook-1974]) allows us to obtain a quadrilateral mesh (after splitting any triangles into three quadrilaterals using their edge midpoints). For the other polygons, a subdivision method introducing midpoints on each side allows us to return to the previous simple case.
370
13.3
CHAPTER 13. OTHER
APPLICATIONS
Parallel computing
Parallel computing is a solution to handle large size problems (i.e., with a large number of unknowns). When coupled with a domain decomposition solution method, this approach needs to construct the mesh of several subdomains whose union covers the entire initial domain. These sub-meshes must enjoy a series of properties and must make communication possible between sub-meshes. From the algorithmical point of view, regarding the meshing point of view, a parallel computation relies on a partitioning of the domain consisting of several meshes (so as to furthermore distribute the computation on the various processors, where one processor is in charge of one sub-mesh). Constructing this partitioning, as well as constructing each of the sub-meshes, can be achieved using many different approaches. Actually, three kinds of approaches can be found that we would like to briefly discuss hereafter. (The purpose of this section is not to provide a detailed study of partitioning methods, but solely to mention some ideas related to the a posteriori methods and to introduce an a priori method based on an extension of Delaunay-type algorithms).
13.3.1
A posteriori partitioning
Provided a (fine) mesh of the domain under consideration, an a posteriori partitioning method splits this mesh into sub-meshes so as to extract the sub-domains. Numerous methods exist to address this problem. For more details, we refer the reader to the rich literature about this topic (see for instance [Simon-1991] or [Farhat,Lesoinne-1993]). The main drawback of this approach is that the necessary memory requirement to complete the partitioning is approximately the sum of the size needed to store the initial mesh and the size of at least one of the sub-meshes. Furthermore, various classical difficulties related to the partitioning methods are observed (related to the sub-meshes, load balancing, the interface smoothness, the interface sizes, etc.). An important remark. This a posteriori approach is most likely the worst way to perform the parallelism at the mesh level. Nevertheless, this method leads to good results for reasonably sized meshes. Conversely, if the size of the problem is very large (for instance, of the order of several million elements), the creation of the initial mesh may not even be possible. For instance, it is possible to achieve a mesh with about 9 millions elements (cf. Table 7.2 at Chapter 7) but, while it is possible to create a mesh a little bit larger, this mesh usually cannot be written onto a file for memory size
13.3. PARALLEL COMPUTING
371
reason. Hence, the a priori approach makes sense, even though it requires more effort in order to make it reasonably efficient.
13.3.2
A priori partitioning
Following this approach, we will attempt to avoid the difficulties and weakness related to the a posteriori method (large memory space requirements, no parallelism at the mesh generation step, etc.) by first constructing a partitioning. This step may start either from a coarse mesh (i.e., with a small number of elements) and then by constructing the mesh of the different members of the partition concurrently, thus taking advantage of the parallelism from the mesh generation step. Another approach starts only from the surface mesh of the domain. The major difficulty expected with this method is to find an appropriate method ensuring a good load balancing between the different submeshes and to define a suitable way to handle the interface between the sub-domains. Indeed, the load balancing can be addressed by using the information provided by either a coarse mesh or the surface mesh. For the first approach, we can consider the empty mesh as defined in Chapters 5 or 7 or a mesh with a relatively small number of internal points as the coarse mesh. For the second approach, the coarse mesh will be constructed using the surface mesh as sole input data. Similarly, the sub-domain interface, irrespective of the method, must be constructed using either the coarse mesh or the surface mesh. The purpose of the following sections, is to discuss these two methods. To this end, we introduce the notion of an inductive Delaunay triangulation.
13.3.3
Partitioning by inductive Delaunay triangulation
As a complement to Chapter 2, we define herein the notion of an inductive Delaunay triangulation. We consider an "ideal" context where the set V of points in R3 is assumed to be in a general position. Then, the sets (cf. Chapter 2) Vi = [P £ R3 such that
d(P, Pi) < d(P, P,),
Vj ^ *}
(13.1)
where d(.,.) is the usual distance from point to point, defines the Voronoi cells whose dual is the Delaunay triangulation of Conv(P], the convex hull of P. This triangulation satisfies the empty sphere criterion. Provided a plane, denoted as (II), we assume that this plane • does not pass through any vertex of the cells V;,
372
CHAPTER 13. OTHER
APPLICATIONS
• intersects at least one bounded Voronoi cell. As a consequence (of the first assumption), any vertex of the cells Vj , as hereafter defined, will be of degree three (meaning that a vertex is shared by exactly three cells). Then, the sets \/.(n) = {P € (H) such that
d(P, Pi} < d(P, PJ),
Vj + i]
(13.2)
where rf(., .) is the usual distance between two points and the P, (Pj) are in jR3, define Voronoi cells in (II) which constitute a set of polygons, where in fact Vj = Vin(II). The dual of this set is a series of triangular faces, 3 in R , joining the Pj's whose cell Vj ' is a non empty cell. The duality relies on constructing the edge PiPj in R3 since V/ ' and Vj ' share an edge. This set of triangles verifies a criterion similar to the classical empty sphere criterion. On the one hand, we will show (in Proposition 13.1) that the union of the faces /"(n) is a planar graph and, on the other hand (in Proposition 13.2), we will further clarify the above criterion. Proposition 13.1. The set JF(n) is a planar graph. Proof. The Voronoi induced cells V^ ' are convex polygons in (II) and, by definition, their union constitutes a conforming partition of (II) (in the sense that the intersection of two cells is either empty, or reduced to a vertex or an edge). Assuming that every cell represents a node of the graph and that the adjacency relationship by an edge is a graph edge, then this graph is planar. D Proposition 13.2. PiPjPk is a face of F if and only if both the three Voronoi induced cells, V^ ,Vj and V^ , are non-empty and these three cells share a vertex. By definition, Proposition 13.2 holds and the vertex common to the three cells is the point on (II) which is equidistant from PJ5 Pj and P&. As a consequence, PiPjPk is a face of F^ if the sphere passing through /^, Pj and Pk centered at a point of (II) is empty (Figure 13.1). Remark. In the case where the first part of the initial assumption is not satisfied, then there exists a vertex of the inductive Voronoi cells equidistant to four points of P and the dual is a quadrilateral. The following proposition is an alternative characterization of the inductive Voronoi cells of (II).
13.3. PARALLEL COMPUTING
373
Figure 13.1: The inductive empty sphere criterion. Proposition 13.3. The set of faces JT(n) is a sub-set of the set of faces of the Delaunay triangulation ofConv(P). Proof. If S(n) stands for the point intersection of (II) with the edge common to three Voronoi cells related to P, then • the dual in R3 of this common edge is a face of the Delaunay triangulation of P, • the dual of £(n) is a face of ^ n ). Hence every face of J^^ is a face of the triangulation of P.
d
As a corollary, the following result holds Proposition 13.4. Conv(P).
The union of the elements of F^ separates
It is then possible to split Conv(P) into two parts.
13.3.4
Partitioning a set of points by induction from the Delaunay triangulation of the convex hull.
Provided a set of points P and a plane (IT). We construct the Delaunay triangulation of P (in fact, that of Conv(P}}. The construction of a partitioning consisting of two parts of Conv(P) can be obtained by identifying the faces of the triangulation whose circumsphere with centers on (II) is empty.
374
CHAPTER 13. OTHER APPLICATIONS
Remark. If (II) intersects only unbounded edges of the Voronoi cells in .R3, then j^(n) consists of the faces of the Delaunay triangulation of V belonging to the boundary of Conv(P] and thus is not a separator. This fact justifies the second part of the initial assumption regarding the given plane. 13.3.5
Partitioning from the domain boundary
In this case, we use the surface discretization of a domain in R3 to obtain a separator enabling us to split the given domain which has not yet been meshed. The construction of this separator is based on the inductive extension of the Delaunay triangulation as described above. Provided that the surface discretization of the domain is Delaunay admissible (cf. Chapter 3) and defining P as the set of the vertices of the surface triangles, we recall that if the triangulation of Conv(P) is given, then a triangulation of the separator can be easily obtained. In fact, one needs only to find the Voronoi cells in R3 which intersect the plane (II) and to construct in R3 the network of triangles forming the desired triangulation which involves the duality of the Voronoi cells in (II). It may be observed that, on the one hand, this triangulation (in fact, this mesh) may include some faces exterior to the domain and, on the other hand, that it is empty in the sense that the element vertices are only the points of Conv(P) (as no points have been added). A few questions are still open : • the surface triangulation is not Delaunay admissible (thus the above method cannot be directly applied to define a triangulation of a separator) , • the points must be created on the separator so as to enrich this separator (the goal being to obtain a mesh suitable for a finite element type application), • the plane (II) must be effectively defined, in the case where a meshed surface is considered and not a convex hull of points. Scheme for the separator construction. We consider a set of points P which are the vertices of a mesh of a surface F which discretizes the boundaries of a polyhedral domain Q. In addition, we consider a plane
13.3. PARALLEL COMPUTING
375
(II). The question then is to construct a separator for P and to derive from it a partitioning of Q. First of all, besides the above problems, we have to notice that the given problem is slightly different from the problem previously discussed. The context is no longer "ideal", the points are not in general position and the domain is not a convex hull problem. Before describing the partitioning method, we would like to indicate the scheme of the construction. Provided a plane (II), the proposed method consists of : • finding a polygonal line (a set of edges), £, such that — all of the edges of C are edges of F, - the line £ is Delaunay admissible with respect to the inductive empty sphere criterion, • inserting the points of £ so as to complete the Delaunay triangulation of a surface whose boundary is C (this is a three-dimensional triangulation problem where the topology is two-dimensional). Upon completion of this stage, we have a empty mesh of the above surface. Then, one has to • create points on this surface (by means of inserting points along the mesh edges as discussed in Chapter 5), • insert these points and repeat the process as long as a point is created. A mesh of the above surface is obtained once this stage is completed. This mesh is the desired separator. As a consequence, two sub-domains can be defined whose boundaries consist of the union of • the mesh of the above separator, • and the relevant parts of the mesh of F. By iterating this process, the initial domain can be split into two or more sub-domains. The interface between two sub-domains is constructed in a unique manner and then a mesh construction algorithm (as described in Chapter 7) can be applied in each sub-domain whose union covers Q, and whose interfaces are conforming. It may be noticed, as a positive effect of the proposed method, that the mesh generation method can be used in parallel. We now turn to give some details about this set of construction stages. At this time, we assume that the plane (II) is given (furthermore we will address the problem of how to define this plane).
376
CHAPTER 13. OTHER APPLICATIONS
Construction of an empty mesh of the separator. We consider a square in the plane (II) enclosing the region intersection of ft with this plane. This square is meshed by means of two triangles. We find the set of triangles of F intersected by the plane. We insert, using the inductive Delaunay kernel the vertices of these triangles in the initial mesh of the square. The resulting mesh is a set of triangles in R3 which form a polyhedral surface. By extracting from this mesh a polygonal boundary, the line £ (a sub-set of the edges of the intersected triangles) we obtain an empty mesh of the separator. Exercise 13.1. Can the cavity associated with any vertex of an intersected triangle be empty and, if so, is it possible to find a line £ suitable to define the separator ? Construction of the final mesh of the separator. The "internal" points are created on each face edge of the empty mesh. The points are then inserted using the inductive Delaunay kernel. The internal point insertion process is similar to that depicted in Chapter 5. Exercise 13.2. Show that the cavity associated with every so-defined internal point is a non-empty set. Possible definitions of the plane (II). Several strategies can be adopted to define the plane (II) which will serve as a support for the separator. The most popular methods consist of : • enclosing the surface F in a box and using the extrema of this box so as to determine the plane, • finding the inertial axes of the domain and using them. The inertial axes are defined through the eigenvectors of the inertia matrix associated with the points of F, i.e., with the set V. This matrix is as follows :
13.3. PARALLEL COMPUTING
377
where G is the centroid of the points of P and Xyx = Xxy (etc., so the above matrix is a symmetric matrix). evaluating the volume of tt and defining a plane so as to balance the volumes, • etc.
One may consult [Galtier,George-1996] and [Galtier-1997] for more details about the construction of the mesh of the separator using this method. Application example. In this paragraph, we depict an example of partitioning for a mechanical device. To appreciate this example, we report the characteristics of the mesh obtained when the whole domain is considered and those of the sub-meshes resulting from the partitioning. The partitioning process has been completed in two phases, first the initial surface has been split into two parts and in turn these parts have again each been split into two parts.
initial surface surface of the first sub-domain surface of the second sub-domain surface of the third sub-domain surface of the fourth sub-domain
np 4,756 1,346 1,435 1,309 1,363
ne 9,512 2,688 2,866 2,610 2,722
Table 13.1: Characteristics of the different surface meshes.
378
CHAPTER 13. OTHER
APPLICATIONS
Figure 13.2: The data: the surface mesh related to the whole domain.
13.3. PARALLEL
COMPUTING
379
Figure 13.3: The output: the meshes related to the surface partitioning.
CHAPTER 13. OTHER
380
entire mesh first sub-domain second sub-domain third sub-domain fourth sub-domain
ne 40,392 2,503 10,764 2,546 10,673 2,269 9,427 2,396 10,095 np 9,161
t 10.32 2.59 2.87 2.22 2.38
APPLICATIONS
Q 9.28 11.05 8.49 21.43 9.28
Table 13.2: Characteristics of the different volume meshes. By observing the initial surface and the four constructed surfaces, we see a nice looking load balancing. So it is if we examine the different threedimensional meshes constructed as compared with the mesh resulting from the initial surface. One may remark, on Figure 13.3, that there are five parts while only four were expected. This is due to the fact that one of the parts includes two connected components. This may or may not be a source of concerns depending on the type of algorithm used in the envisioned computational process. Remarks. The areas that demand more attention, in particular for finite element type application, concern the size of the sub-domain interfaces (in terms of the number of points or elements), their smoothness (in fact, this property is related to the way in which the points are created on the interfaces, by not directly using the plane, but instead using a smoother surface) and the proper load balancing of the sub-domains. Moreover, the assumption that guarantees the validity of the method, i.e., the Delaunay admissibility of the surface F (at least in some neighborhood of (II) on the supporting surface) should probably be avoided.
13.4
Minimal roughness of a surface
We turn here to a surface mesh problem for a cartesian surface defined by a finite set of points. We assume that the points are given in a cartesian manner, (x,y,/(x,y)), where / is the function describing the surface. Let T be an arbitrary triangulation of the points x,y in the plane and let T be the corresponding triangulation defined in R3 by the triples (x,y,/(x,y))'s related to the (x,y)'s. The roughness value of T is the quantity
13.5. NOTES
381
where Ki is a triangle of T, n being the number of elements in T and |