<div class="gmail_quote">On Tue, Aug 9, 2011 at 12:13, Barry Smith <span dir="ltr"><<a href="mailto:bsmith@mcs.anl.gov">bsmith@mcs.anl.gov</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">
<div id=":2jz">Hence MatZeroRowsColumns()?  but then as you noted the SNES FormJacobian needs access to the right hand side vector which is not great. So what about MatZeroRowsColumns() that "remembers" the removed stuff and then when KSPSolve() starts it "adjusts" the right hand side based on the "memory" using something like MatFixRightHandSideForZeroedRowsColumns()?</div>
</blockquote></div><br><div>You can do this, but if the boundary conditions are not imposed on assembly, you either have the problem that solving A*x = b modifies the A and/or b or that the solution x does not satisfy A*x=b. These seem very confusing to me.</div>
<div><br></div><div>If you tell a matrix about Dirichlet dofs, then it can impose suitable conditions during MatSetValues and MatAssemblyBegin/End so that the assembled matrix is ready for solving. This also requires that Vec knows about Dirichlet boundary conditions and/or that users write residual evaluation in a certain way. This knowledge about Dirichlet values condenses, in my opinion, into three operators</div>
<div><br></div><div>R_0 : projection into space with homogeneous Dirichlet values</div><div>R_D : projection into affine space with inhomogeneous Dirichlet values</div><div>R_\Gamma : projection into trace space on Dirichlet part of boundary, not needed if Dirichlet values are removed</div>
<div><br></div><div>These projections may interact differently with different spatial discretizations, but if we taught Vec about these concepts, then we could have a standard recommendation for implementation. I'm not sure this is a good idea, but I think it's the correct level at which to handle it.</div>
<div><br></div><div>If Dirichlet nodes are left in and rediscretized GMG is used, we should scale the trace space based on some local coefficients. I haven't seen an especially simple interface for that.</div>