From cba9eedc0eddf6e16afb829c45a6b3f15e2ad55e Mon Sep 17 00:00:00 2001
From: Patrick Jaap <patrick.jaap@tu-dresden.de>
Date: Wed, 24 Aug 2022 16:21:37 +0200
Subject: [PATCH] Let Mooney-Rivlin throw MathError rather than generic
 exceptions

Some regularizing algorithms based on exceptions filter the exceptions by type to detect math errors such as ill-formed systems or inputs.
---
 dune/elasticity/materials/mooneyrivlindensity.hh | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/dune/elasticity/materials/mooneyrivlindensity.hh b/dune/elasticity/materials/mooneyrivlindensity.hh
index 37ba272..a14f96f 100644
--- a/dune/elasticity/materials/mooneyrivlindensity.hh
+++ b/dune/elasticity/materials/mooneyrivlindensity.hh
@@ -88,7 +88,7 @@ public:
     field_type detF = gradient.determinant();
 
     if (detF < 0)
-      DUNE_THROW( Dune::Exception, "det(F) < 0, so it is not possible to calculate the MooneyRivlinEnergy.");
+      DUNE_THROW( Dune::MathError, "det(F) < 0, so it is not possible to calculate the MooneyRivlinEnergy.");
 
     // Add the local energy density
     field_type strainEnergy = 0;
-- 
GitLab