warp.fem.hanging_node_prolongation#

warp.fem.hanging_node_prolongation(raw_basis)[source]#

Return the prolongation that eliminates the hanging nodes of a continuous Lagrange basis.

The geometry describes which sides cover each cell facet through Geometry.side_facet_incidence(), as AdaptiveNanogrid does. A side that covers a whole facet of one neighbor but only part of a facet of the other is a coarse-to-fine interface. Each node of the finer cell on such a side takes the value of the coarser cell’s interpolant at that node; chains of such constraints across several levels are resolved. Other raw nodes are independent. Passing the result to make_constrained_basis_space() gives the same space as make_conforming_basis_space().

The basis must be interpolatory: each function is one at its own node and zero at the others, as for Lagrange polynomials of any degree. Nothing else depends on the element type.

Parameters:

raw_basis (BasisSpace) – Continuous scalar interpolatory basis on a static geometry that implements Geometry.side_facet_incidence().

Returns:

A compact BSR matrix with scalar blocks of the geometry scalar type, one row per node of raw_basis and one column per independent node. Independent nodes are numbered in increasing raw node order, and each has a unit row.

Raises:
  • NotImplementedError – If raw_basis is not a continuous, scalar and interpolatory basis, or if its geometry does not implement Geometry.side_facet_incidence().

  • ValueError – If the interpolation from a coarser cell is invalid, which happens when the geometry’s sides do not cover cell facets, or if constraints are inconsistent or cyclic.

Return type:

BsrMatrix