]> https://gitweb.dealii.org/ - dealii-svn.git/commitdiff
modification of update_solution_and_constraints ()
authorfrohne <frohne@0785d39b-7218-0410-832d-ea1e28bc413d>
Fri, 24 Feb 2012 20:29:16 +0000 (20:29 +0000)
committerfrohne <frohne@0785d39b-7218-0410-832d-ea1e28bc413d>
Fri, 24 Feb 2012 20:29:16 +0000 (20:29 +0000)
git-svn-id: https://svn.dealii.org/trunk@25165 0785d39b-7218-0410-832d-ea1e28bc413d

deal.II/examples/step-41/step-41.cc

index c8f0d68239448913a53947871df052045147a18c..b588e7f5a17656e53cc4d650f01bd28e93a955ed 100644 (file)
@@ -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 <int dim>
   void
   ObstacleProblem<dim>::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);

In the beginning the Universe was created. This has made a lot of people very angry and has been widely regarded as a bad move.

Douglas Adams


Typeset in Trocchi and Trocchi Bold Sans Serif.