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

coefficientOfFriction -> mu

parent 1f956cf0
No related branches found
No related tags found
No related merge requests found
...@@ -15,12 +15,9 @@ template <int dim, class OuterFunctionType> ...@@ -15,12 +15,9 @@ template <int dim, class OuterFunctionType>
class GlobalLaursenNonlinearity : public Dune::GlobalNonlinearity<dim> { class GlobalLaursenNonlinearity : public Dune::GlobalNonlinearity<dim> {
public: public:
GlobalLaursenNonlinearity( GlobalLaursenNonlinearity(
std::vector<double> const &coefficientOfFriction, std::vector<double> const &mu, std::vector<double> const &normalStress,
std::vector<double> const &normalStress,
std::vector<Dune::FieldVector<double, 1>> const &nodalIntegrals) std::vector<Dune::FieldVector<double, 1>> const &nodalIntegrals)
: coefficientOfFriction(coefficientOfFriction), : mu(mu), normalStress(normalStress), nodalIntegrals(nodalIntegrals) {}
normalStress(normalStress),
nodalIntegrals(nodalIntegrals) {}
/* /*
Return a restriction of the outer function to the i'th node. If Return a restriction of the outer function to the i'th node. If
...@@ -39,14 +36,14 @@ class GlobalLaursenNonlinearity : public Dune::GlobalNonlinearity<dim> { ...@@ -39,14 +36,14 @@ class GlobalLaursenNonlinearity : public Dune::GlobalNonlinearity<dim> {
virtual Dune::NiceFunction *restriction(int i) const { virtual Dune::NiceFunction *restriction(int i) const {
double coefficient = nodalIntegrals[i][0]; double coefficient = nodalIntegrals[i][0];
coefficient *= normalStress[i]; coefficient *= normalStress[i];
coefficient *= 1 + coefficientOfFriction[i]; coefficient *= 1 + mu[i];
return new OuterFunctionType(coefficient); return new OuterFunctionType(coefficient);
} }
private: private:
// TODO: If we're clever, we only store one vector with the precomputed // TODO: If we're clever, we only store one vector with the precomputed
// results // results
std::vector<double> coefficientOfFriction; std::vector<double> mu;
std::vector<double> normalStress; std::vector<double> normalStress;
std::vector<Dune::FieldVector<double, 1>> nodalIntegrals; std::vector<Dune::FieldVector<double, 1>> nodalIntegrals;
}; };
......
...@@ -16,12 +16,11 @@ class GlobalRuinaNonlinearity : public Dune::GlobalNonlinearity<dim> { ...@@ -16,12 +16,11 @@ class GlobalRuinaNonlinearity : public Dune::GlobalNonlinearity<dim> {
public: public:
GlobalRuinaNonlinearity( GlobalRuinaNonlinearity(
std::vector<Dune::FieldVector<double, 1>> const &nodalIntegrals, std::vector<Dune::FieldVector<double, 1>> const &nodalIntegrals,
std::vector<double> const &a, std::vector<double> const &a, std::vector<double> const &mu,
std::vector<double> const &coefficientOfFriction,
std::vector<double> const &eta, std::vector<double> const &normalStress) std::vector<double> const &eta, std::vector<double> const &normalStress)
: nodalIntegrals(nodalIntegrals), : nodalIntegrals(nodalIntegrals),
a(a), a(a),
coefficientOfFriction(coefficientOfFriction), mu(mu),
eta(eta), eta(eta),
normalStress(normalStress) {} normalStress(normalStress) {}
...@@ -32,15 +31,14 @@ class GlobalRuinaNonlinearity : public Dune::GlobalNonlinearity<dim> { ...@@ -32,15 +31,14 @@ class GlobalRuinaNonlinearity : public Dune::GlobalNonlinearity<dim> {
if (nodalIntegrals[i][0] == 0) if (nodalIntegrals[i][0] == 0)
return new Dune::TrivialFunction(); return new Dune::TrivialFunction();
else else
return new Dune::RuinaFunction(nodalIntegrals[i][0], a[i], return new Dune::RuinaFunction(nodalIntegrals[i][0], a[i], mu[i], eta[i],
coefficientOfFriction[i], eta[i],
normalStress[i]); normalStress[i]);
} }
private: private:
std::vector<Dune::FieldVector<double, 1>> nodalIntegrals; std::vector<Dune::FieldVector<double, 1>> nodalIntegrals;
std::vector<double> a; std::vector<double> a;
std::vector<double> coefficientOfFriction; std::vector<double> mu;
std::vector<double> eta; std::vector<double> eta;
std::vector<double> normalStress; std::vector<double> normalStress;
}; };
......
...@@ -218,9 +218,9 @@ int main(int argc, char *argv[]) { ...@@ -218,9 +218,9 @@ int main(int argc, char *argv[]) {
// {{{ Assemble terms for the nonlinearity // {{{ Assemble terms for the nonlinearity
std::vector<double> coefficientOfFriction; std::vector<double> mu;
coefficientOfFriction.resize(grid.size(grid.maxLevel(), dim)); mu.resize(grid.size(grid.maxLevel(), dim));
std::fill(coefficientOfFriction.begin(), coefficientOfFriction.end(), std::fill(mu.begin(), mu.end(),
parset.get<double>("boundary.friction.mu")); parset.get<double>("boundary.friction.mu"));
std::vector<double> normalStress; std::vector<double> normalStress;
...@@ -244,11 +244,11 @@ int main(int argc, char *argv[]) { ...@@ -244,11 +244,11 @@ int main(int argc, char *argv[]) {
parset.get<double>("boundary.friction.eta")); parset.get<double>("boundary.friction.eta"));
myGlobalNonlinearity = new Dune::GlobalRuinaNonlinearity<dim>( myGlobalNonlinearity = new Dune::GlobalRuinaNonlinearity<dim>(
nodalIntegrals, a, coefficientOfFriction, eta, normalStress); nodalIntegrals, a, mu, eta, normalStress);
} else if (friction_model == std::string("Laursen")) { } else if (friction_model == std::string("Laursen")) {
myGlobalNonlinearity = myGlobalNonlinearity =
new Dune::GlobalLaursenNonlinearity<dim, Dune::LinearFunction>( new Dune::GlobalLaursenNonlinearity<dim, Dune::LinearFunction>(
coefficientOfFriction, normalStress, nodalIntegrals); mu, normalStress, nodalIntegrals);
} else { } else {
assert(false); assert(false);
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment