Actually there is magic code that can be generated to tell Matlab the "shape" of the result when coming from DMDA. You need to first push onto the viewer the format PETSC_VIEWER_BINARY_MATLAB. This will cause the VecView to save additional information about the dimensions (not in the binary file) but in the file with the same name but ending in .info. Once the vec saves are done you just look at the .info file and it tells you what matlab commands to run to load the vector into matlab and how to reshape it for 3d. Good luck, Barry > On May 1, 2019, at 4:42 PM, zakaryah via petsc-users > <[email protected]> wrote: > > I'm using PETSc to solve some equations, outputting the results using > PetscViewerBinaryOpen and VecView, then loading the vector files into Matlab > using PetscBinaryRead.m. The vectors are global vectors created from a 3D > DMDA. Is there a way to extract the layout from the binary file, so that I > can visualize the vectors on a 3D grid?
Re: [petsc-users] Vector layout in PetscBinaryRead.m
Smith, Barry F. via petsc-users Thu, 02 May 2019 00:09:14 -0700
- Re: [petsc-users] Vector layout in PetscBi... Smith, Barry F. via petsc-users
- Re: [petsc-users] Vector layout in Pe... Smith, Barry F. via petsc-users
