Skip to content

Commit a92d577

Browse files
committed
Merge branch 'jose/nep-view-mat' into 'main'
NEP: add command-line options for viewing the problem data (split form only) See merge request slepc/slepc!671
2 parents 34635dd + 57432d8 commit a92d577

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

src/nep/interface/nepsolve.c

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,8 @@ PetscErrorCode NEPComputeVectors(NEP nep)
5353
5454
Options Database Keys:
5555
+ -nep_view - print information about the solver used
56+
. -nep_view_matk - view the split form matrix Ak (replace k by an integer from 0 to nt-1)
57+
. -nep_view_fnk - view the split form function fk (replace k by an integer from 0 to nt-1)
5658
. -nep_view_vectors - view the computed eigenvectors
5759
. -nep_view_values - view the computed eigenvalues
5860
. -nep_converged_reason - print reason for convergence, and number of iterations
@@ -74,6 +76,7 @@ PetscErrorCode NEPComputeVectors(NEP nep)
7476
PetscErrorCode NEPSolve(NEP nep)
7577
{
7678
PetscInt i;
79+
char str[16];
7780

7881
PetscFunctionBegin;
7982
PetscValidHeaderSpecific(nep,NEP_CLASSID,1);
@@ -119,6 +122,14 @@ PetscErrorCode NEPSolve(NEP nep)
119122
PetscCall(NEPErrorViewFromOptions(nep));
120123
PetscCall(NEPValuesViewFromOptions(nep));
121124
PetscCall(NEPVectorsViewFromOptions(nep));
125+
if (nep->fui==NEP_USER_INTERFACE_SPLIT) {
126+
for (i=0;i<nep->nt;i++) {
127+
PetscCall(PetscSNPrintf(str,sizeof(str),"-nep_view_mat%" PetscInt_FMT,i));
128+
PetscCall(MatViewFromOptions(nep->A[i],(PetscObject)nep,str));
129+
PetscCall(PetscSNPrintf(str,sizeof(str),"-nep_view_fn%" PetscInt_FMT,i));
130+
PetscCall(FNViewFromOptions(nep->f[i],(PetscObject)nep,str));
131+
}
132+
}
122133

123134
/* Remove the initial subspace */
124135
nep->nini = 0;

0 commit comments

Comments
 (0)