On Tue, Oct 14, 2008 at 08:30:51AM -0600, Ostien, Jakob T wrote: > Hi, > > The demo in nls/nonlinearpoisson/python (for me) produces a seg fault during > the application of the DirichletBC. The problem is related to the > specification of the Vector x and the Function u. > > the code has > x = Vector() > u = Function(element, mesh, x) > > (then later) > > nonlinear_solver.solve(nonlinear_problem, x) > > > But this doesn't work as expected. What does work however is > > nonlinear_solver.solve(nonlinear_problem, u.vector()) > > > Now in the cpp demo, we assign x as > > GenericVector& x = u.vector(); > > which is why it works, so my question is what is the equivalent way to > initialize the function u and then declare x as the vector of u? > > Jake
u = Function(element, mesh, Vector()) x = u.vector() In a short while (getting closer by the minute) it will be u = Function(V) x = u.vector() where V is a FunctionSpace. -- Anders
signature.asc
Description: Digital signature
_______________________________________________ DOLFIN-dev mailing list [email protected] http://www.fenics.org/mailman/listinfo/dolfin-dev
