From: Wolfgang Bangerth Date: Wed, 16 Sep 2015 22:14:07 +0000 (-0500) Subject: Move more things out of MappingQ1 that don't need to be there. X-Git-Tag: v8.4.0-rc2~398^2~2 X-Git-Url: https://gitweb.dealii.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=0d4d41b8694b836bbf1861f24a5d20b09fae00ef;p=dealii.git Move more things out of MappingQ1 that don't need to be there. --- diff --git a/include/deal.II/fe/mapping_q1.h b/include/deal.II/fe/mapping_q1.h index ee4fbf1f0b..91be437bb8 100644 --- a/include/deal.II/fe/mapping_q1.h +++ b/include/deal.II/fe/mapping_q1.h @@ -78,41 +78,6 @@ public: /** * @} */ - - - /** - * @name Interface with FEValues - * @{ - */ - -public: - /** - * Use the InternalData class of the base class without modification - * and additions. - */ - typedef typename MappingQGeneric::InternalData InternalData; - - /** - * @} - */ - -protected: - - /** - * Computes the support points of the mapping. For @p MappingQ1 these are - * the vertices, as obtained by calling Mapping::get_vertices(). - * - * By default, that function just computes the locations of the vertices as - * reported by the Triangulation. However, other classes may override this - * function. In particular, the MappingQ1Eulerian class does exactly this by - * not computing the support points from the geometry of the current cell but - * instead evaluating an externally given displacement field in addition to - * the geometry of the cell. - */ - virtual - void - compute_mapping_support_points(const typename Triangulation::cell_iterator &cell, - std::vector > &a) const; }; diff --git a/include/deal.II/fe/mapping_q1_eulerian.h b/include/deal.II/fe/mapping_q1_eulerian.h index 289a0a8f6f..bd2e3078a5 100644 --- a/include/deal.II/fe/mapping_q1_eulerian.h +++ b/include/deal.II/fe/mapping_q1_eulerian.h @@ -101,7 +101,10 @@ public: const DoFHandler &shiftmap_dof_handler); /** - * Return the mapped vertices of the cell. + * Return the mapped vertices of the cell. For the current class, this function does + * not use the support points from the geometry of the current cell but + * instead evaluates an externally given displacement field in addition to + * the geometry of the cell. */ virtual std_cxx11::array, GeometryInfo::vertices_per_cell> @@ -146,6 +149,15 @@ protected: const typename Mapping::InternalDataBase &internal_data, internal::FEValues::MappingRelatedData &output_data) const; + /** + * Compute the support points of the mapping. For the current class, these are + * the vertices, as obtained by calling Mapping::get_vertices(). + */ + virtual + void + compute_mapping_support_points(const typename Triangulation::cell_iterator &cell, + std::vector > &a) const; + /** * Reference to the vector of shifts. */ diff --git a/source/fe/mapping_q1.cc b/source/fe/mapping_q1.cc index b375941d9b..c4684cd5c3 100644 --- a/source/fe/mapping_q1.cc +++ b/source/fe/mapping_q1.cc @@ -181,22 +181,6 @@ namespace internal -template -void -MappingQ1::compute_mapping_support_points( - const typename Triangulation::cell_iterator &cell, - std::vector > &a) const -{ - std_cxx11::array, GeometryInfo::vertices_per_cell> - vertices = this->get_vertices(cell); - - a.resize(GeometryInfo::vertices_per_cell); - for (unsigned int i=0; i::vertices_per_cell; ++i) - a[i] = vertices[i]; -} - - - /** * Compute an initial guess to pass to the Newton method in * transform_real_to_unit_cell. For the initial guess we proceed in the @@ -453,7 +437,8 @@ transform_real_to_unit_cell (const typename Triangulation::cell_it //MappingQ1. this doesn't currently work because we here really need //a Q1 InternalData, but MappingQGeneric produces one with the //polynomial degree of the MappingQ - std_cxx11::unique_ptr mdata (new InternalData(1)); + std_cxx11::unique_ptr::InternalData> + mdata (new typename MappingQGeneric::InternalData(1)); mdata->initialize (this->requires_update_flags (update_flags), point_quadrature, 1); compute_mapping_support_points (cell, mdata->mapping_support_points); diff --git a/source/fe/mapping_q1_eulerian.cc b/source/fe/mapping_q1_eulerian.cc index 9d2e75b536..4393d813cb 100644 --- a/source/fe/mapping_q1_eulerian.cc +++ b/source/fe/mapping_q1_eulerian.cc @@ -88,6 +88,24 @@ get_vertices +template +void +MappingQ1Eulerian:: +compute_mapping_support_points(const typename Triangulation::cell_iterator &cell, + std::vector > &a) const +{ + const std_cxx11::array, GeometryInfo::vertices_per_cell> + vertices = this->get_vertices(cell); + + a.resize(GeometryInfo::vertices_per_cell); + for (unsigned int i=0; i::vertices_per_cell; ++i) + a[i] = vertices[i]; +} + + + + + template MappingQ1Eulerian * MappingQ1Eulerian::clone () const