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

[Cleanup] Move fd.a out of coefficientProduct

parent 71025c09
No related branches found
No related tags found
No related merge requests found
...@@ -32,7 +32,7 @@ class FrictionPotentialWrapper { ...@@ -32,7 +32,7 @@ class FrictionPotentialWrapper {
class FrictionPotential : public FrictionPotentialWrapper { class FrictionPotential : public FrictionPotentialWrapper {
public: public:
FrictionPotential(double coefficient, FrictionData const &fd) FrictionPotential(double coefficient, FrictionData const &fd)
: fd(fd), coefficientProduct(coefficient * fd.a * fd.normalStress) {} : fd(fd), weightTimesNormalStress(coefficient * fd.normalStress) {}
double evaluate(double V) const { double evaluate(double V) const {
assert(V >= 0); assert(V >= 0);
...@@ -40,7 +40,7 @@ class FrictionPotential : public FrictionPotentialWrapper { ...@@ -40,7 +40,7 @@ class FrictionPotential : public FrictionPotentialWrapper {
return 0; return 0;
// V log(V/V_m) - V + V_m // V log(V/V_m) - V + V_m
return coefficientProduct * (V * std::log(V / V_m) - V + V_m); return weightTimesNormalStress * fd.a * (V * std::log(V / V_m) - V + V_m);
} }
// log(V/V_m) if V >= V_0 // log(V/V_m) if V >= V_0
...@@ -50,7 +50,7 @@ class FrictionPotential : public FrictionPotentialWrapper { ...@@ -50,7 +50,7 @@ class FrictionPotential : public FrictionPotentialWrapper {
if (V <= V_m) if (V <= V_m)
return 0; return 0;
return coefficientProduct * std::log(V / V_m); return weightTimesNormalStress * fd.a * std::log(V / V_m);
} }
// 1/V if V > V_0 // 1/V if V > V_0
...@@ -61,7 +61,7 @@ class FrictionPotential : public FrictionPotentialWrapper { ...@@ -61,7 +61,7 @@ class FrictionPotential : public FrictionPotentialWrapper {
if (V <= V_m) if (V <= V_m)
return 0; return 0;
return coefficientProduct / V; return weightTimesNormalStress * fd.a / V;
} }
double regularity(double V) const { double regularity(double V) const {
...@@ -83,7 +83,7 @@ class FrictionPotential : public FrictionPotentialWrapper { ...@@ -83,7 +83,7 @@ class FrictionPotential : public FrictionPotentialWrapper {
private: private:
FrictionData const &fd; FrictionData const &fd;
double const coefficientProduct; double const weightTimesNormalStress;
double V_m; double V_m;
}; };
......
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