[petsc-dev] [petsc-users] (Fast?) assembly of upper triangle and MatZeroRows

Jed Brown jedbrown at mcs.anl.gov
Tue Aug 9 13:24:51 CDT 2011


On Tue, Aug 9, 2011 at 12:13, Barry Smith <bsmith at mcs.anl.gov> wrote:

> 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()?
>

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.

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

R_0 : projection into space with homogeneous Dirichlet values
R_D : projection into affine space with inhomogeneous Dirichlet values
R_\Gamma : projection into trace space on Dirichlet part of boundary, not
needed if Dirichlet values are removed

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.

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.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.mcs.anl.gov/pipermail/petsc-dev/attachments/20110809/0f907e4b/attachment.html>


More information about the petsc-dev mailing list