From a69942b2f2511e9886b246b1e8663f2e4d8f823c Mon Sep 17 00:00:00 2001 From: bangerth Date: Wed, 24 Aug 2011 19:22:00 +0000 Subject: [PATCH] Move the creation of the FEValues out of the inner loop so that we can reuse things. Needs a bit of effort since we have to deal with hp-DoFHandlers, but nothing too difficult. git-svn-id: https://svn.dealii.org/trunk@24184 0785d39b-7218-0410-832d-ea1e28bc413d --- .../deal.II/numerics/vectors.templates.h | 52 ++++++++++++++----- 1 file changed, 38 insertions(+), 14 deletions(-) diff --git a/deal.II/include/deal.II/numerics/vectors.templates.h b/deal.II/include/deal.II/numerics/vectors.templates.h index b75d91c0e7..9763b62fc9 100644 --- a/deal.II/include/deal.II/numerics/vectors.templates.h +++ b/deal.II/include/deal.II/numerics/vectors.templates.h @@ -4172,6 +4172,40 @@ compute_no_normal_flux_constraints (const DH &dof_handler, std::vector face_dofs; + // create FE and mapping + // collections for all elements in + // use by this DoFHandler + hp::FECollection fe_collection (dof_handler.get_fe()); + hp::MappingCollection mapping_collection; + for (unsigned int i=0; i face_quadrature_collection; + for (unsigned int i=0; i > & + unit_support_points = fe_collection[i].get_unit_face_support_points(); + + Assert (unit_support_points.size() == fe_collection[i].dofs_per_face, + ExcInternalError()); + + face_quadrature_collection + .push_back (Quadrature (unit_support_points)); + } + + // now create the object with which + // we will generate the normal + // vectors + hp::FEFaceValues x_fe_face_values (mapping_collection, + fe_collection, + face_quadrature_collection, + update_normal_vectors); + // have a map that stores normal // vectors for each vector-dof // tuple we want to @@ -4223,19 +4257,8 @@ compute_no_normal_flux_constraints (const DH &dof_handler, face_dofs.resize (fe.dofs_per_face); face->get_dof_indices (face_dofs, cell->active_fe_index()); - // ...and the normal - // vectors at the locations - // where they are defined: - const std::vector > & - unit_support_points = fe.get_unit_face_support_points(); - - Assert (unit_support_points.size() == fe.dofs_per_face, - ExcInternalError()); - - const Quadrature aux_quad (unit_support_points); - FEFaceValues fe_values (mapping, fe, aux_quad, - update_normal_vectors); - fe_values.reinit(cell, face_no); + x_fe_face_values.reinit (cell, face_no); + const FEFaceValues &fe_values = x_fe_face_values.get_present_fe_values(); // then identify which of // them correspond to the @@ -4253,7 +4276,8 @@ compute_no_normal_flux_constraints (const DH &dof_handler, for (unsigned int k=0; kactive_fe_index()].point(k) == + face_quadrature_collection[cell->active_fe_index()].point(i)) && (fe.face_system_to_component_index(k).first >= first_vector_component) -- 2.39.5