]> https://gitweb.dealii.org/ - dealii.git/commitdiff
Rename a function argument. 3446/head
authorWolfgang Bangerth <bangerth@colostate.edu>
Thu, 3 Nov 2016 22:53:45 +0000 (16:53 -0600)
committerWolfgang Bangerth <bangerth@colostate.edu>
Fri, 4 Nov 2016 13:32:14 +0000 (07:32 -0600)
DataOutRotation::build_one_patch took a variable named 'patches',
but unlike in #3445, it is not a reference to the class's member
variable of the same name. Rather, it is an array this function
needs to fill in, and nobody else sees it. Consequently,
rename it 'my_patches'.

While there, also update the documentation, which is no longer
in agreement with the implementation.

include/deal.II/numerics/data_out_rotation.h
source/numerics/data_out_rotation.cc

index eeb10e87e6f526ea89be0d8cc237886d45ee87a4..af59da996644c40b14dbe6712c290b7a16158bbf 100644 (file)
@@ -193,14 +193,14 @@ public:
 
 private:
   /**
-   * Builds every @p n_threads's patch. This function may be called in
-   * parallel. If multithreading is not used, the function is called once and
-   * generates all patches.
+   * Build all of the patches that correspond to the cell given in the first
+   * argument. Use the second argument as scratch space for parallel
+   * invocation in WorkStream, and put the results into the last argument.
    */
   void
   build_one_patch (const cell_iterator *cell,
                    internal::DataOutRotation::ParallelData<dimension, space_dimension> &data,
-                   std::vector<DataOutBase::Patch<dimension+1,space_dimension+1> > &patches);
+                   std::vector<DataOutBase::Patch<dimension+1,space_dimension+1> > &my_patches);
 };
 
 
index 6812cebc5a0ccc5845b93f26ff302fd65fe018c8..4b14ef7265fbc80428dfa97bfa378b666117f782 100644 (file)
@@ -93,9 +93,9 @@ namespace internal
 template <int dim, typename DoFHandlerType>
 void
 DataOutRotation<dim,DoFHandlerType>::
