<div dir="ltr"><div><div>To whom it may concern,<br><br></div><div>I am using KSP to solve Ax=b.</div></div><div>The main() is in Fortran, and it calls a function I write in C.The parameter is array A, x, b.<br><br></div><div>
void P_solve(double x[ ], double b[ ], double A[ ], int size);<br></div><div><br></div><div>In the function, I should call PetscInitialize() before I create the matrix and vectors for A, x, b, and also call MatSetFromOptions() and VecSetFromOptions().<br>
<br></div><div>But I don't have the argc and argv from main function.<br><br></div><div>I just want to fix the KSP type to bcgs and the PC type.<br></div><div>Is there another way that I can set the options not through argc and argv, just set them in the program.<br>
<br></div><div>e.g. options[] = {"-ksp_type", "bcgs"}.<br></div><div><div><div dir="ltr"><div><br></div><div>Thanks,<br></div><div>Longxiang<br></div></div>
</div></div></div>