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

Fix definition of RuinaFunction

parent 037c1146
No related branches found
No related tags found
No related merge requests found
......@@ -35,14 +35,14 @@ class RuinaFunction : public NiceFunction {
RuinaFunction(double coefficient, double a, double mu, double eta,
double normalStress, double b, double state, double L, double h)
: a(a),
eta_h(eta / h),
h(h),
coefficientProduct(coefficient * normalStress),
c(mu + (a - b) * std::log(eta) - b * std::log(L)),
K(b * state) // state is assumed to be logarithmic
{}
void virtual evaluate(double const &x, double &y) const {
double const arg = eta_h * x;
double const arg = x / h;
if (arg == 0) { // TODO: Make this controllable
y = 0;
return;
......@@ -50,11 +50,11 @@ class RuinaFunction : public NiceFunction {
double const expstar = arg * std::log(arg) - arg;
y = a * expstar + (c + K) * arg;
y *= coefficientProduct / eta_h;
y *= coefficientProduct * h;
}
double virtual leftDifferential(double x) const {
double const arg = eta_h * x;
double const arg = x / h;
if (arg < 1e-14) // TODO: Make this controllable
return 0;
......@@ -82,7 +82,7 @@ class RuinaFunction : public NiceFunction {
private:
double const a;
double const eta_h;
double const h;
double const coefficientProduct;
double const c;
double const K;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment