Commit 62c21f6a authored by lisa_julia.nebel_at_tu-dresden.de's avatar lisa_julia.nebel_at_tu-dresden.de
Browse files

Throw an exception in Mooneyrivlindensity if det(F) < 0

parent dc71f420
......@@ -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;
......
......@@ -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;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment