<div dir="ltr"><div class="gmail_extra"><div class="gmail_quote">On Tue, Sep 27, 2016 at 6:48 AM, Cyrill Vonplanta <span dir="ltr"><<a href="mailto:cyrill.von.planta@usi.ch" target="_blank">cyrill.von.planta@usi.ch</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">I am finished with what I set up to do and I just want to leave this note to other potential PETSc-newbies that browse the mailing list:<br>
<br>
The important thing to point out here, is that PETSc (with the configuration below) in general does NOT do a Gauss-Seidel step. Instead it might do a block (!) Gauss-Seidel step using the inodes of the matrix. This leads to iterates that look different from what you would expect if the SOR-step is done coordinate-wise and you get a different convergence history.<br></blockquote><div><br></div><div>Note that you can disable this using</div><div><br></div><div> -mat_no_inodes</div><div><br></div><div> Thanks,</div><div><br></div><div> Matt</div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
(It’s mentioned on the documentation page, but one quickly overreads it)<br>
<br>
Cyrill<br>
<br>
> On 23 Aug 2016, at 16:54, Jed Brown <<a href="mailto:jed@jedbrown.org">jed@jedbrown.org</a>> wrote:<br>
><br>
> Cyrill Vonplanta <<a href="mailto:cyrill.von.planta@usi.ch">cyrill.von.planta@usi.ch</a>> writes:<br>
><br>
>> Dear PETSc-Users,<br>
>><br>
>> I am debugging a smoother of ours and i was wondering what settings of MatSOR exactly form one ordinary Gauss Seidel smoothing step. Currently I use:<br>
>><br>
>> ierr = MatSOR(A,b,1.0,(MatSORType)(<wbr>SOR_ZERO_INITIAL_GUESS | SOR_FORWARD_SWEEP),0,1,1,x); CHKERRV(ierr);<br>
><br>
> Yes, this is a standard forward sweep of GS. Note that your code below<br>
> computes half zeros (because the vector starts as 0), but that it<br>
> handles the diagonal incorrectly if you were to use a nonzero initial<br>
> guess.<br>
><br>
>> I expect this to be the same as this naïve Gauss-Seidel step:<br>
>><br>
>><br>
>> for (int i=0;i<m;i++){<br>
>><br>
>> sum_i = 0;<br>
>><br>
>> sum_i += ps_b_values[i];<br>
>><br>
>> for (int j=0;j<m;j++){<br>
>><br>
>> sum_i -= ps_A_values[i+j*m]*ps_x_<wbr>values[j];<br>
>><br>
>> }<br>
>><br>
>> ps_x_values[i] += sum_i/ps_A_values[i*m +i];<br>
>><br>
>> }<br>
>><br>
>> The ps_* refer to the data parts of PETSc types (everything is serial and dense in my toy example. Initial x is zero.m is dimension of A). However the convergence history looks different. Am I missing something here?<br>
>><br>
>> Best Cyrill<br>
<br>
</blockquote></div><br><br clear="all"><div><br></div>-- <br><div class="gmail_signature" data-smartmail="gmail_signature">What most experimenters take for granted before they begin their experiments is infinitely more interesting than any results to which their experiments lead.<br>-- Norbert Wiener</div>
</div></div>