[petsc-users] Set the options NOT from argc and argv

Longxiang Chen suifengls at gmail.com
Mon May 20 22:38:29 CDT 2013


To whom it may concern,

I am using KSP to solve Ax=b.
The main() is in Fortran, and it calls a function I write in C.The
parameter is array A, x, b.

void P_solve(double x[ ], double b[ ], double A[ ], int size);

In the function, I should call PetscInitialize() before I create the matrix
and vectors for A, x, b, and also call MatSetFromOptions() and
VecSetFromOptions().

But I don't have the argc and argv from main function.

I just want to fix the KSP type to bcgs and the PC type.
Is there another way that I can set the options not through argc and argv,
just set them in the program.

e.g. options[] = {"-ksp_type", "bcgs"}.

Thanks,
Longxiang
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.mcs.anl.gov/pipermail/petsc-users/attachments/20130520/d471d04c/attachment.html>


More information about the petsc-users mailing list