Skip to content
Snippets Groups Projects
Commit 1d8d7f9c authored by Christophe Geuzaine's avatar Christophe Geuzaine
Browse files

new KSPSystemSize current value

parent 8163ba77
No related branches found
No related tags found
No related merge requests found
Pipeline #4657 passed with warnings
...@@ -220,6 +220,7 @@ void Init_ProblemStructure() ...@@ -220,6 +220,7 @@ void Init_ProblemStructure()
Current.KSPIterations = 0.0; Current.KSPIterations = 0.0;
Current.KSPIteration = 0.0; Current.KSPIteration = 0.0;
Current.KSPResidual = 0.0; Current.KSPResidual = 0.0;
Current.KSPSystemSize = 0.0;
} }
// FIXME: TODO to remove parser memory leaks! // FIXME: TODO to remove parser memory leaks!
......
...@@ -1647,7 +1647,7 @@ struct CurrentData { ...@@ -1647,7 +1647,7 @@ struct CurrentData {
double RelaxFac, NbrTestedFac, SolveJacAdaptFailed; //+++ double RelaxFac, NbrTestedFac, SolveJacAdaptFailed; //+++
// Iterative linear system solvers // Iterative linear system solvers
double KSPIterations, KSPIteration, KSPResidual; double KSPIterations, KSPIteration, KSPResidual, KSPSystemSize;
}; };
/* ------------------------------------------------------------------------ */ /* ------------------------------------------------------------------------ */
......
...@@ -332,6 +332,7 @@ struct StringXPointer Current_Value[] = { ...@@ -332,6 +332,7 @@ struct StringXPointer Current_Value[] = {
{"KSPIterations", &Current.KSPIterations}, {"KSPIts", &Current.KSPIterations}, {"KSPIterations", &Current.KSPIterations}, {"KSPIts", &Current.KSPIterations},
{"KSPIteration", &Current.KSPIteration}, {"KSPIteration", &Current.KSPIteration},
{"KSPResidual", &Current.KSPResidual}, {"KSPResidual", &Current.KSPResidual},
{"KSPSystemSize", &Current.KSPSystemSize},
{NULL , NULL} {NULL , NULL}
} ; } ;
......
...@@ -1182,6 +1182,8 @@ static void _zitsol(gMatrix *A, gVector *B, gVector *X) ...@@ -1182,6 +1182,8 @@ static void _zitsol(gMatrix *A, gVector *B, gVector *X)
PetscInt n; PetscInt n;
_try(VecGetLocalSize(B->V, &n)); _try(VecGetLocalSize(B->V, &n));
Current.KSPSystemSize = n;
int *row = (int*)Malloc(nnz * sizeof(int)); int *row = (int*)Malloc(nnz * sizeof(int));
int *col = (int*)Malloc(nnz * sizeof(int)); int *col = (int*)Malloc(nnz * sizeof(int));
double *valr = (double*)Malloc(nnz * sizeof(double)); double *valr = (double*)Malloc(nnz * sizeof(double));
...@@ -1291,6 +1293,7 @@ static void _solve(gMatrix *A, gVector *B, gSolver *Solver, gVector *X, ...@@ -1291,6 +1293,7 @@ static void _solve(gMatrix *A, gVector *B, gSolver *Solver, gVector *X,
PetscInt i, j; PetscInt i, j;
_try(MatGetSize(A->M, &i, &j)); _try(MatGetSize(A->M, &i, &j));
Current.KSPSystemSize = i;
if(!i){ if(!i){
Message::Warning("Zero-size system: skipping solve!"); Message::Warning("Zero-size system: skipping solve!");
return; return;
......
...@@ -1569,6 +1569,8 @@ Current iteration in a Krylov subspace solver. ...@@ -1569,6 +1569,8 @@ Current iteration in a Krylov subspace solver.
Current residual in a Krylov subspace solver. Current residual in a Krylov subspace solver.
@item $KSPIterations @item $KSPIterations
Total number of iterations of Krylov subspace solver. Total number of iterations of Krylov subspace solver.
@item $KSPSystemSize
System size of Krylov subspace solver.
@end table @end table
@noindent Note: @noindent Note:
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment