From: Peter Munch Date: Wed, 26 Jul 2023 08:04:56 +0000 (+0200) Subject: Remove VectorHelper X-Git-Tag: relicensing~640^2 X-Git-Url: https://gitweb.dealii.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=f1ab4b582b451ecc913e4ad2965f2af7558b4677;p=dealii.git Remove VectorHelper --- diff --git a/include/deal.II/numerics/data_out_dof_data.templates.h b/include/deal.II/numerics/data_out_dof_data.templates.h index a8b708acf3..1722cf4de2 100644 --- a/include/deal.II/numerics/data_out_dof_data.templates.h +++ b/include/deal.II/numerics/data_out_dof_data.templates.h @@ -718,82 +718,6 @@ namespace internal } - /** - * Helper class templated on vector type to allow different implementations - * to extract information from a vector. - */ - template - struct VectorHelper - { - /** - * extract the @p indices from @p vector and put them into @p values. - */ - static void - extract(const VectorType & vector, - const std::vector &indices, - const ComponentExtractor extract_component, - std::vector & values); - }; - - - - template - void - VectorHelper::extract( - const VectorType & vector, - const std::vector &indices, - const ComponentExtractor extract_component, - std::vector & values) - { - for (unsigned int i = 0; i < values.size(); ++i) - values[i] = get_component(vector[indices[i]], extract_component); - } - - - -#ifdef DEAL_II_WITH_TRILINOS - template <> - inline void - VectorHelper::extract( - const LinearAlgebra::EpetraWrappers::Vector & /*vector*/, - const std::vector & /*indices*/, - const ComponentExtractor /*extract_component*/, - std::vector & /*values*/) - { - // TODO: we don't have element access - Assert(false, ExcNotImplemented()); - } -#endif - - - -#ifdef DEAL_II_TRILINOS_WITH_TPETRA - template <> - inline void - VectorHelper>::extract( - const LinearAlgebra::TpetraWrappers::Vector & /*vector*/, - const std::vector & /*indices*/, - const ComponentExtractor /*extract_component*/, - std::vector & /*values*/) - { - // TODO: we don't have element access - Assert(false, ExcNotImplemented()); - } - - template <> - inline void - VectorHelper>::extract( - const LinearAlgebra::TpetraWrappers::Vector & /*vector*/, - const std::vector & /*indices*/, - const ComponentExtractor /*extract_component*/, - std::vector & /*values*/) - { - // TODO: we don't have element access - Assert(false, ExcNotImplemented()); - } -#endif - - template DataEntryBase::DataEntryBase( @@ -1693,6 +1617,19 @@ namespace internal private: MGLevelObject> vectors; + + /** + * Extract the @p indices from @p vector and put them into @p values. + */ + void + extract(const LinearAlgebra::distributed::BlockVector &vector, + const std::vector &indices, + const ComponentExtractor extract_component, + std::vector & values) const + { + for (unsigned int i = 0; i < values.size(); ++i) + values[i] = get_component(vector[indices[i]], extract_component); + } }; @@ -1736,8 +1673,7 @@ namespace internal std::vector dof_indices(dofs_per_cell); dof_cell->get_mg_dof_indices(dof_indices); std::vector values(dofs_per_cell); - VectorHelper>:: - extract(*vector, dof_indices, extract_component, values); + extract(*vector, dof_indices, extract_component, values); std::fill(patch_values.begin(), patch_values.end(), 0.0); for (unsigned int i = 0; i < dofs_per_cell; ++i) @@ -1772,8 +1708,7 @@ namespace internal std::vector dof_indices(dofs_per_cell); dof_cell->get_mg_dof_indices(dof_indices); std::vector values(dofs_per_cell); - VectorHelper>:: - extract(*vector, dof_indices, extract_component, values); + extract(*vector, dof_indices, extract_component, values); const unsigned int n_components = fe_patch_values.get_fe().n_components(); const unsigned int n_eval_points = fe_patch_values.n_quadrature_points;