]> https://gitweb.dealii.org/ - dealii.git/commitdiff
fix incorrect Hdiv computation
authorTimo Heister <timo.heister@gmail.com>
Mon, 31 Aug 2015 17:59:05 +0000 (13:59 -0400)
committerTimo Heister <timo.heister@gmail.com>
Mon, 31 Aug 2015 17:59:05 +0000 (13:59 -0400)
|| u ||_Hdiv
= || div u ||_L2
= sqrt( \int_\Omega (div u)^2 )
= sqrt( \int_\Omega (sum d/dx_i u_i)^2 )
and not
= sqrt( \int_\Omega (sum (d/dx_i u_i)^2) )
which was the old implementation.

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

index 8b6d4c272b82cf8ecb4985fc9ad5627aa76374f7..454c44881c010038033f63d12322ab73da4ac3d3 100644 (file)
@@ -6329,9 +6329,8 @@ namespace VectorTools
               // take the trace of the derivatives, square it, multiply it
               // with the weight function
               for (unsigned int k=0; k<dim; ++k)
-                sum += (data.psi_grads[q][k][k] * data.psi_grads[q][k][k]) *
-                       data.weight_vectors[q](k);
-              diff += sum * fe_values.JxW(q);
+                sum += data.psi_grads[q][k][k] * data.weight_vectors[q](k);
+              diff += sum * sum * fe_values.JxW(q);
             }
           diff = std::sqrt(diff);
           break;

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.