Techniqueadvanced
Metric-based anisotropic mesh adaptation
Also called Riemannian metric mesh adaptation, continuous mesh framework.
Builds a metric tensor field from the Hessian of the solution and makes a mesh whose elements are unit and regular in it, so elements stretch along features.
Metric-based anisotropic mesh adaptation makes a mesh whose elements are long in the directions where the solution changes slowly and short where it changes fast. It describes the wanted size and shape at every point by a metric tensor, a symmetric positive definite matrix , and then asks for a mesh in which every edge has length close to 1 when measured with . A mesh that is unit in this sense is a mesh of near equilateral triangles in a deformed space; in the real plane its triangles are stretched as says. The metric usually comes from the Hessian of the computed solution, because the error of linear interpolation is controlled by second derivatives. Solve, build the metric, remesh, and repeat. For the same accuracy, a solution with a strongly directional feature needs far fewer elements than with an isotropic mesh; the example below shows a factor of 10 for a simple quadratic.
In plain words
A mesh puts small tiles where the answer of a computation changes fast. If the answer changes fast in one direction only, as across a shock wave, square tiles waste effort along the other direction. Long thin tiles, lying along the shock, do the same job with far fewer tiles.
The method stores, at each point, a rule for measuring length that says how long a tile edge may be in each direction. Then it builds a mesh in which every edge has length about 1 by that rule. Short in one direction and long in another is then automatic.
The rule comes from the curvature of the answer: strong bending in a direction asks for short edges in that direction. So the loop is: solve, measure the bending, build the rule, remesh, and solve again.
When it applies
- The solution is a scalar field, or a few fields, on a 2D or 3D domain, computed on a simplicial mesh with a linear or low order method, for example the finite element method.
- The solution has strongly directional features: shocks, boundary and shear layers, contact lines, or fronts.
- The mesh generator can work with a variable metric: it can measure edge lengths in a metric and change the mesh locally by edge splits, edge collapses, edge flips and vertex moves.
- It does not help much for a smooth, isotropic solution, where an isotropic mesh sizing function does the same.
The metric and the length of an edge. A metric field gives each point a symmetric positive definite matrix . In a constant metric, the length of an edge vector is . For a varying metric, it is the integral of over , which is computed by a few quadrature points. If with orthogonal , the unit ball of is an ellipse with axes along the columns of and half lengths . These are the wanted edge lengths in the two directions. A mesh is unit for if every edge has in and every element is close to equilateral when measured with .
Why the Hessian. For a quadratic function with Hessian , the error of linear interpolation at the midpoint of an edge is exactly , since . With , where has the absolute values of the eigenvalues of , the midpoint error on an edge of a convex function is , so it is on a unit edge. Different authors use different constants in front of , from different error norms; the structure is the same.
The template
ADAPT(domain, solver, ε, N_max)- 1
T ← an initial mesh - 2
repeat - 3
u ← the solution of the problem on T - 4
H(v) ← a recovered Hessian of u at each vertex v - 5
M(v) ← R |Λ| R^T / (8ε), where H(v) = R Λ R^T, with eigenvalues clipped to [1/h_max², 1/h_min²] - 6
limit the growth of M from vertex to vertex (gradation) - 7
repeat - 8
split every edge with ℓ_M > √2, collapse every edge with ℓ_M < 1/√2 - 9
flip edges and move vertices to make the elements regular in M - 10
until no edge changes - 11
until the error estimate stops falling or the mesh has N_max vertices
L4 recovers second derivatives from a piecewise linear , for example by a least squares fit of a quadratic on the vertex neighbours, or by applying a recovered gradient twice. L5 takes the eigenvalues, which for a symmetric or matrix can be done by the Jacobi eigenvalue algorithm, and the clipping keeps the sizes finite where vanishes. L8 to L9 are the local remeshing operators. A metric aware Delaunay or advancing front mesher can replace L7 to L10 by a new mesh.
The continuous mesh view. Loseille and Alauzet treat a metric field as a continuous mesh. Its complexity is the continuous counterpart of the number of vertices, and a unit mesh has about that many vertices, up to a fixed factor. For the interpolation error in the norm, at a fixed complexity , they derive the optimal metric
in dimension , where the constant makes the complexity equal to . The factor with the determinant moves resolution from places where the Hessian is large in every direction to places where it is large in only one. As the formula tends to a multiple of , the choice of L5.
Classic examples
A stretched quadratic. Let on the unit square and . The Hessian is , so everywhere, and the wanted edge lengths are and . The edge and the edge are unit, and both have midpoint error exactly . The edge has , so L8 splits it, and its midpoint error is , as the formula says. An equilateral triangle with unit sides in has real area , so about triangles cover the square. An isotropic mesh with the same error needs in every direction and about triangles, 10 times more, which is .
Shocks in compressible flow. For an inviscid supersonic flow, the Mach number or the density changes sharply across shocks. An adapted mesh puts long thin triangles along each shock, and a few adaptation loops capture the shocks to a width of a few cells.
Boundary layers. Near a wall in a viscous flow, the velocity Hessian is large in the wall normal direction. Metric adaptation then gives stretched elements along the wall, the same kind of mesh that boundary layer mesh generation builds directly from the geometry.
Surfaces. Meshing a curved surface in its parameter plane is a metric problem: the first fundamental form is the metric. See surface meshing in parametric space.
Variations
- Metric intersection. For several fields, or a field and a geometric size, take at each point the largest metric whose unit ball is inside both unit balls. It is computed by a simultaneous reduction of the two matrices, a generalised eigenvalue problem.
- Gradation. Limit how fast the sizes can change between neighbours, by shrinking each metric so that it is not much larger than its neighbours' metrics carried along the edge. Without it, the elements change size too fast and get bad shapes.
- Goal oriented metrics. Weight the Hessian by the solution of an adjoint problem, so that the mesh reduces the error in a chosen output, such as the drag, instead of the interpolation error.
- Time dependent problems. Build one metric for a window of time steps, by intersecting the metrics of the steps, so that the mesh does not have to change at every step.
- Higher order. For elements of degree , the error depends on derivatives of order , and the metric comes from those.
Pitfalls
- Noisy Hessian. Second derivatives recovered from a piecewise linear field are noisy, and the noise shows up as random stretching. Smooth or fit over a larger patch.
- Zero eigenvalues. Where the solution is linear, the Hessian has a zero eigenvalue and the wanted length is infinite. Always clip the eigenvalues.
- Wrong sign. Use , with the absolute values of the eigenvalues. itself is not positive definite where the solution has a saddle.
- No gradation. Sharp jumps of the metric make the mesher fail or give bad elements at the jump.
- Unit is not enough. A mesh can have all edge lengths near 1 in and still contain flat elements in . Also measure the element quality in .
- Solver limits. Highly stretched elements can make the linear systems ill conditioned and can break the maximum angle condition. Check that the solver handles them.
Exercises
- Show that for every quadratic with Hessian , and conclude that the midpoint error of a convex quadratic is for .
- For , show that the real area of a triangle that is equilateral with unit sides in is , and use it to count the triangles of a unit mesh of a domain of area .
References
- Adrien Loseille and Frédéric Alauzet, Continuous mesh framework part I, well-posed continuous interpolation error, SIAM Journal on Numerical Analysis 49(1), 2011, 38 to 60, the duality between unit meshes and Riemannian metric fields, the complexity of a metric, and the interpolation error of a continuous mesh (general locator)
- Adrien Loseille and Frédéric Alauzet, Continuous mesh framework part II, validations and applications, SIAM Journal on Numerical Analysis 49(1), 2011, 61 to 86, the optimal metric in the L^p norm for a given complexity and the adaptation loop (general locator)
- Pascal Jean Frey and Paul-Louis George, Mesh Generation, Application to Finite Elements, 2nd edition, ISTE and Wiley, 2008, the chapters on metrics, anisotropic meshing and mesh adaptation (general locator)
About this page
The build computes these levels from the evidence in the repository. Each row says what the next level needs. Read what the levels mean.
| Ladder | Level | What the next level needs |
|---|---|---|
| Human proof | H0 no proof |
|
| Lean | L0 no Lean part |
|
| Visual | V0 none |
|
| Writing | W2 basic |
|
Tag FWX0HA Edit this page History Report an error Markdown