<div class="gmail_quote">On Sat, Sep 10, 2011 at 12:36, Mohamad M. Nasr-Azadani <span dir="ltr"><<a href="mailto:mmnasr@gmail.com">mmnasr@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>I am setting up a matrix (parallel) using DA's in 3D. </div><div>DA is built upon a width=1, STAR_STENCIL type. </div><div>The nonzero structure of the resulting matrix is hepta-diagonal for the most part, however, since I am imposing boundary conditions using interpolation methods, for some boundary nodes, it is possible that some extra nonzeros are added into new locations. </div>
<div>This obviously reduces the matrix setup and assembly efficiency since the new nonzeros are not preallocated. </div><div>Is there any way that I could do it myself, i.e. preallocate the new nonzeros before matrix setup to get the best performance? </div>
</blockquote></div><br><div>Unfortunately there is not a convenient way to express this such that DMGetMatrix() will preallocate for those entries. You can preallocate your own matrix without calling DMGetMatrix(). It's not very hard for a stencil width of 1 with STAR, but it is still some code to write.</div>