On Fri, May 24, 2013 at 12:53 PM, Zou (Non-US), Ling <[email protected]>wrote:
> Hi All, > > For a 1-D problem with multiple variables (u, v, w), it is natural to put > those unknowns in a Vec for SNES to solve, like, > > u0, v0, w0, u1, v1, w1, ... uN, vN, wN > > as it would reduce the band width of the Jacobian matrix. > > When passing this kind of structure to FormFunction, it is however not > convenient to access values as you need to jump around to get u(i-1), u(i) > and u(i+1). It is more convenient to have the structure in an order like > > u0, u1, ... uN, v0, v1, ... vN, w0, w1, ... wN > No, not at all. That will kill your cache coherence, and generally be very bad. You can still index as you want, just use DMDAVecGetArrayDOF(), so that you get f[i-1][j][0] --> f_u(i-1,j) f[i][j+1][2] --> f_w(i,j+1) Matt > Thus I need some way to map b/w them. I looked at the manual, it seems > that AO is probably the thing I am looking for. However, there are no > specific examples for them. I also tried VecScatter, split the original Vec > to three Vec(s), however, I am not quite sure if it is the right concept to > use for this kind of scenario. > > Does anyone have experience on this topic (I bet it is quite common). > > > Best, > > Ling > -- What most experimenters take for granted before they begin their experiments is infinitely more interesting than any results to which their experiments lead. -- Norbert Wiener
