There is an error unfortunately:
First, I tested an simpler case by filling the diagonal with mass matrices:
Mat M=
[[UU, 0, UP’, 0, UA’, 0],
[UU, UU, 0, UP’, 0, UA’],
[UP, 0, PP, 0, 0, 0],
[0, UP, 0, PP, 0, 0],
[UA, 0, 0, 0, AA, 0],
[0, UA, 0, 0, 0, AA]];
and set the params like:
set(M, sparams = "-ksp_monitor -ksp_type fgmres -ksp_converged_reason -ksp_initial_guess_nonzero true -ksp_rtol 1.e-5 -ksp_max_it 100 "
+ "-pc_type fieldsplit -pc_fieldsplit_type multiplicative "
+ "-fieldsplit_u_pc_type gamg "
+ "-fieldsplit_v_pc_type gamg "
+ "-fieldsplit_p_pc_type gamg "
+ "-fieldsplit_q_pc_type gamg "
+ "-fieldsplit_a_pc_type gamg "
+ “-fieldsplit_b_pc_type gamg”,
fields = usPETSc, names = names);
There is no error although the solver didn’t converge.
However, when I add
, schurPreconditioner = S, schurList = list)
the above error appears. So, it seems that my S and list are not correct?
I am not sure the format of schurPreconditioner and schurList. The only reference I can find is the following paper. But the block matrix in this paper is much simpler, it has three blocks, and S[0] is the Schur preconditioner. Regarding parameter schurList, say my Schur is a 1000x1000 matrix, should I create a schurList from 1 to 1000?
By the way, chatGTP suggested the following, but the same error occurs.
real[int] schurList(tndof);
// u, v → not Schur
schurList(0 : u2dof-1) = 0;
// p, q → Schur block 1
schurList(u2dof : u2dof+p2dof-1) = 1;
// a, b → Schur block 2
schurList(u2dof+p2dof : tndof-1) = 2;

