44 Eigen::Vector3d
const& real_coords,
46 double const real_coords_tolerance)
const override
49 using LJM =
typename Problem::LocalJacobianMatrix;
50 using LRV =
typename Problem::LocalResidualVector;
52 Problem problem(e, Eigen::Map<const LRV>(real_coords.data()));
54 Eigen::PartialPivLU<LJM> linear_solver(
ElementDim);
57 const double increment_tolerance = 0;
60 [&problem](LJM& J) { problem.updateJacobian(J); },
61 [&problem](LRV& res) { problem.updateResidual(res); },
62 [&problem](
auto& delta_r) { problem.updateSolution(delta_r); },
63 {max_iter, real_coords_tolerance, increment_tolerance});
65 auto const opt_iter = newton_solver.solve(jacobian);
69 DBUG(
"Newton solver succeeded after {} iterations", *opt_iter);
71 Eigen::Vector3d natural_coords = Eigen::Vector3d::Zero();
72 natural_coords.head<
ElementDim>() = problem.getNaturalCoordinates();
73 return natural_coords;
77 "Newton solver failed. Please consider increasing the error "
78 "tolerance or the max. number of Newton iterations.");