[petsc-users] How to interface with PETSc from another application?

Klaus Burkart k_burkart at yahoo.com
Wed Oct 4 09:23:23 CDT 2017


What's the concept to interface with PETSc from another application to solve a linear system with PETSc?

The standard procedure of the job:

1: The application provides a matrix which needs to be converted and be loaded into PETSc

2: The application provides the rhs vector (containing pointers!) which needs to be loaded into PETSc 

3: The linear system is to be solved using PETSc

4: The application provides the result vector x, the PETSc result needs to be copied back to the application into vector x (also expecting pointers)


The problem - maybe a completely wrong approach when it comes to using PETSc: 

With other linear algebra libraries, I included the library functionality in the code of a new solver accessing the functionality usually via header files and created a plugin which can be called from the application when running a simulation. 

Even so the mixed code including PETSc code can be compiled, the bit of the plugin, interfacing with the application is broken as soon as I include more than a PETSc declaration in the mixed code.

How to interface with PETSc from a software application?  (I am using c++ and Ubuntu)

Klaus
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.mcs.anl.gov/pipermail/petsc-users/attachments/20171004/46939907/attachment.html>


More information about the petsc-users mailing list