]> https://gitweb.dealii.org/ - dealii.git/commitdiff
Let DataOut::build_one_patch use a member variable. 3445/head
authorWolfgang Bangerth <bangerth@colostate.edu>
Thu, 3 Nov 2016 22:34:08 +0000 (16:34 -0600)
committerWolfgang Bangerth <bangerth@colostate.edu>
Thu, 3 Nov 2016 22:34:08 +0000 (16:34 -0600)
Currently, it takes a reference to a variable as argument, but this variable
is a member variable of the class to which it has access. That's duplicative.
To make things even more confusing, the local variable and the member
are named the same.

Fix this by just not taking the reference as argument, and directly
accessing the member of the class.

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

index d262a2e218c401d0a97fe201c8dbdd3b2d6f7a2d..94612cc3ad36e4a896028f655984b10499ac6f2c 100644 (file)
@@ -334,8 +334,7 @@ private:
   (const std::pair<cell_iterator, unsigned int>                 *cell_and_index,
    internal::DataOut::ParallelData<DoFHandlerType::dimension, DoFHandlerType::space_dimension>  &scratch_data,
    const unsigned int                                            n_subdivisions,
-   const CurvedCellRegion                                        curved_cell_region,
-   std::vector<DataOutBase::Patch<DoFHandlerType::dimension, DoFHandlerType::space_dimension> > &patches);
+   const CurvedCellRegion                                        curved_cell_region);
 };
 
 
index fdc4674f21e9cd2b761f3e3e34c76ce6e471f0b9..4e094b09c596082f6cfbadaacde860bf9b2013a7 100644 (file)
@@ -66,8 +66,7 @@ build_one_patch
 (const std::pair<cell_iterator, unsigned int>                                                *cell_and_index,
  internal::DataOut::ParallelData<DoFHandlerType::dimension, DoFHandlerType::space_dimension> &scratch_data,
  const unsigned int                                                                           n_subdivisions,
- const CurvedCellRegion                                                                       curved_cell_region,
- std::vector<DataOutBase::Patch<DoFHandlerType::dimension, DoFHandlerType::space_dimension> > &patches)
+ const CurvedCellRegion                                                                       curved_cell_region)
 {
   // first create the output object that we will write into
   ::dealii::DataOutBase::Patch<DoFHandlerType::dimension, DoFHandlerType::space_dimension> patch;
@@ -290,13 +289,13 @@ build_one_patch
   const unsigned int patch_idx =
     (*scratch_data.cell_to_patch_index_map)[cell_and_index->first->level()][cell_and_index->first->index()];
   // did we mess up the indices?
-  Assert(patch_idx < patches.size(), ExcInternalError());
+  Assert(patch_idx < this->patches.size(), ExcInternalError());
   patch.patch_index = patch_idx;
 
   // Put the patch into the patches vector. instead of copying the data,
   // simply swap the contents to avoid the penalty of writing into another
   // processor's memory
-  patches[patch_idx].swap (patch);
+  this->patches[patch_idx].swap (patch);
 }
 
 
@@ -449,8 +448,7 @@ void DataOut<dim,DoFHandlerType>::build_patches
                                         copy data object -- it just writes everything right into the
                                         output array */
                                      n_subdivisions,
-                                     curved_cell_region,
-                                     std_cxx11::ref(this->patches)),
+                                     curved_cell_region),
                      // no copy-local-to-global function needed here
                      std_cxx11::function<void (const int &)>(),
                      thread_data,

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.