dolfin team mailing list archive
-
dolfin team
-
Mailing list archive
-
Message #18442
Re: [Question #110430]: Plot boundary conditions
Question #110430 on DOLFIN changed:
https://answers.launchpad.net/dolfin/+question/110430
Anders Logg posted a new comment:
On Tue, Jun 01, 2010 at 09:57:17AM -0000, Anders Logg wrote:
> Question #110430 on DOLFIN changed:
> https://answers.launchpad.net/dolfin/+question/110430
>
> Anders Logg posted a new comment:
> On Tue, Jun 01, 2010 at 09:33:18AM -0000, bluejerry wrote:
> > Question #110430 on DOLFIN changed:
> > https://answers.launchpad.net/dolfin/+question/110430
> >
> > Status: Answered => Solved
> >
> > bluejerry confirmed that the question is solved:
> > To plot the boundary conditions (as projected to the Vector Space)
> >
> > For the system Ax=b with boundary conditions bc; I first assembled A and
> > b, then applied the boundary condition, e.g.,
> >
> > A = assemble(a)
> > b = assemble(b)
> > bc.apply(A,b)
> >
> > then created a function u in the Vector Space V; and set the vector of u
> > equal bo b
> >
> > u = Function(V)
> > u.vector()[:] = b
> >
> > u can now be plotted using plot(u)
> >
> > This will plot the Vector Space with only the applied Dirichlet boundary
> > conditions applied.
>
> That's a good idea.
>
> An even easier way is the following:
>
> u = Function(V)
> bc.apply(u.vector())
> plot(u)
>
> I think I will add this to the plot functions to enable direct
> plotting of boundary conditions:
>
> plot(bc)
This has been added.
--
Anders
--
You received this question notification because you are a member of
DOLFIN Team, which is an answer contact for DOLFIN.
References