]> https://gitweb.dealii.org/ - dealii.git/commitdiff
do not use square of weight for Hdiv_seminorm 1491/head
authorTimo Heister <timo.heister@gmail.com>
Mon, 31 Aug 2015 20:17:42 +0000 (16:17 -0400)
committerTimo Heister <timo.heister@gmail.com>
Mon, 31 Aug 2015 20:52:37 +0000 (16:52 -0400)
The interpretation of weight in integrate_difference is that it scales
the norm not the function being integrated. We therefore need to scale
the components of div u with the square root of the weight.

include/deal.II/numerics/vector_tools.templates.h

index 454c44881c010038033f63d12322ab73da4ac3d3..7737b179bad5884d83da43dd2547c285d046eda9 100644 (file)
@@ -6326,10 +6326,9 @@ namespace VectorTools
                                   "with at least 'dim' components. In that case, this function "
                                   "will take the divergence of the first 'dim' components."));
               double sum = 0;
-              // take the trace of the derivatives, square it, multiply it
-              // with the weight function
+              // take the trace of the derivatives scaled by the weight and square it
               for (unsigned int k=0; k<dim; ++k)
-                sum += data.psi_grads[q][k][k] * data.weight_vectors[q](k);
+                sum += data.psi_grads[q][k][k] * std::sqrt(data.weight_vectors[q](k));
               diff += sum * sum * fe_values.JxW(q);
             }
           diff = std::sqrt(diff);

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.