<div dir="ltr">Ok thanks.<div><br></div><div>Miguel</div></div><div class="gmail_extra"><br><div class="gmail_quote">On Fri, Sep 26, 2014 at 10:28 AM, Matthew Knepley <span dir="ltr"><<a href="mailto:knepley@gmail.com" target="_blank">knepley@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><div class="gmail_extra"><div class="gmail_quote"><span class="">On Fri, Sep 26, 2014 at 10:26 AM, Miguel Angel Salazar de Troya <span dir="ltr"><<a href="mailto:salazardetroya@gmail.com" target="_blank">salazardetroya@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr">Yeah, but doesn't it only work with the local vectors localX and localF?</div></blockquote><div><br></div></span><div>I am telling you what the interface for the functions is. You can do whatever you want inside.</div><div><br></div><div>  Matt</div><div><div class="h5"><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><div>Miguel</div><div class="gmail_extra"><br><div class="gmail_quote">On Fri, Sep 26, 2014 at 10:10 AM, Matthew Knepley <span dir="ltr"><<a href="mailto:knepley@gmail.com" target="_blank">knepley@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><div class="gmail_extra"><div class="gmail_quote"><span>On Fri, Sep 26, 2014 at 10:06 AM, Miguel Angel Salazar de Troya <span dir="ltr"><<a href="mailto:salazardetroya@gmail.com" target="_blank">salazardetroya@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr">That means that if we call <span style="font-family:arial,sans-serif;font-size:13px">SNESSetFunction() we don't build the residual vector in parallel? In the pflow example (</span><font face="arial, sans-serif"><a href="http://www.mcs.anl.gov/petsc/petsc-as/petsc-current/src/snes/examples/tutorials/network/pflow/pf.c.html" target="_blank">http://www.mcs.anl.gov/petsc/petsc-as/petsc-current/src/snes/examples/tutorials/network/pflow/pf.c.html</a>) the function FormFunction() (Input for SNESSetFunction() works with the local vectors. I don't understand this.</font></div></blockquote><div><br></div></span><div>FormFunction() in that link clearly takes in a global vector X and returns a global vector F. Inside, it</div><div>converts them to local vectors. This is exactly what you would do for a function given to SNESSetFunction().</div><div><br></div><div>  Matt</div><div><div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><div><font face="arial, sans-serif"><br></font></div><div><font face="arial, sans-serif">Thanks</font></div><div><font face="arial, sans-serif">Miguel</font></div></div><div class="gmail_extra"><br><div class="gmail_quote">On Fri, Sep 26, 2014 at 9:34 AM, Matthew Knepley <span dir="ltr"><<a href="mailto:knepley@gmail.com" target="_blank">knepley@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><div class="gmail_extra"><div class="gmail_quote"><span>On Fri, Sep 26, 2014 at 9:31 AM, Miguel Angel Salazar de Troya <span dir="ltr"><<a href="mailto:salazardetroya@gmail.com" target="_blank">salazardetroya@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr">Thanks. I had another question about the DM and SNES and TS. There are similar routines to assign the residual and jacobian evaluation to both objects. For the SNES case are:<div><br></div><div>DMSNESSetFunctionLocal</div><div>DMSNESSetJacobianLocal</div><div><br></div><div>What are the differences of these with:</div><div><br></div><div>SNESSetFunction</div><div>SNESSetJacobian</div></div></blockquote><div><br></div></span><div>SNESSetFunction() expects the user to construct the entire parallel residual vector. DMSNESSetFunctionLocal()</div><div>expects the user to construct the local pieces of the residual, and then it automatically calls DMLocalToGlobal()</div><div>to assembly the full residual. It also converts the input from global vectors to local vectors, and in the case of</div><div>DMDA multidimensional arrays.</div><div><br></div><div>  Thanks,</div><div><br></div><div>    Matt</div><div><div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><div>and when should we use each? With "Local", it is meant to evaluate the function/jacobian for the elements in the local processor? I could get the local edges in DMNetwork by calling DMNetworkGetEdgeRange?</div><div><br></div><div>Miguel</div></div><div class="gmail_extra"><br><div class="gmail_quote"><div><div>On Thu, Sep 25, 2014 at 5:17 PM, Matthew Knepley <span dir="ltr"><<a href="mailto:knepley@gmail.com" target="_blank">knepley@gmail.com</a>></span> wrote:<br></div></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><div class="gmail_extra"><div class="gmail_quote"><div><div><span>On Thu, Sep 25, 2014 at 5:15 PM, Miguel Angel Salazar de Troya <span dir="ltr"><<a href="mailto:salazardetroya@gmail.com" target="_blank">salazardetroya@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><font color="#a64d79">> If you need a symmetric Jacobian, you can use the BC facility in<br>> PetscSection, which eliminates the<br>> variables completely. This is how the FEM examples, like ex12, work.</font><div><br></div><div><div class="gmail_extra">Would that be with PetscSectionSetConstraintDof ? For that I will need the PetscSection, DofSection, within DMNetwork, how can I obtain it? I could cast it to DM_Network from the dm, networkdm,  declared in the main program, maybe something like this:</div><div class="gmail_extra"><pre width="80" style="color:rgb(0,0,0)">DM_Network     *network = (DM_Network*) networkdm->data;</pre><pre width="80"><font face="arial"><span style="white-space:normal">Then I would loop over the vertices and call </span></font><span style="font-family:arial">PetscSectionSetConstraintDof if it's a boundary node (by checking the corresponding component)</span></pre></div></div></div></blockquote></span><div>I admit to not completely understanding DMNetwork. However, it eventually builds a PetscSection for data layout, which</div><div>you could get from DMGetDefaultSection(). The right thing to do is find where it builds the Section, and put in your BC</div><div>there, but that sounds like it would entail coding.</div><div><br></div><div>  Thanks,</div><div><br></div><div>     Matt</div></div></div><span><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><div><div><div><div class="gmail_extra"><pre width="80"><span style="white-space:normal;font-family:arial">Thanks for your responses.</span></pre><pre width="80">Miguel</pre></div><div class="gmail_extra"><br></div></div></div><div class="gmail_extra"><div><div><br><div class="gmail_quote">On Thu, Sep 25, 2014 at 2:42 PM, Jed Brown <span dir="ltr"><<a href="mailto:jed@jedbrown.org" target="_blank">jed@jedbrown.org</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex"><span>Matthew Knepley <<a href="mailto:knepley@gmail.com" target="_blank">knepley@gmail.com</a>> writes:<br>
<br>
> On Thu, Sep 25, 2014 at 1:46 PM, Abhyankar, Shrirang G. <<a href="mailto:abhyshr@mcs.anl.gov" target="_blank">abhyshr@mcs.anl.gov</a><br>
>> wrote:<br>
><br>
>> You are right. The Jacobian for the power grid application is indeed<br>
>> non-symmetric. Is that a problem for your application?<br>
>><br>
><br>
> If you need a symmetric Jacobian, you can use the BC facility in<br>
> PetscSection, which eliminates the<br>
> variables completely. This is how the FEM examples, like ex12, work.<br>
<br>
</span>You can also use MatZeroRowsColumns() or do the equivalent<br>
transformation during assembly (my preference).<span><font color="#888888"><br>
</font></span></blockquote></div></div></div><span><font color="#888888"><br><br clear="all"><div><br></div>-- <br><div dir="ltr"><div><div><font face="verdana, sans-serif"><b>Miguel Angel Salazar de Troya</b></font></div></div><span><font color="#888888"><div><div><br><font face="arial,helvetica,sans-serif">Graduate Research Assistant<br>Department of Mechanical Science and Engineering<br></font>University of Illinois at Urbana-Champaign<br><a href="tel:%28217%29%20550-2360" value="+12175502360" target="_blank">(217) 550-2360</a><br>
</div></div><a href="mailto:salaza11@illinois.edu" target="_blank">salaza11@illinois.edu</a></font></span><div><br></div></div>
</font></span></div></div></div>
</blockquote></span></div><span><br><br clear="all"><span><font color="#888888"><span><div><br></div>-- <br>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
</span></font></span></span></div></div><span><font color="#888888">
</font></span></blockquote></div><span><font color="#888888"><br><br clear="all"><div><br></div>-- <br><div dir="ltr"><span><font face="verdana, sans-serif"><b>Miguel Angel Salazar de Troya</b></font></span><span><font color="#888888"><span><br><font face="arial,helvetica,sans-serif">Graduate Research Assistant<br>Department of Mechanical Science and Engineering<br></font>University of Illinois at Urbana-Champaign<br><a href="tel:%28217%29%20550-2360" value="+12175502360" target="_blank">(217) 550-2360</a><br>
</span><a href="mailto:salaza11@illinois.edu" target="_blank">salaza11@illinois.edu</a></font></span><div><br></div></div>
</font></span></div>
</blockquote></div></div></div><span><div><div><br><br clear="all"><span><font color="#888888"><div><br></div>-- <br>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
</font></span></div></div></span></div></div><span><font color="#888888">
</font></span></blockquote></div><span><font color="#888888"><br><br clear="all"><div><br></div>-- <br><div dir="ltr"><span><font face="verdana, sans-serif"><b>Miguel Angel Salazar de Troya</b></font></span><span><font color="#888888"><span><br><font face="arial,helvetica,sans-serif">Graduate Research Assistant<br>Department of Mechanical Science and Engineering<br></font>University of Illinois at Urbana-Champaign<br><a href="tel:%28217%29%20550-2360" value="+12175502360" target="_blank">(217) 550-2360</a><br>
</span><a href="mailto:salaza11@illinois.edu" target="_blank">salaza11@illinois.edu</a></font></span><div><br></div></div>
</font></span></div>
</blockquote></div></div></div><span><div><div><br><br clear="all"><div><br></div>-- <br>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></span></div></div>
</blockquote></div><br><br clear="all"><div><br></div>-- <br><div dir="ltr"><span><font face="verdana, sans-serif"><b>Miguel Angel Salazar de Troya</b></font></span><span><font color="#888888"><span><br><font face="arial,helvetica,sans-serif">Graduate Research Assistant<br>Department of Mechanical Science and Engineering<br></font>University of Illinois at Urbana-Champaign<br><a href="tel:%28217%29%20550-2360" value="+12175502360" target="_blank">(217) 550-2360</a><br>
</span><a href="mailto:salaza11@illinois.edu" target="_blank">salaza11@illinois.edu</a></font></span><div><br></div></div>
</div></div>
</blockquote></div></div></div><div><div class="h5"><br><br clear="all"><div><br></div>-- <br>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></div>
</blockquote></div><br><br clear="all"><div><br></div>-- <br><div dir="ltr"><font face="verdana, sans-serif"><b>Miguel Angel Salazar de Troya</b></font><span><font color="#888888"><br><font face="arial,helvetica,sans-serif">Graduate Research Assistant<br>Department of Mechanical Science and Engineering<br></font>University of Illinois at Urbana-Champaign<br>(217) 550-2360<br>
<a href="mailto:salaza11@illinois.edu" target="_blank">salaza11@illinois.edu</a></font></span><div><br></div></div>
</div>