diff --git a/dune/elasticity/assemblers/localadolcstiffness.hh b/dune/elasticity/assemblers/localadolcstiffness.hh index fa308f5a265b3f2ba170cb75dd2ba7ae0345daaa..5c02eb4f3635f712dd6d7fd94c18765506514324 100644 --- a/dune/elasticity/assemblers/localadolcstiffness.hh +++ b/dune/elasticity/assemblers/localadolcstiffness.hh @@ -66,7 +66,12 @@ energy(const LocalView& localView, for (size_t i=0; i<localConfiguration.size(); i++) localAConfiguration[i] <<= localConfiguration[i]; - energy = localEnergy_->energy(localView,localAConfiguration); + try { + energy = localEnergy_->energy(localView,localAConfiguration); + } catch (Dune::Exception &e) { + trace_off(rank); + throw e; + } energy >>= pureEnergy; diff --git a/dune/elasticity/materials/mooneyrivlindensity.hh b/dune/elasticity/materials/mooneyrivlindensity.hh index 8069301faf3fbf547f8457b61f2be02d01aabdff..a95f758187dbd34a53b80f92b0f0f6172ea36229 100644 --- a/dune/elasticity/materials/mooneyrivlindensity.hh +++ b/dune/elasticity/materials/mooneyrivlindensity.hh @@ -67,6 +67,9 @@ public: field_type normFSquared = gradient.frobenius_norm2(); field_type detF = gradient.determinant(); + if (detF < 0) + DUNE_THROW( Dune::Exception, "det(F) < 0, so it is not possible to calculate the MooneyRivlinEnergy."); + field_type normFinvSquared = 0; field_type c2Tilde = 0;