25 template <
typename NLS>
39template <
typename NLS>
41 using JacobianType = std::remove_cvref_t<typename NLS::JacobianType>;
42 static_assert((traits::isSpecializationTypeAndNonTypes<Eigen::Matrix, JacobianType>::value) or
43 (traits::isSpecializationTypeNonTypeAndType<Eigen::SparseMatrix, JacobianType>::value),
44 "Linear solver not implemented for the chosen derivative type of the non-linear operator");
47 auto&& residual = nls.residual();
49 if constexpr (traits::isSpecializationTypeAndNonTypes<Eigen::Matrix, JacobianType>::value)
63template <
typename NLS>
64typename NLS::Domain::SolutionVectorType
idbcIncrement(
typename NLS::Domain& x,
const NLS& nls,
double Dlambda) {
67 y.parameter() += Dlambda;
68 y.syncParameterAndGlobalSolution(nls.updateFunction());
69 const auto delta = (y.globalSolution() - x.globalSolution()).eval();
73 v.setZero(x.globalSolution().size());
Contains stl-like type traits.
Collection of fallback default functions.
Type-erased linear solver with templated scalar type.
Definition: assemblermanipulatorbuildingblocks.hh:22
LinearSolverTemplate< double > LinearSolver
Definition: linearsolver.hh:235
auto createSPDLinearSolverFromNonLinearSolver(const NLS &nls)
A helper function that returns a linear solver suitable for symmetric, positive-definite sparse or de...
Definition: common.hh:40
SolverTypeTag
Enumeration representing different solver types.
Definition: linearsolver.hh:31
NLS::Domain::SolutionVectorType idbcIncrement(typename NLS::Domain &x, const NLS &nls, double Dlambda)
A helper function to calculate the increment in the solution vector based on inhomogeneous Dirichlet ...
Definition: common.hh:64
A concept to check if the underlying solver has a valid function to handle inhomogeneous Dirichlet BC...
Definition: common.hh:26