<div dir="ltr"><div class="gmail_extra"><br><div class="gmail_quote">On Fri, Mar 1, 2013 at 10:37 AM, John Mousel <span dir="ltr"><<a href="mailto:elafint.john@gmail.com" target="_blank">elafint.john@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>Let me be even more specific. I'm implementing a velocity correction scheme in rotational form (reference given below). In the first step, forgetting even a sub-iterative loop, a projecting pressure is solved for fromĀ <br>
</div><div><br></div><div>L(p(n+1)) = -div(beta*u(n) + gamma*u(n-1) + exci*u(n-2) + H(n+1) - H(n) + f(n+1) - f(n))</div><div><br></div><div>Here, L and div are Laplacian and divergence operators, and H(n) and f(n) are the non-linear and body force at time level n. In my mind, to form part of the RHS, I can use VecAXPY on all the terms in the div(), and then perform the divergence on that. To avoid communication, I can just use the VecAXPY on the ghosted portion as well, which since I've copied the entire ghosted vector during the VecCopy(u(n),u(n-1)) operation, should make sense.</div>
<div>Is that not a wise thing to do?</div><div></div></blockquote></div><div class="gmail_extra"><br></div>It is common to be able to assemble the RHS without updating ghost points in the local form, but that's not the case here. What you are doing is reasonable, but it couples the time integration method to the physics more tightly than I tend to like. In any case, you need not run the VecAXPY on the global form at all. Since you used the local form in the solve for u(n), it will still be valid on the next iteration. The result of the VecAXPY is a pure work vector so it can be a local vector (rather than the local form of some global vector).</div>
<div class="gmail_extra"><br></div><div class="gmail_extra" style>I predict that this is all premature optimization because the solve does much more communication and that cutting corners here will only serve to make your code more brittle without providing meaningful performance gains.</div>
</div>