Commit 27528420 authored by oliver.sander_at_tu-dresden.de's avatar oliver.sander_at_tu-dresden.de
Browse files

Merge branch 'fix/namespaces' into 'master'

Avoid direct calls of std:: namespaces

See merge request agnumpde/dune-elasticity!38
parents b102a3fa 70f7ca3b
......@@ -92,7 +92,10 @@ public:
field_type strainEnergy = 0;
if (mooneyrivlin_energy == "ciarlet")
return mooneyrivlin_a*normFSquared + mooneyrivlin_b*normFinvSquared*detF + mooneyrivlin_c*detF*detF - ((dim-1)*mooneyrivlin_a + mooneyrivlin_b + 2*mooneyrivlin_c)*std::log(detF);
{
using std::log;
return mooneyrivlin_a*normFSquared + mooneyrivlin_b*normFinvSquared*detF + mooneyrivlin_c*detF*detF - ((dim-1)*mooneyrivlin_a + mooneyrivlin_b + 2*mooneyrivlin_c)*log(detF);
}
else {
strainEnergy = mooneyrivlin_10 * trCTildeMinus3 +
mooneyrivlin_01 * c2TildeMinus3 +
......@@ -104,7 +107,8 @@ public:
mooneyrivlin_12 * trCTildeMinus3 * c2TildeMinus3 * c2TildeMinus3 +
mooneyrivlin_03 * c2TildeMinus3 * c2TildeMinus3 * c2TildeMinus3;
if (mooneyrivlin_energy == "log") {
field_type logDetF = std::log(detF);
using std::log;
field_type logDetF = log(detF);
return strainEnergy + 0.5 * mooneyrivlin_k* logDetF * logDetF;
} else if (mooneyrivlin_energy == "square") {
field_type detFMinus1 = detF - 1;
......
......@@ -50,15 +50,17 @@ public:
Dune::FieldVector<field_type, dim> sigmaSquared;
FMatrixHelp::eigenValues(C, sigmaSquared);
using std::sqrt;
// singular values of F, i.e., eigenvalues of U
std::array<field_type, dim> sigma;
for (int i = 0; i < dim; i++)
sigma[i] = std::sqrt(sigmaSquared[i]);
sigma[i] = sqrt(sigmaSquared[i]);
field_type detC = 1.0;
for (int i = 0; i < dim; i++)
detC *= sigmaSquared[i];
field_type detF = std::sqrt(detC);
field_type detF = sqrt(detC);
// \tilde{C} = \tilde{F}^T\tilde{F} = \frac{1}{\det{F}^{2/3}}C
field_type trCTilde = 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