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

Handle choice Ruina/Laursen in the parset file

parent 53622954
No related branches found
No related tags found
No related merge requests found
...@@ -216,34 +216,44 @@ int main(int argc, char *argv[]) { ...@@ -216,34 +216,44 @@ int main(int argc, char *argv[]) {
stiffnessMatrix.umv(u3, b3); stiffnessMatrix.umv(u3, b3);
// {{{ Assemble terms for the nonlinearity // {{{ Assemble terms for the nonlinearity
std::vector<double> a;
a.resize(grid.size(grid.maxLevel(), dim));
std::fill(a.begin(), a.end(), parset.get<double>("boundary.a"));
std::vector<double> coefficientOfFriction; std::vector<double> coefficientOfFriction;
coefficientOfFriction.resize(grid.size(grid.maxLevel(), dim)); coefficientOfFriction.resize(grid.size(grid.maxLevel(), dim));
std::fill(coefficientOfFriction.begin(), coefficientOfFriction.end(), std::fill(coefficientOfFriction.begin(), coefficientOfFriction.end(),
parset.get<double>("boundary.mu")); parset.get<double>("boundary.mu"));
std::vector<double> eta;
eta.resize(grid.size(grid.maxLevel(), dim));
std::fill(eta.begin(), eta.end(), parset.get<double>("boundary.eta"));
std::vector<double> normalStress; std::vector<double> normalStress;
normalStress.resize(grid.size(grid.maxLevel(), dim)); normalStress.resize(grid.size(grid.maxLevel(), dim));
std::fill(normalStress.begin(), normalStress.end(), std::fill(normalStress.begin(), normalStress.end(),
parset.get<double>("boundary.normalstress")); parset.get<double>("boundary.normalstress"));
Dune::GlobalLaursenNonlinearity<dim, Dune::LinearFunction> Dune::GlobalNonlinearity<dim> *myGlobalNonlinearity;
myGlobalNonlinearity(coefficientOfFriction, normalStress, nodalIntegrals);
// Dune::GlobalRuinaNonlinearity<dim> std::string const friction_model =
// myGlobalNonlinearity(nodalIntegrals, a, coefficientOfFriction, eta, parset.get<std::string>("boundary.friction.model");
// normalStress); if (friction_model == std::string("Ruina")) {
std::vector<double> a;
a.resize(grid.size(grid.maxLevel(), dim));
std::fill(a.begin(), a.end(), parset.get<double>("boundary.a"));
std::vector<double> eta;
eta.resize(grid.size(grid.maxLevel(), dim));
std::fill(eta.begin(), eta.end(), parset.get<double>("boundary.eta"));
myGlobalNonlinearity = new Dune::GlobalRuinaNonlinearity<dim>(
nodalIntegrals, a, coefficientOfFriction, eta, normalStress);
} else if (friction_model == std::string("Laursen")) {
myGlobalNonlinearity =
new Dune::GlobalLaursenNonlinearity<dim, Dune::LinearFunction>(
coefficientOfFriction, normalStress, nodalIntegrals);
} else {
assert(false);
}
// }}} // }}}
{ {
MyConvexProblemType myConvexProblem(stiffnessMatrix, MyConvexProblemType myConvexProblem(stiffnessMatrix,
myGlobalNonlinearity, b1, u1); *myGlobalNonlinearity, b1, u1);
MyBlockProblemType myBlockProblem(myConvexProblem); MyBlockProblemType myBlockProblem(myConvexProblem);
nonlinearGSStep.setProblem(u1, myBlockProblem); nonlinearGSStep.setProblem(u1, myBlockProblem);
...@@ -251,6 +261,7 @@ int main(int argc, char *argv[]) { ...@@ -251,6 +261,7 @@ int main(int argc, char *argv[]) {
solver_tolerance, &energyNorm, solver_tolerance, &energyNorm,
Solver::QUIET); Solver::QUIET);
solver.solve(); solver.solve();
free(myGlobalNonlinearity);
} }
auto *displacement = auto *displacement =
......
...@@ -15,4 +15,7 @@ tolerance = 1e-6 ...@@ -15,4 +15,7 @@ tolerance = 1e-6
a = 0.0015 a = 0.0015
normalstress = 0.1 normalstress = 0.1
mu = 0.75 mu = 0.75
eta = 1 eta = 1
\ No newline at end of file
[boundary.friction]
model = Laursen
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment