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

Use shared_ptr

parent 994efcd0
No related branches found
No related tags found
No related merge requests found
......@@ -228,7 +228,9 @@ int main(int argc, char *argv[]) {
std::fill(normalStress.begin(), normalStress.end(),
parset.get<double>("boundary.friction.normalstress"));
Dune::GlobalNonlinearity<dim> *myGlobalNonlinearity;
typedef Dune::shared_ptr<Dune::GlobalNonlinearity<dim>>
globalNonlinearityPtr;
globalNonlinearityPtr myGlobalNonlinearity;
std::string const friction_model =
parset.get<std::string>("boundary.friction.model");
......@@ -243,12 +245,13 @@ int main(int argc, char *argv[]) {
std::fill(eta.begin(), eta.end(),
parset.get<double>("boundary.friction.eta"));
myGlobalNonlinearity = new Dune::GlobalRuinaNonlinearity<dim>(
nodalIntegrals, a, mu, eta, normalStress);
} else if (friction_model == std::string("Laursen")) {
myGlobalNonlinearity =
globalNonlinearityPtr(new Dune::GlobalRuinaNonlinearity<dim>(
nodalIntegrals, a, mu, eta, normalStress));
} else if (friction_model == std::string("Laursen")) {
myGlobalNonlinearity = globalNonlinearityPtr(
new Dune::GlobalLaursenNonlinearity<dim, Dune::LinearFunction>(
mu, normalStress, nodalIntegrals);
mu, normalStress, nodalIntegrals));
} else {
assert(false);
}
......@@ -264,7 +267,6 @@ int main(int argc, char *argv[]) {
solver_tolerance, &energyNorm,
Solver::QUIET);
solver.solve();
free(myGlobalNonlinearity);
}
auto *displacement =
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment