From: frohne Date: Fri, 24 Feb 2012 20:29:16 +0000 (+0000) Subject: modification of update_solution_and_constraints () X-Git-Url: https://gitweb.dealii.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=3e6a99f901da9f9ef0c14cc753ee089bb4b8c85f;p=dealii-svn.git modification of update_solution_and_constraints () git-svn-id: https://svn.dealii.org/trunk@25165 0785d39b-7218-0410-832d-ea1e28bc413d --- diff --git a/deal.II/examples/step-41/step-41.cc b/deal.II/examples/step-41/step-41.cc index c8f0d68239..b588e7f5a1 100644 --- a/deal.II/examples/step-41/step-41.cc +++ b/deal.II/examples/step-41/step-41.cc @@ -491,8 +491,10 @@ namespace Step41 // over all degrees of freedom and // check the sign of the function // $\Lambda^k_i + c([BU^k]_i - - // G_i)$. To this end, we use the - // formula given in the + // G_i) = \Lambda^k_i + cB_i(U^k_i - + // [g_h]_i)$ because in our case + // $G_i = B_i[g_h]_i$. To this end, + // we use the formula given in the // introduction by which we can // compute the Lagrange multiplier // as the residual of the original @@ -504,10 +506,7 @@ namespace Step41 // At the top of this function, we // compute this residual using a // function that is part of the - // matrix classes (but - // unfortunately for us computes - // the residual with the wrong - // sign). + // matrix classes. template void ObstacleProblem::update_solution_and_constraints () @@ -519,7 +518,6 @@ namespace Step41 TrilinosWrappers::Vector lambda (dof_handler.n_dofs()); complete_system_matrix.residual (lambda, solution, complete_system_rhs); - lambda *= -1; // The next step is to reset the @@ -658,8 +656,8 @@ namespace Step41 if (lambda (dof_index) + penalty_parameter * diagonal_of_mass_matrix(dof_index) * - (obstacle_value - solution_value) - > + (solution_value - obstacle_value) + < 0) { active_set.add_index (dof_index);