Request for Guidance on Implementing Custom PetscViewer Functionality
Dear PETSc Developers,
I hope this message finds you well. I am writing to seek guidance on implementing a custom type of PetscViewer
functionality for our project. We have a requirement to export or convert Vec
, Mat
, and PetscScalar
objects to our custom types using the options database. Specifically, we aim to utilize functionality similar to SLEPc's -eps_view_vectors
to transfer the contents of Vec
objects to an instance of our vector class. Subsequently, we intend to perform additional processing and export the vectors to our custom file format.
While we have managed to implement our own PetscViewer
type and register it using PetscViewerRegister
, we have encountered challenges with VecView
and MatView
functions not utilizing our custom PetscViewer
. Our observation is that VecView
and MatView
do not support PetscViewer
types other than those native to PETSc.
To elaborate further, our envisioned usage of the PetscViewer
would resemble the following:
-eps_view_vectors binary:destination:our_custom_type
We are reaching out to seek your expert advice on the most appropriate approach to tackle this issue. Would it be feasible to implement a PetscViewerFormat
akin to PETSC_VIEWER_SHELL
, or perhaps introduce an interface that could seamlessly integrate with the options database, allowing users to define their own exportation formats? Do you intend to extend or support user-registered PetscViewer
types?
We appreciate your time and expertise in assisting us with this matter. Your guidance will be invaluable in ensuring the successful implementation of our project requirements. Thank you for your attention to this request, and we look forward to your insights.
Warm regards,
René Chenard Research professional GIREF - Université Laval