@@ -853,10 +853,6 @@ PetscNonlinearSolver<T>::solve (SparseMatrix<T> & pre_in, // System Preconditi
853853 LOG_SCOPE ("solve()" , "PetscNonlinearSolver" );
854854 this -> init ();
855855
856- // Backup check on the size of the stored preconditioner to see if the
857- // problem size has changed. If so do not use the stored preconditioner.
858- check_reuse_operator_sizes (x_in .size ());
859-
860856 // Make sure the data passed in are really of Petsc types
861857 PetscMatrix < T > * pre = cast_ptr < PetscMatrix < T > * > (& pre_in );
862858 PetscVector < T > * x = cast_ptr < PetscVector < T > * > (& x_in );
@@ -1144,47 +1140,6 @@ void PetscNonlinearSolver<T>::force_new_preconditioner()
11441140 _setup_reuse = false;
11451141}
11461142
1147- template < typename T >
1148- void PetscNonlinearSolver < T > ::check_reuse_operator_sizes (numeric_index_type new_size )
1149- {
1150- // There are some special cases where libmesh won't know the
1151- // operator size has changed (for example, problems involving
1152- // variational inequalities). This check will force a new
1153- // preconditioner if the operator sizes has changed, regardless
1154- // of what libmesh itself knows about the problem
1155- //
1156- if (!(this -> _reuse_preconditioner ) ||
1157- !(this -> _is_initialized ) ||
1158- !(_setup_reuse ))
1159- return ;
1160-
1161-
1162- KSP ksp ;
1163- PetscErrorCode ierr = SNESGetKSP (_snes , & ksp );
1164- 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-
1172- Mat A ;
1173- Mat P ;
1174- ierr = KSPGetOperators (ksp , & A , & P );
1175- LIBMESH_CHKERR (ierr );
1176-
1177- PetscInt Pm , Pn ;
1178- ierr = MatGetSize (A , & Pm , & Pn );
1179- LIBMESH_CHKERR (ierr );
1180-
1181- if ((unsigned ) Pn != new_size )
1182- {
1183- this -> force_new_preconditioner ();
1184- this -> init ();
1185- }
1186- }
1187-
11881143//------------------------------------------------------------------
11891144// Explicit instantiations
11901145template class LIBMESH_EXPORT PetscNonlinearSolver < Number > ;
0 commit comments