<div dir="ltr"><br><div class="gmail_extra"><br><br><div class="gmail_quote">On Fri, Feb 14, 2014 at 1:31 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:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div class="">Xiangdong <<a href="mailto:epscodes@gmail.com">epscodes@gmail.com</a>> writes:<br>
<br>
> I tired that, however it does not work either.<br>
<br>
</div>"does not work" is not specific.<br></blockquote><div><br></div><div>It always crashed before, but I just figured out the reason. I use CHKERRQ(ierr) right after PetscOptionsGetRealArray. However, I forgot to set ierr to be the return value of that function call.</div>
<div><br></div><div>Thanks a lot for your help.</div><div><br></div><div>Xiangdong </div><div><br></div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div class=""><br>
> I call the function like this:<br>
> double myarray[10];<br>
> int nmax=10;<br>
> PetscOptionsGetRealArray(PETSC_NULL,'-myarray', myarray, &nmax,&flg);<br>
<br>
</div>printf("nmax = %d\n",nmax);<br>
for (i=0; i<nmax; i++) {<br>
printf(" %g\n",myarray[i]);<br>
}<br>
<br>
<br>
Also, please just use NULL.<br>
</blockquote></div><br></div></div>