Skip to content
Snippets Groups Projects
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
No related branches found
No related tags found
1 merge request!35Fix/minor improvements
...@@ -66,7 +66,12 @@ energy(const LocalView& localView, ...@@ -66,7 +66,12 @@ energy(const LocalView& localView,
for (size_t i=0; i<localConfiguration.size(); i++) for (size_t i=0; i<localConfiguration.size(); i++)
localAConfiguration[i] <<= localConfiguration[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; energy >>= pureEnergy;
......
...@@ -67,6 +67,9 @@ public: ...@@ -67,6 +67,9 @@ public:
field_type normFSquared = gradient.frobenius_norm2(); field_type normFSquared = gradient.frobenius_norm2();
field_type detF = gradient.determinant(); 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 normFinvSquared = 0;
field_type c2Tilde = 0; field_type c2Tilde = 0;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment