On 03/01/16 12:45, Stephan Kramer wrote:
Yes, that's necessary; see the last bit of the doc-string for assemble():
If ``bcs`` is supplied and ``f`` is a 2-form, the rows and columns of the resulting :class:`.Matrix` corresponding to boundary nodes will be set to 0 and the diagonal entries to 1. If ``f`` is a 1-form, the vector entries at boundary nodes are set to the boundary condition values.
Cheers Stephan
Actually, the answer is a little more complicated than that. The actual matrix and lhs are typically only assembled in the solve() call and you would actually need to have the matrix available to get the correct rhs when lifting bcs. Also you are allowed to change the bcs before the solve by using bcs.apply(A). I suspect this confusion comes from Dolfin which treats bcs differently (doesn't properly lift them). So in practice in firedrake the bcs are just handled as extra bits of information stored on the matrix, but I would just supply it to the assembly of b as well - if anything it will change the outcome if you force assembly of the rhs with b.vector().array() Cheers Stephan
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?
Thanks, Justin
_______________________________________________ firedrake mailing list firedrake@imperial.ac.uk https://mailman.ic.ac.uk/mailman/listinfo/firedrake
_______________________________________________ firedrake mailing list firedrake@imperial.ac.uk https://mailman.ic.ac.uk/mailman/listinfo/firedrake