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

Do not split the Dieterich nonlinearity

It makes the code harder to read and the computational benefit is
questionable
parent 87230f4c
No related branches found
No related tags found
Loading
...@@ -10,18 +10,17 @@ ...@@ -10,18 +10,17 @@
#include "compute_state_dieterich.hh" #include "compute_state_dieterich.hh"
// The nonlinearity exp(-x) // psi(beta) = V/L beta + e^(-beta)
// NOTE: the Dieterich law has an additional linear term! class DieterichNonlinearity {
class DecayingExponential {
public: public:
typedef Dune::FieldVector<double, 1> VectorType; typedef Dune::FieldVector<double, 1> VectorType;
typedef Dune::FieldMatrix<double, 1, 1> MatrixType; typedef Dune::FieldMatrix<double, 1, 1> MatrixType;
DecayingExponential(double tau) : tau(tau) {} DieterichNonlinearity(double _VoL) : VoL(_VoL) {}
void directionalSubDiff(VectorType const &u, VectorType const &v, void directionalSubDiff(VectorType const &u, VectorType const &v,
Interval<double> &D) const { Interval<double> &D) const {
D[0] = D[1] = v[0] * (-tau * std::exp(-u[0])); D[0] = D[1] = v[0] * (VoL - std::exp(-u[0]));
} }
void directionalDomain(VectorType const &, VectorType const &, void directionalDomain(VectorType const &, VectorType const &,
...@@ -31,16 +30,16 @@ class DecayingExponential { ...@@ -31,16 +30,16 @@ class DecayingExponential {
} }
private: private:
double const tau; double const VoL;
}; };
double state_update_dieterich_bisection(double tau, double VoL, double state_update_dieterich_bisection(double tau, double VoL,
double old_state) { double old_state) {
DecayingExponential::VectorType const start(0); DieterichNonlinearity::VectorType const start(0);
DecayingExponential::VectorType const direction(1); DieterichNonlinearity::VectorType const direction(1);
DecayingExponential const phi(tau); DieterichNonlinearity const phi(VoL);
MyDirectionalConvexFunction<DecayingExponential> const J( MyDirectionalConvexFunction<DieterichNonlinearity> const J(
1.0, old_state - tau * VoL, phi, start, direction); 1.0 / tau, old_state / tau, phi, start, direction);
int bisectionsteps = 0; int bisectionsteps = 0;
Bisection const bisection(0.0, 1.0, 1e-12, true, 0); // TODO Bisection const bisection(0.0, 1.0, 1e-12, true, 0); // TODO
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment