On 12/06/2016 03:17 PM, David Jessop wrote:
> I have a non-linear form of the Poisson equation where the "diffusion"
> coefficient depends on the derivatives of the state variable (see image).
> There are no Dirichlet-type boundary conditions (i.e. no ebcs) so I really
> need to specify a good initial guess at the solution.
> My questions are:
> 1) How are initial guesses passed to the solver? From the documentation,
> it doesn't seem like initial guesses can be directly passed to the
> nls.newton solver as an argument (though they are an argument of the
> subroutine __call__).
You are right that it is not possible to influence the initial guess of the
(non)linear solver from the problem description file. However, you can use the
interactive approach, where everything can be controlled in fine detail. See
, for example, where the line `vec = pb.solve()`  calls the solver. Its
first (optional) argument is the initial state guess (instance of State  -
State.vec is the numpy array holding the DOFs - you can set it in-place to
whatever you want, see below). You can also call the solvers directly (see the
> 2) In what form should the initial guess vector/array be written? Can a
> function be passed? Do numerical values have be be specified at the mesh
For the Lagrange basis (the default), you can use a function of nodal
coordinates - just evaluate what you need in the coordinates returned by
Or, more general, you could misuse the initial conditions facilities for time
dependent problems - create the initial conditions as in , and call
Let me know if you need a more detailed help.