  In electromagnetic simulations of magnets and machines one is often
interested in a highly accurate and local evaluation of the magnetic field
uniformity. Based on local post-processing of the solution, a defect correction
scheme is proposed as an easy to realize alternative to higher order finite
element or hybrid approaches. Radial basis functions (RBF)s are key for the
generality of the method, which in particular can handle unstructured grids.
Also, contrary to conventional finite element basis functions, higher
derivatives of the solution can be evaluated, as required, e.g., for deflection
magnets. Defect correction is applied to obtain a solution with improved
accuracy and adjoint techniques are used to estimate the remaining error for a
specific quantity of interest. Significantly improved (local) convergence
orders are obtained. The scheme is also applied to the simulation of a
Stern-Gerlach magnet currently in operation.
