<div dir="ltr"><meta charset="utf-8"><span class="Apple-style-span" style="font-family: arial, sans-serif; font-size: 13.2px; border-collapse: collapse; "><font face="arial, helvetica, sans-serif"><div><font face="arial, helvetica, sans-serif">I'm posting this to -dev since I'm working in -dev, let me know if I should be pushing this sort of question to -users. </font><span class="Apple-style-span" style="font-size: 13.2px; ">I was debugging a code today and noticed the following note in DAGetGlobalVector:</span></div>
</font><div><font face="arial, helvetica, sans-serif"><br></font></div><div><font face="arial, helvetica, sans-serif">"</font><font face="arial, helvetica, sans-serif">The vector values are NOT initialized and may have garbage in them, so you may need to zero them."</font></div>
<div><font face="arial, helvetica, sans-serif"><br></font></div><div><font face="arial, helvetica, sans-serif">What exactly is the purpose of these routines then? Is there a global Vector associated with a DA? If so, why are the values uninitialized? On the other hand, if there isn't one, what's the sense of 'get/restore'? </font><span style="font-family: arial, helvetica, sans-serif; ">The following code does NOT work the way I'd expect:</span></div>
<div><font face="arial, helvetica, sans-serif"><br></font></div><div><font face="arial, helvetica, sans-serif">DAGetGlobalVector(x)</font></div><div><font face="arial, helvetica, sans-serif"><br></font></div><div><font face="arial, helvetica, sans-serif">/* modify x */</font></div>
<div><font face="arial, helvetica, sans-serif"><br></font></div><div><font face="arial, helvetica, sans-serif">DARestoreGlobalVector(x)</font></div><div><font face="arial, helvetica, sans-serif"><br></font></div><div><font face="arial, helvetica, sans-serif">DAGetGlobalVector(x)</font></div>
<div><font face="arial, helvetica, sans-serif"><br></font></div><div><font face="arial, helvetica, sans-serif">/* access previous values, except everything is zero*/</font></div><div><font face="arial, helvetica, sans-serif"><br>
</font></div><div><font face="arial, helvetica, sans-serif">I guess I'm not grokking something about the concept of a DA or PETSc objects, could somebody explain the purpose or correct usage of Get/Restore here.</font></div>
<div><font face="arial, helvetica, sans-serif"><br></font></div><div><font face="arial, helvetica, sans-serif">Thanks in advance,</font></div><div><font face="arial, helvetica, sans-serif">Aron</font></div></span></div>