Polyhedral Mesh Generation PDF
Polyhedral Mesh Generation PDF
Polyhedral Mesh Generation PDF
net/publication/2555276
CITATION READS
1 179
1 author:
Wayne Oaks
Acorn Engineering
2 PUBLICATIONS 7 CITATIONS
SEE PROFILE
All content following this page was uploaded by Wayne Oaks on 14 August 2015.
ABSTRACT
A new methodology to generate a hex-dominant mesh is presented. From a closed surface and an initial all-hex mesh that
contains the closed surface, the proposed algorithm generates, by intersection, a new mostly-hex mesh that includes polyhedra
located at the boundary of the geometrical domain. The polyhedra may be used as cells if the field simulation solver supports
them or be decomposed into hexahedra and pyramids using a generalized mid-point-subdivision technique. This methodology is
currently used to provide hex-dominant automatic mesh generation in the preprocessor pro*am of the CFD code STAR-CD.
Keywords: mesh generation, polyhedra, hexahedra, mid-point-subdivision, computational geometry.
1.1 Motivations On the one hand the direct usage of polyhedra as cells
requires a solver able to handle them so that STAR-CD list
The all-hex methods just mentioned, although very of acceptable cell shapes has been extended to include a
promising, may present some limitations when applied to certain number of simple polyhedra.
the most extreme geometrical cases that can be encountered
in the industry-related Computational Fluid Dynamics On the other hand, if an extension of the mid-point-
(CFD) and Stress Analysis (SA) simulations. Hex- subdivision [11] is applied to the whole new mesh
dominant algorithms have been proposed in an attempt to (including the polyhedra), as explained later, the result is a
overcome the problem. The hex-dominant algorithms use set of hexahedra and a much smaller set of pyramids.
one (or more) all-hex method but, when the all-hex method As a result, the proposed methodology has the potential to
fails or in regions that are likely too complex for such generate meshes for all the solvers that accept hexahedra
method, then create more tractable shapes (typically and pyramids, i.e. the majority of Finite Elements (FE) and
tetrahedra, prisms and pyramids). FV programs.
In this paper we present a different approach to generate a
hex-dominant mesh. If the constraint of using only 2. THE INITIAL MESH
hexahedra is released, it becomes acceptable to generate a
hex-dominant mesh using any kind of shape or more The initial mesh is a hexahedral mesh that must cover the
generally a polyhedron, provided that the overwhelming whole domain of interest. The initial mesh may be
majority of the mesh is still composed of hexahedra. structured or unstructured. Trivial ways to create the initial
mesh include:
1.2 Polyhedra in the framework of Finite
• Cartesian mesh generation
Volume and Finite Element methods
• Cylindrical mesh generation (if the domain to be
Meshing may be defined as the process of breaking up a
meshed presents an axis of symmetry).
geometrical domain into smaller and geometrically simpler
sub-domains (the cells) which should allow the solution of • Trans Finite Interpolation [12].
the discretized partial differential equations (PDE) that
describe the behaviors of the fields involved in the physics Moreover any combination of such techniques may be used
of the phenomenon. to mesh different parts of the domain.
In CFD one of the most popular ways of solving the Euler We found that unmodified initial grids may lead to the
or Navier-Stokes equations is the Finite Volume (FV) generation of very small cells when the surface is close to
method, which is based on the concepts of cell faces and one or more nodes of the cells. To overcome this difficulty
flux through those faces. The method itself does not depend we perform an adjustment procedure on the nodes of the
on the shape of the cells if the cell faces can be correctly initial grid.
defined. In this case a (convex) polyhedron may be used to
We propose two different simple methods of accomplishing • Curvature of the closest boundary
the task:
• Interactive user input
1. Projecting the nodes of the initial mesh onto the
surface when they are close to the surface. Here A cell can be marked by one of the above criteria and split
close means that the distance is smaller than a into 8 cells. All the information related to the cell neighbors
specified small fraction of the cell size. is automatically updated. Other interesting improvements
are under evaluation. For examples it would be useful to
2. Moving the nodes of the initial mesh away from automatically create a roughly body-fitted initial mesh.
the surface when they are initially close to the
surface. 2.1 Basic Methodology
To move a node far from the surface, first we find the We may consider the core of the polyhedral mesh
vector from the node to its projection onto the surface, and generation as an intersection operation between two b-rep
then we move the node in the opposite direction up to a solids: the triangulated boundary surface S and the initial
specified distance from the surface hexahedral cell C, whose faces, without loss of generality,
Another reason to move the mesh nodes close to the surface can be triangulated in a unique manner choosing a point on
onto the surface or away from the surface is that the each face (the face centroid) and connecting it to the four
adjustment modifies the topology of the final mesh. edges, creating four triangles per face. Once the
triangulation is performed we have two b-rep solids whose
In a polyhedron a trivalent node is a node that has exactly boundaries are triangular faces.
three edges and three faces attached, while for a non-
trivalent node the number of edges and faces is not equal to There are fast ways to evaluate approximated intersections
three (typically it is greater). If all the nodes of a such as the Marching Cube Algorithm[13], but it tends not
polyhedron are trivalent the polyhedron is trivalent. to resolve the surface discontinuity leading to a poor
representation of corners and sharp edges. Since it may be
An interesting property of trivalent polyhedra is that when important to represent such details in the final mesh, we
a b-rep solid represented by a trivalent polyhedron is chose to perform an exact intersection.
intersected by another b-rep solid, the result is another
trivalent polyhedron if the faces of the two solid intersect Given two polyhedral solids S and C, the intersection is a
only at the edges and not at the corners, their sharp edges Boolean operation and the result P is yet another polyhedral
have no common point and there is no corner with more solid:
than three sharp edges inside the trivalent polyhedron.
P = S ∩C
The proposed methods generate quite different final (1)
polyhedral cells.
that is formed by:
Method 1 tends to generate a larger number of polyhedra
with non-trivalent nodes than the second one. In fact, the • All components of S that lie inside C and all
initial mesh after the adjustment has several nodes on the components of C that lie inside S.
surface, and the intersection of a cell with a node on the
surface with the surface itself may create a non-trivalent There are several methods available in literature to perform
polyhedron. On the other hand it has the advantage of Boolean operations on b-rep solids (a small bibliography
generating simpler polyhedra with a smaller number of can be found in [14]). However, the computational cost of
faces and this is a desirable property because not all the several thousands or even hundreds of thousands of
polyhedra can be accepted as valid cell by STAR-CD (see intersections between the cells of the initial mesh and the
3.1.) surface can be extremely high. An efficient implementation
If method 2 is applied, no node of the initial mesh is on the of the intersection operation is important for the practical
surface. The intersection creates a non-trivalent polyhedron applicability of this mesh generation method.
only if the cell edges and the sharp edges of the surface As an extension of the boundary operator defined in [15],
intersect or if a surface corner with more that three sharp let us define b() as the operator that extracts the boundary
edges attached is inside the cell. This characteristic is of an entity, providing as result a set of one-dimension-
important to maximize the number of the resulting lower entities. For completeness we may also define the
hexahedra, when using the generalized mid-point- identity operator as I(X)=X.
subdivision (MPS), as we will explain later.
Applying the b() to eqn.(1) yields the following description
The initial mesh does not need to have the property of of the boundary of P (its faces):
conformity (for a definition of conformity see[8]) and an
initial fully connected mesh may be locally and recursively b ( P ) = b ( S ∩ C ) = b ( S ) ∩ C + S ∩ b (C )
refined according to several criteria including: (2)
• Distance from the boundary If we go down another level of dimensionality, we find the
boundaries of the faces, or edges. By applying the
boundary operator b() to eqn.(2) and discarding duplicated We take advantage of an octree-based search and of
entities in the final result, we obtain: Cartesian box intersection to limit the number of
operations.
L = b( S ) ∩ b(C ) + b(b( S )) ∩ C + S ∩ b(b(C )) Once the set of line segments L is found we perform a
(3) merge operation on the nodes of the segments using a small
fraction of the initial cell size as tolerance. This step would
where L is the set of edge segments bounding the faces of not be necessary if we had used exact arithmetic [16] in the
P. The intersection to be calculated consists of three parts: intersection operation. On the one hand exact arithmetic
allows basic geometric algorithms to be built without local
1. Intersection of the faces of the two solids S and or global tolerances, whose usage may lead to catastrophic
C. errors when the comparison of floating-point numbers is
2. The part of the edges of C that lies inside S. used at a logical branch point. On the other hand it has the
3. The part of the edges of S that lies inside C. potential to greatly slow-down the performance of the
algorithm.
Part 2 and 3 of the intersection rely on the ability to
determine if a point is inside or outside a solid. Several Once the set of all the line segments L=b(b(P)) has been
techniques are available to answer point classification found, a graph G is built with them. The edges of the graph
queries for solids. A brief overview can be found in [10] represent the edges of the faces of the polyhedron P. The
(chap.22 pp. 9-10). For our purposes we have implemented task here is to define a reconstruction operator t(L)
a three-dimensional version of the so-called ray-casting b( P ) = t ( L ) = t (b(b( P )))
algorithm. Basically the algorithm shoots a ray in a
coordinate direction and counts the number of intersections (4)
with the triangulated surfaces. If the number of intersection that reconstructs the faces from their boundaries. It appears
is odd the point is inside, otherwise it is outside. In order to from eqn.(4) that the operator t() may be considered the
make the technique relatively insensible to small gaps and inverse of b():
overlaps in the surface all three coordinates direction are
used and a majority rule is applied to the answers. t (b( X )) = I ( X ) = X
We have developed two algorithms to intersect the cells of (5)
the original mesh and the surface keeping in mind the need The target polyhedron, in order to be consistent, must have
of a small computational cost. The first algorithm performs two, and only two, faces sharing an edge and each of its
an exact intersection with a minimum of inside-outside nodes must be at least trivalent. Having these requirements
calculations, which are typically the most expensive part of in mind, the edges of the graph are merged until all the
the intersection, while the second accepts minor nodes are at least trivalent.
approximations in the intersection as a prize to achieve
further reductions in the computational cost. The If we define the faces of a polyhedron as those closed loops
availability of two algorithms with slightly different in the graph with the shortest length, we can apply the so-
behaviors may be useful in case of failure of one of them. called “greedy” algorithm from graph theory [17],[18] to
In the following sections brief descriptions of both are find them. The “greedy” algorithm is able to find the path
presented. with the shortest distance between two nodes of a graph,
where distance (or weight) actually represents any quantity
2.2 Cell-based algorithm that can be associated with an edge.
A direct implementation of eqn.(3) leads to a cell-based A question that arises is: what definition of distance leads
algorithm, in which each cell of the initial mesh is the greedy algorithm to find all and only the faces of the
processed separately and in the same way. polyhedron? Even though we do not claim to have the
general answer we found that the following definition is
Part 2 and 3 of the intersection do not present particular robust enough to find the faces of the polyhedral cells.
difficulties. They are based on the intersection of a line
segment with a triangle, and an inside-outside calculation The weight wij to be associated with an edge that connects
based on the ray-shooting technique. node i and node j and belong to a path p is:
∑v
Volume Processing (3D): in this step, all the faces that
f (l j ) = k ⋅ vk +1 define a volume inside the surface are found. The volume
k bounded by the mesh cell faces is divided into regions that
(7) are either outside or inside the surface. The outside regions
are ignored. The inside regions are completed by
as the out-of-plane penalty for the loop lj. constructing the faces required to close the volume. They
are generated from edges that are defined in only one face.
2.3 Mesh-based algorithm These edges form closed loops. Additionally, if surface
corners are inside the cell, the closed loops are further
A reduction of the computational effort required by the
subdivided to include them using a process similar to the
intersection between the initial mesh and the surface that is
face processing.
the boundary of the volume to be meshed (hereafter known
just as the surface) can be achieved in two different ways: Looking at these results, we see that information from each
level of dimensionality of S and C is required to perform
• Take advantage of common components in
the intersection operation. The cells in the mesh can be
adjacent cells.
looked upon as a probe of the surface S extracting
• Simplify some parts of the intersection. information from each level of dimensionality. The
following table summarizes the flow of information
The mesh-based algorithm starts by building a hierarchy of extracted from the surface.
information about the intersections between the entire
initial mesh and the surface. Information is captured and Mesh Operation Surface
Mesh Previous
stored starting with the lowest dimensionality of the mesh Entity With Entity
Entity Information
Dimension Surface Dimension
(0D or corner points of each cell) and finally looking at the
volume of the hexahedral cell. Inside /
Corner None 0 3
Outside
This approach serves two purposes. Since mesh details at
lower dimensions are shared by many cells (in a structured Intersects
Edge Corner 1 2
mesh, a corner is shared by 8 cells, an edge by 4 cells and a Surface
face by 2 cells), it reduces the computational time by Pierced by
processing each component only once instead of once for Face Edge 2 Surface 1
each sharing cell as in the cell-based algorithm. Edge
Additionally, by using a common definition for each entity,
Contains
mesh conformity is automatically preserved. The algorithm
Volume Face 3 Surface 0
executes the following steps to evaluate the sidedness of Corner
the hierarchy of components:
Corner Processing (0D): for each corner point of the mesh
cells, determine its sidedness using the Inside-Outside ray- “Previous Information” is the information extracted from
shooting based procedure. the lower level operation that is needed during the current
operation. “Operation With Surface” is the operation
Edge Processing (1D): the mesh cell edges are divided into performed between the mesh entity and the surface and is
segments that are inside the surface, outside the surface or needed to extract information at this level of mesh
on the surface. This is done using the information found in dimensionality. “Mesh Entity Dimension” and “Surface
the previous step for the end points of the edge and Entity Dimension” show, respectively, the dimensions of
calculating the intersections between the edge and the the information used and extracted in the current operation.
surface. The algorithm considers two different types of
intersections: a surface crossing that indicates a transition For what concerns the simplification of the intersection we
of sidedness from inside to outside or vice versa and a note that eqn.(3) can be formally modified by applying the
segment that is entirely contained on the surface. For the two operator b() and t() one after the other to the three parts
latter case, the sidedness of the segment is set to boundary. of the intersection:
Face Processing (2D): now, we take the faces of the mesh L = b( S ) ∩ b(C ) + b(b( S )) ∩ C + S ∩ b(b(C )) =
cells and divide them into areas that are inside the surface, = t[b(b( S ) ∩ b(C ) + b( S ) ∩ b(b(C ))] +
outside the surface or on the surface. This process is done
using the edge sidedness from the previous step and the + t[b(b(b( S ))) ∩ C + b(b( S )) ∩ b(C )] +
information about the face interaction with the surface. In + t[b(b(b(C ))) ∩ S + b(b(C )) ∩ b( S )]
this case, the surface information needed is the location of (8)
the surface edges piercing the face. A set of edges is
formed by retaining the inside part of the face edges.
The modified eqn.(8) shows that, with appropriate 3. CELL GENERATION
reconstruction operators, the line segment set L may be
derived from the following node information: 3.1 Polyhedral cells
• The nodes resulting from intersecting the In this section the actual cell generation is described. Given
edges of S and the faces of C. a set of faces that form a closed volume, the program finds
• The nodes resulting from intersecting the the equivalent three-dimensional cell shape that the faces
edges of C and the faces of S. define by combinatorially comparing them with the faces of
a list of acceptable cells. Many of these cells will be
• The sidedness of the nodes of C respect to S. ‘traditional’ cells found in most FV and FE codes:
tetrahedra, prisms, pyramids and hexahedra. Others will be
• The sidedness of the nodes of S respect to C. more complex shapes that FV or FE programs may or may
As an example of reconstruction, let us concentrate on the not handle. STAR-CD has been modified to recognize 6
second part of eqn. (3) basic polyhedral shapes (see Figure 2).
∑ ∑ 2v
octahedron with quadrilateral faces, if n=5, a decahedron
n pyr = ij
with quadrilateral faces, and so on.
i∈NP j∈NN
For these polyhedra there is no known valid hexahedral
mesh so we propose the alternative of splitting them into (10)
pyramids maintaining a connected mesh by placing an
The number of hexahedra is simply equal to the sum, for
additional point in the center of the 2n-hedron and
each polyhedron, of the number of trivalent nodes.
connecting it with the quadrilateral faces.
The result is a set of pyramids. The result is a 4. TEST CASES
generalization of MPS that is insensible to the valence of
the nodes of the polyhedron. In this section we present three different test cases that
Since this method still divides each face of each show an increasing geometric complexity and have been
polyhedron into quadrilaterals, a fully connected successfully meshed.
(conformity property) initial hexahedral mesh results in a The first, a pyramid, is included because is an example of
fully connected hex-dominant mesh with some pyramids. the generalized MPS. The second one is the geometry for
If NP is the set of non-trivalent polyhedra created by the an internal flow simulation of a valve, while the third is an
intersection, NN the set of non-trivalent nodes of the i-th internal combustion engine head that represent a class of
polyhedron and vij is the valence of the j-th node of the i-th geometries common in FE analysis. The meshes of the test
cases have not been smoothed, optimized, or projected onto
the surface in order to show the result of the basic
methodology.
Number
Number
of cells Total
Test of Number
of MPS Time
Case surface of cells
initial (sec.)
triangles
mesh
Pyramid 27 6 Yes 100 10
Valve 35910 16864 Yes 102178 220
Engine
39688 31571 Yes 132133 325
Head
Table 1
Figure 5. Mesh inside a pyramid.
Table 1 summarizes the results for these test cases showing
the number of cells in the initial meshes, the number of
triangles in the surface, the number of final cells as well as
the total elapsed time spent in the generation. An IBM
IntelliStation with a Pentium II Xeon 450 Mhz and 256 MB
Ram running Linux SUSE 6.0 has been used.
4.1 Pyramid
A simple pyramid with quadrilateral base is presented. The
edges of the base and the height have length 1. In Figure 5
the mesh for a pyramid is shown. Here the size of the initial
mesh has been chosen to be to 0.4 and a generalized MPS
has been applied to all the resulting polyhedra, including
the internal hexahedra.
The top of the pyramid has a quadvalent node. As a result
there must be an octahedron split into 8 pyramids as shown
in Figure 6.
Figure 6. The wireframe of the top octahedron
plus its center.
4.2 Valve
This test case represents the domain around a valve for an
internal flow simulation. It has been chosen because, even
if it is relatively simple from a geometric viewpoint, it
presents highly concave regions and narrow passages
between the valve and the boundary of the domain. See
Figure 7, Figure 8 and Figure 9.
5. CONCLUSIONS