Skip to content
Snippets Groups Projects
Commit 14c79893 authored by Elias Pipping's avatar Elias Pipping Committed by Elias Pipping
Browse files

Fix RuinaFunction::evaluate() hopefully

parent ac950fb2
No related branches found
No related tags found
No related merge requests found
......@@ -56,11 +56,13 @@ class RuinaFunction : public NiceFunction {
rho = exp(-mu/a)
*/
void virtual evaluate(double const &x, double &y) const {
double const arg = std::max(eta * x / h, rho);
double const r = arg * (a * (std::log(arg) - 1) + mu + compound_state);
y = 1 / eta * normalStress * (r + a * rho + mu + compound_state);
y *= coefficient;
y *= h;
double const arg = eta * x / h;
if (arg <= rho) {
y = -log(rho); // TODO: We can write this out explicitly
return;
}
y = arg * (log(arg) - 1) - arg * log(rho) + rho - log(rho);
y *= coefficient * h * normalStress / eta;
}
/*
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment