From d8845fd88735279b7fc99360e17ff18df94d25f7 Mon Sep 17 00:00:00 2001
From: Lisa Julia Nebel <lisa_julia.nebel@tu-dresden.de>
Date: Fri, 9 Jul 2021 10:02:08 +0200
Subject: [PATCH] Add the option to use the Riemannian Proximal Newton solver
 also for problems with dim = dimwold

---
 src/cosserat-continuum.cc | 15 +++++++++++++++
 1 file changed, 15 insertions(+)

diff --git a/src/cosserat-continuum.cc b/src/cosserat-continuum.cc
index 83e5819d..75cb8c36 100644
--- a/src/cosserat-continuum.cc
+++ b/src/cosserat-continuum.cc
@@ -501,6 +501,7 @@ int main (int argc, char *argv[]) try
 
             using GFEAssemblerWrapper = Dune::GFE::GeodesicFEAssemblerWrapper<CompositeBasis, DeformationFEBasis, TargetSpace, RealTuple<double, 3>, Rotation<double,3>>;
             GFEAssemblerWrapper assembler(&mixedAssembler, deformationFEBasis);
+            if (parameterSet.get<std::string>("solvertype", "trustRegion") == "trustRegion") {
             RiemannianTrustRegionSolver<DeformationFEBasis, TargetSpace, GFEAssemblerWrapper> solver;
             solver.setup(*grid,
                      &assembler,
@@ -520,6 +521,20 @@ int main (int argc, char *argv[]) try
             solver.setInitialIterate(xTargetSpace);
             solver.solve();
             xTargetSpace = solver.getSol();
+            } else {
+                RiemannianProximalNewtonSolver<DeformationFEBasis, TargetSpace, GFEAssemblerWrapper> solver;
+                solver.setup(*grid,
+                             &assembler,
+                             xTargetSpace,
+                             dirichletDofsTargetSpace,
+                             tolerance,
+                             maxSolverSteps,
+                             initialRegularization,
+                             instrumented);
+                solver.setInitialIterate(xTargetSpace);
+                solver.solve();
+                xTargetSpace = solver.getSol();
+            }
             for (int i = 0; i < xTargetSpace.size(); i++) {
               x[_0][i] = xTargetSpace[i].r;
               x[_1][i] = xTargetSpace[i].q;
-- 
GitLab