Message: 2<br><div class="gmail_quote"><blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;">
Date: Mon, 8 Nov 2010 19:57:16 -0600<br>
From: Barry Smith <<a href="mailto:bsmith@mcs.anl.gov">bsmith@mcs.anl.gov</a>><br>
Subject: Re: [petsc-users] Can I use MAT_FINAL_ASSEMBLY instead of<br>
MAT_FLUSH_ASSEMBLY?<br>
To: PETSc users list <<a href="mailto:petsc-users@mcs.anl.gov">petsc-users@mcs.anl.gov</a>><br>
Message-ID: <<a href="mailto:52AFD8FB-17C1-4B51-97E9-C77112B69F3C@mcs.anl.gov">52AFD8FB-17C1-4B51-97E9-C77112B69F3C@mcs.anl.gov</a>><br>
Content-Type: text/plain; charset=us-ascii<br>
<br>
<br>
On Nov 8, 2010, at 7:49 PM, Rongliang Chen wrote:<br>
<br>
> Hi everyone,<br>
><br>
> Can I use MAT_FINAL_ASSEMBLY instead of MAT_FLUSH_ASSEMBLY in the function MatAssemblyBegin/End when switching between ADD_VALUES and INSERT_VALUES in MatSetValues()? Thank you!<br>
><br>
> Regards,<br>
><br>
> Rongliang<br>
<br>
Yes, but generally there is no reason to. It is best to use the flush until your final assembly because then it doesn't do any work that needs to be redone or prematurely free memory that may be needed later.<br>
<br>
Why do you want to do that?<br>
<br>
Barry<br>
<br>
<br>
</blockquote><div> <br><font size="2">Hi Barry,<br></font></div><div><font size="2"><br>Thank you for your reply. I find that when I use MAT_FINAL_ASSEMBLY instead of MAT_FLUSH_ASSEMBLY in the function MatAssemblyBegin/End, it will<br>
cause problem. I do not know why.<br><br>The reason that I want to use it like this is that I first set the matrix with ADD_VALUES and then I need to zero some rows of the matrix using MatZeroRowsLocalIS(), at last I still need to set some elements of the matrix with INSERT_VALUES. Between MatSetValues() and MatZeroRowsLocalIS() I need to use MAT_FINAL_ASSEMBLY. <br>
The order is:<br>ADD_VALUES--->MatZeroRowsLocalIS()--->INSERT_VALUES.<br><br>Thanks!<br><br>Regards,<br><br>Rongliang</font><br></div></div>