2
$\begingroup$

I have a PetscBag in my program that I want to write to a filename I have stored as a string. If I want to write to stdout, there is a pre-made PetscViewer macro for that. How do I create a viewer for a PetscBag that writes to a specified file?

$\endgroup$
2
$\begingroup$

Viewers are discussed in the PETSc user guide. Create one using PetscViewerASCIIOpen or PetscViewerBinaryOpen, then call PetscBagView on your viewer.

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.