Algorithmcore
Newest vertex bisection
Refines a triangle by cutting from its newest vertex to the opposite edge, with a closure step to avoid hanging nodes, keeping angles bounded.
- Time
- Θ(M) average
- Space
- Θ(M) extra
- Where
- M = the number of triangles of the mesh before the call
- Model
- Real RAM
- Properties
- bounded similarity classesconforming outputdeterministicnested meshes
- Evidence
- Proof sketchCode in 1 languages
- Origin
- E. G. Sewell, William F. Mitchell, Peter Binev, Wolfgang Dahmen, Ronald DeVore, 1972
Newest vertex bisection (NVB) refines a triangle mesh locally for the adaptive finite element method. Each triangle stores one of its vertices as the newest vertex, and the opposite edge is its refinement edge. A bisection cuts the triangle from the newest vertex to the midpoint of the refinement edge, and the midpoint becomes the newest vertex of both children. A closure step bisects more triangles until no vertex lies in the middle of an edge of another triangle, so the mesh stays conforming and a continuous Lagrange element space can live on it. The rule never makes thin triangles: all descendants of one initial triangle fall into at most four similarity classes, so the angles stay bounded below by a constant that depends only on the initial mesh.
In plain words
Cut a triangle in two, from one corner to the middle of the opposite side. The new point becomes the special corner of both halves, and the next cut of each half starts from there. Because the cut always starts at the newest corner, the halves never get very thin. After a few cuts, the triangles repeat the same few shapes at smaller and smaller sizes. A cut puts a new point in the middle of a side. The triangle on the other side of that side does not have this point as a corner, so it must also be cut. That cut may force another one, and so on. The closure step follows this chain until every point is a corner of all the triangles around it.
The problem
Input. A conforming triangulation of a polygon , where every triangle is an ordered triple of vertex numbers. The edge is the refinement edge, and is the newest vertex. A set of marked triangles, usually from Dorfler marking. A list of boundary edges.
Output. The coarsest conforming triangulation that we get from by newest vertex bisections and in which every marked triangle is bisected at least once, with the refinement edges of the new triangles and the split boundary edges.
The algorithm
The code uses the form with marked edges of Funken, Praetorius and Wissgott. First it finds the set of edges that must be split. Then it bisects each triangle one, two or three times, according to which of its edges are in . This works in one pass because a bisection makes the two old edges and the refinement edges of the two children. So one triangle can split each of its three edges with at most three bisections, and the refinement edge always goes first.
REFINE(T, M) ▷ each triangle is [z1, z2, z3]; z1z2 is its refinement edge- 1
S <- the refinement edges of the triangles in M; push each of them on a stack - 2
while the stack is not empty do pop an edge e - 3
for each triangle T of the mesh that contains e do - 4
if the refinement edge r of T is not in S then add r to S and push r - 5
for each edge in S do create its midpoint - 6
for each triangle [z1, z2, z3] with z1z2 in S do bisect it at the midpoint m of z1z2 into [z3, z1, m] and [z2, z3, m] - 7
look up the midpoints l of z3z1 and r of z2z3, if these edges are in S - 8
if z3z1 is in S then bisect [z3, z1, m] into [m, z3, l] and [z1, m, l] - 9
if z2z3 is in S then bisect [z2, z3, m] into [m, z2, r] and [z3, m, r] - 10
return the new triangles, and split every boundary edge in S into two
Triangles with no edge in are kept as they are. Line L4 is the closure rule. If some edge of will be split, then must be bisected, and its first bisection always cuts its refinement edge.
Initial labels. The labels of the initial mesh fix all later bisections. A labeling is compatible if every interior refinement edge is the refinement edge of both triangles that share it. Then the closure of a single triangle stops after the neighbor across the edge. On a mesh made of squares cut along one diagonal, the diagonals are a compatible choice. Every conforming triangulation in 2D has a compatible labeling (Mitchell 1989; Binev, Dahmen and DeVore 2004, Section 2). Labeling by the longest edge does not always give one.
Example
Take the unit square with corners , , , and the two triangles and . Both have the diagonal as refinement edge, so the labeling is compatible. The reference code gives the following steps.
| Step | Marked triangle | Edges put in | New vertices | Triangles |
|---|---|---|---|---|
| 0 | none | none | none | 2 |
| 1 | 4 | |||
| 2 | all 4 | the 4 sides of the square | , , , | 8 |
| 3 | 10 | |||
| 4 | , then | , | 14 |
In step 1, line L1 puts the diagonal in . Line L3 visits the other triangle , but its refinement edge is the same diagonal, so line L4 adds nothing. Both triangles are bisected once, and the result is , , , . All four have the new vertex as newest vertex and a side of the square as refinement edge.
Step 4 shows the closure. The marked triangle has the refinement edge , which is the vertical segment from to . Its neighbor across that edge is , and the refinement edge of the neighbor is , not . So line L4 adds to . The triangle on the other side of is , and its refinement edge is itself, so the chain stops. Lines L6 to L9 then bisect once, once and twice (first at and then the child that contains ). The count is triangles, and no vertex hangs.
Shapes. The test file refines the scalene triangle , , twelve times with random marks. After 12 steps the mesh is conforming and has at most four distinct triangle shapes up to similarity, for each of the three choices of the first refinement edge. Marking all triangles of this single triangle mesh eight times gives triangles with total area .
Correctness
The full proof is in the correctness proof. Every edge enters the stack at most once, so the closure loop stops. When the loop ends, every triangle that has some edge in also has its refinement edge in . So each triangle falls into one of four cases (no split, one, two or three bisections), and in each case the parent edges in appear as two halves on both sides and the other parent edges stay whole. So the output is conforming. Minimality follows by induction over the order in which edges enter : a conforming refinement that bisects the marked triangles must split every edge in , because a split edge leaves a hanging node on the neighbor until the neighbor is bisected, and a bisection always starts at the refinement edge. The test file checks the output against a second method that bisects triangles with hanging nodes until none is left, on nine random steps on the L-shaped domain.
Proof: The marked-edge form of newest vertex bisection gives the coarsest conforming refinementfull
Setting. is a conforming triangulation of a polygon: two triangles meet in a common vertex, a common edge or not at all. Each triangle is stored as an ordered triple . The edge is its refinement edge, and is its newest vertex. One bisection of adds the midpoint of and gives the two children and . So the new vertex is the newest vertex of both children, and the two old edges and become their refinement edges. A refinement of by newest vertex bisection is any triangulation that we get from by a finite number of such bisections. The input is a set of marked triangles. REFINE is the procedure of the main page, lines L1 to L10.
We prove four claims.
- (Termination.) REFINE stops after at most passes of the loop at line L2, where is the set of edges of .
- (Closure.) At line L5, for every triangle , if any edge of is in the set of split edges, then the refinement edge of is in .
- (Conformity.) The output is a conforming triangulation of the same polygon, every marked triangle is bisected at least once, and the output is a refinement of by newest vertex bisection.
- (Minimality.) Every conforming refinement of by newest vertex bisection in which every marked triangle is bisected is equal to the output of REFINE or is a refinement of it.
Proof of 1. An edge enters the stack only when it enters (lines L1 and L4), and it never leaves . So every edge enters the stack at most once, and each pass of line L2 removes one edge from the stack. The loop at line L3 visits the at most two triangles that contain the edge. So the number of passes is at most , and the total work of lines L2 to L4 is .
Proof of 2. Let be an edge of . The edge entered the stack when it entered , and the loop at line L2 runs until the stack is empty, so was popped once. At that pass, line L3 visited every triangle that contains , and is one of them. Line L4 then put the refinement edge of into , or it was there already.
Proof of 3. By claim 2, each triangle falls into one of four cases at line L6: no edge of is in ; only is in ; and one other edge are in ; all three edges are in . In the first case is kept. In the second case line L6 bisects once. If the left edge is in , line L8 bisects the child , whose refinement edge is . If the right edge is in , line L9 bisects the child , whose refinement edge is . So in every case the children of come from bisections by the rule of the setting, and the output is a refinement by newest vertex bisection. A marked triangle has its refinement edge in by line L1, so it is bisected at least once.
Now look at the edges of the children inside . A direct check of the four cases shows:
- an edge of that is not in is a whole edge of exactly one child;
- an edge of that is in , with midpoint from line L5, is the union of two edges of children, which meet at ;
- every other edge of a child lies inside (apart from its end points) and is shared by exactly two children of .
For example, in the case with all three edges split, the children are , , and , where and are the midpoints of and . The edge becomes and , the edge becomes and , the edge becomes and , and the inner edges , and each lie in two children.
The children of tile , because a bisection cuts a triangle into two triangles along a segment. So the output tiles the polygon. For conformity, take an edge of that lies in two triangles and . The decision whether is in does not depend on the side, and line L5 gives one midpoint. If , then is a whole edge of one child on each side. If , then both sides have the two halves of as edges, with the same midpoint. In both cases no vertex lies inside an edge of a child on the other side. Inner edges of meet only children of . So no hanging node appears, and the output is conforming. The boundary loop after line L9 splits a boundary edge exactly when it is in , so the boundary list matches the boundary of the new mesh.
Proof of 4. Let be a conforming refinement by newest vertex bisection in which every marked triangle is bisected. Say that splits an edge of if the midpoint of is a vertex of . We show by induction over the order in which edges enter that splits every edge in .
An edge that enters at line L1 is the refinement edge of a marked triangle . The first bisection of always cuts its refinement edge, and is bisected in . So splits it.
An edge that enters at line L4 is the refinement edge of a triangle that contains an edge which entered before . By the induction hypothesis, the midpoint of is a vertex of . Because is conforming, cannot lie inside an edge of a triangle of . If were not bisected in , then would be a triangle of with inside its edge , which is a hanging node. So is bisected, and its first bisection cuts . So splits .
So splits every edge of . Fix a triangle of . The descendants of in form a refinement of by bisection that contains the midpoint of every edge of in . The bisection of a triangle is fixed by its labels, so the refinements of form a binary tree of bisections. The children that REFINE gives to are the smallest subtree that splits exactly the edges of in : one bisection for the refinement edge, and one more bisection of a child for each of the other two edges, as no other bisection adds the midpoint of that edge. So the descendants of in are the REFINE children of or refinements of them. This holds for every , which proves claim 4.
What the proof does not cover. The claims above hold for every labeling of the initial triangles, and one call of REFINE always stops. Two further facts are cited, not proved here. First, all descendants of one initial triangle fall into at most four similarity classes (Sewell 1972; Mitchell 1989), so the minimum angle stays bounded below by a constant that depends only on . The test file checks this on a scalene triangle. Second, the closure estimate of Binev, Dahmen and DeVore (2004), , needs a compatible labeling of in their proof. Karkulik, Pavlicek and Praetorius (2013) proved it in 2D for every labeling.
Complexity
With a hash map from edges to triangles, one call costs expected time in the real-RAM model for a mesh of triangles: building the map, the closure (each edge is pushed at most once and has at most two triangles) and the bisection are all linear. The memory is . The output has at most triangles.
One call can bisect triangles far from the marked ones, because a closure chain can be long. So the size of one step is not bounded by a constant times . The bound holds on average over the whole adaptive loop. Binev, Dahmen and DeVore proved that, for a compatible initial labeling, with that depends only on . Karkulik, Pavlicek and Praetorius proved the same estimate in 2D with no condition on the initial labeling. This closure estimate is one of the three parts of the AFEM optimality theorem.
Properties
- Conformity. The output has no hanging nodes, so P1 functions on it are continuous, and the P1 space of is a subspace of the P1 space of .
- Shape regularity. All descendants of one initial triangle are similar to at most four triangles (Sewell 1972; Mitchell 1989). The minimum angle and the ratio of diameter to inradius stay bounded by constants that depend only on .
- Area halving. Each bisection halves the area. A triangle of generation has area times the area of its initial ancestor.
- Uniform refinement. With a compatible labeling, two rounds of marking every triangle cut each triangle into four triangles of area one quarter. All three edges of the parent are split at their midpoints.
- Binary tree. The refinements of one initial triangle form a binary tree of bisections, so the set of all NVB meshes is a lattice: two NVB refinements of have a coarsest common refinement. The optimality proofs use this overlay.
- Orientation. The children keep the orientation of the parent, as the test file checks with signed areas.
Variants and improvements
- Recursive form. Mitchell refines a marked triangle by first refining its neighbor across the refinement edge if the two edges do not agree, recursively, and then bisecting both together. The result is the same mesh as the form with marked edges.
- More bisections per marked triangle. Some codes split all three edges of each marked triangle, which gives four children in one step. The convergence proof of Morin, Nochetto and Siebert (2000) needed several bisections, so that each marked triangle gets a new vertex inside it. Cascon, Kreuzer, Nochetto and Siebert (2008) showed that one bisection is enough.
- Longest edge bisection. Rivara cuts each triangle at its longest edge. The angles also stay bounded, but the closure is longer and the theory of optimal rates is less complete.
- Red-green refinement. Bank, Sherman and Weiser cut a marked triangle into four similar children (red) and remove hanging nodes with temporary bisections (green). The green triangles must be removed before the next step.
- Higher dimensions. Bansch, Kossaczky, Maubach and Traxler gave bisection rules for tetrahedra. Stevenson extended the closure estimate to any dimension under a condition on the initial mesh.
- Coarsening. The binary tree makes coarsening simple: two children with the same parent can be merged back if no neighbor needs them. The 2004 algorithm of Binev, Dahmen and DeVore used coarsening, and later proofs removed it.
When to use it
Use NVB for adaptive finite elements on triangles, especially when the code must follow the theory of convergence rates: the closure estimate, the bounded shapes and the nested spaces are exactly what the proofs need. It is simple to store, because each triangle only needs the order of its vertices. For meshes that must stretch in one direction, for example along boundary layers, NVB is the wrong tool, because it keeps the shapes of the initial mesh; use anisotropic mesh adaptation. For structured grids with block refinement in time dependent problems, use block-structured AMR.
Pitfalls
- Vertex order. The refinement edge must be stored as in every triangle. A mesh generator that outputs counterclockwise triples with no thought about labels gives a valid labeling, but it can be far from compatible, and then the closure chains get long.
- Missed boundary split. If the list of boundary edges is not split with the triangles, the midpoints of Dirichlet edges become free nodes, and the solve imposes a wrong boundary condition with no error message.
- Hash keys. The edge and the edge must give the same key. Store each edge as the pair (smaller number, larger number).
- Mixed refinement rules. Mixing NVB with other cuts, such as red refinement on some triangles, breaks the bound on similarity classes and the closure estimate.
- Cost of one step. Do not expect one call to bisect only a few triangles beyond the marked ones. The bound on the number of extra triangles holds only summed over all steps.
- Floating point midpoints. Computing midpoints again from coordinates for each triangle can give two different nodes for one edge after many levels. Create each midpoint once per edge, as line L5 does.
Implementations
Each implementation follows the pseudocode above. A comment @line links a line of code to a line of the pseudocode. Point at a line of the pseudocode to see the matching code. The build runs the native tests of each language.
# SPDX-License-Identifier: MIT
# Part of https://algorithm.tamnd.com/newest-vertex-bisection/. The authors are listed in prov/GGH2BB.jsonl.
"""Newest vertex bisection (NVB) of a conforming triangulation in 2D.
A mesh is (coords, elements, boundary). coords is a list of (x, y) points.
An element [z1, z2, z3] has the refinement edge z1 z2 and the newest vertex
z3, the vertex opposite the refinement edge. boundary is a list of boundary
edges [a, b]; they are split together with the elements, so that boundary
conditions can follow the refinement.
refine marks the refinement edges of the marked elements, closes the set of
marked edges (a marked edge of an element forces its refinement edge), and
then bisects each element one, two or three times. The result is the
smallest conforming NVB refinement in which every marked element is
bisected at least once. Cost: O(M) for M elements with a hash map
(real-RAM, expected time of the hash map).
"""
def _edge(a, b):
return (a, b) if a < b else (b, a)
def refine(coords, elements, boundary, marked):
"""Return the refined mesh (coords, elements, boundary)."""
coords = list(coords)
touching = {}
for t, z in enumerate(elements):
for r in range(3):
touching.setdefault(_edge(z[r], z[(r + 1) % 3]), []).append(t)
split = {}
stack = []
for t in marked: # @line L1
e = _edge(elements[t][0], elements[t][1])
if e not in split:
split[e] = None
stack.append(e)
while stack: # closure over a work list # @line L2
e = stack.pop()
for t in touching[e]: # @line L3
z = elements[t]
r = _edge(z[0], z[1])
if r not in split: # @line L4
split[r] = None
stack.append(r)
for e in split: # @line L5
(xa, ya), (xb, yb) = coords[e[0]], coords[e[1]]
split[e] = len(coords)
coords.append(((xa + xb) / 2, (ya + yb) / 2))
new = []
for z1, z2, z3 in elements: # @line L6
m = split.get(_edge(z1, z2))
if m is None:
new.append([z1, z2, z3])
continue
left = split.get(_edge(z3, z1)) # @line L7
right = split.get(_edge(z2, z3))
if left is None:
new.append([z3, z1, m])
else:
new.extend([[m, z3, left], [z1, m, left]]) # @line L8
if right is None:
new.append([z2, z3, m])
else:
new.extend([[m, z2, right], [z3, m, right]]) # @line L9
bnew = []
for a, b in boundary:
m = split.get(_edge(a, b))
if m is None:
bnew.append([a, b])
else:
bnew.extend([[a, m], [m, b]])
return coords, new, bnew # @line L10
def refine_by_hanging_nodes(coords, elements, boundary, marked):
"""Second method, used as an oracle: bisect the marked elements once, then
bisect any element that has a hanging node on an edge until none is left.
Cost O(M^2) in the worst case.
"""
coords = list(coords)
where = {p: i for i, p in enumerate(coords)}
def midpoint(a, b):
(xa, ya), (xb, yb) = coords[a], coords[b]
p = ((xa + xb) / 2, (ya + yb) / 2)
if p not in where:
where[p] = len(coords)
coords.append(p)
return where[p]
def bisect(z):
m = midpoint(z[0], z[1])
return [[z[2], z[0], m], [z[1], z[2], m]]
marked = set(marked)
elements = [c for t, z in enumerate(elements) for c in (bisect(z) if t in marked else [z])]
while True:
out, changed = [], False
for z in elements:
hanging = False
for r in range(3):
(xa, ya), (xb, yb) = coords[z[r]], coords[z[(r + 1) % 3]]
if ((xa + xb) / 2, (ya + yb) / 2) in where:
hanging = True
if hanging:
out.extend(bisect(z))
changed = True
else:
out.append(z)
elements = out
if not changed:
break
bnew = []
work = [list(e) for e in boundary]
while work:
a, b = work.pop()
(xa, ya), (xb, yb) = coords[a], coords[b]
p = ((xa + xb) / 2, (ya + yb) / 2)
if p in where:
work.extend([[a, where[p]], [where[p], b]])
else:
bnew.append([a, b])
return coords, elements, bnew
def hanging_nodes(coords, elements):
"""Return the list of (element, edge) pairs whose edge midpoint is a mesh vertex."""
used = {coords[v] for z in elements for v in z}
bad = []
for t, z in enumerate(elements):
for r in range(3):
(xa, ya), (xb, yb) = coords[z[r]], coords[z[(r + 1) % 3]]
if ((xa + xb) / 2, (ya + yb) / 2) in used:
bad.append((t, r))
return bad
def is_conforming(coords, elements, boundary):
"""Check that every edge lies in two elements or is a boundary edge, and that no node hangs."""
count = {}
for z in elements:
for r in range(3):
e = _edge(z[r], z[(r + 1) % 3])
count[e] = count.get(e, 0) + 1
bset = {_edge(a, b) for a, b in boundary}
for e, c in count.items():
if c > 2 or (c == 1 and e not in bset):
return False
return all(count.get(e) == 1 for e in bset) and not hanging_nodes(coords, elements)
def area(coords, z):
"""Return the signed area of the element z."""
(x0, y0), (x1, y1), (x2, y2) = coords[z[0]], coords[z[1]], coords[z[2]]
return ((x1 - x0) * (y2 - y0) - (x2 - x0) * (y1 - y0)) / 2
def shape_key(coords, z, digits=9):
"""Return a key that is equal for similar triangles: sorted squared side ratios."""
p = [coords[v] for v in z]
s = sorted((p[r][0] - p[(r + 1) % 3][0]) ** 2 + (p[r][1] - p[(r + 1) % 3][1]) ** 2 for r in range(3))
return (round(s[0] / s[2], digits), round(s[1] / s[2], digits))
test_newest_vertex_bisection.py 98 lines
# SPDX-License-Identifier: MIT
# Part of https://algorithm.tamnd.com/newest-vertex-bisection/. The authors are listed in prov/GGH2BB.jsonl.
import random
from newest_vertex_bisection import (area, hanging_nodes, is_conforming, refine,
refine_by_hanging_nodes, shape_key)
def l_shape():
coords = [(-1.0, -1.0), (0.0, -1.0), (-1.0, 0.0), (0.0, 0.0),
(1.0, 0.0), (-1.0, 1.0), (0.0, 1.0), (1.0, 1.0)]
elements = [[0, 3, 1], [3, 0, 2], [3, 5, 2], [5, 3, 6], [3, 7, 4], [7, 3, 6]]
boundary = [[0, 1], [1, 3], [3, 4], [4, 7], [7, 6], [6, 5], [5, 2], [2, 0]]
return coords, elements, boundary
def canon(coords, elements):
return sorted(tuple(sorted(coords[v] for v in z)) for z in elements)
def total_area(coords, elements):
return sum(area(coords, z) for z in elements)
def test_single_triangle_hand_example():
c, e, b = refine([(0.0, 0.0), (1.0, 0.0), (0.0, 1.0)], [[0, 1, 2]],
[[0, 1], [1, 2], [2, 0]], [0])
assert c[3] == (0.5, 0.0)
assert e == [[2, 0, 3], [1, 2, 3]]
assert sorted(tuple(x) for x in b) == [(0, 3), (1, 2), (2, 0), (3, 1)]
assert all(z[2] == 3 for z in e)
def test_closure_on_two_triangles():
coords = [(0.0, 0.0), (1.0, 0.0), (1.0, 1.0), (0.0, 1.0)]
elements = [[0, 2, 1], [2, 0, 3]]
boundary = [[0, 1], [1, 2], [2, 3], [3, 0]]
c, e, b = refine(coords, elements, boundary, [0])
assert len(e) == 4
assert is_conforming(c, e, b)
c2, e2, b2 = refine(c, e, b, [0])
assert is_conforming(c2, e2, b2)
assert len(e2) == 5 # the refinement edge of element 0 is on the boundary
c3, e3, b3 = refine(c2, e2, b2, [t for t in range(len(e2)) if 4 in e2[t][:2]])
assert is_conforming(c3, e3, b3)
assert abs(sum(abs(area(c3, z)) for z in e3) - 1.0) < 1e-12
def test_matches_hanging_node_oracle_and_conforms():
rng = random.Random(7)
coords, elements, boundary = l_shape()
signed = total_area(coords, elements)
for _ in range(9):
marked = [t for t in range(len(elements)) if rng.random() < 0.15] or [0]
parents = [tuple(sorted(coords[v] for v in elements[t])) for t in marked]
c1, e1, b1 = refine(coords, elements, boundary, marked)
c2, e2, _ = refine_by_hanging_nodes(coords, elements, boundary, marked)
assert canon(c1, e1) == canon(c2, e2)
assert is_conforming(c1, e1, b1)
assert not hanging_nodes(c1, e1)
assert abs(sum(abs(area(c1, z)) for z in e1) - 3.0) < 1e-12
assert abs(total_area(c1, e1) - signed) < 1e-12 # bisection keeps the orientation
assert all(abs(area(c1, z)) > 0 for z in e1)
children = set(canon(c1, e1))
assert all(p not in children for p in parents)
coords, elements, boundary = c1, e1, b1
def test_uniform_bisection_of_one_triangle_doubles():
coords = [(0.0, 0.0), (1.0, 0.0), (0.3, 0.7)]
elements = [[0, 1, 2]]
boundary = [[0, 1], [1, 2], [2, 0]]
for k in range(1, 9):
coords, elements, boundary = refine(coords, elements, boundary, list(range(len(elements))))
assert len(elements) == 2 ** k
assert abs(total_area(coords, elements) - 0.35) < 1e-12
assert is_conforming(coords, elements, boundary)
def test_at_most_four_similarity_classes():
rng = random.Random(3)
base = [(0.0, 0.0), (1.0, 0.0), (0.3, 0.7)]
for rot in range(3):
coords = list(base)
elements = [[rot % 3, (rot + 1) % 3, (rot + 2) % 3]]
boundary = [[0, 1], [1, 2], [2, 0]]
for _ in range(12):
marked = [t for t in range(len(elements)) if rng.random() < 0.3] or [0]
coords, elements, boundary = refine(coords, elements, boundary, marked)
assert is_conforming(coords, elements, boundary)
assert len({shape_key(coords, z) for z in elements}) <= 4
def test_unmarked_mesh_is_unchanged():
coords, elements, boundary = l_shape()
c, e, b = refine(coords, elements, boundary, [])
assert c == coords and e == elements and b == boundary
History
E. G. Sewell introduced the newest vertex rule in his 1972 PhD thesis at Purdue University, and showed that the descendants of a triangle fall into a few similarity classes. William Mitchell gave the recursive refinement and compared it with other adaptive refinement methods in 1989. Eberhard Bansch, Igor Kossaczky, Joseph Maubach and Christoph Traxler extended bisection to tetrahedra in the 1990s. Peter Binev, Wolfgang Dahmen and Ronald DeVore proved in 2004 that the closure does not spoil the complexity of the adaptive loop, which made optimal rates for adaptive finite elements possible. Rob Stevenson extended this to higher dimensions, and Michael Karkulik, David Pavlicek and Dirk Praetorius removed the condition on the initial labeling in 2D in 2013.
References
- William F. Mitchell, A comparison of adaptive refinement techniques for elliptic problems, ACM Transactions on Mathematical Software 15(4) (1989) 326-347, newest node bisection, its recursive form and the bound on the similarity classes
- Peter Binev, Wolfgang Dahmen and Ronald DeVore, Adaptive finite element methods with convergence rates, Numerische Mathematik 97(2) (2004) 219-268, Section 2 (newest vertex bisection, compatible initial labeling and the closure estimate)
- Michael Karkulik, David Pavlicek and Dirk Praetorius, On 2D newest vertex bisection, optimality of mesh-closure and H1-stability of L2-projection, Constructive Approximation 38(2) (2013) 213-234, the closure estimate in 2D for an arbitrary initial labeling
- Stefan Funken, Dirk Praetorius and Philipp Wissgott, Efficient implementation of adaptive P1-FEM in Matlab, Computational Methods in Applied Mathematics 11(4) (2011) 460-490, the refinement by marked edges, the closure loop and the vectorized bisection
Where this leads
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 | H1 sketch |
|
| Lean | L0 no Lean part |
|
| Code (python) | I0 not checked yet |
|
| Visual | V0 none |
|
| Writing | W2 basic |
|
Tag GGH2BB Edit this page History Report an error Markdown