From a900d2a03099bc213f493335d3da9261ecc1dda5 Mon Sep 17 00:00:00 2001 From: Wolfgang Bangerth Date: Sun, 2 Aug 2015 17:07:40 -0500 Subject: [PATCH] Adjust all of the FiniteElement::fill_fe_*_values. Instead of a single FEValuesData object, they now get references to an internal::FEValues::MappingRelatedData object (which is marked as const, given that it is data that has previously been computed by the mapping) and to internal::FEValues::FiniteElementRelatedData (which is non-const, and which is where the finite elements put their results). --- include/deal.II/fe/fe.h | 65 +++----- include/deal.II/fe/fe_dgp_nonparametric.h | 59 ++++--- include/deal.II/fe/fe_face.h | 50 +++--- include/deal.II/fe/fe_nothing.h | 62 +++---- include/deal.II/fe/fe_poly.h | 51 +++--- include/deal.II/fe/fe_poly.templates.h | 68 ++++---- include/deal.II/fe/fe_poly_face.h | 51 +++--- include/deal.II/fe/fe_poly_face.templates.h | 69 ++++---- include/deal.II/fe/fe_poly_tensor.h | 50 +++--- include/deal.II/fe/fe_system.h | 94 +++++------ source/fe/fe_dgp_nonparametric.cc | 83 ++++----- source/fe/fe_face.cc | 57 ++++--- source/fe/fe_nothing.cc | 9 +- source/fe/fe_poly.cc | 110 ++++++------ source/fe/fe_poly_tensor.cc | 176 ++++++++++---------- source/fe/fe_system.cc | 142 ++++++++-------- source/fe/fe_values.cc | 3 + 17 files changed, 613 insertions(+), 586 deletions(-) diff --git a/include/deal.II/fe/fe.h b/include/deal.II/fe/fe.h index 1491521bd2..700f10b5be 100644 --- a/include/deal.II/fe/fe.h +++ b/include/deal.II/fe/fe.h @@ -2051,54 +2051,39 @@ protected: const Mapping &mapping, const Quadrature &quadrature) const; - /** - * Fill the fields of FEValues. This function performs all the operations - * needed to compute the data of an FEValues object. - * - * The same function in @p mapping must have been called for the same cell - * first! - */ - virtual void + virtual + void fill_fe_values (const Mapping &mapping, const typename Triangulation::cell_iterator &cell, const Quadrature &quadrature, - const typename Mapping::InternalDataBase &mapping_internal, - const typename Mapping::InternalDataBase &fe_internal, - FEValuesData &data, + const typename Mapping::InternalDataBase &mapping_internal, + const typename Mapping::InternalDataBase &fe_internal, + const internal::FEValues::MappingRelatedData &mapping_data, + internal::FEValues::FiniteElementRelatedData &output_data, const CellSimilarity::Similarity cell_similarity) const = 0; - /** - * Fill the fields of FEFaceValues. This function performs all the - * operations needed to compute the data of an FEFaceValues object. - * - * The same function in @p mapping must have been called for the same cell - * first! - */ - virtual void - fill_fe_face_values (const Mapping &mapping, + virtual + void + fill_fe_face_values (const Mapping &mapping, const typename Triangulation::cell_iterator &cell, - const unsigned int face_no, - const Quadrature &quadrature, - const typename Mapping::InternalDataBase &mapping_internal, - const typename Mapping::InternalDataBase &fe_internal, - FEValuesData &data) const = 0; + const unsigned int face_no, + const Quadrature &quadrature, + const typename Mapping::InternalDataBase &mapping_internal, + const typename Mapping::InternalDataBase &fe_internal, + const internal::FEValues::MappingRelatedData &mapping_data, + internal::FEValues::FiniteElementRelatedData &output_data) const = 0; - /** - * Fill the fields of FESubfaceValues. This function performs all the - * operations needed to compute the data of an FESubfaceValues object. - * - * The same function in @p mapping must have been called for the same cell - * first! - */ - virtual void - fill_fe_subface_values (const Mapping &mapping, + virtual + void + fill_fe_subface_values (const Mapping &mapping, const typename Triangulation::cell_iterator &cell, - const unsigned int face_no, - const unsigned int sub_no, - const Quadrature &quadrature, - const typename Mapping::InternalDataBase &mapping_internal, - const typename Mapping::InternalDataBase &fe_internal, - FEValuesData &data) const = 0; + const unsigned int face_no, + const unsigned int sub_no, + const Quadrature &quadrature, + const typename Mapping::InternalDataBase &mapping_internal, + const typename Mapping::InternalDataBase &fe_internal, + const internal::FEValues::MappingRelatedData &mapping_data, + internal::FEValues::FiniteElementRelatedData &output_data) const = 0; friend class InternalDataBase; friend class FEValuesBase; diff --git a/include/deal.II/fe/fe_dgp_nonparametric.h b/include/deal.II/fe/fe_dgp_nonparametric.h index 6dd38bdbd4..079fb90064 100644 --- a/include/deal.II/fe/fe_dgp_nonparametric.h +++ b/include/deal.II/fe/fe_dgp_nonparametric.h @@ -529,42 +529,39 @@ protected: const Mapping &mapping, const Quadrature &quadrature) const; - /** - * Implementation of the same function in FiniteElement. - */ - virtual void - fill_fe_values (const Mapping &mapping, + virtual + void + fill_fe_values (const Mapping &mapping, const typename Triangulation::cell_iterator &cell, - const Quadrature &quadrature, - const typename Mapping::InternalDataBase &mapping_internal, - const typename Mapping::InternalDataBase &fe_internal, - FEValuesData &data, - const CellSimilarity::Similarity cell_similarity) const; + const Quadrature &quadrature, + const typename Mapping::InternalDataBase &mapping_internal, + const typename Mapping::InternalDataBase &fe_internal, + const internal::FEValues::MappingRelatedData &mapping_data, + internal::FEValues::FiniteElementRelatedData &output_data, + const CellSimilarity::Similarity cell_similarity) const; - /** - * Implementation of the same function in FiniteElement. - */ - virtual void - fill_fe_face_values (const Mapping &mapping, + virtual + void + fill_fe_face_values (const Mapping &mapping, const typename Triangulation::cell_iterator &cell, - const unsigned int face_no, - const Quadrature &quadrature, - const typename Mapping::InternalDataBase &mapping_internal, - const typename Mapping::InternalDataBase &fe_internal, - FEValuesData &data) const; + const unsigned int face_no, + const Quadrature &quadrature, + const typename Mapping::InternalDataBase &mapping_internal, + const typename Mapping::InternalDataBase &fe_internal, + const internal::FEValues::MappingRelatedData &mapping_data, + internal::FEValues::FiniteElementRelatedData &output_data) const; - /** - * Implementation of the same function in FiniteElement. - */ - virtual void - fill_fe_subface_values (const Mapping &mapping, + virtual + void + fill_fe_subface_values (const Mapping &mapping, const typename Triangulation::cell_iterator &cell, - const unsigned int face_no, - const unsigned int sub_no, - const Quadrature &quadrature, - const typename Mapping::InternalDataBase &mapping_internal, - const typename Mapping::InternalDataBase &fe_internal, - FEValuesData &data) const; + const unsigned int face_no, + const unsigned int sub_no, + const Quadrature &quadrature, + const typename Mapping::InternalDataBase &mapping_internal, + const typename Mapping::InternalDataBase &fe_internal, + const internal::FEValues::MappingRelatedData &mapping_data, + internal::FEValues::FiniteElementRelatedData &output_data) const; private: diff --git a/include/deal.II/fe/fe_face.h b/include/deal.II/fe/fe_face.h index da5f3ddc99..31fb8f1d3a 100644 --- a/include/deal.II/fe/fe_face.h +++ b/include/deal.II/fe/fe_face.h @@ -243,33 +243,39 @@ protected: const Mapping<1,spacedim> &mapping, const Quadrature<0> &quadrature) const; - virtual void - fill_fe_values (const Mapping<1,spacedim> &mapping, + virtual + void + fill_fe_values (const Mapping<1,spacedim> &mapping, const typename Triangulation<1,spacedim>::cell_iterator &cell, - const Quadrature<1> &quadrature, - const typename Mapping<1,spacedim>::InternalDataBase &mapping_internal, - const typename Mapping<1,spacedim>::InternalDataBase &fe_internal, - FEValuesData<1,spacedim> &data, - const CellSimilarity::Similarity cell_similarity) const; + const Quadrature<1> &quadrature, + const typename Mapping<1,spacedim>::InternalDataBase &mapping_internal, + const typename Mapping<1,spacedim>::InternalDataBase &fe_internal, + const internal::FEValues::MappingRelatedData<1,spacedim> &mapping_data, + internal::FEValues::FiniteElementRelatedData<1,spacedim> &output_data, + const CellSimilarity::Similarity cell_similarity) const; - virtual void - fill_fe_face_values (const Mapping<1,spacedim> &mapping, + virtual + void + fill_fe_face_values (const Mapping<1,spacedim> &mapping, const typename Triangulation<1,spacedim>::cell_iterator &cell, - const unsigned int face_no, - const Quadrature<0> &quadrature, - const typename Mapping<1,spacedim>::InternalDataBase &mapping_internal, - const typename Mapping<1,spacedim>::InternalDataBase &fe_internal, - FEValuesData<1,spacedim> &data) const; + const unsigned int face_no, + const Quadrature<0> &quadrature, + const typename Mapping<1,spacedim>::InternalDataBase &mapping_internal, + const typename Mapping<1,spacedim>::InternalDataBase &fe_internal, + const internal::FEValues::MappingRelatedData<1,spacedim> &mapping_data, + internal::FEValues::FiniteElementRelatedData<1,spacedim> &output_data) const; - virtual void - fill_fe_subface_values (const Mapping<1,spacedim> &mapping, + virtual + void + fill_fe_subface_values (const Mapping<1,spacedim> &mapping, const typename Triangulation<1,spacedim>::cell_iterator &cell, - const unsigned int face_no, - const unsigned int sub_no, - const Quadrature<0> &quadrature, - const typename Mapping<1,spacedim>::InternalDataBase &mapping_internal, - const typename Mapping<1,spacedim>::InternalDataBase &fe_internal, - FEValuesData<1,spacedim> &data) const; + const unsigned int face_no, + const unsigned int sub_no, + const Quadrature<0> &quadrature, + const typename Mapping<1,spacedim>::InternalDataBase &mapping_internal, + const typename Mapping<1,spacedim>::InternalDataBase &fe_internal, + const internal::FEValues::MappingRelatedData<1,spacedim> &mapping_data, + internal::FEValues::FiniteElementRelatedData<1,spacedim> &output_data) const; /** diff --git a/include/deal.II/fe/fe_nothing.h b/include/deal.II/fe/fe_nothing.h index 880d8edcf6..d41fc6a4cd 100644 --- a/include/deal.II/fe/fe_nothing.h +++ b/include/deal.II/fe/fe_nothing.h @@ -147,57 +147,39 @@ public: double shape_value (const unsigned int i, const Point &p) const; - /** - * Fill the fields of FEValues. This function performs all the operations - * needed to compute the data of an FEValues object. - * - * In the current case, this function returns no meaningful information, - * since the element has no degrees of freedom. - */ virtual void - fill_fe_values (const Mapping &mapping, + fill_fe_values (const Mapping &mapping, const typename Triangulation::cell_iterator &cell, - const Quadrature &quadrature, - const typename Mapping::InternalDataBase &mapping_data, - const typename Mapping::InternalDataBase &fedata, - FEValuesData &data, - const CellSimilarity::Similarity cell_similarity) const; + const Quadrature &quadrature, + const typename Mapping::InternalDataBase &mapping_internal, + const typename Mapping::InternalDataBase &fe_internal, + const internal::FEValues::MappingRelatedData &mapping_data, + internal::FEValues::FiniteElementRelatedData &output_data, + const CellSimilarity::Similarity cell_similarity) const; - /** - * Fill the fields of FEFaceValues. This function performs all the - * operations needed to compute the data of an FEFaceValues object. - * - * In the current case, this function returns no meaningful information, - * since the element has no degrees of freedom. - */ virtual void - fill_fe_face_values (const Mapping &mapping, + fill_fe_face_values (const Mapping &mapping, const typename Triangulation::cell_iterator &cell, - const unsigned int face, - const Quadrature & quadrature, - const typename Mapping::InternalDataBase &mapping_data, - const typename Mapping::InternalDataBase &fedata, - FEValuesData &data) const; + const unsigned int face_no, + const Quadrature &quadrature, + const typename Mapping::InternalDataBase &mapping_internal, + const typename Mapping::InternalDataBase &fe_internal, + const internal::FEValues::MappingRelatedData &mapping_data, + internal::FEValues::FiniteElementRelatedData &output_data) const; - /** - * Fill the fields of FESubFaceValues. This function performs all the - * operations needed to compute the data of an FESubFaceValues object. - * - * In the current case, this function returns no meaningful information, - * since the element has no degrees of freedom. - */ virtual void - fill_fe_subface_values (const Mapping &mapping, + fill_fe_subface_values (const Mapping &mapping, const typename Triangulation::cell_iterator &cell, - const unsigned int face, - const unsigned int subface, - const Quadrature & quadrature, - const typename Mapping::InternalDataBase &mapping_data, - const typename Mapping::InternalDataBase &fedata, - FEValuesData &data) const; + const unsigned int face_no, + const unsigned int sub_no, + const Quadrature &quadrature, + const typename Mapping::InternalDataBase &mapping_internal, + const typename Mapping::InternalDataBase &fe_internal, + const internal::FEValues::MappingRelatedData &mapping_data, + internal::FEValues::FiniteElementRelatedData &output_data) const; /** * Prepare internal data structures and fill in values independent of the diff --git a/include/deal.II/fe/fe_poly.h b/include/deal.II/fe/fe_poly.h index b82cf5b530..4097495eec 100644 --- a/include/deal.II/fe/fe_poly.h +++ b/include/deal.II/fe/fe_poly.h @@ -168,34 +168,39 @@ protected: const Mapping &mapping, const Quadrature &quadrature) const; - virtual void - fill_fe_values (const Mapping &mapping, + virtual + void + fill_fe_values (const Mapping &mapping, const typename Triangulation::cell_iterator &cell, - const Quadrature &quadrature, - const typename Mapping::InternalDataBase &mapping_internal, - const typename Mapping::InternalDataBase &fe_internal, - FEValuesData &data, - const CellSimilarity::Similarity cell_similarity) const; + const Quadrature &quadrature, + const typename Mapping::InternalDataBase &mapping_internal, + const typename Mapping::InternalDataBase &fe_internal, + const internal::FEValues::MappingRelatedData &mapping_data, + internal::FEValues::FiniteElementRelatedData &output_data, + const CellSimilarity::Similarity cell_similarity) const; - virtual void - fill_fe_face_values (const Mapping &mapping, + virtual + void + fill_fe_face_values (const Mapping &mapping, const typename Triangulation::cell_iterator &cell, - const unsigned int face_no, - const Quadrature &quadrature, - const typename Mapping::InternalDataBase &mapping_internal, - const typename Mapping::InternalDataBase &fe_internal, - FEValuesData &data) const; + const unsigned int face_no, + const Quadrature &quadrature, + const typename Mapping::InternalDataBase &mapping_internal, + const typename Mapping::InternalDataBase &fe_internal, + const internal::FEValues::MappingRelatedData &mapping_data, + internal::FEValues::FiniteElementRelatedData &output_data) const; - virtual void - fill_fe_subface_values (const Mapping &mapping, + virtual + void + fill_fe_subface_values (const Mapping &mapping, const typename Triangulation::cell_iterator &cell, - const unsigned int face_no, - const unsigned int sub_no, - const Quadrature &quadrature, - const typename Mapping::InternalDataBase &mapping_internal, - const typename Mapping::InternalDataBase &fe_internal, - FEValuesData &data) const; - + const unsigned int face_no, + const unsigned int sub_no, + const Quadrature &quadrature, + const typename Mapping::InternalDataBase &mapping_internal, + const typename Mapping::InternalDataBase &fe_internal, + const internal::FEValues::MappingRelatedData &mapping_data, + internal::FEValues::FiniteElementRelatedData &output_data) const; /** * Determine the values that need to be computed on the unit cell to be able diff --git a/include/deal.II/fe/fe_poly.templates.h b/include/deal.II/fe/fe_poly.templates.h index 61b6e9fb02..3379671e62 100644 --- a/include/deal.II/fe/fe_poly.templates.h +++ b/include/deal.II/fe/fe_poly.templates.h @@ -247,14 +247,15 @@ FE_Poly::get_data (const UpdateFlags update_flags, template void -FE_Poly::fill_fe_values -(const Mapping &mapping, - const typename Triangulation::cell_iterator &cell, - const Quadrature &quadrature, - const typename Mapping::InternalDataBase &mapping_data, - const typename Mapping::InternalDataBase &fedata, - FEValuesData &data, - const CellSimilarity::Similarity cell_similarity) const +FE_Poly:: +fill_fe_values (const Mapping &mapping, + const typename Triangulation::cell_iterator &cell, + const Quadrature &quadrature, + const typename Mapping::InternalDataBase &mapping_internal, + const typename Mapping::InternalDataBase &fedata, + const internal::FEValues::MappingRelatedData &, + internal::FEValues::FiniteElementRelatedData &output_data, + const CellSimilarity::Similarity cell_similarity) const { // convert data object to internal // data for this class. fails with @@ -269,16 +270,18 @@ FE_Poly::fill_fe_values { if (flags & update_values) for (unsigned int i=0; icompute_2nd (mapping, cell, QProjector::DataSetDescriptor::cell(), - mapping_data, fe_data, data); + mapping_internal, fe_data, + output_data); } @@ -290,9 +293,10 @@ fill_fe_face_values (const Mapping &mapping, const typename Triangulation::cell_iterator &cell, const unsigned int face, const Quadrature &quadrature, - const typename Mapping::InternalDataBase &mapping_data, + const typename Mapping::InternalDataBase &mapping_internal, const typename Mapping::InternalDataBase &fedata, - FEValuesData &data) const + const internal::FEValues::MappingRelatedData &, + internal::FEValues::FiniteElementRelatedData &output_data) const { // convert data object to internal // data for this class. fails with @@ -318,16 +322,17 @@ fill_fe_face_values (const Mapping &mapping, { if (flags & update_values) for (unsigned int i=0; icompute_2nd (mapping, cell, offset, mapping_data, fe_data, data); + this->compute_2nd (mapping, cell, offset, mapping_internal, fe_data, + output_data); } @@ -400,14 +405,16 @@ fill_fe_face_values (const Mapping &mapping, template void -FE_Poly::fill_fe_subface_values (const Mapping &mapping, - const typename Triangulation::cell_iterator &cell, - const unsigned int face, - const unsigned int subface, - const Quadrature &quadrature, - const typename Mapping::InternalDataBase &mapping_data, - const typename Mapping::InternalDataBase &fedata, - FEValuesData &data) const +FE_Poly:: +fill_fe_subface_values (const Mapping &mapping, + const typename Triangulation::cell_iterator &cell, + const unsigned int face, + const unsigned int subface, + const Quadrature &quadrature, + const typename Mapping::InternalDataBase &mapping_internal, + const typename Mapping::InternalDataBase &fedata, + const internal::FEValues::MappingRelatedData &, + internal::FEValues::FiniteElementRelatedData &output_data) const { // convert data object to internal // data for this class. fails with @@ -434,16 +441,17 @@ FE_Poly::fill_fe_subface_values (const Mapping { if (flags & update_values) for (unsigned int i=0; icompute_2nd (mapping, cell, offset, mapping_data, fe_data, data); + this->compute_2nd (mapping, cell, offset, mapping_internal, fe_data, + output_data); } diff --git a/include/deal.II/fe/fe_poly_face.h b/include/deal.II/fe/fe_poly_face.h index 8f370c363f..28f9d23cdc 100644 --- a/include/deal.II/fe/fe_poly_face.h +++ b/include/deal.II/fe/fe_poly_face.h @@ -156,34 +156,39 @@ protected: const Mapping &mapping, const Quadrature& quadrature) const; - virtual void - fill_fe_values (const Mapping &mapping, + virtual + void + fill_fe_values (const Mapping &mapping, const typename Triangulation::cell_iterator &cell, - const Quadrature &quadrature, - const typename Mapping::InternalDataBase &mapping_internal, - const typename Mapping::InternalDataBase &fe_internal, - FEValuesData &data, - const CellSimilarity::Similarity cell_similarity) const; + const Quadrature &quadrature, + const typename Mapping::InternalDataBase &mapping_internal, + const typename Mapping::InternalDataBase &fe_internal, + const internal::FEValues::MappingRelatedData &mapping_data, + internal::FEValues::FiniteElementRelatedData &output_data, + const CellSimilarity::Similarity cell_similarity) const; - virtual void - fill_fe_face_values (const Mapping &mapping, + virtual + void + fill_fe_face_values (const Mapping &mapping, const typename Triangulation::cell_iterator &cell, - const unsigned int face_no, - const Quadrature &quadrature, - const typename Mapping::InternalDataBase &mapping_internal, - const typename Mapping::InternalDataBase &fe_internal, - FEValuesData &data) const; + const unsigned int face_no, + const Quadrature &quadrature, + const typename Mapping::InternalDataBase &mapping_internal, + const typename Mapping::InternalDataBase &fe_internal, + const internal::FEValues::MappingRelatedData &mapping_data, + internal::FEValues::FiniteElementRelatedData &output_data) const; - virtual void - fill_fe_subface_values (const Mapping &mapping, + virtual + void + fill_fe_subface_values (const Mapping &mapping, const typename Triangulation::cell_iterator &cell, - const unsigned int face_no, - const unsigned int sub_no, - const Quadrature &quadrature, - const typename Mapping::InternalDataBase &mapping_internal, - const typename Mapping::InternalDataBase &fe_internal, - FEValuesData &data) const; - + const unsigned int face_no, + const unsigned int sub_no, + const Quadrature &quadrature, + const typename Mapping::InternalDataBase &mapping_internal, + const typename Mapping::InternalDataBase &fe_internal, + const internal::FEValues::MappingRelatedData &mapping_data, + internal::FEValues::FiniteElementRelatedData &output_data) const; /** * Determine the values that need to be computed on the unit cell to be able diff --git a/include/deal.II/fe/fe_poly_face.templates.h b/include/deal.II/fe/fe_poly_face.templates.h index 22fe72a672..8b21146eb1 100644 --- a/include/deal.II/fe/fe_poly_face.templates.h +++ b/include/deal.II/fe/fe_poly_face.templates.h @@ -1,6 +1,6 @@ // --------------------------------------------------------------------- // -// Copyright (C) 2009 - 2014 by the deal.II authors +// Copyright (C) 2009 - 2015 by the deal.II authors // // This file is part of the deal.II library. // @@ -171,14 +171,15 @@ FE_PolyFace::get_subface_data ( //--------------------------------------------------------------------------- template void -FE_PolyFace::fill_fe_values -(const Mapping &, - const typename Triangulation::cell_iterator &, - const Quadrature &, - const typename Mapping::InternalDataBase &, - const typename Mapping::InternalDataBase &, - FEValuesData &, - const CellSimilarity::Similarity ) const +FE_PolyFace:: +fill_fe_values (const Mapping &, + const typename Triangulation::cell_iterator &, + const Quadrature &, + const typename Mapping::InternalDataBase &, + const typename Mapping::InternalDataBase &, + const internal::FEValues::MappingRelatedData &, + internal::FEValues::FiniteElementRelatedData &, + const CellSimilarity::Similarity ) const { // Do nothing, since we do not have // values in the interior @@ -188,14 +189,15 @@ FE_PolyFace::fill_fe_values template void -FE_PolyFace::fill_fe_face_values ( - const Mapping &, - const typename Triangulation::cell_iterator &, - const unsigned int face, - const Quadrature& quadrature, - const typename Mapping::InternalDataBase &, - const typename Mapping::InternalDataBase &fedata, - FEValuesData &data) const +FE_PolyFace:: +fill_fe_face_values (const Mapping &, + const typename Triangulation::cell_iterator &, + const unsigned int face, + const Quadrature& quadrature, + const typename Mapping::InternalDataBase &, + const typename Mapping::InternalDataBase &fedata, + const internal::FEValues::MappingRelatedData &, + internal::FEValues::FiniteElementRelatedData &output_data) const { // convert data object to internal // data for this class. fails with @@ -210,7 +212,7 @@ FE_PolyFace::fill_fe_face_values ( for (unsigned int i=0; idofs_per_cell; ++k) - data.shape_values(k,i) = 0.; + output_data.shape_values(k,i) = 0.; switch (dim) { case 3: @@ -220,7 +222,7 @@ FE_PolyFace::fill_fe_face_values ( { const unsigned int foffset = this->first_quad_index + this->dofs_per_quad * face; for (unsigned int k=0; kdofs_per_quad; ++k) - data.shape_values(foffset+k,i) = fe_data.shape_values[k+this->first_face_quad_index][i]; + output_data.shape_values(foffset+k,i) = fe_data.shape_values[k+this->first_face_quad_index][i]; } } case 2: @@ -232,7 +234,8 @@ FE_PolyFace::fill_fe_face_values ( for (unsigned int line=0; line::lines_per_face; ++line) { for (unsigned int k=0; kdofs_per_line; ++k) - data.shape_values(foffset+GeometryInfo::face_to_cell_lines(face, line)*this->dofs_per_line+k,i) = fe_data.shape_values[k+(line*this->dofs_per_line)+this->first_face_line_index][i]; + output_data.shape_values(foffset+GeometryInfo::face_to_cell_lines(face, line)*this->dofs_per_line+k,i) + = fe_data.shape_values[k+(line*this->dofs_per_line)+this->first_face_line_index][i]; } } } @@ -241,7 +244,8 @@ FE_PolyFace::fill_fe_face_values ( // Fill data for vertex shape functions if (this->dofs_per_vertex != 0) for (unsigned int lvertex=0; lvertex::vertices_per_face; ++lvertex) - data.shape_values(GeometryInfo::face_to_cell_vertices(face, lvertex),i) = fe_data.shape_values[lvertex][i]; + output_data.shape_values(GeometryInfo::face_to_cell_vertices(face, lvertex),i) + = fe_data.shape_values[lvertex][i]; break; } } @@ -251,15 +255,16 @@ FE_PolyFace::fill_fe_face_values ( template void -FE_PolyFace::fill_fe_subface_values ( - const Mapping &, - const typename Triangulation::cell_iterator &, - const unsigned int face, - const unsigned int subface, - const Quadrature& quadrature, - const typename Mapping::InternalDataBase &, - const typename Mapping::InternalDataBase &fedata, - FEValuesData &data) const +FE_PolyFace:: +fill_fe_subface_values (const Mapping &, + const typename Triangulation::cell_iterator &, + const unsigned int face, + const unsigned int subface, + const Quadrature& quadrature, + const typename Mapping::InternalDataBase &, + const typename Mapping::InternalDataBase &fedata, + const internal::FEValues::MappingRelatedData &, + internal::FEValues::FiniteElementRelatedData &output_data) const { // convert data object to internal // data for this class. fails with @@ -277,9 +282,9 @@ FE_PolyFace::fill_fe_subface_values ( for (unsigned int i=0; idofs_per_cell; ++k) - data.shape_values(k,i) = 0.; + output_data.shape_values(k,i) = 0.; for (unsigned int k=0; k &mapping, const Quadrature &quadrature) const; - virtual void - fill_fe_values (const Mapping &mapping, + virtual + void + fill_fe_values (const Mapping &mapping, const typename Triangulation::cell_iterator &cell, - const Quadrature &quadrature, - const typename Mapping::InternalDataBase &mapping_internal, - const typename Mapping::InternalDataBase &fe_internal, - FEValuesData &data, - const CellSimilarity::Similarity cell_similarity) const; + const Quadrature &quadrature, + const typename Mapping::InternalDataBase &mapping_internal, + const typename Mapping::InternalDataBase &fe_internal, + const internal::FEValues::MappingRelatedData &mapping_data, + internal::FEValues::FiniteElementRelatedData &output_data, + const CellSimilarity::Similarity cell_similarity) const; - virtual void - fill_fe_face_values (const Mapping &mapping, + virtual + void + fill_fe_face_values (const Mapping &mapping, const typename Triangulation::cell_iterator &cell, - const unsigned int face_no, - const Quadrature &quadrature, - const typename Mapping::InternalDataBase &mapping_internal, - const typename Mapping::InternalDataBase &fe_internal, - FEValuesData &data) const; + const unsigned int face_no, + const Quadrature &quadrature, + const typename Mapping::InternalDataBase &mapping_internal, + const typename Mapping::InternalDataBase &fe_internal, + const internal::FEValues::MappingRelatedData &mapping_data, + internal::FEValues::FiniteElementRelatedData &output_data) const; - virtual void - fill_fe_subface_values (const Mapping &mapping, + virtual + void + fill_fe_subface_values (const Mapping &mapping, const typename Triangulation::cell_iterator &cell, - const unsigned int face_no, - const unsigned int sub_no, - const Quadrature &quadrature, - const typename Mapping::InternalDataBase &mapping_internal, - const typename Mapping::InternalDataBase &fe_internal, - FEValuesData &data) const; + const unsigned int face_no, + const unsigned int sub_no, + const Quadrature &quadrature, + const typename Mapping::InternalDataBase &mapping_internal, + const typename Mapping::InternalDataBase &fe_internal, + const internal::FEValues::MappingRelatedData &mapping_data, + internal::FEValues::FiniteElementRelatedData &output_data) const; /** * Fields of cell-independent data for FE_PolyTensor. Stores the values of diff --git a/include/deal.II/fe/fe_system.h b/include/deal.II/fe/fe_system.h index 578fd8c38d..9efbc1ef32 100644 --- a/include/deal.II/fe/fe_system.h +++ b/include/deal.II/fe/fe_system.h @@ -812,52 +812,39 @@ protected: const Mapping &mapping, const Quadrature &quadrature) const; - /** - * Implementation of the same function in FiniteElement. - * - * Passes on control to @p compute_fill that does the work for all three - * fill_fe*_values functions. - */ - virtual void - fill_fe_values (const Mapping &mapping, + virtual + void + fill_fe_values (const Mapping &mapping, const typename Triangulation::cell_iterator &cell, - const Quadrature &quadrature, - const typename Mapping::InternalDataBase &mapping_data, - const typename Mapping::InternalDataBase &fe_data, - FEValuesData &data, - const CellSimilarity::Similarity cell_similarity) const; + const Quadrature &quadrature, + const typename Mapping::InternalDataBase &mapping_internal, + const typename Mapping::InternalDataBase &fe_internal, + const internal::FEValues::MappingRelatedData &mapping_data, + internal::FEValues::FiniteElementRelatedData &output_data, + const CellSimilarity::Similarity cell_similarity) const; - /** - * Implementation of the same function in FiniteElement. - * - * Passes on control to @p compute_fill that does the work for all three - * fill_fe*_values functions. - */ - virtual void - fill_fe_face_values (const Mapping &mapping, + virtual + void + fill_fe_face_values (const Mapping &mapping, const typename Triangulation::cell_iterator &cell, - const unsigned int face_no, - const Quadrature &quadrature, - const typename Mapping::InternalDataBase &mapping_data, - const typename Mapping::InternalDataBase &fe_data, - FEValuesData &data) const; + const unsigned int face_no, + const Quadrature &quadrature, + const typename Mapping::InternalDataBase &mapping_internal, + const typename Mapping::InternalDataBase &fe_internal, + const internal::FEValues::MappingRelatedData &mapping_data, + internal::FEValues::FiniteElementRelatedData &output_data) const; - /** - * Implementation of the same function in FiniteElement. - * - * Passes on control to @p compute_fill that does the work for all three - * fill_fe*_values functions. - */ - virtual void - fill_fe_subface_values (const Mapping &mapping, + virtual + void + fill_fe_subface_values (const Mapping &mapping, const typename Triangulation::cell_iterator &cell, - const unsigned int face_no, - const unsigned int sub_no, - const Quadrature &quadrature, - const typename Mapping::InternalDataBase &mapping_data, - const typename Mapping::InternalDataBase &fe_data, - FEValuesData &data) const; - + const unsigned int face_no, + const unsigned int sub_no, + const Quadrature &quadrature, + const typename Mapping::InternalDataBase &mapping_internal, + const typename Mapping::InternalDataBase &fe_internal, + const internal::FEValues::MappingRelatedData &mapping_data, + internal::FEValues::FiniteElementRelatedData &output_data) const; /** * Do the work for the three fill_fe*_values functions. @@ -876,9 +863,10 @@ protected: const unsigned int sub_no, const Quadrature &quadrature, const CellSimilarity::Similarity cell_similarity, - const typename Mapping::InternalDataBase &mapping_data, + const typename Mapping::InternalDataBase &mapping_internal, const typename Mapping::InternalDataBase &fe_data, - FEValuesData &data) const; + const internal::FEValues::MappingRelatedData &mapping_data, + internal::FEValues::FiniteElementRelatedData &output_data) const; private: @@ -1044,16 +1032,16 @@ private: */ template void - compute_fill_one_base ( - const Mapping &mapping, - const typename Triangulation::cell_iterator &cell, - const std::pair face_sub_no, - const Quadrature &quadrature, - const CellSimilarity::Similarity cell_similarity, - const std::pair::InternalDataBase *, - const typename Mapping::InternalDataBase *> mapping_data, - const unsigned int base_element, - FEValuesData &data) const; + compute_fill_one_base (const Mapping &mapping, + const typename Triangulation::cell_iterator &cell, + const std::pair face_sub_no, + const Quadrature &quadrature, + const CellSimilarity::Similarity cell_similarity, + const std::pair::InternalDataBase *, + const typename Mapping::InternalDataBase *> mapping_internal, + const unsigned int base_element, + const internal::FEValues::MappingRelatedData &mapping_data, + internal::FEValues::FiniteElementRelatedData &output_data) const; /** * Usually: Fields of cell-independent data. diff --git a/source/fe/fe_dgp_nonparametric.cc b/source/fe/fe_dgp_nonparametric.cc index b8bf0faaa8..cfe74c284a 100644 --- a/source/fe/fe_dgp_nonparametric.cc +++ b/source/fe/fe_dgp_nonparametric.cc @@ -277,19 +277,20 @@ FE_DGPNonparametric::get_data ( template void -FE_DGPNonparametric::fill_fe_values ( - const Mapping &, - const typename Triangulation::cell_iterator &, - const Quadrature &, - const typename Mapping::InternalDataBase &, - const typename Mapping::InternalDataBase &fe_data, - FEValuesData &data, - const CellSimilarity::Similarity /*cell_similarity*/) const +FE_DGPNonparametric:: +fill_fe_values (const Mapping &, + const typename Triangulation::cell_iterator &, + const Quadrature &, + const typename Mapping::InternalDataBase &, + const typename Mapping::InternalDataBase &fe_data, + const internal::FEValues::MappingRelatedData &mapping_data, + internal::FEValues::FiniteElementRelatedData &output_data, + const CellSimilarity::Similarity /*cell_similarity*/) const { const UpdateFlags flags(fe_data.current_update_flags()); Assert (flags & update_quadrature_points, ExcInternalError()); - const unsigned int n_q_points = data.quadrature_points.size(); + const unsigned int n_q_points = mapping_data.quadrature_points.size(); std::vector values(flags & update_values ? this->dofs_per_cell : 0); std::vector > grads(flags & update_gradients ? this->dofs_per_cell : 0); @@ -298,16 +299,16 @@ FE_DGPNonparametric::fill_fe_values ( if (flags & (update_values | update_gradients)) for (unsigned int i=0; idofs_per_cell; ++k) { if (flags & update_values) - data.shape_values[k][i] = values[k]; + output_data.shape_values[k][i] = values[k]; if (flags & update_gradients) - data.shape_gradients[k][i] = grads[k]; + output_data.shape_gradients[k][i] = grads[k]; if (flags & update_hessians) - data.shape_hessians[k][i] = grad_grads[k]; + output_data.shape_hessians[k][i] = grad_grads[k]; } } } @@ -316,19 +317,20 @@ FE_DGPNonparametric::fill_fe_values ( template void -FE_DGPNonparametric::fill_fe_face_values ( - const Mapping &, - const typename Triangulation::cell_iterator &, - const unsigned int, - const Quadrature&, - const typename Mapping::InternalDataBase &, - const typename Mapping::InternalDataBase &fe_data, - FEValuesData &data) const +FE_DGPNonparametric:: +fill_fe_face_values (const Mapping &, + const typename Triangulation::cell_iterator &, + const unsigned int, + const Quadrature&, + const typename Mapping::InternalDataBase &, + const typename Mapping::InternalDataBase &fe_data, + const internal::FEValues::MappingRelatedData &mapping_data, + internal::FEValues::FiniteElementRelatedData &output_data) const { const UpdateFlags flags(fe_data.update_once | fe_data.update_each); Assert (flags & update_quadrature_points, ExcInternalError()); - const unsigned int n_q_points = data.quadrature_points.size(); + const unsigned int n_q_points = mapping_data.quadrature_points.size(); std::vector values(flags & update_values ? this->dofs_per_cell : 0); std::vector > grads(flags & update_gradients ? this->dofs_per_cell : 0); @@ -337,16 +339,16 @@ FE_DGPNonparametric::fill_fe_face_values ( if (flags & (update_values | update_gradients)) for (unsigned int i=0; idofs_per_cell; ++k) { if (flags & update_values) - data.shape_values[k][i] = values[k]; + output_data.shape_values[k][i] = values[k]; if (flags & update_gradients) - data.shape_gradients[k][i] = grads[k]; + output_data.shape_gradients[k][i] = grads[k]; if (flags & update_hessians) - data.shape_hessians[k][i] = grad_grads[k]; + output_data.shape_hessians[k][i] = grad_grads[k]; } } } @@ -355,20 +357,21 @@ FE_DGPNonparametric::fill_fe_face_values ( template void -FE_DGPNonparametric::fill_fe_subface_values ( - const Mapping &, - const typename Triangulation::cell_iterator &, - const unsigned int, - const unsigned int, - const Quadrature&, - const typename Mapping::InternalDataBase &, - const typename Mapping::InternalDataBase &fe_data, - FEValuesData &data) const +FE_DGPNonparametric:: +fill_fe_subface_values (const Mapping &, + const typename Triangulation::cell_iterator &, + const unsigned int, + const unsigned int, + const Quadrature&, + const typename Mapping::InternalDataBase &, + const typename Mapping::InternalDataBase &fe_data, + const internal::FEValues::MappingRelatedData &mapping_data, + internal::FEValues::FiniteElementRelatedData &output_data) const { const UpdateFlags flags(fe_data.update_once | fe_data.update_each); Assert (flags & update_quadrature_points, ExcInternalError()); - const unsigned int n_q_points = data.quadrature_points.size(); + const unsigned int n_q_points = mapping_data.quadrature_points.size(); std::vector values(flags & update_values ? this->dofs_per_cell : 0); std::vector > grads(flags & update_gradients ? this->dofs_per_cell : 0); @@ -377,16 +380,16 @@ FE_DGPNonparametric::fill_fe_subface_values ( if (flags & (update_values | update_gradients)) for (unsigned int i=0; idofs_per_cell; ++k) { if (flags & update_values) - data.shape_values[k][i] = values[k]; + output_data.shape_values[k][i] = values[k]; if (flags & update_gradients) - data.shape_gradients[k][i] = grads[k]; + output_data.shape_gradients[k][i] = grads[k]; if (flags & update_hessians) - data.shape_hessians[k][i] = grad_grads[k]; + output_data.shape_hessians[k][i] = grad_grads[k]; } } } diff --git a/source/fe/fe_face.cc b/source/fe/fe_face.cc index 85b909dc1d..d3a63e71df 100644 --- a/source/fe/fe_face.cc +++ b/source/fe/fe_face.cc @@ -517,14 +517,15 @@ FE_FaceQ<1,spacedim>::get_subface_data ( template void -FE_FaceQ<1,spacedim>::fill_fe_values -(const Mapping<1,spacedim> &, - const typename Triangulation<1,spacedim>::cell_iterator &, - const Quadrature<1> &, - const typename Mapping<1,spacedim>::InternalDataBase &, - const typename Mapping<1,spacedim>::InternalDataBase &, - FEValuesData<1,spacedim> &, - const CellSimilarity::Similarity ) const +FE_FaceQ<1,spacedim>:: +fill_fe_values(const Mapping<1,spacedim> &, + const typename Triangulation<1,spacedim>::cell_iterator &, + const Quadrature<1> &, + const typename Mapping<1,spacedim>::InternalDataBase &, + const typename Mapping<1,spacedim>::InternalDataBase &, + const internal::FEValues::MappingRelatedData<1,spacedim> &, + internal::FEValues::FiniteElementRelatedData<1,spacedim> &, + const CellSimilarity::Similarity ) const { // Do nothing, since we do not have values in the interior } @@ -533,14 +534,15 @@ FE_FaceQ<1,spacedim>::fill_fe_values template void -FE_FaceQ<1,spacedim>::fill_fe_face_values ( - const Mapping<1,spacedim> &, - const typename Triangulation<1,spacedim>::cell_iterator &, - const unsigned int face, - const Quadrature<0> &, - const typename Mapping<1,spacedim>::InternalDataBase &, - const typename Mapping<1,spacedim>::InternalDataBase &fedata, - FEValuesData<1,spacedim> &data) const +FE_FaceQ<1,spacedim>:: +fill_fe_face_values (const Mapping<1,spacedim> &, + const typename Triangulation<1,spacedim>::cell_iterator &, + const unsigned int face, + const Quadrature<0> &, + const typename Mapping<1,spacedim>::InternalDataBase &, + const typename Mapping<1,spacedim>::InternalDataBase &fedata, + const internal::FEValues::MappingRelatedData<1,spacedim> &, + internal::FEValues::FiniteElementRelatedData<1,spacedim> &output_data) const { const UpdateFlags flags(fedata.update_once | fedata.update_each); @@ -548,23 +550,24 @@ FE_FaceQ<1,spacedim>::fill_fe_face_values ( if (flags & update_values) { for (unsigned int k=0; kdofs_per_cell; ++k) - data.shape_values(k,0) = 0.; - data.shape_values(foffset,0) = 1; + output_data.shape_values(k,0) = 0.; + output_data.shape_values(foffset,0) = 1; } } template void -FE_FaceQ<1,spacedim>::fill_fe_subface_values ( - const Mapping<1,spacedim> &, - const typename Triangulation<1,spacedim>::cell_iterator &, - const unsigned int , - const unsigned int , - const Quadrature<0> &, - const typename Mapping<1,spacedim>::InternalDataBase &, - const typename Mapping<1,spacedim>::InternalDataBase &, - FEValuesData<1,spacedim> &) const +FE_FaceQ<1,spacedim>:: +fill_fe_subface_values (const Mapping<1,spacedim> &, + const typename Triangulation<1,spacedim>::cell_iterator &, + const unsigned int , + const unsigned int , + const Quadrature<0> &, + const typename Mapping<1,spacedim>::InternalDataBase &, + const typename Mapping<1,spacedim>::InternalDataBase &, + const internal::FEValues::MappingRelatedData<1,spacedim> &, + internal::FEValues::FiniteElementRelatedData<1,spacedim> &) const { Assert(false, ExcMessage("There are no sub-face values to fill in 1D!")); } diff --git a/source/fe/fe_nothing.cc b/source/fe/fe_nothing.cc index 8ffc976137..08a4b7cdd2 100644 --- a/source/fe/fe_nothing.cc +++ b/source/fe/fe_nothing.cc @@ -122,7 +122,8 @@ fill_fe_values (const Mapping & /*mapping*/, const Quadrature & /*quadrature*/, const typename Mapping::InternalDataBase & /*mapping_data*/, const typename Mapping::InternalDataBase & /*fedata*/, - FEValuesData & /*data*/, + const internal::FEValues::MappingRelatedData &/*mapping_data*/, + internal::FEValues::FiniteElementRelatedData &/*output_data*/, const CellSimilarity::Similarity /*cell_similarity*/) const { // leave data fields empty @@ -139,7 +140,8 @@ fill_fe_face_values (const Mapping & /*mapping*/, const Quadrature & /*quadrature*/, const typename Mapping::InternalDataBase & /*mapping_data*/, const typename Mapping::InternalDataBase & /*fedata*/, - FEValuesData & /*data*/) const + const internal::FEValues::MappingRelatedData &/*mapping_data*/, + internal::FEValues::FiniteElementRelatedData &/*output_data*/) const { // leave data fields empty } @@ -154,7 +156,8 @@ fill_fe_subface_values (const Mapping & /*mapping*/, const Quadrature & /*quadrature*/, const typename Mapping::InternalDataBase & /*mapping_data*/, const typename Mapping::InternalDataBase & /*fedata*/, - FEValuesData & /*data*/) const + const internal::FEValues::MappingRelatedData &/*mapping_data*/, + internal::FEValues::FiniteElementRelatedData &/*output_data*/) const { // leave data fields empty } diff --git a/source/fe/fe_poly.cc b/source/fe/fe_poly.cc index cf31ba690f..b36b543f74 100644 --- a/source/fe/fe_poly.cc +++ b/source/fe/fe_poly.cc @@ -1,6 +1,6 @@ // --------------------------------------------------------------------- // -// Copyright (C) 2004 - 2014 by the deal.II authors +// Copyright (C) 2004 - 2015 by the deal.II authors // // This file is part of the deal.II library. // @@ -29,14 +29,15 @@ DEAL_II_NAMESPACE_OPEN template <> void -FE_Poly,1,2>::fill_fe_values -(const Mapping<1,2> &mapping, - const Triangulation<1,2>::cell_iterator &cell, - const Quadrature<1> &quadrature, - const Mapping<1,2>::InternalDataBase &mapping_data, - const Mapping<1,2>::InternalDataBase &fedata, - FEValuesData<1,2> &data, - const CellSimilarity::Similarity cell_similarity) const +FE_Poly,1,2>:: +fill_fe_values (const Mapping<1,2> &mapping, + const Triangulation<1,2>::cell_iterator &cell, + const Quadrature<1> &quadrature, + const Mapping<1,2>::InternalDataBase &mapping_internal, + const Mapping<1,2>::InternalDataBase &fedata, + const internal::FEValues::MappingRelatedData<1,2> &, + internal::FEValues::FiniteElementRelatedData<1,2> &output_data, + const CellSimilarity::Similarity cell_similarity) const { // convert data object to internal // data for this class. fails with @@ -51,30 +52,33 @@ FE_Poly,1,2>::fill_fe_values { if (flags & update_values) for (unsigned int i=0; icompute_2nd (mapping, cell, QProjector<1>::DataSetDescriptor::cell(), - mapping_data, fe_data, data); + mapping_internal, fe_data, + output_data); } template <> void -FE_Poly,2,3>::fill_fe_values -(const Mapping<2,3> &mapping, - const Triangulation<2,3>::cell_iterator &cell, - const Quadrature<2> &quadrature, - const Mapping<2,3>::InternalDataBase &mapping_data, - const Mapping<2,3>::InternalDataBase &fedata, - FEValuesData<2,3> &data, - const CellSimilarity::Similarity cell_similarity) const +FE_Poly,2,3>:: +fill_fe_values (const Mapping<2,3> &mapping, + const Triangulation<2,3>::cell_iterator &cell, + const Quadrature<2> &quadrature, + const Mapping<2,3>::InternalDataBase &mapping_internal, + const Mapping<2,3>::InternalDataBase &fedata, + const internal::FEValues::MappingRelatedData<2,3> &, + internal::FEValues::FiniteElementRelatedData<2,3> &output_data, + const CellSimilarity::Similarity cell_similarity) const { // assert that the following dynamics @@ -88,29 +92,32 @@ FE_Poly,2,3>::fill_fe_values { if (flags & update_values) for (unsigned int i=0; icompute_2nd (mapping, cell, QProjector<2>::DataSetDescriptor::cell(), - mapping_data, fe_data, data); + mapping_internal, fe_data, + output_data); } template <> void -FE_Poly,1,2>::fill_fe_values ( - const Mapping<1,2> &mapping, - const Triangulation<1,2>::cell_iterator &cell, - const Quadrature<1> &quadrature, - const Mapping<1,2>::InternalDataBase &mapping_data, - const Mapping<1,2>::InternalDataBase &fedata, - FEValuesData<1,2> &data, - const CellSimilarity::Similarity cell_similarity) const +FE_Poly,1,2>:: +fill_fe_values (const Mapping<1,2> &mapping, + const Triangulation<1,2>::cell_iterator &cell, + const Quadrature<1> &quadrature, + const Mapping<1,2>::InternalDataBase &mapping_internal, + const Mapping<1,2>::InternalDataBase &fedata, + const internal::FEValues::MappingRelatedData<1,2> &, + internal::FEValues::FiniteElementRelatedData<1,2> &output_data, + const CellSimilarity::Similarity cell_similarity) const { // convert data object to internal // data for this class. fails with @@ -126,29 +133,32 @@ FE_Poly,1,2>::fill_fe_values ( { if (flags & update_values) for (unsigned int i=0; icompute_2nd (mapping, cell, QProjector<1>::DataSetDescriptor::cell(), - mapping_data, fe_data, data); + mapping_internal, fe_data, + output_data); } template <> void -FE_Poly,2,3>::fill_fe_values -(const Mapping<2,3> &mapping, - const Triangulation<2,3>::cell_iterator &cell, - const Quadrature<2> &quadrature, - const Mapping<2,3>::InternalDataBase &mapping_data, - const Mapping<2,3>::InternalDataBase &fedata, - FEValuesData<2,3> &data, - const CellSimilarity::Similarity cell_similarity) const +FE_Poly,2,3>:: +fill_fe_values (const Mapping<2,3> &mapping, + const Triangulation<2,3>::cell_iterator &cell, + const Quadrature<2> &quadrature, + const Mapping<2,3>::InternalDataBase &mapping_internal, + const Mapping<2,3>::InternalDataBase &fedata, + const internal::FEValues::MappingRelatedData<2,3> &, + internal::FEValues::FiniteElementRelatedData<2,3> &output_data, + const CellSimilarity::Similarity cell_similarity) const { Assert (dynamic_cast (&fedata) != 0, ExcInternalError()); const InternalData &fe_data = static_cast (fedata); @@ -159,17 +169,19 @@ FE_Poly,2,3>::fill_fe_values { if (flags & update_values) for (unsigned int i=0; icompute_2nd (mapping, cell, QProjector<2>::DataSetDescriptor::cell(), - mapping_data, fe_data, data); + mapping_internal, fe_data, + output_data); } diff --git a/source/fe/fe_poly_tensor.cc b/source/fe/fe_poly_tensor.cc index 99cb7a2fc7..efebdd71f8 100644 --- a/source/fe/fe_poly_tensor.cc +++ b/source/fe/fe_poly_tensor.cc @@ -389,14 +389,15 @@ FE_PolyTensor::get_data ( template void -FE_PolyTensor::fill_fe_values ( - const Mapping &mapping, - const typename Triangulation::cell_iterator &cell, - const Quadrature &quadrature, - const typename Mapping::InternalDataBase &mapping_data, - const typename Mapping::InternalDataBase &fedata, - FEValuesData &data, - const CellSimilarity::Similarity cell_similarity) const +FE_PolyTensor:: +fill_fe_values (const Mapping &mapping, + const typename Triangulation::cell_iterator &cell, + const Quadrature &quadrature, + const typename Mapping::InternalDataBase &mapping_internal, + const typename Mapping::InternalDataBase &fedata, + const internal::FEValues::MappingRelatedData &, + internal::FEValues::FiniteElementRelatedData &output_data, + const CellSimilarity::Similarity cell_similarity) const { // convert data object to internal // data for this class. fails with @@ -429,8 +430,8 @@ FE_PolyTensor::fill_fe_values ( for (unsigned int i=0; idofs_per_cell; ++i) { - const unsigned int first = data.shape_function_to_row_table[i * this->n_components() + - this->get_nonzero_components(i).first_selected_component()]; + const unsigned int first = output_data.shape_function_to_row_table[i * this->n_components() + + this->get_nonzero_components(i).first_selected_component()]; // update the shape function values as necessary // @@ -449,7 +450,7 @@ FE_PolyTensor::fill_fe_values ( { for (unsigned int k=0; k::fill_fe_values ( { std::vector > shape_values (n_q_points); mapping.transform(fe_data.shape_values[i], - shape_values, mapping_data, mapping_type); + shape_values, mapping_internal, mapping_type); for (unsigned int k=0; k::fill_fe_values ( { std::vector > shape_values (n_q_points); mapping.transform(fe_data.shape_values[i], shape_values, - mapping_data, mapping_piola); + mapping_internal, mapping_piola); for (unsigned int k=0; k::fill_fe_values ( { std::vector > shape_values (n_q_points); mapping.transform (fe_data.shape_values[i], shape_values, - mapping_data, mapping_covariant); + mapping_internal, mapping_covariant); for (unsigned int k = 0; k < n_q_points; ++k) for (unsigned int d = 0; d < dim; ++d) - data.shape_values(first+d,k) = sign_change[i] * shape_values[k][d]; + output_data.shape_values(first+d,k) = sign_change[i] * shape_values[k][d]; break; } @@ -514,31 +515,31 @@ FE_PolyTensor::fill_fe_values ( case mapping_none: { mapping.transform(fe_data.shape_grads[i], shape_grads1, - mapping_data, mapping_covariant); + mapping_internal, mapping_covariant); for (unsigned int k=0; k::fill_fe_values ( input[k] = fe_data.shape_grads[i][k]; mapping.transform(input, shape_grads1, - mapping_data, mapping_piola_gradient); + mapping_internal, mapping_piola_gradient); for (unsigned int k=0; k::fill_fe_values ( for (unsigned int k=0; k::fill_fe_values ( || (mapping_type == mapping_nedelec)))) this->compute_2nd (mapping, cell, typename QProjector::DataSetDescriptor().cell(), - mapping_data, fe_data, data); + mapping_internal, fe_data, + output_data); } template void -FE_PolyTensor::fill_fe_face_values ( - const Mapping &mapping, - const typename Triangulation::cell_iterator &cell, - const unsigned int face, - const Quadrature &quadrature, - const typename Mapping::InternalDataBase &mapping_data, - const typename Mapping::InternalDataBase &fedata, - FEValuesData &data) const +FE_PolyTensor:: +fill_fe_face_values (const Mapping &mapping, + const typename Triangulation::cell_iterator &cell, + const unsigned int face, + const Quadrature &quadrature, + const typename Mapping::InternalDataBase &mapping_internal, + const typename Mapping::InternalDataBase &fedata, + const internal::FEValues::MappingRelatedData &, + internal::FEValues::FiniteElementRelatedData &output_data) const { // convert data object to internal // data for this class. fails with @@ -657,8 +660,8 @@ FE_PolyTensor::fill_fe_face_values ( for (unsigned int i=0; idofs_per_cell; ++i) { - const unsigned int first = data.shape_function_to_row_table[i * this->n_components() + - this->get_nonzero_components(i).first_selected_component()]; + const unsigned int first = output_data.shape_function_to_row_table[i * this->n_components() + + this->get_nonzero_components(i).first_selected_component()]; if (flags & update_values) { @@ -668,7 +671,7 @@ FE_PolyTensor::fill_fe_face_values ( { for (unsigned int k=0; k::fill_fe_face_values ( // for transformation std::vector > shape_values (n_q_points); mapping.transform(make_slice(fe_data.shape_values[i], offset, n_q_points), - shape_values, mapping_data, mapping_type); + shape_values, mapping_internal, mapping_type); for (unsigned int k=0; k::fill_fe_face_values ( { std::vector > shape_values (n_q_points); mapping.transform(make_slice(fe_data.shape_values[i], offset, n_q_points), - shape_values, mapping_data, mapping_piola); + shape_values, mapping_internal, mapping_piola); for (unsigned int k=0; k::fill_fe_face_values ( { std::vector > shape_values (n_q_points); mapping.transform (make_slice (fe_data.shape_values[i], offset, n_q_points), - shape_values, mapping_data, mapping_covariant); + shape_values, mapping_internal, mapping_covariant); for (unsigned int k = 0; k < n_q_points; ++k) for (unsigned int d = 0; d < dim; ++d) - data.shape_values(first+d,k) = sign_change[i] * shape_values[k][d]; + output_data.shape_values(first+d,k) = sign_change[i] * shape_values[k][d]; break; } @@ -729,31 +732,31 @@ FE_PolyTensor::fill_fe_face_values ( case mapping_none: { mapping.transform(make_slice(fe_data.shape_grads[i], offset, n_q_points), - shape_grads1, mapping_data, mapping_covariant); + shape_grads1, mapping_internal, mapping_covariant); for (unsigned int k=0; k::fill_fe_face_values ( input[k] = fe_data.shape_grads[i][k]; mapping.transform(make_slice(input, offset, n_q_points), shape_grads1, - mapping_data, mapping_piola_gradient); + mapping_internal, mapping_piola_gradient); for (unsigned int k=0; k::fill_fe_face_values ( for (unsigned int k=0; k::fill_fe_face_values ( } if (flags & update_hessians) - this->compute_2nd (mapping, cell, offset, mapping_data, fe_data, data); + this->compute_2nd (mapping, cell, offset, mapping_internal, fe_data, + output_data); } template void -FE_PolyTensor::fill_fe_subface_values ( - const Mapping &mapping, - const typename Triangulation::cell_iterator &cell, - const unsigned int face, - const unsigned int subface, - const Quadrature &quadrature, - const typename Mapping::InternalDataBase &mapping_data, - const typename Mapping::InternalDataBase &fedata, - FEValuesData &data) const +FE_PolyTensor:: +fill_fe_subface_values (const Mapping &mapping, + const typename Triangulation::cell_iterator &cell, + const unsigned int face, + const unsigned int subface, + const Quadrature &quadrature, + const typename Mapping::InternalDataBase &mapping_internal, + const typename Mapping::InternalDataBase &fedata, + const internal::FEValues::MappingRelatedData &, + internal::FEValues::FiniteElementRelatedData &output_data) const { // convert data object to internal // data for this class. fails with @@ -866,8 +871,8 @@ FE_PolyTensor::fill_fe_subface_values ( for (unsigned int i=0; idofs_per_cell; ++i) { - const unsigned int first = data.shape_function_to_row_table[i * this->n_components() + - this->get_nonzero_components(i).first_selected_component()]; + const unsigned int first = output_data.shape_function_to_row_table[i * this->n_components() + + this->get_nonzero_components(i).first_selected_component()]; if (flags & update_values) { @@ -877,7 +882,7 @@ FE_PolyTensor::fill_fe_subface_values ( { for (unsigned int k=0; k::fill_fe_subface_values ( // transformation std::vector > shape_values (n_q_points); mapping.transform(make_slice(fe_data.shape_values[i], offset, n_q_points), - shape_values, mapping_data, mapping_type); + shape_values, mapping_internal, mapping_type); for (unsigned int k=0; k::fill_fe_subface_values ( { std::vector > shape_values (n_q_points); mapping.transform(make_slice(fe_data.shape_values[i], offset, n_q_points), - shape_values, mapping_data, mapping_piola); + shape_values, mapping_internal, mapping_piola); for (unsigned int k=0; k::fill_fe_subface_values ( { std::vector > shape_values (n_q_points); mapping.transform (make_slice (fe_data.shape_values[i], offset, n_q_points), - shape_values, mapping_data, mapping_covariant); + shape_values, mapping_internal, mapping_covariant); for (unsigned int k = 0; k < n_q_points; ++k) for (unsigned int d = 0; d < dim; ++d) - data.shape_values(first+d,k) = sign_change[i] * shape_values[k][d]; + output_data.shape_values(first+d,k) = sign_change[i] * shape_values[k][d]; break; } @@ -935,32 +940,32 @@ FE_PolyTensor::fill_fe_subface_values ( case mapping_none: { mapping.transform(make_slice(fe_data.shape_grads[i], offset, n_q_points), - shape_grads1, mapping_data, mapping_covariant); + shape_grads1, mapping_internal, mapping_covariant); for (unsigned int k=0; k::fill_fe_subface_values ( input[k] = fe_data.shape_grads[i][k]; mapping.transform(make_slice(input, offset, n_q_points), shape_grads1, - mapping_data, mapping_piola_gradient); + mapping_internal, mapping_piola_gradient); for (unsigned int k=0; k::fill_fe_subface_values ( input[k] = fe_data.shape_grads[i][k]; mapping.transform (make_slice (input, offset, n_q_points), - shape_grads1, mapping_data, mapping_covariant_gradient); + shape_grads1, mapping_internal, mapping_covariant_gradient); for (unsigned int k = 0; k < n_q_points; ++k) for (unsigned int d = 0; d < dim; ++d) - data.shape_gradients[first + d][k] = sign_change[i] * shape_grads1[k][d]; + output_data.shape_gradients[first + d][k] = sign_change[i] * shape_grads1[k][d]; break; } @@ -1016,7 +1021,8 @@ FE_PolyTensor::fill_fe_subface_values ( } if (flags & update_hessians) - this->compute_2nd (mapping, cell, offset, mapping_data, fe_data, data); + this->compute_2nd (mapping, cell, offset, mapping_internal, fe_data, + output_data); } diff --git a/source/fe/fe_system.cc b/source/fe/fe_system.cc index b0d3bab9fe..f880a0a70e 100644 --- a/source/fe/fe_system.cc +++ b/source/fe/fe_system.cc @@ -1033,34 +1033,38 @@ FESystem::get_subface_data ( template void -FESystem::fill_fe_values ( - const Mapping &mapping, - const typename Triangulation::cell_iterator &cell, - const Quadrature &quadrature, - const typename Mapping::InternalDataBase &mapping_data, - const typename Mapping::InternalDataBase &fe_data, - FEValuesData &data, - const CellSimilarity::Similarity cell_similarity) const +FESystem:: +fill_fe_values (const Mapping &mapping, + const typename Triangulation::cell_iterator &cell, + const Quadrature &quadrature, + const typename Mapping::InternalDataBase &mapping_internal, + const typename Mapping::InternalDataBase &fe_data, + const internal::FEValues::MappingRelatedData &mapping_data, + internal::FEValues::FiniteElementRelatedData &output_data, + const CellSimilarity::Similarity cell_similarity) const { compute_fill(mapping, cell, invalid_face_number, invalid_face_number, - quadrature, cell_similarity, mapping_data, fe_data, data); + quadrature, cell_similarity, mapping_internal, fe_data, + mapping_data, output_data); } template void -FESystem::fill_fe_face_values ( - const Mapping &mapping, - const typename Triangulation::cell_iterator &cell, - const unsigned int face_no, - const Quadrature &quadrature, - const typename Mapping::InternalDataBase &mapping_data, - const typename Mapping::InternalDataBase &fe_data, - FEValuesData &data) const +FESystem:: +fill_fe_face_values (const Mapping &mapping, + const typename Triangulation::cell_iterator &cell, + const unsigned int face_no, + const Quadrature &quadrature, + const typename Mapping::InternalDataBase &mapping_internal, + const typename Mapping::InternalDataBase &fe_data, + const internal::FEValues::MappingRelatedData &mapping_data, + internal::FEValues::FiniteElementRelatedData &output_data) const { compute_fill (mapping, cell, face_no, invalid_face_number, quadrature, - CellSimilarity::none, mapping_data, fe_data, data); + CellSimilarity::none, mapping_internal, fe_data, + mapping_data, output_data); } @@ -1068,18 +1072,20 @@ FESystem::fill_fe_face_values ( template void -FESystem::fill_fe_subface_values ( - const Mapping &mapping, - const typename Triangulation::cell_iterator &cell, - const unsigned int face_no, - const unsigned int sub_no, - const Quadrature &quadrature, - const typename Mapping::InternalDataBase &mapping_data, - const typename Mapping::InternalDataBase &fe_data, - FEValuesData &data) const +FESystem:: +fill_fe_subface_values (const Mapping &mapping, + const typename Triangulation::cell_iterator &cell, + const unsigned int face_no, + const unsigned int sub_no, + const Quadrature &quadrature, + const typename Mapping::InternalDataBase &mapping_internal, + const typename Mapping::InternalDataBase &fe_data, + const internal::FEValues::MappingRelatedData &mapping_data, + internal::FEValues::FiniteElementRelatedData &output_data) const { compute_fill (mapping, cell, face_no, sub_no, quadrature, - CellSimilarity::none, mapping_data, fe_data, data); + CellSimilarity::none, mapping_internal, fe_data, + mapping_data, output_data); } @@ -1087,18 +1093,19 @@ FESystem::fill_fe_subface_values ( template template void -FESystem::compute_fill_one_base ( - const Mapping &mapping, - const typename Triangulation::cell_iterator &cell, - const std::pair face_sub_no, - const Quadrature &quadrature, - const CellSimilarity::Similarity cell_similarity, - const std::pair::InternalDataBase *, - const typename Mapping::InternalDataBase *> mapping_data, - const unsigned int base_no, - FEValuesData &data) const +FESystem:: +compute_fill_one_base (const Mapping &mapping, + const typename Triangulation::cell_iterator &cell, + const std::pair face_sub_no, + const Quadrature &quadrature, + const CellSimilarity::Similarity cell_similarity, + const std::pair::InternalDataBase *, + const typename Mapping::InternalDataBase *> mapping_internal, + const unsigned int base_no, + const internal::FEValues::MappingRelatedData &mapping_data, + internal::FEValues::FiniteElementRelatedData &output_data) const { - const InternalData &fe_data = static_cast (*mapping_data.second); + const InternalData &fe_data = static_cast (*mapping_internal.second); const unsigned int n_q_points = quadrature.size(); const FiniteElement & @@ -1141,13 +1148,13 @@ FESystem::compute_fill_one_base ( // that we store here into the corresponding objects we pass down // to the various base elements. some of these arrays may be empty, // in which case copying is cheap - base_data.JxW_values = data.JxW_values; - base_data.jacobians = data.jacobians; - base_data.jacobian_grads = data.jacobian_grads; - base_data.inverse_jacobians = data.inverse_jacobians; - base_data.quadrature_points = data.quadrature_points; - base_data.normal_vectors = data.normal_vectors; - base_data.boundary_forms = data.boundary_forms; + base_data.JxW_values = mapping_data.JxW_values; + base_data.jacobians = mapping_data.jacobians; + base_data.jacobian_grads = mapping_data.jacobian_grads; + base_data.inverse_jacobians = mapping_data.inverse_jacobians; + base_data.quadrature_points = mapping_data.quadrature_points; + base_data.normal_vectors = mapping_data.normal_vectors; + base_data.boundary_forms = mapping_data.boundary_forms; // Make sure that in the case of fill_fe_values the data is only // copied from base_data to data if base_data is changed. therefore @@ -1157,14 +1164,14 @@ FESystem::compute_fill_one_base ( // copied from base_data to data on each face, therefore use // base_fe_data.update_flags. if (face_sub_no.first==invalid_face_number) - base_fe.fill_fe_values(mapping, cell, *cell_quadrature, *mapping_data.first, - base_fe_data, base_data, cell_similarity); + base_fe.fill_fe_values(mapping, cell, *cell_quadrature, *mapping_internal.first, + base_fe_data, base_data, base_data, cell_similarity); else if (face_sub_no.second==invalid_face_number) base_fe.fill_fe_face_values(mapping, cell, face_sub_no.first, - *face_quadrature, *mapping_data.first, base_fe_data, base_data); + *face_quadrature, *mapping_internal.first, base_fe_data, base_data, base_data); else base_fe.fill_fe_subface_values(mapping, cell, face_sub_no.first, face_sub_no.second, - *face_quadrature, *mapping_data.first, base_fe_data, base_data); + *face_quadrature, *mapping_internal.first, base_fe_data, base_data, base_data); // now data has been generated, so copy it. we used to work by // looping over all base elements (i.e. this outer loop), then over @@ -1215,12 +1222,12 @@ FESystem::compute_fill_one_base ( { if (base_flags & update_values) for (unsigned int q=0; q::compute_fill_one_base ( template template void -FESystem::compute_fill ( - const Mapping &mapping, - const typename Triangulation::cell_iterator &cell, - const unsigned int face_no, - const unsigned int sub_no, - const Quadrature &quadrature, - const CellSimilarity::Similarity cell_similarity, - const typename Mapping::InternalDataBase &mapping_data, - const typename Mapping::InternalDataBase &fedata, - FEValuesData &data) const +FESystem:: +compute_fill (const Mapping &mapping, + const typename Triangulation::cell_iterator &cell, + const unsigned int face_no, + const unsigned int sub_no, + const Quadrature &quadrature, + const CellSimilarity::Similarity cell_similarity, + const typename Mapping::InternalDataBase &mapping_internal, + const typename Mapping::InternalDataBase &fedata, + const internal::FEValues::MappingRelatedData &mapping_data, + internal::FEValues::FiniteElementRelatedData &output_data) const { const unsigned int n_q_points = quadrature.size(); @@ -1282,7 +1290,7 @@ FESystem::compute_fill ( // compute update flags ... const UpdateFlags base_update_flags - = mapping_data.update_flags | base_fe_data.update_flags; + = mapping_internal.update_flags | base_fe_data.update_flags; // Initialize the FEValuesDatas for the base elements. FEValuesData &base_data=fe_data.get_fe_values_data(base_no); @@ -1302,10 +1310,11 @@ FESystem::compute_fill ( std::make_pair(face_no, sub_no), std_cxx11::cref(quadrature), CellSimilarity::none, - std::make_pair(&mapping_data, + std::make_pair(&mapping_internal, &fedata), base_no, - std_cxx11::ref(data)))); + std_cxx11::ref(mapping_data), + std_cxx11::ref(output_data)))); task_group.join_all(); } @@ -1331,7 +1340,8 @@ FESystem::compute_fill ( cell->subface_case(face_no)); } - this->compute_2nd (mapping, cell, offset, mapping_data, fe_data, data); + this->compute_2nd (mapping, cell, offset, mapping_internal, fe_data, + output_data); } } diff --git a/source/fe/fe_values.cc b/source/fe/fe_values.cc index 49792db89b..f54eefa036 100644 --- a/source/fe/fe_values.cc +++ b/source/fe/fe_values.cc @@ -3559,6 +3559,7 @@ void FEValues::do_reinit () *this->mapping_data, *this->fe_data, *this, + *this, this->cell_similarity); this->fe_data->clear_first_cell (); @@ -3754,6 +3755,7 @@ void FEFaceValues::do_reinit (const unsigned int face_no) this->quadrature, *this->mapping_data, *this->fe_data, + *this, *this); this->fe_data->clear_first_cell (); @@ -3987,6 +3989,7 @@ void FESubfaceValues::do_reinit (const unsigned int face_no, this->quadrature, *this->mapping_data, *this->fe_data, + *this, *this); this->fe_data->clear_first_cell (); -- 2.39.5