femo_alpha.dynamic_rm_shell.nonlinear_utils

Module Contents

Classes

NewtonSolver

This class was copied from dolfinx.nls.petsc.NewtonSolver, for reference and for future modifications

NonlinearProblem_mod

Nonlinear problem class for solving the non-linear problem

Functions

solveNonlinear_mod(F, w, bcs[, abs_tol, max_it, log])

Wrap up the nonlinear solver for the problem F(w)=0 and

class femo_alpha.dynamic_rm_shell.nonlinear_utils.NewtonSolver(comm: mpi4py.MPI.Intracomm, problem: NonlinearProblem)

Bases: dolfinx.cpp.nls.petsc.NewtonSolver

This class was copied from dolfinx.nls.petsc.NewtonSolver, for reference and for future modifications

property A: petsc4py.PETSc.Mat

Jacobian matrix

property b: petsc4py.PETSc.Vec

Residual vector

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

solve(u: fem.Function)

Solve non-linear problem into function u. Returns the number of iterations and if the solver converged.

class femo_alpha.dynamic_rm_shell.nonlinear_utils.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 \(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

property L: dolfinx.fem.forms.FormMetaClass

Compiled linear form (the residual form)

property a: dolfinx.fem.forms.FormMetaClass

Compiled bilinear form (the Jacobian form)

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

J(x: petsc4py.PETSc.Vec, A: petsc4py.PETSc.Mat)

Assemble the Jacobian matrix.

Args:

x: The vector containing the latest solution

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

femo_alpha.dynamic_rm_shell.nonlinear_utils.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