Actual source code: ex87.c

  1: static char help[] = "Solves a saddle-point linear system using PCHPDDM.\n\n";

  3: #include <petscksp.h>
  4: #include <petsc/private/petscimpl.h>

  6: static PetscErrorCode MatAndISLoad(const char *prefix, const char *identifier, Mat A, IS is, Mat N, PetscMPIInt size);
  7: static PetscErrorCode ResetA11(KSP ksp);

  9: int main(int argc, char **args)
 10: {
 11:   Vec               b, x;               /* computed solution and RHS */
 12:   Mat               A[4], aux[2], nest; /* linear system matrix */
 13:   KSP               ksp, *subksp;       /* linear solver context */
 14:   PC                pc;
 15:   IS                is[2];
 16:   PetscMPIInt       size;
 17:   PetscInt          m, M, n, N, id = 0;
 18:   PetscViewer       viewer;
 19:   const char *const system[] = {"elasticity", "stokes", "diffusion", "lagrange"};
 20:   /* "elasticity":
 21:    *    2D linear elasticity with rubber-like and steel-like material coefficients, i.e., Poisson's ratio \in {0.4999, 0.35} and Young's modulus \in {0.01 GPa, 200.0 GPa}
 22:    *      discretized by order 2 (resp. 0) Lagrange finite elements in displacements (resp. pressure) on a triangle mesh
 23:    * "stokes":
 24:    *    2D lid-driven cavity with constant viscosity
 25:    *      discretized by order 2 (resp. 1) Lagrange finite elements, i.e., lowest-order Taylor--Hood finite elements, in velocities (resp. pressure) on a triangle mesh
 26:    *      if the option -empty_A11 is not set (or set to false), a pressure with a zero mean-value is computed
 27:    * "diffusion":
 28:    *    2D primal-dual nonsymmetric diffusion equation
 29:    *      discretized by order 2 (resp. 1) Lagrange finite elements in primal (resp. dual) unknowns on a triangle mesh
 30:    * "lagrange":
 31:    *    2D linear elasticity with essential boundary conditions imposed through a Lagrange multiplier
 32:    */
 33:   char      dir[PETSC_MAX_PATH_LEN], prefix[PETSC_MAX_PATH_LEN];
 34:   PCType    type;
 35:   PetscBool flg[4] = {PETSC_FALSE, PETSC_FALSE, PETSC_FALSE, PETSC_FALSE};

 37:   PetscFunctionBeginUser;
 38:   PetscCall(PetscInitialize(&argc, &args, NULL, help));
 39:   PetscCallMPI(MPI_Comm_size(PETSC_COMM_WORLD, &size));
 40:   PetscCall(PetscOptionsGetEList(NULL, NULL, "-system", system, PETSC_STATIC_ARRAY_LENGTH(system), &id, NULL));
 41:   if (id == 1) PetscCall(PetscOptionsGetBool(NULL, NULL, "-empty_A11", flg, NULL));
 42:   if (id != 3) PetscCheck(size == 4, PETSC_COMM_WORLD, PETSC_ERR_WRONG_MPI_SIZE, "This example requires 4 processes");
 43:   else PetscCheck(id == 3 && size == 2, PETSC_COMM_WORLD, PETSC_ERR_WRONG_MPI_SIZE, "This example requires 2 processes");
 44:   for (PetscInt i = 0; i < 2; ++i) {
 45:     PetscCall(MatCreate(PETSC_COMM_WORLD, A + (i ? 3 : 0)));
 46:     if (id < 2 || (id == 3 && i == 0)) {
 47:       PetscCall(ISCreate(PETSC_COMM_SELF, is + i));
 48:       PetscCall(MatCreate(PETSC_COMM_SELF, aux + i));
 49:     } else {
 50:       is[i]  = NULL;
 51:       aux[i] = NULL;
 52:     }
 53:   }
 54:   PetscCall(PetscStrncpy(dir, ".", sizeof(dir)));
 55:   PetscCall(PetscOptionsGetString(NULL, NULL, "-load_dir", dir, sizeof(dir), NULL));
 56:   /* loading matrices and auxiliary data for the diagonal blocks */
 57:   PetscCall(PetscSNPrintf(prefix, sizeof(prefix), "%s/%s", dir, id == 3 ? "D" : (id == 2 ? "E" : (id == 1 ? "B" : "A"))));
 58:   PetscCall(MatAndISLoad(prefix, "00", A[0], is[0], aux[0], size));
 59:   PetscCall(MatAndISLoad(prefix, "11", A[3], is[1], aux[1], size));
 60:   /* loading the off-diagonal block with a coherent row/column layout */
 61:   PetscCall(MatCreate(PETSC_COMM_WORLD, A + 2));
 62:   PetscCall(MatGetLocalSize(A[0], &n, NULL));
 63:   PetscCall(MatGetSize(A[0], &N, NULL));
 64:   PetscCall(MatGetLocalSize(A[3], &m, NULL));
 65:   PetscCall(MatGetSize(A[3], &M, NULL));
 66:   PetscCall(MatSetSizes(A[2], m, n, M, N));
 67:   PetscCall(PetscSNPrintf(prefix, sizeof(prefix), "%s/%s10.dat", dir, id == 3 ? "D" : (id == 2 ? "E" : (id == 1 ? "B" : "A"))));
 68:   PetscCall(PetscViewerBinaryOpen(PETSC_COMM_WORLD, prefix, FILE_MODE_READ, &viewer));
 69:   PetscCall(MatLoad(A[2], viewer));
 70:   PetscCall(PetscViewerDestroy(&viewer));
 71:   if (id != 2) {
 72:     /* transposing the off-diagonal block */
 73:     PetscCall(PetscOptionsGetBool(NULL, NULL, "-transpose", flg + 1, NULL));
 74:     PetscCall(PetscOptionsGetBool(NULL, NULL, "-permute", flg + 2, NULL));
 75:     PetscCall(PetscOptionsGetBool(NULL, NULL, "-explicit", flg + 3, NULL));
 76:     if (flg[1]) {
 77:       if (flg[2]) {
 78:         PetscCall(MatTranspose(A[2], MAT_INITIAL_MATRIX, A + 1));
 79:         PetscCall(MatDestroy(A + 2));
 80:       }
 81:       if (!flg[3]) PetscCall(MatCreateTranspose(A[2 - flg[2]], A + 1 + flg[2]));
 82:       else PetscCall(MatTranspose(A[2 - flg[2]], MAT_INITIAL_MATRIX, A + 1 + flg[2]));
 83:     } else {
 84:       if (flg[2]) {
 85:         PetscCall(MatHermitianTranspose(A[2], MAT_INITIAL_MATRIX, A + 1));
 86:         PetscCall(MatDestroy(A + 2));
 87:       }
 88:       if (!flg[3]) PetscCall(MatCreateHermitianTranspose(A[2 - flg[2]], A + 1 + flg[2]));
 89:       else PetscCall(MatHermitianTranspose(A[2 - flg[2]], MAT_INITIAL_MATRIX, A + 1 + flg[2]));
 90:     }
 91:   } else {
 92:     PetscCall(MatCreate(PETSC_COMM_WORLD, A + 1));
 93:     PetscCall(MatSetSizes(A[1], n, m, N, M));
 94:     PetscCall(PetscSNPrintf(prefix, sizeof(prefix), "%s/E01.dat", dir));
 95:     PetscCall(PetscViewerBinaryOpen(PETSC_COMM_WORLD, prefix, FILE_MODE_READ, &viewer));
 96:     PetscCall(MatLoad(A[1], viewer));
 97:     PetscCall(PetscViewerDestroy(&viewer));
 98:     PetscCall(MatConvert(A[0], MATBAIJ, MAT_INPLACE_MATRIX, A));
 99:   }
100:   flg[3] = PETSC_FALSE;
101:   PetscCall(PetscOptionsGetBool(NULL, NULL, "-null_A11", flg + 3, NULL));
102:   PetscCheck(!flg[3] || flg[0] || id == 3, PETSC_COMM_WORLD, PETSC_ERR_ARG_INCOMP, "-null_A11 requires either -system stokes -empty_A11 or -system lagrange");
103:   if (flg[0]) PetscCall(MatDestroy(A + 3));
104:   else {
105:     PetscCall(PetscOptionsGetBool(NULL, NULL, "-diagonal_A11", flg, NULL));
106:     if (flg[0]) {
107:       PetscCall(MatDestroy(A + 3));
108:       PetscCall(MatCreateConstantDiagonal(PETSC_COMM_WORLD, m, m, M, M, PETSC_SMALL, A + 3));
109:     }
110:   }
111:   flg[1] = PETSC_FALSE;
112:   PetscCall(PetscOptionsGetBool(NULL, NULL, "-all_transpose", flg + 1, NULL));
113:   if (flg[1] && flg[2]) {
114:     Mat S;

116:     PetscCall(MatTranspose(A[1], MAT_INITIAL_MATRIX, &S));
117:     PetscCall(MatDestroy(A + 1));
118:     PetscCall(MatCreateHermitianTranspose(S, A + 1));
119:     PetscCall(MatDestroy(&S));
120:   }
121:   /* global coefficient matrix */
122:   PetscCall(MatCreateNest(PETSC_COMM_WORLD, 2, NULL, 2, NULL, A, &nest));
123:   PetscCall(KSPCreate(PETSC_COMM_WORLD, &ksp));
124:   PetscCall(KSPSetOperators(ksp, nest, nest));
125:   PetscCall(KSPGetPC(ksp, &pc));
126:   /* outer preconditioner */
127:   PetscCall(PCSetType(pc, PCFIELDSPLIT));
128:   PetscCall(PCFieldSplitSetType(pc, PC_COMPOSITE_SCHUR));
129:   PetscCall(PCFieldSplitSetSchurPre(pc, PC_FIELDSPLIT_SCHUR_PRE_SELF, NULL));
130:   PetscCall(PCSetFromOptions(pc));
131:   PetscCall(PCGetType(pc, &type));
132:   PetscCall(PetscStrcmp(type, PCFIELDSPLIT, flg + 1));
133:   if (flg[1]) {
134:     PetscCall(PCSetUp(pc));
135:     PetscCall(PCFieldSplitGetSubKSP(pc, &n, &subksp));
136:     if (flg[3]) PetscCall(ResetA11(subksp[1]));
137:     PetscCall(KSPGetPC(subksp[0], &pc));
138:     /* inner preconditioner associated to top-left block */
139: #if PetscDefined(HAVE_HPDDM) && PetscDefined(HAVE_DYNAMIC_LIBRARIES) && PetscDefined(USE_SHARED_LIBRARIES)
140:     PetscCall(PCSetType(pc, PCHPDDM));
141:     PetscCall(PCHPDDMSetAuxiliaryMat(pc, is[0], aux[0], NULL, NULL));
142: #endif
143:     PetscCall(PCSetFromOptions(pc));
144:     PetscCall(KSPGetPC(subksp[1], &pc));
145:     /* inner preconditioner associated to Schur complement, which will be set internally to PCKSP (or PCASM if the Schur complement is centralized on a single process) */
146: #if PetscDefined(HAVE_HPDDM) && PetscDefined(HAVE_DYNAMIC_LIBRARIES) && PetscDefined(USE_SHARED_LIBRARIES)
147:     PetscCall(PCSetType(pc, PCHPDDM));
148:     if (!flg[0]) PetscCall(PCHPDDMSetAuxiliaryMat(pc, is[1], aux[1], NULL, NULL));
149: #endif
150:     PetscCall(PCSetFromOptions(pc));
151:     PetscCall(PetscFree(subksp));
152:   } else PetscCall(MatSetBlockSize(A[0], 2));
153:   PetscCall(KSPSetFromOptions(ksp));
154:   PetscCall(MatCreateVecs(nest, &b, &x));
155:   if (id != 2) {
156:     PetscCall(PetscSNPrintf(prefix, sizeof(prefix), "%s/rhs_%s.dat", dir, id == 3 ? "D" : (id == 1 ? "B" : "A")));
157:     PetscCall(PetscViewerBinaryOpen(PETSC_COMM_WORLD, prefix, FILE_MODE_READ, &viewer));
158:     PetscCall(VecLoad(b, viewer));
159:     PetscCall(PetscViewerDestroy(&viewer));
160:   } else PetscCall(VecSetRandom(b, NULL));
161:   PetscCall(KSPSolve(ksp, b, x));
162:   flg[1] = PETSC_FALSE;
163:   PetscCall(PetscOptionsGetBool(NULL, NULL, "-viewer", flg + 1, NULL));
164:   if (flg[1]) PetscCall(PCView(pc, PETSC_VIEWER_STDOUT_WORLD));
165:   flg[1] = PETSC_FALSE;
166:   PetscCall(PetscOptionsGetBool(NULL, NULL, "-successive_solves", flg + 1, NULL));
167:   if (flg[1]) {
168:     KSPConvergedReason reason[2];
169:     PetscInt           iterations[2];
170:     PetscCall(KSPGetConvergedReason(ksp, reason));
171:     PetscCall(KSPGetTotalIterations(ksp, iterations));
172:     PetscCall(KSPMonitorCancel(ksp));
173:     PetscCall(PetscOptionsClearValue(NULL, "-ksp_monitor"));
174:     PetscCall(PetscObjectStateIncrease((PetscObject)nest));
175:     PetscCall(KSPGetPC(ksp, &pc));
176:     PetscCall(PCSetUp(pc)); /* update PCFIELDSPLIT submatrices */
177:     PetscCall(PCFieldSplitGetSubKSP(pc, &n, &subksp));
178:     if (flg[3]) PetscCall(ResetA11(subksp[1]));
179:     PetscCall(KSPGetPC(subksp[0], &pc));
180: #if PetscDefined(HAVE_HPDDM) && PetscDefined(HAVE_DYNAMIC_LIBRARIES) && PetscDefined(USE_SHARED_LIBRARIES)
181:     PetscCall(PCHPDDMSetAuxiliaryMat(pc, is[0], aux[0], NULL, NULL));
182: #endif
183:     PetscCall(PCSetFromOptions(pc));
184:     PetscCall(KSPGetPC(subksp[1], &pc));
185: #if PetscDefined(HAVE_HPDDM) && PetscDefined(HAVE_DYNAMIC_LIBRARIES) && PetscDefined(USE_SHARED_LIBRARIES)
186:     PetscCall(PCSetType(pc, PCHPDDM)); /* may have been set to PCKSP internally (or PCASM if the Schur complement is centralized on a single process), so need to enforce the proper PCType */
187:     if (!flg[0]) PetscCall(PCHPDDMSetAuxiliaryMat(pc, is[1], aux[1], NULL, NULL));
188: #endif
189:     PetscCall(PCSetFromOptions(pc));
190:     PetscCall(PetscFree(subksp));
191:     PetscCall(KSPSolve(ksp, b, x));
192:     PetscCall(KSPGetConvergedReason(ksp, reason + 1));
193:     PetscCall(KSPGetTotalIterations(ksp, iterations + 1));
194:     iterations[1] -= iterations[0];
195:     PetscCheck(reason[0] == reason[1] && PetscAbs(iterations[0] - iterations[1]) <= 3, PetscObjectComm((PetscObject)ksp), PETSC_ERR_PLIB, "Successive calls to KSPSolve() did not converge for the same reason (%s v. %s) or with the same number of iterations (+/- 3, %" PetscInt_FMT " v. %" PetscInt_FMT ")", KSPConvergedReasons[reason[0]], KSPConvergedReasons[reason[1]], iterations[0], iterations[1]);
196:   }
197:   PetscCall(VecDestroy(&x));
198:   PetscCall(VecDestroy(&b));
199:   PetscCall(KSPDestroy(&ksp));
200:   PetscCall(MatDestroy(&nest));
201:   PetscCall(MatDestroy(A + 1));
202:   PetscCall(MatDestroy(A + 2));
203:   for (PetscInt i = 0; i < 2; ++i) {
204:     PetscCall(MatDestroy(A + (i ? 3 : 0)));
205:     PetscCall(MatDestroy(aux + i));
206:     PetscCall(ISDestroy(is + i));
207:   }
208:   PetscCall(PetscFinalize());
209:   return 0;
210: }

