MAT_FLUSH_ASSEMBLY

Matthew Knepley knepley at gmail.com
Tue Jul 22 17:51:17 CDT 2008


2008/7/22 LECAS Dimitri <dimitri.lecas at c-s.fr>:
> Hi
>
> I'am building a matrice (MPISBAIJ) in two steps, the first one i add many
> contributions with MatSetValue and the flag ADD_VALUES, and the last step i
> put boundary conditions using the flag INSERT_VALUES.
>
> I want to understand how to use MatAssemblyBegin and MatAssemblyEnd. Do I
> have to put between the two steps call to MatAssemblyBegin and
> MatAssemblyEnd with MAT_FLUSH_ASSEMBLY flag and after the last step call to
> MatAssemblyBegin and MatAssemblyEnd with MAT_FINAL_ASSEMBLY flag ?

1) FLUSH allows you to change the insertion mode, and flushes the communication
    buffers. FINAL does the same and compresses the matrix, etc. What
you propose
    should work.

2) If you are just setting some rows to the identity, you might
consider MatZeroRows().

   Matt

> Thanks
> --
> Dimitri Lecas
-- 
What most experimenters take for granted before they begin their
experiments is infinitely more interesting than any results to which
their experiments lead.
-- Norbert Wiener




More information about the petsc-users mailing list