Skip to content

Mesh Refinement

Discretization error

The finite-element solution is only an approximation, and its accuracy is limited by the mesh: the basis functions can represent the true field only as well as the element size and order allow. Refining everywhere uniformly reduces the error but is expensive, because most of the extra degrees of freedom land where the field is already well resolved. Adaptive refinement instead concentrates resolution where it does the most good.

Error indicators

Adaptivity needs a way to tell, without knowing the exact answer, where the mesh is too coarse. Each model can supply a per-element error indicator: a scalar, computed from the current solution, that estimates how much each element contributes to the overall discretization error. Elements with a large indicator are the ones worth refining.

Because the indicator is built from the computed solution rather than a known reference, it is an a posteriori estimate: refinement is a solve, estimate, refine, and solve-again loop.

Refinement modes

μfem drives refinement through a dedicated refinement model, which supports two modes:

  • Uniform refinement subdivides every element of the mesh. It is simple and predictable, useful for convergence studies.
  • Adaptive refinement asks the participating models which elements to act on. A model can flag elements for

    • h-refinement, subdividing the flagged elements into smaller ones,
    • p- (order) refinement, raising the polynomial order of the basis on the flagged elements, or
    • r-refinement, relocating mesh nodes to concentrate resolution without changing their number or order (planned, not yet supported).

Refining in \(h\) adds elements where the field varies rapidly, refining in \(p\) adds accuracy where the field is smooth, and refining in \(r\) moves existing resolution to where it is needed.

One element shown three ways: h-refinement subdivides it into four smaller cells, p-refinement keeps one cell but adds interior nodes for a higher-order basis, and r-refinement relocates the nodes without changing their number

See the Refinement Model for how to enable and configure refinement in a case.

Hanging nodes

When non-conforming mesh support is enabled, local h-refinement leaves the mesh non-conforming: a refined element meets a coarser neighbour along an edge or face whose endpoints do not all match, leaving hanging nodes. The degrees of freedom at those nodes cannot be free, or the field would be discontinuous across the interface.

A coarse element meeting two finer elements along its right edge; the fine elements introduce a node at the middle of the coarse edge, the hanging node, which is not a vertex of the coarse element

They are handled exactly as the multi-point constraints in Constraints: each hanging degree of freedom is tied to its parent edge or face through the projection \(P\), so the refined solution stays continuous. Adaptive refinement and the constraint machinery are therefore two sides of the same feature.