@@ -295,7 +295,8 @@ unsigned int NewtonSolver::solve()
295295 rhs .close ();
296296
297297#ifdef LIBMESH_ENABLE_CONSTRAINTS
298- _system .get_dof_map ().enforce_constraints_exactly (_system );
298+ if (this -> _exact_constraint_enforcement )
299+ _system .get_dof_map ().enforce_constraints_exactly (_system );
299300#endif
300301
301302 SparseMatrix < Number > & matrix = * (_system .matrix );
@@ -426,8 +427,9 @@ unsigned int NewtonSolver::solve()
426427 _system .update ();
427428 // The linear solver may not have fit our constraints exactly
428429#ifdef LIBMESH_ENABLE_CONSTRAINTS
429- _system .get_dof_map ().enforce_constraints_exactly
430- (_system , & linear_solution , /* homogeneous = */ true);
430+ if (this -> _exact_constraint_enforcement )
431+ _system .get_dof_map ().enforce_constraints_exactly
432+ (_system , & linear_solution , /* homogeneous = */ true);
431433#endif
432434
433435 const unsigned int linear_steps = rval .first ;
@@ -553,7 +555,8 @@ unsigned int NewtonSolver::solve()
553555
554556 // The linear solver may not have fit our constraints exactly
555557#ifdef LIBMESH_ENABLE_CONSTRAINTS
556- _system .get_dof_map ().enforce_constraints_exactly (_system );
558+ if (this -> _exact_constraint_enforcement )
559+ _system .get_dof_map ().enforce_constraints_exactly (_system );
557560#endif
558561
559562 // We may need to localize a parallel solution
0 commit comments