<div dir="ltr">On Tue, Aug 13, 2013 at 10:31 AM, Roc Wang <span dir="ltr"><<a href="mailto:pengxwang@hotmail.com" target="_blank">pengxwang@hotmail.com</a>></span> wrote:<br><div class="gmail_extra"><div class="gmail_quote">
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div><div dir="ltr">Hi,<br><br> I am confused about calling<br><pre>PetscErrorCode DMDAGetNeighbors(DM da,const PetscMPIInt *ranks[]),<br><br>I am calling the function like this:<br><br>PetscMPIInt ** neighbors;<br>DMDAGetNeighbors(da, neighbors);<br>
<br>but the error shows<br><br>src/solver.cpp:152: error: invalid conversion from ‘PetscMPIInt**’ to ‘const PetscMPIInt**’<br>src/solver.cpp:152: error: initializing argument 2 of ‘PetscErrorCode DMDAGetNeighbors(_p_DM*, const PetscMPIInt**)’ <br>
<br>How should I define the neighbors before calling the function? Sorry it's not a pure Petsc question, but I am new in c++. Thanks for any comments.<br></pre> </div></div>
</blockquote></div><br>const PetscMPIInt *neighbors;</div><div class="gmail_extra"><br></div><div class="gmail_extra">DMDAGetNeighbors(dm, &neighbors);</div><div class="gmail_extra"><br></div><div class="gmail_extra">
Matt<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>