[petsc-dev] setting viewer format from options

Smith, Barry F. bsmith at mcs.anl.gov
Wed Jan 16 17:47:17 CST 2019



> On Jan 16, 2019, at 6:47 AM, Hapla Vaclav via petsc-dev <petsc-dev at mcs.anl.gov> wrote:
> 
> I need to distinguish a PetscViewerFormat in DMLoad() and MatLoad().

   Presumably this information would be stored in the *.info file associated with the datafile you are opening for reading. It makes no sense for it to come from the command line since it is a property of the file being read. 

   Why not have an option in MatLoad(), -matload_viewer_format that gets the format, use a PetscViewerPushFormat(), do the (*matload)() and then pop the format?

   Barry

  Note that other properties of the data file are handled this way: MAT_SYMMETRIC, MAT_SPD


> And it would be handy to be able to set it from options. So I wanted to add -viewer_format option into PetscViewerSetFromOptions().
> 
> But the problem is PetscViewerSetFormat() is deprecated and PetscViewerPushFormat() needs to be paired with PetscViewerPopFormat() which I don't know where to place correctly.
> 
> Can you see some clean way to proceed?
> 
> Thanks
> 
> Vaclav



More information about the petsc-dev mailing list