autopdex.solver.linear_solve_jax

autopdex.solver.linear_solve_jax(dofs, settings, static_settings, **kwargs)[source]

Solves a linear system of equations using JAX’s matrix free solvers.

This function performs a linear solve using different itterative solvers, optionally imposing Dirichlet boundary conditions and preconditioning and using different matrix or Hessian vector product (HVP) methods.

Parameters:
  • dofs (jnp.ndarray) – Initial degrees of freedom.

  • settings (dict) – Dictionary of problem settings.

  • static_settings (dict) – Dictionary of static settings that do not change during iterations.

  • **kwargs – Additional keyword arguments for the solver.

Returns:

Solution degrees of freedom after solving the linear system.

Return type:

jnp.ndarray

Hessian Vector Product (HVP) Types:
  • ‘fwdrev’: Forward and reverse mode differentiation.

  • ‘revrev’: Reverse mode differentiation (only for symmetric matrices).

  • ‘assemble’: Assembles the tangent matrix explicitly (not supported with nodal imposition, then call e.g. PetSc).

  • ‘linearize’: Uses JAX’s linearize function.

  • Default: Uses ‘fwdrev’ if not specified or if an unsupported type is provided.

Solver Types:
  • ‘cg’: Conjugate Gradient.

  • ‘normal cg’: Normal Conjugate Gradient.

  • ‘gmres’: Generalized Minimal Residual Method.

  • ‘bicgstab’: BiConjugate Gradient Stabilized.

  • ‘lu’: LU Decomposition.

  • ‘cholesky’: Cholesky Decomposition (converts tangent to dense mode; not supported with nodal imposition).

  • ‘qr’: QR Decomposition (not supported with nodal imposition).

  • ‘jacobi’: Jacobi Method.

  • Default: Uses ‘bicgstab’ if not specified or if an unsupported type is provided.

Notes

  • Dirichlet boundary conditions are imposed if ‘nodal imposition’ is specified as the solution structure.

  • The itterative solver can be preconditioned with ‘jacobi’.

  • When using ‘assemble’ HVP type, the function will explicitly assemble the tangent matrix.