From 0527ecb039af9065fd7baac0b5f96c42ed2a3376 Mon Sep 17 00:00:00 2001 From: Jonathan Robey Date: Tue, 30 Aug 2016 19:57:10 -0700 Subject: [PATCH] Duplicate approach for FEFaceValues and FESubfaceValues --- source/fe/fe_values.cc | 60 ++++++++++++++++++++++++++---------------- 1 file changed, 37 insertions(+), 23 deletions(-) diff --git a/source/fe/fe_values.cc b/source/fe/fe_values.cc index 7ddb230907..5c5f0d8238 100644 --- a/source/fe/fe_values.cc +++ b/source/fe/fe_values.cc @@ -3902,7 +3902,8 @@ FEFaceValues::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 @@ -3915,16 +3916,19 @@ FEFaceValues::initialize (const UpdateFlags update_flags) this->quadrature, this->finite_element_output); Threads::Task::InternalDataBase *> - mapping_get_data = Threads::new_task (&Mapping::get_face_data, - *this->mapping, - flags, - this->quadrature); + mapping_get_data; + if (flags & update_mapping) + mapping_get_data = Threads::new_task (&Mapping::get_face_data, + *this->mapping, + flags, + this->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()); } @@ -3993,11 +3997,14 @@ void FEFaceValues::do_reinit (const unsigned int face_no) const typename Triangulation::cell_iterator cell=*this->present_cell; this->present_face_index=cell->face_index(face_no); - this->get_mapping().fill_fe_face_values(*this->present_cell, - face_no, - this->quadrature, - *this->mapping_data, - this->mapping_output); + if (this->update_flags & update_mapping) + { + this->get_mapping().fill_fe_face_values(*this->present_cell, + face_no, + this->quadrature, + *this->mapping_data, + this->mapping_output); + } this->get_fe().fill_fe_face_values(*this->present_cell, face_no, @@ -4061,7 +4068,8 @@ FESubfaceValues::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 @@ -4075,16 +4083,19 @@ FESubfaceValues::initialize (const UpdateFlags update_flags) this->quadrature, this->finite_element_output); Threads::Task::InternalDataBase *> - mapping_get_data = Threads::new_task (&Mapping::get_subface_data, - *this->mapping, - flags, - this->quadrature); + mapping_get_data; + if (flags & update_mapping) + mapping_get_data = Threads::new_task (&Mapping::get_subface_data, + *this->mapping, + flags, + this->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()); } @@ -4237,12 +4248,15 @@ void FESubfaceValues::do_reinit (const unsigned int face_no, } // now ask the mapping and the finite element to do the actual work - this->get_mapping().fill_fe_subface_values(*this->present_cell, - face_no, - subface_no, - this->quadrature, - *this->mapping_data, - this->mapping_output); + if (this->update_flags & update_mapping) + { + this->get_mapping().fill_fe_subface_values(*this->present_cell, + face_no, + subface_no, + this->quadrature, + *this->mapping_data, + this->mapping_output); + } this->get_fe().fill_fe_subface_values(*this->present_cell, face_no, -- 2.39.5