Alright got it, thanks all

On Mon, Jan 4, 2016 at 2:35 AM, Lawrence Mitchell <lawrence.mitchell@imperial.ac.uk> wrote:

> On 3 Jan 2016, at 12:24, Stephan Kramer <s.kramer@imperial.ac.uk> wrote:

...
>
>>
>> On 31/12/15 20:01, Justin Chang wrote:
>>> Hi all,
>>>
>>> Say I have this:
>>>
>>> a = dot(grad(u),grad(v))*dx
>>> L = f*v*dx
>>> bcs = DirichletBC(...)
>>>
>>> A = assemble(a)
>>> b = assemble(L)
>>> solver = LinearSolver(A, ...)
>>> solver.solve(x,b)
>>>
>>> If I want to apply the DirichletBC's, I would use "A =
>>> assemble(a,bcs=bcs)." Is it necessary to also do this for b? Would it
>>> have any affect?


It's unnecessary to do anything for b.  If you also assemble b with bcs it doesn't harm, however.

As Stephan points out, boundary conditions are lifted from the operator to the RHS during the solve, so they're sort of a property of the operator.  If you assemble the RHS with bcs applied (b = assemble(L, bcs=bcs)), then the boundary nodes will have the boundary condition value.


Cheers,

Lawrence

_______________________________________________
firedrake mailing list
firedrake@imperial.ac.uk
https://mailman.ic.ac.uk/mailman/listinfo/firedrake