]> https://gitweb.dealii.org/ - dealii.git/commitdiff
step-22: add comment
authorTimo Heister <timo.heister@gmail.com>
Wed, 26 Feb 2014 18:12:19 +0000 (18:12 +0000)
committerTimo Heister <timo.heister@gmail.com>
Wed, 26 Feb 2014 18:12:19 +0000 (18:12 +0000)
git-svn-id: https://svn.dealii.org/trunk@32558 0785d39b-7218-0410-832d-ea1e28bc413d

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

index e63bae370c368c42012fdf97ede42219441e1e0c..69fbc3b615cea3fe934a5b3eeeb2fc4f58d0dbf4 100644 (file)
@@ -674,6 +674,18 @@ namespace Step22
 
                   }
 
+               // For the right-hand side we use the fact that the shape
+               // functions are only non-zero in one component (because our
+               // elements are primitive).  Instead of multiplying the tensor
+               // representing the dim+1 values of shape function i with the
+               // whole right-hand side vector, we only look at the only
+               // non-zero component. The Function
+               // FiniteElement::system_to_component_index(i) will return
+               // which component this shape function lives in (0=x velocity,
+               // 1=y velocity, 2=pressure in 2d), which we use to pick out
+               // the correct component of the right-hand side vector to
+               // multiply with.
+               
                 const unsigned int component_i =
                   fe.system_to_component_index(i).first;
                 local_rhs(i) += fe_values.shape_value(i,q) *

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.