From 5c740a890ec6e3f7e7398d6920d77aae058da4ea Mon Sep 17 00:00:00 2001 From: Guido Kanschat Date: Thu, 11 Nov 2010 20:46:11 +0000 Subject: [PATCH] remove n_quadrature_points member variable after being deprecated for nearly 3 years git-svn-id: https://svn.dealii.org/trunk@22694 0785d39b-7218-0410-832d-ea1e28bc413d --- deal.II/include/deal.II/base/quadrature.h | 22 +-------- deal.II/source/base/quadrature.cc | 51 ++++++++------------ deal.II/source/fe/fe_nedelec.cc | 16 +++++- deal.II/source/fe/fe_q.cc | 8 +-- deal.II/source/fe/mapping_q_eulerian.cc | 4 +- deal.II/source/numerics/data_out.cc | 4 +- deal.II/source/numerics/data_out_faces.cc | 4 +- deal.II/source/numerics/data_out_rotation.cc | 4 +- deal.II/source/numerics/data_out_stack.cc | 2 +- deal.II/source/numerics/error_estimator.cc | 8 ++- 10 files changed, 52 insertions(+), 71 deletions(-) diff --git a/deal.II/include/deal.II/base/quadrature.h b/deal.II/include/deal.II/base/quadrature.h index fa3829aa8e..d99b5a7c42 100644 --- a/deal.II/include/deal.II/base/quadrature.h +++ b/deal.II/include/deal.II/base/quadrature.h @@ -2,7 +2,7 @@ // $Id$ // Version: $Name$ // -// Copyright (C) 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2009 by the deal.II authors +// Copyright (C) 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2009, 2010 by the deal.II authors // // This file is subject to QPL and may not be distributed // without copyright and license information. Please refer @@ -90,26 +90,6 @@ class Quadrature : public Subscriptor */ typedef Quadrature SubQuadrature; - /** - * @deprecated Use size() - * instead. - * - * Number of quadrature points. - * - * @warning After introduction of - * the assignment operator, this - * number is not constant anymore - * and erroneous assignment can - * compromise integrity of the - * Quadrature object. Since - * direct data access should be - * considered a design flaw - * anyway, it is strongly - * suggested to use size() - * instead. - */ - unsigned int n_quadrature_points; - /** * Constructor. * diff --git a/deal.II/source/base/quadrature.cc b/deal.II/source/base/quadrature.cc index 2d7de09456..764e145b16 100644 --- a/deal.II/source/base/quadrature.cc +++ b/deal.II/source/base/quadrature.cc @@ -40,11 +40,12 @@ namespace } - +//TODO: It would be desirable to have a Tensor template <> Quadrature<0>::Quadrature (const unsigned int) - : n_quadrature_points(1), - weights (1, 1.) + : +// quadrature_points(1), + weights (1, 1.) {} @@ -57,7 +58,6 @@ Quadrature<0>::~Quadrature () template Quadrature::Quadrature (const unsigned int n_q) : - n_quadrature_points(n_q), quadrature_points (n_q, Point()), weights (n_q, 0) {} @@ -68,7 +68,6 @@ template Quadrature::Quadrature (const std::vector > &points, const std::vector &weights) : - n_quadrature_points(points.size()), quadrature_points(points), weights(weights) { @@ -81,7 +80,6 @@ Quadrature::Quadrature (const std::vector > &points, template Quadrature::Quadrature (const std::vector > &points) : - n_quadrature_points(points.size()), quadrature_points(points), weights(points.size(), std::atof("Inf")) { @@ -94,19 +92,17 @@ Quadrature::Quadrature (const std::vector > &points) template Quadrature::Quadrature (const Point &point) : - n_quadrature_points(1), quadrature_points(std::vector > (1, point)), weights(std::vector (1, 1.)) {} template <> -Quadrature<0>::Quadrature (const Quadrature<-1> &, - const Quadrature<1> &) - : - n_quadrature_points (1), - weights(1, 1.) -{} +Quadrature<0>::Quadrature (const SubQuadrature&, + const Quadrature<1>&) +{ + Assert(false, ExcImpossibleInDim(0)); +} @@ -114,10 +110,8 @@ template Quadrature::Quadrature (const SubQuadrature &q1, const Quadrature<1> &q2) : - n_quadrature_points (q1.size() * - q2.size()), - quadrature_points (n_quadrature_points), - weights (n_quadrature_points, 0) + quadrature_points (q1.size() * q2.size()), + weights (q1.size() * q2.size()) { unsigned int present_index = 0; for (unsigned int i2=0; i2 Quadrature<1>::Quadrature (const SubQuadrature&, const Quadrature<1>& q2) : - n_quadrature_points (q2.size()), - quadrature_points (n_quadrature_points), - weights (n_quadrature_points, 0) + quadrature_points (q2.size()), + weights (q2.size()) { unsigned int present_index = 0; for (unsigned int i2=0; i2::Quadrature (const SubQuadrature&, template <> Quadrature<0>::Quadrature (const Quadrature<1> &) : - n_quadrature_points (1), - weights (1, 1.) + Subscriptor(), +// quadrature_points(1), + weights(1,1.) {} template <> Quadrature<1>::Quadrature (const Quadrature<0> &) : - n_quadrature_points (numbers::invalid_unsigned_int), - quadrature_points (), - weights () + Subscriptor() { // this function should never be // called -- this should be the // copy constructor in 1d... - Assert (false, ExcInternalError()); + Assert (false, ExcImpossibleInDim(1)); } @@ -218,9 +210,8 @@ template Quadrature::Quadrature (const Quadrature &q) : Subscriptor(), - n_quadrature_points (dimpow(q.size())), - quadrature_points (n_quadrature_points), - weights (n_quadrature_points, 0.) + quadrature_points (dimpow(q.size())), + weights (dimpow(q.size())) { Assert (dim <= 3, ExcNotImplemented()); @@ -253,7 +244,6 @@ template Quadrature::Quadrature (const Quadrature &q) : Subscriptor(), - n_quadrature_points (q.size()), quadrature_points (q.quadrature_points), weights (q.weights) {} @@ -265,7 +255,6 @@ Quadrature::operator= (const Quadrature& q) { weights = q.weights; quadrature_points = q.quadrature_points; - n_quadrature_points = q.size(); return *this; } diff --git a/deal.II/source/fe/fe_nedelec.cc b/deal.II/source/fe/fe_nedelec.cc index c024ab8133..f744500769 100644 --- a/deal.II/source/fe/fe_nedelec.cc +++ b/deal.II/source/fe/fe_nedelec.cc @@ -23,6 +23,7 @@ DEAL_II_NAMESPACE_OPEN +//#define DEBUG_NEDELEC template FE_Nedelec::FE_Nedelec (const unsigned int p) : @@ -36,6 +37,10 @@ FE_PolyTensor, dim> std::vector (dim, true))), deg (p) { +#ifdef DEBUG_NEDELEC + deallog << get_name() << std::endl; +#endif + Assert (dim >= 2, ExcImpossibleInDim(dim)); const unsigned int n_dofs = this->dofs_per_cell; @@ -58,11 +63,20 @@ deg (p) // matrices to the right sizes. // Restriction only for isotropic // refinement +#ifdef DEBUG_NEDELEC + deallog << "Embedding" << std::endl; +#endif this->reinit_restriction_and_prolongation_matrices (); // Fill prolongation matrices with embedding operators FETools::compute_embedding_matrices (*this, this->prolongation, true); +#ifdef DEBUG_NEDELEC + deallog << "Restriction" << std::endl; +#endif initialize_restriction (); - + +#ifdef DEBUG_NEDELEC + deallog << "Face Embedding" << std::endl; +#endif FullMatrix face_embeddings[GeometryInfo::max_children_per_face]; for (unsigned int i = 0; i < GeometryInfo::max_children_per_face; ++i) diff --git a/deal.II/source/fe/fe_q.cc b/deal.II/source/fe/fe_q.cc index c1d4f0ddfa..8bdede7b51 100644 --- a/deal.II/source/fe/fe_q.cc +++ b/deal.II/source/fe/fe_q.cc @@ -588,14 +588,14 @@ FE_Q::FE_Q (const Quadrature<1> &points) : FE_Poly, dim, spacedim> ( TensorProductPolynomials(Polynomials::generate_complete_Lagrange_basis(points.get_points())), - FiniteElementData(get_dpo_vector(points.n_quadrature_points-1), - 1, points.n_quadrature_points-1, + FiniteElementData(get_dpo_vector(points.size()-1), + 1, points.size()-1, FiniteElementData::H1), std::vector (1, false), std::vector >(1, std::vector(1,true))), - face_index_map(FE_Q_Helper::invert_numbering(face_lexicographic_to_hierarchic_numbering (points.n_quadrature_points-1))) + face_index_map(FE_Q_Helper::invert_numbering(face_lexicographic_to_hierarchic_numbering (points.size()-1))) { - const unsigned int degree = points.n_quadrature_points-1; + const unsigned int degree = points.size()-1; Assert (degree > 0, ExcMessage ("This element can only be used for polynomial degrees " diff --git a/deal.II/source/fe/mapping_q_eulerian.cc b/deal.II/source/fe/mapping_q_eulerian.cc index 6a1e9010cd..6f46d41c16 100644 --- a/deal.II/source/fe/mapping_q_eulerian.cc +++ b/deal.II/source/fe/mapping_q_eulerian.cc @@ -72,7 +72,7 @@ SupportQuadrature (const unsigned int map_degree) // trapezoidal quadrature rule. const QTrapez<1> q1d; const QIterated q_iterated(q1d,map_degree); - const unsigned int n_q_points = q_iterated.n_quadrature_points; + const unsigned int n_q_points = q_iterated.size(); // we then need to define a renumbering // vector that allows us to go from a @@ -150,7 +150,7 @@ compute_mapping_support_points // components appropriately, or create a // separate dof handler for the displacements. - const unsigned int n_support_pts = support_quadrature.n_quadrature_points; + const unsigned int n_support_pts = support_quadrature.size(); const unsigned int n_components = euler_dof_handler->get_fe().n_components(); Assert (n_components >= spacedim, ExcDimensionMismatch(n_components, spacedim) ); diff --git a/deal.II/source/numerics/data_out.cc b/deal.II/source/numerics/data_out.cc index 9a346cbf82..d72ff30abb 100644 --- a/deal.II/source/numerics/data_out.cc +++ b/deal.II/source/numerics/data_out.cc @@ -57,7 +57,7 @@ namespace internal ParallelDataBase (n_components, n_datasets, n_subdivisions, - quadrature.n_quadrature_points, + quadrature.size(), n_postprocessor_outputs, finite_elements), q_collection (quadrature), @@ -1077,7 +1077,7 @@ void DataOut::build_patches (const Mapping sample_patch; sample_patch.n_subdivisions = n_subdivisions; - sample_patch.data.reinit (n_datasets, patch_points.n_quadrature_points); + sample_patch.data.reinit (n_datasets, patch_points.size()); diff --git a/deal.II/source/numerics/data_out_faces.cc b/deal.II/source/numerics/data_out_faces.cc index 8760e59d56..cad21ea6b0 100644 --- a/deal.II/source/numerics/data_out_faces.cc +++ b/deal.II/source/numerics/data_out_faces.cc @@ -49,7 +49,7 @@ namespace internal ParallelDataBase (n_components, n_datasets, n_subdivisions, - quadrature.n_quadrature_points, + quadrature.size(), n_postprocessor_outputs, finite_elements), q_collection (quadrature), @@ -357,7 +357,7 @@ void DataOutFaces::build_patches (const Mapping &mapping, DataOutBase::Patch sample_patch; sample_patch.n_subdivisions = n_subdivisions; sample_patch.data.reinit (n_datasets, - patch_points.n_quadrature_points); + patch_points.size()); // now build the patches in parallel WorkStream::run (&all_faces[0], diff --git a/deal.II/source/numerics/data_out_rotation.cc b/deal.II/source/numerics/data_out_rotation.cc index 94a0e8f587..4d14e22165 100644 --- a/deal.II/source/numerics/data_out_rotation.cc +++ b/deal.II/source/numerics/data_out_rotation.cc @@ -62,7 +62,7 @@ namespace internal ParallelDataBase (n_components, n_datasets, n_subdivisions, - quadrature.n_quadrature_points, + quadrature.size(), n_postprocessor_outputs, finite_elements), n_patches_per_circle (n_patches_per_circle), @@ -507,7 +507,7 @@ void DataOutRotation::build_patches (const unsigned int n_patches_per_ci { new_patches[i].n_subdivisions = n_subdivisions; new_patches[i].data.reinit (n_datasets, - patch_points.n_quadrature_points + patch_points.size() * (n_subdivisions+1)); } diff --git a/deal.II/source/numerics/data_out_stack.cc b/deal.II/source/numerics/data_out_stack.cc index 8c24e7c3a9..59ed4fcc33 100644 --- a/deal.II/source/numerics/data_out_stack.cc +++ b/deal.II/source/numerics/data_out_stack.cc @@ -279,7 +279,7 @@ void DataOutStack::build_patches (const unsigned int nnnn_subdi hp::FEValues x_fe_patch_values (fe_collection, q_collection, update_values); - const unsigned int n_q_points = patch_points.n_quadrature_points; + const unsigned int n_q_points = patch_points.size(); std::vector patch_values (n_q_points); std::vector > patch_values_system (n_q_points, Vector(n_components)); diff --git a/deal.II/source/numerics/error_estimator.cc b/deal.II/source/numerics/error_estimator.cc index e2efdb9795..55106b8c3a 100644 --- a/deal.II/source/numerics/error_estimator.cc +++ b/deal.II/source/numerics/error_estimator.cc @@ -330,7 +330,7 @@ namespace internal void ParallelData::resize (const unsigned int active_fe_index) { - const unsigned int n_q_points = face_quadratures[active_fe_index].n_quadrature_points; + const unsigned int n_q_points = face_quadratures[active_fe_index].size(); const unsigned int n_components = finite_element.n_components(); normal_vectors.resize(n_q_points); @@ -420,8 +420,7 @@ namespace internal const unsigned int dim = DH::dimension; const typename DH::face_iterator face = cell->face(face_no); - const unsigned int n_q_points = parallel_data.face_quadratures[cell->active_fe_index()] - .n_quadrature_points, + const unsigned int n_q_points = parallel_data.face_quadratures[cell->active_fe_index()].size(), n_components = parallel_data.finite_element.n_components(), n_solution_vectors = solutions.size(); @@ -632,8 +631,7 @@ namespace internal const unsigned int dim = DH::dimension; const typename DH::cell_iterator neighbor = cell->neighbor(face_no); - const unsigned int n_q_points = parallel_data.face_quadratures[cell->active_fe_index()] - .n_quadrature_points, + const unsigned int n_q_points = parallel_data.face_quadratures[cell->active_fe_index()].size(), n_components = parallel_data.finite_element.n_components(), n_solution_vectors = solutions.size(); const typename DH::face_iterator -- 2.39.5