]> https://gitweb.dealii.org/ - dealii.git/commitdiff
Adapt step-12 some further. 6117/head
authorWolfgang Bangerth <bangerth@colostate.edu>
Thu, 29 Mar 2018 03:40:49 +0000 (21:40 -0600)
committerWolfgang Bangerth <bangerth@colostate.edu>
Thu, 29 Mar 2018 03:40:49 +0000 (21:40 -0600)
In #5988, I added a function beta(...) that computes the advection direction
in step-12, but I forgot to update one other place where we computed this
direction as well. Use the new function in there as well.

examples/step-12/step-12.cc

index e82e3f9beb4043a44eea8ee1ba0fad5fdbe22376..41cd7213d46a850a538e71a0aceb0937db941827 100644 (file)
@@ -351,16 +351,13 @@ namespace Step12
     // the current point.
     for (unsigned int point=0; point<fe_values.n_quadrature_points; ++point)
       {
-        Point<dim> beta;
-        beta(0) = -fe_values.quadrature_point(point)(1);
-        beta(1) = fe_values.quadrature_point(point)(0);
-        beta /= beta.norm();
+        const Tensor<1,dim> beta_at_q_point = beta (fe_values.quadrature_point(point));
 
         // We solve a homogeneous equation, thus no right hand side shows up
         // in the cell term.  What's left is integrating the matrix entries.
         for (unsigned int i=0; i<fe_values.dofs_per_cell; ++i)
           for (unsigned int j=0; j<fe_values.dofs_per_cell; ++j)
-            local_matrix(i,j) += -beta *
+            local_matrix(i,j) += -beta_at_q_point *
                                  fe_values.shape_grad(i,point) *
                                  fe_values.shape_value(j,point) *
                                  JxW[point];

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.