From d7f2d7b4463de30a9d1eb1827694d3f264940f4b Mon Sep 17 00:00:00 2001 From: Wolfgang Bangerth Date: Wed, 28 Oct 2015 16:54:51 -0500 Subject: [PATCH] Move a few pieces to a more natural place. --- include/deal.II/fe/mapping_q_eulerian.h | 71 +++++++++++++------------ source/fe/mapping_q_eulerian.cc | 30 +++++------ 2 files changed, 49 insertions(+), 52 deletions(-) diff --git a/include/deal.II/fe/mapping_q_eulerian.h b/include/deal.II/fe/mapping_q_eulerian.h index 9964d19c07..a2c57827f6 100644 --- a/include/deal.II/fe/mapping_q_eulerian.h +++ b/include/deal.II/fe/mapping_q_eulerian.h @@ -175,41 +175,6 @@ protected: private: - /** - * Special quadrature rule used to define the support points in the - * reference configuration. - */ - - class SupportQuadrature : public Quadrature - { - public: - /** - * Constructor, with an argument defining the desired polynomial degree. - */ - - SupportQuadrature (const unsigned int map_degree); - - }; - - /** - * A member variable holding the quadrature points in the right order. - */ - const SupportQuadrature support_quadrature; - - /** - * FEValues object used to query the the given finite element field at the - * support points in the reference configuration. - * - * The variable is marked as mutable since we have to call FEValues::reinit - * from compute_mapping_support_points, a function that is 'const'. - */ - mutable FEValues fe_values; - - /** - * A variable to guard access to the fe_values variable. - */ - mutable Threads::Mutex fe_values_mutex; - /** * A class derived from MappingQGeneric that provides the generic * mapping with support points on boundary objects so that the @@ -249,6 +214,42 @@ private: * Reference to the surrounding object off of which we live. */ const MappingQEulerian &mapping_q_eulerian; + + + /** + * Special quadrature rule used to define the support points in the + * reference configuration. + */ + + class SupportQuadrature : public Quadrature + { + public: + /** + * Constructor, with an argument defining the desired polynomial degree. + */ + + SupportQuadrature (const unsigned int map_degree); + + }; + + /** + * A member variable holding the quadrature points in the right order. + */ + const SupportQuadrature support_quadrature; + + /** + * FEValues object used to query the the given finite element field at the + * support points in the reference configuration. + * + * The variable is marked as mutable since we have to call FEValues::reinit + * from compute_mapping_support_points, a function that is 'const'. + */ + mutable FEValues fe_values; + + /** + * A variable to guard access to the fe_values variable. + */ + mutable Threads::Mutex fe_values_mutex; }; }; diff --git a/source/fe/mapping_q_eulerian.cc b/source/fe/mapping_q_eulerian.cc index 60213ecb6b..672328a5b3 100644 --- a/source/fe/mapping_q_eulerian.cc +++ b/source/fe/mapping_q_eulerian.cc @@ -40,7 +40,11 @@ MappingQEulerianGeneric (const unsigned int degree, const MappingQEulerian &mapping_q_eulerian) : MappingQGeneric(degree), - mapping_q_eulerian (mapping_q_eulerian) + mapping_q_eulerian (mapping_q_eulerian), + support_quadrature(degree), + fe_values(mapping_q_eulerian.euler_dof_handler->get_fe(), + support_quadrature, + update_values | update_q_points) {} template @@ -51,11 +55,7 @@ MappingQEulerian (const unsigned int degree, : MappingQ(degree, true), euler_vector(&euler_vector), - euler_dof_handler(&euler_dof_handler), - support_quadrature(degree), - fe_values(euler_dof_handler.get_fe(), - support_quadrature, - update_values | update_q_points) + euler_dof_handler(&euler_dof_handler) { // reset the q1 mapping we use for interior cells (and previously // set by the MappingQ constructor) to a MappingQ1Eulerian with the @@ -77,11 +77,7 @@ MappingQEulerian (const unsigned int degree, : MappingQ(degree, true), euler_vector(&euler_vector), - euler_dof_handler(&euler_dof_handler), - support_quadrature(degree), - fe_values(euler_dof_handler.get_fe(), - support_quadrature, - update_values | update_q_points) + euler_dof_handler(&euler_dof_handler) { // reset the q1 mapping we use for interior cells (and previously // set by the MappingQ constructor) to a MappingQ1Eulerian with the @@ -109,7 +105,7 @@ MappingQEulerian::clone () const // .... SUPPORT QUADRATURE CONSTRUCTOR template -MappingQEulerian:: +MappingQEulerian::MappingQEulerianGeneric:: SupportQuadrature:: SupportQuadrature (const unsigned int map_degree) : @@ -206,7 +202,7 @@ compute_mapping_support_points (const typename Triangulation::cell // that. this implies that the user should order components appropriately, // or create a separate dof handler for the displacements. - const unsigned int n_support_pts = mapping_q_eulerian.support_quadrature.size(); + const unsigned int n_support_pts = support_quadrature.size(); const unsigned int n_components = mapping_q_eulerian.euler_dof_handler->get_fe().n_components(); Assert (n_components >= spacedim, ExcDimensionMismatch(n_components, spacedim) ); @@ -218,16 +214,16 @@ compute_mapping_support_points (const typename Triangulation::cell // fill shift vector for each support point using an fe_values object. make // sure that the fe_values variable isn't used simultaneously from different // threads - Threads::Mutex::ScopedLock lock(mapping_q_eulerian.fe_values_mutex); - mapping_q_eulerian.fe_values.reinit(dof_cell); - mapping_q_eulerian.fe_values.get_function_values(*mapping_q_eulerian.euler_vector, shift_vector); + Threads::Mutex::ScopedLock lock(fe_values_mutex); + fe_values.reinit(dof_cell); + fe_values.get_function_values(*mapping_q_eulerian.euler_vector, shift_vector); // and finally compute the positions of the support points in the deformed // configuration. std::vector > a(n_support_pts); for (unsigned int q=0; q