]> https://gitweb.dealii.org/ - code-gallery.git/commitdiff
Update DataOut filter interface usage. 109/head
authorWolfgang Bangerth <bangerth@colostate.edu>
Tue, 19 Jul 2022 20:52:22 +0000 (14:52 -0600)
committerWolfgang Bangerth <bangerth@colostate.edu>
Tue, 19 Jul 2022 20:52:22 +0000 (14:52 -0600)
As far as I can see, all these filters in this code gallery program do
is select the locally owned cells. But this is what DataOut has been
doing automatically for a long time already, so the filters are no longer
necessary.

The face filter class was not even used :-)

Nonlinear_PoroViscoelasticity/nonlinear-poro-viscoelasticity.cc

index 1e527e61769d47b8253fec2558880312f574255f..0381dfeded234044cdbf2acbafa38b30c69ad1bc 100644 (file)
@@ -2799,76 +2799,6 @@ namespace NonLinearPoroViscoElasticity
            timerfile.leave_subsection();\r
      }\r
 \r
-    //Class to be able to output results correctly when using Paraview\r
-    template<int dim, class DH=DoFHandler<dim> >\r
-    class FilteredDataOut : public DataOut<dim, DH>\r
-    {\r
-        public:\r
-          FilteredDataOut ()\r
-          {}\r
-\r
-          virtual ~FilteredDataOut() {}\r
-\r
-          virtual typename DataOut<dim, DH>::cell_iterator\r
-          first_cell ()\r
-          {\r
-            typename DataOut<dim, DH>::active_cell_iterator\r
-            cell = this->dofs->begin_active();\r
-            while ((cell != this->dofs->end()) &&\r
-                   (!cell->is_locally_owned()))\r
-              ++cell;\r
-            return cell;\r
-          }\r
-\r
-          virtual typename DataOut<dim, DH>::cell_iterator\r
-          next_cell (const typename DataOut<dim, DH>::cell_iterator &old_cell)\r
-          {\r
-            if (old_cell != this->dofs->end())\r
-              {\r
-                const IteratorFilters::LocallyOwnedCell predicate{};\r
-                return\r
-                  ++(FilteredIterator<typename DataOut<dim, DH>::active_cell_iterator>\r
-                     (predicate,old_cell));\r
-              }\r
-            else\r
-              return old_cell;\r
-          }\r
-    };\r
-\r
-    template<int dim, class DH=DoFHandler<dim> >\r
-     class FilteredDataOutFaces : public DataOutFaces<dim,DH>\r
-     {\r
-         public:\r
-           FilteredDataOutFaces ()\r
-           {}\r
-\r
-           virtual ~FilteredDataOutFaces() {}\r
-\r
-           virtual typename DataOutFaces<dim,DH>::cell_iterator\r
-           first_cell ()\r
-           {\r
-             typename DataOutFaces<dim,DH>::active_cell_iterator\r
-             cell = this->dofs->begin_active();\r
-             while ((cell!=this->dofs->end()) && (!cell->is_locally_owned()))\r
-               ++cell;\r
-             return cell;\r
-           }\r
-\r
-           virtual typename DataOutFaces<dim,DH>::cell_iterator\r
-           next_cell (const typename DataOutFaces<dim, DH>::cell_iterator &old_cell)\r
-           {\r
-             if (old_cell!=this->dofs->end())\r
-             {\r
-                 const IteratorFilters::LocallyOwnedCell predicate{};\r
-                 return\r
-                   ++(FilteredIterator<typename DataOutFaces<dim,DH>::active_cell_iterator>\r
-                      (predicate,old_cell));\r
-             }\r
-             else\r
-               return old_cell;\r
-           }\r
-     };\r
-\r
     //Class to compute gradient of the pressure\r
     template <int dim>\r
     class GradientPostprocessor : public DataPostprocessorVector<dim>\r
@@ -3271,7 +3201,7 @@ namespace NonLinearPoroViscoElasticity
         }\r
 \r
         // Add the results to the solution to create the output file for Paraview\r
-        FilteredDataOut<dim> data_out;\r
+        DataOut<dim> data_out;\r
         std::vector<DataComponentInterpretation::DataComponentInterpretation>\r
           comp_type(dim,\r
                     DataComponentInterpretation::component_is_part_of_vector);\r

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.