[petsc-users] use of VecGetArray() with dof>1 (block size > 1)

Jed Brown jed at jedbrown.org
Fri May 27 21:59:14 CDT 2016


Ed Bueler <elbueler at alaska.edu> writes:
> Jed's "more information" answer about unstructured grids is a bit vague,
> but it must be the one that motivates the difference.

VecGetArray is most commonly used for algebraic operations that know
nothing about the geometry/discretization.  DM* functions are normally
used to access vectors in a discretization-aware way, such as DMDA with
{k,j,i} indexing or DMPlex with indexing by topological "points".  If
you're doing something unstructured without a DM, you probably have some
analogous data structure and I would suggest making a Vec accessor in
the language of that discretization.  If you really think the flat array
of structs that you're getting from VecGetArray (with an awkward cast)
is the best interface for your unstructured discretization, I would
still suggest making that trivial wrapper.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 818 bytes
Desc: not available
URL: <http://lists.mcs.anl.gov/pipermail/petsc-users/attachments/20160527/b0ae86f9/attachment.pgp>


More information about the petsc-users mailing list