File tree Expand file tree Collapse file tree 1 file changed +10
-3
lines changed
Expand file tree Collapse file tree 1 file changed +10
-3
lines changed Original file line number Diff line number Diff line change @@ -1153,15 +1153,22 @@ void PetscNonlinearSolver<T>::check_reuse_operator_sizes(numeric_index_type new_
11531153 // preconditioner if the operator sizes has changed, regardless
11541154 // of what libmesh itself knows about the problem
11551155 //
1156- if (!(this -> _reuse_preconditioner ) || !(this -> _is_initialized ))
1156+ if (!(this -> _reuse_preconditioner ) ||
1157+ !(this -> _is_initialized ) ||
1158+ !(_setup_reuse ))
11571159 return ;
11581160
1159- if (!_setup_reuse )
1160- return ;
11611161
11621162 KSP ksp ;
11631163 PetscErrorCode ierr = SNESGetKSP (_snes , & ksp );
11641164 LIBMESH_CHKERR (ierr );
1165+
1166+ PetscBool setup_A , setup_P ;
1167+ ierr = KSPGetOperatorsSet (ksp , & setup_A , & setup_P );
1168+ LIBMESH_CHKERR (ierr );
1169+ if (!(setup_A && setup_P ))
1170+ return ;
1171+
11651172 Mat A ;
11661173 Mat P ;
11671174 ierr = KSPGetOperators (ksp , & A , & P );
You can’t perform that action at this time.
0 commit comments