Use ilu with type=ilutp instead of nofill

Contrary to luinc command ilu with nofill option doesn't not allow for partial
pivoting
time-shift
ferhat 2013-04-05 14:52:49 +02:00 committed by Sébastien Villemot
parent 1d14ff8060
commit 4e7050baf9
1 changed files with 5 additions and 3 deletions

View File

@ -4589,15 +4589,17 @@ dynSparseMatrix::Solve_Matlab_GMRES(mxArray *A_m, mxArray *b_m, int Size, double
throw FatalExceptionHandling(tmp.str());
#endif
size_t n = mxGetM(A_m);
const char *field_names[] = {"droptol"};
const char *field_names[] = {"droptol", "type"};
mwSize dims[1] = { 1 };
mxArray *Setup = mxCreateStructArray(1, dims, 1, field_names);
mxArray *Setup = mxCreateStructArray(1, dims, 2, field_names);
mxSetFieldByNumber(Setup, 0, 0, mxCreateDoubleScalar(lu_inc_tol));
mxSetFieldByNumber(Setup, 0, 1, mxCreateString("ilutp"));
mxArray *lhs0[2];
mxArray *rhs0[2];
rhs0[0] = A_m;
rhs0[1] = Setup;
mexCallMATLAB(2, lhs0, 2, rhs0, "ilu");
if (mexCallMATLAB(2, lhs0, 2, rhs0, "ilu"))
throw FatalExceptionHandling("In GMRES, the incomplet LU decomposition (ilu) ahs failed.");
mxArray *L1 = lhs0[0];
mxArray *U1 = lhs0[1];
/*[za,flag1] = gmres(g1a,b,Blck_size,1e-6,Blck_size*periods,L1,U1);*/