From 00a20938feb6a633e41255a8b058ee1bf81a07ae Mon Sep 17 00:00:00 2001 From: Wolfgang Bangerth Date: Wed, 12 Aug 2015 09:39:16 -0500 Subject: [PATCH] Make MappingFEField use only update_each. This is the exact equivalent to #1337 (commit 04430b5) but for MappingFEField. The logic there seems to simply have been copied from MappingQ1, so this was easy (and passes the testsuite). --- source/fe/mapping_fe_field.cc | 53 +++++++++++++++-------------------- 1 file changed, 22 insertions(+), 31 deletions(-) diff --git a/source/fe/mapping_fe_field.cc b/source/fe/mapping_fe_field.cc index e942f7a839..2a51d304cb 100644 --- a/source/fe/mapping_fe_field.cc +++ b/source/fe/mapping_fe_field.cc @@ -125,27 +125,10 @@ MappingFEField::compute_shapes_virtual ( template UpdateFlags -MappingFEField::update_once (const UpdateFlags in) const +MappingFEField::update_once (const UpdateFlags) const { - UpdateFlags out = UpdateFlags(in & (update_transformation_values - | update_transformation_gradients)); - - // Shape function values - if (in & update_quadrature_points) - out |= update_transformation_values; - - // Shape function gradients - if (in & (update_covariant_transformation - | update_contravariant_transformation - | update_JxW_values - | update_boundary_forms - | update_normal_vectors - | update_jacobians - | update_jacobian_grads - | update_inverse_jacobians)) - out |= update_transformation_gradients; - - return out; + // nothing here + return update_default; } @@ -239,10 +222,19 @@ MappingFEField::compute_data (const UpdateFlags upd const UpdateFlags flags(data.update_flags); - if (flags & update_transformation_values) + // see if we need the (transformation) shape function values + // and/or gradients and resize the necessary arrays + if (flags & update_quadrature_points) data.shape_values.resize(data.n_shape_functions * n_q_points); - if (flags & update_transformation_gradients) + if (flags & (update_covariant_transformation + | update_contravariant_transformation + | update_JxW_values + | update_boundary_forms + | update_normal_vectors + | update_jacobians + | update_jacobian_grads + | update_inverse_jacobians)) data.shape_derivatives.resize(data.n_shape_functions * n_q_points); if (flags & update_covariant_transformation) @@ -390,7 +382,7 @@ namespace internal const std::vector &fe_to_real, std::vector > &quadrature_points) { - const UpdateFlags update_flags(data.current_update_flags()); + const UpdateFlags update_flags = data.update_each; if (update_flags & update_quadrature_points) { @@ -427,7 +419,7 @@ namespace internal const ComponentMask &fe_mask, const std::vector &fe_to_real) { - const UpdateFlags update_flags(data.current_update_flags()); + const UpdateFlags update_flags = data.update_each; // then Jacobians if (update_flags & update_contravariant_transformation) @@ -497,7 +489,7 @@ namespace internal const std::vector &fe_to_real, std::vector > &jacobian_grads) { - const UpdateFlags update_flags(data.current_update_flags()); + const UpdateFlags update_flags = data.update_each; if (update_flags & update_jacobian_grads) { const unsigned int n_q_points = jacobian_grads.size(); @@ -551,7 +543,7 @@ namespace internal const typename dealii::MappingFEField::InternalData &data, internal::FEValues::MappingRelatedData &output_data) { - const UpdateFlags update_flags(data.current_update_flags()); + const UpdateFlags update_flags = data.update_each; if (update_flags & update_boundary_forms) { @@ -749,7 +741,7 @@ fill_fe_values (const typename Triangulation::cell_iterator &cell, QProjector::DataSetDescriptor::cell (), data, *fe, fe_mask, fe_to_real); - const UpdateFlags update_flags(data.current_update_flags()); + const UpdateFlags update_flags = data.update_each; const std::vector &weights=quadrature.get_weights(); // Multiply quadrature weights by absolute value of Jacobian determinants or @@ -1080,8 +1072,8 @@ transform_unit_to_real_cell (const typename Triangulation::cell_it // the right size and transformation shape values already computed at point // p. const Quadrature point_quadrature(p); - std_cxx11::unique_ptr - mdata (get_data(update_transformation_values, point_quadrature)); + std_cxx11::unique_ptr mdata (get_data(update_quadrature_points | update_jacobians, + point_quadrature)); update_internal_dofs(cell, *mdata); @@ -1138,7 +1130,7 @@ transform_real_to_unit_cell (const typename Triangulation::cell_it const Quadrature point_quadrature(initial_p_unit); - UpdateFlags update_flags = update_transformation_values|update_transformation_gradients; + UpdateFlags update_flags = update_quadrature_points | update_jacobians; if (spacedim>dim) update_flags |= update_jacobian_grads; std_cxx11::unique_ptr @@ -1259,7 +1251,6 @@ failure: } - template unsigned int MappingFEField::get_degree() const -- 2.39.5