From 6b360c2cca40ef866faa1b8e1a79c10ad66fa6a1 Mon Sep 17 00:00:00 2001 From: Wolfgang Bangerth Date: Wed, 5 Aug 2015 21:00:37 -0500 Subject: [PATCH] Empty FEValuesData and move the only two members to the derived class. --- include/deal.II/fe/fe_values.h | 18 ++++--------- source/fe/fe_values.cc | 46 ++++++++++++++-------------------- 2 files changed, 24 insertions(+), 40 deletions(-) diff --git a/include/deal.II/fe/fe_values.h b/include/deal.II/fe/fe_values.h index 5257d51805..dfbde3f28a 100644 --- a/include/deal.II/fe/fe_values.h +++ b/include/deal.II/fe/fe_values.h @@ -1274,18 +1274,6 @@ template class FEValuesData : public internal::FEValues::MappingRelatedData, public internal::FEValues::FiniteElementRelatedData { -public: - /** - * Initialize all vectors to correct size. - */ - void initialize (const unsigned int n_quadrature_points, - const FiniteElement &fe, - const UpdateFlags flags); - - /** - * Original update flags handed to the constructor of FEValues. - */ - UpdateFlags update_flags; }; @@ -2372,7 +2360,6 @@ protected: */ const SmartPointer,FEValuesBase > fe; - /** * Internal data of mapping. */ @@ -2383,6 +2370,11 @@ protected: */ SmartPointer::InternalDataBase,FEValuesBase > fe_data; + /** + * Original update flags handed to the constructor of FEValues. + */ + UpdateFlags update_flags; + /** * Initialize some update flags. Called from the @p initialize functions of * derived classes, which are in turn called from their constructors. diff --git a/source/fe/fe_values.cc b/source/fe/fe_values.cc index 6960d72c56..de1051e3b4 100644 --- a/source/fe/fe_values.cc +++ b/source/fe/fe_values.cc @@ -104,7 +104,7 @@ namespace FEValuesViews ExcIndexRange(component, 0, fe_values.fe->n_components())); //TODO: we'd like to use the fields with the same name as these -// variables from FEValuesData, but they aren't initialized yet +// variables from FEValuesBase, but they aren't initialized yet // at the time we get here, so re-create it all const std::vector shape_function_to_row_table = make_shape_function_to_row_table (*fe_values.fe); @@ -165,7 +165,7 @@ namespace FEValuesViews fe_values.fe->n_components())); //TODO: we'd like to use the fields with the same name as these -// variables from FEValuesData, but they aren't initialized yet +// variables from FEValuesBase, but they aren't initialized yet // at the time we get here, so re-create it all const std::vector shape_function_to_row_table = make_shape_function_to_row_table (*fe_values.fe); @@ -263,7 +263,7 @@ namespace FEValuesViews 0, fe_values.fe->n_components())); //TODO: we'd like to use the fields with the same name as these -// variables from FEValuesData, but they aren't initialized yet +// variables from FEValuesBase, but they aren't initialized yet // at the time we get here, so re-create it all const std::vector shape_function_to_row_table = make_shape_function_to_row_table (*fe_values.fe); @@ -362,7 +362,7 @@ namespace FEValuesViews 0, fe_values.fe->n_components())); //TODO: we'd like to use the fields with the same name as these -// variables from FEValuesData, but they aren't initialized yet +// variables from FEValuesBase, but they aren't initialized yet // at the time we get here, so re-create it all const std::vector shape_function_to_row_table = make_shape_function_to_row_table (*fe_values.fe); @@ -2070,9 +2070,6 @@ get_interpolated_dof_values (const IndexSet &, -/* --------------------- FEValuesData ----------------- */ - - namespace internal { namespace FEValues @@ -2149,20 +2146,6 @@ namespace internal } -template -void -FEValuesData::initialize (const unsigned int n_quadrature_points, - const FiniteElement &fe, - const UpdateFlags flags) -{ - // initialize the base classes - internal::FEValues::MappingRelatedData::initialize(n_quadrature_points, flags); - internal::FEValues::FiniteElementRelatedData::initialize(n_quadrature_points, fe, flags); - - this->update_flags = flags; -} - - /*------------------------------- FEValuesBase ---------------------------*/ @@ -3447,8 +3430,11 @@ FEValues::initialize (const UpdateFlags update_flags) this->mapping_data = this->mapping->get_data(flags, quadrature); this->fe_data = this->fe->get_data(flags, *this->mapping, quadrature); - // set up objects within this class - FEValuesData::initialize (this->n_quadrature_points, *this->fe, flags); + // initialize the base classes + internal::FEValues::MappingRelatedData::initialize(this->n_quadrature_points, flags); + internal::FEValues::FiniteElementRelatedData::initialize(this->n_quadrature_points, *this->fe, flags); + + this->update_flags = flags; } @@ -3674,8 +3660,11 @@ FEFaceValues::initialize (const UpdateFlags update_flags) this->mapping_data = this->mapping->get_face_data(flags, this->quadrature); this->fe_data = this->fe->get_face_data(flags, *this->mapping, this->quadrature); - // set up objects within this class - FEValuesData::initialize(this->n_quadrature_points, *this->fe, flags); + // initialize the base classes + internal::FEValues::MappingRelatedData::initialize(this->n_quadrature_points, flags); + internal::FEValues::FiniteElementRelatedData::initialize(this->n_quadrature_points, *this->fe, flags); + + this->update_flags = flags; } @@ -3822,8 +3811,11 @@ FESubfaceValues::initialize (const UpdateFlags update_flags) *this->mapping, this->quadrature); - // set up objects within this class - FEValuesData::initialize(this->n_quadrature_points, *this->fe, flags); + // initialize the base classes + internal::FEValues::MappingRelatedData::initialize(this->n_quadrature_points, flags); + internal::FEValues::FiniteElementRelatedData::initialize(this->n_quadrature_points, *this->fe, flags); + + this->update_flags = flags; } -- 2.39.5