Re: [petsc-users] How to use PETSc real version and complex version simultaneously?

2023-04-06 Thread gaochenyi14
Thanks for the hint.I did a naive test and managed to use the same function with different typedefs. Basically, it is relied on that C has no name mangling while C++ has name mangling. Could this trick applies to PETSc? The files for the test are attached. The procedure for compilation is in the

Re: [petsc-users] How to use PETSc real version and complex version simultaneously?

2023-04-05 Thread Matthew Knepley
On Wed, Apr 5, 2023 at 1:59 PM gaochenyi14 wrote: > Hi, > > I rely on PETSc to deal with real and complex sparse matrices of dimension > 1e4 * 1e4 or above. I want to use real version when only real matrices are > involved, to achieve better performance, and use complex version only when >

[petsc-users] How to use PETSc real version and complex version simultaneously?

2023-04-05 Thread gaochenyi14
Hi, I rely on PETSc to deal with real and complex sparse matrices of dimension 1e4 * 1e4 or above. I want to use real version when only real matrices are involved, to achieve better performance, and use complex version only when complex matrices get involved. But in the manual it says