# Introduction

MOOSE offers an option to use the Zienkiewicz-Zhu patch recovery technique to evaluate nodal gradients (and other values that do not live on nodes), which leads to an accurate and superconvergent nodal gradient.

The Zienkiewicz-Zhu patch recovery algorithm relies on finding an element patch for a given node, and then performing a Least Squares Regression/Fitting (LSR) over all sample points in the constructed patch.

# Element Patch

In general, the element patch is defined as: (1) where is the number of connected elements on the current node. Gauss points on each element are proved to be superconvergent sampling points. Therefore, sampling points of the patch is simply the union of all quadrature points on connected elements.

As will be discussed in the next section, nodal gradient will be reconstructed by fitting to a set of monomial terms. The number of monomial terms (or degrees of freedom) is given by , where is the dimension of the mesh, is the polynomial order. Therefore, we need at least sampling points on the patch.

On internal nodes and side nodes, we have enough sampling points to perform the fitting. On corner nodes, the algorithm recommends using an interior patch that contains the corner node.

# Complete Multi-Indexing of Monomials

The gradient field is best fitted to a complete set of monomials up to certain order . To enumerate combinations of , let be a multi-index of length , where is the dimension of the mesh: (2) and let . Define a family of monomials as functions of spatial coordinates . (3) For example, and , we will have (4) Again, the number of monomial terms in this case.

# Least Squares Fitting

Rest of the algorithm remains straight-forward, as it follows a standard Least Squares Fitting: (5) where can be interpreted as the patch stiffness matrix, the patch load vector, and is a vector containing fitted coefficients. The stiffness matrix and the load vector are assembled over all sampling points: (6) note that is the solution gradient component-wise. All components of the solution gradient share the same stiffness matrix, so can be cached to reduce computational cost. The fitted nodal gradient can then be computed as: (7)