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!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 [https://urldefense.us/v3/__http://www.dtu.dk/-/media/DTU_Generelt/Andet/mail-signature-logo.png__;!!G_uCfscf7eWS!fmgo_gSUThwXeUVpPBhwFVgTXRhk3tS8gDcRbkXu6TQu9lj3Emm5wwGKPUktzKcWMN-isoQKklivOskRIMM$ ] Peder Jørgensgaard Olesen Postdoc DTU Construct Institut for Byggeri og Mekanisk Teknologi pj...@dtu.dk<mailto:pj...@dtu.dk> Koppels Allé Building 403 2800 Kgs. Lyngby https://urldefense.us/v3/__http://www.dtu.dk/english__;!!G_uCfscf7eWS!fmgo_gSUThwXeUVpPBhwFVgTXRhk3tS8gDcRbkXu6TQu9lj3Emm5wwGKPUktzKcWMN-isoQKklivVLvHjUo$ <https://urldefense.us/v3/__https://www.dtu.dk/english__;!!G_uCfscf7eWS!fmgo_gSUThwXeUVpPBhwFVgTXRhk3tS8gDcRbkXu6TQu9lj3Emm5wwGKPUktzKcWMN-isoQKklivEFUBK2I$ >