From: frohne Date: Sun, 26 Feb 2012 17:22:41 +0000 (+0000) Subject: extend the output by the contact force X-Git-Url: https://gitweb.dealii.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=14ea7930dd18d5a266025d27f9fd6c6dc2bb813d;p=dealii-svn.git extend the output by the contact force git-svn-id: https://svn.dealii.org/trunk@25173 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 b588e7f5a1..53ca503baa 100644 --- a/deal.II/examples/step-41/step-41.cc +++ b/deal.II/examples/step-41/step-41.cc @@ -109,6 +109,7 @@ namespace Step41 TrilinosWrappers::Vector system_rhs; TrilinosWrappers::Vector complete_system_rhs; TrilinosWrappers::Vector diagonal_of_mass_matrix; + TrilinosWrappers::Vector contact_force; }; @@ -284,6 +285,7 @@ namespace Step41 solution.reinit (dof_handler.n_dofs()); system_rhs.reinit (dof_handler.n_dofs()); complete_system_rhs.reinit (dof_handler.n_dofs()); + contact_force.reinit (dof_handler.n_dofs()); // The only other thing to do // here is to compute the factors @@ -518,7 +520,8 @@ namespace Step41 TrilinosWrappers::Vector lambda (dof_handler.n_dofs()); complete_system_matrix.residual (lambda, solution, complete_system_rhs); - + contact_force.ratio (lambda, diagonal_of_mass_matrix); + contact_force *= -1; // The next step is to reset the // active set and constraints @@ -756,6 +759,7 @@ namespace Step41 data_out.attach_dof_handler (dof_handler); data_out.add_data_vector (solution, "displacement"); data_out.add_data_vector (active_set, "active_set"); + data_out.add_data_vector (contact_force, "lambda"); data_out.build_patches ();