]> https://gitweb.dealii.org/ - dealii.git/commitdiff
Add check to step-12 10680/head
authorPeter Munch <peterrmuench@gmail.com>
Thu, 9 Jul 2020 18:01:26 +0000 (20:01 +0200)
committerPeter Munch <peterrmuench@gmail.com>
Thu, 9 Jul 2020 18:01:26 +0000 (20:01 +0200)
examples/step-12/step-12.cc

index fcec1e2c1f998d2ffaba5d6cc9ba6f24502d0dd2..70a6bd64c697241a40effff570810537ed754ebc 100644 (file)
@@ -126,7 +126,9 @@ namespace Step12
     Point<dim> wind_field;
     wind_field(0) = -p(1);
     wind_field(1) = p(0);
-    wind_field /= wind_field.norm();
+
+    if (wind_field.norm() > 1e-10)
+      wind_field /= wind_field.norm();
 
     return wind_field;
   }

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.