212: PetscErrorCode MatAndISLoad(const char *prefix, const char *identifier, Mat A, IS is, Mat aux, PetscMPIInt size)
213: {
214:   Mat             tmp[3];
215:   IS              sizes;
216:   const PetscInt *idx;
217:   PetscInt        m;
218:   PetscLayout     map;
219:   PetscViewer     viewer;
220:   char            name[PETSC_MAX_PATH_LEN];

222:   PetscFunctionBeginUser;
223:   PetscCall(PetscSNPrintf(name, sizeof(name), "%s%s_sizes_%d.dat", prefix, identifier, size));
224:   PetscCall(PetscViewerBinaryOpen(PETSC_COMM_WORLD, name, FILE_MODE_READ, &viewer));
225:   PetscCall(ISCreate(PETSC_COMM_WORLD, &sizes));
226:   PetscCall(ISLoad(sizes, viewer));
227:   PetscCall(ISSetBlockSize(sizes, is && aux ? 5 : 4)); /* not mandatory but useful to check for proper sizes */
228:   PetscCall(ISGetIndices(sizes, &idx));
229:   PetscCall(MatSetSizes(A, idx[0], idx[1], idx[2], idx[3]));
230:   if (is && aux) {
231:     PetscCall(MatCreate(PETSC_COMM_WORLD, tmp));
232:     PetscCall(MatSetSizes(tmp[0], idx[4], idx[4], PETSC_DETERMINE, PETSC_DETERMINE));
233:     PetscCall(MatSetUp(tmp[0]));
234:   }
235:   PetscCall(ISRestoreIndices(sizes, &idx));
236:   PetscCall(ISDestroy(&sizes));
237:   PetscCall(PetscViewerDestroy(&viewer));
238:   PetscCall(PetscSNPrintf(name, sizeof(name), "%s%s.dat", prefix, identifier));
239:   PetscCall(PetscViewerBinaryOpen(PETSC_COMM_WORLD, name, FILE_MODE_READ, &viewer));
240:   PetscCall(MatLoad(A, viewer));
241:   PetscCall(PetscViewerDestroy(&viewer));
242:   if (is && aux) {
243:     PetscCall(ISCreate(PETSC_COMM_WORLD, &sizes));
244:     PetscCall(MatGetLayouts(tmp[0], &map, NULL));
245:     PetscCall(ISSetLayout(sizes, map));
246:     PetscCall(PetscSNPrintf(name, sizeof(name), "%s%s_is_%d.dat", prefix, identifier, size));
247:     PetscCall(PetscViewerBinaryOpen(PETSC_COMM_WORLD, name, FILE_MODE_READ, &viewer));
248:     PetscCall(ISLoad(sizes, viewer));
249:     PetscCall(ISGetLocalSize(sizes, &m));
250:     PetscCall(ISGetIndices(sizes, &idx));
251:     PetscCall(ISSetType(is, ISGENERAL));
252:     PetscCall(ISGeneralSetIndices(is, m, idx, PETSC_COPY_VALUES));
253:     PetscCall(ISRestoreIndices(sizes, &idx));
254:     PetscCall(ISDestroy(&sizes));
255:     PetscCall(PetscViewerDestroy(&viewer));
256:     PetscCall(PetscSNPrintf(name, sizeof(name), "%s%s_aux_%d.dat", prefix, identifier, size));
257:     PetscCall(PetscViewerBinaryOpen(PETSC_COMM_WORLD, name, FILE_MODE_READ, &viewer));
258:     PetscCall(MatLoad(tmp[0], viewer));
259:     PetscCall(PetscViewerDestroy(&viewer));
260:     PetscCall(MatGetDiagonalBlock(tmp[0], tmp + 1));
261:     PetscCall(MatDuplicate(tmp[1], MAT_COPY_VALUES, tmp + 2));
262:     PetscCall(MatHeaderReplace(aux, tmp + 2));
263:     PetscCall(MatDestroy(tmp));
264:   }
265:   PetscFunctionReturn(PETSC_SUCCESS);
266: }

