From: Wolfgang Bangerth Date: Wed, 2 Nov 2016 21:03:32 +0000 (-0600) Subject: Remove a duplicate variable. X-Git-Tag: v8.5.0-rc1~504^2 X-Git-Url: https://gitweb.dealii.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=5290f388c4df8aa0fcf890f82e809a93daf4a8e4;p=dealii.git Remove a duplicate variable. The variable already exists in the base class Function. We don't need to duplicate it in the class FEFieldFunction. --- diff --git a/include/deal.II/numerics/fe_field_function.h b/include/deal.II/numerics/fe_field_function.h index e6beccc6e5..407602fb50 100644 --- a/include/deal.II/numerics/fe_field_function.h +++ b/include/deal.II/numerics/fe_field_function.h @@ -1,6 +1,6 @@ // --------------------------------------------------------------------- // -// Copyright (C) 2007 - 2015 by the deal.II authors +// Copyright (C) 2007 - 2016 by the deal.II authors // // This file is part of the deal.II library. // @@ -447,11 +447,6 @@ namespace Functions */ mutable cell_hint_t cell_hint; - /** - * Store the number of components of this function. - */ - const unsigned int n_components; - /** * Given a cell, return the reference coordinates of the given point * within this cell if it indeed lies within the cell. Otherwise return an diff --git a/include/deal.II/numerics/fe_field_function.templates.h b/include/deal.II/numerics/fe_field_function.templates.h index 82d36f4954..1ca192bbc1 100644 --- a/include/deal.II/numerics/fe_field_function.templates.h +++ b/include/deal.II/numerics/fe_field_function.templates.h @@ -1,6 +1,6 @@ // --------------------------------------------------------------------- // -// Copyright (C) 2007 - 2015 by the deal.II authors +// Copyright (C) 2007 - 2016 by the deal.II authors // // This file is part of the deal.II library. // @@ -41,8 +41,7 @@ namespace Functions dh(&mydh, "FEFieldFunction"), data_vector(myv), mapping(mymapping), - cell_hint(dh->end()), - n_components(mydh.get_fe().n_components()) + cell_hint(dh->end()) { } @@ -62,8 +61,8 @@ namespace Functions void FEFieldFunction::vector_value (const Point &p, Vector &values) const { - Assert (values.size() == n_components, - ExcDimensionMismatch(values.size(), n_components)); + Assert (values.size() == this->n_components, + ExcDimensionMismatch(values.size(), this->n_components)); typename DoFHandlerType::active_cell_iterator cell = cell_hint.get(); if (cell == dh->end()) cell = dh->begin_active(); @@ -101,7 +100,7 @@ namespace Functions FEFieldFunction::value (const Point &p, const unsigned int comp) const { - Vector values(n_components); + Vector values(this->n_components); vector_value(p, values); return values(comp); } @@ -115,8 +114,8 @@ namespace Functions std::vector > &gradients) const { typedef typename VectorType::value_type number; - Assert (gradients.size() == n_components, - ExcDimensionMismatch(gradients.size(), n_components)); + Assert (gradients.size() == this->n_components, + ExcDimensionMismatch(gradients.size(), this->n_components)); typename DoFHandlerType::active_cell_iterator cell = cell_hint.get(); if (cell == dh->end()) cell = dh->begin_active(); @@ -142,7 +141,7 @@ namespace Functions update_gradients); fe_v.reinit(cell); - if (n_components == 1) + if (this->n_components == 1) { // the size of the @p gradients coincidentally coincides // with the number of quadrature points we evaluate the function at. @@ -156,7 +155,7 @@ namespace Functions // to the number of quadrature points (always one here), whereas the second // to the number of components. std::vector< std::vector > > vgrads - (1, std::vector >(n_components) ); + (1, std::vector >(this->n_components) ); fe_v.get_function_gradients(data_vector, vgrads); gradients = vgrads[0]; } @@ -170,7 +169,7 @@ namespace Functions gradient (const Point &p, const unsigned int comp) const { - std::vector > grads(n_components); + std::vector > grads(this->n_components); vector_gradient(p, grads); return grads[comp]; } @@ -183,8 +182,8 @@ namespace Functions vector_laplacian (const Point &p, Vector &values) const { - Assert (values.size() == n_components, - ExcDimensionMismatch(values.size(), n_components)); + Assert (values.size() == this->n_components, + ExcDimensionMismatch(values.size(), this->n_components)); typename DoFHandlerType::active_cell_iterator cell = cell_hint.get(); if (cell == dh->end()) cell = dh->begin_active(); @@ -222,7 +221,7 @@ namespace Functions (const Point &p, const unsigned int comp) const { - Vector lap(n_components); + Vector lap(this->n_components); vector_laplacian(p, lap); return lap[comp]; } @@ -266,7 +265,7 @@ namespace Functions { fe_v.reinit(cells[i], i, 0); const unsigned int nq = qpoints[i].size(); - std::vector< Vector > vvalues (nq, Vector(n_components)); + std::vector< Vector > vvalues (nq, Vector(this->n_components)); fe_v.get_present_fe_values ().get_function_values(data_vector, vvalues); for (unsigned int q=0; q > vvalues(points.size(), Vector(n_components)); + std::vector< Vector > vvalues(points.size(), Vector(this->n_components)); vector_value_list(points, vvalues); for (unsigned int q=0; q > > - vgrads (nq, std::vector >(n_components)); + vgrads (nq, std::vector >(this->n_components)); fe_v.get_present_fe_values ().get_function_gradients(data_vector, vgrads); for (unsigned int q=0; q > > - vvalues(points.size(), std::vector >(n_components)); + vvalues(points.size(), std::vector >(this->n_components)); vector_gradient_list(points, vvalues); for (unsigned int q=0; q > vvalues (nq, Vector(n_components)); + std::vector< Vector > vvalues (nq, Vector(this->n_components)); fe_v.get_present_fe_values ().get_function_laplacians(data_vector, vvalues); for (unsigned int q=0; q > vvalues(points.size(), Vector(n_components)); + std::vector< Vector > vvalues(points.size(), Vector(this->n_components)); vector_laplacian_list(points, vvalues); for (unsigned int q=0; q