[petsc-users] Composing different Field Components into single Vector (or data array)

James Wright jrwrigh.iii at gmail.com
Mon Apr 17 12:30:30 CDT 2023


Hello,

I currently have two DMPlex objects, both `DMClone`ed from the same
"original" DMPlex object. They have different fields with different numbers
of components on each of them. I would like to compose certain components
from each into a single contiguous array. I'd also like to do this from a
DMGlobal vector. What is the best/most robust way to do that?

Obviously I can just `VecGetArrayRead` each of the vectors and loop through
them manually, but that relies on knowledge of the array data layout.
There's `DMPlexGetLocalOffsets`, but since I want to use the global Vec,
there isn't a corresponding `DMPlexGetGlobalOffsets` (that I can see
anyways). This manually looping would also require that the underlying
arrangement of the DOFs is the same between the two DMPlex objects, but I
assume this is true from the `DMClone` operation.

Thanks,
James Wright
Graduate Research Assistant, PhD
University of Colorado Boulder
Cell: (864) 498 8869
Email: james at jameswright.xyz
Website: jameswright.xyz <https://www.jameswright.xyz/>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.mcs.anl.gov/pipermail/petsc-users/attachments/20230417/de7bb9b8/attachment.html>


More information about the petsc-users mailing list