Hi Peder, You can run with '-help -vec_view' (or whatever your view option is) and that prints all options that are queried for. This is very noisy so grep on 'vec_view' and you will see the option information: what it was, what it is after the query, and what options it accepts.
I don't know of one that does what you want. You could write it to a file and use sed or awk, etc. Mark On Thu, Apr 10, 2025 at 4:25 AM Peder Jørgensgaard Olesen via petsc-users < petsc-users@mcs.anl.gov> wrote: > I would like to output the contents of a Vec to an ASCII file in which the > entries are all on one line, as "x[0] x[1] x[2] ... x[N-1]". This can > be done in a slightly roundabout way by putting the values in a 1xN dense > Mat, assembling the matrix, and then use MatView with a suitable format, > but one would think that skipping the matrix step and use a VecView > directly would be more efficient (the procedure is to be repeated many > times). However, none of the viewer formats seems to support the desired > output formatting for Vec. > > Is there any way to customize viewer formats for a specific layout - or is > there perhaps a more clever way to do the thing I want? > > Also, somewhat relatedly, is there a more detailed specification of > available viewer formats? The documentation for PetscViewerFormat ( > https://urldefense.us/v3/__https://petsc.org/release/manualpages/Viewer/PetscViewerFormat/*petscviewerformat__;Iw!!G_uCfscf7eWS!bBFDjNvT7RMZgpeDh0FUlbrbeUxPtb93k6PYYqfx5ls9UeUdQ8aiIMM2e7qCFxUOUxQW2MqPjMj9BccmOMloaJI$ > > <https://urldefense.us/v3/__https://petsc.org/release/manualpages/Viewer/PetscViewerFormat/*petscviewerformat__;Iw!!G_uCfscf7eWS!fmgo_gSUThwXeUVpPBhwFVgTXRhk3tS8gDcRbkXu6TQu9lj3Emm5wwGKPUktzKcWMN-isoQKklivtNv-eU4$>) > briefly describes a number of them, and notes that "A variety of > specialized formats also exist", although this isn't elaborated. > > Thanks! > > Best, > Peder > > *Peder Jørgensgaard Olesen* > Postdoc > DTU Construct > Institut for Byggeri og Mekanisk Teknologi > > pj...@dtu.dk > Koppels Allé > Building 403 > 2800 Kgs. Lyngby > https://urldefense.us/v3/__http://www.dtu.dk/english__;!!G_uCfscf7eWS!bBFDjNvT7RMZgpeDh0FUlbrbeUxPtb93k6PYYqfx5ls9UeUdQ8aiIMM2e7qCFxUOUxQW2MqPjMj9BccmR8pz5l4$ > > <https://urldefense.us/v3/__https://www.dtu.dk/english__;!!G_uCfscf7eWS!fmgo_gSUThwXeUVpPBhwFVgTXRhk3tS8gDcRbkXu6TQu9lj3Emm5wwGKPUktzKcWMN-isoQKklivEFUBK2I$> > >