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 {
a(a),
V0(V0),
coefficientProduct(coefficient * normalStress),
K(mu +
b * (state + std::log(V0 / L))), // state is assumed to be logarithmic
rho(std::exp(-K / a)) {}
// state is assumed to be logarithmic
K(mu + b * (state + std::log(V0 / L))),
V_m(std::exp(-K / a)) {}
double virtual evaluate(double x) const {
double const arg = x / V0;
if (arg <= rho)
double virtual evaluate(double V) const {
double const arg = V / V0;
if (arg <= V_m)
return 0;
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 const arg = x / V0;
if (arg <= rho)
double virtual leftDifferential(double V) const {
double const arg = V / V0;
if (arg <= V_m)
return 0;
double const ret = a * std::log(arg) + K;
return coefficientProduct * ret;
}
double virtual rightDifferential(double s) const {
return leftDifferential(s);
double virtual rightDifferential(double V) const {
return leftDifferential(V);
}
double virtual second_deriv(double x) const {
assert(x >= 0);
double virtual second_deriv(double V) const {
assert(V >= 0);
assert(V0 > 0);
double const arg = x / V0;
if (arg <= rho)
double const arg = V / V0;
if (arg <= V_m)
return 0;
return coefficientProduct * a / x;
return coefficientProduct * a / V;
}
double virtual regularity(double x) const {
assert(x >= 0);
double virtual regularity(double V) const {
assert(V >= 0);
assert(V0 > 0);
double const arg = x / V0;
double const arg = V / V0;
// 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::abs(second_deriv(x));
return std::abs(second_deriv(V));
}
bool virtual smoothesNorm() const { return true; }
......@@ -100,7 +100,7 @@ class RuinaFunction : public NiceFunction {
double const V0;
double const coefficientProduct;
double const K;
double const rho;
double const V_m;
};
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