<div dir="ltr"><div><div>I think he wants the source location so that he can copy and implementation and "tweak" it slightly<br><br></div>The location is here<br></div>${PETSC_DIR}/src/dm/impls/da/fdda.c<div><div><br>/Users/dmay/software/petsc-3.6.0/src<br>dmay@nikkan:~/software/petsc-3.6.0/src $ grep -r DMCreateMatrix_DA_3d_MPIAIJ *<br>dm/impls/da/fdda.c:extern PetscErrorCode DMCreateMatrix_DA_3d_MPIAIJ(DM,Mat);<br>dm/impls/da/fdda.c:extern PetscErrorCode DMCreateMatrix_DA_3d_MPIAIJ_Fill(DM,Mat);<br>dm/impls/da/fdda.c:        ierr = DMCreateMatrix_DA_3d_MPIAIJ_Fill(da,A);CHKERRQ(ierr);<br>dm/impls/da/fdda.c:        ierr = DMCreateMatrix_DA_3d_MPIAIJ(da,A);CHKERRQ(ierr);<br><b>dm/impls/da/fdda.c:#define __FUNCT__ "DMCreateMatrix_DA_3d_MPIAIJ"<br>dm/impls/da/fdda.c:PetscErrorCode DMCreateMatrix_DA_3d_MPIAIJ(DM da,Mat J)<br></b>dm/impls/da/fdda.c:#define __FUNCT__ "DMCreateMatrix_DA_3d_MPIAIJ_Fill"<br>dm/impls/da/fdda.c:PetscErrorCode DMCreateMatrix_DA_3d_MPIAIJ_Fill(DM da,Mat J)<br><br></div></div></div><div class="gmail_extra"><br><div class="gmail_quote">On 11 February 2016 at 04:08, 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 Wed, Feb 10, 2016 at 8:59 PM, Sang pham van <span dir="ltr"><<a href="mailto:pvsang002@gmail.com" target="_blank">pvsang002@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><p dir="ltr">The irregular rows is quite many. The matrix really needs to be preallocated. <br>
Could you show me how to use DMCreateMatrix_DA_3d_MPIAIJ() directly?</p>
<p dir="ltr"></p></blockquote></span><div>Just put the declaration right into your source.</div><div><br></div><div>   Matt <br></div><div><div class="h5"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><p dir="ltr">Pham</p>
<div class="gmail_quote">On Feb 11, 2016 9:52 AM, "Matthew Knepley" <<a href="mailto:knepley@gmail.com" target="_blank">knepley@gmail.com</a>> wrote:<br type="attribution"><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">On Wed, Feb 10, 2016 at 8:44 PM, Sang pham van <span dir="ltr"><<a href="mailto:pvsang002@gmail.com" target="_blank">pvsang002@gmail.com</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"><p dir="ltr">That is because my matrix has some rows which need more entries than usual.<br></p></blockquote><div><br></div><div>If its only a few, you could just turn off the allocation error.</div><div> </div><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"><p dir="ltr">
Where can i find source code of DMCreateMatrix()?</p>
<p dir="ltr"></p></blockquote><div><br></div><div><a href="https://bitbucket.org/petsc/petsc/src/827b69d6bb12709ff9b9a0dede31640477fc2b74/src/dm/impls/da/fdda.c?at=master&fileviewer=file-view-default#fdda.c-1024" target="_blank">https://bitbucket.org/petsc/petsc/src/827b69d6bb12709ff9b9a0dede31640477fc2b74/src/dm/impls/da/fdda.c?at=master&fileviewer=file-view-default#fdda.c-1024</a></div><div><br></div><div>  Matt <br></div><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"><p dir="ltr">Pham.<br>
</p>
<div class="gmail_quote">On Feb 11, 2016 8:35 AM, "Matthew Knepley" <<a href="mailto:knepley@gmail.com" target="_blank">knepley@gmail.com</a>> wrote:<br type="attribution"><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"><div dir="ltr"><div class="gmail_extra"><div class="gmail_quote">On Wed, Feb 10, 2016 at 6:14 PM, Sang pham van <span dir="ltr"><<a href="mailto:pvsang002@gmail.com" target="_blank">pvsang002@gmail.com</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"><div dir="ltr"><span style="font-size:12.8px">Hi,</span><div style="font-size:12.8px"><br></div><div style="font-size:12.8px">I am trying to create a DM matrix with <span style="font-size:12.8px">DMCreateMatrix_DA_3d_MPIAIJ() instead of using DMCreateMatrix().</span></div></div></blockquote><div><br></div><div>Why, that should be called automatically by DMCreateMatrix()?</div><div><br></div><div>  Matt</div><div> </div><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"><div dir="ltr"><div style="font-size:12.8px"><span style="font-size:12.8px">Which header file should I include to use that routine? also, what is the source file containing the DMCreateMatrix() routine?</span></div><div style="font-size:12.8px"><span style="font-size:12.8px"><br></span></div><div style="font-size:12.8px"><span style="font-size:12.8px">Many thanks in advance.</span></div><div style="font-size:12.8px"><div><img src="https://ssl.gstatic.com/ui/v1/icons/mail/images/cleardot.gif"></div><span><font color="#888888"><div>Pham</div></font></span></div></div>
</blockquote></div><br><br clear="all"><span><font color="#888888"><span><font color="#888888"><div><br></div>-- <br><div>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>
</font></span></font></span></div></div><span><font color="#888888">
</font></span></blockquote></div><span><font color="#888888">
</font></span></blockquote></div><span><font color="#888888"><br><br clear="all"><div><br></div>-- <br><div>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>
</font></span></div></div>
</blockquote></div>
</blockquote></div></div></div><div><div class="h5"><br><br clear="all"><div><br></div>-- <br><div>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></div>
</blockquote></div><br></div>