:py:mod:`femo_alpha.dynamic_rm_shell.nonlinear_utils` ===================================================== .. py:module:: femo_alpha.dynamic_rm_shell.nonlinear_utils Module Contents --------------- Classes ~~~~~~~ .. autoapisummary:: femo_alpha.dynamic_rm_shell.nonlinear_utils.NewtonSolver femo_alpha.dynamic_rm_shell.nonlinear_utils.NonlinearProblem_mod Functions ~~~~~~~~~ .. autoapisummary:: femo_alpha.dynamic_rm_shell.nonlinear_utils.solveNonlinear_mod .. py:class:: NewtonSolver(comm: mpi4py.MPI.Intracomm, problem: NonlinearProblem) Bases: :py:obj:`dolfinx.cpp.nls.petsc.NewtonSolver` This class was copied from dolfinx.nls.petsc.NewtonSolver, for reference and for future modifications .. !! processed by numpydoc !! .. py:property:: A :type: petsc4py.PETSc.Mat Jacobian matrix .. !! processed by numpydoc !! .. py:property:: b :type: petsc4py.PETSc.Vec Residual vector .. !! processed by numpydoc !! .. py:method:: setP(P: types.FunctionType, Pmat: petsc4py.PETSc.Mat) Set the function for computing the preconditioner matrix Args: P: Function to compute the preconditioner matrix Pmat: Matrix to assemble the preconditioner into .. !! processed by numpydoc !! .. py:method:: solve(u: fem.Function) Solve non-linear problem into function u. Returns the number of iterations and if the solver converged. .. !! processed by numpydoc !! .. py:class:: NonlinearProblem_mod(F: ufl.form.Form, u: dolfinx.fem.function.Function, bcs: List[dolfinx.fem.bcs.DirichletBCMetaClass] = [], J: ufl.form.Form = None, form_compiler_options={}, jit_options={}) Nonlinear problem class for solving the non-linear problem :math:`F(u, v) = 0 \ \forall v \in V` using PETSc as the linear algebra backend. This class was copied from the `NonlinearProblem` class that is built-in in DOLFINx .. !! processed by numpydoc !! .. py:property:: L :type: dolfinx.fem.forms.FormMetaClass Compiled linear form (the residual form) .. !! processed by numpydoc !! .. py:property:: a :type: dolfinx.fem.forms.FormMetaClass Compiled bilinear form (the Jacobian form) .. !! processed by numpydoc !! .. py:method:: F(x: petsc4py.PETSc.Vec, b: petsc4py.PETSc.Vec) Assemble the residual F into the vector b. Args: x: The vector containing the latest solution b: Vector to assemble the residual into .. !! processed by numpydoc !! .. py:method:: J(x: petsc4py.PETSc.Vec, A: petsc4py.PETSc.Mat) Assemble the Jacobian matrix. Args: x: The vector containing the latest solution .. !! processed by numpydoc !! .. py:method:: form(x: petsc4py.PETSc.Vec) This function is called before the residual or Jacobian is computed. This is usually used to update ghost values. Args: x: The vector containing the latest solution .. !! processed by numpydoc !! .. py:function:: solveNonlinear_mod(F, w, bcs, abs_tol=1e-50, max_it=1, log=False) Wrap up the nonlinear solver for the problem F(w)=0 and returns the solution .. !! processed by numpydoc !!