]> https://gitweb.dealii.org/ - dealii-svn.git/commitdiff
Make access to shape values and gradients more consistent by using the new vector2d...
authorwolf <wolf@0785d39b-7218-0410-832d-ea1e28bc413d>
Fri, 8 Mar 2002 10:39:40 +0000 (10:39 +0000)
committerwolf <wolf@0785d39b-7218-0410-832d-ea1e28bc413d>
Fri, 8 Mar 2002 10:39:40 +0000 (10:39 +0000)
git-svn-id: https://svn.dealii.org/trunk@5552 0785d39b-7218-0410-832d-ea1e28bc413d

deal.II/examples/step-5/step-5.cc
deal.II/examples/step-6/step-6.cc
deal.II/examples/step-7/step-7.cc
deal.II/examples/step-8/step-8.cc
deal.II/examples/step-9/step-9.cc

index ebbf6f3f1e103e6442e37879c4c9eb79242d3519..a244c6f713cc8fd0e871ddd313ded77a2170dc67 100644 (file)
@@ -470,10 +470,10 @@ void LaplaceProblem<dim>::assemble_system ()
                                       // Instead of writing
                                       // fe_values.shape_value(j,q)
                                       // we can now write
-                                      // shape_values(j,q), i.e. the
+                                      // shape_values[j][q], i.e. the
                                       // function call needed
                                       // previously for each access
-                                      // has been optimized away.
+                                      // will be optimized away.
                                       //
                                       // There are alike functions
                                       // for almost all data elements
@@ -487,7 +487,8 @@ void LaplaceProblem<dim>::assemble_system ()
                                       // in the matrix (j,q) now
                                       // needs to be the gradient of
                                       // the shape function, which is
-                                      // a vector.
+                                      // a tensor rather than a
+                                      // scalar.
                                       //
                                       // Similarly, access to the
                                       // place where quadrature
@@ -514,23 +515,7 @@ void LaplaceProblem<dim>::assemble_system ()
                                       // fe_values object is no more
                                       // explicitely needed to access
                                       // the different fields (see
-                                      // below). Unfortunately,
-                                      // things became a bit
-                                      // inconsistent, since the
-                                      // shape values are accessed
-                                      // via the FullMatrix operator
-                                      // (), i.e. using parentheses,
-                                      // while all the other fields
-                                      // are accessed through vector
-                                      // operator [], i.e. using
-                                      // brackets. This is due to
-                                      // historical reasons and
-                                      // frequently leads to a bit of
-                                      // confusion, but since the
-                                      // places where this happens
-                                      // are few in well-written
-                                      // programs, this is not too
-                                      // big a problem.
+                                      // below).
 
                                       // There is one more thing: in
                                       // this example, we want to use
@@ -610,7 +595,7 @@ void LaplaceProblem<dim>::assemble_system ()
                                             // For the right hand
                                             // side, a constant value
                                             // is used again:
-           cell_rhs(i) += (shape_values (i,q_point) *
+           cell_rhs(i) += (shape_values[i][q_point] *
                            1.0 *
                            JxW_values[q_point]);
          };
index bcfa77fb09d80b1ad41581c889b979c8c0e9d22b..96163f9adde43f47a859814769d047b0e1294a74 100644 (file)
@@ -533,9 +533,9 @@ void LaplaceProblem<dim>::assemble_system ()
                                    shape_grads[j][q_point])   *
                                   JxW_values[q_point]);
 
-           cell_rhs(i) += (shape_values (i,q_point) *
+           cell_rhs(i) += (shape_values[i][q_point] *
                            1.0 *
-                           fe_values.JxW (q_point));
+                           JxW_values[q_point]);
          };
 
 
index 2a119ec194296e43b7b0d5ba97bcc900b8704d67..a27f10c6bd59ead3da994e29985817a0db8cb5cb 100644 (file)
@@ -888,13 +888,13 @@ void LaplaceProblem<dim>::assemble_system ()
                                    shape_grads[j][q_point] *
                                    JxW_values[q_point])
                                   +
-                                  (shape_values(i,q_point) *
-                                   shape_values(j,q_point) *
+                                  (shape_values[i][q_point] *
+                                   shape_values[j][q_point] *
                                    JxW_values[q_point]));
 
            cell_rhs(i) += (shape_values (i,q_point) *
                            rhs_values [q_point] *
-                           fe_values.JxW (q_point));
+                           JxW_values[q_point]);
          };
 
                                       // Then there is that second
@@ -988,7 +988,7 @@ void LaplaceProblem<dim>::assemble_system ()
                                                 // shape function:
                for (unsigned int i=0; i<dofs_per_cell; ++i)
                  cell_rhs(i) += (neumann_value *
-                                 face_shape_values(i,q_point) *
+                                 face_shape_values[i][q_point] *
                                  face_JxW_values[q_point]);
              };
          };
index 37fdaf6c9a7ca29b1a9abf8034019ac8598f550f..fe24ce0cd1290c99af91c13833e3e7246b215451 100644 (file)
@@ -690,7 +690,7 @@ void ElasticProblem<dim>::assemble_system ()
            component_i = fe.system_to_component_index(i).first;
          
          for (unsigned int q_point=0; q_point<n_q_points; ++q_point)
-           cell_rhs(i) += shape_values(i,q_point) *
+           cell_rhs(i) += shape_values[i][q_point] *
                           rhs_values[q_point](component_i) *
                           JxW_values[q_point];
        };
index 4fd06faddc8b5051238a3f2aca0e8c9af9b11d5e..50ee66aec3c435d3fa1bffc62b4dc034d3d34faa 100644 (file)
@@ -1045,13 +1045,13 @@ assemble_system_interval (const typename DoFHandler<dim>::active_cell_iterator &
            for (unsigned int j=0; j<dofs_per_cell; ++j)
              cell_matrix(i,j) += ((advection_directions[q_point] *
                                    shape_grads[j][q_point]    *
-                                   (shape_values(i,q_point) +
+                                   (shape_values[i][q_point] +
                                     delta *
                                     (advection_directions[q_point] *
                                      shape_grads[i][q_point]))) *
                                   JxW_values[q_point]);
 
-           cell_rhs(i) += ((shape_values (i,q_point) +
+           cell_rhs(i) += ((shape_values[i][q_point] +
                             delta *
                             (advection_directions[q_point] *
                              shape_grads[i][q_point])        ) *
@@ -1175,14 +1175,14 @@ assemble_system_interval (const typename DoFHandler<dim>::active_cell_iterator &
                    for (unsigned int j=0; j<dofs_per_cell; ++j)
                      cell_matrix(i,j) -= (face_advection_directions[q_point] *
                                           normal_vectors[q_point] *
-                                          face_shape_values(i,q_point) *
-                                          face_shape_values(j,q_point) *
+                                          face_shape_values[i][q_point] *
+                                          face_shape_values[j][q_point] *
                                           face_JxW_values[q_point]);
                    
                    cell_rhs(i) -= (face_advection_directions[q_point] *
                                    normal_vectors[q_point] *
                                    face_boundary_values[q_point] *
-                                   face_shape_values(i,q_point) *
+                                   face_shape_values[i][q_point] *
                                    face_JxW_values[q_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.