]> https://gitweb.dealii.org/ - dealii-svn.git/commitdiff
Fix evaluation of the system matrix.
authorwolf <wolf@0785d39b-7218-0410-832d-ea1e28bc413d>
Thu, 11 Sep 2003 15:42:06 +0000 (15:42 +0000)
committerwolf <wolf@0785d39b-7218-0410-832d-ea1e28bc413d>
Thu, 11 Sep 2003 15:42:06 +0000 (15:42 +0000)
git-svn-id: https://svn.dealii.org/trunk@7973 0785d39b-7218-0410-832d-ea1e28bc413d

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

index 0d866a3f7802595c227892cd65ce982b25c332dd..86174d35681e9fa2ca2923ee440bbb8ed2d6b536 100644 (file)
@@ -584,20 +584,28 @@ void ElasticProblem<dim>::assemble_system ()
                  cell_matrix(i,j) 
                    += 
                                                     // This first term is
-                                                    // ((lambda+mu) d_i u_i, d_j v_j).
+                                                    // (lambda d_i u_i, d_j v_j)
+                                                    // + (mu d_i u_j, d_j v_i).
                                                     // Note that
                                                     // ``shape_grad(i,q_point)''
                                                     // returns the
                                                     // gradient of
+                                                    // the only
+                                                    // nonzero
+                                                    // component of
                                                     // the i-th shape
                                                     // function at
                                                     // quadrature
                                                     // point
                                                     // q_point. The
                                                     // component
-                                                    // ``comp(i)'',
+                                                    // ``comp(i)'' of
+                                                    // the gradient,
                                                     // which is the
                                                     // derivative of
+                                                    // this only
+                                                    // nonzero vector
+                                                    // component of
                                                     // the i-th shape
                                                     // function with
                                                     // respect to the
@@ -609,8 +617,11 @@ void ElasticProblem<dim>::assemble_system ()
                    (
                      (fe_values.shape_grad(i,q_point)[component_i] *
                       fe_values.shape_grad(j,q_point)[component_j] *
-                      (lambda_values[q_point] +
-                       mu_values[q_point]))
+                      lambda_values[q_point])
+                     +
+                     (fe_values.shape_grad(i,q_point)[component_j] *
+                      fe_values.shape_grad(j,q_point)[component_i] *
+                      mu_values[q_point])
                      +
                                                       // The second term is
                                                       // (mu nabla u_i, nabla v_j).

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.