From fd1a439aa978d89fa8574281395c5db596cf5159 Mon Sep 17 00:00:00 2001 From: Wolfgang Bangerth Date: Thu, 10 Sep 2015 14:35:38 -0500 Subject: [PATCH] Move an internal function to the only class that now still uses it. --- include/deal.II/fe/mapping_q_generic.h | 18 ----------- source/fe/mapping_q1.cc | 42 +++++++++++++++++++++++--- source/fe/mapping_q_generic.cc | 19 ------------ 3 files changed, 38 insertions(+), 41 deletions(-) diff --git a/include/deal.II/fe/mapping_q_generic.h b/include/deal.II/fe/mapping_q_generic.h index 5eae7b0f9e..f7b4ae5afd 100644 --- a/include/deal.II/fe/mapping_q_generic.h +++ b/include/deal.II/fe/mapping_q_generic.h @@ -468,24 +468,6 @@ protected: compute_mapping_support_points (const typename Triangulation::cell_iterator &cell, std::vector > &a) const = 0; - /** - * Transforms a point @p p on the unit cell to the point @p p_real on the - * real cell @p cell and returns @p p_real. - * - * This function is called by @p transform_unit_to_real_cell and multiple - * times (through the Newton iteration) by @p - * transform_real_to_unit_cell_internal. - * - * Takes a reference to an @p InternalData that must already include the - * shape values at point @p p and the mapping support points of the cell. - * - * This @p InternalData argument avoids multiple computations of the shape - * values at point @p p and especially multiple computations of the mapping - * support points. - */ - Point - transform_unit_to_real_cell_internal (const InternalData &mdata) const; - /** * Make MappingQ a friend since it needs to call the * fill_fe_values() functions on its MappingQ1 sub-object. diff --git a/source/fe/mapping_q1.cc b/source/fe/mapping_q1.cc index f52b098027..e3671b7a68 100644 --- a/source/fe/mapping_q1.cc +++ b/source/fe/mapping_q1.cc @@ -475,6 +475,40 @@ transform_real_to_unit_cell (const typename Triangulation::cell_it } +namespace +{ + /** + * Transforms a point @p p on the unit cell to the point @p p_real on the + * real cell @p cell and returns @p p_real. + * + * This function is called by @p transform_unit_to_real_cell and multiple + * times (through the Newton iteration) by @p + * transform_real_to_unit_cell_internal. + * + * Takes a reference to an @p InternalData that must already include the + * shape values at point @p p and the mapping support points of the cell. + * + * This @p InternalData argument avoids multiple computations of the shape + * values at point @p p and especially multiple computations of the mapping + * support points. + */ + template + Point + transform_unit_to_real_cell_internal (const typename MappingQ1::InternalData &data) + { + AssertDimension (data.shape_values.size(), + data.mapping_support_points.size()); + + // use now the InternalData to + // compute the point in real space. + Point p_real; + for (unsigned int i=0; i Point @@ -508,7 +542,7 @@ transform_real_to_unit_cell_internal mdata.compute_shape_function_values(std::vector > (1, p_unit)); - Point p_real = transform_unit_to_real_cell_internal(mdata); + Point p_real = transform_unit_to_real_cell_internal(mdata); Tensor<1,spacedim> f = p_real-p; // early out if we already have our point @@ -597,7 +631,7 @@ transform_real_to_unit_cell_internal mdata.compute_shape_function_values(std::vector > (1, p_unit_trial)); // f(x) - Point p_real_trial = transform_unit_to_real_cell_internal(mdata); + Point p_real_trial = transform_unit_to_real_cell_internal(mdata); const Tensor<1,spacedim> f_trial = p_real_trial-p; #ifdef DEBUG_TRANSFORM_REAL_TO_UNIT_CELL @@ -753,7 +787,7 @@ transform_real_to_unit_cell_internal_codim1 } p_minus_F = p; - p_minus_F -= transform_unit_to_real_cell_internal(mdata); + p_minus_F -= transform_unit_to_real_cell_internal(mdata); for (unsigned int j=0; j(mdata); for (unsigned int j=0; j::cell_it -template -Point -MappingQGeneric:: -transform_unit_to_real_cell_internal (const InternalData &data) const -{ - AssertDimension (data.shape_values.size(), - data.mapping_support_points.size()); - - // use now the InternalData to - // compute the point in real space. - Point p_real; - for (unsigned int i=0; i UpdateFlags MappingQGeneric::requires_update_flags (const UpdateFlags in) const -- 2.39.5