Skip to content
Snippets Groups Projects
Commit 3f5fab8e authored by Thomas Witkowski's avatar Thomas Witkowski
Browse files

Added possibility to analyze matrices from FETI-DP.

parent 64e91ba5
No related branches found
No related tags found
No related merge requests found
......@@ -1099,6 +1099,40 @@ namespace AMDiS {
}
void PetscSolverFeti::dbgMatrix()
{
FUNCNAME("PetscSolverFeti::dbgMatrix()");
#if (DEBUG != 0)
int writeInteriorMatrix = -1;
Parameters::get("parallel->debug->write interior matrix",
writeInteriorMatrix);
if (writeInteriorMatrix >= 0 &&
writeInteriorMatrix == MPI::COMM_WORLD.Get_rank()) {
PetscViewer petscView;
PetscViewerBinaryOpen(PETSC_COMM_SELF, "interior.mat",
FILE_MODE_WRITE, &petscView);
MatView(subdomain->getMatIntInt(), petscView);
PetscViewerDestroy(&petscView);
}
int writeCoarseMatrix = 0;
Parameters::get("parallel->debug->write coarse matrix",
writeCoarseMatrix);
if (writeCoarseMatrix > 0) {
PetscViewer petscView;
PetscViewerBinaryOpen(PETSC_COMM_WORLD, "coarse.mat",
FILE_MODE_WRITE, &petscView);
MatView(subdomain->getMatCoarseCoarse(), petscView);
PetscViewerDestroy(&petscView);
}
#endif
}
void PetscSolverFeti::recoverSolution(Vec &vec_sol_b,
Vec &vec_sol_primal,
SystemVector &vec)
......@@ -1412,6 +1446,11 @@ namespace AMDiS {
// === Create PETSc solver for the FETI-DP operator. ===
createFetiKsp(feSpaces);
// === If required, run debug tests. ===
dbgMatrix();
}
......
......@@ -135,6 +135,10 @@ namespace AMDiS {
/// Destroys FETI-DP operator, \ref ksp_feti
void destroyFetiKsp();
/// In debug modes, this function runs some debug tests on the FETI
/// matrices. In optimized mode, nothing is done here.
void dbgMatrix();
/** \brief
* Recovers AMDiS solution vector from PETSc's solution vectors of the
* FETI-DP system. First, the B variables can locally be copied to the
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment