← Back to team overview

dolfin team mailing list archive

NLS: [...]

 

Commit from garth (2005-12-06 14:54 CET)
-----------------

NLS:

Change from PETSc nonlinear solvers to own Newton methods. It looks a lot cleaner and simpler. It is derived from KrylovSolver, so parameters for the linear solver are set in the usual way.

There are two interfaces to the nonlinear solver.

1. The simple version (see src/demo/nls/poisson/):

NewtonSolver newtonsolver;
newtonsolver.solve(a, L, bc, mesh, x);


2. More sophisicated version (see src/demo/nls/nonlinearpoisson):

MyNonlinearFunction nonlinear_function(a, L, mesh, bc);

NewtonSolver newtonsolver;
newtonsolver.solve(nonlinear_function, x);

The user defines the NonlinearFunction. It returns the vector F(u)=0 and the Jacobian for the particular problem.

  dolfin  src/demo/nls/nonlinearpoisson/NonlinearPoisson.form  1.2
  dolfin  src/demo/nls/nonlinearpoisson/NonlinearPoisson.h     1.3
  dolfin  src/demo/nls/nonlinearpoisson/main.cpp               1.3
  dolfin  src/demo/nls/poisson/PoissonNl.form                  1.2
  dolfin  src/demo/nls/poisson/PoissonNl.h                     1.3
  dolfin  src/demo/nls/poisson/main.cpp                        1.3
  dolfin  src/demo/poisson/main.cpp                            1.11
  dolfin  src/kernel/nls/NewtonSolver.cpp                      1.4
  dolfin  src/kernel/nls/NonlinearFunction.cpp                 1.6
  dolfin  src/kernel/nls/dolfin/NewtonSolver.h                 1.4
  dolfin  src/kernel/nls/dolfin/NonlinearFunction.h            1.5