<div dir="ltr"><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><span style="font-family:courier new,monospace">
> For memory allocation, I know that every row of C contains exactly 12<br>
> non-zeros (since I interpolate from a 3x4 grid). But I have no idea if they<br>
> are in the diagonal or the off-diagonal region of the matrix. For C^T, I<br>
> can't predict beforehand how many non-zeros will be present in each row.<br>
> Most rows will in fact be empty. But if I assume a "nice" solid boundary, I<br>
> would imagine each velocity grid point should not be influenced by more<br>
> than ~4 body points.<br></span>
<span style="font-family:courier new,monospace"><br></span>
</div><span style="font-family:courier new,monospace">Can you just make one pass to count and another to insert?<br></span></blockquote><div><span style="font-family:courier new,monospace"><br></span></div><div><span style="font-family:courier new,monospace">Yes I could do that. I'll try that out. <br>




 <br></span></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><span style="font-family:courier new,monospace">

C * C^T is the influence of particles on each other?  Why can't you<br>
compute that analytically (without referencing the grid directly)?<br></span></blockquote><div><span style="font-family:courier new,monospace"><br></span></div><div><span style="font-family:courier new,monospace">I haven't thought about that. The interpolation coefficients would depend upon the relative positions of the body points with respect to the grid, and the product matrix will depend on their positions with respect to each other. I don't know if this can be done without referencing the grid. <br>




</span>
</div></div><span style="font-family:courier new,monospace"><br></span></div><div class="gmail_extra"><span style="font-family:courier new,monospace">I also have a couple of related questions:</span><span style="font-family:courier new,monospace"><br>




<br>[1] Suppose my body moves, and the positions of the body points change, will I have to completely deallocate C^T and reallocate the new rows on each process? It's possible that the number of non-zeros on each process can change. What would you suggest as the best strategy to do this?<br>




<br></span></div><div class="gmail_extra"><span style="font-family:courier new,monospace">[2] For a two dimensional staggered grid, I would need to interpolate both the x- and y- velocity components. So my system [C][u]=[b] will be:<br>




</span></div><div class="gmail_extra"><span style="font-family:courier new,monospace"><br>/Cx 0 \ /u\ = /bx\<br></span></div><div class="gmail_extra"><span style="font-family:courier new,monospace">\0  Cy/ \v/   \by/<br>



<br>
</span></div><div class="gmail_extra"><span style="font-family:courier new,monospace">Currently, I set up the right hand side as a single vector of size 2*numBodyPoints using VecCreate, and use the global index of the rows when I want to assemble the matrix C. Suppose I made it a DMComposite of bx and by (which I can create as 1-D DAs), how can I reference the correct row of the vector?<br>


<br>Also, is it possible to create a composite vector of two vectors that are not distributed arrays? <br>
</span></div><div class="gmail_extra"><span style="font-family:courier new,monospace"><br></span></div><div class="gmail_extra"><span style="font-family:courier new,monospace">Thank you,<br>Anush<br></span></div></div>