2010/4/15 陈乐平(Leping Chen) <span dir="ltr">&lt;<a href="mailto:chenleping@yahoo.cn">chenleping@yahoo.cn</a>&gt;</span><br><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">










<div style="margin:10px;font-family:verdana;font-size:10pt">
<div><font color="#0000ff" size="3" face="Verdana">hello, petsc teams,</font></div>
<div><font color="#0000ff" size="3"></font>&nbsp;</div>
<div><font color="#0000ff" size="3">when I use FormFuncion(), I need use a value of 
x;</font></div>
<div><font color="#0000ff" size="3"></font>&nbsp;</div>
<div><font color="#0000ff" size="3">but x is defined by Vec, I don&#39;t know how to 
get&nbsp; a value of x, for example, the 3rd value.</font></div></div></blockquote><div><br></div><div>Exactly as Jed wrote, you can use VecGetArray() to access any local values</div><div>of x.</div><div><br></div><div>&nbsp;&nbsp; Matt</div>
<div>&nbsp;</div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;"><div style="margin:10px;font-family:verdana;font-size:10pt"><div><font color="#0000ff" size="3"><span class="Apple-style-span" style="color: rgb(0, 0, 0); font-size: 13px; ">&nbsp;</span></font></div>

<div><font face="Verdana"></font><font color="#0000ff" size="3">thanks,</font></div>
<div><font color="#0000ff" size="3"></font>&nbsp;</div>
<div><font color="#0000ff" size="3">leping</font></div>
<div><font color="#0000ff" size="3" face="Verdana">&nbsp;<span> 
<div></div></span></font>
<hr color="#b5c4df" size="1">
</div></div>
<div><font size="2" face="Verdana"><strong>发件人:</strong> Jed Brown </font></div>
<div><font size="2" face="Verdana"><strong>发送时间:</strong> 2010-04-16&nbsp; 21:21:47 
</font></div>
<div><font size="2" face="Verdana"><strong>收件人:</strong> chenleping; PETSc users 
list </font></div>
<div><font size="2" face="Verdana"><strong>抄送:</strong> </font></div>
<div><font size="2" face="Verdana"><strong>主题:</strong> Re: [petsc-users] array and 
vec </font></div>
<div><font size="2" face="Verdana"></font></div>
<div><font size="2" face="Verdana">
<div>On&nbsp;Thu,&nbsp;15&nbsp;Apr&nbsp;2010&nbsp;21:17:19&nbsp;+0800,&nbsp;&quot;=?gb2312?B?s8LA1sa9?=&quot;&nbsp;&lt;<a href="mailto:chenleping@yahoo.cn" target="_blank">chenleping@yahoo.cn</a>&gt;&nbsp;wrote:</div>
<div>&gt;&nbsp;petsc&nbsp;teams,</div>
<div>&gt;&nbsp;</div>
<div>&gt;&nbsp;for&nbsp;following&nbsp;definitions:</div>
<div>&gt;&nbsp;</div>
<div>&gt;&nbsp;double&nbsp;precision&nbsp;u(n)</div>
<div>&gt;&nbsp;Vec&nbsp;&nbsp;v</div>
<div>&gt;&nbsp;</div>
<div>&gt;&nbsp;then,&nbsp;how&nbsp;can&nbsp;I&nbsp;actualize&nbsp;mutual&nbsp;updating&nbsp;between&nbsp;u(n)&nbsp;and&nbsp;v?</div>
<div></div>
<div>I&#39;m&nbsp;not&nbsp;sure&nbsp;what&nbsp;you&nbsp;mean,&nbsp;if&nbsp;these&nbsp;are&nbsp;the&nbsp;same&nbsp;quantity&nbsp;then&nbsp;they</div>
<div>shouldn&#39;t&nbsp;be&nbsp;stored&nbsp;in&nbsp;separate&nbsp;locations.&nbsp;&nbsp;See&nbsp;VecGetArray:</div>
<div></div>
<div>&nbsp;&nbsp;<a href="http://www.mcs.anl.gov/petsc/petsc-as/snapshots/petsc-current/docs/manualpages/Vec/VecGetArray.html" target="_blank">http://www.mcs.anl.gov/petsc/petsc-as/snapshots/petsc-current/docs/manualpages/Vec/VecGetArray.html</a></div>

<div></div>
<div>Jed</div></font></div>
</blockquote></div><br><br clear="all"><br>-- <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<br>