Commit 9cd0a12c authored by Thomas Witkowski's avatar Thomas Witkowski

Some work on navier stokes solver.

parent 234ea16e
......@@ -48,9 +48,53 @@ namespace AMDiS {
pressureComponent.push_back(2);
PCSetType(pc, PCFIELDSPLIT);
PCFieldSplitSetType(pc, PC_COMPOSITE_SCHUR);
PCFieldSplitSetSchurFactType(pc, PC_FIELDSPLIT_SCHUR_FACT_FULL);
createFieldSplit(pc, "velocity", velocityComponents);
createFieldSplit(pc, "pressure", pressureComponent);
KSPSetUp(kspInterior);
KSP *subKsp;
int nSubKsp;
PCFieldSplitGetSubKSP(pc, &nSubKsp, &subKsp);
TEST_EXIT(nSubKsp == 2)("Wrong numer of KSPs inside of the fieldsplit preconditioner!\n");
KSP velocityKsp = subKsp[0];
KSP schurKsp = subKsp[1];
PetscFree(subKsp);
Mat A00, A01, A10, A11;
PCFieldSplitGetSchurBlocks(pc, &A00, &A01, &A10, &A11);
MatInfo minfo;
PetscInt nRow, nCol;
MatGetSize(A00, &nRow, &nCol);
MatGetInfo(A00, MAT_GLOBAL_SUM, &minfo);
MSG("A00: %d x %d with %d nnz\n", nRow, nCol, static_cast<int>(minfo.nz_used));
MatGetSize(A01, &nRow, &nCol);
MatGetInfo(A01, MAT_GLOBAL_SUM, &minfo);
MSG("A01: %d x %d with %d nnz\n", nRow, nCol, static_cast<int>(minfo.nz_used));
MatGetSize(A10, &nRow, &nCol);
MatGetInfo(A10, MAT_GLOBAL_SUM, &minfo);
MSG("A10: %d x %d with %d nnz\n", nRow, nCol, static_cast<int>(minfo.nz_used));
MatGetSize(A11, &nRow, &nCol);
MatGetInfo(A11, MAT_GLOBAL_SUM, &minfo);
MSG("A11: %d x %d with %d nnz\n", nRow, nCol, static_cast<int>(minfo.nz_used));
KSPSetType(velocityKsp, KSPPREONLY);
PC pcSub;
KSPGetPC(velocityKsp, &pcSub);
PCSetType(pcSub, PCLU);
PCFactorSetMatSolverPackage(pcSub, MATSOLVERMUMPS);
KSPView(velocityKsp, PETSC_VIEWER_STDOUT_WORLD);
KSPView(schurKsp, PETSC_VIEWER_STDOUT_WORLD);
}
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment