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

x -> V, rho -> V_m

parent 6dcec895
No related branches found
No related tags found
No related merge requests found
...@@ -46,51 +46,51 @@ class RuinaFunction : public NiceFunction { ...@@ -46,51 +46,51 @@ class RuinaFunction : public NiceFunction {
a(a), a(a),
V0(V0), V0(V0),
coefficientProduct(coefficient * normalStress), coefficientProduct(coefficient * normalStress),
K(mu + // state is assumed to be logarithmic
b * (state + std::log(V0 / L))), // state is assumed to be logarithmic K(mu + b * (state + std::log(V0 / L))),
rho(std::exp(-K / a)) {} V_m(std::exp(-K / a)) {}
double virtual evaluate(double x) const { double virtual evaluate(double V) const {
double const arg = x / V0; double const arg = V / V0;
if (arg <= rho) if (arg <= V_m)
return 0; return 0;
return coefficientProduct * return coefficientProduct *
(+a * arg * (std::log(arg) - 1) + K * arg + a * rho); (+a * arg * (std::log(arg) - 1) + K * arg + a * V_m);
} }
double virtual leftDifferential(double x) const { double virtual leftDifferential(double V) const {
double const arg = x / V0; double const arg = V / V0;
if (arg <= rho) if (arg <= V_m)
return 0; return 0;
double const ret = a * std::log(arg) + K; double const ret = a * std::log(arg) + K;
return coefficientProduct * ret; return coefficientProduct * ret;
} }
double virtual rightDifferential(double s) const { double virtual rightDifferential(double V) const {
return leftDifferential(s); return leftDifferential(V);
} }
double virtual second_deriv(double x) const { double virtual second_deriv(double V) const {
assert(x >= 0); assert(V >= 0);
assert(V0 > 0); assert(V0 > 0);
double const arg = x / V0; double const arg = V / V0;
if (arg <= rho) if (arg <= V_m)
return 0; return 0;
return coefficientProduct * a / x; return coefficientProduct * a / V;
} }
double virtual regularity(double x) const { double virtual regularity(double V) const {
assert(x >= 0); assert(V >= 0);
assert(V0 > 0); assert(V0 > 0);
double const arg = x / V0; double const arg = V / V0;
// TODO: Make this controllable // TODO: Make this controllable
if (std::abs(arg - rho) < 1e-14) if (std::abs(arg - V_m) < 1e-14)
return std::numeric_limits<double>::infinity(); return std::numeric_limits<double>::infinity();
return std::abs(second_deriv(x)); return std::abs(second_deriv(V));
} }
bool virtual smoothesNorm() const { return true; } bool virtual smoothesNorm() const { return true; }
...@@ -100,7 +100,7 @@ class RuinaFunction : public NiceFunction { ...@@ -100,7 +100,7 @@ class RuinaFunction : public NiceFunction {
double const V0; double const V0;
double const coefficientProduct; double const coefficientProduct;
double const K; double const K;
double const rho; double const V_m;
}; };
class TrivialFunction : public NiceFunction { class TrivialFunction : public NiceFunction {
......
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