dolfin team mailing list archive
-
dolfin team
-
Mailing list archive
-
Message #10092
Re: NonlinearProblem, DirichletBC and the vector x
> -----Original Message-----
> From: dolfin-dev-bounces@xxxxxxxxxx
> [mailto:dolfin-dev-bounces@xxxxxxxxxx] On Behalf Of Anders Logg
> Sent: Tuesday, October 14, 2008 9:36 AM
> To: dolfin-dev@xxxxxxxxxx
> Subject: Re: [DOLFIN-dev] NonlinearProblem, DirichletBC and
> the vector x
>
> 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.
OK, sounds good. Thanks for your help.
Jake
>
> --
> Anders
>
References