From: Wolfgang Bangerth Date: Tue, 19 Jul 2022 20:52:22 +0000 (-0600) Subject: Update DataOut filter interface usage. X-Git-Url: https://gitweb.dealii.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=55bbfbf2140a8602662613efb1f8d5fdd91064c7;p=code-gallery.git Update DataOut filter interface usage. 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 :-) --- diff --git a/Nonlinear_PoroViscoelasticity/nonlinear-poro-viscoelasticity.cc b/Nonlinear_PoroViscoelasticity/nonlinear-poro-viscoelasticity.cc index 1e527e6..0381dfe 100644 --- a/Nonlinear_PoroViscoelasticity/nonlinear-poro-viscoelasticity.cc +++ b/Nonlinear_PoroViscoelasticity/nonlinear-poro-viscoelasticity.cc @@ -2799,76 +2799,6 @@ namespace NonLinearPoroViscoElasticity timerfile.leave_subsection(); } - //Class to be able to output results correctly when using Paraview - template > - class FilteredDataOut : public DataOut - { - public: - FilteredDataOut () - {} - - virtual ~FilteredDataOut() {} - - virtual typename DataOut::cell_iterator - first_cell () - { - typename DataOut::active_cell_iterator - cell = this->dofs->begin_active(); - while ((cell != this->dofs->end()) && - (!cell->is_locally_owned())) - ++cell; - return cell; - } - - virtual typename DataOut::cell_iterator - next_cell (const typename DataOut::cell_iterator &old_cell) - { - if (old_cell != this->dofs->end()) - { - const IteratorFilters::LocallyOwnedCell predicate{}; - return - ++(FilteredIterator::active_cell_iterator> - (predicate,old_cell)); - } - else - return old_cell; - } - }; - - template > - class FilteredDataOutFaces : public DataOutFaces - { - public: - FilteredDataOutFaces () - {} - - virtual ~FilteredDataOutFaces() {} - - virtual typename DataOutFaces::cell_iterator - first_cell () - { - typename DataOutFaces::active_cell_iterator - cell = this->dofs->begin_active(); - while ((cell!=this->dofs->end()) && (!cell->is_locally_owned())) - ++cell; - return cell; - } - - virtual typename DataOutFaces::cell_iterator - next_cell (const typename DataOutFaces::cell_iterator &old_cell) - { - if (old_cell!=this->dofs->end()) - { - const IteratorFilters::LocallyOwnedCell predicate{}; - return - ++(FilteredIterator::active_cell_iterator> - (predicate,old_cell)); - } - else - return old_cell; - } - }; - //Class to compute gradient of the pressure template class GradientPostprocessor : public DataPostprocessorVector @@ -3271,7 +3201,7 @@ namespace NonLinearPoroViscoElasticity } // Add the results to the solution to create the output file for Paraview - FilteredDataOut data_out; + DataOut data_out; std::vector comp_type(dim, DataComponentInterpretation::component_is_part_of_vector);