]> https://gitweb.dealii.org/ - dealii.git/commit
Fix VectorTools::integrate_difference() for NaN components.
authorWolfgang Bangerth <bangerth@colostate.edu>
Thu, 29 Mar 2018 22:24:35 +0000 (16:24 -0600)
committerWolfgang Bangerth <bangerth@colostate.edu>
Mon, 2 Apr 2018 22:33:50 +0000 (16:33 -0600)
commitc29dd40ae14080107fdfdfaeddeca8a37e366ba3
tree96b9094cd61ccf9b136f7cccbc98cc768e5a5330
parenta2717434c705ad8389ef8102c8afec9ed61dd329
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.
include/deal.II/numerics/vector_tools.templates.h

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


Typeset in Trocchi and Trocchi Bold Sans Serif.