-build_one_patch (const cell_iterator *cell,
+build_one_patch (const cell_iterator                                                 *cell,
                  internal::DataOutRotation::ParallelData<dimension, space_dimension> &data,
-                 std::vector<DataOutBase::Patch<dimension+1,space_dimension+1> > &patches)
+                 std::vector<DataOutBase::Patch<dimension+1,space_dimension+1> >     &my_patches)
 {
   if (dim == 3)
     {
@@ -140,10 +140,10 @@ build_one_patch (const cell_iterator *cell,
           Assert (r1 >= 0, ExcRadialVariableHasNegativeValues(r1));
           Assert (r2 >= 0, ExcRadialVariableHasNegativeValues(r2));
 
-          patches[angle].vertices[0] = r1*angle_directions[angle];
-          patches[angle].vertices[1] = r2*angle_directions[angle];
-          patches[angle].vertices[2] = r1*angle_directions[angle+1];
-          patches[angle].vertices[3] = r2*angle_directions[angle+1];
+          my_patches[angle].vertices[0] = r1*angle_directions[angle];
+          my_patches[angle].vertices[1] = r2*angle_directions[angle];
+          my_patches[angle].vertices[2] = r1*angle_directions[angle+1];
+          my_patches[angle].vertices[3] = r2*angle_directions[angle+1];
 
           break;
         };
@@ -161,12 +161,12 @@ build_one_patch (const cell_iterator *cell,
               Assert (v(0) >= 0, ExcRadialVariableHasNegativeValues(v(0)));
 
               // now set the vertices of the patch
-              patches[angle].vertices[vertex] = v(0) * angle_directions[angle];
-              patches[angle].vertices[vertex][0] = v(1);
+              my_patches[angle].vertices[vertex] = v(0) * angle_directions[angle];
+              my_patches[angle].vertices[vertex][0] = v(1);
 
-              patches[angle].vertices[vertex+GeometryInfo<dimension>::vertices_per_cell]
+              my_patches[angle].vertices[vertex+GeometryInfo<dimension>::vertices_per_cell]
                 = v(0) * angle_directions[angle+1];
-              patches[angle].vertices[vertex+GeometryInfo<dimension>::vertices_per_cell][0]
+              my_patches[angle].vertices[vertex+GeometryInfo<dimension>::vertices_per_cell][0]
                 = v(1);
             };
 
@@ -254,8 +254,8 @@ build_one_patch (const cell_iterator *cell,
                         case 1:
                           for (unsigned int x=0; x<n_points; ++x)
                             for (unsigned int y=0; y<n_points; ++y)
-                              patches[angle].data(offset+component,
-                                                  x*n_points + y)
+                              my_patches[angle].data(offset+component,
+                                                     x*n_points + y)
                                 = data.postprocessed_values[dataset][x](component);
                           break;
 
@@ -263,10 +263,10 @@ build_one_patch (const cell_iterator *cell,
                           for (unsigned int x=0; x<n_points; ++x)
                             for (unsigned int y=0; y<n_points; ++y)
                               for (unsigned int z=0; z<n_points; ++z)
-                                patches[angle].data(offset+component,
-                                                    x*n_points*n_points +
-                                                    y*n_points +
-                                                    z)
+                                my_patches[angle].data(offset+component,
+                                                       x*n_points*n_points +
+                                                       y*n_points +
+                                                       z)
                                   = data.postprocessed_values[dataset][x*n_points+z](component);
                           break;
 
@@ -285,8 +285,8 @@ build_one_patch (const cell_iterator *cell,
                     case 1:
                       for (unsigned int x=0; x<n_points; ++x)
                         for (unsigned int y=0; y<n_points; ++y)
-                          patches[angle].data(offset,
-                                              x*n_points + y)
+                          my_patches[angle].data(offset,
+                                                 x*n_points + y)
                             = data.patch_values_scalar.solution_values[x];
                       break;
 
@@ -294,10 +294,10 @@ build_one_patch (const cell_iterator *cell,
                       for (unsigned int x=0; x<n_points; ++x)
                         for (unsigned int y=0; y<n_points; ++y)
                           for (unsigned int z=0; z<n_points; ++z)
-                            patches[angle].data(offset,
-                                                x*n_points*n_points +
-                                                y +
-                                                z*n_points)
+                            my_patches[angle].data(offset,
+                                                   x*n_points*n_points +
+                                                   y +
+                                                   z*n_points)
                               = data.patch_values_scalar.solution_values[x*n_points+z];
                       break;
 
@@ -320,8 +320,8 @@ build_one_patch (const cell_iterator *cell,
                         case 1:
                           for (unsigned int x=0; x<n_points; ++x)
                             for (unsigned int y=0; y<n_points; ++y)
-                              patches[angle].data(offset+component,
-                                                  x*n_points + y)
+                              my_patches[angle].data(offset+component,
+                                                     x*n_points + y)
                                 = data.patch_values_system.solution_values[x](component);
                           break;
 
@@ -329,10 +329,10 @@ build_one_patch (const cell_iterator *cell,
                           for (unsigned int x=0; x<n_points; ++x)
                             for (unsigned int y=0; y<n_points; ++y)
                               for (unsigned int z=0; z<n_points; ++z)
-                                patches[angle].data(offset+component,
-                                                    x*n_points*n_points +
-                                                    y*n_points +
-                                                    z)
+                                my_patches[angle].data(offset+component,
+                                                       x*n_points*n_points +
+                                                       y*n_points +
+                                                       z)
                                   = data.patch_values_system.solution_values[x*n_points+z](component);
                           break;
 
@@ -362,9 +362,9 @@ build_one_patch (const cell_iterator *cell,
                 case 1:
                   for (unsigned int x=0; x<n_points; ++x)
                     for (unsigned int y=0; y<n_points; ++y)
-                      patches[angle].data(dataset+offset,
-                                          x*n_points +
-                                          y)
+                      my_patches[angle].data(dataset+offset,
+                                             x*n_points +
+                                             y)
                         = value;
                   break;
 
@@ -372,10 +372,10 @@ build_one_patch (const cell_iterator *cell,
                   for (unsigned int x=0; x<n_points; ++x)
                     for (unsigned int y=0; y<n_points; ++y)
                       for (unsigned int z=0; z<n_points; ++z)
-                        patches[angle].data(dataset+offset,
-                                            x*n_points*n_points +
-                                            y*n_points +
-                                            z)
+                        my_patches[angle].data(dataset+offset,
+                                               x*n_points*n_points +
+                                               y*n_points +
+                                               z)
                           = value;
                   break;
 

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.