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

Barry Smith bsmith at mcs.anl.gov
Mon Aug 8 14:23:35 CDT 2011


   PETSc developers,

     We have a MatZeroRowsColumns() for MPIAIJ and SeqSBAIJ, what about having one for MPISBAIJ? Anyone want to code it up?

   Barry


    
On Aug 8, 2011, at 9:10 AM, Jed Brown wrote:

> On Mon, Aug 8, 2011 at 08:40, Clemens Domanig <clemens.domanig at uibk.ac.at> wrote:
> Hi,
> 
> I want my FE-program to be able to use LU- and LDLt-decomp (MUMPS). LU works fine and now I want to implement LDLt. My Questions:
> 1.) How can I speed up the assembly of the upper triangle matrix?
> * '-mat_ignore_lower_triangular' makes it terrible slow
> (1000 elements -> 1s explode to 18s
> * MatSetValues with Blocks of 6x6 and single values at the diagonal is even worse.
> 
> SBAIJ needs different preallocation. If you set it with Mat{Seq,MPI}SBAIJSetPreallocation(), assembly will be fast.
>  
> 2.) SBAIJ doesn't like MatZeroRows. What are the alternatives to apply boundary conditions to my matrix?
> 
> That function would make the matrix nonsymmetric because the columns aren't also zeroed, so you couldn't use it with a symmetric solver anyway. I believe in imposing boundary conditions symmetrically at the local level (either by removing them or by imposing them while computing residuals for those nodes), but many people like to do it differently.
> 
> To do boundary conditions by zeroing rows and columns after assembly, you would need to modify the right hand side in a compatible way. We could automate this by having the Mat "remember" the entries in the columns that it zeroed so that each right hand side could automatically be modified before starting the solve, but then solving A*x = b would either yield an x that doesn't satisfy this equation or modify b, both of which I think would be confusing.
> 
> Suggestions for imposing boundary conditions globally without ruining symmetry or having confusing semantics would be welcome.



More information about the petsc-users mailing list