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