cideMOD.numerics.solver

Classes

NewtonBlockSolver(comm, problem[, conf, ...])

A Newton solver for non-linear block problems.

NonlinearBlockProblem(F, u, bcs, J[, ...])

Define a nonlinear problem, interfacing with SNES.

class cideMOD.numerics.solver.NewtonBlockSolver(comm: mpi4py.MPI.Intracomm, problem: NonlinearBlockProblem, conf='mumps', monitor=False, save_path=None)[source]

Bases: object

A Newton solver for non-linear block problems.

log = [('snes_monitor', ':snes_log.txt'), ('ksp_monitor', ':ksp_log.txt'), ('snes_linesearch_monitor', ':line_search_log.txt'), ('options_view', True), ('options_left', True)]
reset()[source]

This method resets the solver in order to be ready for running another simulation with the same initial configuration.

reset_snes_solution()[source]
solve(plot=False, clean=True)[source]

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

class cideMOD.numerics.solver.NonlinearBlockProblem(F: List[ufl.Form], u: Tuple[dolfinx.fem.Function], bcs: List[dolfinx.fem.DirichletBC], J: List[List[ufl.Form]], restriction: List[multiphenicsx.fem.DofMapRestriction] | None = None, P: ufl.Form | None = None)[source]

Bases: object

Define a nonlinear problem, interfacing with SNES.

F(snes: petsc4py.PETSc.SNES, x: petsc4py.PETSc.Vec, b: petsc4py.PETSc.Vec) None

Assemble the residual.

J(snes: petsc4py.PETSc.SNES, x: petsc4py.PETSc.Vec, A: petsc4py.PETSc.Mat, P_mat: petsc4py.PETSc.Mat) None

Assemble the jacobian.

create_snes_solution() petsc4py.PETSc.Vec[source]

Create SNES solution vector

obj(snes: petsc4py.PETSc.SNES, x: petsc4py.PETSc.Vec) float64

Compute the norm of the residual.

update_solutions(x: petsc4py.PETSc.Vec) None

Update self._solutions with data in x.