From: Jonathan Robey Date: Tue, 30 Aug 2016 22:00:10 +0000 (-0700) Subject: Set conditions on updating mapping data X-Git-Tag: v8.5.0-rc1~670^2~3 X-Git-Url: https://gitweb.dealii.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=615731133405cc5c7edc22085c4eaf3af62e328f;p=dealii.git Set conditions on updating mapping data --- diff --git a/include/deal.II/fe/fe_update_flags.h b/include/deal.II/fe/fe_update_flags.h index eaa7e27ef8..5477216581 100644 --- a/include/deal.II/fe/fe_update_flags.h +++ b/include/deal.II/fe/fe_update_flags.h @@ -207,7 +207,31 @@ enum UpdateFlags /** * Combination of the flags needed for Piola transform of Hdiv elements. */ - update_piola = update_volume_elements | update_contravariant_transformation + update_piola = update_volume_elements | update_contravariant_transformation, + /** + * Combination of the flags that require a mapping calculation + */ + update_mapping = + // Direct data + update_quadrature_points | + update_JxW_values | + update_jacobians | + update_jacobian_grads | + update_jacobian_pushed_forward_grads | + update_jacobian_2nd_derivatives | + update_jacobian_pushed_forward_2nd_derivatives | + update_jacobian_3rd_derivatives | + update_jacobian_pushed_forward_3rd_derivatives | + update_inverse_jacobians | + update_boundary_forms | + update_normal_vectors | + // Transformation dependence + update_covariant_transformation | + update_contravariant_transformation | + update_transformation_values | + update_transformation_gradients | + // Volume data + update_volume_elements }; diff --git a/source/fe/fe_values.cc b/source/fe/fe_values.cc index 5274b76bf9..7ddb230907 100644 --- a/source/fe/fe_values.cc +++ b/source/fe/fe_values.cc @@ -3653,7 +3653,8 @@ FEValues::initialize (const UpdateFlags update_flags) const UpdateFlags flags = this->compute_update_flags (update_flags); // initialize the base classes - this->mapping_output.initialize(this->n_quadrature_points, flags); + if (flags & update_mapping) + this->mapping_output.initialize(this->n_quadrature_points, flags); this->finite_element_output.initialize(this->n_quadrature_points, *this->fe, flags); // then get objects into which the FE and the Mapping can store @@ -3666,16 +3667,19 @@ FEValues::initialize (const UpdateFlags update_flags) quadrature, this->finite_element_output); Threads::Task::InternalDataBase *> - mapping_get_data = Threads::new_task (&Mapping::get_data, - *this->mapping, - flags, - quadrature); + mapping_get_data; + if (flags & update_mapping) + mapping_get_data = Threads::new_task (&Mapping::get_data, + *this->mapping, + flags, + quadrature); this->update_flags = flags; // then collect answers from the two task above this->fe_data.reset (fe_get_data.return_value()); - this->mapping_data.reset (mapping_get_data.return_value()); + if (flags & update_mapping) + this->mapping_data.reset (mapping_get_data.return_value()); } @@ -3772,12 +3776,15 @@ void FEValues::do_reinit () // specific to the mapping. also let it inspect the // cell similarity flag and, if necessary, update // it - this->cell_similarity - = this->get_mapping().fill_fe_values(*this->present_cell, - this->cell_similarity, - quadrature, - *this->mapping_data, - this->mapping_output); + if (this->update_flags & update_mapping) + { + this->cell_similarity + = this->get_mapping().fill_fe_values(*this->present_cell, + this->cell_similarity, + quadrature, + *this->mapping_data, + this->mapping_output); + } // then call the finite element and, with the data // already filled by the mapping, let it compute the