autopdex.solver.solve_diagonal_linear
- autopdex.solver.solve_diagonal_linear(dofs, settings, static_settings, **kwargs)[source]
Solves a linear system assuming the tangent matrix is diagonal.
This function solves the linear system by leveraging the assumption that the tangent matrix is diagonal, which simplifies the solution process. It supports nodal imposition of Dirichlet boundary conditions and handles the assembly of the residual and diagonal tangent matrix.
If the tangent matrix is not diagonal, it will produce a wrong diagonal of the tangent!
- Parameters:
dofs (jnp.ndarray or dict) – Degrees of freedom or initial guess for the solution.
settings (dict) – Dictionary containing various settings and parameters required for assembling the problem.
static_settings (dict) – Dictionary containing static settings such as solution structure and solver backend.
**kwargs (dict) – Additional keyword arguments passed to the solver function.
- Returns:
The solution obtained by solving the linear system assuming a diagonal tangent matrix.
- Return type:
sol (jnp.ndarray)
Notes
If nodal imposition is detected in the static_settings, the function imposes Dirichlet boundary conditions and adjusts the degrees of freedom accordingly.
The function assembles the residual and diagonal tangent matrix before solving the system.
The solution process involves element-wise division of the residual by the diagonal elements of the tangent matrix.