Fix VectorTools::integrate_difference() for NaN components.
The VectorTools::integrate_difference() function allows users
to provide a weight function that can also serve as a component mask
to select individual components of the solution vector for error
computation. For components not selected, such a mask would then
simply be zero.
In some cases, the solution vector contains NaN numbers, for example
when one uses the FE_FaceQ element for certain components of the
solution vector and uses a quadrature formula for error evaluation
that has quadrature points in the interior of the cell. For any
regular solution component for which the component mask has a zero
weight, the value of that component will be multiplied by zero and
consequently does not add anything to the error computation. However,
if the NaNs of a FE_FaceQ are multiplied with zero weights, the result
is still a NaN, and adding it to the values times weights of the other
components results in NaNs -- in effect rendering it impossible to get
any information out of the VectorTools::integrate_difference()
function if one of the finite elements involved is FE_FaceQ.
This is now fixed by simply skipping vector components for which the
weight vector is zero. This has the same result as before for all
normal situations, but also properly skips the NaN case outlined
above.
In the beginning the Universe was created. This has made a lot of
people very angry and has been widely regarded as a bad move.
Douglas Adams