]> https://gitweb.dealii.org/ - dealii.git/commitdiff
Move a few variables with no memory allocation into the innermost useful scope.
authorWolfgang Bangerth <bangerth@math.tamu.edu>
Sun, 12 Apr 2009 04:29:04 +0000 (04:29 +0000)
committerWolfgang Bangerth <bangerth@math.tamu.edu>
Sun, 12 Apr 2009 04:29:04 +0000 (04:29 +0000)
git-svn-id: https://svn.dealii.org/trunk@18593 0785d39b-7218-0410-832d-ea1e28bc413d

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

index 07cc3acc7677e9c92fedd497bdaef7de5c5f456e..9737b95c3a8850cff90005f3f5933230d4862d78 100644 (file)
@@ -599,8 +599,6 @@ void BEMProblem<dim>::assemble_system() {
     // the matrix in the global row i.
     Vector<double>      local_matrix_row_i(fe.dofs_per_cell);
     
-    Point<dim> R;
-
     // The index i runs on the collocation points, which are the
     // support of the ith basis function, while j runs on inner
     // integration. We perform this check here to ensure that we are
@@ -654,7 +652,7 @@ void BEMProblem<dim>::assemble_system() {
                     // Distance between the external support point
                     // and the quadrature point on the internal
                     // cell.
-                    R = q_points[q] - support_points[i];
+                    const Point<dim> R = q_points[q] - support_points[i];
                         
                     system_rhs(i) += ( LaplaceKernel::single_layer(R)   * 
                                        normal_wind                      *
@@ -745,7 +743,7 @@ void BEMProblem<dim>::assemble_system() {
                         wind.vector_value_list(singular_q_points, singular_cell_wind);
                     
                         for(unsigned int q=0; q<singular_quadrature->size(); ++q) {
-                            R = singular_q_points[q]- support_points[i];
+                         const Point<dim> R = singular_q_points[q]- support_points[i];
                             double normal_wind = 0;
                             for(unsigned int d=0; d<dim; ++d)
                                 normal_wind += (singular_cell_wind[q](d)*
@@ -873,9 +871,6 @@ void BEMProblem<dim>::compute_exterior_solution() {
     std::vector<double> normal_wind(n_q_points);
     std::vector<Vector<double> > local_wind(n_q_points, Vector<double>(dim) );
     
-    Point<dim> R;
-
-
     typename DoFHandler<dim>::active_cell_iterator
         external_cell = external_dh.begin_active(),
         external_endc = external_dh.end();
@@ -905,7 +900,7 @@ void BEMProblem<dim>::compute_exterior_solution() {
             
             for(unsigned int q=0; q<n_q_points; ++q) {
                 
-                R =  q_points[q] - external_support_points[i];
+             const Point<dim> R =  q_points[q] - external_support_points[i];
                         
                 external_phi(i) += ( ( LaplaceKernel::single_layer(R)   * 
                                        normal_wind[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.