<div dir="ltr"><div dir="ltr">On Wed, Feb 3, 2021 at 1:03 PM Sepideh Kavousi <<a href="mailto:skavou1@lsu.edu">skavou1@lsu.edu</a>> wrote:<br></div><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">




<div dir="ltr">
<div style="font-family:Calibri,Arial,Helvetica,sans-serif;font-size:12pt;color:rgb(0,0,0)">
I only have one field "names vx" and this variable change in both x and y directions. I have also chosen dof in DMDACreate2d to "1".
<br>
</div>
<div style="font-family:Calibri,Arial,Helvetica,sans-serif;font-size:12pt;color:rgb(0,0,0)">
<br>
</div>
<div style="font-family:Calibri,Arial,Helvetica,sans-serif;font-size:12pt;color:rgb(0,0,0)">
I am not sure why I should have aF[i][j].vx. "i" defines the grids in x direction and "j" is in y-directions. In all my previous codes I define" aF[j][i].vx" and not "aF[i][j].vx", and it was working properly.</div></div></blockquote><div><br></div><div>To me, it looks like you have "jj"</div><div><br></div><div>  Matt</div><div> </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr">
<div style="font-family:Calibri,Arial,Helvetica,sans-serif;font-size:12pt;color:rgb(0,0,0)">
Best,</div>
<div style="font-family:Calibri,Arial,Helvetica,sans-serif;font-size:12pt;color:rgb(0,0,0)">
Sepideh<br>
</div>
<div id="gmail-m_7812890000668533844appendonsend"></div>
<hr style="display:inline-block;width:98%">
<div id="gmail-m_7812890000668533844divRplyFwdMsg" dir="ltr"><font face="Calibri, sans-serif" style="font-size:11pt" color="#000000"><b>From:</b> Jed Brown <<a href="mailto:jed@jedbrown.org" target="_blank">jed@jedbrown.org</a>><br>
<b>Sent:</b> Wednesday, February 3, 2021 11:46 AM<br>
<b>To:</b> Sepideh Kavousi <<a href="mailto:skavou1@lsu.edu" target="_blank">skavou1@lsu.edu</a>>; <a href="mailto:petsc-users@mcs.anl.gov" target="_blank">petsc-users@mcs.anl.gov</a> <<a href="mailto:petsc-users@mcs.anl.gov" target="_blank">petsc-users@mcs.anl.gov</a>><br>
<b>Subject:</b> Re: [petsc-users] SNES-norm is zero all the time</font>
<div> </div>
</div>
<div><font size="2"><span style="font-size:11pt">
<div>Sepideh Kavousi <<a href="mailto:skavou1@lsu.edu" target="_blank">skavou1@lsu.edu</a>> writes:<br>
<br>
> I am not running an specific example. Attached is  my code. and when I wun with<br>
> ./step5.out -snes_monitor -snes_fd_color -ts_monitor -snes_converged_reason -pc_type lu<br>
><br>
> it seems it does not solve anything because the output is like:<br>
><br>
>     0 SNES Function norm 0.000000000000e+00<br>
>   Nonlinear solve converged due to CONVERGED_FNORM_ABS iterations 0<br>
> 1 TS dt 0.005 time 0.005<br>
<br>
Check your FormFunction for why af[][] is zero. I see<br>
<br>
  aF[j][j].vx<br>
<br>
but you'll need to set at all the grid points, i.e., aF[j][i].vx and aF[j][i].vy.<br>
</div>
</span></font></div>
</div>

</blockquote></div><br clear="all"><div><br></div>-- <br><div dir="ltr" class="gmail_signature"><div dir="ltr"><div><div dir="ltr"><div><div dir="ltr"><div>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><br></div><div><a href="http://www.cse.buffalo.edu/~knepley/" target="_blank">https://www.cse.buffalo.edu/~knepley/</a><br></div></div></div></div></div></div></div></div>