From: Matthias Maier Date: Fri, 15 Sep 2017 15:32:41 +0000 (-0500) Subject: simplify X-Git-Tag: v9.0.0-rc1~1055^2~5 X-Git-Url: https://gitweb.dealii.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=97e7a798f11a08dc14cb4a53718d083ac851ee70;p=dealii.git simplify --- diff --git a/include/deal.II/fe/fe_tools.templates.h b/include/deal.II/fe/fe_tools.templates.h index cd064e4b85..ac7b14fa98 100644 --- a/include/deal.II/fe/fe_tools.templates.h +++ b/include/deal.II/fe/fe_tools.templates.h @@ -2912,55 +2912,50 @@ namespace FETools namespace { - // internal helper class to partially specialize the number type + // Helper functions for + // FETools::convert_generalized_support_point_values_to_dof_values template - struct ConvertHelper + static void convert_helper( + const FiniteElement &finite_element, + const std::vector > &support_point_values, + std::vector &dof_values) { - static void convert_generalized_support_point_values_to_dof_values( - const FiniteElement &finite_element, - const std::vector > &support_point_values, - std::vector &dof_values) - { - static Threads::ThreadLocalStorage > > - double_support_point_values; - static Threads::ThreadLocalStorage > - double_dof_values; + static Threads::ThreadLocalStorage > > + double_support_point_values; + static Threads::ThreadLocalStorage > + double_dof_values; - double_support_point_values.get().resize(support_point_values.size()); - double_dof_values.get().resize(dof_values.size()); + double_support_point_values.get().resize(support_point_values.size()); + double_dof_values.get().resize(dof_values.size()); - for (unsigned int i = 0; i < support_point_values.size(); ++i) - { - double_support_point_values.get()[i].reinit( - finite_element.n_components(), false); - std::copy(std::begin(support_point_values[i]), - std::end(support_point_values[i]), - std::begin(double_support_point_values.get()[i])); - } + for (unsigned int i = 0; i < support_point_values.size(); ++i) + { + double_support_point_values.get()[i].reinit( + finite_element.n_components(), false); + std::copy(std::begin(support_point_values[i]), + std::end(support_point_values[i]), + std::begin(double_support_point_values.get()[i])); + } - finite_element.convert_generalized_support_point_values_to_dof_values( - double_support_point_values.get(), double_dof_values.get()); + finite_element.convert_generalized_support_point_values_to_dof_values( + double_support_point_values.get(), double_dof_values.get()); + + std::copy(std::begin(double_dof_values.get()), + std::end(double_dof_values.get()), + std::begin(dof_values)); + } - std::copy(std::begin(double_dof_values.get()), - std::end(double_dof_values.get()), - std::begin(dof_values)); - } - }; - // In case of double simply call the finite element directly template - struct ConvertHelper + static void convert_helper( + const FiniteElement &finite_element, + const std::vector > &support_point_values, + std::vector &dof_values) { - static void convert_generalized_support_point_values_to_dof_values( - const FiniteElement &finite_element, - const std::vector > &support_point_values, - std::vector &dof_values) - { - finite_element.convert_generalized_support_point_values_to_dof_values( - support_point_values, dof_values); - } - }; + finite_element.convert_generalized_support_point_values_to_dof_values( + support_point_values, dof_values); + } } /* anonymous namespace */ @@ -2976,8 +2971,7 @@ namespace FETools finite_element.get_generalized_support_points().size()); AssertDimension(dof_values.size(), finite_element.dofs_per_cell); - ConvertHelper:: - convert_generalized_support_point_values_to_dof_values( + convert_helper( finite_element, support_point_values, dof_values); }