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