[petsc-users] Associate Values with DM variable
Alan Wei
zhenglun.wei at gmail.com
Fri Aug 19 16:52:19 CDT 2011
Dear all,
I have a question of the access of the DM in PETSc.
1) I used
DMDACreate2d(..., &da), where 'da' is a DM parameter;
2) and a DMDASetUniformCoordinates(da, ...) was used to set up a coordinate
system on 'da'.
3) Then I used
DMDAGetCoordinateDA(da, &cda);
DMDAGetGhostedCoordinates(da, &gc);
DMDAVecGetArray(cda, gc, &coors);
So that I can access the coordinate values of each points in 'da'.
4) My question is,
4.1) in spite of 'coors', is there any other values stored in 'da' for
every points of it;
4.2) I want to store other parameters associating with 'da', what should I
do for that? for example, since 'da' has a coordinate, I treat it as a
uniform mesh. In addition to coordinate values, I hope I can store u and v
(x/y-direction velocity magnitude) in each node of this coordinate. I
thought about use DMDACreate2d to create other two distributed matrices.
However, I'm not sure that these three DM (including 'da') has the same
allocation in parallel computational nodes. Like, 'da' is assigned x = 0~4
to rank-0 and x = 5~10 to rank-1; while DM for 'u' is arranged x = 0~5 to
rank-0 and x = 6~10 to rank-1.
Thanks,
Alan
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.mcs.anl.gov/pipermail/petsc-users/attachments/20110819/83ff6afc/attachment.htm>
More information about the petsc-users
mailing list