268: static PetscErrorCode ResetA11(KSP ksp)
269: {
270:   Mat S, A00, Ap00, A01, A10;

272:   PetscFunctionBeginUser;
273:   PetscCall(KSPGetOperators(ksp, &S, NULL));
274:   PetscCall(MatSchurComplementGetSubMatrices(S, &A00, &Ap00, &A01, &A10, NULL));
275:   PetscCall(MatSchurComplementUpdateSubMatrices(S, A00, Ap00, A01, A10, NULL));
276:   PetscFunctionReturn(PETSC_SUCCESS);
277: }

279: /*TEST

281:    testset:
282:       requires: datafilespath hpddm slepc double !complex !defined(PETSC_USE_64BIT_INDICES) defined(PETSC_HAVE_DYNAMIC_LIBRARIES) defined(PETSC_USE_SHARED_LIBRARIES)
283:       nsize: 4
284:       args: -load_dir ${DATAFILESPATH}/matrices/hpddm/GENEO -ksp_monitor -ksp_rtol 1e-4 -fieldsplit_ksp_max_it 100 -fieldsplit_pc_hpddm_levels_1_eps_nev 10 -fieldsplit_pc_hpddm_levels_1_st_share_sub_ksp -fieldsplit_pc_hpddm_has_neumann -fieldsplit_pc_hpddm_define_subdomains -fieldsplit_1_pc_hpddm_schur_precondition geneo -fieldsplit_pc_hpddm_coarse_pc_type redundant -fieldsplit_pc_hpddm_coarse_redundant_pc_type cholesky -fieldsplit_pc_hpddm_levels_1_sub_pc_type lu -fieldsplit_ksp_type fgmres -ksp_type fgmres -ksp_max_it 10 -fieldsplit_1_pc_hpddm_coarse_correction balanced -fieldsplit_1_pc_hpddm_levels_1_eps_gen_non_hermitian -fieldsplit_1_pc_hpddm_coarse_p 2
285:       test:
286:         requires: mumps
287:         suffix: 1
288:         args: -viewer -system {{elasticity stokes}separate output} -fieldsplit_1_pc_hpddm_ksp_pc_side left -fieldsplit_1_pc_hpddm_levels_1_sub_mat_mumps_icntl_26 1
289:         filter: grep -v -e "action of " -e "                            " -e "block size" -e "total: nonzeros=" -e "using I-node" -e "aij" -e "transpose" -e "diagonal" -e "total number of" -e "                rows="
290:       test:
291:         requires: mumps
292:         suffix: 2
293:         output_file: output/ex87_1_system-stokes.out
294:         args: -viewer -system stokes -empty_A11 -transpose {{false true}shared output} -permute {{false true}shared output} -fieldsplit_1_pc_hpddm_ksp_pc_side right -fieldsplit_1_pc_hpddm_coarse_mat_type baij -fieldsplit_1_pc_hpddm_levels_1_sub_mat_mumps_icntl_26 1 -explicit {{false true}shared output}
295:         filter: grep -v -e "action of " -e "                            " -e "block size" -e "total: nonzeros=" -e "using I-node" -e "aij" -e "transpose" -e "diagonal" -e "total number of" -e "                rows=" | sed -e "s/      right preconditioning/      left preconditioning/g" -e "s/      using UNPRECONDITIONED/      using PRECONDITIONED/g"
296:       test:
297:         suffix: 1_petsc
298:         args: -system {{elasticity stokes}separate output} -fieldsplit_1_pc_hpddm_ksp_pc_side left -fieldsplit_1_pc_hpddm_levels_1_sub_pc_factor_mat_solver_type petsc -fieldsplit_1_pc_hpddm_levels_1_eps_threshold_absolute 0.3 -permute
299:       test:
300:         suffix: 2_petsc
301:         output_file: output/ex87_1_petsc_system-stokes.out
302:         args: -system stokes -empty_A11 -null_A11 {{false true}shared output} -transpose -fieldsplit_1_pc_hpddm_ksp_pc_side right -fieldsplit_1_pc_hpddm_levels_1_sub_pc_factor_mat_solver_type petsc -fieldsplit_1_pc_hpddm_coarse_mat_type baij -fieldsplit_1_pc_hpddm_levels_1_eps_threshold_absolute 0.3 -fieldsplit_1_pc_hpddm_levels_1_sub_pc_factor_shift_type inblocks -successive_solves
303:         filter: sed -e "s/type: transpose/type: hermitiantranspose/g"
304:       test:
305:         suffix: threshold
306:         requires: !defined(PETSC_HAVE_MKL_SPARSE_SP2M_FEATURE)
307:         output_file: output/ex87_1_petsc_system-elasticity.out
308:         args: -fieldsplit_1_pc_hpddm_ksp_pc_side left -fieldsplit_1_pc_hpddm_levels_1_eps_threshold_absolute 0.2 -fieldsplit_1_pc_hpddm_coarse_mat_type {{baij sbaij}shared output} -successive_solves
309:    testset:
310:       requires: datafilespath hpddm slepc double !complex !defined(PETSC_USE_64BIT_INDICES) defined(PETSC_HAVE_DYNAMIC_LIBRARIES) defined(PETSC_USE_SHARED_LIBRARIES)
311:       nsize: 4
312:       args: -load_dir ${DATAFILESPATH}/matrices/hpddm/GENEO -ksp_monitor -ksp_rtol 1e-4 -fieldsplit_ksp_max_it 100 -fieldsplit_pc_hpddm_levels_1_st_share_sub_ksp -fieldsplit_pc_hpddm_define_subdomains -fieldsplit_1_pc_hpddm_schur_precondition geneo -fieldsplit_pc_hpddm_coarse_pc_type redundant -fieldsplit_pc_hpddm_coarse_redundant_pc_type cholesky -fieldsplit_pc_hpddm_levels_1_sub_pc_type lu -fieldsplit_ksp_type fgmres -ksp_type fgmres -ksp_max_it 10 -fieldsplit_1_pc_hpddm_coarse_correction balanced -fieldsplit_1_pc_hpddm_levels_1_eps_gen_non_hermitian -fieldsplit_1_pc_hpddm_coarse_p 2 -system stokes -fieldsplit_1_pc_hpddm_ksp_pc_side left -fieldsplit_1_pc_hpddm_levels_1_sub_pc_factor_mat_solver_type petsc -fieldsplit_1_pc_hpddm_levels_1_eps_threshold_absolute 0.3
313:       test:
314:         suffix: diagonal
315:         output_file: output/ex87_1_petsc_system-stokes.out
316:         args: -fieldsplit_pc_hpddm_levels_1_eps_nev 10 -fieldsplit_0_pc_hpddm_has_neumann -diagonal_A11 {{false true}shared output}
317:       test:
318:         suffix: harmonic_overlap_2
319:         output_file: output/ex87_1_petsc_system-stokes.out
320:         args: -fieldsplit_0_pc_hpddm_harmonic_overlap 2 -fieldsplit_0_pc_hpddm_levels_1_svd_nsv 20 -diagonal_A11 -permute {{false true}shared output} -all_transpose

322:    test:
323:       requires: datafilespath double !complex !defined(PETSC_USE_64BIT_INDICES) !hpddm !memkind
324:       nsize: 4
325:       suffix: selfp
326:       output_file: output/empty.out
327:       filter: grep -v "CONVERGED_RTOL iterations"
328:       args: -load_dir ${DATAFILESPATH}/matrices/hpddm/GENEO -system stokes -ksp_rtol 1e-4 -ksp_converged_reason -ksp_max_it 30 -pc_type fieldsplit -pc_fieldsplit_type schur -fieldsplit_ksp_type preonly -pc_fieldsplit_schur_precondition selfp -fieldsplit_pc_type bjacobi -fieldsplit_sub_pc_type lu -transpose {{false true}shared output} -fieldsplit_1_mat_schur_complement_ainv_type lump

330:    test:
331:       requires: datafilespath hpddm slepc double !complex !defined(PETSC_USE_64BIT_INDICES) defined(PETSC_HAVE_DYNAMIC_LIBRARIES) defined(PETSC_USE_SHARED_LIBRARIES)
332:       nsize: 4
333:       suffix: nonsymmetric_least_squares
334:       output_file: output/empty.out
335:       filter: grep -v "CONVERGED_RTOL iterations"
336:       args: -load_dir ${DATAFILESPATH}/matrices/hpddm/GENEO -system diffusion -ksp_rtol 1e-4 -ksp_converged_reason -ksp_max_it 20 -pc_type fieldsplit -pc_fieldsplit_type schur -fieldsplit_ksp_type preonly -fieldsplit_0_pc_type pbjacobi -prefix_push fieldsplit_1_ -pc_hpddm_schur_precondition least_squares -pc_hpddm_define_subdomains -prefix_push pc_hpddm_levels_1_ -sub_pc_type lu -sub_pc_factor_shift_type nonzero -eps_nev 5 -eps_gen_non_hermitian -st_share_sub_ksp -prefix_pop -prefix_pop -fieldsplit_1_mat_schur_complement_ainv_type {{diag blockdiag}shared output}

338:    testset:
339:       requires: datafilespath hpddm slepc double !complex !defined(PETSC_USE_64BIT_INDICES) defined(PETSC_HAVE_DYNAMIC_LIBRARIES) defined(PETSC_USE_SHARED_LIBRARIES)
340:       nsize: 2
341:       output_file: output/empty.out
342:       filter: grep -v "CONVERGED_RTOL iterations"
343:       test:
344:         suffix: lagrange
345:         args: -load_dir ${DATAFILESPATH}/matrices/hpddm/GENEO -ksp_rtol 1e-4 -fieldsplit_ksp_max_it 100 -fieldsplit_0_pc_hpddm_has_neumann -fieldsplit_0_pc_hpddm_levels_1_eps_nev 10 -fieldsplit_0_pc_hpddm_levels_1_st_share_sub_ksp -fieldsplit_0_pc_hpddm_define_subdomains -fieldsplit_1_pc_hpddm_schur_precondition geneo -fieldsplit_0_pc_hpddm_coarse_pc_type redundant -fieldsplit_0_pc_hpddm_coarse_redundant_pc_type cholesky -fieldsplit_0_pc_hpddm_levels_1_sub_pc_type lu -fieldsplit_ksp_type fgmres -ksp_type fgmres -ksp_max_it 10 -system lagrange -transpose {{false true}shared output} -successive_solves
346:       test:
347:         suffix: lagrange_null_A11
348:         args: -load_dir ${DATAFILESPATH}/matrices/hpddm/GENEO -ksp_rtol 1e-4 -fieldsplit_ksp_max_it 100 -fieldsplit_0_pc_hpddm_has_neumann -fieldsplit_0_pc_hpddm_levels_1_eps_nev 10 -fieldsplit_0_pc_hpddm_levels_1_st_share_sub_ksp -fieldsplit_0_pc_hpddm_define_subdomains -fieldsplit_1_pc_hpddm_schur_precondition geneo -fieldsplit_0_pc_hpddm_coarse_pc_type redundant -fieldsplit_0_pc_hpddm_coarse_redundant_pc_type cholesky -fieldsplit_0_pc_hpddm_levels_1_sub_pc_type lu -fieldsplit_ksp_type fgmres -ksp_type fgmres -ksp_max_it 10 -system lagrange -null_A11 -successive_solves

350:    test:
351:       requires: datafilespath mumps double !complex !defined(PETSC_USE_64BIT_INDICES)
352:       nsize: 4
353:       suffix: mumps
354:       output_file: output/empty.out
355:       args: -load_dir ${DATAFILESPATH}/matrices/hpddm/GENEO -ksp_type preonly -system elasticity -pc_type cholesky -mat_mumps_icntl_15 1

357: TEST*/