[petsc-dev] setting viewer format from options

Matthew Knepley knepley at gmail.com
Wed Jan 16 07:21:42 CST 2019


On Wed, Jan 16, 2019 at 7:48 AM Hapla Vaclav via petsc-dev <
petsc-dev at mcs.anl.gov> wrote:

> I need to distinguish a PetscViewerFormat in DMLoad() and MatLoad(). 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?
>

I think you just Push and do not Pop. Do we check for a non-empty stack? We
silently ignore too many Pops.

  Thanks,

     Matt


> Thanks
>
> Vaclav



-- 
What most experimenters take for granted before they begin their
experiments is infinitely more interesting than any results to which their
experiments lead.
-- Norbert Wiener

https://www.cse.buffalo.edu/~knepley/ <http://www.cse.buffalo.edu/~knepley/>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.mcs.anl.gov/pipermail/petsc-dev/attachments/20190116/934961ee/attachment.html>


More information about the petsc-dev mailing list