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

Introduce L and b

parent b4f23bf3
No related branches found
No related tags found
No related merge requests found
...@@ -26,13 +26,17 @@ class GlobalRuinaNonlinearity ...@@ -26,13 +26,17 @@ class GlobalRuinaNonlinearity
shared_ptr<BlockVector<FieldVector<double, 1>> const> mu, shared_ptr<BlockVector<FieldVector<double, 1>> const> mu,
shared_ptr<BlockVector<FieldVector<double, 1>> const> eta, shared_ptr<BlockVector<FieldVector<double, 1>> const> eta,
shared_ptr<BlockVector<FieldVector<double, 1>> const> normalStress, shared_ptr<BlockVector<FieldVector<double, 1>> const> normalStress,
shared_ptr<BlockVector<FieldVector<double, 1>> const> state, double h) shared_ptr<BlockVector<FieldVector<double, 1>> const> b,
shared_ptr<BlockVector<FieldVector<double, 1>> const> state,
shared_ptr<BlockVector<FieldVector<double, 1>> const> L, double h)
: nodalIntegrals(nodalIntegrals), : nodalIntegrals(nodalIntegrals),
a(a), a(a),
mu(mu), mu(mu),
eta(eta), eta(eta),
normalStress(normalStress), normalStress(normalStress),
b(b),
state(state), state(state),
L(L),
h(h), h(h),
trivialNonlinearity( trivialNonlinearity(
new LocalNonlinearity<dim>(make_shared<TrivialFunction const>())), new LocalNonlinearity<dim>(make_shared<TrivialFunction const>())),
...@@ -55,7 +59,7 @@ class GlobalRuinaNonlinearity ...@@ -55,7 +59,7 @@ class GlobalRuinaNonlinearity
auto const func = make_shared<RuinaFunction const>( auto const func = make_shared<RuinaFunction const>(
(*nodalIntegrals)[i][0], (*a)[i][0], (*mu)[i][0], (*eta)[i][0], (*nodalIntegrals)[i][0], (*a)[i][0], (*mu)[i][0], (*eta)[i][0],
(*normalStress)[i][0], (*state)[i][0], h); (*normalStress)[i][0], (*b)[i][0], (*state)[i][0], (*L)[i][0], h);
restrictions[i] = make_shared<LocalNonlinearity<dim> const>(func); restrictions[i] = make_shared<LocalNonlinearity<dim> const>(func);
return restrictions[i]; return restrictions[i];
} }
...@@ -68,7 +72,9 @@ class GlobalRuinaNonlinearity ...@@ -68,7 +72,9 @@ class GlobalRuinaNonlinearity
shared_ptr<BlockVector<FieldVector<double, 1>> const> mu; shared_ptr<BlockVector<FieldVector<double, 1>> const> mu;
shared_ptr<BlockVector<FieldVector<double, 1>> const> eta; shared_ptr<BlockVector<FieldVector<double, 1>> const> eta;
shared_ptr<BlockVector<FieldVector<double, 1>> const> normalStress; shared_ptr<BlockVector<FieldVector<double, 1>> const> normalStress;
shared_ptr<BlockVector<FieldVector<double, 1>> const> b;
shared_ptr<BlockVector<FieldVector<double, 1>> const> state; shared_ptr<BlockVector<FieldVector<double, 1>> const> state;
shared_ptr<BlockVector<FieldVector<double, 1>> const> L;
double const h; double const h;
std::vector<shared_ptr<LocalNonlinearity<dim> const>> mutable restrictions; std::vector<shared_ptr<LocalNonlinearity<dim> const>> mutable restrictions;
......
...@@ -31,14 +31,14 @@ class NiceFunction : public VirtualFunction<double, double> { ...@@ -31,14 +31,14 @@ class NiceFunction : public VirtualFunction<double, double> {
class RuinaFunction : public NiceFunction { class RuinaFunction : public NiceFunction {
public: public:
RuinaFunction(double coefficient, double a, double mu, double eta, RuinaFunction(double coefficient, double a, double mu, double eta,
double normalStress, double state, double h) double normalStress, double b, double state, double L, double h)
: coefficient(coefficient), : coefficient(coefficient),
a(a), a(a),
mu(mu), mu(mu),
rho(exp(-mu / a)), rho(exp(-mu / a)),
eta(eta), eta(eta),
normalStress(normalStress), normalStress(normalStress),
state(state), compound_state(b * (state - log(eta * L))),
h(h) {} h(h) {}
/* /*
...@@ -57,8 +57,8 @@ class RuinaFunction : public NiceFunction { ...@@ -57,8 +57,8 @@ class RuinaFunction : public NiceFunction {
*/ */
void virtual evaluate(double const &x, double &y) const { void virtual evaluate(double const &x, double &y) const {
double const arg = std::max(eta * x / h, rho); double const arg = std::max(eta * x / h, rho);
double const r = arg * (a * (std::log(arg) - 1) + mu + state); double const r = arg * (a * (std::log(arg) - 1) + mu + compound_state);
y = 1 / eta * normalStress * r + a * rho + mu + state; y = 1 / eta * normalStress * r + a * rho + mu + compound_state;
y *= coefficient; y *= coefficient;
y *= h; y *= h;
} }
...@@ -75,7 +75,8 @@ class RuinaFunction : public NiceFunction { ...@@ -75,7 +75,8 @@ class RuinaFunction : public NiceFunction {
if (arg <= rho) if (arg <= rho)
return 0; return 0;
return coefficient * normalStress * (a * std::log(arg) + mu + state); return coefficient * normalStress *
(a * std::log(arg) + mu + compound_state);
} }
/* see above */ /* see above */
...@@ -84,7 +85,8 @@ class RuinaFunction : public NiceFunction { ...@@ -84,7 +85,8 @@ class RuinaFunction : public NiceFunction {
if (arg <= rho) if (arg <= rho)
return 0; return 0;
return coefficient * normalStress * (a * std::log(arg) + mu + state); return coefficient * normalStress *
(a * std::log(arg) + mu + compound_state);
} }
/* /*
...@@ -113,7 +115,7 @@ class RuinaFunction : public NiceFunction { ...@@ -113,7 +115,7 @@ class RuinaFunction : public NiceFunction {
double const mu; double const mu;
double const eta; double const eta;
double const normalStress; double const normalStress;
double const state; double const compound_state;
double const h; double const h;
double const rho; double const rho;
......
...@@ -168,9 +168,15 @@ assemble_nonlinearity( ...@@ -168,9 +168,15 @@ assemble_nonlinearity(
auto eta = Dune::make_shared<SingletonVectorType>(size); auto eta = Dune::make_shared<SingletonVectorType>(size);
*eta = parset.get<double>("boundary.friction.eta"); *eta = parset.get<double>("boundary.friction.eta");
auto b = Dune::make_shared<SingletonVectorType>(size);
*b = 1; // FIXME
auto L = Dune::make_shared<SingletonVectorType>(size);
*L = 1.0 / parset.get<double>("boundary.friction.eta"); // FIXME
return Dune::make_shared< return Dune::make_shared<
Dune::GlobalRuinaNonlinearity<VectorType, MatrixType> const>( Dune::GlobalRuinaNonlinearity<VectorType, MatrixType> const>(
nodalIntegrals, a, mu, eta, normalStress, state, h); nodalIntegrals, a, mu, eta, normalStress, b, state, L, h);
} else if (friction_model == std::string("Laursen")) { } else if (friction_model == std::string("Laursen")) {
return return
// TODO: take state and h into account // TODO: take state and h into account
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment