From bcae5348920fe010dce15349c60bd87d05b7ee7a Mon Sep 17 00:00:00 2001 From: Peter Munch Date: Thu, 9 Jul 2020 20:01:26 +0200 Subject: [PATCH] Add check to step-12 --- examples/step-12/step-12.cc | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/examples/step-12/step-12.cc b/examples/step-12/step-12.cc index fcec1e2c1f..70a6bd64c6 100644 --- a/examples/step-12/step-12.cc +++ b/examples/step-12/step-12.cc @@ -126,7 +126,9 @@ namespace Step12 Point 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; } -- 2.39.5