From ebe0ab78f6c155c0fec9134411deb40a6dd8bd38 Mon Sep 17 00:00:00 2001 From: Peter Munch Date: Fri, 3 Jul 2020 10:19:39 +0200 Subject: [PATCH] Replace dofs_per_vertex -> n_dofs_per_vertex() Replace dofs_per_cell -> n_dofs_per_cell() --- include/deal.II/base/quadrature_point_data.h | 6 +- include/deal.II/dofs/dof_accessor.h | 4 +- include/deal.II/dofs/dof_accessor.templates.h | 99 ++++++----- include/deal.II/dofs/dof_handler.h | 2 +- include/deal.II/dofs/dof_levels.h | 2 +- include/deal.II/fe/fe.h | 32 ++-- include/deal.II/fe/fe_bernstein.h | 8 +- include/deal.II/fe/fe_dgp.h | 8 +- include/deal.II/fe/fe_dgp_monomial.h | 10 +- include/deal.II/fe/fe_dgp_nonparametric.h | 8 +- include/deal.II/fe/fe_dgq.h | 10 +- include/deal.II/fe/fe_enriched.h | 8 +- include/deal.II/fe/fe_face.h | 16 +- include/deal.II/fe/fe_nedelec.h | 8 +- include/deal.II/fe/fe_poly.h | 26 +-- include/deal.II/fe/fe_poly.templates.h | 46 ++--- include/deal.II/fe/fe_poly_face.templates.h | 6 +- include/deal.II/fe/fe_poly_tensor.h | 32 ++-- include/deal.II/fe/fe_q_base.h | 10 +- include/deal.II/fe/fe_q_bubbles.h | 2 +- include/deal.II/fe/fe_q_dg0.h | 2 +- include/deal.II/fe/fe_q_hierarchical.h | 8 +- include/deal.II/fe/fe_system.h | 10 +- include/deal.II/fe/fe_tools.h | 10 +- include/deal.II/fe/fe_tools.templates.h | 168 +++++++++--------- .../fe/fe_tools_extrapolate.templates.h | 12 +- .../fe/fe_tools_interpolate.templates.h | 28 +-- include/deal.II/fe/fe_values.h | 68 +++---- include/deal.II/hp/fe_collection.h | 8 +- include/deal.II/integrators/l2.h | 4 +- include/deal.II/integrators/maxwell.h | 2 +- .../matrix_free/cuda_matrix_free.templates.h | 8 +- include/deal.II/matrix_free/fe_evaluation.h | 2 +- .../matrix_free/matrix_free.templates.h | 10 +- .../matrix_free/shape_info.templates.h | 17 +- include/deal.II/meshworker/dof_info.h | 6 +- include/deal.II/meshworker/scratch_data.h | 3 +- .../deal.II/multigrid/mg_transfer_internal.h | 2 +- .../multigrid/mg_transfer_matrix_free.h | 18 +- .../numerics/data_out_dof_data.templates.h | 4 +- .../numerics/matrix_creator.templates.h | 4 +- .../vector_tools_boundary.templates.h | 29 +-- .../vector_tools_interpolate.templates.h | 40 +++-- .../vector_tools_point_value.templates.h | 10 +- .../numerics/vector_tools_project.templates.h | 2 +- include/deal.II/particles/utilities.h | 4 +- source/distributed/cell_weights.cc | 5 +- source/distributed/solution_transfer.cc | 4 +- source/dofs/dof_accessor.cc | 2 +- source/dofs/dof_accessor_get.cc | 10 +- source/dofs/dof_accessor_set.cc | 10 +- source/dofs/dof_handler.cc | 46 ++--- source/dofs/dof_handler_policy.cc | 50 +++--- source/dofs/dof_renumbering.cc | 21 +-- source/dofs/dof_tools.cc | 95 +++++----- source/dofs/dof_tools_constraints.cc | 51 +++--- source/dofs/dof_tools_sparsity.cc | 90 +++++----- source/fe/fe.cc | 74 ++++---- source/fe/fe_abf.cc | 24 +-- source/fe/fe_bdm.cc | 12 +- source/fe/fe_bernardi_raugel.cc | 8 +- source/fe/fe_dgp.cc | 8 +- source/fe/fe_dgp_monomial.cc | 46 ++--- source/fe/fe_dgp_nonparametric.cc | 56 +++--- source/fe/fe_dgq.cc | 71 ++++---- source/fe/fe_enriched.cc | 14 +- source/fe/fe_face.cc | 16 +- source/fe/fe_nedelec.cc | 31 ++-- source/fe/fe_nedelec_sz.cc | 24 +-- source/fe/fe_p1nc.cc | 12 +- source/fe/fe_poly_tensor.cc | 18 +- source/fe/fe_q.cc | 4 +- source/fe/fe_q_base.cc | 74 ++++---- source/fe/fe_q_bubbles.cc | 25 +-- source/fe/fe_q_dg0.cc | 29 +-- source/fe/fe_q_hierarchical.cc | 86 ++++----- source/fe/fe_q_iso_q1.cc | 4 +- source/fe/fe_rannacher_turek.cc | 2 +- source/fe/fe_raviart_thomas.cc | 25 +-- source/fe/fe_raviart_thomas_nodal.cc | 20 +-- source/fe/fe_rt_bubbles.cc | 18 +- source/fe/fe_series_fourier.cc | 17 +- source/fe/fe_series_legendre.cc | 17 +- source/fe/fe_system.cc | 158 ++++++++-------- source/fe/fe_trace.cc | 18 +- source/fe/fe_values.cc | 52 +++--- source/fe/mapping_fe_field.cc | 9 +- source/fe/mapping_q1_eulerian.cc | 2 +- source/fe/mapping_q_eulerian.cc | 2 +- source/grid/grid_tools_dof_handlers.cc | 9 +- source/meshworker/scratch_data.cc | 12 +- source/multigrid/mg_tools.cc | 79 ++++---- source/multigrid/mg_transfer_block.cc | 14 +- source/multigrid/mg_transfer_component.cc | 8 +- source/multigrid/mg_transfer_internal.cc | 58 +++--- source/multigrid/mg_transfer_prebuilt.cc | 2 +- source/non_matching/coupling.cc | 40 +++-- source/numerics/point_value_history.cc | 4 +- source/numerics/smoothness_estimator.cc | 8 +- source/numerics/solution_transfer.cc | 18 +- source/particles/utilities.cc | 20 +-- 101 files changed, 1282 insertions(+), 1172 deletions(-) diff --git a/include/deal.II/base/quadrature_point_data.h b/include/deal.II/base/quadrature_point_data.h index d73796d345..7bb77b1314 100644 --- a/include/deal.II/base/quadrature_point_data.h +++ b/include/deal.II/base/quadrature_point_data.h @@ -897,8 +897,8 @@ namespace parallel std::unique_ptr>(projection_fe_.clone())) , data_size_in_bytes(0) , n_q_points(rhs_quadrature.size()) - , project_to_fe_matrix(projection_fe->dofs_per_cell, n_q_points) - , project_to_qp_matrix(n_q_points, projection_fe->dofs_per_cell) + , project_to_fe_matrix(projection_fe->n_dofs_per_cell(), n_q_points) + , project_to_qp_matrix(n_q_points, projection_fe->n_dofs_per_cell()) , handle(numbers::invalid_unsigned_int) , data_storage(nullptr) , triangulation(nullptr) @@ -1014,7 +1014,7 @@ namespace parallel { // we need to first use prolongation matrix to get dofvalues on child // cells based on dofvalues stored in the parent's data_store - matrix_dofs_child.reinit(projection_fe->dofs_per_cell, + matrix_dofs_child.reinit(projection_fe->n_dofs_per_cell(), number_of_values); for (unsigned int child = 0; child < cell->n_children(); ++child) if (cell->child(child)->is_locally_owned()) diff --git a/include/deal.II/dofs/dof_accessor.h b/include/deal.II/dofs/dof_accessor.h index 0cd63c5fb4..997e5befff 100644 --- a/include/deal.II/dofs/dof_accessor.h +++ b/include/deal.II/dofs/dof_accessor.h @@ -1810,7 +1810,7 @@ public: * * @param[out] dof_indices The vector into which the indices will be * written. It has to have the right size (namely, - * fe.dofs_per_cell, fe.dofs_per_face, or + * fe.n_dofs_per_cell(), fe.dofs_per_face, or * fe.dofs_per_line, depending on which kind of object this * function is called) before being passed to this function. * @@ -1827,7 +1827,7 @@ public: * argument to this function is called local_dof_indices by * convention. The name is not meant to indicate the local numbers of * degrees of freedom (which are always between zero and - * fe.dofs_per_cell) but instead that the returned values are + * fe.n_dofs_per_cell()) but instead that the returned values are * the global indices of those degrees of freedom that are located * locally on the current cell. * diff --git a/include/deal.II/dofs/dof_accessor.templates.h b/include/deal.II/dofs/dof_accessor.templates.h index a644468f20..dffbaa2dfb 100644 --- a/include/deal.II/dofs/dof_accessor.templates.h +++ b/include/deal.II/dofs/dof_accessor.templates.h @@ -247,7 +247,7 @@ namespace internal if (d == 0) dof_handler.object_dof_indices - [0][0][obj_index * dof_handler.get_fe().dofs_per_vertex + + [0][0][obj_index * dof_handler.get_fe().n_dofs_per_vertex() + local_index] = global_index; else dof_handler.object_dof_indices @@ -347,7 +347,7 @@ namespace internal if (d == 0) return dof_handler.object_dof_indices - [0][0][obj_index * dof_handler.get_fe().dofs_per_vertex + + [0][0][obj_index * dof_handler.get_fe().n_dofs_per_vertex() + local_index]; else return dof_handler.object_dof_indices @@ -432,7 +432,7 @@ namespace internal "hp::DoFHandler does not implement multilevel DoFs.")); return dof_handler.mg_vertex_dofs[vertex_index].get_index( - level, i, dof_handler.get_fe().dofs_per_vertex); + level, i, dof_handler.get_fe().n_dofs_per_vertex()); } @@ -450,7 +450,7 @@ namespace internal "hp::DoFHandler does not implement multilevel DoFs.")); return dof_handler.mg_vertex_dofs[vertex_index].set_index( - level, i, dof_handler.get_fe().dofs_per_vertex, index); + level, i, dof_handler.get_fe().n_dofs_per_vertex(), index); } @@ -610,7 +610,7 @@ namespace internal dof_indices.begin(); for (const unsigned int vertex : accessor.vertex_indices()) - for (unsigned int dof = 0; dof < fe.dofs_per_vertex; ++dof) + for (unsigned int dof = 0; dof < fe.n_dofs_per_vertex(); ++dof) accessor.set_mg_vertex_dof_index( level, vertex, dof, *next++, fe_index); @@ -635,7 +635,7 @@ namespace internal dof_indices.begin(); for (const unsigned int vertex : accessor.vertex_indices()) - for (unsigned int dof = 0; dof < fe.dofs_per_vertex; ++dof) + for (unsigned int dof = 0; dof < fe.n_dofs_per_vertex(); ++dof) accessor.set_mg_vertex_dof_index( level, vertex, dof, *next++, fe_index); @@ -665,7 +665,7 @@ namespace internal dof_indices.begin(); for (const unsigned int vertex : accessor.vertex_indices()) - for (unsigned int dof = 0; dof < fe.dofs_per_vertex; ++dof) + for (unsigned int dof = 0; dof < fe.n_dofs_per_vertex(); ++dof) accessor.set_mg_vertex_dof_index( level, vertex, dof, *next++, fe_index); @@ -806,11 +806,11 @@ namespace internal const unsigned int fe_index, const DoFOperation &) { - const unsigned int // - dofs_per_vertex = accessor.get_fe(fe_index).dofs_per_vertex, // - dofs_per_line = accessor.get_fe(fe_index).dofs_per_line, // - dofs_per_quad = accessor.get_fe(fe_index).dofs_per_quad, // - dofs_per_hex = accessor.get_fe(fe_index).dofs_per_hex; // + const unsigned int // + dofs_per_vertex = accessor.get_fe(fe_index).n_dofs_per_vertex(), // + dofs_per_line = accessor.get_fe(fe_index).dofs_per_line, // + dofs_per_quad = accessor.get_fe(fe_index).dofs_per_quad, // + dofs_per_hex = accessor.get_fe(fe_index).dofs_per_hex; // const unsigned int inner_dofs = structdim == 1 ? dofs_per_line : @@ -1187,13 +1187,13 @@ DoFAccessor::mg_vertex_dof_index( (void)fe_index; Assert(this->dof_handler != nullptr, ExcInvalidObject()); AssertIndexRange(vertex, this->n_vertices()); - AssertIndexRange(i, this->dof_handler->get_fe(fe_index).dofs_per_vertex); + AssertIndexRange(i, this->dof_handler->get_fe(fe_index).n_dofs_per_vertex()); Assert(dof_handler->hp_capability_enabled == false, ExcMessage("hp::DoFHandler does not implement multilevel DoFs.")); return this->dof_handler->mg_vertex_dofs[this->vertex_index(vertex)] - .get_index(level, i, this->dof_handler->get_fe().dofs_per_vertex); + .get_index(level, i, this->dof_handler->get_fe().n_dofs_per_vertex()); } @@ -1239,13 +1239,13 @@ DoFAccessor:: (void)fe_index; Assert(this->dof_handler != nullptr, ExcInvalidObject()); AssertIndexRange(vertex, this->n_vertices()); - AssertIndexRange(i, this->dof_handler->get_fe(fe_index).dofs_per_vertex); + AssertIndexRange(i, this->dof_handler->get_fe(fe_index).n_dofs_per_vertex()); Assert(dof_handler->hp_capability_enabled == false, ExcMessage("hp::DoFHandler does not implement multilevel DoFs.")); this->dof_handler->mg_vertex_dofs[this->vertex_index(vertex)].set_index( - level, i, this->dof_handler->get_fe().dofs_per_vertex, index); + level, i, this->dof_handler->get_fe().n_dofs_per_vertex(), index); } @@ -1293,7 +1293,7 @@ namespace internal std::vector::iterator next = dof_indices.begin(); for (const unsigned int vertex : accessor.vertex_indices()) - for (unsigned int dof = 0; dof < fe.dofs_per_vertex; ++dof) + for (unsigned int dof = 0; dof < fe.n_dofs_per_vertex(); ++dof) *next++ = accessor.mg_vertex_dof_index(level, vertex, dof); for (unsigned int dof = 0; dof < fe.dofs_per_line; ++dof) @@ -1318,7 +1318,7 @@ namespace internal std::vector::iterator next = dof_indices.begin(); for (const unsigned int vertex : accessor.vertex_indices()) - for (unsigned int dof = 0; dof < fe.dofs_per_vertex; ++dof) + for (unsigned int dof = 0; dof < fe.n_dofs_per_vertex(); ++dof) *next++ = accessor.mg_vertex_dof_index(level, vertex, dof); for (unsigned int line = 0; line < accessor.n_lines(); ++line) @@ -1347,7 +1347,7 @@ namespace internal std::vector::iterator next = dof_indices.begin(); for (const unsigned int vertex : accessor.vertex_indices()) - for (unsigned int dof = 0; dof < fe.dofs_per_vertex; ++dof) + for (unsigned int dof = 0; dof < fe.n_dofs_per_vertex(); ++dof) *next++ = accessor.mg_vertex_dof_index(level, vertex, dof); for (unsigned int line = 0; line < accessor.n_lines(); ++line) @@ -1406,14 +1406,14 @@ DoFAccessor::get_dof_indices( case 1: Assert(dof_indices.size() == (this->n_vertices() * - this->dof_handler->get_fe(fe_index).dofs_per_vertex + + this->dof_handler->get_fe(fe_index).n_dofs_per_vertex() + this->dof_handler->get_fe(fe_index).dofs_per_line), ExcVectorDoesNotMatch()); break; case 2: Assert(dof_indices.size() == (this->n_vertices() * - this->dof_handler->get_fe(fe_index).dofs_per_vertex + + this->dof_handler->get_fe(fe_index).n_dofs_per_vertex() + this->n_lines() * this->dof_handler->get_fe(fe_index).dofs_per_line + this->dof_handler->get_fe(fe_index).dofs_per_quad), @@ -1422,7 +1422,7 @@ DoFAccessor::get_dof_indices( case 3: Assert(dof_indices.size() == (this->n_vertices() * - this->dof_handler->get_fe(fe_index).dofs_per_vertex + + this->dof_handler->get_fe(fe_index).n_dofs_per_vertex() + this->n_lines() * this->dof_handler->get_fe(fe_index).dofs_per_line + this->n_faces() * @@ -1447,9 +1447,9 @@ DoFAccessor::get_dof_indices( // not allocated for this // non-active thing Assert(this->fe_index_is_active(fe_index) || - (this->dof_handler->get_fe(fe_index).dofs_per_cell == + (this->dof_handler->get_fe(fe_index).n_dofs_per_cell() == this->n_vertices() * - this->dof_handler->get_fe(fe_index).dofs_per_vertex), + this->dof_handler->get_fe(fe_index).n_dofs_per_vertex()), ExcInternalError()); // now do the actual work @@ -1479,14 +1479,14 @@ DoFAccessor::get_mg_dof_indices( case 1: Assert(dof_indices.size() == (this->n_vertices() * - this->dof_handler->get_fe(fe_index).dofs_per_vertex + + this->dof_handler->get_fe(fe_index).n_dofs_per_vertex() + this->dof_handler->get_fe(fe_index).dofs_per_line), ExcVectorDoesNotMatch()); break; case 2: Assert(dof_indices.size() == (this->n_vertices() * - this->dof_handler->get_fe(fe_index).dofs_per_vertex + + this->dof_handler->get_fe(fe_index).n_dofs_per_vertex() + this->n_lines() * this->dof_handler->get_fe(fe_index).dofs_per_line + this->dof_handler->get_fe(fe_index).dofs_per_quad), @@ -1495,7 +1495,7 @@ DoFAccessor::get_mg_dof_indices( case 3: Assert(dof_indices.size() == (this->n_vertices() * - this->dof_handler->get_fe(fe_index).dofs_per_vertex + + this->dof_handler->get_fe(fe_index).n_dofs_per_vertex() + this->n_lines() * this->dof_handler->get_fe(fe_index).dofs_per_line + this->n_faces() * @@ -1535,7 +1535,7 @@ DoFAccessor::set_mg_dof_indices( { Assert(dof_indices.size() == this->n_vertices() * - this->dof_handler->get_fe(fe_index).dofs_per_vertex + + this->dof_handler->get_fe(fe_index).n_dofs_per_vertex() + this->dof_handler->get_fe(fe_index).dofs_per_line, ExcVectorDoesNotMatch()); break; @@ -1545,7 +1545,7 @@ DoFAccessor::set_mg_dof_indices( { Assert(dof_indices.size() == this->n_vertices() * - this->dof_handler->get_fe(fe_index).dofs_per_vertex + + this->dof_handler->get_fe(fe_index).n_dofs_per_vertex() + this->n_lines() * this->dof_handler->get_fe(fe_index).dofs_per_line + this->dof_handler->get_fe(fe_index).dofs_per_quad, @@ -1557,7 +1557,7 @@ DoFAccessor::set_mg_dof_indices( { Assert(dof_indices.size() == this->n_vertices() * - this->dof_handler->get_fe(fe_index).dofs_per_vertex + + this->dof_handler->get_fe(fe_index).n_dofs_per_vertex() + this->n_lines() * this->dof_handler->get_fe(fe_index).dofs_per_line + this->n_faces() * @@ -2013,7 +2013,7 @@ namespace internal // FE_Nothing if (accessor.has_children()) return; - const unsigned int dofs_per_cell = accessor.get_fe().dofs_per_cell; + const unsigned int dofs_per_cell = accessor.get_fe().n_dofs_per_cell(); if (dofs_per_cell == 0) return; @@ -2407,9 +2407,9 @@ DoFCellAccessor:: ExcMessage("get_dof_indices() only works on active cells.")); Assert(this->is_artificial() == false, ExcMessage("Can't ask for DoF indices on artificial cells.")); - AssertDimension(dof_indices.size(), this->get_fe().dofs_per_cell); + AssertDimension(dof_indices.size(), this->get_fe().n_dofs_per_cell()); - const auto dofs_per_cell = this->get_fe().dofs_per_cell; + const auto dofs_per_cell = this->get_fe().n_dofs_per_cell(); if (dofs_per_cell > 0) { const types::global_dof_index *cache = @@ -2488,7 +2488,7 @@ DoFCellAccessor::get_dof_values( Assert(this->dof_handler != nullptr, typename BaseClass::ExcInvalidObject()); Assert(static_cast(local_values_end - local_values_begin) == - this->get_fe().dofs_per_cell, + this->get_fe().n_dofs_per_cell(), typename DoFCellAccessor::ExcVectorDoesNotMatch()); Assert(values.size() == this->get_dof_handler().n_dofs(), typename DoFCellAccessor::ExcVectorDoesNotMatch()); @@ -2498,11 +2498,11 @@ DoFCellAccessor::get_dof_values( this->dof_handler, this->present_level, this->present_index, - this->get_fe().dofs_per_cell); + this->get_fe().n_dofs_per_cell()); dealii::internal::DoFAccessorImplementation::Implementation:: extract_subvector_to(values, cache, - cache + this->get_fe().dofs_per_cell, + cache + this->get_fe().n_dofs_per_cell(), local_values_begin); } @@ -2522,7 +2522,7 @@ DoFCellAccessor::get_dof_values( Assert(this->is_active(), ExcMessage("Cell must be active.")); Assert(static_cast(local_values_end - local_values_begin) == - this->get_fe().dofs_per_cell, + this->get_fe().n_dofs_per_cell(), typename DoFCellAccessor::ExcVectorDoesNotMatch()); Assert(values.size() == this->get_dof_handler().n_dofs(), typename DoFCellAccessor::ExcVectorDoesNotMatch()); @@ -2533,7 +2533,7 @@ DoFCellAccessor::get_dof_values( this->dof_handler, this->present_level, this->present_index, - this->get_fe().dofs_per_cell); + this->get_fe().n_dofs_per_cell()); constraints.get_dof_values(values, *cache, @@ -2555,7 +2555,7 @@ DoFCellAccessor::set_dof_values( Assert(this->is_active(), ExcMessage("Cell must be active.")); Assert(static_cast(local_values.size()) == - this->get_fe().dofs_per_cell, + this->get_fe().n_dofs_per_cell(), typename DoFCellAccessor::ExcVectorDoesNotMatch()); Assert(values.size() == this->get_dof_handler().n_dofs(), typename DoFCellAccessor::ExcVectorDoesNotMatch()); @@ -2567,9 +2567,9 @@ DoFCellAccessor::set_dof_values( this->dof_handler, this->present_level, this->present_index, - this->get_fe().dofs_per_cell); + this->get_fe().n_dofs_per_cell()); - for (unsigned int i = 0; i < this->get_fe().dofs_per_cell; ++i, ++cache) + for (unsigned int i = 0; i < this->get_fe().n_dofs_per_cell(); ++i, ++cache) internal::ElementAccess::set(local_values(i), *cache, values); } @@ -2775,7 +2775,7 @@ DoFCellAccessor:: Assert(this->dof_handler != nullptr, (typename std::decay::type::ExcInvalidObject())); Assert(static_cast(local_source_end - local_source_begin) == - this->get_fe().dofs_per_cell, + this->get_fe().n_dofs_per_cell(), (typename std::decay::type::ExcVectorDoesNotMatch())); Assert(this->dof_handler->n_dofs() == global_destination.size(), (typename std::decay::type::ExcVectorDoesNotMatch())); @@ -2806,7 +2806,8 @@ DoFCellAccessor:: { Assert(this->dof_handler != nullptr, (typename std::decay::type::ExcInvalidObject())); - Assert(local_source_end - local_source_begin == this->get_fe().dofs_per_cell, + Assert(local_source_end - local_source_begin == + this->get_fe().n_dofs_per_cell(), (typename std::decay::type::ExcVectorDoesNotMatch())); Assert(this->dof_handler->n_dofs() == global_destination.size(), (typename std::decay::type::ExcVectorDoesNotMatch())); @@ -2837,9 +2838,9 @@ DoFCellAccessor:: { Assert(this->dof_handler != nullptr, (typename std::decay::type::ExcInvalidObject())); - Assert(local_source.m() == this->get_fe().dofs_per_cell, + Assert(local_source.m() == this->get_fe().n_dofs_per_cell(), (typename std::decay::type::ExcMatrixDoesNotMatch())); - Assert(local_source.n() == this->get_fe().dofs_per_cell, + Assert(local_source.n() == this->get_fe().n_dofs_per_cell(), (typename std::decay::type::ExcMatrixDoesNotMatch())); Assert(this->dof_handler->n_dofs() == global_destination.m(), (typename std::decay::type::ExcMatrixDoesNotMatch())); @@ -2872,22 +2873,22 @@ DoFCellAccessor:: { Assert(this->dof_handler != nullptr, (typename std::decay::type::ExcInvalidObject())); - Assert(local_matrix.m() == this->get_fe().dofs_per_cell, + Assert(local_matrix.m() == this->get_fe().n_dofs_per_cell(), (typename std::decay::type::ExcMatrixDoesNotMatch())); - Assert(local_matrix.n() == this->get_fe().dofs_per_cell, + Assert(local_matrix.n() == this->get_fe().n_dofs_per_cell(), (typename std::decay::type::ExcVectorDoesNotMatch())); Assert(this->dof_handler->n_dofs() == global_matrix.m(), (typename std::decay::type::ExcMatrixDoesNotMatch())); Assert(this->dof_handler->n_dofs() == global_matrix.n(), (typename std::decay::type::ExcMatrixDoesNotMatch())); - Assert(local_vector.size() == this->get_fe().dofs_per_cell, + Assert(local_vector.size() == this->get_fe().n_dofs_per_cell(), (typename std::decay::type::ExcVectorDoesNotMatch())); Assert(this->dof_handler->n_dofs() == global_vector.size(), (typename std::decay::type::ExcVectorDoesNotMatch())); Assert(!this->has_children(), ExcMessage("Cell must be active.")); - const unsigned int n_dofs = this->get_fe().dofs_per_cell; + const unsigned int n_dofs = this->get_fe().n_dofs_per_cell(); const types::global_dof_index *dofs = dealii::internal::DoFAccessorImplementation::Implementation::get_cache_ptr( this->dof_handler, this->level(), this->present_index, n_dofs); diff --git a/include/deal.II/dofs/dof_handler.h b/include/deal.II/dofs/dof_handler.h index c770bc8678..f727ef1e27 100644 --- a/include/deal.II/dofs/dof_handler.h +++ b/include/deal.II/dofs/dof_handler.h @@ -1352,7 +1352,7 @@ private: * on the various levels this vertex exists on. * * The starting offset of the DoFs that belong to a @p level are given by - * dofs_per_vertex * (level-coarsest_level). @p dofs_per_vertex + * n_dofs_per_vertex() * (level-coarsest_level). @p n_dofs_per_vertex() * must therefore be passed as an argument to the functions that set or * read an index. */ diff --git a/include/deal.II/dofs/dof_levels.h b/include/deal.II/dofs/dof_levels.h index f5450a3976..4512e520e1 100644 --- a/include/deal.II/dofs/dof_levels.h +++ b/include/deal.II/dofs/dof_levels.h @@ -71,7 +71,7 @@ namespace internal public: /** * Cache for the DoF indices on cells. The size of this array equals the - * number of cells on a given level times selected_fe.dofs_per_cell. + * number of cells on a given level times selected_fe.n_dofs_per_cell(). */ std::vector cell_dof_indices_cache; diff --git a/include/deal.II/fe/fe.h b/include/deal.II/fe/fe.h index ab1f003384..49d7098419 100644 --- a/include/deal.II/fe/fe.h +++ b/include/deal.II/fe/fe.h @@ -484,10 +484,10 @@ class FESystem; * following piece of code in the constructor of a class derived from * FiniteElement to compute the $M$ matrix: * @code - * FullMatrix M(this->dofs_per_cell, this->dofs_per_cell); + * FullMatrix M(this->n_dofs_per_cell(), this->n_dofs_per_cell()); * FETools::compute_node_matrix(M, *this); - * this->inverse_node_matrix.reinit(this->dofs_per_cell, this->dofs_per_cell); - * this->inverse_node_matrix.invert(M); + * this->inverse_node_matrix.reinit(this->n_dofs_per_cell(), + * this->n_dofs_per_cell()); this->inverse_node_matrix.invert(M); * @endcode * Don't forget to make sure * that #unit_support_points or #generalized_support_points are initialized @@ -509,8 +509,8 @@ class FESystem; * In the latter case, all that is required is the following piece of code: * @code * for (unsigned int c=0; c::max_children_per_cell; ++c) - * this->prolongation[c].reinit (this->dofs_per_cell, - * this->dofs_per_cell); + * this->prolongation[c].reinit (this->n_dofs_per_cell(), + * this->n_dofs_per_cell()); * FETools::compute_embedding_matrices (*this, this->prolongation); * @endcode * As in this example, prolongation is almost always implemented via @@ -824,7 +824,7 @@ public: * version hp::DoFHandler, since one can then write code like this: * @code * dofs_per_cell = - * dof_handler->get_fe()[cell->active_fe_index()].dofs_per_cell; + * dof_handler->get_fe()[cell->active_fe_index()].n_dofs_per_cell(); * @endcode * * This code doesn't work in both situations without the present operator @@ -1321,10 +1321,10 @@ public: * reference to a finite element object representing one of the other finite * elements active on this particular vertex. The function computes which of * the degrees of freedom of the two finite element objects are equivalent, - * both numbered between zero and the corresponding value of dofs_per_vertex - * of the two finite elements. The first index of each pair denotes one of - * the vertex dofs of the present element, whereas the second is the - * corresponding index of the other finite element. + * both numbered between zero and the corresponding value of + * n_dofs_per_vertex() of the two finite elements. The first index of each + * pair denotes one of the vertex dofs of the present element, whereas the + * second is the corresponding index of the other finite element. */ virtual std::vector> hp_vertex_dof_identities(const FiniteElement &fe_other) const; @@ -3205,7 +3205,7 @@ inline std::pair FiniteElement::system_to_block_index( const unsigned int index) const { - AssertIndexRange(index, this->dofs_per_cell); + AssertIndexRange(index, this->n_dofs_per_cell()); // The block is computed simply as // first block of this base plus // the index within the base blocks @@ -3222,7 +3222,7 @@ inline bool FiniteElement::restriction_is_additive( const unsigned int index) const { - AssertIndexRange(index, this->dofs_per_cell); + AssertIndexRange(index, this->n_dofs_per_cell()); return restriction_is_additive_flags[index]; } @@ -3232,7 +3232,7 @@ template inline const ComponentMask & FiniteElement::get_nonzero_components(const unsigned int i) const { - AssertIndexRange(i, this->dofs_per_cell); + AssertIndexRange(i, this->n_dofs_per_cell()); return nonzero_components[i]; } @@ -3242,7 +3242,7 @@ template inline unsigned int FiniteElement::n_nonzero_components(const unsigned int i) const { - AssertIndexRange(i, this->dofs_per_cell); + AssertIndexRange(i, this->n_dofs_per_cell()); return n_nonzero_components_table[i]; } @@ -3261,7 +3261,7 @@ template inline bool FiniteElement::is_primitive(const unsigned int i) const { - AssertIndexRange(i, this->dofs_per_cell); + AssertIndexRange(i, this->n_dofs_per_cell()); // return primitivity of a shape // function by checking whether it @@ -3285,7 +3285,7 @@ inline GeometryPrimitive FiniteElement::get_associated_geometry_primitive( const unsigned int cell_dof_index) const { - AssertIndexRange(cell_dof_index, this->dofs_per_cell); + AssertIndexRange(cell_dof_index, this->n_dofs_per_cell()); // just go through the usual cases, taking into account how DoFs // are enumerated on the reference cell diff --git a/include/deal.II/fe/fe_bernstein.h b/include/deal.II/fe/fe_bernstein.h index 136c566e78..a88638272f 100644 --- a/include/deal.II/fe/fe_bernstein.h +++ b/include/deal.II/fe/fe_bernstein.h @@ -150,10 +150,10 @@ public: * reference to a finite element object representing one of the other finite * elements active on this particular vertex. The function computes which of * the degrees of freedom of the two finite element objects are equivalent, - * both numbered between zero and the corresponding value of dofs_per_vertex - * of the two finite elements. The first index of each pair denotes one of - * the vertex dofs of the present element, whereas the second is the - * corresponding index of the other finite element. + * both numbered between zero and the corresponding value of + * n_dofs_per_vertex() of the two finite elements. The first index of each + * pair denotes one of the vertex dofs of the present element, whereas the + * second is the corresponding index of the other finite element. */ virtual std::vector> hp_vertex_dof_identities( diff --git a/include/deal.II/fe/fe_dgp.h b/include/deal.II/fe/fe_dgp.h index c8e71cc2df..007fd1a388 100644 --- a/include/deal.II/fe/fe_dgp.h +++ b/include/deal.II/fe/fe_dgp.h @@ -337,10 +337,10 @@ public: * reference to a finite element object representing one of the other finite * elements active on this particular vertex. The function computes which of * the degrees of freedom of the two finite element objects are equivalent, - * both numbered between zero and the corresponding value of dofs_per_vertex - * of the two finite elements. The first index of each pair denotes one of - * the vertex dofs of the present element, whereas the second is the - * corresponding index of the other finite element. + * both numbered between zero and the corresponding value of + * n_dofs_per_vertex() of the two finite elements. The first index of each + * pair denotes one of the vertex dofs of the present element, whereas the + * second is the corresponding index of the other finite element. * * This being a discontinuous element, the set of such constraints is of * course empty. diff --git a/include/deal.II/fe/fe_dgp_monomial.h b/include/deal.II/fe/fe_dgp_monomial.h index 518827193b..30488ff42c 100644 --- a/include/deal.II/fe/fe_dgp_monomial.h +++ b/include/deal.II/fe/fe_dgp_monomial.h @@ -312,10 +312,10 @@ public: * reference to a finite element object representing one of the other finite * elements active on this particular vertex. The function computes which of * the degrees of freedom of the two finite element objects are equivalent, - * both numbered between zero and the corresponding value of dofs_per_vertex - * of the two finite elements. The first index of each pair denotes one of - * the vertex dofs of the present element, whereas the second is the - * corresponding index of the other finite element. + * both numbered between zero and the corresponding value of + * n_dofs_per_vertex() of the two finite elements. The first index of each + * pair denotes one of the vertex dofs of the present element, whereas the + * second is the corresponding index of the other finite element. * * This being a discontinuous element, the set of such constraints is of * course empty. @@ -368,7 +368,7 @@ public: /** * Return the matrix interpolating from the given finite element to the * present one. The size of the matrix is then @p dofs_per_cell times - * source.dofs_per_cell. + * source.n_dofs_per_cell(). * * These matrices are only available if the source element is also a @p FE_Q * element. Otherwise, an exception of type diff --git a/include/deal.II/fe/fe_dgp_nonparametric.h b/include/deal.II/fe/fe_dgp_nonparametric.h index acaa2901e8..09de0822dd 100644 --- a/include/deal.II/fe/fe_dgp_nonparametric.h +++ b/include/deal.II/fe/fe_dgp_nonparametric.h @@ -426,10 +426,10 @@ public: * reference to a finite element object representing one of the other finite * elements active on this particular vertex. The function computes which of * the degrees of freedom of the two finite element objects are equivalent, - * both numbered between zero and the corresponding value of dofs_per_vertex - * of the two finite elements. The first index of each pair denotes one of - * the vertex dofs of the present element, whereas the second is the - * corresponding index of the other finite element. + * both numbered between zero and the corresponding value of + * n_dofs_per_vertex() of the two finite elements. The first index of each + * pair denotes one of the vertex dofs of the present element, whereas the + * second is the corresponding index of the other finite element. * * This being a discontinuous element, the set of such constraints is of * course empty. diff --git a/include/deal.II/fe/fe_dgq.h b/include/deal.II/fe/fe_dgq.h index e2d9f5d049..ed1e2a9baa 100644 --- a/include/deal.II/fe/fe_dgq.h +++ b/include/deal.II/fe/fe_dgq.h @@ -129,7 +129,7 @@ public: /** * Return the matrix interpolating from the given finite element to the * present one. The size of the matrix is then @p dofs_per_cell times - * source.dofs_per_cell. + * source.n_dofs_per_cell(). * * These matrices are only available if the source element is also a @p * FE_DGQ element. Otherwise, an exception of type @@ -235,10 +235,10 @@ public: * reference to a finite element object representing one of the other finite * elements active on this particular vertex. The function computes which of * the degrees of freedom of the two finite element objects are equivalent, - * both numbered between zero and the corresponding value of dofs_per_vertex - * of the two finite elements. The first index of each pair denotes one of - * the vertex dofs of the present element, whereas the second is the - * corresponding index of the other finite element. + * both numbered between zero and the corresponding value of + * n_dofs_per_vertex() of the two finite elements. The first index of each + * pair denotes one of the vertex dofs of the present element, whereas the + * second is the corresponding index of the other finite element. * * This being a discontinuous element, the set of such constraints is of * course empty. diff --git a/include/deal.II/fe/fe_enriched.h b/include/deal.II/fe/fe_enriched.h index a9a952e3d2..e34b3cf96c 100644 --- a/include/deal.II/fe/fe_enriched.h +++ b/include/deal.II/fe/fe_enriched.h @@ -426,10 +426,10 @@ public: * reference to a finite element object representing one of the other finite * elements active on this particular vertex. The function computes which of * the degrees of freedom of the two finite element objects are equivalent, - * both numbered between zero and the corresponding value of dofs_per_vertex - * of the two finite elements. The first index of each pair denotes one of - * the vertex dofs of the present element, whereas the second is the - * corresponding index of the other finite element. + * both numbered between zero and the corresponding value of + * n_dofs_per_vertex() of the two finite elements. The first index of each + * pair denotes one of the vertex dofs of the present element, whereas the + * second is the corresponding index of the other finite element. */ virtual std::vector> hp_vertex_dof_identities( diff --git a/include/deal.II/fe/fe_face.h b/include/deal.II/fe/fe_face.h index f83d891e33..34717b6cb5 100644 --- a/include/deal.II/fe/fe_face.h +++ b/include/deal.II/fe/fe_face.h @@ -134,10 +134,10 @@ public: * reference to a finite element object representing one of the other finite * elements active on this particular vertex. The function computes which of * the degrees of freedom of the two finite element objects are equivalent, - * both numbered between zero and the corresponding value of dofs_per_vertex - * of the two finite elements. The first index of each pair denotes one of - * the vertex dofs of the present element, whereas the second is the - * corresponding index of the other finite element. + * both numbered between zero and the corresponding value of + * n_dofs_per_vertex() of the two finite elements. The first index of each + * pair denotes one of the vertex dofs of the present element, whereas the + * second is the corresponding index of the other finite element. * * The set of such constraints is non-empty only for dim==1. */ @@ -284,10 +284,10 @@ public: * reference to a finite element object representing one of the other finite * elements active on this particular vertex. The function computes which of * the degrees of freedom of the two finite element objects are equivalent, - * both numbered between zero and the corresponding value of dofs_per_vertex - * of the two finite elements. The first index of each pair denotes one of - * the vertex dofs of the present element, whereas the second is the - * corresponding index of the other finite element. + * both numbered between zero and the corresponding value of + * n_dofs_per_vertex() of the two finite elements. The first index of each + * pair denotes one of the vertex dofs of the present element, whereas the + * second is the corresponding index of the other finite element. * * The set of such constraints is non-empty only for dim==1. */ diff --git a/include/deal.II/fe/fe_nedelec.h b/include/deal.II/fe/fe_nedelec.h index 7734bf48c3..c1c8fc333c 100644 --- a/include/deal.II/fe/fe_nedelec.h +++ b/include/deal.II/fe/fe_nedelec.h @@ -203,10 +203,10 @@ public: * reference to a finite element object representing one of the other finite * elements active on this particular vertex. The function computes which of * the degrees of freedom of the two finite element objects are equivalent, - * both numbered between zero and the corresponding value of dofs_per_vertex - * of the two finite elements. The first index of each pair denotes one of - * the vertex dofs of the present element, whereas the second is the - * corresponding index of the other finite element. + * both numbered between zero and the corresponding value of + * n_dofs_per_vertex() of the two finite elements. The first index of each + * pair denotes one of the vertex dofs of the present element, whereas the + * second is the corresponding index of the other finite element. */ virtual std::vector> hp_vertex_dof_identities(const FiniteElement &fe_other) const override; diff --git a/include/deal.II/fe/fe_poly.h b/include/deal.II/fe/fe_poly.h index 29171c9add..94e63ba164 100644 --- a/include/deal.II/fe/fe_poly.h +++ b/include/deal.II/fe/fe_poly.h @@ -273,13 +273,13 @@ protected: // polynomial to put the values and derivatives of shape functions // to put there, depending on what the user requested std::vector values( - update_flags & update_values ? this->dofs_per_cell : 0); + update_flags & update_values ? this->n_dofs_per_cell() : 0); std::vector> grads( - update_flags & update_gradients ? this->dofs_per_cell : 0); + update_flags & update_gradients ? this->n_dofs_per_cell() : 0); std::vector> grad_grads( - update_flags & update_hessians ? this->dofs_per_cell : 0); + update_flags & update_hessians ? this->n_dofs_per_cell() : 0); std::vector> third_derivatives( - update_flags & update_3rd_derivatives ? this->dofs_per_cell : 0); + update_flags & update_3rd_derivatives ? this->n_dofs_per_cell() : 0); std::vector> fourth_derivatives; // won't be needed, so leave empty @@ -302,16 +302,16 @@ protected: if ((update_flags & update_values) && !((output_data.shape_values.n_rows() > 0) && (output_data.shape_values.n_cols() == n_q_points))) - data.shape_values.reinit(this->dofs_per_cell, n_q_points); + data.shape_values.reinit(this->n_dofs_per_cell(), n_q_points); if (update_flags & update_gradients) - data.shape_gradients.reinit(this->dofs_per_cell, n_q_points); + data.shape_gradients.reinit(this->n_dofs_per_cell(), n_q_points); if (update_flags & update_hessians) - data.shape_hessians.reinit(this->dofs_per_cell, n_q_points); + data.shape_hessians.reinit(this->n_dofs_per_cell(), n_q_points); if (update_flags & update_3rd_derivatives) - data.shape_3rd_derivatives.reinit(this->dofs_per_cell, n_q_points); + data.shape_3rd_derivatives.reinit(this->n_dofs_per_cell(), n_q_points); // next already fill those fields of which we have information by // now. note that the shape gradients are only those on the unit @@ -338,10 +338,10 @@ protected: if (output_data.shape_values.n_rows() > 0) { if (output_data.shape_values.n_cols() == n_q_points) - for (unsigned int k = 0; k < this->dofs_per_cell; ++k) + for (unsigned int k = 0; k < this->n_dofs_per_cell(); ++k) output_data.shape_values[k][i] = values[k]; else - for (unsigned int k = 0; k < this->dofs_per_cell; ++k) + for (unsigned int k = 0; k < this->n_dofs_per_cell(); ++k) data.shape_values[k][i] = values[k]; } @@ -349,15 +349,15 @@ protected: // so we write them into our scratch space and only later // copy stuff into where FEValues wants it if (update_flags & update_gradients) - for (unsigned int k = 0; k < this->dofs_per_cell; ++k) + for (unsigned int k = 0; k < this->n_dofs_per_cell(); ++k) data.shape_gradients[k][i] = grads[k]; if (update_flags & update_hessians) - for (unsigned int k = 0; k < this->dofs_per_cell; ++k) + for (unsigned int k = 0; k < this->n_dofs_per_cell(); ++k) data.shape_hessians[k][i] = grad_grads[k]; if (update_flags & update_3rd_derivatives) - for (unsigned int k = 0; k < this->dofs_per_cell; ++k) + for (unsigned int k = 0; k < this->n_dofs_per_cell(); ++k) data.shape_3rd_derivatives[k][i] = third_derivatives[k]; } return data_ptr; diff --git a/include/deal.II/fe/fe_poly.templates.h b/include/deal.II/fe/fe_poly.templates.h index 2c45729306..c4bcb2c100 100644 --- a/include/deal.II/fe/fe_poly.templates.h +++ b/include/deal.II/fe/fe_poly.templates.h @@ -59,7 +59,7 @@ double FE_Poly::shape_value(const unsigned int i, const Point & p) const { - AssertIndexRange(i, this->dofs_per_cell); + AssertIndexRange(i, this->n_dofs_per_cell()); return poly_space->compute_value(i, p); } @@ -72,7 +72,7 @@ FE_Poly::shape_value_component( const unsigned int component) const { (void)component; - AssertIndexRange(i, this->dofs_per_cell); + AssertIndexRange(i, this->n_dofs_per_cell()); AssertIndexRange(component, 1); return poly_space->compute_value(i, p); } @@ -84,7 +84,7 @@ Tensor<1, dim> FE_Poly::shape_grad(const unsigned int i, const Point & p) const { - AssertIndexRange(i, this->dofs_per_cell); + AssertIndexRange(i, this->n_dofs_per_cell()); return poly_space->template compute_derivative<1>(i, p); } @@ -97,7 +97,7 @@ FE_Poly::shape_grad_component(const unsigned int i, const unsigned int component) const { (void)component; - AssertIndexRange(i, this->dofs_per_cell); + AssertIndexRange(i, this->n_dofs_per_cell()); AssertIndexRange(component, 1); return poly_space->template compute_derivative<1>(i, p); } @@ -109,7 +109,7 @@ Tensor<2, dim> FE_Poly::shape_grad_grad(const unsigned int i, const Point & p) const { - AssertIndexRange(i, this->dofs_per_cell); + AssertIndexRange(i, this->n_dofs_per_cell()); return poly_space->template compute_derivative<2>(i, p); } @@ -123,7 +123,7 @@ FE_Poly::shape_grad_grad_component( const unsigned int component) const { (void)component; - AssertIndexRange(i, this->dofs_per_cell); + AssertIndexRange(i, this->n_dofs_per_cell()); AssertIndexRange(component, 1); return poly_space->template compute_derivative<2>(i, p); } @@ -135,7 +135,7 @@ Tensor<3, dim> FE_Poly::shape_3rd_derivative(const unsigned int i, const Point & p) const { - AssertIndexRange(i, this->dofs_per_cell); + AssertIndexRange(i, this->n_dofs_per_cell()); return poly_space->template compute_derivative<3>(i, p); } @@ -149,7 +149,7 @@ FE_Poly::shape_3rd_derivative_component( const unsigned int component) const { (void)component; - AssertIndexRange(i, this->dofs_per_cell); + AssertIndexRange(i, this->n_dofs_per_cell()); AssertIndexRange(component, 1); return poly_space->template compute_derivative<3>(i, p); } @@ -161,7 +161,7 @@ Tensor<4, dim> FE_Poly::shape_4th_derivative(const unsigned int i, const Point & p) const { - AssertIndexRange(i, this->dofs_per_cell); + AssertIndexRange(i, this->n_dofs_per_cell()); return poly_space->template compute_derivative<4>(i, p); } @@ -175,7 +175,7 @@ FE_Poly::shape_4th_derivative_component( const unsigned int component) const { (void)component; - AssertIndexRange(i, this->dofs_per_cell); + AssertIndexRange(i, this->n_dofs_per_cell()); AssertIndexRange(component, 1); return poly_space->template compute_derivative<4>(i, p); } @@ -295,7 +295,7 @@ FE_Poly::fill_fe_values( // we were in get_data() if (flags & update_gradients && cell_similarity != CellSimilarity::translation) - for (unsigned int k = 0; k < this->dofs_per_cell; ++k) + for (unsigned int k = 0; k < this->n_dofs_per_cell(); ++k) mapping.transform(make_array_view(fe_data.shape_gradients, k), mapping_covariant, mapping_internal, @@ -303,7 +303,7 @@ FE_Poly::fill_fe_values( if (flags & update_hessians && cell_similarity != CellSimilarity::translation) { - for (unsigned int k = 0; k < this->dofs_per_cell; ++k) + for (unsigned int k = 0; k < this->n_dofs_per_cell(); ++k) mapping.transform(make_array_view(fe_data.shape_hessians, k), mapping_covariant_gradient, mapping_internal, @@ -316,7 +316,7 @@ FE_Poly::fill_fe_values( if (flags & update_3rd_derivatives && cell_similarity != CellSimilarity::translation) { - for (unsigned int k = 0; k < this->dofs_per_cell; ++k) + for (unsigned int k = 0; k < this->n_dofs_per_cell(); ++k) mapping.transform(make_array_view(fe_data.shape_3rd_derivatives, k), mapping_covariant_hessian, mapping_internal, @@ -377,12 +377,12 @@ FE_Poly::fill_fe_face_values( // the values (unlike in the case of fill_fe_values()) since // we need to take into account the offsets if (flags & update_values) - for (unsigned int k = 0; k < this->dofs_per_cell; ++k) + for (unsigned int k = 0; k < this->n_dofs_per_cell(); ++k) for (unsigned int i = 0; i < quadrature.size(); ++i) output_data.shape_values(k, i) = fe_data.shape_values[k][i + offset]; if (flags & update_gradients) - for (unsigned int k = 0; k < this->dofs_per_cell; ++k) + for (unsigned int k = 0; k < this->n_dofs_per_cell(); ++k) mapping.transform( make_array_view(fe_data.shape_gradients, k, offset, quadrature.size()), mapping_covariant, @@ -391,7 +391,7 @@ FE_Poly::fill_fe_face_values( if (flags & update_hessians) { - for (unsigned int k = 0; k < this->dofs_per_cell; ++k) + for (unsigned int k = 0; k < this->n_dofs_per_cell(); ++k) mapping.transform( make_array_view(fe_data.shape_hessians, k, offset, quadrature.size()), mapping_covariant_gradient, @@ -404,7 +404,7 @@ FE_Poly::fill_fe_face_values( if (flags & update_3rd_derivatives) { - for (unsigned int k = 0; k < this->dofs_per_cell; ++k) + for (unsigned int k = 0; k < this->n_dofs_per_cell(); ++k) mapping.transform(make_array_view(fe_data.shape_3rd_derivatives, k, offset, @@ -471,12 +471,12 @@ FE_Poly::fill_fe_subface_values( // the values (unlike in the case of fill_fe_values()) since // we need to take into account the offsets if (flags & update_values) - for (unsigned int k = 0; k < this->dofs_per_cell; ++k) + for (unsigned int k = 0; k < this->n_dofs_per_cell(); ++k) for (unsigned int i = 0; i < quadrature.size(); ++i) output_data.shape_values(k, i) = fe_data.shape_values[k][i + offset]; if (flags & update_gradients) - for (unsigned int k = 0; k < this->dofs_per_cell; ++k) + for (unsigned int k = 0; k < this->n_dofs_per_cell(); ++k) mapping.transform( make_array_view(fe_data.shape_gradients, k, offset, quadrature.size()), mapping_covariant, @@ -485,7 +485,7 @@ FE_Poly::fill_fe_subface_values( if (flags & update_hessians) { - for (unsigned int k = 0; k < this->dofs_per_cell; ++k) + for (unsigned int k = 0; k < this->n_dofs_per_cell(); ++k) mapping.transform( make_array_view(fe_data.shape_hessians, k, offset, quadrature.size()), mapping_covariant_gradient, @@ -498,7 +498,7 @@ FE_Poly::fill_fe_subface_values( if (flags & update_3rd_derivatives) { - for (unsigned int k = 0; k < this->dofs_per_cell; ++k) + for (unsigned int k = 0; k < this->n_dofs_per_cell(); ++k) mapping.transform(make_array_view(fe_data.shape_3rd_derivatives, k, offset, @@ -524,7 +524,7 @@ FE_Poly::correct_hessians( & mapping_data, const unsigned int n_q_points) const { - for (unsigned int dof = 0; dof < this->dofs_per_cell; ++dof) + for (unsigned int dof = 0; dof < this->n_dofs_per_cell(); ++dof) for (unsigned int i = 0; i < n_q_points; ++i) for (unsigned int j = 0; j < spacedim; ++j) output_data.shape_hessians[dof][i] -= @@ -543,7 +543,7 @@ FE_Poly::correct_third_derivatives( & mapping_data, const unsigned int n_q_points) const { - for (unsigned int dof = 0; dof < this->dofs_per_cell; ++dof) + for (unsigned int dof = 0; dof < this->n_dofs_per_cell(); ++dof) for (unsigned int i = 0; i < n_q_points; ++i) for (unsigned int j = 0; j < spacedim; ++j) for (unsigned int k = 0; k < spacedim; ++k) diff --git a/include/deal.II/fe/fe_poly_face.templates.h b/include/deal.II/fe/fe_poly_face.templates.h index 68f8b6dc2a..9599cc539a 100644 --- a/include/deal.II/fe/fe_poly_face.templates.h +++ b/include/deal.II/fe/fe_poly_face.templates.h @@ -134,7 +134,7 @@ FE_PolyFace::fill_fe_face_values( if (fe_data.update_each & update_values) for (unsigned int i = 0; i < quadrature.size(); ++i) { - for (unsigned int k = 0; k < this->dofs_per_cell; ++k) + for (unsigned int k = 0; k < this->n_dofs_per_cell(); ++k) output_data.shape_values(k, i) = 0.; switch (dim) { @@ -182,7 +182,7 @@ FE_PolyFace::fill_fe_face_values( case 1: { // Fill data for vertex shape functions - if (this->dofs_per_vertex != 0) + if (this->n_dofs_per_vertex() != 0) for (unsigned int lvertex = 0; lvertex < GeometryInfo::vertices_per_face; ++lvertex) @@ -227,7 +227,7 @@ FE_PolyFace::fill_fe_subface_values( if (fe_data.update_each & update_values) { - for (unsigned int k = 0; k < this->dofs_per_cell; ++k) + for (unsigned int k = 0; k < this->n_dofs_per_cell(); ++k) for (unsigned int i = 0; i < quadrature.size(); ++i) output_data.shape_values(k, i) = 0.; for (unsigned int k = 0; k < fe_data.shape_values.size(); ++k) diff --git a/include/deal.II/fe/fe_poly_tensor.h b/include/deal.II/fe/fe_poly_tensor.h index f4da13a153..914e1ec089 100644 --- a/include/deal.II/fe/fe_poly_tensor.h +++ b/include/deal.II/fe/fe_poly_tensor.h @@ -260,7 +260,7 @@ protected: std::vector> fourth_derivatives(0); if (update_flags & (update_values | update_gradients | update_hessians)) - data.sign_change.resize(this->dofs_per_cell); + data.sign_change.resize(this->n_dofs_per_cell()); // initialize fields only if really // necessary. otherwise, don't @@ -284,16 +284,16 @@ protected: if (update_flags & update_values) { - values.resize(this->dofs_per_cell); - data.shape_values.reinit(this->dofs_per_cell, n_q_points); + values.resize(this->n_dofs_per_cell()); + data.shape_values.reinit(this->n_dofs_per_cell(), n_q_points); if (update_transformed_shape_values) data.transformed_shape_values.resize(n_q_points); } if (update_flags & update_gradients) { - grads.resize(this->dofs_per_cell); - data.shape_grads.reinit(this->dofs_per_cell, n_q_points); + grads.resize(this->n_dofs_per_cell()); + data.shape_grads.reinit(this->n_dofs_per_cell(), n_q_points); data.transformed_shape_grads.resize(n_q_points); if (update_transformed_shape_grads) @@ -302,8 +302,8 @@ protected: if (update_flags & update_hessians) { - grad_grads.resize(this->dofs_per_cell); - data.shape_grad_grads.reinit(this->dofs_per_cell, n_q_points); + grad_grads.resize(this->n_dofs_per_cell()); + data.shape_grad_grads.reinit(this->n_dofs_per_cell(), n_q_points); data.transformed_shape_hessians.resize(n_q_points); if (update_transformed_shape_hessian_tensors) data.untransformed_shape_hessian_tensors.resize(n_q_points); @@ -329,13 +329,13 @@ protected: if (update_flags & update_values) { if (inverse_node_matrix.n_cols() == 0) - for (unsigned int i = 0; i < this->dofs_per_cell; ++i) + for (unsigned int i = 0; i < this->n_dofs_per_cell(); ++i) data.shape_values[i][k] = values[i]; else - for (unsigned int i = 0; i < this->dofs_per_cell; ++i) + for (unsigned int i = 0; i < this->n_dofs_per_cell(); ++i) { Tensor<1, dim> add_values; - for (unsigned int j = 0; j < this->dofs_per_cell; ++j) + for (unsigned int j = 0; j < this->n_dofs_per_cell(); ++j) add_values += inverse_node_matrix(j, i) * values[j]; data.shape_values[i][k] = add_values; } @@ -344,13 +344,13 @@ protected: if (update_flags & update_gradients) { if (inverse_node_matrix.n_cols() == 0) - for (unsigned int i = 0; i < this->dofs_per_cell; ++i) + for (unsigned int i = 0; i < this->n_dofs_per_cell(); ++i) data.shape_grads[i][k] = grads[i]; else - for (unsigned int i = 0; i < this->dofs_per_cell; ++i) + for (unsigned int i = 0; i < this->n_dofs_per_cell(); ++i) { Tensor<2, dim> add_grads; - for (unsigned int j = 0; j < this->dofs_per_cell; ++j) + for (unsigned int j = 0; j < this->n_dofs_per_cell(); ++j) add_grads += inverse_node_matrix(j, i) * grads[j]; data.shape_grads[i][k] = add_grads; } @@ -359,13 +359,13 @@ protected: if (update_flags & update_hessians) { if (inverse_node_matrix.n_cols() == 0) - for (unsigned int i = 0; i < this->dofs_per_cell; ++i) + for (unsigned int i = 0; i < this->n_dofs_per_cell(); ++i) data.shape_grad_grads[i][k] = grad_grads[i]; else - for (unsigned int i = 0; i < this->dofs_per_cell; ++i) + for (unsigned int i = 0; i < this->n_dofs_per_cell(); ++i) { Tensor<3, dim> add_grad_grads; - for (unsigned int j = 0; j < this->dofs_per_cell; ++j) + for (unsigned int j = 0; j < this->n_dofs_per_cell(); ++j) add_grad_grads += inverse_node_matrix(j, i) * grad_grads[j]; data.shape_grad_grads[i][k] = add_grad_grads; diff --git a/include/deal.II/fe/fe_q_base.h b/include/deal.II/fe/fe_q_base.h index 2d951de19e..1aba53ee59 100644 --- a/include/deal.II/fe/fe_q_base.h +++ b/include/deal.II/fe/fe_q_base.h @@ -50,7 +50,7 @@ public: /** * Return the matrix interpolating from the given finite element to the * present one. The size of the matrix is then @p dofs_per_cell times - * source.dofs_per_cell. + * source.n_dofs_per_cell(). * * These matrices are only available if the source element is also a @p FE_Q * element. Otherwise, an exception of type @@ -234,10 +234,10 @@ public: * reference to a finite element object representing one of the other finite * elements active on this particular vertex. The function computes which of * the degrees of freedom of the two finite element objects are equivalent, - * both numbered between zero and the corresponding value of dofs_per_vertex - * of the two finite elements. The first index of each pair denotes one of - * the vertex dofs of the present element, whereas the second is the - * corresponding index of the other finite element. + * both numbered between zero and the corresponding value of + * n_dofs_per_vertex() of the two finite elements. The first index of each + * pair denotes one of the vertex dofs of the present element, whereas the + * second is the corresponding index of the other finite element. */ virtual std::vector> hp_vertex_dof_identities( diff --git a/include/deal.II/fe/fe_q_bubbles.h b/include/deal.II/fe/fe_q_bubbles.h index 3f61942377..6ae5e84445 100644 --- a/include/deal.II/fe/fe_q_bubbles.h +++ b/include/deal.II/fe/fe_q_bubbles.h @@ -115,7 +115,7 @@ public: /** * Return the matrix interpolating from the given finite element to the * present one. The size of the matrix is then @p dofs_per_cell times - * source.dofs_per_cell. + * source.n_dofs_per_cell(). * * These matrices are only available if the source element is also a @p * FE_Q_Bubbles element. Otherwise, an exception of type diff --git a/include/deal.II/fe/fe_q_dg0.h b/include/deal.II/fe/fe_q_dg0.h index 64ca1cb854..d1ea8957b0 100644 --- a/include/deal.II/fe/fe_q_dg0.h +++ b/include/deal.II/fe/fe_q_dg0.h @@ -270,7 +270,7 @@ public: /** * Return the matrix interpolating from the given finite element to the * present one. The size of the matrix is then @p dofs_per_cell times - * source.dofs_per_cell. + * source.n_dofs_per_cell(). * * These matrices are only available if the source element is also a @p * FE_Q_DG0 element. Otherwise, an exception of type diff --git a/include/deal.II/fe/fe_q_hierarchical.h b/include/deal.II/fe/fe_q_hierarchical.h index 7fcdeafe7f..9cd599b94c 100644 --- a/include/deal.II/fe/fe_q_hierarchical.h +++ b/include/deal.II/fe/fe_q_hierarchical.h @@ -606,10 +606,10 @@ public: * reference to a finite element object representing one of the other finite * elements active on this particular vertex. The function computes which of * the degrees of freedom of the two finite element objects are equivalent, - * both numbered between zero and the corresponding value of dofs_per_vertex - * of the two finite elements. The first index of each pair denotes one of - * the vertex dofs of the present element, whereas the second is the - * corresponding index of the other finite element. + * both numbered between zero and the corresponding value of + * n_dofs_per_vertex() of the two finite elements. The first index of each + * pair denotes one of the vertex dofs of the present element, whereas the + * second is the corresponding index of the other finite element. */ virtual std::vector> hp_vertex_dof_identities(const FiniteElement &fe_other) const override; diff --git a/include/deal.II/fe/fe_system.h b/include/deal.II/fe/fe_system.h index 6484743867..a832dd886d 100644 --- a/include/deal.II/fe/fe_system.h +++ b/include/deal.II/fe/fe_system.h @@ -721,7 +721,7 @@ public: /** * Return the matrix interpolating from the given finite element to the * present one. The size of the matrix is then @p dofs_per_cell times - * source.dofs_per_cell. + * source.n_dofs_per_cell(). * * These matrices are available if source and destination element are both * @p FESystem elements, have the same number of base elements with same @@ -938,10 +938,10 @@ public: * reference to a finite element object representing one of the other finite * elements active on this particular vertex. The function computes which of * the degrees of freedom of the two finite element objects are equivalent, - * both numbered between zero and the corresponding value of dofs_per_vertex - * of the two finite elements. The first index of each pair denotes one of - * the vertex dofs of the present element, whereas the second is the - * corresponding index of the other finite element. + * both numbered between zero and the corresponding value of + * n_dofs_per_vertex() of the two finite elements. The first index of each + * pair denotes one of the vertex dofs of the present element, whereas the + * second is the corresponding index of the other finite element. */ virtual std::vector> hp_vertex_dof_identities( diff --git a/include/deal.II/fe/fe_tools.h b/include/deal.II/fe/fe_tools.h index 3d1970df31..929d536ce4 100644 --- a/include/deal.II/fe/fe_tools.h +++ b/include/deal.II/fe/fe_tools.h @@ -183,7 +183,7 @@ namespace FETools /** * Compute the interpolation matrix that interpolates a @p fe1-function to a * @p fe2-function on each cell. The interpolation_matrix needs to be of - * size (fe2.dofs_per_cell, fe1.dofs_per_cell). + * size (fe2.n_dofs_per_cell(), fe1.n_dofs_per_cell()). * * Note, that if the finite element space @p fe1 is a subset of the finite * element space @p fe2 then the @p interpolation_matrix is an embedding @@ -199,7 +199,7 @@ namespace FETools * Compute the interpolation matrix that interpolates a @p fe1-function to a * @p fe2-function, and interpolates this to a second @p fe1-function on * each cell. The interpolation_matrix needs to be of size - * (fe1.dofs_per_cell, fe1.dofs_per_cell). + * (fe1.n_dofs_per_cell(), fe1.n_dofs_per_cell()). * * Note, that this function only makes sense if the finite element space due * to @p fe1 is not a subset of the finite element space due to @p fe2, as @@ -214,8 +214,8 @@ namespace FETools /** * Compute the identity matrix minus the back interpolation matrix. - * The @p difference_matrix will be of size (fe1.dofs_per_cell, - * fe1.dofs_per_cell) after this function. Previous content + * The @p difference_matrix will be of size (fe1.n_dofs_per_cell(), + * fe1.n_dofs_per_cell()) after this function. Previous content * of the argument will be overwritten. * * This function computes the matrix that transforms a @p fe1 function $z$ to @@ -569,7 +569,7 @@ namespace FETools * This method implements the * FETools::compute_projection_from_quadrature_points_matrix method for * faces of a mesh. The matrix that it returns, X, is face specific and its - * size is fe.dofs_per_cell by rhs_quadrature.size(). The dimension, dim + * size is fe.n_dofs_per_cell() by rhs_quadrature.size(). The dimension, dim * must be larger than 1 for this class, since Quadrature objects are * required. See the documentation on the Quadrature class for more * information. diff --git a/include/deal.II/fe/fe_tools.templates.h b/include/deal.II/fe/fe_tools.templates.h index 549542d6a1..bd25eb58be 100644 --- a/include/deal.II/fe/fe_tools.templates.h +++ b/include/deal.II/fe/fe_tools.templates.h @@ -107,7 +107,7 @@ namespace FETools if (multiplicities[i] > 0) { multiplied_dofs_per_vertex += - fes[i]->dofs_per_vertex * multiplicities[i]; + fes[i]->n_dofs_per_vertex() * multiplicities[i]; multiplied_dofs_per_line += fes[i]->dofs_per_line * multiplicities[i]; multiplied_dofs_per_quad += @@ -156,7 +156,7 @@ namespace FETools for (unsigned int base = 0; base < fes.size(); ++base) for (unsigned int m = 0; m < multiplicities[base]; ++m) - block_indices.push_back(fes[base]->dofs_per_cell); + block_indices.push_back(fes[base]->n_dofs_per_cell()); return FiniteElementData(dpo, (do_tensor_product ? @@ -213,7 +213,7 @@ namespace FETools unsigned int n_shape_functions = 0; for (unsigned int i = 0; i < fes.size(); ++i) if (multiplicities[i] > 0) // check needed as fe might be nullptr - n_shape_functions += fes[i]->dofs_per_cell * multiplicities[i]; + n_shape_functions += fes[i]->n_dofs_per_cell() * multiplicities[i]; // generate the array that will hold the output std::vector retval(n_shape_functions, false); @@ -233,13 +233,14 @@ namespace FETools for (unsigned int base = 0; base < fes.size(); ++base) for (unsigned int m = 0; m < multiplicities[base]; ++m) for (unsigned int local_index = 0; - local_index < fes[base]->dofs_per_vertex; + local_index < fes[base]->n_dofs_per_vertex(); ++local_index, ++total_index) { const unsigned int index_in_base = - (fes[base]->dofs_per_vertex * vertex_number + local_index); + (fes[base]->n_dofs_per_vertex() * vertex_number + + local_index); - Assert(index_in_base < fes[base]->dofs_per_cell, + Assert(index_in_base < fes[base]->n_dofs_per_cell(), ExcInternalError()); retval[total_index] = fes[base]->restriction_is_additive(index_in_base); @@ -261,7 +262,7 @@ namespace FETools (fes[base]->dofs_per_line * line_number + local_index + fes[base]->first_line_index); - Assert(index_in_base < fes[base]->dofs_per_cell, + Assert(index_in_base < fes[base]->n_dofs_per_cell(), ExcInternalError()); retval[total_index] = fes[base]->restriction_is_additive(index_in_base); @@ -283,7 +284,7 @@ namespace FETools (fes[base]->dofs_per_quad * quad_number + local_index + fes[base]->first_quad_index); - Assert(index_in_base < fes[base]->dofs_per_cell, + Assert(index_in_base < fes[base]->n_dofs_per_cell(), ExcInternalError()); retval[total_index] = fes[base]->restriction_is_additive(index_in_base); @@ -305,7 +306,7 @@ namespace FETools (fes[base]->dofs_per_hex * hex_number + local_index + fes[base]->first_hex_index); - Assert(index_in_base < fes[base]->dofs_per_cell, + Assert(index_in_base < fes[base]->n_dofs_per_cell(), ExcInternalError()); retval[total_index] = fes[base]->restriction_is_additive(index_in_base); @@ -375,7 +376,7 @@ namespace FETools unsigned int n_shape_functions = 0; for (unsigned int i = 0; i < fes.size(); ++i) if (multiplicities[i] > 0) // needed because fe might be nullptr - n_shape_functions += fes[i]->dofs_per_cell * multiplicities[i]; + n_shape_functions += fes[i]->n_dofs_per_cell() * multiplicities[i]; unsigned int n_components = 0; if (do_tensor_product) @@ -425,11 +426,12 @@ namespace FETools comp_start += fes[base]->n_components() * do_tensor_product) for (unsigned int local_index = 0; - local_index < fes[base]->dofs_per_vertex; + local_index < fes[base]->n_dofs_per_vertex(); ++local_index, ++total_index) { const unsigned int index_in_base = - (fes[base]->dofs_per_vertex * vertex_number + local_index); + (fes[base]->n_dofs_per_vertex() * vertex_number + + local_index); Assert(comp_start + fes[base]->n_components() <= retval[total_index].size(), @@ -666,11 +668,11 @@ namespace FETools fe.base_element(base).n_components() * do_tensor_product) for (unsigned int local_index = 0; - local_index < fe.base_element(base).dofs_per_vertex; + local_index < fe.base_element(base).n_dofs_per_vertex(); ++local_index, ++total_index) { const unsigned int index_in_base = - (fe.base_element(base).dofs_per_vertex * vertex_number + + (fe.base_element(base).n_dofs_per_vertex() * vertex_number + local_index); system_to_base_table[total_index] = @@ -859,7 +861,7 @@ namespace FETools fe.base_element(base).n_components() * do_tensor_product) for (unsigned int local_index = 0; - local_index < fe.base_element(base).dofs_per_vertex; + local_index < fe.base_element(base).n_dofs_per_vertex(); ++local_index, ++total_index) { // get (cell) index of this shape function inside the base @@ -871,11 +873,11 @@ namespace FETools // taken as representative for all others located on the same // type of object): const unsigned int index_in_base = - (fe.base_element(base).dofs_per_vertex * vertex_number + + (fe.base_element(base).n_dofs_per_vertex() * vertex_number + local_index); const unsigned int face_index_in_base = - (fe.base_element(base).dofs_per_vertex * vertex_number + + (fe.base_element(base).n_dofs_per_vertex() * vertex_number + local_index); face_system_to_base_table[total_index] = @@ -1349,8 +1351,8 @@ namespace FETools std::vector & renumbering, std::vector> &comp_start) { - Assert(renumbering.size() == element.dofs_per_cell, - ExcDimensionMismatch(renumbering.size(), element.dofs_per_cell)); + Assert(renumbering.size() == element.n_dofs_per_cell(), + ExcDimensionMismatch(renumbering.size(), element.n_dofs_per_cell())); comp_start.resize(element.n_base_elements()); @@ -1358,7 +1360,8 @@ namespace FETools for (unsigned int i = 0; i < comp_start.size(); ++i) { comp_start[i].resize(element.element_multiplicity(i)); - const unsigned int increment = element.base_element(i).dofs_per_cell; + const unsigned int increment = + element.base_element(i).n_dofs_per_cell(); for (unsigned int &first_index_of_component : comp_start[i]) { @@ -1372,7 +1375,7 @@ namespace FETools // numbering, renumbering // contains the index of the // cell-block numbering - for (unsigned int i = 0; i < element.dofs_per_cell; ++i) + for (unsigned int i = 0; i < element.n_dofs_per_cell(); ++i) { std::pair, unsigned int> indices = element.system_to_base_index(i); @@ -1390,8 +1393,8 @@ namespace FETools std::vector &block_data, bool return_start_indices) { - Assert(renumbering.size() == element.dofs_per_cell, - ExcDimensionMismatch(renumbering.size(), element.dofs_per_cell)); + Assert(renumbering.size() == element.n_dofs_per_cell(), + ExcDimensionMismatch(renumbering.size(), element.n_dofs_per_cell())); Assert(block_data.size() == element.n_blocks(), ExcDimensionMismatch(block_data.size(), element.n_blocks())); @@ -1418,7 +1421,7 @@ namespace FETools k += block_data[i]; } - for (unsigned int i = 0; i < element.dofs_per_cell; ++i) + for (unsigned int i = 0; i < element.n_dofs_per_cell(); ++i) { std::pair indices = element.system_to_block_index(i); @@ -1436,12 +1439,12 @@ namespace FETools { Assert(fe1.n_components() == fe2.n_components(), ExcDimensionMismatch(fe1.n_components(), fe2.n_components())); - Assert(interpolation_matrix.m() == fe2.dofs_per_cell && - interpolation_matrix.n() == fe1.dofs_per_cell, + Assert(interpolation_matrix.m() == fe2.n_dofs_per_cell() && + interpolation_matrix.n() == fe1.n_dofs_per_cell(), ExcMatrixDimensionMismatch(interpolation_matrix.m(), interpolation_matrix.n(), - fe2.dofs_per_cell, - fe1.dofs_per_cell)); + fe2.n_dofs_per_cell(), + fe1.n_dofs_per_cell())); // first try the easy way: maybe the FE wants to implement things itself: try @@ -1470,13 +1473,13 @@ namespace FETools const std::vector> &fe2_support_points = fe2.get_unit_support_points(); - Assert(fe2_support_points.size() == fe2.dofs_per_cell, + Assert(fe2_support_points.size() == fe2.n_dofs_per_cell(), (typename FiniteElement::ExcFEHasNoSupportPoints())); - for (unsigned int i = 0; i < fe2.dofs_per_cell; ++i) + for (unsigned int i = 0; i < fe2.n_dofs_per_cell(); ++i) { const unsigned int i1 = fe2.system_to_component_index(i).first; - for (unsigned int j = 0; j < fe1.dofs_per_cell; ++j) + for (unsigned int j = 0; j < fe1.n_dofs_per_cell(); ++j) { const unsigned int j1 = fe1.system_to_component_index(j).first; if (i1 == j1) @@ -1498,15 +1501,17 @@ namespace FETools { Assert(fe1.n_components() == fe2.n_components(), ExcDimensionMismatch(fe1.n_components(), fe2.n_components())); - Assert(interpolation_matrix.m() == fe1.dofs_per_cell && - interpolation_matrix.n() == fe1.dofs_per_cell, + Assert(interpolation_matrix.m() == fe1.n_dofs_per_cell() && + interpolation_matrix.n() == fe1.n_dofs_per_cell(), ExcMatrixDimensionMismatch(interpolation_matrix.m(), interpolation_matrix.n(), - fe1.dofs_per_cell, - fe1.dofs_per_cell)); + fe1.n_dofs_per_cell(), + fe1.n_dofs_per_cell())); - FullMatrix first_matrix(fe2.dofs_per_cell, fe1.dofs_per_cell); - FullMatrix second_matrix(fe1.dofs_per_cell, fe2.dofs_per_cell); + FullMatrix first_matrix(fe2.n_dofs_per_cell(), + fe1.n_dofs_per_cell()); + FullMatrix second_matrix(fe1.n_dofs_per_cell(), + fe2.n_dofs_per_cell()); get_interpolation_matrix(fe1, fe2, first_matrix); get_interpolation_matrix(fe2, fe1, second_matrix); @@ -1525,18 +1530,18 @@ namespace FETools { Assert(fe1.n_components() == fe2.n_components(), ExcDimensionMismatch(fe1.n_components(), fe2.n_components())); - Assert(difference_matrix.m() == fe1.dofs_per_cell && - difference_matrix.n() == fe1.dofs_per_cell, + Assert(difference_matrix.m() == fe1.n_dofs_per_cell() && + difference_matrix.n() == fe1.n_dofs_per_cell(), ExcMatrixDimensionMismatch(difference_matrix.m(), difference_matrix.n(), - fe1.dofs_per_cell, - fe1.dofs_per_cell)); + fe1.n_dofs_per_cell(), + fe1.n_dofs_per_cell())); - FullMatrix interpolation_matrix(fe1.dofs_per_cell); + FullMatrix interpolation_matrix(fe1.n_dofs_per_cell()); get_back_interpolation_matrix(fe1, fe2, interpolation_matrix); // compute difference - difference_matrix = IdentityMatrix(fe1.dofs_per_cell); + difference_matrix = IdentityMatrix(fe1.n_dofs_per_cell()); difference_matrix.add(-1, interpolation_matrix); } @@ -1551,13 +1556,16 @@ namespace FETools Assert(fe1.n_components() == 1, ExcNotImplemented()); Assert(fe1.n_components() == fe2.n_components(), ExcDimensionMismatch(fe1.n_components(), fe2.n_components())); - Assert(matrix.m() == fe2.dofs_per_cell && matrix.n() == fe1.dofs_per_cell, - ExcMatrixDimensionMismatch( - matrix.m(), matrix.n(), fe2.dofs_per_cell, fe1.dofs_per_cell)); + Assert(matrix.m() == fe2.n_dofs_per_cell() && + matrix.n() == fe1.n_dofs_per_cell(), + ExcMatrixDimensionMismatch(matrix.m(), + matrix.n(), + fe2.n_dofs_per_cell(), + fe1.n_dofs_per_cell())); matrix = 0; - const unsigned int n1 = fe1.dofs_per_cell; - const unsigned int n2 = fe2.dofs_per_cell; + const unsigned int n1 = fe1.n_dofs_per_cell(); + const unsigned int n2 = fe2.n_dofs_per_cell(); // First, create a local mass matrix for the unit cell Triangulation tr; @@ -1625,7 +1633,7 @@ namespace FETools FullMatrix compute_node_matrix(const FiniteElement &fe) { - const unsigned int n_dofs = fe.dofs_per_cell; + const unsigned int n_dofs = fe.n_dofs_per_cell(); FullMatrix N(n_dofs, n_dofs); @@ -1691,7 +1699,7 @@ namespace FETools FullMatrix & this_matrix, const double threshold) { - const unsigned int n = fe.dofs_per_cell; + const unsigned int n = fe.n_dofs_per_cell(); const unsigned int nd = fe.n_components(); const unsigned int nq = coarse.n_quadrature_points; @@ -1746,7 +1754,7 @@ namespace FETools const unsigned int ref_case, const double threshold) { - const unsigned int n = fe.dofs_per_cell; + const unsigned int n = fe.n_dofs_per_cell(); const unsigned int nc = GeometryInfo::n_children(RefinementCase(ref_case)); for (unsigned int i = 0; i < nc; ++i) @@ -1937,11 +1945,11 @@ namespace FETools { const unsigned int offset_c = GeometryInfo::face_to_cell_vertices(face_coarse, i) * - fe.dofs_per_vertex; + fe.n_dofs_per_vertex(); const unsigned int offset_f = GeometryInfo::face_to_cell_vertices(face_fine, i) * - fe.dofs_per_vertex; - for (unsigned int j = 0; j < fe.dofs_per_vertex; ++j) + fe.n_dofs_per_vertex(); + for (unsigned int j = 0; j < fe.n_dofs_per_vertex(); ++j) { face_c_dofs[face_dof] = offset_c + j; face_f_dofs[face_dof] = offset_f + j; @@ -2121,7 +2129,7 @@ namespace FETools > & matrices, const bool isotropic_only) { - const unsigned int n = fe.dofs_per_cell; + const unsigned int n = fe.n_dofs_per_cell(); const unsigned int nd = fe.n_components(); const unsigned int degree = fe.degree; @@ -2270,9 +2278,9 @@ namespace FETools const std::vector &JxW = fine.get_JxW_values(); // Outer loop over all fine grid shape functions phi_j - for (unsigned int j = 0; j < fe.dofs_per_cell; ++j) + for (unsigned int j = 0; j < fe.n_dofs_per_cell(); ++j) { - for (unsigned int i = 0; i < fe.dofs_per_cell; ++i) + for (unsigned int i = 0; i < fe.n_dofs_per_cell(); ++i) { if (fe. @@ -2302,7 +2310,7 @@ namespace FETools // RHS ready. Solve system and enter row into matrix inverse_mass_matrix.vmult(v_coarse, v_fine); - for (unsigned int i = 0; i < fe.dofs_per_cell; ++i) + for (unsigned int i = 0; i < fe.n_dofs_per_cell(); ++i) this_matrix(i, j) = v_coarse(i); } @@ -2724,30 +2732,30 @@ namespace FETools // first build the matrices M and Q // described in the documentation - FullMatrix M(fe.dofs_per_cell, fe.dofs_per_cell); - FullMatrix Q(fe.dofs_per_cell, rhs_quadrature.size()); + FullMatrix M(fe.n_dofs_per_cell(), fe.n_dofs_per_cell()); + FullMatrix Q(fe.n_dofs_per_cell(), rhs_quadrature.size()); - for (unsigned int i = 0; i < fe.dofs_per_cell; ++i) - for (unsigned int j = 0; j < fe.dofs_per_cell; ++j) + for (unsigned int i = 0; i < fe.n_dofs_per_cell(); ++i) + for (unsigned int j = 0; j < fe.n_dofs_per_cell(); ++j) for (unsigned int q = 0; q < lhs_quadrature.size(); ++q) M(i, j) += fe.shape_value(i, lhs_quadrature.point(q)) * fe.shape_value(j, lhs_quadrature.point(q)) * lhs_quadrature.weight(q); - for (unsigned int i = 0; i < fe.dofs_per_cell; ++i) + for (unsigned int i = 0; i < fe.n_dofs_per_cell(); ++i) for (unsigned int q = 0; q < rhs_quadrature.size(); ++q) Q(i, q) += fe.shape_value(i, rhs_quadrature.point(q)) * rhs_quadrature.weight(q); // then invert M - FullMatrix M_inverse(fe.dofs_per_cell, fe.dofs_per_cell); + FullMatrix M_inverse(fe.n_dofs_per_cell(), fe.n_dofs_per_cell()); M_inverse.invert(M); // finally compute the result - X.reinit(fe.dofs_per_cell, rhs_quadrature.size()); + X.reinit(fe.n_dofs_per_cell(), rhs_quadrature.size()); M_inverse.mmult(X, Q); - Assert(X.m() == fe.dofs_per_cell, ExcInternalError()); + Assert(X.m() == fe.n_dofs_per_cell(), ExcInternalError()); Assert(X.n() == rhs_quadrature.size(), ExcInternalError()); } @@ -2762,10 +2770,10 @@ namespace FETools { Assert(fe.n_components() == 1, ExcNotImplemented()); Assert(I_q.m() == quadrature.size(), ExcMessage("Wrong matrix size")); - Assert(I_q.n() == fe.dofs_per_cell, ExcMessage("Wrong matrix size")); + Assert(I_q.n() == fe.n_dofs_per_cell(), ExcMessage("Wrong matrix size")); for (unsigned int q = 0; q < quadrature.size(); ++q) - for (unsigned int i = 0; i < fe.dofs_per_cell; ++i) + for (unsigned int i = 0; i < fe.n_dofs_per_cell(); ++i) I_q(q, i) = fe.shape_value(i, quadrature.point(q)); } @@ -2919,8 +2927,8 @@ namespace FETools // build the matrices M and Q // described in the documentation - FullMatrix M(fe.dofs_per_cell, fe.dofs_per_cell); - FullMatrix Q(fe.dofs_per_cell, rhs_quadrature.size()); + FullMatrix M(fe.n_dofs_per_cell(), fe.n_dofs_per_cell()); + FullMatrix Q(fe.n_dofs_per_cell(), rhs_quadrature.size()); { // need an FEFaceValues object to evaluate shape function @@ -2928,13 +2936,13 @@ namespace FETools FEFaceValues fe_face_values(fe, lhs_quadrature, update_values); fe_face_values.reinit(cell, face); // setup shape_value on this face. - for (unsigned int i = 0; i < fe.dofs_per_cell; ++i) - for (unsigned int j = 0; j < fe.dofs_per_cell; ++j) + for (unsigned int i = 0; i < fe.n_dofs_per_cell(); ++i) + for (unsigned int j = 0; j < fe.n_dofs_per_cell(); ++j) for (unsigned int q = 0; q < lhs_quadrature.size(); ++q) M(i, j) += fe_face_values.shape_value(i, q) * fe_face_values.shape_value(j, q) * lhs_quadrature.weight(q); - for (unsigned int i = 0; i < fe.dofs_per_cell; ++i) + for (unsigned int i = 0; i < fe.n_dofs_per_cell(); ++i) { M(i, i) = (M(i, i) == 0 ? 1 : M(i, i)); } @@ -2944,20 +2952,20 @@ namespace FETools FEFaceValues fe_face_values(fe, rhs_quadrature, update_values); fe_face_values.reinit(cell, face); // setup shape_value on this face. - for (unsigned int i = 0; i < fe.dofs_per_cell; ++i) + for (unsigned int i = 0; i < fe.n_dofs_per_cell(); ++i) for (unsigned int q = 0; q < rhs_quadrature.size(); ++q) Q(i, q) += fe_face_values.shape_value(i, q) * rhs_quadrature.weight(q); } // then invert M - FullMatrix M_inverse(fe.dofs_per_cell, fe.dofs_per_cell); + FullMatrix M_inverse(fe.n_dofs_per_cell(), fe.n_dofs_per_cell()); M_inverse.invert(M); // finally compute the result - X.reinit(fe.dofs_per_cell, rhs_quadrature.size()); + X.reinit(fe.n_dofs_per_cell(), rhs_quadrature.size()); M_inverse.mmult(X, Q); - Assert(X.m() == fe.dofs_per_cell, ExcInternalError()); + Assert(X.m() == fe.n_dofs_per_cell(), ExcInternalError()); Assert(X.n() == rhs_quadrature.size(), ExcInternalError()); } @@ -3084,7 +3092,7 @@ namespace FETools { AssertDimension(support_point_values.size(), finite_element.get_generalized_support_points().size()); - AssertDimension(dof_values.size(), finite_element.dofs_per_cell); + AssertDimension(dof_values.size(), finite_element.n_dofs_per_cell()); internal::FEToolsConvertHelper::convert_helper( finite_element, support_point_values, dof_values); @@ -3279,8 +3287,8 @@ namespace FETools hierarchic_to_lexicographic_numbering(const FiniteElementData &fe, std::vector & h2l) { - Assert(h2l.size() == fe.dofs_per_cell, - ExcDimensionMismatch(h2l.size(), fe.dofs_per_cell)); + Assert(h2l.size() == fe.n_dofs_per_cell(), + ExcDimensionMismatch(h2l.size(), fe.n_dofs_per_cell())); hierarchic_to_lexicographic_numbering(fe.dofs_per_line + 1, h2l); } diff --git a/include/deal.II/fe/fe_tools_extrapolate.templates.h b/include/deal.II/fe/fe_tools_extrapolate.templates.h index f7bd100823..1abefa66ec 100644 --- a/include/deal.II/fe/fe_tools_extrapolate.templates.h +++ b/include/deal.II/fe/fe_tools_extrapolate.templates.h @@ -546,7 +546,7 @@ namespace FETools { const FiniteElement &fe = dealii_cell->get_dof_handler().get_fe(); - const unsigned int dofs_per_cell = fe.dofs_per_cell; + const unsigned int dofs_per_cell = fe.n_dofs_per_cell(); Vector interpolated_values( dofs_per_cell); @@ -608,7 +608,7 @@ namespace FETools { const FiniteElement &fe = dealii_cell->get_dof_handler().get_fe(); - const unsigned int dofs_per_cell = fe.dofs_per_cell; + const unsigned int dofs_per_cell = fe.n_dofs_per_cell(); Assert(interpolated_values.size() == dofs_per_cell, ExcDimensionMismatch(interpolated_values.size(), @@ -728,7 +728,7 @@ namespace FETools { const FiniteElement &fe = dealii_cell->get_dof_handler().get_fe(); - const unsigned int dofs_per_cell = fe.dofs_per_cell; + const unsigned int dofs_per_cell = fe.n_dofs_per_cell(); if (dealii_cell->is_active()) { @@ -1242,7 +1242,7 @@ namespace FETools { const FiniteElement &fe = dealii_cell->get_dof_handler().get_fe(); - const unsigned int dofs_per_cell = fe.dofs_per_cell; + const unsigned int dofs_per_cell = fe.n_dofs_per_cell(); CellData cell_data(dofs_per_cell); cell_data.quadrant = p4est_cell; @@ -1416,7 +1416,7 @@ namespace FETools const unsigned int dofs_per_face = fe.dofs_per_face; if (dofs_per_face > 0) { - const unsigned int dofs_per_cell = fe.dofs_per_cell; + const unsigned int dofs_per_cell = fe.n_dofs_per_cell(); std::vector indices(dofs_per_cell); typename DoFHandler::active_cell_iterator cell = dof2.begin_active(), @@ -1715,7 +1715,7 @@ namespace FETools const DoFHandler &dof2, OutVector & u2) { - const unsigned int dofs_per_cell = dof2.get_fe().dofs_per_cell; + const unsigned int dofs_per_cell = dof2.get_fe().n_dofs_per_cell(); Vector dof_values(dofs_per_cell); // then traverse grid bottom up diff --git a/include/deal.II/fe/fe_tools_interpolate.templates.h b/include/deal.II/fe/fe_tools_interpolate.templates.h index d567cdcb56..47344852b9 100644 --- a/include/deal.II/fe/fe_tools_interpolate.templates.h +++ b/include/deal.II/fe/fe_tools_interpolate.templates.h @@ -158,7 +158,7 @@ namespace FETools // hanging node constraints. Consequently, when the elements are // continuous no hanging node constraints are allowed. const bool hanging_nodes_not_allowed = - ((cell2->get_fe().dofs_per_vertex != 0) && + ((cell2->get_fe().n_dofs_per_vertex() != 0) && (constraints.n_constraints() == 0)); if (hanging_nodes_not_allowed) @@ -168,8 +168,8 @@ namespace FETools ExcHangingNodesNotAllowed()); #endif - const unsigned int dofs_per_cell1 = cell1->get_fe().dofs_per_cell; - const unsigned int dofs_per_cell2 = cell2->get_fe().dofs_per_cell; + const unsigned int dofs_per_cell1 = cell1->get_fe().n_dofs_per_cell(); + const unsigned int dofs_per_cell2 = cell2->get_fe().n_dofs_per_cell(); u1_local.reinit(dofs_per_cell1); u2_local.reinit(dofs_per_cell2); @@ -312,7 +312,8 @@ namespace FETools // hanging node constraints. Consequently, when the elements are // continuous no hanging node constraints are allowed. const bool hanging_nodes_not_allowed = - (cell->get_fe().dofs_per_vertex != 0) || (fe2.dofs_per_vertex != 0); + (cell->get_fe().n_dofs_per_vertex() != 0) || + (fe2.n_dofs_per_vertex() != 0); if (hanging_nodes_not_allowed) for (const unsigned int face : cell->face_indices()) @@ -321,7 +322,7 @@ namespace FETools ExcHangingNodesNotAllowed()); #endif - const unsigned int dofs_per_cell1 = cell->get_fe().dofs_per_cell; + const unsigned int dofs_per_cell1 = cell->get_fe().n_dofs_per_cell(); // make sure back_interpolation matrix is available if (interpolation_matrices[&cell->get_fe()] == nullptr) @@ -569,8 +570,8 @@ namespace FETools { // For discontinuous elements without constraints take the simpler version // of the back_interpolate function. - if (dof1.get_fe().dofs_per_vertex == 0 && - dof2.get_fe().dofs_per_vertex == 0 && + if (dof1.get_fe().n_dofs_per_vertex() == 0 && + dof2.get_fe().n_dofs_per_vertex() == 0 && constraints1.n_constraints() == 0 && constraints2.n_constraints() == 0) back_interpolate(dof1, u1, dof2.get_fe(), u1_interpolated); else @@ -621,7 +622,7 @@ namespace FETools " index sets.")); #endif - const unsigned int dofs_per_cell = dof1.get_fe().dofs_per_cell; + const unsigned int dofs_per_cell = dof1.get_fe().n_dofs_per_cell(); Vector u1_local(dofs_per_cell); Vector u1_diff_local(dofs_per_cell); @@ -645,7 +646,8 @@ namespace FETools // hanging node constraints. Consequently, when the elements are // continuous no hanging node constraints are allowed. const bool hanging_nodes_not_allowed = - (dof1.get_fe().dofs_per_vertex != 0) || (fe2.dofs_per_vertex != 0); + (dof1.get_fe().n_dofs_per_vertex() != 0) || + (fe2.n_dofs_per_vertex() != 0); if (hanging_nodes_not_allowed) for (const unsigned int face : cell->face_indices()) @@ -730,8 +732,8 @@ namespace FETools // without constraints take the // cheaper version of the // interpolation_difference function. - if (dof1.get_fe().dofs_per_vertex == 0 && - dof2.get_fe().dofs_per_vertex == 0 && + if (dof1.get_fe().n_dofs_per_vertex() == 0 && + dof2.get_fe().n_dofs_per_vertex() == 0 && constraints1.n_constraints() == 0 && constraints2.n_constraints() == 0) interpolation_difference(dof1, u1, dof2.get_fe(), u1_difference); else @@ -766,8 +768,8 @@ namespace FETools dof2.begin_active(); typename DoFHandler::active_cell_iterator end = dof2.end(); - const unsigned int n1 = dof1.get_fe().dofs_per_cell; - const unsigned int n2 = dof2.get_fe().dofs_per_cell; + const unsigned int n1 = dof1.get_fe().n_dofs_per_cell(); + const unsigned int n2 = dof2.get_fe().n_dofs_per_cell(); Vector u1_local(n1); Vector u2_local(n2); diff --git a/include/deal.II/fe/fe_values.h b/include/deal.II/fe/fe_values.h index 1f45a8b8eb..c0ad804b59 100644 --- a/include/deal.II/fe/fe_values.h +++ b/include/deal.II/fe/fe_values.h @@ -361,12 +361,12 @@ namespace FEValuesViews * * The DoF values typically would be obtained in the following way: * @code - * Vector local_dof_values(cell->get_fe().dofs_per_cell); + * Vector local_dof_values(cell->get_fe().n_dofs_per_cell()); * cell->get_dof_values(solution, local_dof_values); * @endcode * or, for a generic @p Number type, * @code - * std::vector local_dof_values(cell->get_fe().dofs_per_cell); + * std::vector local_dof_values(cell->get_fe().n_dofs_per_cell()); * cell->get_dof_values(solution, * local_dof_values.begin(), * local_dof_values.end()); @@ -929,12 +929,12 @@ namespace FEValuesViews * * The DoF values typically would be obtained in the following way: * @code - * Vector local_dof_values(cell->get_fe().dofs_per_cell); + * Vector local_dof_values(cell->get_fe().n_dofs_per_cell()); * cell->get_dof_values(solution, local_dof_values); * @endcode * or, for a generic @p Number type, * @code - * std::vector local_dof_values(cell->get_fe().dofs_per_cell); + * std::vector local_dof_values(cell->get_fe().n_dofs_per_cell()); * cell->get_dof_values(solution, * local_dof_values.begin(), * local_dof_values.end()); @@ -1440,12 +1440,12 @@ namespace FEValuesViews * * The DoF values typically would be obtained in the following way: * @code - * Vector local_dof_values(cell->get_fe().dofs_per_cell); + * Vector local_dof_values(cell->get_fe().n_dofs_per_cell()); * cell->get_dof_values(solution, local_dof_values); * @endcode * or, for a generic @p Number type, * @code - * std::vector local_dof_values(cell->get_fe().dofs_per_cell); + * std::vector local_dof_values(cell->get_fe().n_dofs_per_cell()); * cell->get_dof_values(solution, * local_dof_values.begin(), * local_dof_values.end()); @@ -1750,12 +1750,12 @@ namespace FEValuesViews * * The DoF values typically would be obtained in the following way: * @code - * Vector local_dof_values(cell->get_fe().dofs_per_cell); + * Vector local_dof_values(cell->get_fe().n_dofs_per_cell()); * cell->get_dof_values(solution, local_dof_values); * @endcode * or, for a generic @p Number type, * @code - * std::vector local_dof_values(cell->get_fe().dofs_per_cell); + * std::vector local_dof_values(cell->get_fe().n_dofs_per_cell()); * cell->get_dof_values(solution, * local_dof_values.begin(), * local_dof_values.end()); @@ -2015,8 +2015,8 @@ namespace FEValuesViews * { * values.reinit(cell); * for (unsigned int q=0; q::value(const unsigned int shape_function, const unsigned int q_point) const { - AssertIndexRange(shape_function, fe_values->fe->dofs_per_cell); + AssertIndexRange(shape_function, fe_values->fe->n_dofs_per_cell()); Assert( fe_values->update_flags & update_values, ((typename FEValuesBase::ExcAccessToUninitializedField( @@ -4145,7 +4145,7 @@ namespace FEValuesViews Scalar::gradient(const unsigned int shape_function, const unsigned int q_point) const { - AssertIndexRange(shape_function, fe_values->fe->dofs_per_cell); + AssertIndexRange(shape_function, fe_values->fe->n_dofs_per_cell()); Assert(fe_values->update_flags & update_gradients, (typename FEValuesBase::ExcAccessToUninitializedField( "update_gradients"))); @@ -4168,7 +4168,7 @@ namespace FEValuesViews Scalar::hessian(const unsigned int shape_function, const unsigned int q_point) const { - AssertIndexRange(shape_function, fe_values->fe->dofs_per_cell); + AssertIndexRange(shape_function, fe_values->fe->n_dofs_per_cell()); Assert(fe_values->update_flags & update_hessians, (typename FEValuesBase::ExcAccessToUninitializedField( "update_hessians"))); @@ -4190,7 +4190,7 @@ namespace FEValuesViews Scalar::third_derivative(const unsigned int shape_function, const unsigned int q_point) const { - AssertIndexRange(shape_function, fe_values->fe->dofs_per_cell); + AssertIndexRange(shape_function, fe_values->fe->n_dofs_per_cell()); Assert(fe_values->update_flags & update_3rd_derivatives, (typename FEValuesBase::ExcAccessToUninitializedField( "update_3rd_derivatives"))); @@ -4213,7 +4213,7 @@ namespace FEValuesViews Vector::value(const unsigned int shape_function, const unsigned int q_point) const { - AssertIndexRange(shape_function, fe_values->fe->dofs_per_cell); + AssertIndexRange(shape_function, fe_values->fe->n_dofs_per_cell()); Assert(fe_values->update_flags & update_values, (typename FEValuesBase::ExcAccessToUninitializedField( "update_values"))); @@ -4251,7 +4251,7 @@ namespace FEValuesViews Vector::gradient(const unsigned int shape_function, const unsigned int q_point) const { - AssertIndexRange(shape_function, fe_values->fe->dofs_per_cell); + AssertIndexRange(shape_function, fe_values->fe->n_dofs_per_cell()); Assert(fe_values->update_flags & update_gradients, (typename FEValuesBase::ExcAccessToUninitializedField( "update_gradients"))); @@ -4291,7 +4291,7 @@ namespace FEValuesViews const unsigned int q_point) const { // this function works like in the case above - AssertIndexRange(shape_function, fe_values->fe->dofs_per_cell); + AssertIndexRange(shape_function, fe_values->fe->n_dofs_per_cell()); Assert(fe_values->update_flags & update_gradients, (typename FEValuesBase::ExcAccessToUninitializedField( "update_gradients"))); @@ -4328,7 +4328,7 @@ namespace FEValuesViews { // this function works like in the case above - AssertIndexRange(shape_function, fe_values->fe->dofs_per_cell); + AssertIndexRange(shape_function, fe_values->fe->n_dofs_per_cell()); Assert(fe_values->update_flags & update_gradients, (typename FEValuesBase::ExcAccessToUninitializedField( "update_gradients"))); @@ -4500,7 +4500,7 @@ namespace FEValuesViews const unsigned int q_point) const { // this function works like in the case above - AssertIndexRange(shape_function, fe_values->fe->dofs_per_cell); + AssertIndexRange(shape_function, fe_values->fe->n_dofs_per_cell()); Assert(fe_values->update_flags & update_hessians, (typename FEValuesBase::ExcAccessToUninitializedField( "update_hessians"))); @@ -4540,7 +4540,7 @@ namespace FEValuesViews const unsigned int q_point) const { // this function works like in the case above - AssertIndexRange(shape_function, fe_values->fe->dofs_per_cell); + AssertIndexRange(shape_function, fe_values->fe->n_dofs_per_cell()); Assert(fe_values->update_flags & update_3rd_derivatives, (typename FEValuesBase::ExcAccessToUninitializedField( "update_3rd_derivatives"))); @@ -4647,7 +4647,7 @@ namespace FEValuesViews Vector::symmetric_gradient(const unsigned int shape_function, const unsigned int q_point) const { - AssertIndexRange(shape_function, fe_values->fe->dofs_per_cell); + AssertIndexRange(shape_function, fe_values->fe->n_dofs_per_cell()); Assert(fe_values->update_flags & update_gradients, (typename FEValuesBase::ExcAccessToUninitializedField( "update_gradients"))); @@ -4682,7 +4682,7 @@ namespace FEValuesViews SymmetricTensor<2, dim, spacedim>::value(const unsigned int shape_function, const unsigned int q_point) const { - AssertIndexRange(shape_function, fe_values->fe->dofs_per_cell); + AssertIndexRange(shape_function, fe_values->fe->n_dofs_per_cell()); Assert(fe_values->update_flags & update_values, (typename FEValuesBase::ExcAccessToUninitializedField( "update_values"))); @@ -4727,7 +4727,7 @@ namespace FEValuesViews const unsigned int shape_function, const unsigned int q_point) const { - AssertIndexRange(shape_function, fe_values->fe->dofs_per_cell); + AssertIndexRange(shape_function, fe_values->fe->n_dofs_per_cell()); Assert(fe_values->update_flags & update_gradients, (typename FEValuesBase::ExcAccessToUninitializedField( "update_gradients"))); @@ -4805,7 +4805,7 @@ namespace FEValuesViews Tensor<2, dim, spacedim>::value(const unsigned int shape_function, const unsigned int q_point) const { - AssertIndexRange(shape_function, fe_values->fe->dofs_per_cell); + AssertIndexRange(shape_function, fe_values->fe->n_dofs_per_cell()); Assert(fe_values->update_flags & update_values, (typename FEValuesBase::ExcAccessToUninitializedField( "update_values"))); @@ -4855,7 +4855,7 @@ namespace FEValuesViews Tensor<2, dim, spacedim>::divergence(const unsigned int shape_function, const unsigned int q_point) const { - AssertIndexRange(shape_function, fe_values->fe->dofs_per_cell); + AssertIndexRange(shape_function, fe_values->fe->n_dofs_per_cell()); Assert(fe_values->update_flags & update_gradients, (typename FEValuesBase::ExcAccessToUninitializedField( "update_gradients"))); @@ -4911,7 +4911,7 @@ namespace FEValuesViews Tensor<2, dim, spacedim>::gradient(const unsigned int shape_function, const unsigned int q_point) const { - AssertIndexRange(shape_function, fe_values->fe->dofs_per_cell); + AssertIndexRange(shape_function, fe_values->fe->n_dofs_per_cell()); Assert(fe_values->update_flags & update_gradients, (typename FEValuesBase::ExcAccessToUninitializedField( "update_gradients"))); @@ -5027,7 +5027,7 @@ inline const double & FEValuesBase::shape_value(const unsigned int i, const unsigned int j) const { - AssertIndexRange(i, fe->dofs_per_cell); + AssertIndexRange(i, fe->n_dofs_per_cell()); Assert(this->update_flags & update_values, ExcAccessToUninitializedField("update_values")); Assert(fe->is_primitive(i), ExcShapeFunctionNotPrimitive(i)); @@ -5064,7 +5064,7 @@ FEValuesBase::shape_value_component( const unsigned int j, const unsigned int component) const { - AssertIndexRange(i, fe->dofs_per_cell); + AssertIndexRange(i, fe->n_dofs_per_cell()); Assert(this->update_flags & update_values, ExcAccessToUninitializedField("update_values")); AssertIndexRange(component, fe->n_components()); @@ -5093,7 +5093,7 @@ inline const Tensor<1, spacedim> & FEValuesBase::shape_grad(const unsigned int i, const unsigned int j) const { - AssertIndexRange(i, fe->dofs_per_cell); + AssertIndexRange(i, fe->n_dofs_per_cell()); Assert(this->update_flags & update_gradients, ExcAccessToUninitializedField("update_gradients")); Assert(fe->is_primitive(i), ExcShapeFunctionNotPrimitive(i)); @@ -5130,7 +5130,7 @@ FEValuesBase::shape_grad_component( const unsigned int j, const unsigned int component) const { - AssertIndexRange(i, fe->dofs_per_cell); + AssertIndexRange(i, fe->n_dofs_per_cell()); Assert(this->update_flags & update_gradients, ExcAccessToUninitializedField("update_gradients")); AssertIndexRange(component, fe->n_components()); @@ -5158,7 +5158,7 @@ inline const Tensor<2, spacedim> & FEValuesBase::shape_hessian(const unsigned int i, const unsigned int j) const { - AssertIndexRange(i, fe->dofs_per_cell); + AssertIndexRange(i, fe->n_dofs_per_cell()); Assert(this->update_flags & update_hessians, ExcAccessToUninitializedField("update_hessians")); Assert(fe->is_primitive(i), ExcShapeFunctionNotPrimitive(i)); @@ -5195,7 +5195,7 @@ FEValuesBase::shape_hessian_component( const unsigned int j, const unsigned int component) const { - AssertIndexRange(i, fe->dofs_per_cell); + AssertIndexRange(i, fe->n_dofs_per_cell()); Assert(this->update_flags & update_hessians, ExcAccessToUninitializedField("update_hessians")); AssertIndexRange(component, fe->n_components()); @@ -5223,7 +5223,7 @@ inline const Tensor<3, spacedim> & FEValuesBase::shape_3rd_derivative(const unsigned int i, const unsigned int j) const { - AssertIndexRange(i, fe->dofs_per_cell); + AssertIndexRange(i, fe->n_dofs_per_cell()); Assert(this->update_flags & update_3rd_derivatives, ExcAccessToUninitializedField("update_3rd_derivatives")); Assert(fe->is_primitive(i), ExcShapeFunctionNotPrimitive(i)); @@ -5260,7 +5260,7 @@ FEValuesBase::shape_3rd_derivative_component( const unsigned int j, const unsigned int component) const { - AssertIndexRange(i, fe->dofs_per_cell); + AssertIndexRange(i, fe->n_dofs_per_cell()); Assert(this->update_flags & update_3rd_derivatives, ExcAccessToUninitializedField("update_3rd_derivatives")); AssertIndexRange(component, fe->n_components()); diff --git a/include/deal.II/hp/fe_collection.h b/include/deal.II/hp/fe_collection.h index 0489e2e15e..cf2138110f 100644 --- a/include/deal.II/hp/fe_collection.h +++ b/include/deal.II/hp/fe_collection.h @@ -884,8 +884,8 @@ namespace hp unsigned int max = 0; for (unsigned int i = 0; i < finite_elements.size(); ++i) - if (finite_elements[i]->dofs_per_vertex > max) - max = finite_elements[i]->dofs_per_vertex; + if (finite_elements[i]->n_dofs_per_vertex() > max) + max = finite_elements[i]->n_dofs_per_vertex(); return max; } @@ -964,8 +964,8 @@ namespace hp unsigned int max = 0; for (unsigned int i = 0; i < finite_elements.size(); ++i) - if (finite_elements[i]->dofs_per_cell > max) - max = finite_elements[i]->dofs_per_cell; + if (finite_elements[i]->n_dofs_per_cell() > max) + max = finite_elements[i]->n_dofs_per_cell(); return max; } diff --git a/include/deal.II/integrators/l2.h b/include/deal.II/integrators/l2.h index ea0bfa3220..fe7b8060ca 100644 --- a/include/deal.II/integrators/l2.h +++ b/include/deal.II/integrators/l2.h @@ -244,8 +244,8 @@ namespace LocalIntegrators const double factor1 = 1., const double factor2 = 1.) { - const unsigned int n1_dofs = fe1.dofs_per_cell; - const unsigned int n2_dofs = fe2.dofs_per_cell; + const unsigned int n1_dofs = fe1.n_dofs_per_cell(); + const unsigned int n2_dofs = fe2.n_dofs_per_cell(); const unsigned int n_components = fe1.get_fe().n_components(); Assert(n1_dofs == n2_dofs, ExcNotImplemented()); diff --git a/include/deal.II/integrators/maxwell.h b/include/deal.II/integrators/maxwell.h index cb31100575..4ec7ccd2e4 100644 --- a/include/deal.II/integrators/maxwell.h +++ b/include/deal.II/integrators/maxwell.h @@ -392,7 +392,7 @@ namespace LocalIntegrators const double factor1 = 1., const double factor2 = -1.) { - const unsigned int n_dofs = fe1.dofs_per_cell; + const unsigned int n_dofs = fe1.n_dofs_per_cell(); AssertDimension(fe1.get_fe().n_components(), dim); AssertDimension(fe2.get_fe().n_components(), dim); diff --git a/include/deal.II/matrix_free/cuda_matrix_free.templates.h b/include/deal.II/matrix_free/cuda_matrix_free.templates.h index d488792a67..21f725b9af 100644 --- a/include/deal.II/matrix_free/cuda_matrix_free.templates.h +++ b/include/deal.II/matrix_free/cuda_matrix_free.templates.h @@ -261,7 +261,7 @@ namespace CUDAWrappers const UpdateFlags & update_flags) : data(data) , fe_degree(data->fe_degree) - , dofs_per_cell(data->dofs_per_cell) + , dofs_per_cell(data->n_dofs_per_cell()) , q_points_per_cell(data->q_points_per_cell) , fe_values(mapping, fe, @@ -273,7 +273,7 @@ namespace CUDAWrappers , padding_length(data->get_padding_length()) , hanging_nodes(fe_degree, dof_handler, lexicographic_inv) { - local_dof_indices.resize(data->dofs_per_cell); + local_dof_indices.resize(data->n_dofs_per_cell()); lexicographic_dof_indices.resize(dofs_per_cell); } @@ -503,7 +503,7 @@ namespace CUDAWrappers const AffineConstraints &constraints) { std::vector local_dof_indices( - cell->get_fe().dofs_per_cell); + cell->get_fe().n_dofs_per_cell()); cell->get_dof_indices(local_dof_indices); constraints.resolve_indices(local_dof_indices); @@ -888,7 +888,7 @@ namespace CUDAWrappers padding_length = 1 << static_cast( std::ceil(dim * std::log2(fe_degree + 1.))); - dofs_per_cell = fe.dofs_per_cell; + dofs_per_cell = fe.n_dofs_per_cell(); q_points_per_cell = std::pow(n_q_points_1d, dim); const ::dealii::internal::MatrixFreeFunctions::ShapeInfo shape_info( diff --git a/include/deal.II/matrix_free/fe_evaluation.h b/include/deal.II/matrix_free/fe_evaluation.h index 8d0f6761b4..b5b172956e 100644 --- a/include/deal.II/matrix_free/fe_evaluation.h +++ b/include/deal.II/matrix_free/fe_evaluation.h @@ -7068,7 +7068,7 @@ FEEvaluationmapped_geometry.get() != nullptr, ExcNotInitialized()); this->mapped_geometry->reinit( static_cast::cell_iterator>(cell)); - this->local_dof_indices.resize(cell->get_fe().dofs_per_cell); + this->local_dof_indices.resize(cell->get_fe().n_dofs_per_cell()); if (level_dof_access) cell->get_mg_dof_indices(this->local_dof_indices); else diff --git a/include/deal.II/matrix_free/matrix_free.templates.h b/include/deal.II/matrix_free/matrix_free.templates.h index 9aadc8521f..e1a33459e0 100644 --- a/include/deal.II/matrix_free/matrix_free.templates.h +++ b/include/deal.II/matrix_free/matrix_free.templates.h @@ -408,7 +408,7 @@ MatrixFree::internal_reinit( dof_info[i].start_components[c] + dof_info[i].n_components[c]; } dof_info[i].dofs_per_cell.push_back( - dof_handler[i]->get_fe(0).dofs_per_cell); + dof_handler[i]->get_fe(0).n_dofs_per_cell()); // if indices are not initialized, the cell_level_index might not be // divisible by the vectorization length. But it must be for @@ -746,7 +746,7 @@ namespace internal dof_info[no].cell_active_fe_index.resize( n_active_cells, numbers::invalid_unsigned_int); - is_fe_dg[no] = fes[0].dofs_per_vertex == 0; + is_fe_dg[no] = fes[0].n_dofs_per_vertex() == 0; lexicographic[no].resize(fes.size()); @@ -759,7 +759,7 @@ namespace internal { const FiniteElement &fe = fes[fe_index]; // cache number of finite elements and dofs_per_cell - dof_info[no].dofs_per_cell.push_back(fe.dofs_per_cell); + dof_info[no].dofs_per_cell.push_back(fe.n_dofs_per_cell()); dof_info[no].dofs_per_face.push_back(fe.dofs_per_face); dof_info[no].dimension = dim; dof_info[no].n_base_elements = fe.n_base_elements(); @@ -780,7 +780,7 @@ namespace internal .push_back(dof_info[no] .component_dof_indices_offset[fe_index] .back() + - fe.base_element(c).dofs_per_cell); + fe.base_element(c).n_dofs_per_cell()); dof_info[no].fe_index_conversion[fe_index].push_back( fe.base_element(c).degree); } @@ -942,7 +942,7 @@ namespace internal dof_indices.resize( cell->neighbor_or_periodic_neighbor(f) ->get_fe() - .dofs_per_cell); + .n_dofs_per_cell()); cell->neighbor_or_periodic_neighbor(f) ->get_mg_dof_indices(dof_indices); for (const auto dof_index : dof_indices) diff --git a/include/deal.II/matrix_free/shape_info.templates.h b/include/deal.II/matrix_free/shape_info.templates.h index 26e07726cd..4bced72888 100644 --- a/include/deal.II/matrix_free/shape_info.templates.h +++ b/include/deal.II/matrix_free/shape_info.templates.h @@ -124,7 +124,8 @@ namespace internal const unsigned int fe_degree = fe->degree; const unsigned int n_q_points_1d = quad.size(); - const unsigned int n_dofs_1d = std::min(fe->dofs_per_cell, fe_degree + 1); + const unsigned int n_dofs_1d = + std::min(fe->n_dofs_per_cell(), fe_degree + 1); // renumber (this is necessary for FE_Q, for example, since there the // vertex DoFs come first, which is incompatible with the lexicographic @@ -154,8 +155,8 @@ namespace internal scalar_lexicographic = fe_poly->get_poly_space_numbering_inverse(); else if (fe_dgp != nullptr) { - scalar_lexicographic.resize(fe_dgp->dofs_per_cell); - for (unsigned int i = 0; i < fe_dgp->dofs_per_cell; ++i) + scalar_lexicographic.resize(fe_dgp->n_dofs_per_cell()); + for (unsigned int i = 0; i < fe_dgp->n_dofs_per_cell(); ++i) scalar_lexicographic[i] = i; element_type = truncated_tensor; } @@ -164,7 +165,7 @@ namespace internal scalar_lexicographic = fe_q_dg0->get_poly_space_numbering_inverse(); element_type = tensor_symmetric_plus_dg0; } - else if (fe->dofs_per_cell == 0) + else if (fe->n_dofs_per_cell() == 0) { // FE_Nothing case -> nothing to do here } @@ -183,7 +184,7 @@ namespace internal std::vector scalar_inv = Utilities::invert_permutation(scalar_lexicographic); std::vector lexicographic( - fe_in.dofs_per_cell, numbers::invalid_unsigned_int); + fe_in.n_dofs_per_cell(), numbers::invalid_unsigned_int); unsigned int components_before = 0; for (unsigned int e = 0; e < base_element_number; ++e) components_before += fe_in.element_multiplicity(e); @@ -199,7 +200,7 @@ namespace internal // have undefined blocks lexicographic_numbering.resize(fe_in.element_multiplicity( base_element_number) * - fe->dofs_per_cell, + fe->n_dofs_per_cell(), numbers::invalid_unsigned_int); for (unsigned int i = 0; i < lexicographic.size(); ++i) if (lexicographic[i] != numbers::invalid_unsigned_int) @@ -216,7 +217,7 @@ namespace internal // by reading the name, as done before r29356) if (fe->has_support_points()) unit_point = fe->get_unit_support_points()[scalar_lexicographic[0]]; - Assert(fe->dofs_per_cell == 0 || + Assert(fe->n_dofs_per_cell() == 0 || std::abs(fe->shape_value(scalar_lexicographic[0], unit_point) - 1) < 1e-13, ExcInternalError("Could not decode 1D shape functions for the " @@ -227,7 +228,7 @@ namespace internal n_q_points = Utilities::fixed_power(n_q_points_1d); n_q_points_face = dim > 1 ? Utilities::fixed_power(n_q_points_1d) : 1; - dofs_per_component_on_cell = fe->dofs_per_cell; + dofs_per_component_on_cell = fe->n_dofs_per_cell(); dofs_per_component_on_face = dim > 1 ? Utilities::fixed_power(fe_degree + 1) : 1; diff --git a/include/deal.II/meshworker/dof_info.h b/include/deal.II/meshworker/dof_info.h index 6bb11ae693..ad4d51ae13 100644 --- a/include/deal.II/meshworker/dof_info.h +++ b/include/deal.II/meshworker/dof_info.h @@ -304,7 +304,7 @@ namespace MeshWorker , level_cell(false) { std::vector aux(1); - aux[0] = dof_handler.get_fe().dofs_per_cell; + aux[0] = dof_handler.get_fe().n_dofs_per_cell(); aux_local_indices.reinit(aux); } @@ -314,12 +314,12 @@ namespace MeshWorker inline void DoFInfo::get_indices(const DHCellIterator &c) { - indices.resize(c->get_fe().dofs_per_cell); + indices.resize(c->get_fe().n_dofs_per_cell()); if (block_info == nullptr || block_info->local().size() == 0) c->get_active_or_mg_dof_indices(indices); else { - indices_org.resize(c->get_fe().dofs_per_cell); + indices_org.resize(c->get_fe().n_dofs_per_cell()); c->get_active_or_mg_dof_indices(indices_org); set_block_indices(); } diff --git a/include/deal.II/meshworker/scratch_data.h b/include/deal.II/meshworker/scratch_data.h index 3a18fee1b0..2d7b3b5255 100644 --- a/include/deal.II/meshworker/scratch_data.h +++ b/include/deal.II/meshworker/scratch_data.h @@ -998,7 +998,8 @@ namespace MeshWorker const std::string &global_vector_name, Number dummy) const { - const unsigned int n_dofs = get_current_fe_values().get_fe().dofs_per_cell; + const unsigned int n_dofs = + get_current_fe_values().get_fe().n_dofs_per_cell(); const std::string dofs_name = get_unique_dofs_name(global_vector_name, n_dofs, dummy); diff --git a/include/deal.II/multigrid/mg_transfer_internal.h b/include/deal.II/multigrid/mg_transfer_internal.h index 494cdfd082..7367914349 100644 --- a/include/deal.II/multigrid/mg_transfer_internal.h +++ b/include/deal.II/multigrid/mg_transfer_internal.h @@ -97,7 +97,7 @@ namespace internal /** * A variable storing the number of degrees of freedom on all child cells. - * It is 2dim*fe.dofs_per_cell for DG elements and + * It is 2dim*fe.n_dofs_per_cell() for DG elements and * somewhat less for continuous elements. */ unsigned int n_child_cell_dofs; diff --git a/include/deal.II/multigrid/mg_transfer_matrix_free.h b/include/deal.II/multigrid/mg_transfer_matrix_free.h index 939641b1e0..76e24a29d6 100644 --- a/include/deal.II/multigrid/mg_transfer_matrix_free.h +++ b/include/deal.II/multigrid/mg_transfer_matrix_free.h @@ -199,8 +199,8 @@ private: /** * A variable storing the number of degrees of freedom on all child cells. It - * is 2dim*fe.dofs_per_cell for DG elements and somewhat - * less for continuous elements. + * is 2dim*fe.n_dofs_per_cell() for DG elements and + * somewhat less for continuous elements. */ unsigned int n_child_cell_dofs; @@ -545,10 +545,10 @@ MGTransferMatrixFree::interpolate_to_mg( ghosted_vector = dst[level]; ghosted_vector.update_ghost_values(); - std::vector dof_values_coarse(fe.dofs_per_cell); - Vector dof_values_fine(fe.dofs_per_cell); - Vector tmp(fe.dofs_per_cell); - std::vector dof_indices(fe.dofs_per_cell); + std::vector dof_values_coarse(fe.n_dofs_per_cell()); + Vector dof_values_fine(fe.n_dofs_per_cell()); + Vector tmp(fe.n_dofs_per_cell()); + std::vector dof_indices(fe.n_dofs_per_cell()); typename DoFHandler::cell_iterator cell = dof_handler.begin(level - 1); typename DoFHandler::cell_iterator endc = dof_handler.end(level - 1); @@ -565,18 +565,18 @@ MGTransferMatrixFree::interpolate_to_mg( for (unsigned int child = 0; child < cell->n_children(); ++child) { cell->child(child)->get_mg_dof_indices(dof_indices); - for (unsigned int i = 0; i < fe.dofs_per_cell; ++i) + for (unsigned int i = 0; i < fe.n_dofs_per_cell(); ++i) dof_values_fine(i) = ghosted_vector(dof_indices[i]); fe.get_restriction_matrix(child, cell->refinement_case()) .vmult(tmp, dof_values_fine); - for (unsigned int i = 0; i < fe.dofs_per_cell; ++i) + for (unsigned int i = 0; i < fe.n_dofs_per_cell(); ++i) if (fe.restriction_is_additive(i)) dof_values_coarse[i] += tmp[i]; else if (tmp(i) != 0.) dof_values_coarse[i] = tmp[i]; } cell->get_mg_dof_indices(dof_indices); - for (unsigned int i = 0; i < fe.dofs_per_cell; ++i) + for (unsigned int i = 0; i < fe.n_dofs_per_cell(); ++i) dst[level - 1](dof_indices[i]) = dof_values_coarse[i]; } diff --git a/include/deal.II/numerics/data_out_dof_data.templates.h b/include/deal.II/numerics/data_out_dof_data.templates.h index d0545803c9..d9af4fb620 100644 --- a/include/deal.II/numerics/data_out_dof_data.templates.h +++ b/include/deal.II/numerics/data_out_dof_data.templates.h @@ -1251,7 +1251,7 @@ namespace internal const VectorType *vector = &((*vectors)[dof_cell->level()]); const unsigned int dofs_per_cell = - this->dof_handler->get_fe(0).dofs_per_cell; + this->dof_handler->get_fe(0).n_dofs_per_cell(); std::vector dof_indices(dofs_per_cell); dof_cell->get_mg_dof_indices(dof_indices); @@ -1290,7 +1290,7 @@ namespace internal const VectorType *vector = &((*vectors)[dof_cell->level()]); const unsigned int dofs_per_cell = - this->dof_handler->get_fe(0).dofs_per_cell; + this->dof_handler->get_fe(0).n_dofs_per_cell(); std::vector dof_indices(dofs_per_cell); dof_cell->get_mg_dof_indices(dof_indices); diff --git a/include/deal.II/numerics/matrix_creator.templates.h b/include/deal.II/numerics/matrix_creator.templates.h index bbbdf0467a..d1fd6b72f0 100644 --- a/include/deal.II/numerics/matrix_creator.templates.h +++ b/include/deal.II/numerics/matrix_creator.templates.h @@ -951,7 +951,7 @@ namespace MatrixCreator const unsigned int dofs_per_face = fe.dofs_per_face; copy_data.cell = cell; - copy_data.dofs_per_cell = fe.dofs_per_cell; + copy_data.dofs_per_cell = fe.n_dofs_per_cell(); UpdateFlags update_flags = UpdateFlags(update_values | update_JxW_values | update_normal_vectors | @@ -1382,7 +1382,7 @@ namespace MatrixCreator const unsigned int dofs_per_face = fe.dofs_per_face; copy_data.cell = cell; - copy_data.dofs_per_cell = fe.dofs_per_cell; + copy_data.dofs_per_cell = fe.n_dofs_per_cell(); copy_data.dofs.resize(copy_data.dofs_per_cell); cell->get_dof_indices(copy_data.dofs); diff --git a/include/deal.II/numerics/vector_tools_boundary.templates.h b/include/deal.II/numerics/vector_tools_boundary.templates.h index df11dd947a..0088a8d8ba 100644 --- a/include/deal.II/numerics/vector_tools_boundary.templates.h +++ b/include/deal.II/numerics/vector_tools_boundary.templates.h @@ -130,7 +130,7 @@ namespace VectorTools boundary_function.vector_value(cell->vertex(direction), function_values); - for (unsigned int i = 0; i < fe.dofs_per_vertex; ++i) + for (unsigned int i = 0; i < fe.n_dofs_per_vertex(); ++i) if (component_mask[fe.face_system_to_component_index(i) .first]) boundary_values[cell->vertex_dof_index( @@ -229,7 +229,7 @@ namespace VectorTools // interested in, however. make sure that all shape functions // that are non-zero for the components we are interested in, // are in fact primitive - for (unsigned int i = 0; i < cell->get_fe().dofs_per_cell; + for (unsigned int i = 0; i < cell->get_fe().n_dofs_per_cell(); ++i) { const ComponentMask &nonzero_component_array = @@ -310,19 +310,23 @@ namespace VectorTools (dim == 1 ? i : (dim == 2 ? - (i < 2 * fe.dofs_per_vertex ? + (i < 2 * fe.n_dofs_per_vertex() ? i : - i + 2 * fe.dofs_per_vertex) : + i + 2 * fe.n_dofs_per_vertex()) : (dim == 3 ? - (i < 4 * fe.dofs_per_vertex ? + (i < 4 * fe.n_dofs_per_vertex() ? i : - (i < 4 * fe.dofs_per_vertex + + (i < 4 * fe.n_dofs_per_vertex() + 4 * fe.dofs_per_line ? - i + 4 * fe.dofs_per_vertex : - i + 4 * fe.dofs_per_vertex + + i + + 4 * + fe.n_dofs_per_vertex() : + i + + 4 * + fe.n_dofs_per_vertex() + 8 * fe.dofs_per_line)) : numbers::invalid_unsigned_int))); - Assert(cell_i < fe.dofs_per_cell, + Assert(cell_i < fe.n_dofs_per_cell(), ExcInternalError()); // make sure that if this is not a primitive @@ -2150,7 +2154,7 @@ namespace VectorTools // and so on. const unsigned int face_dof_idx = - GeometryInfo::vertices_per_face * fe.dofs_per_vertex + + GeometryInfo::vertices_per_face * fe.n_dofs_per_vertex() + line * fe.dofs_per_line + line_dof_idx; // Note, assuming that the edge orientations are "standard" @@ -2586,7 +2590,7 @@ namespace VectorTools // (degree+1),..,2*(degree+1) and so on. const unsigned int face_dof_idx = GeometryInfo::vertices_per_face * - fe.dofs_per_vertex + + fe.n_dofs_per_vertex() + line * fe.dofs_per_line + line_dof_idx; // Next, translate from face to cell. Note, this might be @@ -2661,7 +2665,8 @@ namespace VectorTools ++quad_dof_idx) { const unsigned int face_idx = - GeometryInfo::vertices_per_face * fe.dofs_per_vertex + + GeometryInfo::vertices_per_face * + fe.n_dofs_per_vertex() + lines_per_face * fe.dofs_per_line + quad_dof_idx; const unsigned int cell_idx = fe.face_to_cell_index(face_idx, face); diff --git a/include/deal.II/numerics/vector_tools_interpolate.templates.h b/include/deal.II/numerics/vector_tools_interpolate.templates.h index 511400948c..eac1231721 100644 --- a/include/deal.II/numerics/vector_tools_interpolate.templates.h +++ b/include/deal.II/numerics/vector_tools_interpolate.templates.h @@ -334,7 +334,7 @@ namespace VectorTools const unsigned int fe_index = cell->active_fe_index(); // Do nothing if there are no local degrees of freedom. - if (fe[fe_index].dofs_per_cell == 0) + if (fe[fe_index].n_dofs_per_cell() == 0) continue; // Skip processing of the current cell if the function object is @@ -349,7 +349,7 @@ namespace VectorTools fe_values.get_present_fe_values().get_quadrature_points(); // Get indices of the dofs on this cell - const auto n_dofs = fe[fe_index].dofs_per_cell; + const auto n_dofs = fe[fe_index].n_dofs_per_cell(); dofs_on_cell.resize(n_dofs); cell->get_dof_indices(dofs_on_cell); @@ -533,8 +533,8 @@ namespace VectorTools OutVector & data_2) { using number = typename OutVector::value_type; - Vector cell_data_1(dof_1.get_fe().dofs_per_cell); - Vector cell_data_2(dof_2.get_fe().dofs_per_cell); + Vector cell_data_1(dof_1.get_fe().n_dofs_per_cell()); + Vector cell_data_2(dof_2.get_fe().n_dofs_per_cell()); // Reset output vector. data_2 = static_cast(0); @@ -544,7 +544,7 @@ namespace VectorTools touch_count.reinit(data_2); std::vector local_dof_indices( - dof_2.get_fe().dofs_per_cell); + dof_2.get_fe().n_dofs_per_cell()); typename DoFHandler::active_cell_iterator cell_1 = dof_1.begin_active(); @@ -565,7 +565,7 @@ namespace VectorTools cell_2->get_dof_indices(local_dof_indices); // Distribute cell vector. - for (unsigned int j = 0; j < dof_2.get_fe().dofs_per_cell; ++j) + for (unsigned int j = 0; j < dof_2.get_fe().n_dofs_per_cell(); ++j) { ::dealii::internal::ElementAccess::add( cell_data_2(j), local_dof_indices[j], data_2); @@ -638,9 +638,10 @@ namespace VectorTools MappingQGeneric map_q(fe.degree); FEValues fe_v(map_q, fe, quad, update_quadrature_points); - std::vector dofs(fe.dofs_per_cell); + std::vector dofs(fe.n_dofs_per_cell()); - AssertDimension(fe.dofs_per_cell, fe.get_unit_support_points().size()); + AssertDimension(fe.n_dofs_per_cell(), + fe.get_unit_support_points().size()); Assert(fe.is_primitive(), ExcMessage("FE is not Primitive! This won't work.")); @@ -699,8 +700,9 @@ namespace VectorTools const ComponentMask maskq(spacedim, true); get_position_vector(dhq, eulerq); - FullMatrix transfer(fe.dofs_per_cell, feq.dofs_per_cell); - FullMatrix local_transfer(feq.dofs_per_cell); + FullMatrix transfer(fe.n_dofs_per_cell(), + feq.n_dofs_per_cell()); + FullMatrix local_transfer(feq.n_dofs_per_cell()); const std::vector> &points = feq.get_unit_support_points(); // Here we construct the interpolation matrix from @@ -735,18 +737,18 @@ namespace VectorTools // and check that this is the case. If not, we bail out, not // knowing what to do in this case. - std::vector fe_to_feq(fe.dofs_per_cell, + std::vector fe_to_feq(fe.n_dofs_per_cell(), numbers::invalid_unsigned_int); unsigned int index = 0; - for (unsigned int i = 0; i < fe.dofs_per_cell; ++i) + for (unsigned int i = 0; i < fe.n_dofs_per_cell(); ++i) if (fe_mask[fe.system_to_component_index(i).first]) fe_to_feq[i] = index++; - // If index is not the same as feq.dofs_per_cell, we won't + // If index is not the same as feq.n_dofs_per_cell(), we won't // know how to invert the resulting matrix. Bail out. - Assert(index == feq.dofs_per_cell, ExcNotImplemented()); + Assert(index == feq.n_dofs_per_cell(), ExcNotImplemented()); - for (unsigned int j = 0; j < fe.dofs_per_cell; ++j) + for (unsigned int j = 0; j < fe.n_dofs_per_cell(); ++j) { const unsigned int comp_j = fe.system_to_component_index(j).first; if (fe_mask[comp_j]) @@ -763,9 +765,9 @@ namespace VectorTools // one is filled only with the information from the components // of the displacement. The rest is set to zero. local_transfer.invert(local_transfer); - for (unsigned int i = 0; i < fe.dofs_per_cell; ++i) + for (unsigned int i = 0; i < fe.n_dofs_per_cell(); ++i) if (fe_to_feq[i] != numbers::invalid_unsigned_int) - for (unsigned int j = 0; j < feq.dofs_per_cell; ++j) + for (unsigned int j = 0; j < feq.n_dofs_per_cell(); ++j) transfer(i, j) = local_transfer(fe_to_feq[i], j); // The interpolation matrix is then passed to the @@ -927,7 +929,7 @@ namespace VectorTools // dof_values by interpolation. if (cell1->is_active()) { - cache.reinit(cell1->get_fe().dofs_per_cell); + cache.reinit(cell1->get_fe().n_dofs_per_cell()); cell1->get_interpolated_dof_values(u1, cache, cell1->active_fe_index()); @@ -937,7 +939,7 @@ namespace VectorTools } else { - cache.reinit(cell2->get_fe().dofs_per_cell); + cache.reinit(cell2->get_fe().n_dofs_per_cell()); cell1->get_interpolated_dof_values(u1, cache, cell2->active_fe_index()); diff --git a/include/deal.II/numerics/vector_tools_point_value.templates.h b/include/deal.II/numerics/vector_tools_point_value.templates.h index 05c831c63c..5c4da1c075 100644 --- a/include/deal.II/numerics/vector_tools_point_value.templates.h +++ b/include/deal.II/numerics/vector_tools_point_value.templates.h @@ -299,7 +299,7 @@ namespace VectorTools UpdateFlags(update_values)); fe_values.reinit(cell_point.first); - const unsigned int dofs_per_cell = dof_handler.get_fe().dofs_per_cell; + const unsigned int dofs_per_cell = dof_handler.get_fe().n_dofs_per_cell(); std::vector local_dof_indices(dofs_per_cell); cell_point.first->get_dof_indices(local_dof_indices); @@ -358,7 +358,8 @@ namespace VectorTools UpdateFlags(update_values)); fe_values.reinit(cell_point.first); - const unsigned int dofs_per_cell = cell_point.first->get_fe().dofs_per_cell; + const unsigned int dofs_per_cell = + cell_point.first->get_fe().n_dofs_per_cell(); std::vector local_dof_indices(dofs_per_cell); cell_point.first->get_dof_indices(local_dof_indices); @@ -400,7 +401,7 @@ namespace VectorTools UpdateFlags(update_values)); fe_values.reinit(cell_point.first); - const unsigned int dofs_per_cell = dof_handler.get_fe().dofs_per_cell; + const unsigned int dofs_per_cell = dof_handler.get_fe().n_dofs_per_cell(); std::vector local_dof_indices(dofs_per_cell); cell_point.first->get_dof_indices(local_dof_indices); @@ -466,7 +467,8 @@ namespace VectorTools UpdateFlags(update_values)); fe_values.reinit(cell_point.first); - const unsigned int dofs_per_cell = cell_point.first->get_fe().dofs_per_cell; + const unsigned int dofs_per_cell = + cell_point.first->get_fe().n_dofs_per_cell(); std::vector local_dof_indices(dofs_per_cell); cell_point.first->get_dof_indices(local_dof_indices); diff --git a/include/deal.II/numerics/vector_tools_project.templates.h b/include/deal.II/numerics/vector_tools_project.templates.h index f4c730afd1..8748496ebe 100644 --- a/include/deal.II/numerics/vector_tools_project.templates.h +++ b/include/deal.II/numerics/vector_tools_project.templates.h @@ -639,7 +639,7 @@ namespace VectorTools quadrature, update_values | update_JxW_values); - const unsigned int dofs_per_cell = dof.get_fe().dofs_per_cell; + const unsigned int dofs_per_cell = dof.get_fe().n_dofs_per_cell(); const unsigned int n_q_points = quadrature.size(); Vector cell_rhs(dofs_per_cell); std::vector local_dof_indices(dofs_per_cell); diff --git a/include/deal.II/particles/utilities.h b/include/deal.II/particles/utilities.h index cf06c04a37..e3f3bd6fa3 100644 --- a/include/deal.II/particles/utilities.h +++ b/include/deal.II/particles/utilities.h @@ -220,7 +220,7 @@ namespace Particles if (comps[i]) space_gtl[i] = j++; - std::vector dof_indices(fe.dofs_per_cell); + std::vector dof_indices(fe.n_dofs_per_cell()); while (particle != particle_handler.end()) { @@ -238,7 +238,7 @@ namespace Particles const auto id = particle->get_id(); - for (unsigned int j = 0; j < fe.dofs_per_cell; ++j) + for (unsigned int j = 0; j < fe.n_dofs_per_cell(); ++j) { const auto comp_j = space_gtl[fe.system_to_component_index(j).first]; diff --git a/source/distributed/cell_weights.cc b/source/distributed/cell_weights.cc index 01d1ae9982..fb8dfff2bc 100644 --- a/source/distributed/cell_weights.cc +++ b/source/distributed/cell_weights.cc @@ -82,7 +82,7 @@ namespace parallel const FiniteElement &future_fe) -> unsigned int { const float result = std::trunc(coefficients.first * - std::pow(future_fe.dofs_per_cell, coefficients.second)); + std::pow(future_fe.n_dofs_per_cell(), coefficients.second)); Assert(result >= 0. && result <= @@ -106,7 +106,8 @@ namespace parallel const FiniteElement &future_fe) -> unsigned int { float result = 0; for (const auto &pair : coefficients) - result += pair.first * std::pow(future_fe.dofs_per_cell, pair.second); + result += + pair.first * std::pow(future_fe.n_dofs_per_cell(), pair.second); result = std::trunc(result); Assert(result >= 0. && diff --git a/source/distributed/solution_transfer.cc b/source/distributed/solution_transfer.cc index 2e4652abbd..481990c56d 100644 --- a/source/distributed/solution_transfer.cc +++ b/source/distributed/solution_transfer.cc @@ -343,7 +343,7 @@ namespace parallel } const unsigned int dofs_per_cell = - dof_handler->get_fe(fe_index).dofs_per_cell; + dof_handler->get_fe(fe_index).n_dofs_per_cell(); if (dofs_per_cell == 0) return std::vector(); // nothing to do for FE_Nothing @@ -418,7 +418,7 @@ namespace parallel } const unsigned int dofs_per_cell = - dof_handler->get_fe(fe_index).dofs_per_cell; + dof_handler->get_fe(fe_index).n_dofs_per_cell(); if (dofs_per_cell == 0) return; // nothing to do for FE_Nothing diff --git a/source/dofs/dof_accessor.cc b/source/dofs/dof_accessor.cc index 836f4dbc33..863d584cd4 100644 --- a/source/dofs/dof_accessor.cc +++ b/source/dofs/dof_accessor.cc @@ -130,7 +130,7 @@ DoFCellAccessor::set_dof_indices( Assert(this->dof_handler != nullptr, typename BaseClass::ExcInvalidObject()); - AssertDimension(local_dof_indices.size(), this->get_fe().dofs_per_cell); + AssertDimension(local_dof_indices.size(), this->get_fe().n_dofs_per_cell()); internal::DoFAccessorImplementation::Implementation:: template set_dof_indices(*this, diff --git a/source/dofs/dof_accessor_get.cc b/source/dofs/dof_accessor_get.cc index b9b2f7c6fe..0569e0475e 100644 --- a/source/dofs/dof_accessor_get.cc +++ b/source/dofs/dof_accessor_get.cc @@ -73,7 +73,7 @@ DoFCellAccessor::get_interpolated_dof_values( // well, here we need to first get the values from the current // cell and then interpolate it to the element requested. this // can clearly only happen for hp::DoFHandler objects - const unsigned int dofs_per_cell = this->get_fe().dofs_per_cell; + const unsigned int dofs_per_cell = this->get_fe().n_dofs_per_cell(); if (dofs_per_cell == 0) { interpolated_values = 0; @@ -84,8 +84,8 @@ DoFCellAccessor::get_interpolated_dof_values( this->get_dof_values(values, tmp); FullMatrix interpolation( - this->dof_handler->get_fe(fe_index).dofs_per_cell, - this->get_fe().dofs_per_cell); + this->dof_handler->get_fe(fe_index).n_dofs_per_cell(), + this->get_fe().n_dofs_per_cell()); this->dof_handler->get_fe(fe_index).get_interpolation_matrix( this->get_fe(), interpolation); interpolation.vmult(interpolated_values, tmp); @@ -115,7 +115,7 @@ DoFCellAccessor::get_interpolated_dof_values( const FiniteElement &fe = this->get_dof_handler().get_fe(fe_index); - const unsigned int dofs_per_cell = fe.dofs_per_cell; + const unsigned int dofs_per_cell = fe.n_dofs_per_cell(); Assert(this->dof_handler != nullptr, typename BaseClass::ExcInvalidObject()); @@ -130,7 +130,7 @@ DoFCellAccessor::get_interpolated_dof_values( // interpolating FE_Nothing), then simply skip all of the // following since the output vector would be of size zero // anyway (and in fact is of size zero, see the assertion above) - if (fe.dofs_per_cell > 0) + if (fe.n_dofs_per_cell() > 0) { Vector tmp1(dofs_per_cell); Vector tmp2(dofs_per_cell); diff --git a/source/dofs/dof_accessor_set.cc b/source/dofs/dof_accessor_set.cc index b5c1143819..b9fd3d0ab1 100644 --- a/source/dofs/dof_accessor_set.cc +++ b/source/dofs/dof_accessor_set.cc @@ -69,12 +69,12 @@ DoFCellAccessor::set_dof_values_by_interpolation( else { Assert(local_values.size() == - this->dof_handler->get_fe(fe_index).dofs_per_cell, + this->dof_handler->get_fe(fe_index).n_dofs_per_cell(), ExcMessage("Incorrect size of local_values vector.")); FullMatrix interpolation( - this->get_fe().dofs_per_cell, - this->dof_handler->get_fe(fe_index).dofs_per_cell); + this->get_fe().n_dofs_per_cell(), + this->dof_handler->get_fe(fe_index).n_dofs_per_cell()); this->get_fe().get_interpolation_matrix( this->dof_handler->get_fe(fe_index), interpolation); @@ -82,7 +82,7 @@ DoFCellAccessor::set_dof_values_by_interpolation( // do the interpolation to the target space. for historical // reasons, matrices are set to size 0x0 internally even // we reinit as 4x0, so we have to treat this case specially - Vector tmp(this->get_fe().dofs_per_cell); + Vector tmp(this->get_fe().n_dofs_per_cell()); if ((tmp.size() > 0) && (local_values.size() > 0)) interpolation.vmult(tmp, local_values); @@ -105,7 +105,7 @@ DoFCellAccessor::set_dof_values_by_interpolation( const FiniteElement &fe = this->get_dof_handler().get_fe(fe_index); - const unsigned int dofs_per_cell = fe.dofs_per_cell; + const unsigned int dofs_per_cell = fe.n_dofs_per_cell(); Assert(this->dof_handler != nullptr, typename BaseClass::ExcInvalidObject()); diff --git a/source/dofs/dof_handler.cc b/source/dofs/dof_handler.cc index dd0b53f1c6..ec9004b891 100644 --- a/source/dofs/dof_handler.cc +++ b/source/dofs/dof_handler.cc @@ -160,8 +160,8 @@ namespace internal // the following numbers are not based on actual counting but by // extrapolating the number sequences from the previous ones (for - // example, for dofs_per_vertex, the sequence above is 19, 21, 28, - // 30, 37, and is continued as follows): + // example, for n_dofs_per_vertex(), the sequence above is 19, 21, + // 28, 30, 37, and is continued as follows): case 9: max_couplings = 39 * dof_handler.fe_collection.max_dofs_per_vertex() + @@ -260,7 +260,8 @@ namespace internal static void reserve_space(DoFHandler<1, spacedim> &dof_handler) { dof_handler.object_dof_indices[0][0].resize( - dof_handler.tria->n_vertices() * dof_handler.get_fe().dofs_per_vertex, + dof_handler.tria->n_vertices() * + dof_handler.get_fe().n_dofs_per_vertex(), numbers::invalid_dof_index); for (unsigned int i = 0; i < dof_handler.tria->n_levels(); ++i) @@ -279,7 +280,7 @@ namespace internal dof_handler.cell_dof_cache_indices[i].resize( dof_handler.tria->n_raw_cells(i) * - dof_handler.get_fe().dofs_per_cell, + dof_handler.get_fe().n_dofs_per_cell(), numbers::invalid_dof_index); dof_handler.cell_dof_cache_ptr[i].reserve( @@ -287,11 +288,12 @@ namespace internal for (unsigned int j = 0; j < dof_handler.tria->n_raw_cells(i) + 1; j++) dof_handler.cell_dof_cache_ptr[i].push_back( - j * dof_handler.get_fe().dofs_per_cell); + j * dof_handler.get_fe().n_dofs_per_cell()); } dof_handler.object_dof_indices[0][0].resize( - dof_handler.tria->n_vertices() * dof_handler.get_fe().dofs_per_vertex, + dof_handler.tria->n_vertices() * + dof_handler.get_fe().n_dofs_per_vertex(), numbers::invalid_dof_index); } @@ -299,7 +301,8 @@ namespace internal static void reserve_space(DoFHandler<2, spacedim> &dof_handler) { dof_handler.object_dof_indices[0][0].resize( - dof_handler.tria->n_vertices() * dof_handler.get_fe().dofs_per_vertex, + dof_handler.tria->n_vertices() * + dof_handler.get_fe().n_dofs_per_vertex(), numbers::invalid_dof_index); for (unsigned int i = 0; i < dof_handler.tria->n_levels(); ++i) @@ -318,7 +321,7 @@ namespace internal dof_handler.cell_dof_cache_indices[i].resize( dof_handler.tria->n_raw_cells(i) * - dof_handler.get_fe().dofs_per_cell, + dof_handler.get_fe().n_dofs_per_cell(), numbers::invalid_dof_index); dof_handler.cell_dof_cache_ptr[i].reserve( @@ -326,11 +329,12 @@ namespace internal for (unsigned int j = 0; j < dof_handler.tria->n_raw_cells(i) + 1; j++) dof_handler.cell_dof_cache_ptr[i].push_back( - j * dof_handler.get_fe().dofs_per_cell); + j * dof_handler.get_fe().n_dofs_per_cell()); } dof_handler.object_dof_indices[0][0].resize( - dof_handler.tria->n_vertices() * dof_handler.get_fe().dofs_per_vertex, + dof_handler.tria->n_vertices() * + dof_handler.get_fe().n_dofs_per_vertex(), numbers::invalid_dof_index); if (dof_handler.tria->n_cells() > 0) @@ -354,7 +358,8 @@ namespace internal static void reserve_space(DoFHandler<3, spacedim> &dof_handler) { dof_handler.object_dof_indices[0][0].resize( - dof_handler.tria->n_vertices() * dof_handler.get_fe().dofs_per_vertex, + dof_handler.tria->n_vertices() * + dof_handler.get_fe().n_dofs_per_vertex(), numbers::invalid_dof_index); for (unsigned int i = 0; i < dof_handler.tria->n_levels(); ++i) @@ -373,7 +378,7 @@ namespace internal dof_handler.cell_dof_cache_indices[i].resize( dof_handler.tria->n_raw_cells(i) * - dof_handler.get_fe().dofs_per_cell, + dof_handler.get_fe().n_dofs_per_cell(), numbers::invalid_dof_index); dof_handler.cell_dof_cache_ptr[i].reserve( @@ -381,11 +386,12 @@ namespace internal for (unsigned int j = 0; j < dof_handler.tria->n_raw_cells(i) + 1; j++) dof_handler.cell_dof_cache_ptr[i].push_back( - j * dof_handler.get_fe().dofs_per_cell); + j * dof_handler.get_fe().n_dofs_per_cell()); } dof_handler.object_dof_indices[0][0].resize( - dof_handler.tria->n_vertices() * dof_handler.get_fe().dofs_per_vertex, + dof_handler.tria->n_vertices() * + dof_handler.get_fe().n_dofs_per_vertex(), numbers::invalid_dof_index); if (dof_handler.tria->n_cells() > 0) @@ -475,7 +481,7 @@ namespace internal dof_handler.mg_vertex_dofs[vertex].init( min_level[vertex], max_level[vertex], - dof_handler.get_fe().dofs_per_vertex); + dof_handler.get_fe().n_dofs_per_vertex()); } else @@ -548,7 +554,7 @@ namespace internal ExcInternalError()); dof_handler.mg_vertex_dofs[vertex].init(min_level[vertex], max_level[vertex], - fe.dofs_per_vertex); + fe.n_dofs_per_vertex()); } else @@ -623,7 +629,7 @@ namespace internal ExcInternalError()); dof_handler.mg_vertex_dofs[vertex].init(min_level[vertex], max_level[vertex], - fe.dofs_per_vertex); + fe.n_dofs_per_vertex()); } else @@ -1078,7 +1084,7 @@ namespace internal { fe_slots_needed++; vertex_slots_needed += - dof_handler.get_fe(fe).dofs_per_vertex; + dof_handler.get_fe(fe).n_dofs_per_vertex(); } } } @@ -1102,7 +1108,7 @@ namespace internal dof_handler.object_dof_indices[l][d].size()); for (unsigned int i = 0; - i < dof_handler.get_fe(fe).dofs_per_vertex; + i < dof_handler.get_fe(fe).n_dofs_per_vertex(); i++) dof_handler.object_dof_indices[l][d].push_back( numbers::invalid_dof_index); @@ -1173,7 +1179,7 @@ namespace internal dof_handler.cell_dof_cache_ptr[level][cell->index()] = cache_size; - cache_size += cell->get_fe().dofs_per_cell; + cache_size += cell->get_fe().n_dofs_per_cell(); } dof_handler.object_dof_indices[level][dim] = diff --git a/source/dofs/dof_handler_policy.cc b/source/dofs/dof_handler_policy.cc index 0df5e7a642..4803ec877b 100644 --- a/source/dofs/dof_handler_policy.cc +++ b/source/dofs/dof_handler_policy.cc @@ -1702,7 +1702,7 @@ namespace internal if ((subdomain_id == numbers::invalid_subdomain_id) || (cell->subdomain_id() == subdomain_id)) { - dof_indices.resize(cell->get_fe().dofs_per_cell); + dof_indices.resize(cell->get_fe().n_dofs_per_cell()); // circumvent cache internal::DoFAccessorImplementation::Implementation:: @@ -1755,7 +1755,7 @@ namespace internal // delete all dofs that live there and that we have // previously assigned a number to (i.e. the ones on // the interface) - local_dof_indices.resize(cell->get_fe().dofs_per_cell); + local_dof_indices.resize(cell->get_fe().n_dofs_per_cell()); cell->get_dof_indices(local_dof_indices); for (const auto &local_dof_index : local_dof_indices) if (local_dof_index != numbers::invalid_dof_index) @@ -1792,7 +1792,7 @@ namespace internal if ((level_subdomain_id == numbers::invalid_subdomain_id) || (cell->level_subdomain_id() == level_subdomain_id)) { - dof_indices.resize(cell->get_fe().dofs_per_cell); + dof_indices.resize(cell->get_fe().n_dofs_per_cell()); cell->get_mg_dof_indices(dof_indices); @@ -1865,7 +1865,7 @@ namespace internal // really is unused Assert(dof_handler.get_triangulation().vertex_used( (i - dof_handler.object_dof_indices[0][0].begin()) / - dof_handler.get_fe().dofs_per_vertex) == false, + dof_handler.get_fe().n_dofs_per_vertex()) == false, ExcInternalError()); return; } @@ -1906,7 +1906,7 @@ namespace internal std::integral_constant()); for (unsigned int d = 0; - d < dof_handler.get_fe(fe_index).dofs_per_vertex; + d < dof_handler.get_fe(fe_index).n_dofs_per_vertex(); ++d) { const types::global_dof_index old_dof_index = @@ -2457,13 +2457,14 @@ namespace internal // if the present vertex lives on the current level if ((i->get_coarsest_level() <= level) && (i->get_finest_level() >= level)) - for (unsigned int d = 0; d < dof_handler.get_fe().dofs_per_vertex; + for (unsigned int d = 0; + d < dof_handler.get_fe().n_dofs_per_vertex(); ++d) { const dealii::types::global_dof_index idx = i->get_index(level, d, - dof_handler.get_fe().dofs_per_vertex); + dof_handler.get_fe().n_dofs_per_vertex()); if (idx != numbers::invalid_dof_index) { @@ -2474,7 +2475,7 @@ namespace internal ExcInternalError()); i->set_index(level, d, - dof_handler.get_fe().dofs_per_vertex, + dof_handler.get_fe().n_dofs_per_vertex(), (indices_we_care_about.size() == 0) ? (new_numbers[idx]) : (new_numbers[indices_we_care_about @@ -2908,7 +2909,8 @@ namespace internal // that all cells are either locally owned or ghosts (not // artificial), so this call will always yield the true owner const types::subdomain_id subdomain_id = cell->subdomain_id(); - const unsigned int dofs_per_cell = cell->get_fe().dofs_per_cell; + const unsigned int dofs_per_cell = + cell->get_fe().n_dofs_per_cell(); local_dof_indices.resize(dofs_per_cell); cell->get_dof_indices(local_dof_indices); @@ -2970,7 +2972,8 @@ namespace internal // artificial), so this call will always yield the true owner const types::subdomain_id level_subdomain_id = cell->level_subdomain_id(); - const unsigned int dofs_per_cell = cell->get_fe().dofs_per_cell; + const unsigned int dofs_per_cell = + cell->get_fe().n_dofs_per_cell(); local_dof_indices.resize(dofs_per_cell); cell->get_mg_dof_indices(local_dof_indices); @@ -3554,14 +3557,14 @@ namespace internal ExcInternalError()); std::vector data( - cell->get_fe().dofs_per_cell); + cell->get_fe().n_dofs_per_cell()); cell->get_mg_dof_indices(data); return data; }; const auto unpack = [](const auto &cell, const auto &dofs) { - Assert(cell->get_fe().dofs_per_cell == dofs.size(), + Assert(cell->get_fe().n_dofs_per_cell() == dofs.size(), ExcInternalError()); Assert(cell->level_subdomain_id() != @@ -3569,7 +3572,7 @@ namespace internal ExcInternalError()); std::vector dof_indices( - cell->get_fe().dofs_per_cell); + cell->get_fe().n_dofs_per_cell()); cell->get_mg_dof_indices(dof_indices); bool complete = true; @@ -3655,20 +3658,20 @@ namespace internal Assert(cell->is_locally_owned(), ExcInternalError()); std::vector data( - cell->get_fe().dofs_per_cell); + cell->get_fe().n_dofs_per_cell()); cell->get_dof_indices(data); return data; }; const auto unpack = [](const auto &cell, const auto &dofs) { - Assert(cell->get_fe().dofs_per_cell == dofs.size(), + Assert(cell->get_fe().n_dofs_per_cell() == dofs.size(), ExcInternalError()); Assert(cell->is_ghost(), ExcInternalError()); std::vector dof_indices( - cell->get_fe().dofs_per_cell); + cell->get_fe().n_dofs_per_cell()); cell->update_cell_dof_indices_cache(); cell->get_dof_indices(dof_indices); @@ -3941,7 +3944,7 @@ namespace internal for (const auto &cell : dof_handler->active_cell_iterators()) if (!cell->is_artificial()) { - local_dof_indices.resize(cell->get_fe().dofs_per_cell); + local_dof_indices.resize(cell->get_fe().n_dofs_per_cell()); cell->get_dof_indices(local_dof_indices); if (local_dof_indices.end() != std::find(local_dof_indices.begin(), @@ -4041,9 +4044,11 @@ namespace internal // delete all dofs that live there and that we // have previously assigned a number to // (i.e. the ones on the interface) - local_dof_indices.resize(cell->get_fe().dofs_per_cell); + local_dof_indices.resize( + cell->get_fe().n_dofs_per_cell()); cell->get_mg_dof_indices(local_dof_indices); - for (unsigned int i = 0; i < cell->get_fe().dofs_per_cell; + for (unsigned int i = 0; + i < cell->get_fe().n_dofs_per_cell(); ++i) if (local_dof_indices[i] != numbers::invalid_dof_index) renumbering[local_dof_indices[i]] = @@ -4176,7 +4181,7 @@ namespace internal if (cell->level_subdomain_id() != dealii::numbers::artificial_subdomain_id) { - local_dof_indices.resize(cell->get_fe().dofs_per_cell); + local_dof_indices.resize(cell->get_fe().n_dofs_per_cell()); cell->get_mg_dof_indices(local_dof_indices); if (local_dof_indices.end() != std::find(local_dof_indices.begin(), @@ -4369,10 +4374,11 @@ namespace internal for (auto cell : dof_handler->active_cell_iterators()) if (cell->is_ghost()) { - local_dof_indices.resize(cell->get_fe().dofs_per_cell); + local_dof_indices.resize(cell->get_fe().n_dofs_per_cell()); cell->get_dof_indices(local_dof_indices); - for (unsigned int i = 0; i < cell->get_fe().dofs_per_cell; + for (unsigned int i = 0; + i < cell->get_fe().n_dofs_per_cell(); ++i) // delete a DoF index if it has not already been deleted // (e.g., by visiting a neighboring cell, if it is on the diff --git a/source/dofs/dof_renumbering.cc b/source/dofs/dof_renumbering.cc index 80932f51f4..91dd5cc960 100644 --- a/source/dofs/dof_renumbering.cc +++ b/source/dofs/dof_renumbering.cc @@ -293,7 +293,7 @@ namespace DoFRenumbering for (const auto &cell : dof_handler.active_cell_iterators()) { - const unsigned int dofs_per_cell = cell->get_fe().dofs_per_cell; + const unsigned int dofs_per_cell = cell->get_fe().n_dofs_per_cell(); dofs_on_this_cell.resize(dofs_per_cell); @@ -756,8 +756,8 @@ namespace DoFRenumbering std::vector> component_list(fe_collection.size()); for (unsigned int f = 0; f < fe_collection.size(); ++f) { - const FiniteElement &fe = fe_collection[f]; - const unsigned int dofs_per_cell = fe.dofs_per_cell; + const FiniteElement &fe = fe_collection[f]; + const unsigned int dofs_per_cell = fe.n_dofs_per_cell(); component_list[f].resize(dofs_per_cell); for (unsigned int i = 0; i < dofs_per_cell; ++i) if (fe.is_primitive(i)) @@ -815,7 +815,7 @@ namespace DoFRenumbering // list using their component const unsigned int fe_index = cell->active_fe_index(); const unsigned int dofs_per_cell = - fe_collection[fe_index].dofs_per_cell; + fe_collection[fe_index].n_dofs_per_cell(); local_dof_indices.resize(dofs_per_cell); cell->get_active_or_mg_dof_indices(local_dof_indices); @@ -1047,8 +1047,8 @@ namespace DoFRenumbering for (unsigned int f = 0; f < fe_collection.size(); ++f) { const FiniteElement &fe = fe_collection[f]; - block_list[f].resize(fe.dofs_per_cell); - for (unsigned int i = 0; i < fe.dofs_per_cell; ++i) + block_list[f].resize(fe.n_dofs_per_cell()); + for (unsigned int i = 0; i < fe.n_dofs_per_cell(); ++i) block_list[f][i] = fe.system_to_block_index(i).first; } @@ -1092,7 +1092,7 @@ namespace DoFRenumbering // list using their component const unsigned int fe_index = cell->active_fe_index(); const unsigned int dofs_per_cell = - fe_collection[fe_index].dofs_per_cell; + fe_collection[fe_index].n_dofs_per_cell(); local_dof_indices.resize(dofs_per_cell); cell->get_active_or_mg_dof_indices(local_dof_indices); @@ -1255,7 +1255,8 @@ namespace DoFRenumbering if (cell->is_locally_owned()) { // first get the existing DoF indices - const unsigned int dofs_per_cell = cell->get_fe().dofs_per_cell; + const unsigned int dofs_per_cell = + cell->get_fe().n_dofs_per_cell(); std::vector local_dof_indices( dofs_per_cell); cell->get_dof_indices(local_dof_indices); @@ -1760,7 +1761,7 @@ namespace DoFRenumbering for (const auto &cell : dof.active_cell_iterators()) { - const unsigned int dofs_per_cell = cell->get_fe().dofs_per_cell; + const unsigned int dofs_per_cell = cell->get_fe().n_dofs_per_cell(); local_dof_indices.resize(dofs_per_cell); hp_fe_values.reinit(cell); const FEValues &fe_values = @@ -1854,7 +1855,7 @@ namespace DoFRenumbering std::vector already_touched(dof.n_dofs(), false); - const unsigned int dofs_per_cell = dof.get_fe().dofs_per_cell; + const unsigned int dofs_per_cell = dof.get_fe().n_dofs_per_cell(); std::vector local_dof_indices(dofs_per_cell); typename DoFHandler::level_cell_iterator begin = dof.begin(level); diff --git a/source/dofs/dof_tools.cc b/source/dofs/dof_tools.cc index 632236dcd1..0df1d77db1 100644 --- a/source/dofs/dof_tools.cc +++ b/source/dofs/dof_tools.cc @@ -128,13 +128,13 @@ namespace DoFTools const ComponentMask &component_mask) { std::vector local_component_association( - fe.dofs_per_cell, static_cast(-1)); + fe.n_dofs_per_cell(), static_cast(-1)); // compute the component each local dof belongs to. // if the shape function is primitive, then this // is simple and we can just associate it with // what system_to_component_index gives us - for (unsigned int i = 0; i < fe.dofs_per_cell; ++i) + for (unsigned int i = 0; i < fe.n_dofs_per_cell(); ++i) if (fe.is_primitive(i)) local_component_association[i] = fe.system_to_component_index(i).first; @@ -228,7 +228,7 @@ namespace DoFTools if (c->is_locally_owned()) { const unsigned int fe_index = c->active_fe_index(); - const unsigned int dofs_per_cell = c->get_fe().dofs_per_cell; + const unsigned int dofs_per_cell = c->get_fe().n_dofs_per_cell(); indices.resize(dofs_per_cell); c->get_dof_indices(indices); for (unsigned int i = 0; i < dofs_per_cell; ++i) @@ -270,9 +270,9 @@ namespace DoFTools for (unsigned int f = 0; f < fe_collection.size(); ++f) { const FiniteElement &fe = fe_collection[f]; - local_block_association[f].resize(fe.dofs_per_cell, + local_block_association[f].resize(fe.n_dofs_per_cell(), static_cast(-1)); - for (unsigned int i = 0; i < fe.dofs_per_cell; ++i) + for (unsigned int i = 0; i < fe.n_dofs_per_cell(); ++i) local_block_association[f][i] = fe.system_to_block_index(i).first; Assert(std::find(local_block_association[f].begin(), @@ -288,7 +288,7 @@ namespace DoFTools if (cell->is_locally_owned()) { const unsigned int fe_index = cell->active_fe_index(); - const unsigned int dofs_per_cell = cell->get_fe().dofs_per_cell; + const unsigned int dofs_per_cell = cell->get_fe().n_dofs_per_cell(); indices.resize(dofs_per_cell); cell->get_dof_indices(indices); for (unsigned int i = 0; i < dofs_per_cell; ++i) @@ -355,7 +355,7 @@ namespace DoFTools for (unsigned int present_cell = 0; cell != endc; ++cell, ++present_cell) { - const unsigned int dofs_per_cell = cell->get_fe().dofs_per_cell; + const unsigned int dofs_per_cell = cell->get_fe().n_dofs_per_cell(); dof_indices.resize(dofs_per_cell); cell->get_dof_indices(dof_indices); @@ -471,8 +471,9 @@ namespace DoFTools component_mask); // Check which dofs were selected - std::vector this_selected_dofs(fe_collection[f].dofs_per_cell); - for (unsigned int i = 0; i < fe_collection[f].dofs_per_cell; ++i) + std::vector this_selected_dofs( + fe_collection[f].n_dofs_per_cell()); + for (unsigned int i = 0; i < fe_collection[f].n_dofs_per_cell(); ++i) this_selected_dofs[i] = component_mask[local_component_association[i]]; @@ -486,7 +487,7 @@ namespace DoFTools if (c->is_locally_owned()) { const unsigned int fe_index = c->active_fe_index(); - const unsigned int dofs_per_cell = c->get_fe().dofs_per_cell; + const unsigned int dofs_per_cell = c->get_fe().n_dofs_per_cell(); local_dof_indices.resize(dofs_per_cell); c->get_dof_indices(local_dof_indices); for (unsigned int i = 0; i < dofs_per_cell; ++i) @@ -599,17 +600,17 @@ namespace DoFTools // whether it is something interesting or not std::vector local_component_asssociation = internal::get_local_component_association(fe, component_mask); - std::vector local_selected_dofs(fe.dofs_per_cell); - for (unsigned int i = 0; i < fe.dofs_per_cell; ++i) + std::vector local_selected_dofs(fe.n_dofs_per_cell()); + for (unsigned int i = 0; i < fe.n_dofs_per_cell(); ++i) local_selected_dofs[i] = component_mask[local_component_asssociation[i]]; // then loop over all cells and do work - std::vector indices(fe.dofs_per_cell); + std::vector indices(fe.n_dofs_per_cell()); typename DoFHandler::level_cell_iterator c; for (c = dof.begin(level); c != dof.end(level); ++c) { c->get_mg_dof_indices(indices); - for (unsigned int i = 0; i < fe.dofs_per_cell; ++i) + for (unsigned int i = 0; i < fe.n_dofs_per_cell(); ++i) selected_dofs[indices[i]] = local_selected_dofs[i]; } } @@ -730,15 +731,15 @@ namespace DoFTools (dim == 1 ? i : (dim == 2 ? - (i < 2 * fe.dofs_per_vertex ? + (i < 2 * fe.n_dofs_per_vertex() ? i : - i + 2 * fe.dofs_per_vertex) : - (dim == 3 ? (i < 4 * fe.dofs_per_vertex ? + i + 2 * fe.n_dofs_per_vertex()) : + (dim == 3 ? (i < 4 * fe.n_dofs_per_vertex() ? i : - (i < 4 * fe.dofs_per_vertex + + (i < 4 * fe.n_dofs_per_vertex() + 4 * fe.dofs_per_line ? - i + 4 * fe.dofs_per_vertex : - i + 4 * fe.dofs_per_vertex + + i + 4 * fe.n_dofs_per_vertex() : + i + 4 * fe.n_dofs_per_vertex() + 8 * fe.dofs_per_line)) : numbers::invalid_unsigned_int))); if (fe.is_primitive(cell_index)) @@ -811,11 +812,11 @@ namespace DoFTools { const FiniteElement &fe = cell->get_fe(); - const unsigned int dofs_per_cell = fe.dofs_per_cell; + const unsigned int dofs_per_cell = fe.n_dofs_per_cell(); cell_dof_indices.resize(dofs_per_cell); cell->get_dof_indices(cell_dof_indices); - for (unsigned int i = 0; i < fe.dofs_per_cell; ++i) + for (unsigned int i = 0; i < fe.n_dofs_per_cell(); ++i) if (fe.has_support_on_face(i, face)) { if (!check_vector_component) @@ -876,7 +877,7 @@ namespace DoFTools for (; cell != endc; ++cell) if (!cell->is_artificial() && predicate(cell)) { - local_dof_indices.resize(cell->get_fe().dofs_per_cell); + local_dof_indices.resize(cell->get_fe().n_dofs_per_cell()); cell->get_dof_indices(local_dof_indices); predicate_dofs.insert(local_dof_indices.begin(), local_dof_indices.end()); @@ -903,7 +904,7 @@ namespace DoFTools continue; } - const unsigned int dofs_per_cell = (*it)->get_fe().dofs_per_cell; + const unsigned int dofs_per_cell = (*it)->get_fe().n_dofs_per_cell(); local_dof_indices.resize(dofs_per_cell); (*it)->get_dof_indices(local_dof_indices); dofs_with_support_on_halo_cells.insert(local_dof_indices.begin(), @@ -991,7 +992,8 @@ namespace DoFTools spacedim>::line_iterator line = cell->face(face); - for (unsigned int dof = 0; dof != fe.dofs_per_vertex; ++dof) + for (unsigned int dof = 0; dof != fe.n_dofs_per_vertex(); + ++dof) selected_dofs.add_index( line->child(0)->vertex_dof_index(1, dof)); @@ -1047,7 +1049,7 @@ namespace DoFTools // and subtract (in the end) all the indices which a shared // between this face and its subfaces for (unsigned int vertex = 0; vertex < 4; ++vertex) - for (unsigned int dof = 0; dof != fe.dofs_per_vertex; + for (unsigned int dof = 0; dof != fe.n_dofs_per_vertex(); ++dof) unconstrained_dofs.add_index( face->vertex_dof_index(vertex, dof)); @@ -1111,7 +1113,7 @@ namespace DoFTools for (; cell != endc; ++cell) if (cell->subdomain_id() == subdomain_id) { - const unsigned int dofs_per_cell = cell->get_fe().dofs_per_cell; + const unsigned int dofs_per_cell = cell->get_fe().n_dofs_per_cell(); local_dof_indices.resize(dofs_per_cell); cell->get_dof_indices(local_dof_indices); for (unsigned int i = 0; i < dofs_per_cell; ++i) @@ -1141,7 +1143,7 @@ namespace DoFTools for (; cell != endc; ++cell) if (cell->is_locally_owned()) { - dof_indices.resize(cell->get_fe().dofs_per_cell); + dof_indices.resize(cell->get_fe().n_dofs_per_cell()); cell->get_dof_indices(dof_indices); for (const types::global_dof_index dof_index : dof_indices) @@ -1181,7 +1183,7 @@ namespace DoFTools for (; cell != endc; ++cell) if (cell->is_ghost()) { - dof_indices.resize(cell->get_fe().dofs_per_cell); + dof_indices.resize(cell->get_fe().n_dofs_per_cell()); cell->get_dof_indices(dof_indices); for (const auto dof_index : dof_indices) if (!dof_set.is_element(dof_index)) @@ -1232,7 +1234,7 @@ namespace DoFTools id == numbers::artificial_subdomain_id) continue; - dof_indices.resize(cell->get_fe().dofs_per_cell); + dof_indices.resize(cell->get_fe().n_dofs_per_cell()); cell->get_mg_dof_indices(dof_indices); for (const auto dof_index : dof_indices) if (!dof_set.is_element(dof_index)) @@ -1323,7 +1325,7 @@ namespace DoFTools for (const auto &cell : dof_handler.active_cell_iterators()) if (cell->is_locally_owned()) { - dof_indices.resize(cell->get_fe().dofs_per_cell); + dof_indices.resize(cell->get_fe().n_dofs_per_cell()); cell->get_dof_indices(dof_indices); for (unsigned int i = 0; i < dof_indices.size(); ++i) @@ -1513,7 +1515,7 @@ namespace DoFTools ExcMessage( "The subdomain ID of the halo cell should not match that of the vector entry.")); - local_dof_indices.resize(cell->get_fe().dofs_per_cell); + local_dof_indices.resize(cell->get_fe().n_dofs_per_cell()); cell->get_dof_indices(local_dof_indices); for (const types::global_dof_index local_dof_index : @@ -1600,7 +1602,7 @@ namespace DoFTools { const types::subdomain_id subdomain_id = cell_owners[cell->active_cell_index()]; - const unsigned int dofs_per_cell = cell->get_fe().dofs_per_cell; + const unsigned int dofs_per_cell = cell->get_fe().n_dofs_per_cell(); local_dof_indices.resize(dofs_per_cell); cell->get_dof_indices(local_dof_indices); @@ -1681,7 +1683,7 @@ namespace DoFTools if ((cell->is_artificial() == false) && (cell->subdomain_id() == subdomain)) { - const unsigned int dofs_per_cell = cell->get_fe().dofs_per_cell; + const unsigned int dofs_per_cell = cell->get_fe().n_dofs_per_cell(); local_dof_indices.resize(dofs_per_cell); cell->get_dof_indices(local_dof_indices); subdomain_indices.insert(subdomain_indices.end(), @@ -2223,12 +2225,13 @@ namespace DoFTools const FEValues &fe_values = hp_fe_values.get_present_fe_values(); - local_dof_indices.resize(cell->get_fe().dofs_per_cell); + local_dof_indices.resize(cell->get_fe().n_dofs_per_cell()); cell->get_dof_indices(local_dof_indices); const std::vector> &points = fe_values.get_quadrature_points(); - for (unsigned int i = 0; i < cell->get_fe().dofs_per_cell; ++i) + for (unsigned int i = 0; i < cell->get_fe().n_dofs_per_cell(); + ++i) { const unsigned int dof_comp = cell->get_fe().system_to_component_index(i).first; @@ -2478,12 +2481,12 @@ namespace DoFTools ++i; block_list.reinit(i, dof_handler.n_dofs(), - dof_handler.get_fe().dofs_per_cell); + dof_handler.get_fe().n_dofs_per_cell()); i = 0; for (cell = dof_handler.begin(level); cell != endc; ++cell) if (cell->is_locally_owned_on_level()) { - indices.resize(cell->get_fe().dofs_per_cell); + indices.resize(cell->get_fe().n_dofs_per_cell()); cell->get_mg_dof_indices(indices); if (selected_dofs.size() != 0) @@ -2522,13 +2525,13 @@ namespace DoFTools for (cell = dof_handler.begin(level); cell != endc; ++cell) { - indices.resize(cell->get_fe().dofs_per_cell); + indices.resize(cell->get_fe().n_dofs_per_cell()); cell->get_mg_dof_indices(indices); if (interior_only) { // Exclude degrees of freedom on faces opposite to the vertex - exclude.resize(fe.dofs_per_cell); + exclude.resize(fe.n_dofs_per_cell()); std::fill(exclude.begin(), exclude.end(), false); const unsigned int dpf = fe.dofs_per_face; @@ -2581,7 +2584,7 @@ namespace DoFTools // For hp, only this line here would have to be replaced. const FiniteElement &fe = dof_handler.get_fe(); - const unsigned int n_dofs = fe.dofs_per_cell; + const unsigned int n_dofs = fe.n_dofs_per_cell(); indices.resize(n_dofs); exclude.resize(n_dofs); std::fill(exclude.begin(), exclude.end(), false); @@ -2680,7 +2683,7 @@ namespace DoFTools for (const unsigned int v : GeometryInfo::vertex_indices()) { const unsigned int vg = cell->vertex_index(v); - vertex_dof_count[vg] += cell->get_fe().dofs_per_cell; + vertex_dof_count[vg] += cell->get_fe().n_dofs_per_cell(); ++vertex_cell_count[vg]; for (unsigned int d = 0; d < dim; ++d) { @@ -2728,7 +2731,7 @@ namespace DoFTools for (cell = dof_handler.begin(level); cell != endc; ++cell) { const FiniteElement &fe = cell->get_fe(); - indices.resize(fe.dofs_per_cell); + indices.resize(fe.n_dofs_per_cell()); cell->get_mg_dof_indices(indices); for (const unsigned int v : GeometryInfo::vertex_indices()) @@ -2745,7 +2748,7 @@ namespace DoFTools { // Exclude degrees of freedom on faces opposite to the // vertex - exclude.resize(fe.dofs_per_cell); + exclude.resize(fe.n_dofs_per_cell()); std::fill(exclude.begin(), exclude.end(), false); const unsigned int dpf = fe.dofs_per_face; @@ -2813,7 +2816,7 @@ namespace DoFTools Assert(cell->is_artificial() == false, ExcMessage("This function can not be called with cells that are " "not either locally owned or ghost cells.")); - local_dof_indices.resize(cell->get_fe().dofs_per_cell); + local_dof_indices.resize(cell->get_fe().n_dofs_per_cell()); cell->get_dof_indices(local_dof_indices); dofs_on_patch.insert(local_dof_indices.begin(), local_dof_indices.end()); @@ -2844,7 +2847,7 @@ namespace DoFTools Assert(cell->is_artificial() == false, ExcMessage("This function can not be called with cells that are " "not either locally owned or ghost cells.")); - local_dof_indices.resize(cell->get_fe().dofs_per_cell); + local_dof_indices.resize(cell->get_fe().n_dofs_per_cell()); cell->get_dof_indices(local_dof_indices); dofs_on_patch.insert(local_dof_indices.begin(), local_dof_indices.end()); diff --git a/source/dofs/dof_tools_constraints.cc b/source/dofs/dof_tools_constraints.cc index 26a4fc88db..f701ba8e6a 100644 --- a/source/dofs/dof_tools_constraints.cc +++ b/source/dofs/dof_tools_constraints.cc @@ -178,7 +178,8 @@ namespace DoFTools Assert(fe1.dofs_per_face >= fe2.dofs_per_face, ExcInternalError()); AssertDimension(primary_dof_mask.size(), fe1.dofs_per_face); - Assert(fe2.dofs_per_vertex <= fe1.dofs_per_vertex, ExcInternalError()); + Assert(fe2.n_dofs_per_vertex() <= fe1.n_dofs_per_vertex(), + ExcInternalError()); Assert(fe2.dofs_per_line <= fe1.dofs_per_line, ExcInternalError()); Assert((dim < 3) || (fe2.dofs_per_quad <= fe1.dofs_per_quad), ExcInternalError()); @@ -211,11 +212,11 @@ namespace DoFTools { unsigned int dofs_added = 0; unsigned int i = 0; - while (dofs_added < fe2.dofs_per_vertex) + while (dofs_added < fe2.n_dofs_per_vertex()) { // make sure that we were able to find a set of primary dofs and // that the code down below didn't just reject all our efforts - Assert(i < fe1.dofs_per_vertex, ExcInternalError()); + Assert(i < fe1.n_dofs_per_vertex(), ExcInternalError()); // tentatively push this vertex dof primary_dof_list.push_back(index + i); @@ -232,7 +233,7 @@ namespace DoFTools // forward counter by one ++i; } - index += fe1.dofs_per_vertex; + index += fe1.n_dofs_per_vertex(); } for (int l = 0; @@ -646,9 +647,10 @@ namespace DoFTools const unsigned int fe_index = cell->active_fe_index(); const unsigned int n_dofs_on_mother = - 2 * fe.dofs_per_vertex + fe.dofs_per_line, - n_dofs_on_children = - fe.dofs_per_vertex + 2 * fe.dofs_per_line; + 2 * fe.n_dofs_per_vertex() + + fe.dofs_per_line, + n_dofs_on_children = fe.n_dofs_per_vertex() + + 2 * fe.dofs_per_line; dofs_on_mother.resize(n_dofs_on_mother); // we might not use all of those in case of artificial cells, so @@ -670,7 +672,8 @@ namespace DoFTools // @p{FiniteElement::constraints()} unsigned int next_index = 0; for (unsigned int vertex = 0; vertex < 2; ++vertex) - for (unsigned int dof = 0; dof != fe.dofs_per_vertex; ++dof) + for (unsigned int dof = 0; dof != fe.n_dofs_per_vertex(); + ++dof) dofs_on_mother[next_index++] = this_face->vertex_dof_index(vertex, dof, fe_index); for (unsigned int dof = 0; dof != fe.dofs_per_line; ++dof) @@ -678,7 +681,7 @@ namespace DoFTools this_face->dof_index(dof, fe_index); AssertDimension(next_index, dofs_on_mother.size()); - for (unsigned int dof = 0; dof != fe.dofs_per_vertex; ++dof) + for (unsigned int dof = 0; dof != fe.n_dofs_per_vertex(); ++dof) dofs_on_children.push_back( this_face->child(0)->vertex_dof_index(1, dof, fe_index)); for (unsigned int child = 0; child < 2; ++child) @@ -829,7 +832,7 @@ namespace DoFTools const unsigned int n_dofs_on_mother = fe.dofs_per_face; const unsigned int n_dofs_on_children = - (5 * fe.dofs_per_vertex + 12 * fe.dofs_per_line + + (5 * fe.n_dofs_per_vertex() + 12 * fe.dofs_per_line + 4 * fe.dofs_per_quad); // TODO[TL]: think about this and the following in case of @@ -855,7 +858,8 @@ namespace DoFTools // @p{FiniteElement::constraints()} unsigned int next_index = 0; for (unsigned int vertex = 0; vertex < 4; ++vertex) - for (unsigned int dof = 0; dof != fe.dofs_per_vertex; ++dof) + for (unsigned int dof = 0; dof != fe.n_dofs_per_vertex(); + ++dof) dofs_on_mother[next_index++] = this_face->vertex_dof_index(vertex, dof, fe_index); for (unsigned int line = 0; line < 4; ++line) @@ -881,13 +885,14 @@ namespace DoFTools this_face->child(3)->vertex_index(0))), ExcInternalError()); - for (unsigned int dof = 0; dof != fe.dofs_per_vertex; ++dof) + for (unsigned int dof = 0; dof != fe.n_dofs_per_vertex(); ++dof) dofs_on_children.push_back( this_face->child(0)->vertex_dof_index(3, dof)); // dof numbers on the centers of the lines bounding this face for (unsigned int line = 0; line < 4; ++line) - for (unsigned int dof = 0; dof != fe.dofs_per_vertex; ++dof) + for (unsigned int dof = 0; dof != fe.n_dofs_per_vertex(); + ++dof) dofs_on_children.push_back( this_face->line(line)->child(0)->vertex_dof_index( 1, dof, fe_index)); @@ -2617,7 +2622,7 @@ namespace DoFTools // vector to hold the representation of a single degree of freedom on // the coarse grid (for the selected fe) on the fine grid - copy_data.dofs_per_cell = coarse_fe.dofs_per_cell; + copy_data.dofs_per_cell = coarse_fe.n_dofs_per_cell(); copy_data.parameter_dof_indices.resize(copy_data.dofs_per_cell); // get the global indices of the parameter dofs on this parameter grid @@ -2744,7 +2749,7 @@ namespace DoFTools unsigned int n_interesting_dofs = 0; for (unsigned int local_dof = 0; - local_dof < coarse_grid.get_fe().dofs_per_cell; + local_dof < coarse_grid.get_fe().n_dofs_per_cell(); ++local_dof) if (coarse_grid.get_fe().system_to_component_index(local_dof).first == coarse_component) @@ -2866,7 +2871,7 @@ namespace DoFTools n_fine_dofs = fine_grid.n_dofs(); // local numbers of dofs - const unsigned int fine_dofs_per_cell = fine_fe.dofs_per_cell; + const unsigned int fine_dofs_per_cell = fine_fe.n_dofs_per_cell(); // alias the number of dofs per cell belonging to the coarse_component // which is to be the restriction of the fine grid: @@ -2874,7 +2879,7 @@ namespace DoFTools coarse_fe .base_element( coarse_fe.component_to_base_index(coarse_component).first) - .dofs_per_cell; + .n_dofs_per_cell(); // Try to find out whether the grids stem from the same coarse grid. @@ -2939,7 +2944,7 @@ namespace DoFTools for (unsigned int local_coarse_dof = 0; local_coarse_dof < coarse_dofs_per_cell_component; ++local_coarse_dof) - for (unsigned int fine_dof = 0; fine_dof < fine_fe.dofs_per_cell; + for (unsigned int fine_dof = 0; fine_dof < fine_fe.n_dofs_per_cell(); ++fine_dof) if (fine_fe.system_to_component_index(fine_dof) == std::make_pair(fine_component, local_coarse_dof)) @@ -2957,13 +2962,13 @@ namespace DoFTools // this is an interesting dof. finally count how many true's there std::vector dof_is_interesting(fine_grid.n_dofs(), false); std::vector local_dof_indices( - fine_fe.dofs_per_cell); + fine_fe.n_dofs_per_cell()); for (const auto &cell : fine_grid.active_cell_iterators()) if (cell->is_locally_owned()) { cell->get_dof_indices(local_dof_indices); - for (unsigned int i = 0; i < fine_fe.dofs_per_cell; ++i) + for (unsigned int i = 0; i < fine_fe.n_dofs_per_cell(); ++i) if (fine_fe.system_to_component_index(i).first == fine_component) dof_is_interesting[local_dof_indices[i]] = true; @@ -2984,13 +2989,13 @@ namespace DoFTools { std::vector local_dof_indices( - fine_fe.dofs_per_cell); + fine_fe.n_dofs_per_cell()); unsigned int next_free_index = 0; for (const auto &cell : fine_grid.active_cell_iterators()) if (cell->is_locally_owned()) { cell->get_dof_indices(local_dof_indices); - for (unsigned int i = 0; i < fine_fe.dofs_per_cell; ++i) + for (unsigned int i = 0; i < fine_fe.n_dofs_per_cell(); ++i) // if this DoF is a parameter dof and has not yet been // numbered, then do so if ((fine_fe.system_to_component_index(i).first == @@ -3376,7 +3381,7 @@ namespace DoFTools const FiniteElement &fe = cell->get_fe(); // get global indices of dofs on the cell - cell_dofs.resize(fe.dofs_per_cell); + cell_dofs.resize(fe.n_dofs_per_cell()); cell->get_dof_indices(cell_dofs); for (const auto face_no : cell->face_indices()) diff --git a/source/dofs/dof_tools_sparsity.cc b/source/dofs/dof_tools_sparsity.cc index a7b3bdcbbc..5c3ab54412 100644 --- a/source/dofs/dof_tools_sparsity.cc +++ b/source/dofs/dof_tools_sparsity.cc @@ -102,7 +102,7 @@ namespace DoFTools (subdomain_id == cell->subdomain_id())) && cell->is_locally_owned()) { - const unsigned int dofs_per_cell = cell->get_fe().dofs_per_cell; + const unsigned int dofs_per_cell = cell->get_fe().n_dofs_per_cell(); dofs_on_this_cell.resize(dofs_per_cell); cell->get_dof_indices(dofs_on_this_cell); @@ -168,11 +168,11 @@ namespace DoFTools for (unsigned int f = 0; f < fe_collection.size(); ++f) { bool_dof_mask[f].reinit( - TableIndices<2>(fe_collection[f].dofs_per_cell, - fe_collection[f].dofs_per_cell)); + TableIndices<2>(fe_collection[f].n_dofs_per_cell(), + fe_collection[f].n_dofs_per_cell())); bool_dof_mask[f].fill(false); - for (unsigned int i = 0; i < fe_collection[f].dofs_per_cell; ++i) - for (unsigned int j = 0; j < fe_collection[f].dofs_per_cell; ++j) + for (unsigned int i = 0; i < fe_collection[f].n_dofs_per_cell(); ++i) + for (unsigned int j = 0; j < fe_collection[f].n_dofs_per_cell(); ++j) if (dof_mask[f](i, j) != none) bool_dof_mask[f](i, j) = true; } @@ -193,7 +193,7 @@ namespace DoFTools { const unsigned int fe_index = cell->active_fe_index(); const unsigned int dofs_per_cell = - fe_collection[fe_index].dofs_per_cell; + fe_collection[fe_index].n_dofs_per_cell(); dofs_on_this_cell.resize(dofs_per_cell); cell->get_dof_indices(dofs_on_this_cell); @@ -282,9 +282,9 @@ namespace DoFTools if (cell_row->is_active() && cell_col->is_active()) { const unsigned int dofs_per_cell_row = - cell_row->get_fe().dofs_per_cell; + cell_row->get_fe().n_dofs_per_cell(); const unsigned int dofs_per_cell_col = - cell_col->get_fe().dofs_per_cell; + cell_col->get_fe().n_dofs_per_cell(); std::vector local_dof_indices_row( dofs_per_cell_row); std::vector local_dof_indices_col( @@ -308,9 +308,9 @@ namespace DoFTools const typename DoFHandler::cell_iterator cell_row_child = child_cells[i]; const unsigned int dofs_per_cell_row = - cell_row_child->get_fe().dofs_per_cell; + cell_row_child->get_fe().n_dofs_per_cell(); const unsigned int dofs_per_cell_col = - cell_col->get_fe().dofs_per_cell; + cell_col->get_fe().n_dofs_per_cell(); std::vector local_dof_indices_row( dofs_per_cell_row); std::vector local_dof_indices_col( @@ -335,9 +335,9 @@ namespace DoFTools const typename DoFHandler::active_cell_iterator cell_col_child = child_cells[i]; const unsigned int dofs_per_cell_row = - cell_row->get_fe().dofs_per_cell; + cell_row->get_fe().n_dofs_per_cell(); const unsigned int dofs_per_cell_col = - cell_col_child->get_fe().dofs_per_cell; + cell_col_child->get_fe().n_dofs_per_cell(); std::vector local_dof_indices_row( dofs_per_cell_row); std::vector local_dof_indices_col( @@ -452,7 +452,8 @@ namespace DoFTools while (!cell->is_active()) cell = cell->child(direction); - const unsigned int dofs_per_vertex = cell->get_fe().dofs_per_vertex; + const unsigned int dofs_per_vertex = + cell->get_fe().n_dofs_per_vertex(); std::vector boundary_dof_boundary_indices( dofs_per_vertex); @@ -572,7 +573,8 @@ namespace DoFTools (subdomain_id == cell->subdomain_id())) && cell->is_locally_owned()) { - const unsigned int n_dofs_on_this_cell = cell->get_fe().dofs_per_cell; + const unsigned int n_dofs_on_this_cell = + cell->get_fe().n_dofs_per_cell(); dofs_on_this_cell.resize(n_dofs_on_this_cell); cell->get_dof_indices(dofs_on_this_cell); @@ -615,7 +617,7 @@ namespace DoFTools cell->neighbor_child_on_subface(face, sub_nr); const unsigned int n_dofs_on_neighbor = - sub_neighbor->get_fe().dofs_per_cell; + sub_neighbor->get_fe().n_dofs_per_cell(); dofs_on_other_cell.resize(n_dofs_on_neighbor); sub_neighbor->get_dof_indices(dofs_on_other_cell); @@ -652,7 +654,7 @@ namespace DoFTools continue; const unsigned int n_dofs_on_neighbor = - neighbor->get_fe().dofs_per_cell; + neighbor->get_fe().n_dofs_per_cell(); dofs_on_other_cell.resize(n_dofs_on_neighbor); neighbor->get_dof_indices(dofs_on_other_cell); @@ -712,7 +714,7 @@ namespace DoFTools ExcDimensionMismatch(component_couplings.n_cols(), fe.n_components())); - const unsigned int n_dofs = fe.dofs_per_cell; + const unsigned int n_dofs = fe.n_dofs_per_cell(); Table<2, Coupling> dof_couplings(n_dofs, n_dofs); @@ -784,9 +786,9 @@ namespace DoFTools const FiniteElement &fe = dof.get_fe(); std::vector dofs_on_this_cell( - fe.dofs_per_cell); + fe.n_dofs_per_cell()); std::vector dofs_on_other_cell( - fe.dofs_per_cell); + fe.n_dofs_per_cell()); const Table<2, Coupling> int_dof_mask = @@ -794,19 +796,19 @@ namespace DoFTools flux_dof_mask = dof_couplings_from_component_couplings(fe, flux_mask); - Table<2, bool> support_on_face(fe.dofs_per_cell, + Table<2, bool> support_on_face(fe.n_dofs_per_cell(), GeometryInfo::faces_per_cell); - for (unsigned int i = 0; i < fe.dofs_per_cell; ++i) + for (unsigned int i = 0; i < fe.n_dofs_per_cell(); ++i) for (const unsigned int f : GeometryInfo::face_indices()) support_on_face(i, f) = fe.has_support_on_face(i, f); // Convert the int_dof_mask to bool_int_dof_mask so we can pass it // to constraints.add_entries_local_to_global() - Table<2, bool> bool_int_dof_mask(fe.dofs_per_cell, - fe.dofs_per_cell); + Table<2, bool> bool_int_dof_mask(fe.n_dofs_per_cell(), + fe.n_dofs_per_cell()); bool_int_dof_mask.fill(false); - for (unsigned int i = 0; i < fe.dofs_per_cell; ++i) - for (unsigned int j = 0; j < fe.dofs_per_cell; ++j) + for (unsigned int i = 0; i < fe.n_dofs_per_cell(); ++i) + for (unsigned int j = 0; j < fe.n_dofs_per_cell(); ++j) if (int_dof_mask(i, j) != none) bool_int_dof_mask(i, j) = true; @@ -836,11 +838,12 @@ namespace DoFTools if (cell->at_boundary(face_n) && (!periodic_neighbor)) { - for (unsigned int i = 0; i < fe.dofs_per_cell; ++i) + for (unsigned int i = 0; i < fe.n_dofs_per_cell(); + ++i) { const bool i_non_zero_i = support_on_face(i, face_n); - for (unsigned int j = 0; j < fe.dofs_per_cell; + for (unsigned int j = 0; j < fe.n_dofs_per_cell(); ++j) { const bool j_non_zero_i = @@ -925,7 +928,8 @@ namespace DoFTools sub_neighbor->get_dof_indices( dofs_on_other_cell); - for (unsigned int i = 0; i < fe.dofs_per_cell; + for (unsigned int i = 0; + i < fe.n_dofs_per_cell(); ++i) { const bool i_non_zero_i = @@ -933,7 +937,7 @@ namespace DoFTools const bool i_non_zero_e = support_on_face(i, neighbor_face_n); for (unsigned int j = 0; - j < fe.dofs_per_cell; + j < fe.n_dofs_per_cell(); ++j) { const bool j_non_zero_i = @@ -1019,14 +1023,15 @@ namespace DoFTools else { neighbor->get_dof_indices(dofs_on_other_cell); - for (unsigned int i = 0; i < fe.dofs_per_cell; + for (unsigned int i = 0; i < fe.n_dofs_per_cell(); ++i) { const bool i_non_zero_i = support_on_face(i, face_n); const bool i_non_zero_e = support_on_face(i, neighbor_face_n); - for (unsigned int j = 0; j < fe.dofs_per_cell; + for (unsigned int j = 0; + j < fe.n_dofs_per_cell(); ++j) { const bool j_non_zero_i = @@ -1134,10 +1139,11 @@ namespace DoFTools for (unsigned int f = 0; f < fe.size(); ++f) { bool_int_and_flux_dof_mask[f].reinit( - TableIndices<2>(fe[f].dofs_per_cell, fe[f].dofs_per_cell)); + TableIndices<2>(fe[f].n_dofs_per_cell(), + fe[f].n_dofs_per_cell())); bool_int_and_flux_dof_mask[f].fill(false); - for (unsigned int i = 0; i < fe[f].dofs_per_cell; ++i) - for (unsigned int j = 0; j < fe[f].dofs_per_cell; ++j) + for (unsigned int i = 0; i < fe[f].n_dofs_per_cell(); ++i) + for (unsigned int j = 0; j < fe[f].n_dofs_per_cell(); ++j) if (int_and_flux_dof_mask[f](i, j) != none) bool_int_and_flux_dof_mask[f](i, j) = true; } @@ -1151,7 +1157,7 @@ namespace DoFTools (subdomain_id == cell->subdomain_id())) && cell->is_locally_owned()) { - dofs_on_this_cell.resize(cell->get_fe().dofs_per_cell); + dofs_on_this_cell.resize(cell->get_fe().n_dofs_per_cell()); cell->get_dof_indices(dofs_on_this_cell); // make sparsity pattern for this cell also taking into @@ -1239,11 +1245,11 @@ namespace DoFTools sub_nr); dofs_on_other_cell.resize( - sub_neighbor->get_fe().dofs_per_cell); + sub_neighbor->get_fe().n_dofs_per_cell()); sub_neighbor->get_dof_indices( dofs_on_other_cell); for (unsigned int i = 0; - i < cell->get_fe().dofs_per_cell; + i < cell->get_fe().n_dofs_per_cell(); ++i) { const unsigned int ii = @@ -1259,8 +1265,8 @@ namespace DoFTools ExcInternalError()); for (unsigned int j = 0; - j < - sub_neighbor->get_fe().dofs_per_cell; + j < sub_neighbor->get_fe() + .n_dofs_per_cell(); ++j) { const unsigned int jj = @@ -1299,10 +1305,10 @@ namespace DoFTools else { dofs_on_other_cell.resize( - neighbor->get_fe().dofs_per_cell); + neighbor->get_fe().n_dofs_per_cell()); neighbor->get_dof_indices(dofs_on_other_cell); for (unsigned int i = 0; - i < cell->get_fe().dofs_per_cell; + i < cell->get_fe().n_dofs_per_cell(); ++i) { const unsigned int ii = @@ -1318,7 +1324,7 @@ namespace DoFTools ExcInternalError()); for (unsigned int j = 0; - j < neighbor->get_fe().dofs_per_cell; + j < neighbor->get_fe().n_dofs_per_cell(); ++j) { const unsigned int jj = diff --git a/source/fe/fe.cc b/source/fe/fe.cc index a13d88cee0..87254982c9 100644 --- a/source/fe/fe.cc +++ b/source/fe/fe.cc @@ -65,7 +65,7 @@ FiniteElement::FiniteElement( dim == 3 ? 8 : 0) , adjust_line_dof_index_for_line_orientation_table( dim == 3 ? this->dofs_per_line : 0) - , system_to_base_table(this->dofs_per_cell) + , system_to_base_table(this->n_dofs_per_cell()) , face_system_to_base_table(this->dofs_per_face) , component_to_base_table(this->components, std::make_pair(std::make_pair(0U, 0U), 0U)) @@ -74,11 +74,12 @@ FiniteElement::FiniteElement( // Special handling of vectors of length one: in this case, we // assume that all entries were supposed to be equal restriction_is_additive_flags( - r_i_a_f.size() == 1 ? std::vector(fe_data.dofs_per_cell, r_i_a_f[0]) : - r_i_a_f) + r_i_a_f.size() == 1 ? + std::vector(fe_data.n_dofs_per_cell(), r_i_a_f[0]) : + r_i_a_f) , nonzero_components( nonzero_c.size() == 1 ? - std::vector(fe_data.dofs_per_cell, nonzero_c[0]) : + std::vector(fe_data.n_dofs_per_cell(), nonzero_c[0]) : nonzero_c) , n_nonzero_components_table(compute_n_nonzero_components(nonzero_components)) , cached_primitivity(std::find_if(n_nonzero_components_table.begin(), @@ -87,10 +88,10 @@ FiniteElement::FiniteElement( return n_components != 1U; }) == n_nonzero_components_table.end()) { - Assert(restriction_is_additive_flags.size() == this->dofs_per_cell, + Assert(restriction_is_additive_flags.size() == this->n_dofs_per_cell(), ExcDimensionMismatch(restriction_is_additive_flags.size(), - this->dofs_per_cell)); - AssertDimension(nonzero_components.size(), this->dofs_per_cell); + this->n_dofs_per_cell())); + AssertDimension(nonzero_components.size(), this->n_dofs_per_cell()); for (unsigned int i = 0; i < nonzero_components.size(); ++i) { Assert(nonzero_components[i].size() == this->n_components(), @@ -107,15 +108,15 @@ FiniteElement::FiniteElement( // empty. if (this->is_primitive()) { - system_to_component_table.resize(this->dofs_per_cell); + system_to_component_table.resize(this->n_dofs_per_cell()); face_system_to_component_table.resize(this->dofs_per_face); - for (unsigned int j = 0; j < this->dofs_per_cell; ++j) + for (unsigned int j = 0; j < this->n_dofs_per_cell(); ++j) system_to_component_table[j] = std::pair(0, j); for (unsigned int j = 0; j < this->dofs_per_face; ++j) face_system_to_component_table[j] = std::pair(0, j); } - for (unsigned int j = 0; j < this->dofs_per_cell; ++j) + for (unsigned int j = 0; j < this->n_dofs_per_cell(); ++j) system_to_base_table[j] = std::make_pair(std::make_pair(0U, 0U), j); for (unsigned int j = 0; j < this->dofs_per_face; ++j) face_system_to_base_table[j] = std::make_pair(std::make_pair(0U, 0U), j); @@ -285,16 +286,18 @@ FiniteElement::reinit_restriction_and_prolongation_matrices( for (unsigned int i = 0; i < nc; ++i) { - if (this->restriction[ref_case - 1][i].m() != this->dofs_per_cell && + if (this->restriction[ref_case - 1][i].m() != + this->n_dofs_per_cell() && (!isotropic_restriction_only || ref_case == RefinementCase::isotropic_refinement)) - this->restriction[ref_case - 1][i].reinit(this->dofs_per_cell, - this->dofs_per_cell); - if (this->prolongation[ref_case - 1][i].m() != this->dofs_per_cell && + this->restriction[ref_case - 1][i].reinit(this->n_dofs_per_cell(), + this->n_dofs_per_cell()); + if (this->prolongation[ref_case - 1][i].m() != + this->n_dofs_per_cell() && (!isotropic_prolongation_only || ref_case == RefinementCase::isotropic_refinement)) - this->prolongation[ref_case - 1][i].reinit(this->dofs_per_cell, - this->dofs_per_cell); + this->prolongation[ref_case - 1][i].reinit(this->n_dofs_per_cell(), + this->n_dofs_per_cell()); } } } @@ -316,7 +319,7 @@ FiniteElement::get_restriction_matrix( // we use refinement_case-1 here. the -1 takes care of the origin of the // vector, as for RefinementCase::no_refinement (=0) there is no data // available and so the vector indices are shifted - Assert(restriction[refinement_case - 1][child].n() == this->dofs_per_cell, + Assert(restriction[refinement_case - 1][child].n() == this->n_dofs_per_cell(), ExcProjectionVoid()); return restriction[refinement_case - 1][child]; } @@ -341,7 +344,8 @@ FiniteElement::get_prolongation_matrix( // RefinementCase::no_refinement (=0) there is no // data available and so the vector indices // are shifted - Assert(prolongation[refinement_case - 1][child].n() == this->dofs_per_cell, + Assert(prolongation[refinement_case - 1][child].n() == + this->n_dofs_per_cell(), ExcEmbeddingVoid()); return prolongation[refinement_case - 1][child]; } @@ -572,15 +576,15 @@ FiniteElement::face_to_cell_index(const unsigned int face_index, { // get the number of the vertex on the face that corresponds to this DoF, // along with the number of the DoF on this vertex - const unsigned int face_vertex = face_index / this->dofs_per_vertex; + const unsigned int face_vertex = face_index / this->n_dofs_per_vertex(); const unsigned int dof_index_on_vertex = - face_index % this->dofs_per_vertex; + face_index % this->n_dofs_per_vertex(); // then get the number of this vertex on the cell and translate // this to a DoF number on the cell return (GeometryInfo::face_to_cell_vertices( face, face_vertex, face_orientation, face_flip, face_rotation) * - this->dofs_per_vertex + + this->n_dofs_per_vertex() + dof_index_on_vertex); } else if (face_index < this->first_face_quad_index) @@ -686,10 +690,10 @@ FiniteElement::prolongation_is_implemented() const { // make sure also the lazily initialized matrices are created get_prolongation_matrix(c, RefinementCase(ref_case)); - Assert((prolongation[ref_case - 1][c].m() == this->dofs_per_cell) || + Assert((prolongation[ref_case - 1][c].m() == this->n_dofs_per_cell()) || (prolongation[ref_case - 1][c].m() == 0), ExcInternalError()); - Assert((prolongation[ref_case - 1][c].n() == this->dofs_per_cell) || + Assert((prolongation[ref_case - 1][c].n() == this->n_dofs_per_cell()) || (prolongation[ref_case - 1][c].n() == 0), ExcInternalError()); if ((prolongation[ref_case - 1][c].m() == 0) || @@ -714,10 +718,10 @@ FiniteElement::restriction_is_implemented() const { // make sure also the lazily initialized matrices are created get_restriction_matrix(c, RefinementCase(ref_case)); - Assert((restriction[ref_case - 1][c].m() == this->dofs_per_cell) || + Assert((restriction[ref_case - 1][c].m() == this->n_dofs_per_cell()) || (restriction[ref_case - 1][c].m() == 0), ExcInternalError()); - Assert((restriction[ref_case - 1][c].n() == this->dofs_per_cell) || + Assert((restriction[ref_case - 1][c].n() == this->n_dofs_per_cell()) || (restriction[ref_case - 1][c].n() == 0), ExcInternalError()); if ((restriction[ref_case - 1][c].m() == 0) || @@ -742,10 +746,10 @@ FiniteElement::isotropic_prolongation_is_implemented() const { // make sure also the lazily initialized matrices are created get_prolongation_matrix(c, RefinementCase(ref_case)); - Assert((prolongation[ref_case - 1][c].m() == this->dofs_per_cell) || + Assert((prolongation[ref_case - 1][c].m() == this->n_dofs_per_cell()) || (prolongation[ref_case - 1][c].m() == 0), ExcInternalError()); - Assert((prolongation[ref_case - 1][c].n() == this->dofs_per_cell) || + Assert((prolongation[ref_case - 1][c].n() == this->n_dofs_per_cell()) || (prolongation[ref_case - 1][c].n() == 0), ExcInternalError()); if ((prolongation[ref_case - 1][c].m() == 0) || @@ -770,10 +774,10 @@ FiniteElement::isotropic_restriction_is_implemented() const { // make sure also the lazily initialized matrices are created get_restriction_matrix(c, RefinementCase(ref_case)); - Assert((restriction[ref_case - 1][c].m() == this->dofs_per_cell) || + Assert((restriction[ref_case - 1][c].m() == this->n_dofs_per_cell()) || (restriction[ref_case - 1][c].m() == 0), ExcInternalError()); - Assert((restriction[ref_case - 1][c].n() == this->dofs_per_cell) || + Assert((restriction[ref_case - 1][c].n() == this->n_dofs_per_cell()) || (restriction[ref_case - 1][c].n() == 0), ExcInternalError()); if ((restriction[ref_case - 1][c].m() == 0) || @@ -843,10 +847,10 @@ FiniteElement::interface_constraints_size() const case 1: return {0U, 0U}; case 2: - return {this->dofs_per_vertex + 2 * this->dofs_per_line, + return {this->n_dofs_per_vertex() + 2 * this->dofs_per_line, this->dofs_per_face}; case 3: - return {5 * this->dofs_per_vertex + 12 * this->dofs_per_line + + return {5 * this->n_dofs_per_vertex() + 12 * this->dofs_per_line + 4 * this->dofs_per_quad, this->dofs_per_face}; default: @@ -985,7 +989,7 @@ FiniteElement::get_unit_support_points() const // there are as many as there are // degrees of freedom Assert((unit_support_points.size() == 0) || - (unit_support_points.size() == this->dofs_per_cell), + (unit_support_points.size() == this->n_dofs_per_cell()), ExcInternalError()); return unit_support_points; } @@ -1027,8 +1031,8 @@ template Point FiniteElement::unit_support_point(const unsigned int index) const { - AssertIndexRange(index, this->dofs_per_cell); - Assert(unit_support_points.size() == this->dofs_per_cell, + AssertIndexRange(index, this->n_dofs_per_cell()); + Assert(unit_support_points.size() == this->n_dofs_per_cell(), ExcFEHasNoSupportPoints()); return unit_support_points[index]; } @@ -1141,7 +1145,7 @@ FiniteElement::get_constant_modes() const { Assert(false, ExcNotImplemented()); return std::pair, std::vector>( - Table<2, bool>(this->n_components(), this->dofs_per_cell), + Table<2, bool>(this->n_components(), this->n_dofs_per_cell()), std::vector(this->n_components())); } diff --git a/source/fe/fe_abf.cc b/source/fe/fe_abf.cc index 85eb12392b..455b4ebf6e 100644 --- a/source/fe/fe_abf.cc +++ b/source/fe/fe_abf.cc @@ -58,7 +58,7 @@ FE_ABF::FE_ABF(const unsigned int deg) , rt_order(deg) { Assert(dim >= 2, ExcImpossibleInDim(dim)); - const unsigned int n_dofs = this->dofs_per_cell; + const unsigned int n_dofs = this->n_dofs_per_cell(); this->mapping_kind = {mapping_raviart_thomas}; // First, initialize the @@ -343,9 +343,10 @@ FE_ABF::initialize_restriction() // Store shape values, since the // evaluation suffers if not // ordered by point - Table<2, double> cached_values_face(this->dofs_per_cell, q_face.size()); + Table<2, double> cached_values_face(this->n_dofs_per_cell(), + q_face.size()); for (unsigned int k = 0; k < q_face.size(); ++k) - for (unsigned int i = 0; i < this->dofs_per_cell; ++i) + for (unsigned int i = 0; i < this->n_dofs_per_cell(); ++i) cached_values_face(i, k) = this->shape_value_component( i, q_face.point(k), GeometryInfo::unit_normal_direction[face]); @@ -374,7 +375,7 @@ FE_ABF::initialize_restriction() // corresponding shape // functions. for (unsigned int k = 0; k < n_face_points; ++k) - for (unsigned int i_child = 0; i_child < this->dofs_per_cell; + for (unsigned int i_child = 0; i_child < this->n_dofs_per_cell(); ++i_child) for (unsigned int i_face = 0; i_face < this->dofs_per_face; ++i_face) @@ -421,9 +422,11 @@ FE_ABF::initialize_restriction() // Store shape values, since the // evaluation suffers if not // ordered by point - Table<3, double> cached_values_cell(this->dofs_per_cell, q_cell.size(), dim); + Table<3, double> cached_values_cell(this->n_dofs_per_cell(), + q_cell.size(), + dim); for (unsigned int k = 0; k < q_cell.size(); ++k) - for (unsigned int i = 0; i < this->dofs_per_cell; ++i) + for (unsigned int i = 0; i < this->n_dofs_per_cell(); ++i) for (unsigned int d = 0; d < dim; ++d) cached_values_cell(i, k, d) = this->shape_value_component(i, q_cell.point(k), d); @@ -434,7 +437,8 @@ FE_ABF::initialize_restriction() Quadrature q_sub = QProjector::project_to_child(q_cell, child); for (unsigned int k = 0; k < q_sub.size(); ++k) - for (unsigned int i_child = 0; i_child < this->dofs_per_cell; ++i_child) + for (unsigned int i_child = 0; i_child < this->n_dofs_per_cell(); + ++i_child) for (unsigned int d = 0; d < dim; ++d) for (unsigned int i_weight = 0; i_weight < polynomials[d]->n(); ++i_weight) @@ -491,7 +495,7 @@ bool FE_ABF::has_support_on_face(const unsigned int shape_index, const unsigned int face_index) const { - AssertIndexRange(shape_index, this->dofs_per_cell); + AssertIndexRange(shape_index, this->n_dofs_per_cell()); AssertIndexRange(face_index, GeometryInfo::faces_per_cell); // Return computed values if we @@ -540,8 +544,8 @@ FE_ABF::convert_generalized_support_point_values_to_dof_values( Assert(support_point_values[0].size() == this->n_components(), ExcDimensionMismatch(support_point_values[0].size(), this->n_components())); - Assert(nodal_values.size() == this->dofs_per_cell, - ExcDimensionMismatch(nodal_values.size(), this->dofs_per_cell)); + Assert(nodal_values.size() == this->n_dofs_per_cell(), + ExcDimensionMismatch(nodal_values.size(), this->n_dofs_per_cell())); std::fill(nodal_values.begin(), nodal_values.end(), 0.); diff --git a/source/fe/fe_bdm.cc b/source/fe/fe_bdm.cc index ba126082e5..baa4a17306 100644 --- a/source/fe/fe_bdm.cc +++ b/source/fe/fe_bdm.cc @@ -54,7 +54,7 @@ FE_BDM::FE_BDM(const unsigned int deg) ExcMessage( "Lowest order BDM element are degree 1, but you asked for degree 0")); - const unsigned int n_dofs = this->dofs_per_cell; + const unsigned int n_dofs = this->n_dofs_per_cell(); this->mapping_kind = {mapping_bdm}; // These must be done first, since @@ -139,8 +139,8 @@ FE_BDM::convert_generalized_support_point_values_to_dof_values( ExcDimensionMismatch(support_point_values.size(), this->generalized_support_points.size())); AssertDimension(support_point_values[0].size(), dim); - Assert(nodal_values.size() == this->dofs_per_cell, - ExcDimensionMismatch(nodal_values.size(), this->dofs_per_cell)); + Assert(nodal_values.size() == this->n_dofs_per_cell(), + ExcDimensionMismatch(nodal_values.size(), this->n_dofs_per_cell())); // First do interpolation on faces. There, the component evaluated // depends on the face direction and orientation. @@ -185,14 +185,14 @@ FE_BDM::convert_generalized_support_point_values_to_dof_values( test_values_cell.size()); // Done for BDM1 - if (dbase == this->dofs_per_cell) + if (dbase == this->n_dofs_per_cell()) return; // What's missing are the interior // degrees of freedom. In each // point, we take all components of // the solution. - Assert((this->dofs_per_cell - dbase) % dim == 0, ExcInternalError()); + Assert((this->n_dofs_per_cell() - dbase) % dim == 0, ExcInternalError()); for (unsigned int d = 0; d < dim; ++d, dbase += test_values_cell[0].size()) { @@ -205,7 +205,7 @@ FE_BDM::convert_generalized_support_point_values_to_dof_values( } } - Assert(dbase == this->dofs_per_cell, ExcInternalError()); + Assert(dbase == this->n_dofs_per_cell(), ExcInternalError()); } diff --git a/source/fe/fe_bernardi_raugel.cc b/source/fe/fe_bernardi_raugel.cc index f51963d69f..147db9986c 100644 --- a/source/fe/fe_bernardi_raugel.cc +++ b/source/fe/fe_bernardi_raugel.cc @@ -52,7 +52,7 @@ FE_BernardiRaugel::FE_BernardiRaugel(const unsigned int p) Assert(dim == 2 || dim == 3, ExcImpossibleInDim(dim)); Assert(p == 1, ExcMessage("Only BR1 elements are available")); - // const unsigned int n_dofs = this->dofs_per_cell; + // const unsigned int n_dofs = this->n_dofs_per_cell(); this->mapping_kind = {mapping_none}; // These must be done first, since @@ -97,8 +97,8 @@ FE_BernardiRaugel::convert_generalized_support_point_values_to_dof_values( ExcDimensionMismatch(support_point_values.size(), this->generalized_support_points.size())); AssertDimension(support_point_values[0].size(), dim); - Assert(nodal_values.size() == this->dofs_per_cell, - ExcDimensionMismatch(nodal_values.size(), this->dofs_per_cell)); + Assert(nodal_values.size() == this->n_dofs_per_cell(), + ExcDimensionMismatch(nodal_values.size(), this->n_dofs_per_cell())); std::vector> normals; for (unsigned int i : GeometryInfo::face_indices()) @@ -150,7 +150,7 @@ FE_BernardiRaugel::initialize_support_points() { // The support points for our shape functions are the vertices and // the face midpoints, for a total of #vertices + #faces points - this->generalized_support_points.resize(this->dofs_per_cell); + this->generalized_support_points.resize(this->n_dofs_per_cell()); // We need dim copies of each vertex for the first dim*vertices_per_cell // generalized support points diff --git a/source/fe/fe_dgp.cc b/source/fe/fe_dgp.cc index 49725dc3a6..7505623561 100644 --- a/source/fe/fe_dgp.cc +++ b/source/fe/fe_dgp.cc @@ -34,10 +34,12 @@ FE_DGP::FE_DGP(const unsigned int degree) degree, FiniteElementData::L2), std::vector( - FiniteElementData(get_dpo_vector(degree), 1, degree).dofs_per_cell, + FiniteElementData(get_dpo_vector(degree), 1, degree) + .n_dofs_per_cell(), true), std::vector( - FiniteElementData(get_dpo_vector(degree), 1, degree).dofs_per_cell, + FiniteElementData(get_dpo_vector(degree), 1, degree) + .n_dofs_per_cell(), std::vector(1, true))) { // Reinit the vectors of restriction and prolongation matrices to the right @@ -272,7 +274,7 @@ template std::pair, std::vector> FE_DGP::get_constant_modes() const { - Table<2, bool> constant_modes(1, this->dofs_per_cell); + Table<2, bool> constant_modes(1, this->n_dofs_per_cell()); constant_modes(0, 0) = true; return std::pair, std::vector>( constant_modes, std::vector(1, 0)); diff --git a/source/fe/fe_dgp_monomial.cc b/source/fe/fe_dgp_monomial.cc index e123dbc0be..80780dfdc7 100644 --- a/source/fe/fe_dgp_monomial.cc +++ b/source/fe/fe_dgp_monomial.cc @@ -130,20 +130,21 @@ namespace internal template FE_DGPMonomial::FE_DGPMonomial(const unsigned int degree) - : FE_Poly( - PolynomialsP(degree), - FiniteElementData(get_dpo_vector(degree), - 1, - degree, - FiniteElementData::L2), - std::vector( - FiniteElementData(get_dpo_vector(degree), 1, degree).dofs_per_cell, - true), - std::vector( - FiniteElementData(get_dpo_vector(degree), 1, degree).dofs_per_cell, - std::vector(1, true))) + : FE_Poly(PolynomialsP(degree), + FiniteElementData(get_dpo_vector(degree), + 1, + degree, + FiniteElementData::L2), + std::vector( + FiniteElementData(get_dpo_vector(degree), 1, degree) + .n_dofs_per_cell(), + true), + std::vector( + FiniteElementData(get_dpo_vector(degree), 1, degree) + .n_dofs_per_cell(), + std::vector(1, true))) { - Assert(this->poly_space->n() == this->dofs_per_cell, ExcInternalError()); + Assert(this->poly_space->n() == this->n_dofs_per_cell(), ExcInternalError()); Assert(this->poly_space->degree() == this->degree, ExcInternalError()); // DG doesn't have constraints, so @@ -208,10 +209,10 @@ FE_DGPMonomial::get_interpolation_matrix( const unsigned int n = interpolation_matrix.n(); (void)m; (void)n; - Assert(m == this->dofs_per_cell, - ExcDimensionMismatch(m, this->dofs_per_cell)); - Assert(n == source_dgp_monomial->dofs_per_cell, - ExcDimensionMismatch(n, source_dgp_monomial->dofs_per_cell)); + Assert(m == this->n_dofs_per_cell(), + ExcDimensionMismatch(m, this->n_dofs_per_cell())); + Assert(n == source_dgp_monomial->n_dofs_per_cell(), + ExcDimensionMismatch(n, source_dgp_monomial->n_dofs_per_cell())); const unsigned int min_mn = interpolation_matrix.m() < interpolation_matrix.n() ? @@ -223,17 +224,18 @@ FE_DGPMonomial::get_interpolation_matrix( } else { - std::vector> unit_points(this->dofs_per_cell); + std::vector> unit_points(this->n_dofs_per_cell()); internal::FE_DGPMonomial::generate_unit_points(this->degree, unit_points); FullMatrix source_fe_matrix(unit_points.size(), - source_fe.dofs_per_cell); - for (unsigned int j = 0; j < source_fe.dofs_per_cell; ++j) + source_fe.n_dofs_per_cell()); + for (unsigned int j = 0; j < source_fe.n_dofs_per_cell(); ++j) for (unsigned int k = 0; k < unit_points.size(); ++k) source_fe_matrix(k, j) = source_fe.shape_value(j, unit_points[k]); - FullMatrix this_matrix(this->dofs_per_cell, this->dofs_per_cell); - for (unsigned int j = 0; j < this->dofs_per_cell; ++j) + FullMatrix this_matrix(this->n_dofs_per_cell(), + this->n_dofs_per_cell()); + for (unsigned int j = 0; j < this->n_dofs_per_cell(); ++j) for (unsigned int k = 0; k < unit_points.size(); ++k) this_matrix(k, j) = this->poly_space->compute_value(j, unit_points[k]); diff --git a/source/fe/fe_dgp_nonparametric.cc b/source/fe/fe_dgp_nonparametric.cc index 341a81bf94..bf0b920513 100644 --- a/source/fe/fe_dgp_nonparametric.cc +++ b/source/fe/fe_dgp_nonparametric.cc @@ -42,14 +42,16 @@ FE_DGPNonparametric::FE_DGPNonparametric( degree, FiniteElementData::L2), std::vector( - FiniteElementData(get_dpo_vector(degree), 1, degree).dofs_per_cell, + FiniteElementData(get_dpo_vector(degree), 1, degree) + .n_dofs_per_cell(), true), std::vector( - FiniteElementData(get_dpo_vector(degree), 1, degree).dofs_per_cell, + FiniteElementData(get_dpo_vector(degree), 1, degree) + .n_dofs_per_cell(), std::vector(1, true))) , polynomial_space(Polynomials::Legendre::generate_complete_basis(degree)) { - const unsigned int n_dofs = this->dofs_per_cell; + const unsigned int n_dofs = this->n_dofs_per_cell(); for (unsigned int ref_case = RefinementCase::cut_x; ref_case < RefinementCase::isotropic_refinement + 1; ++ref_case) @@ -139,7 +141,7 @@ FE_DGPNonparametric::shape_value(const unsigned int i, { (void)i; (void)p; - AssertIndexRange(i, this->dofs_per_cell); + AssertIndexRange(i, this->n_dofs_per_cell()); AssertThrow(false, (typename FiniteElement::ExcUnitShapeValuesDoNotExist())); return 0; @@ -157,7 +159,7 @@ FE_DGPNonparametric::shape_value_component( (void)i; (void)p; (void)component; - AssertIndexRange(i, this->dofs_per_cell); + AssertIndexRange(i, this->n_dofs_per_cell()); AssertIndexRange(component, 1); AssertThrow(false, (typename FiniteElement::ExcUnitShapeValuesDoNotExist())); @@ -173,7 +175,7 @@ FE_DGPNonparametric::shape_grad(const unsigned int i, { (void)i; (void)p; - AssertIndexRange(i, this->dofs_per_cell); + AssertIndexRange(i, this->n_dofs_per_cell()); AssertThrow(false, (typename FiniteElement::ExcUnitShapeValuesDoNotExist())); return Tensor<1, dim>(); @@ -190,7 +192,7 @@ FE_DGPNonparametric::shape_grad_component( (void)i; (void)p; (void)component; - AssertIndexRange(i, this->dofs_per_cell); + AssertIndexRange(i, this->n_dofs_per_cell()); AssertIndexRange(component, 1); AssertThrow(false, (typename FiniteElement::ExcUnitShapeValuesDoNotExist())); @@ -206,7 +208,7 @@ FE_DGPNonparametric::shape_grad_grad(const unsigned int i, { (void)i; (void)p; - AssertIndexRange(i, this->dofs_per_cell); + AssertIndexRange(i, this->n_dofs_per_cell()); AssertThrow(false, (typename FiniteElement::ExcUnitShapeValuesDoNotExist())); return Tensor<2, dim>(); @@ -224,7 +226,7 @@ FE_DGPNonparametric::shape_grad_grad_component( (void)i; (void)p; (void)component; - AssertIndexRange(i, this->dofs_per_cell); + AssertIndexRange(i, this->n_dofs_per_cell()); AssertIndexRange(component, 1); AssertThrow(false, (typename FiniteElement::ExcUnitShapeValuesDoNotExist())); @@ -321,11 +323,11 @@ FE_DGPNonparametric::fill_fe_values( const unsigned int n_q_points = mapping_data.quadrature_points.size(); std::vector values( - (fe_internal.update_each & update_values) ? this->dofs_per_cell : 0); + (fe_internal.update_each & update_values) ? this->n_dofs_per_cell() : 0); std::vector> grads( - (fe_internal.update_each & update_gradients) ? this->dofs_per_cell : 0); + (fe_internal.update_each & update_gradients) ? this->n_dofs_per_cell() : 0); std::vector> grad_grads( - (fe_internal.update_each & update_hessians) ? this->dofs_per_cell : 0); + (fe_internal.update_each & update_hessians) ? this->n_dofs_per_cell() : 0); std::vector> empty_vector_of_3rd_order_tensors; std::vector> empty_vector_of_4th_order_tensors; @@ -340,15 +342,15 @@ FE_DGPNonparametric::fill_fe_values( empty_vector_of_4th_order_tensors); if (fe_internal.update_each & update_values) - for (unsigned int k = 0; k < this->dofs_per_cell; ++k) + for (unsigned int k = 0; k < this->n_dofs_per_cell(); ++k) output_data.shape_values[k][i] = values[k]; if (fe_internal.update_each & update_gradients) - for (unsigned int k = 0; k < this->dofs_per_cell; ++k) + for (unsigned int k = 0; k < this->n_dofs_per_cell(); ++k) output_data.shape_gradients[k][i] = grads[k]; if (fe_internal.update_each & update_hessians) - for (unsigned int k = 0; k < this->dofs_per_cell; ++k) + for (unsigned int k = 0; k < this->n_dofs_per_cell(); ++k) output_data.shape_hessians[k][i] = grad_grads[k]; } } @@ -377,11 +379,11 @@ FE_DGPNonparametric::fill_fe_face_values( const unsigned int n_q_points = mapping_data.quadrature_points.size(); std::vector values( - (fe_internal.update_each & update_values) ? this->dofs_per_cell : 0); + (fe_internal.update_each & update_values) ? this->n_dofs_per_cell() : 0); std::vector> grads( - (fe_internal.update_each & update_gradients) ? this->dofs_per_cell : 0); + (fe_internal.update_each & update_gradients) ? this->n_dofs_per_cell() : 0); std::vector> grad_grads( - (fe_internal.update_each & update_hessians) ? this->dofs_per_cell : 0); + (fe_internal.update_each & update_hessians) ? this->n_dofs_per_cell() : 0); std::vector> empty_vector_of_3rd_order_tensors; std::vector> empty_vector_of_4th_order_tensors; @@ -396,15 +398,15 @@ FE_DGPNonparametric::fill_fe_face_values( empty_vector_of_4th_order_tensors); if (fe_internal.update_each & update_values) - for (unsigned int k = 0; k < this->dofs_per_cell; ++k) + for (unsigned int k = 0; k < this->n_dofs_per_cell(); ++k) output_data.shape_values[k][i] = values[k]; if (fe_internal.update_each & update_gradients) - for (unsigned int k = 0; k < this->dofs_per_cell; ++k) + for (unsigned int k = 0; k < this->n_dofs_per_cell(); ++k) output_data.shape_gradients[k][i] = grads[k]; if (fe_internal.update_each & update_hessians) - for (unsigned int k = 0; k < this->dofs_per_cell; ++k) + for (unsigned int k = 0; k < this->n_dofs_per_cell(); ++k) output_data.shape_hessians[k][i] = grad_grads[k]; } } @@ -434,11 +436,11 @@ FE_DGPNonparametric::fill_fe_subface_values( const unsigned int n_q_points = mapping_data.quadrature_points.size(); std::vector values( - (fe_internal.update_each & update_values) ? this->dofs_per_cell : 0); + (fe_internal.update_each & update_values) ? this->n_dofs_per_cell() : 0); std::vector> grads( - (fe_internal.update_each & update_gradients) ? this->dofs_per_cell : 0); + (fe_internal.update_each & update_gradients) ? this->n_dofs_per_cell() : 0); std::vector> grad_grads( - (fe_internal.update_each & update_hessians) ? this->dofs_per_cell : 0); + (fe_internal.update_each & update_hessians) ? this->n_dofs_per_cell() : 0); std::vector> empty_vector_of_3rd_order_tensors; std::vector> empty_vector_of_4th_order_tensors; @@ -453,15 +455,15 @@ FE_DGPNonparametric::fill_fe_subface_values( empty_vector_of_4th_order_tensors); if (fe_internal.update_each & update_values) - for (unsigned int k = 0; k < this->dofs_per_cell; ++k) + for (unsigned int k = 0; k < this->n_dofs_per_cell(); ++k) output_data.shape_values[k][i] = values[k]; if (fe_internal.update_each & update_gradients) - for (unsigned int k = 0; k < this->dofs_per_cell; ++k) + for (unsigned int k = 0; k < this->n_dofs_per_cell(); ++k) output_data.shape_gradients[k][i] = grads[k]; if (fe_internal.update_each & update_hessians) - for (unsigned int k = 0; k < this->dofs_per_cell; ++k) + for (unsigned int k = 0; k < this->n_dofs_per_cell(); ++k) output_data.shape_hessians[k][i] = grad_grads[k]; } } diff --git a/source/fe/fe_dgq.cc b/source/fe/fe_dgq.cc index 429221ebfa..0034f68c88 100644 --- a/source/fe/fe_dgq.cc +++ b/source/fe/fe_dgq.cc @@ -69,10 +69,12 @@ FE_DGQ::FE_DGQ(const unsigned int degree) degree, FiniteElementData::L2), std::vector( - FiniteElementData(get_dpo_vector(degree), 1, degree).dofs_per_cell, + FiniteElementData(get_dpo_vector(degree), 1, degree) + .n_dofs_per_cell(), true), std::vector( - FiniteElementData(get_dpo_vector(degree), 1, degree).dofs_per_cell, + FiniteElementData(get_dpo_vector(degree), 1, degree) + .n_dofs_per_cell(), std::vector(1, true))) { // Compute support points, which are the tensor product of the Lagrange @@ -103,13 +105,13 @@ FE_DGQ::FE_DGQ( polynomials.size() - 1), 1, polynomials.size() - 1) - .dofs_per_cell, + .n_dofs_per_cell(), true), std::vector( FiniteElementData(get_dpo_vector(polynomials.size() - 1), 1, polynomials.size() - 1) - .dofs_per_cell, + .n_dofs_per_cell(), std::vector(1, true))) { // No support points can be defined in general. Derived classes might define @@ -147,9 +149,9 @@ FE_DGQ::convert_generalized_support_point_values_to_dof_values( AssertDimension(support_point_values.size(), this->get_unit_support_points().size()); AssertDimension(support_point_values.size(), nodal_values.size()); - AssertDimension(this->dofs_per_cell, nodal_values.size()); + AssertDimension(this->n_dofs_per_cell(), nodal_values.size()); - for (unsigned int i = 0; i < this->dofs_per_cell; ++i) + for (unsigned int i = 0; i < this->n_dofs_per_cell(); ++i) { AssertDimension(support_point_values[i].size(), 1); @@ -281,32 +283,33 @@ FE_DGQ::get_interpolation_matrix( const FE_DGQ &source_fe = dynamic_cast &>(x_source_fe); - Assert(interpolation_matrix.m() == this->dofs_per_cell, - ExcDimensionMismatch(interpolation_matrix.m(), this->dofs_per_cell)); - Assert(interpolation_matrix.n() == source_fe.dofs_per_cell, + Assert(interpolation_matrix.m() == this->n_dofs_per_cell(), + ExcDimensionMismatch(interpolation_matrix.m(), + this->n_dofs_per_cell())); + Assert(interpolation_matrix.n() == source_fe.n_dofs_per_cell(), ExcDimensionMismatch(interpolation_matrix.n(), - source_fe.dofs_per_cell)); + source_fe.n_dofs_per_cell())); // compute the interpolation // matrices in much the same way as // we do for the embedding matrices // from mother to child. - FullMatrix cell_interpolation(this->dofs_per_cell, - this->dofs_per_cell); - FullMatrix source_interpolation(this->dofs_per_cell, - source_fe.dofs_per_cell); - FullMatrix tmp(this->dofs_per_cell, source_fe.dofs_per_cell); - for (unsigned int j = 0; j < this->dofs_per_cell; ++j) + FullMatrix cell_interpolation(this->n_dofs_per_cell(), + this->n_dofs_per_cell()); + FullMatrix source_interpolation(this->n_dofs_per_cell(), + source_fe.n_dofs_per_cell()); + FullMatrix tmp(this->n_dofs_per_cell(), source_fe.n_dofs_per_cell()); + for (unsigned int j = 0; j < this->n_dofs_per_cell(); ++j) { // generate a point on this // cell and evaluate the // shape functions there const Point p = this->unit_support_points[j]; - for (unsigned int i = 0; i < this->dofs_per_cell; ++i) + for (unsigned int i = 0; i < this->n_dofs_per_cell(); ++i) cell_interpolation(j, i) = this->poly_space->compute_value(i, p); - for (unsigned int i = 0; i < source_fe.dofs_per_cell; ++i) + for (unsigned int i = 0; i < source_fe.n_dofs_per_cell(); ++i) source_interpolation(j, i) = source_fe.poly_space->compute_value(i, p); } @@ -318,8 +321,8 @@ FE_DGQ::get_interpolation_matrix( cell_interpolation.mmult(interpolation_matrix, source_interpolation); // cut off very small values - for (unsigned int i = 0; i < this->dofs_per_cell; ++i) - for (unsigned int j = 0; j < source_fe.dofs_per_cell; ++j) + for (unsigned int i = 0; i < this->n_dofs_per_cell(); ++i) + for (unsigned int j = 0; j < source_fe.n_dofs_per_cell(); ++j) if (std::fabs(interpolation_matrix(i, j)) < 1e-15) interpolation_matrix(i, j) = 0.; @@ -328,10 +331,10 @@ FE_DGQ::get_interpolation_matrix( // this point. this must be so // since the shape functions sum up // to 1 - for (unsigned int i = 0; i < this->dofs_per_cell; ++i) + for (unsigned int i = 0; i < this->n_dofs_per_cell(); ++i) { double sum = 0.; - for (unsigned int j = 0; j < source_fe.dofs_per_cell; ++j) + for (unsigned int j = 0; j < source_fe.n_dofs_per_cell(); ++j) sum += interpolation_matrix(i, j); Assert(std::fabs(sum - 1) < 5e-14 * std::max(this->degree, 1U) * dim, @@ -414,7 +417,7 @@ FE_DGQ::get_prolongation_matrix( // if matrix got updated while waiting for the lock if (this->prolongation[refinement_case - 1][child].n() == - this->dofs_per_cell) + this->n_dofs_per_cell()) return this->prolongation[refinement_case - 1][child]; // now do the work. need to get a non-const version of data in order to @@ -427,7 +430,8 @@ FE_DGQ::get_prolongation_matrix( RefinementCase::isotropic_refinement); isotropic_matrices.back().resize( GeometryInfo::n_children(RefinementCase(refinement_case)), - FullMatrix(this->dofs_per_cell, this->dofs_per_cell)); + FullMatrix(this->n_dofs_per_cell(), + this->n_dofs_per_cell())); if (dim == spacedim) FETools::compute_embedding_matrices(*this, isotropic_matrices, @@ -489,7 +493,7 @@ FE_DGQ::get_restriction_matrix( // if matrix got updated while waiting for the lock... if (this->restriction[refinement_case - 1][child].n() == - this->dofs_per_cell) + this->n_dofs_per_cell()) return this->restriction[refinement_case - 1][child]; // now do the work. need to get a non-const version of data in order to @@ -502,7 +506,8 @@ FE_DGQ::get_restriction_matrix( RefinementCase::isotropic_refinement); isotropic_matrices.back().resize( GeometryInfo::n_children(RefinementCase(refinement_case)), - FullMatrix(this->dofs_per_cell, this->dofs_per_cell)); + FullMatrix(this->n_dofs_per_cell(), + this->n_dofs_per_cell())); if (dim == spacedim) FETools::compute_projection_matrices(*this, isotropic_matrices, @@ -709,7 +714,7 @@ bool FE_DGQ::has_support_on_face(const unsigned int shape_index, const unsigned int face_index) const { - AssertIndexRange(shape_index, this->dofs_per_cell); + AssertIndexRange(shape_index, this->n_dofs_per_cell()); AssertIndexRange(face_index, GeometryInfo::faces_per_cell); unsigned int n = this->degree + 1; @@ -757,7 +762,7 @@ FE_DGQ::has_support_on_face(const unsigned int shape_index, return true; if (face_index == 2 && shape_index < n) return true; - if (face_index == 3 && shape_index >= this->dofs_per_cell - n) + if (face_index == 3 && shape_index >= this->n_dofs_per_cell() - n) return true; return false; } @@ -782,7 +787,7 @@ FE_DGQ::has_support_on_face(const unsigned int shape_index, if (face_index == 4 && shape_index < n2) return true; // z=1 - if (face_index == 5 && shape_index >= this->dofs_per_cell - n2) + if (face_index == 5 && shape_index >= this->n_dofs_per_cell() - n2) return true; return false; } @@ -799,7 +804,7 @@ template std::pair, std::vector> FE_DGQ::get_constant_modes() const { - Table<2, bool> constant_modes(1, this->dofs_per_cell); + Table<2, bool> constant_modes(1, this->n_dofs_per_cell()); constant_modes.fill(true); return std::pair, std::vector>( constant_modes, std::vector(1, 0)); @@ -931,9 +936,9 @@ FE_DGQArbitraryNodes:: AssertDimension(support_point_values.size(), this->get_unit_support_points().size()); AssertDimension(support_point_values.size(), nodal_values.size()); - AssertDimension(this->dofs_per_cell, nodal_values.size()); + AssertDimension(this->n_dofs_per_cell(), nodal_values.size()); - for (unsigned int i = 0; i < this->dofs_per_cell; ++i) + for (unsigned int i = 0; i < this->n_dofs_per_cell(); ++i) { AssertDimension(support_point_values[i].size(), 1); @@ -979,7 +984,7 @@ FE_DGQLegendre::get_constant_modes() const { // Legendre represents a constant function by one in the first basis // function and zero in all others - Table<2, bool> constant_modes(1, this->dofs_per_cell); + Table<2, bool> constant_modes(1, this->n_dofs_per_cell()); constant_modes(0, 0) = true; return std::pair, std::vector>( constant_modes, std::vector(1, 0)); diff --git a/source/fe/fe_enriched.cc b/source/fe/fe_enriched.cc index 46c57d2646..11ededa286 100644 --- a/source/fe/fe_enriched.cc +++ b/source/fe/fe_enriched.cc @@ -211,7 +211,7 @@ FE_Enriched::FE_Enriched( this->n_base_elements())); // build the map: (base_no, base_m) -> vector of local element DoFs - for (unsigned int system_index = 0; system_index < this->dofs_per_cell; + for (unsigned int system_index = 0; system_index < this->n_dofs_per_cell(); ++system_index) { const unsigned int base_no = @@ -248,10 +248,10 @@ FE_Enriched::FE_Enriched( m < base_no_mult_local_enriched_dofs[base_no].size(); m++) Assert(base_no_mult_local_enriched_dofs[base_no][m].size() == - fes[base_no]->dofs_per_cell, + fes[base_no]->n_dofs_per_cell(), ExcDimensionMismatch( base_no_mult_local_enriched_dofs[base_no][m].size(), - fes[base_no]->dofs_per_cell)); + fes[base_no]->n_dofs_per_cell())); } } @@ -439,7 +439,7 @@ FE_Enriched::initialize( { // If the system is not primitive, these have not been initialized by // FiniteElement - this->system_to_component_table.resize(this->dofs_per_cell); + this->system_to_component_table.resize(this->n_dofs_per_cell()); this->face_system_to_component_table.resize(this->dofs_per_face); FETools::Compositing::build_cell_tables(this->system_to_base_table, @@ -659,13 +659,15 @@ FE_Enriched::multiply_by_enrichment( const UpdateFlags base_flags = base_fe_data.update_each; - for (unsigned int system_index = 0; system_index < this->dofs_per_cell; + for (unsigned int system_index = 0; + system_index < this->n_dofs_per_cell(); ++system_index) if (this->system_to_base_table[system_index].first.first == base_no) { const unsigned int base_index = this->system_to_base_table[system_index].second; - Assert(base_index < base_fe.dofs_per_cell, ExcInternalError()); + Assert(base_index < base_fe.n_dofs_per_cell(), + ExcInternalError()); // now copy. if the shape function is primitive, then there // is only one value to be copied, but for non-primitive diff --git a/source/fe/fe_face.cc b/source/fe/fe_face.cc index 9789720605..b0bb00e993 100644 --- a/source/fe/fe_face.cc +++ b/source/fe/fe_face.cc @@ -475,8 +475,8 @@ template std::pair, std::vector> FE_FaceQ::get_constant_modes() const { - Table<2, bool> constant_modes(1, this->dofs_per_cell); - for (unsigned int i = 0; i < this->dofs_per_cell; ++i) + Table<2, bool> constant_modes(1, this->n_dofs_per_cell()); + for (unsigned int i = 0; i < this->n_dofs_per_cell(); ++i) constant_modes(0, i) = true; return std::pair, std::vector>( constant_modes, std::vector(1, 0)); @@ -491,9 +491,9 @@ FE_FaceQ::convert_generalized_support_point_values_to_dof_values( AssertDimension(support_point_values.size(), this->get_unit_support_points().size()); AssertDimension(support_point_values.size(), nodal_values.size()); - AssertDimension(this->dofs_per_cell, nodal_values.size()); + AssertDimension(this->n_dofs_per_cell(), nodal_values.size()); - for (unsigned int i = 0; i < this->dofs_per_cell; ++i) + for (unsigned int i = 0; i < this->n_dofs_per_cell(); ++i) { AssertDimension(support_point_values[i].size(), 1); @@ -647,8 +647,8 @@ template std::pair, std::vector> FE_FaceQ<1, spacedim>::get_constant_modes() const { - Table<2, bool> constant_modes(1, this->dofs_per_cell); - for (unsigned int i = 0; i < this->dofs_per_cell; ++i) + Table<2, bool> constant_modes(1, this->n_dofs_per_cell()); + for (unsigned int i = 0; i < this->n_dofs_per_cell(); ++i) constant_modes(0, i) = true; return std::pair, std::vector>( constant_modes, std::vector(1, 0)); @@ -712,7 +712,7 @@ FE_FaceQ<1, spacedim>::fill_fe_face_values( const unsigned int foffset = face; if (fe_internal.update_each & update_values) { - for (unsigned int k = 0; k < this->dofs_per_cell; ++k) + for (unsigned int k = 0; k < this->n_dofs_per_cell(); ++k) output_data.shape_values(k, 0) = 0.; output_data.shape_values(foffset, 0) = 1; } @@ -978,7 +978,7 @@ template std::pair, std::vector> FE_FaceP::get_constant_modes() const { - Table<2, bool> constant_modes(1, this->dofs_per_cell); + Table<2, bool> constant_modes(1, this->n_dofs_per_cell()); for (unsigned int face : GeometryInfo::face_indices()) constant_modes(0, face * this->dofs_per_face) = true; return std::pair, std::vector>( diff --git a/source/fe/fe_nedelec.cc b/source/fe/fe_nedelec.cc index e46ba88a06..c774591786 100644 --- a/source/fe/fe_nedelec.cc +++ b/source/fe/fe_nedelec.cc @@ -85,7 +85,7 @@ FE_Nedelec::FE_Nedelec(const unsigned int order) Assert(dim >= 2, ExcImpossibleInDim(dim)); - const unsigned int n_dofs = this->dofs_per_cell; + const unsigned int n_dofs = this->n_dofs_per_cell(); this->mapping_kind = {mapping_nedelec}; // First, initialize the @@ -534,7 +534,7 @@ FE_Nedelec::initialize_restriction() // functions of the child cells // to the lowest order shape // functions of the parent cell. - for (unsigned int dof = 0; dof < this->dofs_per_cell; ++dof) + for (unsigned int dof = 0; dof < this->n_dofs_per_cell(); ++dof) for (unsigned int q_point = 0; q_point < n_edge_quadrature_points; ++q_point) { @@ -626,7 +626,7 @@ FE_Nedelec::initialize_restriction() FullMatrix system_rhs(this->degree - 1, 4); Vector tmp(4); - for (unsigned int dof = 0; dof < this->dofs_per_cell; ++dof) + for (unsigned int dof = 0; dof < this->n_dofs_per_cell(); ++dof) for (unsigned int i = 0; i < 2; ++i) { system_rhs = 0.0; @@ -801,7 +801,7 @@ FE_Nedelec::initialize_restriction() system_rhs.reinit(system_matrix_inv.m(), 8); tmp.reinit(8); - for (unsigned int dof = 0; dof < this->dofs_per_cell; ++dof) + for (unsigned int dof = 0; dof < this->n_dofs_per_cell(); ++dof) { system_rhs = 0.0; @@ -963,7 +963,7 @@ FE_Nedelec::initialize_restriction() // functions of the child cells // to the lowest order shape // functions of the parent cell. - for (unsigned int dof = 0; dof < this->dofs_per_cell; ++dof) + for (unsigned int dof = 0; dof < this->n_dofs_per_cell(); ++dof) for (unsigned int q_point = 0; q_point < n_edge_quadrature_points; ++q_point) { @@ -1068,7 +1068,8 @@ FE_Nedelec::initialize_restriction() for (unsigned int i = 0; i < 2; ++i) for (unsigned int j = 0; j < 2; ++j) - for (unsigned int dof = 0; dof < this->dofs_per_cell; ++dof) + for (unsigned int dof = 0; dof < this->n_dofs_per_cell(); + ++dof) { system_rhs = 0.0; @@ -1300,7 +1301,7 @@ FE_Nedelec::initialize_restriction() tmp.reinit(24); for (unsigned int i = 0; i < 2; ++i) - for (unsigned int dof = 0; dof < this->dofs_per_cell; ++dof) + for (unsigned int dof = 0; dof < this->n_dofs_per_cell(); ++dof) { system_rhs = 0.0; @@ -1641,7 +1642,7 @@ FE_Nedelec::initialize_restriction() system_rhs.reinit(system_matrix_inv.m(), 24); tmp.reinit(24); - for (unsigned int dof = 0; dof < this->dofs_per_cell; ++dof) + for (unsigned int dof = 0; dof < this->n_dofs_per_cell(); ++dof) { system_rhs = 0.0; @@ -2035,7 +2036,7 @@ bool FE_Nedelec::has_support_on_face(const unsigned int shape_index, const unsigned int face_index) const { - AssertIndexRange(shape_index, this->dofs_per_cell); + AssertIndexRange(shape_index, this->n_dofs_per_cell()); AssertIndexRange(face_index, GeometryInfo::faces_per_cell); const unsigned int deg = this->degree - 1; @@ -2970,7 +2971,7 @@ FE_Nedelec::get_prolongation_matrix( // if matrix got updated while waiting for the lock if (this->prolongation[refinement_case - 1][child].n() == - this->dofs_per_cell) + this->n_dofs_per_cell()) return this->prolongation[refinement_case - 1][child]; // now do the work. need to get a non-const version of data in order to @@ -3026,7 +3027,7 @@ FE_Nedelec::get_restriction_matrix( // if matrix got updated while waiting for the lock... if (this->restriction[refinement_case - 1][child].n() == - this->dofs_per_cell) + this->n_dofs_per_cell()) return this->restriction[refinement_case - 1][child]; // now do the work. need to get a non-const version of data in order to @@ -3081,8 +3082,8 @@ FE_Nedelec::convert_generalized_support_point_values_to_dof_values( Assert(support_point_values[0].size() == this->n_components(), ExcDimensionMismatch(support_point_values[0].size(), this->n_components())); - Assert(nodal_values.size() == this->dofs_per_cell, - ExcDimensionMismatch(nodal_values.size(), this->dofs_per_cell)); + Assert(nodal_values.size() == this->n_dofs_per_cell(), + ExcDimensionMismatch(nodal_values.size(), this->n_dofs_per_cell())); std::fill(nodal_values.begin(), nodal_values.end(), 0.0); switch (dim) @@ -4018,9 +4019,9 @@ template std::pair, std::vector> FE_Nedelec::get_constant_modes() const { - Table<2, bool> constant_modes(dim, this->dofs_per_cell); + Table<2, bool> constant_modes(dim, this->n_dofs_per_cell()); for (unsigned int d = 0; d < dim; ++d) - for (unsigned int i = 0; i < this->dofs_per_cell; ++i) + for (unsigned int i = 0; i < this->n_dofs_per_cell(); ++i) constant_modes(d, i) = true; std::vector components; for (unsigned int d = 0; d < dim; ++d) diff --git a/source/fe/fe_nedelec_sz.cc b/source/fe/fe_nedelec_sz.cc index 03221321ba..861bb8afb4 100644 --- a/source/fe/fe_nedelec_sz.cc +++ b/source/fe/fe_nedelec_sz.cc @@ -165,13 +165,13 @@ FE_NedelecSZ::get_data( // Resize shape function arrays according to update flags: if (flags & update_values) { - data.shape_values.resize(this->dofs_per_cell, + data.shape_values.resize(this->n_dofs_per_cell(), std::vector>(n_q_points)); } if (flags & update_gradients) { - data.shape_grads.resize(this->dofs_per_cell, + data.shape_grads.resize(this->n_dofs_per_cell(), std::vector>( n_q_points)); } @@ -1128,9 +1128,9 @@ FE_NedelecSZ::fill_edge_values( const unsigned int n_q_points = quadrature.size(); Assert(!(flags & update_values) || - fe_data.shape_values.size() == this->dofs_per_cell, + fe_data.shape_values.size() == this->n_dofs_per_cell(), ExcDimensionMismatch(fe_data.shape_values.size(), - this->dofs_per_cell)); + this->n_dofs_per_cell())); Assert(!(flags & update_values) || fe_data.shape_values[0].size() == n_q_points, ExcDimensionMismatch(fe_data.shape_values[0].size(), n_q_points)); @@ -1565,9 +1565,9 @@ FE_NedelecSZ::fill_face_values( const unsigned int n_q_points = quadrature.size(); Assert(!(flags & update_values) || - fe_data.shape_values.size() == this->dofs_per_cell, + fe_data.shape_values.size() == this->n_dofs_per_cell(), ExcDimensionMismatch(fe_data.shape_values.size(), - this->dofs_per_cell)); + this->n_dofs_per_cell())); Assert(!(flags & update_values) || fe_data.shape_values[0].size() == n_q_points, ExcDimensionMismatch(fe_data.shape_values[0].size(), @@ -1939,9 +1939,9 @@ FE_NedelecSZ::fill_fe_values( const unsigned int n_q_points = quadrature.size(); Assert(!(flags & update_values) || - fe_data.shape_values.size() == this->dofs_per_cell, + fe_data.shape_values.size() == this->n_dofs_per_cell(), ExcDimensionMismatch(fe_data.shape_values.size(), - this->dofs_per_cell)); + this->n_dofs_per_cell())); Assert(!(flags & update_values) || fe_data.shape_values[0].size() == n_q_points, ExcDimensionMismatch(fe_data.shape_values[0].size(), n_q_points)); @@ -1951,7 +1951,7 @@ FE_NedelecSZ::fill_fe_values( // Now have all shape_values stored on the reference cell. // Must now transform to the physical cell. std::vector> transformed_shape_values(n_q_points); - for (unsigned int dof = 0; dof < this->dofs_per_cell; ++dof) + for (unsigned int dof = 0; dof < this->n_dofs_per_cell(); ++dof) { const unsigned int first = data.shape_function_to_row_table[dof * this->n_components() + @@ -1978,7 +1978,7 @@ FE_NedelecSZ::fill_fe_values( // Must now transform to the physical cell. std::vector> input(n_q_points); std::vector> transformed_shape_grads(n_q_points); - for (unsigned int dof = 0; dof < this->dofs_per_cell; ++dof) + for (unsigned int dof = 0; dof < this->n_dofs_per_cell(); ++dof) { for (unsigned int q = 0; q < n_q_points; ++q) { @@ -2079,7 +2079,7 @@ FE_NedelecSZ::fill_fe_face_values( // Now have all shape_values stored on the reference cell. // Must now transform to the physical cell. std::vector> transformed_shape_values(n_q_points); - for (unsigned int dof = 0; dof < this->dofs_per_cell; ++dof) + for (unsigned int dof = 0; dof < this->n_dofs_per_cell(); ++dof) { mapping.transform(make_array_view(fe_data.shape_values[dof], offset, @@ -2109,7 +2109,7 @@ FE_NedelecSZ::fill_fe_face_values( // Must now transform to the physical cell. std::vector> input(n_q_points); std::vector> transformed_shape_grads(n_q_points); - for (unsigned int dof = 0; dof < this->dofs_per_cell; ++dof) + for (unsigned int dof = 0; dof < this->n_dofs_per_cell(); ++dof) { for (unsigned int q = 0; q < n_q_points; ++q) { diff --git a/source/fe/fe_p1nc.cc b/source/fe/fe_p1nc.cc index 6b5215786e..e66652bebc 100644 --- a/source/fe/fe_p1nc.cc +++ b/source/fe/fe_p1nc.cc @@ -228,14 +228,14 @@ FE_P1NC::fill_fe_values( // compute on the cell if (flags & update_values) for (unsigned int i = 0; i < n_q_points; ++i) - for (unsigned int k = 0; k < this->dofs_per_cell; ++k) + for (unsigned int k = 0; k < this->n_dofs_per_cell(); ++k) output_data.shape_values[k][i] = (coeffs[k][0] * mapping_data.quadrature_points[i](0) + coeffs[k][1] * mapping_data.quadrature_points[i](1) + coeffs[k][2]); if (flags & update_gradients) for (unsigned int i = 0; i < n_q_points; ++i) - for (unsigned int k = 0; k < this->dofs_per_cell; ++k) + for (unsigned int k = 0; k < this->n_dofs_per_cell(); ++k) output_data.shape_gradients[k][i] = Point<2>(coeffs[k][0], coeffs[k][1]); } @@ -266,7 +266,7 @@ FE_P1NC::fill_fe_face_values( if (flags & update_values) for (unsigned int i = 0; i < quadrature_on_face.size(); ++i) - for (unsigned int k = 0; k < this->dofs_per_cell; ++k) + for (unsigned int k = 0; k < this->n_dofs_per_cell(); ++k) { const Point<2> quadrature_point = mapping.transform_unit_to_real_cell(cell, @@ -279,7 +279,7 @@ FE_P1NC::fill_fe_face_values( if (flags & update_gradients) for (unsigned int i = 0; i < quadrature_on_face.size(); ++i) - for (unsigned int k = 0; k < this->dofs_per_cell; ++k) + for (unsigned int k = 0; k < this->n_dofs_per_cell(); ++k) output_data.shape_gradients[k][i] = Point<2>(coeffs[k][0], coeffs[k][1]); } @@ -312,7 +312,7 @@ FE_P1NC::fill_fe_subface_values( if (flags & update_values) for (unsigned int i = 0; i < quadrature_on_subface.size(); ++i) { - for (unsigned int k = 0; k < this->dofs_per_cell; ++k) + for (unsigned int k = 0; k < this->n_dofs_per_cell(); ++k) { const Point<2> quadrature_point = mapping.transform_unit_to_real_cell( @@ -326,7 +326,7 @@ FE_P1NC::fill_fe_subface_values( if (flags & update_gradients) for (unsigned int i = 0; i < quadrature_on_subface.size(); ++i) - for (unsigned int k = 0; k < this->dofs_per_cell; ++k) + for (unsigned int k = 0; k < this->n_dofs_per_cell(); ++k) output_data.shape_gradients[k][i] = Point<2>(coeffs[k][0], coeffs[k][1]); } diff --git a/source/fe/fe_poly_tensor.cc b/source/fe/fe_poly_tensor.cc index f92894054f..21efff6175 100644 --- a/source/fe/fe_poly_tensor.cc +++ b/source/fe/fe_poly_tensor.cc @@ -243,7 +243,7 @@ FE_PolyTensor::shape_value_component( const Point & p, const unsigned int component) const { - AssertIndexRange(i, this->dofs_per_cell); + AssertIndexRange(i, this->n_dofs_per_cell()); AssertIndexRange(component, dim); std::lock_guard lock(cache_mutex); @@ -288,7 +288,7 @@ FE_PolyTensor::shape_grad_component( const Point & p, const unsigned int component) const { - AssertIndexRange(i, this->dofs_per_cell); + AssertIndexRange(i, this->n_dofs_per_cell()); AssertIndexRange(component, dim); std::lock_guard lock(cache_mutex); @@ -334,7 +334,7 @@ FE_PolyTensor::shape_grad_grad_component( const Point & p, const unsigned int component) const { - AssertIndexRange(i, this->dofs_per_cell); + AssertIndexRange(i, this->n_dofs_per_cell()); AssertIndexRange(component, dim); std::lock_guard lock(cache_mutex); @@ -392,9 +392,9 @@ FE_PolyTensor::fill_fe_values( const unsigned int n_q_points = quadrature.size(); Assert(!(fe_data.update_each & update_values) || - fe_data.shape_values.size()[0] == this->dofs_per_cell, + fe_data.shape_values.size()[0] == this->n_dofs_per_cell(), ExcDimensionMismatch(fe_data.shape_values.size()[0], - this->dofs_per_cell)); + this->n_dofs_per_cell())); Assert(!(fe_data.update_each & update_values) || fe_data.shape_values.size()[1] == n_q_points, ExcDimensionMismatch(fe_data.shape_values.size()[1], n_q_points)); @@ -418,7 +418,7 @@ FE_PolyTensor::fill_fe_values( fe_data.sign_change); - for (unsigned int i = 0; i < this->dofs_per_cell; ++i) + for (unsigned int i = 0; i < this->n_dofs_per_cell(); ++i) { const MappingKind mapping_kind = get_mapping_kind(i); @@ -996,7 +996,7 @@ FE_PolyTensor::fill_fe_face_values( this->mapping_kind, fe_data.sign_change); - for (unsigned int i = 0; i < this->dofs_per_cell; ++i) + for (unsigned int i = 0; i < this->n_dofs_per_cell(); ++i) { const MappingKind mapping_kind = get_mapping_kind(i); @@ -1626,7 +1626,7 @@ FE_PolyTensor::fill_fe_subface_values( this->mapping_kind, fe_data.sign_change); - for (unsigned int i = 0; i < this->dofs_per_cell; ++i) + for (unsigned int i = 0; i < this->n_dofs_per_cell(); ++i) { const MappingKind mapping_kind = get_mapping_kind(i); @@ -2190,7 +2190,7 @@ FE_PolyTensor::requires_update_flags( { UpdateFlags out = update_default; - for (unsigned int i = 0; i < this->dofs_per_cell; ++i) + for (unsigned int i = 0; i < this->n_dofs_per_cell(); ++i) { const MappingKind mapping_kind = get_mapping_kind(i); diff --git a/source/fe/fe_q.cc b/source/fe/fe_q.cc index a085033cc5..87fe157b67 100644 --- a/source/fe/fe_q.cc +++ b/source/fe/fe_q.cc @@ -155,9 +155,9 @@ FE_Q::convert_generalized_support_point_values_to_dof_values( AssertDimension(support_point_values.size(), this->get_unit_support_points().size()); AssertDimension(support_point_values.size(), nodal_values.size()); - AssertDimension(this->dofs_per_cell, nodal_values.size()); + AssertDimension(this->n_dofs_per_cell(), nodal_values.size()); - for (unsigned int i = 0; i < this->dofs_per_cell; ++i) + for (unsigned int i = 0; i < this->n_dofs_per_cell(); ++i) { AssertDimension(support_point_values[i].size(), 1); diff --git a/source/fe/fe_q_base.cc b/source/fe/fe_q_base.cc index c2353a0e64..3cd7b0e002 100644 --- a/source/fe/fe_q_base.cc +++ b/source/fe/fe_q_base.cc @@ -435,15 +435,15 @@ FE_Q_Base::initialize( // class FE_Q_DG0 that otherwise shares 95% of the code. const unsigned int q_dofs_per_cell = Utilities::fixed_power(q_degree + 1); - Assert(q_dofs_per_cell == this->dofs_per_cell || - q_dofs_per_cell + 1 == this->dofs_per_cell || - q_dofs_per_cell + dim == this->dofs_per_cell, + Assert(q_dofs_per_cell == this->n_dofs_per_cell() || + q_dofs_per_cell + 1 == this->n_dofs_per_cell() || + q_dofs_per_cell + dim == this->n_dofs_per_cell(), ExcInternalError()); [this, q_dofs_per_cell]() { std::vector renumber = FETools::hierarchic_to_lexicographic_numbering(q_degree); - for (unsigned int i = q_dofs_per_cell; i < this->dofs_per_cell; ++i) + for (unsigned int i = q_dofs_per_cell; i < this->n_dofs_per_cell(); ++i) renumber.push_back(i); auto *tensor_poly_space_ptr = dynamic_cast *>(this->poly_space.get()); @@ -509,12 +509,12 @@ FE_Q_Base::get_interpolation_matrix( &x_source_fe)) { // ok, source is a Q element, so we will be able to do the work - Assert(interpolation_matrix.m() == this->dofs_per_cell, + Assert(interpolation_matrix.m() == this->n_dofs_per_cell(), ExcDimensionMismatch(interpolation_matrix.m(), - this->dofs_per_cell)); - Assert(interpolation_matrix.n() == x_source_fe.dofs_per_cell, + this->n_dofs_per_cell())); + Assert(interpolation_matrix.n() == x_source_fe.n_dofs_per_cell(), ExcDimensionMismatch(interpolation_matrix.m(), - x_source_fe.dofs_per_cell)); + x_source_fe.n_dofs_per_cell())); // only evaluate Q dofs const unsigned int q_dofs_per_cell = @@ -542,9 +542,10 @@ FE_Q_Base::get_interpolation_matrix( } // for FE_Q_DG0, add one last row of identity - if (q_dofs_per_cell < this->dofs_per_cell) + if (q_dofs_per_cell < this->n_dofs_per_cell()) { - AssertDimension(source_q_dofs_per_cell + 1, source_fe->dofs_per_cell); + AssertDimension(source_q_dofs_per_cell + 1, + source_fe->n_dofs_per_cell()); for (unsigned int i = 0; i < source_q_dofs_per_cell; ++i) interpolation_matrix(q_dofs_per_cell, i) = 0.; for (unsigned int j = 0; j < q_dofs_per_cell; ++j) @@ -554,17 +555,17 @@ FE_Q_Base::get_interpolation_matrix( // cut off very small values const double eps = 2e-13 * q_degree * dim; - for (unsigned int i = 0; i < this->dofs_per_cell; ++i) - for (unsigned int j = 0; j < source_fe->dofs_per_cell; ++j) + for (unsigned int i = 0; i < this->n_dofs_per_cell(); ++i) + for (unsigned int j = 0; j < source_fe->n_dofs_per_cell(); ++j) if (std::fabs(interpolation_matrix(i, j)) < eps) interpolation_matrix(i, j) = 0.; // make sure that the row sum of each of the matrices is 1 at this // point. this must be so since the shape functions sum up to 1 - for (unsigned int i = 0; i < this->dofs_per_cell; ++i) + for (unsigned int i = 0; i < this->n_dofs_per_cell(); ++i) { double sum = 0.; - for (unsigned int j = 0; j < source_fe->dofs_per_cell; ++j) + for (unsigned int j = 0; j < source_fe->n_dofs_per_cell(); ++j) sum += interpolation_matrix(i, j); Assert(std::fabs(sum - 1) < eps, ExcInternalError()); @@ -578,13 +579,13 @@ FE_Q_Base::get_interpolation_matrix( // with a n_dofs x 0 matrix. there is nothing to do here // we would like to verify that the number of rows and columns of - // the matrix equals this->dofs_per_cell and zero. unfortunately, + // the matrix equals this->n_dofs_per_cell() and zero. unfortunately, // whenever we do FullMatrix::reinit(m,0), it sets both rows and // columns to zero, instead of m and zero. thus, only test the // number of columns - Assert(interpolation_matrix.n() == x_source_fe.dofs_per_cell, + Assert(interpolation_matrix.n() == x_source_fe.n_dofs_per_cell(), ExcDimensionMismatch(interpolation_matrix.m(), - x_source_fe.dofs_per_cell)); + x_source_fe.n_dofs_per_cell())); } else AssertThrow( @@ -1055,15 +1056,15 @@ FE_Q_Base::face_to_cell_index( { // get the number of the vertex on the face that corresponds to this DoF, // along with the number of the DoF on this vertex - const unsigned int face_vertex = face_index / this->dofs_per_vertex; + const unsigned int face_vertex = face_index / this->n_dofs_per_vertex(); const unsigned int dof_index_on_vertex = - face_index % this->dofs_per_vertex; + face_index % this->n_dofs_per_vertex(); // then get the number of this vertex on the cell and translate // this to a DoF number on the cell return (GeometryInfo::face_to_cell_vertices( face, face_vertex, face_orientation, face_flip, face_rotation) * - this->dofs_per_vertex + + this->n_dofs_per_vertex() + dof_index_on_vertex); } else if (face_index < this->first_face_quad_index) @@ -1186,7 +1187,7 @@ FE_Q_Base::get_prolongation_matrix( // if matrix got updated while waiting for the lock if (this->prolongation[refinement_case - 1][child].n() == - this->dofs_per_cell) + this->n_dofs_per_cell()) return this->prolongation[refinement_case - 1][child]; // distinguish q/q_dg0 case: only treat Q dofs first @@ -1251,7 +1252,8 @@ FE_Q_Base::get_prolongation_matrix( } } - FullMatrix prolongate(this->dofs_per_cell, this->dofs_per_cell); + FullMatrix prolongate(this->n_dofs_per_cell(), + this->n_dofs_per_cell()); // go through the points in diagonal to capture variation in all // directions simultaneously @@ -1331,19 +1333,19 @@ FE_Q_Base::get_prolongation_matrix( // the discontinuous node is simply mapped on the discontinuous node on // the child element - if (q_dofs_per_cell < this->dofs_per_cell) + if (q_dofs_per_cell < this->n_dofs_per_cell()) prolongate(q_dofs_per_cell, q_dofs_per_cell) = 1.; // and make sure that the row sum is 1. this must be so since for this // element, the shape functions add up to one #ifdef DEBUG - for (unsigned int row = 0; row < this->dofs_per_cell; ++row) + for (unsigned int row = 0; row < this->n_dofs_per_cell(); ++row) { double sum = 0; - for (unsigned int col = 0; col < this->dofs_per_cell; ++col) + for (unsigned int col = 0; col < this->n_dofs_per_cell(); ++col) sum += prolongate(row, col); Assert(std::fabs(sum - 1.) < - std::max(eps, 5e-16 * std::sqrt(this->dofs_per_cell)), + std::max(eps, 5e-16 * std::sqrt(this->n_dofs_per_cell())), ExcInternalError("The entries in a row of the local " "prolongation matrix do not add to one. " "This typically indicates that the " @@ -1384,11 +1386,11 @@ FE_Q_Base::get_restriction_matrix( // if matrix got updated while waiting for the lock... if (this->restriction[refinement_case - 1][child].n() == - this->dofs_per_cell) + this->n_dofs_per_cell()) return this->restriction[refinement_case - 1][child]; - FullMatrix my_restriction(this->dofs_per_cell, - this->dofs_per_cell); + FullMatrix my_restriction(this->n_dofs_per_cell(), + this->n_dofs_per_cell()); // distinguish q/q_dg0 case const unsigned int q_dofs_per_cell = Utilities::fixed_power(q_degree + 1); @@ -1418,7 +1420,7 @@ FE_Q_Base::get_restriction_matrix( const unsigned int dofs1d = q_degree + 1; std::vector> evaluations1d(dofs1d); - my_restriction.reinit(this->dofs_per_cell, this->dofs_per_cell); + my_restriction.reinit(this->n_dofs_per_cell(), this->n_dofs_per_cell()); for (unsigned int i = 0; i < q_dofs_per_cell; ++i) { @@ -1474,7 +1476,8 @@ FE_Q_Base::get_restriction_matrix( dofs1d); } Assert(std::fabs(sum_check - 1) < - std::max(eps, 5e-16 * std::sqrt(this->dofs_per_cell)), + std::max(eps, + 5e-16 * std::sqrt(this->n_dofs_per_cell())), ExcInternalError("The entries in a row of the local " "restriction matrix do not add to one. " "This typically indicates that the " @@ -1484,8 +1487,9 @@ FE_Q_Base::get_restriction_matrix( } // part for FE_Q_DG0 - if (q_dofs_per_cell < this->dofs_per_cell) - my_restriction(this->dofs_per_cell - 1, this->dofs_per_cell - 1) = + if (q_dofs_per_cell < this->n_dofs_per_cell()) + my_restriction(this->n_dofs_per_cell() - 1, + this->n_dofs_per_cell() - 1) = 1. / GeometryInfo::n_children( RefinementCase(refinement_case)); } @@ -1512,7 +1516,7 @@ FE_Q_Base::has_support_on_face( const unsigned int shape_index, const unsigned int face_index) const { - AssertIndexRange(shape_index, this->dofs_per_cell); + AssertIndexRange(shape_index, this->n_dofs_per_cell()); AssertIndexRange(face_index, GeometryInfo::faces_per_cell); // in 1d, things are simple. since there is only one degree of freedom per @@ -1610,7 +1614,7 @@ template std::pair, std::vector> FE_Q_Base::get_constant_modes() const { - Table<2, bool> constant_modes(1, this->dofs_per_cell); + Table<2, bool> constant_modes(1, this->n_dofs_per_cell()); // We here just care for the constant mode due to the polynomial space // without any enrichments // As there may be more constant modes derived classes may to implement this diff --git a/source/fe/fe_q_bubbles.cc b/source/fe/fe_q_bubbles.cc index 464d23a9a7..dc38e9d687 100644 --- a/source/fe/fe_q_bubbles.cc +++ b/source/fe/fe_q_bubbles.cc @@ -52,7 +52,7 @@ namespace internal std::vector>> &matrices, const bool isotropic_only) { - const unsigned int dpc = fe.dofs_per_cell; + const unsigned int dpc = fe.n_dofs_per_cell(); const unsigned int degree = fe.degree; // Initialize quadrature formula on fine cells @@ -134,7 +134,7 @@ namespace internal FullMatrix coarse_rhs_matrix(n_dofs, dpc); std::vector> child_ldi( - nc, std::vector(fe.dofs_per_cell)); + nc, std::vector(fe.n_dofs_per_cell())); // now create the mass matrix and all the right_hand sides unsigned int child_no = 0; @@ -210,7 +210,7 @@ FE_Q_Bubbles::FE_Q_Bubbles(const unsigned int q_degree) point[d] = 0.5; for (unsigned int i = 0; i < n_bubbles; ++i) this->unit_support_points.push_back(point); - AssertDimension(this->dofs_per_cell, this->unit_support_points.size()); + AssertDimension(this->n_dofs_per_cell(), this->unit_support_points.size()); this->reinit_restriction_and_prolongation_matrices(); if (dim == spacedim) @@ -249,7 +249,7 @@ FE_Q_Bubbles::FE_Q_Bubbles(const Quadrature<1> &points) point[d] = 0.5; for (unsigned int i = 0; i < n_bubbles; ++i) this->unit_support_points.push_back(point); - AssertDimension(this->dofs_per_cell, this->unit_support_points.size()); + AssertDimension(this->n_dofs_per_cell(), this->unit_support_points.size()); this->reinit_restriction_and_prolongation_matrices(); if (dim == spacedim) @@ -276,7 +276,7 @@ FE_Q_Bubbles::get_name() const bool type = true; const unsigned int n_points = this->degree; std::vector points(n_points); - const unsigned int dofs_per_cell = this->dofs_per_cell; + const unsigned int dofs_per_cell = this->n_dofs_per_cell(); const std::vector> &unit_support_points = this->unit_support_points; unsigned int index = 0; @@ -362,13 +362,13 @@ FE_Q_Bubbles:: Assert(support_point_values.size() == this->unit_support_points.size(), ExcDimensionMismatch(support_point_values.size(), this->unit_support_points.size())); - Assert(nodal_values.size() == this->dofs_per_cell, - ExcDimensionMismatch(nodal_values.size(), this->dofs_per_cell)); + Assert(nodal_values.size() == this->n_dofs_per_cell(), + ExcDimensionMismatch(nodal_values.size(), this->n_dofs_per_cell())); Assert(support_point_values[0].size() == this->n_components(), ExcDimensionMismatch(support_point_values[0].size(), this->n_components())); - for (unsigned int i = 0; i < this->dofs_per_cell - 1; ++i) + for (unsigned int i = 0; i < this->n_dofs_per_cell() - 1; ++i) { const std::pair index = this->system_to_component_index(i); @@ -397,11 +397,12 @@ FE_Q_Bubbles::get_interpolation_matrix( (x_source_fe.get_name().find("FE_Q_Bubbles<") == 0) || (dynamic_cast(&x_source_fe) != nullptr), (typename FiniteElement::ExcInterpolationNotImplemented())); - Assert(interpolation_matrix.m() == this->dofs_per_cell, - ExcDimensionMismatch(interpolation_matrix.m(), this->dofs_per_cell)); - Assert(interpolation_matrix.n() == x_source_fe.dofs_per_cell, + Assert(interpolation_matrix.m() == this->n_dofs_per_cell(), ExcDimensionMismatch(interpolation_matrix.m(), - x_source_fe.dofs_per_cell)); + this->n_dofs_per_cell())); + Assert(interpolation_matrix.n() == x_source_fe.n_dofs_per_cell(), + ExcDimensionMismatch(interpolation_matrix.m(), + x_source_fe.n_dofs_per_cell())); // Provide a short cut in case we are just inquiring the identity auto casted_fe = dynamic_cast(&x_source_fe); diff --git a/source/fe/fe_q_dg0.cc b/source/fe/fe_q_dg0.cc index 2003961a0a..3f1b209c35 100644 --- a/source/fe/fe_q_dg0.cc +++ b/source/fe/fe_q_dg0.cc @@ -55,7 +55,7 @@ FE_Q_DG0::FE_Q_DG0(const unsigned int degree) for (unsigned int d = 0; d < dim; ++d) point[d] = 0.5; this->unit_support_points.push_back(point); - AssertDimension(this->dofs_per_cell, this->unit_support_points.size()); + AssertDimension(this->n_dofs_per_cell(), this->unit_support_points.size()); } @@ -85,7 +85,7 @@ FE_Q_DG0::FE_Q_DG0(const Quadrature<1> &points) for (unsigned int d = 0; d < dim; ++d) point[d] = 0.5; this->unit_support_points.push_back(point); - AssertDimension(this->dofs_per_cell, this->unit_support_points.size()); + AssertDimension(this->n_dofs_per_cell(), this->unit_support_points.size()); } @@ -102,7 +102,7 @@ FE_Q_DG0::get_name() const bool type = true; const unsigned int n_points = this->degree + 1; std::vector points(n_points); - const unsigned int dofs_per_cell = this->dofs_per_cell; + const unsigned int dofs_per_cell = this->n_dofs_per_cell(); const std::vector> &unit_support_points = this->unit_support_points; unsigned int index = 0; @@ -187,13 +187,13 @@ FE_Q_DG0::convert_generalized_support_point_values_to_dof_values( Assert(support_point_values.size() == this->unit_support_points.size(), ExcDimensionMismatch(support_point_values.size(), this->unit_support_points.size())); - Assert(nodal_dofs.size() == this->dofs_per_cell, - ExcDimensionMismatch(nodal_dofs.size(), this->dofs_per_cell)); + Assert(nodal_dofs.size() == this->n_dofs_per_cell(), + ExcDimensionMismatch(nodal_dofs.size(), this->n_dofs_per_cell())); Assert(support_point_values[0].size() == this->n_components(), ExcDimensionMismatch(support_point_values[0].size(), this->n_components())); - for (unsigned int i = 0; i < this->dofs_per_cell - 1; ++i) + for (unsigned int i = 0; i < this->n_dofs_per_cell() - 1; ++i) { const std::pair index = this->system_to_component_index(i); @@ -220,11 +220,12 @@ FE_Q_DG0::get_interpolation_matrix( (dynamic_cast(&x_source_fe) != nullptr), (typename FiniteElement::ExcInterpolationNotImplemented())); - Assert(interpolation_matrix.m() == this->dofs_per_cell, - ExcDimensionMismatch(interpolation_matrix.m(), this->dofs_per_cell)); - Assert(interpolation_matrix.n() == x_source_fe.dofs_per_cell, + Assert(interpolation_matrix.m() == this->n_dofs_per_cell(), ExcDimensionMismatch(interpolation_matrix.m(), - x_source_fe.dofs_per_cell)); + this->n_dofs_per_cell())); + Assert(interpolation_matrix.n() == x_source_fe.n_dofs_per_cell(), + ExcDimensionMismatch(interpolation_matrix.m(), + x_source_fe.n_dofs_per_cell())); this->FE_Q_Base, dim, spacedim>:: get_interpolation_matrix(x_source_fe, interpolation_matrix); @@ -264,7 +265,7 @@ FE_Q_DG0::has_support_on_face( const unsigned int face_index) const { // discontinuous function has support on all faces - if (shape_index == this->dofs_per_cell - 1) + if (shape_index == this->n_dofs_per_cell() - 1) return true; else return FE_Q_Base, dim, spacedim>:: @@ -277,14 +278,14 @@ template std::pair, std::vector> FE_Q_DG0::get_constant_modes() const { - Table<2, bool> constant_modes(2, this->dofs_per_cell); + Table<2, bool> constant_modes(2, this->n_dofs_per_cell()); // 1 represented by FE_Q part - for (unsigned int i = 0; i < this->dofs_per_cell - 1; ++i) + for (unsigned int i = 0; i < this->n_dofs_per_cell() - 1; ++i) constant_modes(0, i) = true; // 1 represented by DG0 part - constant_modes(1, this->dofs_per_cell - 1) = true; + constant_modes(1, this->n_dofs_per_cell() - 1) = true; return std::pair, std::vector>( constant_modes, std::vector(2, 0)); diff --git a/source/fe/fe_q_hierarchical.cc b/source/fe/fe_q_hierarchical.cc index ea724014ab..d20ba0b49b 100644 --- a/source/fe/fe_q_hierarchical.cc +++ b/source/fe/fe_q_hierarchical.cc @@ -57,19 +57,20 @@ namespace internal template FE_Q_Hierarchical::FE_Q_Hierarchical(const unsigned int degree) - : FE_Poly( - TensorProductPolynomials( - Polynomials::Hierarchical::generate_complete_basis(degree)), - FiniteElementData(get_dpo_vector(degree), - 1, - degree, - FiniteElementData::H1), - std::vector( - FiniteElementData(get_dpo_vector(degree), 1, degree).dofs_per_cell, - false), - std::vector( - FiniteElementData(get_dpo_vector(degree), 1, degree).dofs_per_cell, - std::vector(1, true))) + : FE_Poly(TensorProductPolynomials( + Polynomials::Hierarchical::generate_complete_basis(degree)), + FiniteElementData(get_dpo_vector(degree), + 1, + degree, + FiniteElementData::H1), + std::vector( + FiniteElementData(get_dpo_vector(degree), 1, degree) + .n_dofs_per_cell(), + false), + std::vector( + FiniteElementData(get_dpo_vector(degree), 1, degree) + .n_dofs_per_cell(), + std::vector(1, true))) , face_renumber(face_fe_q_hierarchical_to_hierarchic_numbering(degree)) { TensorProductPolynomials *poly_space_derived_ptr = @@ -93,12 +94,12 @@ FE_Q_Hierarchical::FE_Q_Hierarchical(const unsigned int degree) // for all dimensions. std::vector> dofs_cell( GeometryInfo<1>::max_children_per_cell, - FullMatrix(2 * this->dofs_per_vertex + this->dofs_per_line, - 2 * this->dofs_per_vertex + this->dofs_per_line)); + FullMatrix(2 * this->n_dofs_per_vertex() + this->dofs_per_line, + 2 * this->n_dofs_per_vertex() + this->dofs_per_line)); std::vector> dofs_subcell( GeometryInfo<1>::max_children_per_cell, - FullMatrix(2 * this->dofs_per_vertex + this->dofs_per_line, - 2 * this->dofs_per_vertex + this->dofs_per_line)); + FullMatrix(2 * this->n_dofs_per_vertex() + this->dofs_per_line, + 2 * this->n_dofs_per_vertex() + this->dofs_per_line)); // build these fields, as they are // needed as auxiliary fields later // on @@ -157,10 +158,10 @@ FE_Q_Hierarchical::get_interpolation_matrix( { // ok, source is a Q_Hierarchical element, so we will be able to do the // work - Assert(matrix.m() == this->dofs_per_cell, - ExcDimensionMismatch(matrix.m(), this->dofs_per_cell)); - Assert(matrix.n() == source.dofs_per_cell, - ExcDimensionMismatch(matrix.m(), source_fe->dofs_per_cell)); + Assert(matrix.m() == this->n_dofs_per_cell(), + ExcDimensionMismatch(matrix.m(), this->n_dofs_per_cell())); + Assert(matrix.n() == source.n_dofs_per_cell(), + ExcDimensionMismatch(matrix.m(), source_fe->n_dofs_per_cell())); // Recall that DoFs are renumbered in the following order: // vertices, lines, quads, hexes. @@ -171,7 +172,7 @@ FE_Q_Hierarchical::get_interpolation_matrix( matrix = 0.; // distinguish between the case when we interpolate to a richer element - if (this->dofs_per_cell >= source_fe->dofs_per_cell) + if (this->n_dofs_per_cell() >= source_fe->n_dofs_per_cell()) { const std::vector dof_map = this->get_embedding_dofs(source_fe->degree); @@ -388,7 +389,8 @@ FE_Q_Hierarchical::build_dofs_cell( std::vector> &dofs_cell, std::vector> &dofs_subcell) const { - const unsigned int dofs_1d = 2 * this->dofs_per_vertex + this->dofs_per_line; + const unsigned int dofs_1d = + 2 * this->n_dofs_per_vertex() + this->dofs_per_line; // The dofs_subcell matrices are transposed // (4.19), (4.21) and (4.27),(4.28),(4.30) in @@ -501,7 +503,8 @@ void FE_Q_Hierarchical::initialize_constraints( const std::vector> &dofs_subcell) { - const unsigned int dofs_1d = 2 * this->dofs_per_vertex + this->dofs_per_line; + const unsigned int dofs_1d = + 2 * this->n_dofs_per_vertex() + this->dofs_per_line; this->interface_constraints.TableBase<2, double>::reinit( this->interface_constraints_size()); @@ -674,7 +677,8 @@ FE_Q_Hierarchical::initialize_embedding_and_restriction( { unsigned int iso = RefinementCase::isotropic_refinement - 1; - const unsigned int dofs_1d = 2 * this->dofs_per_vertex + this->dofs_per_line; + const unsigned int dofs_1d = + 2 * this->n_dofs_per_vertex() + this->dofs_per_line; TensorProductPolynomials *poly_space_derived_ptr = dynamic_cast *>(this->poly_space.get()); const std::vector &renumber = @@ -682,10 +686,10 @@ FE_Q_Hierarchical::initialize_embedding_and_restriction( for (unsigned int c = 0; c < GeometryInfo::max_children_per_cell; ++c) { - this->prolongation[iso][c].reinit(this->dofs_per_cell, - this->dofs_per_cell); - this->restriction[iso][c].reinit(this->dofs_per_cell, - this->dofs_per_cell); + this->prolongation[iso][c].reinit(this->n_dofs_per_cell(), + this->n_dofs_per_cell()); + this->restriction[iso][c].reinit(this->n_dofs_per_cell(), + this->n_dofs_per_cell()); } // the 1d case is particularly @@ -711,8 +715,8 @@ FE_Q_Hierarchical::initialize_embedding_and_restriction( // i loops over the dofs in the // parent cell. These are the // columns in the embedding matrix. - for (unsigned int j = 0; j < this->dofs_per_cell; ++j) - for (unsigned int i = 0; i < this->dofs_per_cell; ++i) + for (unsigned int j = 0; j < this->n_dofs_per_cell(); ++j) + for (unsigned int i = 0; i < this->n_dofs_per_cell(); ++i) switch (dim) { case 2: @@ -1950,7 +1954,7 @@ FE_Q_Hierarchical::hierarchic_to_fe_q_hierarchical_numbering( const FiniteElementData &fe) { Assert(fe.n_components() == 1, ExcInternalError()); - std::vector h2l(fe.dofs_per_cell); + std::vector h2l(fe.n_dofs_per_cell()); // polynomial degree const unsigned int degree = fe.dofs_per_line + 1; @@ -1974,7 +1978,7 @@ FE_Q_Hierarchical::hierarchic_to_fe_q_hierarchical_numbering( { case 1: { - for (unsigned int i = 0; i < fe.dofs_per_cell; ++i) + for (unsigned int i = 0; i < fe.n_dofs_per_cell(); ++i) h2l[i] = i; break; @@ -2020,7 +2024,7 @@ FE_Q_Hierarchical::hierarchic_to_fe_q_hierarchical_numbering( for (unsigned int j = 0; j < fe.dofs_per_line; ++j) h2l[next_index++] = (2 + i) * n + 2 + j; - Assert(next_index == fe.dofs_per_cell, ExcInternalError()); + Assert(next_index == fe.n_dofs_per_cell(), ExcInternalError()); break; } @@ -2106,7 +2110,7 @@ FE_Q_Hierarchical::hierarchic_to_fe_q_hierarchical_numbering( for (unsigned int k = 0; k < fe.dofs_per_line; ++k) h2l[next_index++] = (2 + i) * n2 + (2 + j) * n + 2 + k; - Assert(next_index == fe.dofs_per_cell, ExcInternalError()); + Assert(next_index == fe.n_dofs_per_cell(), ExcInternalError()); break; } @@ -2146,7 +2150,7 @@ bool FE_Q_Hierarchical<1>::has_support_on_face(const unsigned int shape_index, const unsigned int face_index) const { - AssertIndexRange(shape_index, this->dofs_per_cell); + AssertIndexRange(shape_index, this->n_dofs_per_cell()); AssertIndexRange(face_index, GeometryInfo<1>::faces_per_cell); @@ -2167,7 +2171,7 @@ bool FE_Q_Hierarchical::has_support_on_face(const unsigned int shape_index, const unsigned int face_index) const { - AssertIndexRange(shape_index, this->dofs_per_cell); + AssertIndexRange(shape_index, this->n_dofs_per_cell()); AssertIndexRange(face_index, GeometryInfo::faces_per_cell); // first, special-case interior @@ -2275,8 +2279,8 @@ FE_Q_Hierarchical::get_embedding_dofs(const unsigned int sub_degree) const } else if (sub_degree == this->degree) { - std::vector embedding_dofs(this->dofs_per_cell); - for (unsigned int i = 0; i < this->dofs_per_cell; ++i) + std::vector embedding_dofs(this->n_dofs_per_cell()); + for (unsigned int i = 0; i < this->n_dofs_per_cell(); ++i) embedding_dofs[i] = i; return embedding_dofs; @@ -2392,11 +2396,11 @@ template std::pair, std::vector> FE_Q_Hierarchical::get_constant_modes() const { - Table<2, bool> constant_modes(1, this->dofs_per_cell); + Table<2, bool> constant_modes(1, this->n_dofs_per_cell()); for (const unsigned int i : GeometryInfo::vertex_indices()) constant_modes(0, i) = true; for (unsigned int i = GeometryInfo::vertices_per_cell; - i < this->dofs_per_cell; + i < this->n_dofs_per_cell(); ++i) constant_modes(0, i) = false; return std::pair, std::vector>( diff --git a/source/fe/fe_q_iso_q1.cc b/source/fe/fe_q_iso_q1.cc index 9447a49032..27a01ea3ce 100644 --- a/source/fe/fe_q_iso_q1.cc +++ b/source/fe/fe_q_iso_q1.cc @@ -84,9 +84,9 @@ FE_Q_iso_Q1:: AssertDimension(support_point_values.size(), this->get_unit_support_points().size()); AssertDimension(support_point_values.size(), nodal_values.size()); - AssertDimension(this->dofs_per_cell, nodal_values.size()); + AssertDimension(this->n_dofs_per_cell(), nodal_values.size()); - for (unsigned int i = 0; i < this->dofs_per_cell; ++i) + for (unsigned int i = 0; i < this->n_dofs_per_cell(); ++i) { AssertDimension(support_point_values[i].size(), 1); diff --git a/source/fe/fe_rannacher_turek.cc b/source/fe/fe_rannacher_turek.cc index 84f532b573..cab89759c0 100644 --- a/source/fe/fe_rannacher_turek.cc +++ b/source/fe/fe_rannacher_turek.cc @@ -115,7 +115,7 @@ FE_RannacherTurek::convert_generalized_support_point_values_to_dof_values( { AssertDimension(support_point_values.size(), this->generalized_support_points.size()); - AssertDimension(nodal_values.size(), this->dofs_per_cell); + AssertDimension(nodal_values.size(), this->n_dofs_per_cell()); const unsigned int q_points_per_face = this->weights.size(); std::fill(nodal_values.begin(), nodal_values.end(), 0.0); diff --git a/source/fe/fe_raviart_thomas.cc b/source/fe/fe_raviart_thomas.cc index 47d6a43dde..a24c029a6d 100644 --- a/source/fe/fe_raviart_thomas.cc +++ b/source/fe/fe_raviart_thomas.cc @@ -58,7 +58,7 @@ FE_RaviartThomas::FE_RaviartThomas(const unsigned int deg) std::vector(dim, true))) { Assert(dim >= 2, ExcImpossibleInDim(dim)); - const unsigned int n_dofs = this->dofs_per_cell; + const unsigned int n_dofs = this->n_dofs_per_cell(); this->mapping_kind = {mapping_raviart_thomas}; // First, initialize the @@ -280,10 +280,10 @@ FE_RaviartThomas::initialize_restriction() // Store shape values, since the // evaluation suffers if not // ordered by point - Table<2, double> cached_values_on_face(this->dofs_per_cell, + Table<2, double> cached_values_on_face(this->n_dofs_per_cell(), q_face.size()); for (unsigned int k = 0; k < q_face.size(); ++k) - for (unsigned int i = 0; i < this->dofs_per_cell; ++i) + for (unsigned int i = 0; i < this->n_dofs_per_cell(); ++i) cached_values_on_face(i, k) = this->shape_value_component( i, q_face.point(k), GeometryInfo::unit_normal_direction[face]); @@ -312,7 +312,7 @@ FE_RaviartThomas::initialize_restriction() // corresponding shape // functions. for (unsigned int k = 0; k < n_face_points; ++k) - for (unsigned int i_child = 0; i_child < this->dofs_per_cell; + for (unsigned int i_child = 0; i_child < this->n_dofs_per_cell(); ++i_child) for (unsigned int i_face = 0; i_face < this->dofs_per_face; ++i_face) @@ -360,11 +360,11 @@ FE_RaviartThomas::initialize_restriction() // Store shape values, since the // evaluation suffers if not // ordered by point - Table<3, double> cached_values_on_cell(this->dofs_per_cell, + Table<3, double> cached_values_on_cell(this->n_dofs_per_cell(), q_cell.size(), dim); for (unsigned int k = 0; k < q_cell.size(); ++k) - for (unsigned int i = 0; i < this->dofs_per_cell; ++i) + for (unsigned int i = 0; i < this->n_dofs_per_cell(); ++i) for (unsigned int d = 0; d < dim; ++d) cached_values_on_cell(i, k, d) = this->shape_value_component(i, q_cell.point(k), d); @@ -375,7 +375,8 @@ FE_RaviartThomas::initialize_restriction() Quadrature q_sub = QProjector::project_to_child(q_cell, child); for (unsigned int k = 0; k < q_sub.size(); ++k) - for (unsigned int i_child = 0; i_child < this->dofs_per_cell; ++i_child) + for (unsigned int i_child = 0; i_child < this->n_dofs_per_cell(); + ++i_child) for (unsigned int d = 0; d < dim; ++d) for (unsigned int i_weight = 0; i_weight < polynomials[d]->n(); ++i_weight) @@ -417,9 +418,9 @@ template std::pair, std::vector> FE_RaviartThomas::get_constant_modes() const { - Table<2, bool> constant_modes(dim, this->dofs_per_cell); + Table<2, bool> constant_modes(dim, this->n_dofs_per_cell()); for (unsigned int d = 0; d < dim; ++d) - for (unsigned int i = 0; i < this->dofs_per_cell; ++i) + for (unsigned int i = 0; i < this->n_dofs_per_cell(); ++i) constant_modes(d, i) = true; std::vector components; for (unsigned int d = 0; d < dim; ++d) @@ -440,7 +441,7 @@ bool FE_RaviartThomas::has_support_on_face(const unsigned int shape_index, const unsigned int face_index) const { - AssertIndexRange(shape_index, this->dofs_per_cell); + AssertIndexRange(shape_index, this->n_dofs_per_cell()); AssertIndexRange(face_index, GeometryInfo::faces_per_cell); // Return computed values if we @@ -486,8 +487,8 @@ FE_RaviartThomas::convert_generalized_support_point_values_to_dof_values( Assert(support_point_values.size() == this->generalized_support_points.size(), ExcDimensionMismatch(support_point_values.size(), this->generalized_support_points.size())); - Assert(nodal_values.size() == this->dofs_per_cell, - ExcDimensionMismatch(nodal_values.size(), this->dofs_per_cell)); + Assert(nodal_values.size() == this->n_dofs_per_cell(), + ExcDimensionMismatch(nodal_values.size(), this->n_dofs_per_cell())); Assert(support_point_values[0].size() == this->n_components(), ExcDimensionMismatch(support_point_values[0].size(), this->n_components())); diff --git a/source/fe/fe_raviart_thomas_nodal.cc b/source/fe/fe_raviart_thomas_nodal.cc index 895ba4c29d..8e5f9161e2 100644 --- a/source/fe/fe_raviart_thomas_nodal.cc +++ b/source/fe/fe_raviart_thomas_nodal.cc @@ -49,7 +49,7 @@ FE_RaviartThomasNodal::FE_RaviartThomasNodal(const unsigned int deg) std::vector(dim, true))) { Assert(dim >= 2, ExcImpossibleInDim(dim)); - const unsigned int n_dofs = this->dofs_per_cell; + const unsigned int n_dofs = this->n_dofs_per_cell(); this->mapping_kind = {mapping_raviart_thomas}; // First, initialize the @@ -147,7 +147,7 @@ template void FE_RaviartThomasNodal::initialize_support_points(const unsigned int deg) { - this->generalized_support_points.resize(this->dofs_per_cell); + this->generalized_support_points.resize(this->n_dofs_per_cell()); this->generalized_face_support_points.resize(this->dofs_per_face); // Number of the point being entered @@ -211,7 +211,7 @@ FE_RaviartThomasNodal::initialize_support_points(const unsigned int deg) for (unsigned int k = 0; k < quadrature->size(); ++k) this->generalized_support_points[current++] = quadrature->point(k); } - Assert(current == this->dofs_per_cell, ExcInternalError()); + Assert(current == this->n_dofs_per_cell(), ExcInternalError()); } @@ -278,7 +278,7 @@ FE_RaviartThomasNodal::has_support_on_face( const unsigned int shape_index, const unsigned int face_index) const { - AssertIndexRange(shape_index, this->dofs_per_cell); + AssertIndexRange(shape_index, this->n_dofs_per_cell()); AssertIndexRange(face_index, GeometryInfo::faces_per_cell); // The first degrees of freedom are @@ -310,8 +310,8 @@ FE_RaviartThomasNodal:: Assert(support_point_values.size() == this->generalized_support_points.size(), ExcDimensionMismatch(support_point_values.size(), this->generalized_support_points.size())); - Assert(nodal_values.size() == this->dofs_per_cell, - ExcDimensionMismatch(nodal_values.size(), this->dofs_per_cell)); + Assert(nodal_values.size() == this->n_dofs_per_cell(), + ExcDimensionMismatch(nodal_values.size(), this->n_dofs_per_cell())); Assert(support_point_values[0].size() == this->n_components(), ExcDimensionMismatch(support_point_values[0].size(), this->n_components())); @@ -334,11 +334,11 @@ FE_RaviartThomasNodal:: // The remaining points form dim // chunks, one for each component. - const unsigned int istep = (this->dofs_per_cell - fbase) / dim; - Assert((this->dofs_per_cell - fbase) % dim == 0, ExcInternalError()); + const unsigned int istep = (this->n_dofs_per_cell() - fbase) / dim; + Assert((this->n_dofs_per_cell() - fbase) % dim == 0, ExcInternalError()); f = 0; - while (fbase < this->dofs_per_cell) + while (fbase < this->n_dofs_per_cell()) { for (unsigned int i = 0; i < istep; ++i) { @@ -347,7 +347,7 @@ FE_RaviartThomasNodal:: fbase += istep; ++f; } - Assert(fbase == this->dofs_per_cell, ExcInternalError()); + Assert(fbase == this->n_dofs_per_cell(), ExcInternalError()); } diff --git a/source/fe/fe_rt_bubbles.cc b/source/fe/fe_rt_bubbles.cc index beb7e69407..d4d3554fcc 100644 --- a/source/fe/fe_rt_bubbles.cc +++ b/source/fe/fe_rt_bubbles.cc @@ -52,7 +52,7 @@ FE_RT_Bubbles::FE_RT_Bubbles(const unsigned int deg) deg >= 1, ExcMessage( "Lowest order RT_Bubbles element is degree 1, but you requested for degree 0")); - const unsigned int n_dofs = this->dofs_per_cell; + const unsigned int n_dofs = this->n_dofs_per_cell(); this->mapping_kind = {mapping_raviart_thomas}; // Initialize support points and quadrature weights @@ -131,7 +131,7 @@ template void FE_RT_Bubbles::initialize_support_points(const unsigned int deg) { - this->generalized_support_points.resize(this->dofs_per_cell); + this->generalized_support_points.resize(this->n_dofs_per_cell()); this->generalized_face_support_points.resize(this->dofs_per_face); // Index of the point being entered @@ -197,7 +197,7 @@ FE_RT_Bubbles::initialize_support_points(const unsigned int deg) for (unsigned int k = 0; k < quadrature->size(); ++k) this->generalized_support_points[current++] = quadrature->point(k); } - Assert(current == this->dofs_per_cell, ExcInternalError()); + Assert(current == this->n_dofs_per_cell(), ExcInternalError()); } @@ -266,8 +266,8 @@ FE_RT_Bubbles::convert_generalized_support_point_values_to_dof_values( Assert(support_point_values.size() == this->generalized_support_points.size(), ExcDimensionMismatch(support_point_values.size(), this->generalized_support_points.size())); - Assert(nodal_values.size() == this->dofs_per_cell, - ExcDimensionMismatch(nodal_values.size(), this->dofs_per_cell)); + Assert(nodal_values.size() == this->n_dofs_per_cell(), + ExcDimensionMismatch(nodal_values.size(), this->n_dofs_per_cell())); Assert(support_point_values[0].size() == this->n_components(), ExcDimensionMismatch(support_point_values[0].size(), this->n_components())); @@ -287,11 +287,11 @@ FE_RT_Bubbles::convert_generalized_support_point_values_to_dof_values( } // The remaining points form dim chunks, one for each component. - const unsigned int istep = (this->dofs_per_cell - fbase) / dim; - Assert((this->dofs_per_cell - fbase) % dim == 0, ExcInternalError()); + const unsigned int istep = (this->n_dofs_per_cell() - fbase) / dim; + Assert((this->n_dofs_per_cell() - fbase) % dim == 0, ExcInternalError()); f = 0; - while (fbase < this->dofs_per_cell) + while (fbase < this->n_dofs_per_cell()) { for (unsigned int i = 0; i < istep; ++i) { @@ -300,7 +300,7 @@ FE_RT_Bubbles::convert_generalized_support_point_values_to_dof_values( fbase += istep; ++f; } - Assert(fbase == this->dofs_per_cell, ExcInternalError()); + Assert(fbase == this->n_dofs_per_cell(), ExcInternalError()); } diff --git a/source/fe/fe_series_fourier.cc b/source/fe/fe_series_fourier.cc index 814592253b..5fb7aede3b 100644 --- a/source/fe/fe_series_fourier.cc +++ b/source/fe/fe_series_fourier.cc @@ -97,11 +97,12 @@ namespace if (fourier_transform_matrices[fe].m() == 0) { - fourier_transform_matrices[fe].reinit(n_coefficients_per_direction[fe], - fe_collection[fe].dofs_per_cell); + fourier_transform_matrices[fe].reinit( + n_coefficients_per_direction[fe], + fe_collection[fe].n_dofs_per_cell()); for (unsigned int k = 0; k < n_coefficients_per_direction[fe]; ++k) - for (unsigned int j = 0; j < fe_collection[fe].dofs_per_cell; ++j) + for (unsigned int j = 0; j < fe_collection[fe].n_dofs_per_cell(); ++j) fourier_transform_matrices[fe](k, j) = integrate(fe_collection[fe], q_collection[fe], k_vectors(k), j); } @@ -123,13 +124,14 @@ namespace { fourier_transform_matrices[fe].reinit( Utilities::fixed_power<2>(n_coefficients_per_direction[fe]), - fe_collection[fe].dofs_per_cell); + fe_collection[fe].n_dofs_per_cell()); unsigned int k = 0; for (unsigned int k1 = 0; k1 < n_coefficients_per_direction[fe]; ++k1) for (unsigned int k2 = 0; k2 < n_coefficients_per_direction[fe]; ++k2, ++k) - for (unsigned int j = 0; j < fe_collection[fe].dofs_per_cell; ++j) + for (unsigned int j = 0; j < fe_collection[fe].n_dofs_per_cell(); + ++j) fourier_transform_matrices[fe](k, j) = integrate( fe_collection[fe], q_collection[fe], k_vectors(k1, k2), j); } @@ -151,14 +153,15 @@ namespace { fourier_transform_matrices[fe].reinit( Utilities::fixed_power<3>(n_coefficients_per_direction[fe]), - fe_collection[fe].dofs_per_cell); + fe_collection[fe].n_dofs_per_cell()); unsigned int k = 0; for (unsigned int k1 = 0; k1 < n_coefficients_per_direction[fe]; ++k1) for (unsigned int k2 = 0; k2 < n_coefficients_per_direction[fe]; ++k2) for (unsigned int k3 = 0; k3 < n_coefficients_per_direction[fe]; ++k3, ++k) - for (unsigned int j = 0; j < fe_collection[fe].dofs_per_cell; ++j) + for (unsigned int j = 0; j < fe_collection[fe].n_dofs_per_cell(); + ++j) fourier_transform_matrices[fe](k, j) = integrate(fe_collection[fe], q_collection[fe], diff --git a/source/fe/fe_series_legendre.cc b/source/fe/fe_series_legendre.cc index 17e1a7739b..c2c63f0923 100644 --- a/source/fe/fe_series_legendre.cc +++ b/source/fe/fe_series_legendre.cc @@ -118,11 +118,12 @@ namespace if (legendre_transform_matrices[fe].m() == 0) { - legendre_transform_matrices[fe].reinit(n_coefficients_per_direction[fe], - fe_collection[fe].dofs_per_cell); + legendre_transform_matrices[fe].reinit( + n_coefficients_per_direction[fe], + fe_collection[fe].n_dofs_per_cell()); for (unsigned int k = 0; k < n_coefficients_per_direction[fe]; ++k) - for (unsigned int j = 0; j < fe_collection[fe].dofs_per_cell; ++j) + for (unsigned int j = 0; j < fe_collection[fe].n_dofs_per_cell(); ++j) legendre_transform_matrices[fe](k, j) = integrate( fe_collection[fe], q_collection[fe], TableIndices<1>(k), j); } @@ -143,13 +144,14 @@ namespace { legendre_transform_matrices[fe].reinit( Utilities::fixed_power<2>(n_coefficients_per_direction[fe]), - fe_collection[fe].dofs_per_cell); + fe_collection[fe].n_dofs_per_cell()); unsigned int k = 0; for (unsigned int k1 = 0; k1 < n_coefficients_per_direction[fe]; ++k1) for (unsigned int k2 = 0; k2 < n_coefficients_per_direction[fe]; ++k2, k++) - for (unsigned int j = 0; j < fe_collection[fe].dofs_per_cell; ++j) + for (unsigned int j = 0; j < fe_collection[fe].n_dofs_per_cell(); + ++j) legendre_transform_matrices[fe](k, j) = integrate(fe_collection[fe], q_collection[fe], @@ -173,14 +175,15 @@ namespace { legendre_transform_matrices[fe].reinit( Utilities::fixed_power<3>(n_coefficients_per_direction[fe]), - fe_collection[fe].dofs_per_cell); + fe_collection[fe].n_dofs_per_cell()); unsigned int k = 0; for (unsigned int k1 = 0; k1 < n_coefficients_per_direction[fe]; ++k1) for (unsigned int k2 = 0; k2 < n_coefficients_per_direction[fe]; ++k2) for (unsigned int k3 = 0; k3 < n_coefficients_per_direction[fe]; ++k3, k++) - for (unsigned int j = 0; j < fe_collection[fe].dofs_per_cell; ++j) + for (unsigned int j = 0; j < fe_collection[fe].n_dofs_per_cell(); + ++j) legendre_transform_matrices[fe](k, j) = integrate(fe_collection[fe], q_collection[fe], diff --git a/source/fe/fe_system.cc b/source/fe/fe_system.cc index c7cbacd625..c65c2b99ce 100644 --- a/source/fe/fe_system.cc +++ b/source/fe/fe_system.cc @@ -386,7 +386,7 @@ double FESystem::shape_value(const unsigned int i, const Point & p) const { - AssertIndexRange(i, this->dofs_per_cell); + AssertIndexRange(i, this->n_dofs_per_cell()); Assert(this->is_primitive(i), (typename FiniteElement::ExcShapeFunctionNotPrimitive( i))); @@ -404,7 +404,7 @@ FESystem::shape_value_component( const Point & p, const unsigned int component) const { - AssertIndexRange(i, this->dofs_per_cell); + AssertIndexRange(i, this->n_dofs_per_cell()); AssertIndexRange(component, this->n_components()); // if this value is supposed to be @@ -438,7 +438,7 @@ Tensor<1, dim> FESystem::shape_grad(const unsigned int i, const Point & p) const { - AssertIndexRange(i, this->dofs_per_cell); + AssertIndexRange(i, this->n_dofs_per_cell()); Assert(this->is_primitive(i), (typename FiniteElement::ExcShapeFunctionNotPrimitive( i))); @@ -456,7 +456,7 @@ FESystem::shape_grad_component( const Point & p, const unsigned int component) const { - AssertIndexRange(i, this->dofs_per_cell); + AssertIndexRange(i, this->n_dofs_per_cell()); AssertIndexRange(component, this->n_components()); // if this value is supposed to be zero, then return right away... @@ -483,7 +483,7 @@ Tensor<2, dim> FESystem::shape_grad_grad(const unsigned int i, const Point & p) const { - AssertIndexRange(i, this->dofs_per_cell); + AssertIndexRange(i, this->n_dofs_per_cell()); Assert(this->is_primitive(i), (typename FiniteElement::ExcShapeFunctionNotPrimitive( i))); @@ -501,7 +501,7 @@ FESystem::shape_grad_grad_component( const Point & p, const unsigned int component) const { - AssertIndexRange(i, this->dofs_per_cell); + AssertIndexRange(i, this->n_dofs_per_cell()); AssertIndexRange(component, this->n_components()); // if this value is supposed to be zero, then return right away... @@ -528,7 +528,7 @@ Tensor<3, dim> FESystem::shape_3rd_derivative(const unsigned int i, const Point & p) const { - AssertIndexRange(i, this->dofs_per_cell); + AssertIndexRange(i, this->n_dofs_per_cell()); Assert(this->is_primitive(i), (typename FiniteElement::ExcShapeFunctionNotPrimitive( i))); @@ -546,7 +546,7 @@ FESystem::shape_3rd_derivative_component( const Point & p, const unsigned int component) const { - AssertIndexRange(i, this->dofs_per_cell); + AssertIndexRange(i, this->n_dofs_per_cell()); AssertIndexRange(component, this->n_components()); // if this value is supposed to be zero, then return right away... @@ -573,7 +573,7 @@ Tensor<4, dim> FESystem::shape_4th_derivative(const unsigned int i, const Point & p) const { - AssertIndexRange(i, this->dofs_per_cell); + AssertIndexRange(i, this->n_dofs_per_cell()); Assert(this->is_primitive(i), (typename FiniteElement::ExcShapeFunctionNotPrimitive( i))); @@ -591,7 +591,7 @@ FESystem::shape_4th_derivative_component( const Point & p, const unsigned int component) const { - AssertIndexRange(i, this->dofs_per_cell); + AssertIndexRange(i, this->n_dofs_per_cell()); AssertIndexRange(component, this->n_components()); // if this value is supposed to be zero, then return right away... @@ -623,13 +623,14 @@ FESystem::get_interpolation_matrix( // reasons, if you call matrix.reinit(8,0), it sets the sizes // to m==n==0 internally. this may happen when we use a FE_Nothing, // so write the test in a more lenient way - Assert((interpolation_matrix.m() == this->dofs_per_cell) || - (x_source_fe.dofs_per_cell == 0), - ExcDimensionMismatch(interpolation_matrix.m(), this->dofs_per_cell)); - Assert((interpolation_matrix.n() == x_source_fe.dofs_per_cell) || - (this->dofs_per_cell == 0), + Assert((interpolation_matrix.m() == this->n_dofs_per_cell()) || + (x_source_fe.n_dofs_per_cell() == 0), ExcDimensionMismatch(interpolation_matrix.m(), - x_source_fe.dofs_per_cell)); + this->n_dofs_per_cell())); + Assert((interpolation_matrix.n() == x_source_fe.n_dofs_per_cell()) || + (this->n_dofs_per_cell() == 0), + ExcDimensionMismatch(interpolation_matrix.m(), + x_source_fe.n_dofs_per_cell())); // there are certain conditions that the two elements have to satisfy so // that this can work. @@ -667,8 +668,8 @@ FESystem::get_interpolation_matrix( std::vector> base_matrices(this->n_base_elements()); for (unsigned int i = 0; i < this->n_base_elements(); ++i) { - base_matrices[i].reinit(base_element(i).dofs_per_cell, - source_fe.base_element(i).dofs_per_cell); + base_matrices[i].reinit(base_element(i).n_dofs_per_cell(), + source_fe.base_element(i).n_dofs_per_cell()); base_element(i).get_interpolation_matrix(source_fe.base_element(i), base_matrices[i]); } @@ -677,8 +678,8 @@ FESystem::get_interpolation_matrix( // different bases (or multiplicity indices) are really zero. then assign // entries interpolation_matrix = 0; - for (unsigned int i = 0; i < this->dofs_per_cell; ++i) - for (unsigned int j = 0; j < source_fe.dofs_per_cell; ++j) + for (unsigned int i = 0; i < this->n_dofs_per_cell(); ++i) + for (unsigned int j = 0; j < source_fe.n_dofs_per_cell(); ++j) if (this->system_to_base_table[i].first == source_fe.system_to_base_table[j].first) interpolation_matrix(i, j) = @@ -709,7 +710,7 @@ FESystem::get_restriction_matrix( // check if updated while waiting for lock if (this->restriction[refinement_case - 1][child].n() == - this->dofs_per_cell) + this->n_dofs_per_cell()) return this->restriction[refinement_case - 1][child]; // Check if some of the matrices of the base elements are void. @@ -723,7 +724,7 @@ FESystem::get_restriction_matrix( { base_matrices[i] = &base_element(i).get_restriction_matrix(child, refinement_case); - if (base_matrices[i]->n() != base_element(i).dofs_per_cell) + if (base_matrices[i]->n() != base_element(i).n_dofs_per_cell()) do_restriction = false; } Assert(do_restriction, @@ -732,8 +733,8 @@ FESystem::get_restriction_matrix( // if we did not encounter void matrices, initialize the matrix sizes if (do_restriction) { - FullMatrix restriction(this->dofs_per_cell, - this->dofs_per_cell); + FullMatrix restriction(this->n_dofs_per_cell(), + this->n_dofs_per_cell()); // distribute the matrices of the base finite elements to the // matrices of this object. for this, loop over all degrees of @@ -743,8 +744,8 @@ FESystem::get_restriction_matrix( // note that we by definition of a base element, they are // independent, i.e. do not couple. only DoFs that belong to the // same instance of a base element may couple - for (unsigned int i = 0; i < this->dofs_per_cell; ++i) - for (unsigned int j = 0; j < this->dofs_per_cell; ++j) + for (unsigned int i = 0; i < this->n_dofs_per_cell(); ++i) + for (unsigned int j = 0; j < this->n_dofs_per_cell(); ++j) { // first find out to which base element indices i and j // belong, and which instance thereof in case the base element @@ -800,7 +801,7 @@ FESystem::get_prolongation_matrix( std::lock_guard lock(this->mutex); if (this->prolongation[refinement_case - 1][child].n() == - this->dofs_per_cell) + this->n_dofs_per_cell()) return this->prolongation[refinement_case - 1][child]; bool do_prolongation = true; @@ -810,7 +811,7 @@ FESystem::get_prolongation_matrix( { base_matrices[i] = &base_element(i).get_prolongation_matrix(child, refinement_case); - if (base_matrices[i]->n() != base_element(i).dofs_per_cell) + if (base_matrices[i]->n() != base_element(i).n_dofs_per_cell()) do_prolongation = false; } Assert(do_prolongation, @@ -818,11 +819,11 @@ FESystem::get_prolongation_matrix( if (do_prolongation) { - FullMatrix prolongate(this->dofs_per_cell, - this->dofs_per_cell); + FullMatrix prolongate(this->n_dofs_per_cell(), + this->n_dofs_per_cell()); - for (unsigned int i = 0; i < this->dofs_per_cell; ++i) - for (unsigned int j = 0; j < this->dofs_per_cell; ++j) + for (unsigned int i = 0; i < this->n_dofs_per_cell(); ++i) + for (unsigned int j = 0; j < this->n_dofs_per_cell(); ++j) { if (this->system_to_base_table[i].first != this->system_to_base_table[j].first) @@ -875,7 +876,7 @@ FESystem::face_to_cell_index(const unsigned int face_dof_index, // to the one we're interested in -- crude, maybe, but works for now const std::pair, unsigned int> target = std::make_pair(face_base_index.first, base_face_to_cell_index); - for (unsigned int i = 0; i < this->dofs_per_cell; ++i) + for (unsigned int i = 0; i < this->n_dofs_per_cell(); ++i) if (this->system_to_base_index(i) == target) return i; @@ -1324,13 +1325,15 @@ FESystem::compute_fill( // also in case we detected a cell similarity (but no heavy work will // be done inside the individual elements in case we have a // translation and simple elements). - for (unsigned int system_index = 0; system_index < this->dofs_per_cell; + for (unsigned int system_index = 0; + system_index < this->n_dofs_per_cell(); ++system_index) if (this->system_to_base_table[system_index].first.first == base_no) { const unsigned int base_index = this->system_to_base_table[system_index].second; - Assert(base_index < base_fe.dofs_per_cell, ExcInternalError()); + Assert(base_index < base_fe.n_dofs_per_cell(), + ExcInternalError()); // now copy. if the shape function is primitive, then there // is only one value to be copied, but for non-primitive @@ -1441,15 +1444,15 @@ FESystem::build_interface_constraints() // order is the same as for the first vertex of the whole cell, // so we can use the system_to_base_table variable (using the // face_s_t_base_t function would yield the same) - if (m < this->dofs_per_vertex) + if (m < this->n_dofs_per_vertex()) m_index = this->system_to_base_table[m]; else // then come the two sets of line indices { const unsigned int index_in_line = - (m - this->dofs_per_vertex) % this->dofs_per_line; + (m - this->n_dofs_per_vertex()) % this->dofs_per_line; const unsigned int sub_line = - (m - this->dofs_per_vertex) / this->dofs_per_line; + (m - this->n_dofs_per_vertex()) / this->dofs_per_line; Assert(sub_line < 2, ExcInternalError()); // from this information, try to get base element and @@ -1457,7 +1460,7 @@ FESystem::build_interface_constraints() // corresponding face index of m in the present element, // then use face_system_to_base_table const unsigned int tmp1 = - 2 * this->dofs_per_vertex + index_in_line; + 2 * this->n_dofs_per_vertex() + index_in_line; m_index.first = this->face_system_to_base_table[tmp1].first; // what we are still missing is the index of m within the @@ -1469,18 +1472,18 @@ FESystem::build_interface_constraints() // dof, we can construct the rest: tmp2 will denote the // index of this shape function among the line shape // functions: - Assert( - this->face_system_to_base_table[tmp1].second >= - 2 * base_element(m_index.first.first).dofs_per_vertex, - ExcInternalError()); + Assert(this->face_system_to_base_table[tmp1].second >= + 2 * base_element(m_index.first.first) + .n_dofs_per_vertex(), + ExcInternalError()); const unsigned int tmp2 = this->face_system_to_base_table[tmp1].second - - 2 * base_element(m_index.first.first).dofs_per_vertex; + 2 * base_element(m_index.first.first).n_dofs_per_vertex(); Assert(tmp2 < base_element(m_index.first.first).dofs_per_line, ExcInternalError()); m_index.second = - base_element(m_index.first.first).dofs_per_vertex + + base_element(m_index.first.first).n_dofs_per_vertex() + base_element(m_index.first.first).dofs_per_line * sub_line + tmp2; @@ -1495,35 +1498,37 @@ FESystem::build_interface_constraints() // the indices m=0..5*d_v-1 are from the center and the four // subline vertices. their order is the same as for the first // vertex of the whole cell, so we can use the simple arithmetic - if (m < 5 * this->dofs_per_vertex) + if (m < 5 * this->n_dofs_per_vertex()) m_index = this->system_to_base_table[m]; else // then come the 12 sets of line indices - if (m < 5 * this->dofs_per_vertex + 12 * this->dofs_per_line) + if (m < + 5 * this->n_dofs_per_vertex() + 12 * this->dofs_per_line) { // for the meaning of all this, see the 2d part const unsigned int index_in_line = - (m - 5 * this->dofs_per_vertex) % this->dofs_per_line; + (m - 5 * this->n_dofs_per_vertex()) % this->dofs_per_line; const unsigned int sub_line = - (m - 5 * this->dofs_per_vertex) / this->dofs_per_line; + (m - 5 * this->n_dofs_per_vertex()) / this->dofs_per_line; Assert(sub_line < 12, ExcInternalError()); const unsigned int tmp1 = - 4 * this->dofs_per_vertex + index_in_line; + 4 * this->n_dofs_per_vertex() + index_in_line; m_index.first = this->face_system_to_base_table[tmp1].first; - Assert( - this->face_system_to_base_table[tmp1].second >= - 4 * base_element(m_index.first.first).dofs_per_vertex, - ExcInternalError()); + Assert(this->face_system_to_base_table[tmp1].second >= + 4 * base_element(m_index.first.first) + .n_dofs_per_vertex(), + ExcInternalError()); const unsigned int tmp2 = this->face_system_to_base_table[tmp1].second - - 4 * base_element(m_index.first.first).dofs_per_vertex; + 4 * base_element(m_index.first.first).n_dofs_per_vertex(); Assert(tmp2 < base_element(m_index.first.first).dofs_per_line, ExcInternalError()); m_index.second = - 5 * base_element(m_index.first.first).dofs_per_vertex + + 5 * + base_element(m_index.first.first).n_dofs_per_vertex() + base_element(m_index.first.first).dofs_per_line * sub_line + tmp2; @@ -1533,18 +1538,18 @@ FESystem::build_interface_constraints() { // for the meaning of all this, see the 2d part const unsigned int index_in_quad = - (m - 5 * this->dofs_per_vertex - + (m - 5 * this->n_dofs_per_vertex() - 12 * this->dofs_per_line) % this->dofs_per_quad; Assert(index_in_quad < this->dofs_per_quad, ExcInternalError()); const unsigned int sub_quad = - ((m - 5 * this->dofs_per_vertex - + ((m - 5 * this->n_dofs_per_vertex() - 12 * this->dofs_per_line) / this->dofs_per_quad); Assert(sub_quad < 4, ExcInternalError()); - const unsigned int tmp1 = 4 * this->dofs_per_vertex + + const unsigned int tmp1 = 4 * this->n_dofs_per_vertex() + 4 * this->dofs_per_line + index_in_quad; Assert(tmp1 < this->face_system_to_base_table.size(), @@ -1553,18 +1558,21 @@ FESystem::build_interface_constraints() Assert( this->face_system_to_base_table[tmp1].second >= - 4 * base_element(m_index.first.first).dofs_per_vertex + + 4 * base_element(m_index.first.first) + .n_dofs_per_vertex() + 4 * base_element(m_index.first.first).dofs_per_line, ExcInternalError()); const unsigned int tmp2 = this->face_system_to_base_table[tmp1].second - - 4 * base_element(m_index.first.first).dofs_per_vertex - + 4 * + base_element(m_index.first.first).n_dofs_per_vertex() - 4 * base_element(m_index.first.first).dofs_per_line; Assert(tmp2 < base_element(m_index.first.first).dofs_per_quad, ExcInternalError()); m_index.second = - 5 * base_element(m_index.first.first).dofs_per_vertex + + 5 * + base_element(m_index.first.first).n_dofs_per_vertex() + 12 * base_element(m_index.first.first).dofs_per_line + base_element(m_index.first.first).dofs_per_quad * sub_quad + @@ -1634,7 +1642,7 @@ FESystem::initialize( { // If the system is not primitive, these have not been initialized by // FiniteElement - this->system_to_component_table.resize(this->dofs_per_cell); + this->system_to_component_table.resize(this->n_dofs_per_cell()); this->face_system_to_component_table.resize(this->dofs_per_face); FETools::Compositing::build_cell_tables(this->system_to_base_table, @@ -1664,16 +1672,16 @@ FESystem::initialize( // logic. for (unsigned int base_el = 0; base_el < this->n_base_elements(); ++base_el) if (!base_element(base_el).has_support_points() && - base_element(base_el).dofs_per_cell != 0) + base_element(base_el).n_dofs_per_cell() != 0) { this->unit_support_points.resize(0); return; } // generate unit support points from unit support points of sub elements - this->unit_support_points.resize(this->dofs_per_cell); + this->unit_support_points.resize(this->n_dofs_per_cell()); - for (unsigned int i = 0; i < this->dofs_per_cell; ++i) + for (unsigned int i = 0; i < this->n_dofs_per_cell(); ++i) { const unsigned int base = this->system_to_base_table[i].first.first, base_index = this->system_to_base_table[i].second; @@ -2308,8 +2316,8 @@ template Point FESystem::unit_support_point(const unsigned int index) const { - AssertIndexRange(index, this->dofs_per_cell); - Assert((this->unit_support_points.size() == this->dofs_per_cell) || + AssertIndexRange(index, this->n_dofs_per_cell()); + Assert((this->unit_support_points.size() == this->n_dofs_per_cell()) || (this->unit_support_points.size() == 0), (typename FiniteElement::ExcFEHasNoSupportPoints())); @@ -2354,7 +2362,7 @@ FESystem::get_constant_modes() const // Note that this->n_components() is actually only an estimate of how many // constant modes we will need. There might be more than one such mode // (e.g. FE_Q_DG0). - Table<2, bool> constant_modes(this->n_components(), this->dofs_per_cell); + Table<2, bool> constant_modes(this->n_components(), this->n_dofs_per_cell()); std::vector components; for (unsigned int i = 0; i < base_elements.size(); ++i) { @@ -2374,14 +2382,14 @@ FESystem::get_constant_modes() const element_multiplicity, constant_modes.n_cols()); for (unsigned int r = 0; r < comp; ++r) - for (unsigned int c = 0; c < this->dofs_per_cell; ++c) + for (unsigned int c = 0; c < this->n_dofs_per_cell(); ++c) new_constant_modes(r, c) = constant_modes(r, c); constant_modes.swap(new_constant_modes); } // next, fill the constant modes from the individual components as well // as the component numbers corresponding to the constant mode rows - for (unsigned int k = 0; k < this->dofs_per_cell; ++k) + for (unsigned int k = 0; k < this->n_dofs_per_cell(); ++k) { std::pair, unsigned int> ind = this->system_to_base_index(k); @@ -2414,7 +2422,7 @@ FESystem::convert_generalized_support_point_values_to_dof_values( AssertDimension(point_values.size(), this->get_generalized_support_points().size()); - AssertDimension(dof_values.size(), this->dofs_per_cell); + AssertDimension(dof_values.size(), this->n_dofs_per_cell()); std::vector base_dof_values; std::vector> base_point_values; @@ -2430,7 +2438,7 @@ FESystem::convert_generalized_support_point_values_to_dof_values( // number of components we're dealing with. const auto & base_element = this->base_element(base); const unsigned int multiplicity = this->element_multiplicity(base); - const unsigned int n_base_dofs = base_element.dofs_per_cell; + const unsigned int n_base_dofs = base_element.n_dofs_per_cell(); const unsigned int n_base_components = base_element.n_components(); // If the number of base degrees of freedom is zero, there is nothing @@ -2481,7 +2489,7 @@ FESystem::convert_generalized_support_point_values_to_dof_values( // function, but that doesn't exist -- just do it by using the // reverse table -- the amount of work done here is not worth // trying to optimizing this. - for (unsigned int i = 0; i < this->dofs_per_cell; ++i) + for (unsigned int i = 0; i < this->n_dofs_per_cell(); ++i) if (this->system_to_base_index(i).first == std::make_pair(base, m)) dof_values[i] = @@ -2498,7 +2506,7 @@ FESystem::convert_generalized_support_point_values_to_dof_values( // reverse table -- the amount of work done here is not worth // trying to optimizing this. for (unsigned int m = 0; m < multiplicity; ++m) - for (unsigned int i = 0; i < this->dofs_per_cell; ++i) + for (unsigned int i = 0; i < this->n_dofs_per_cell(); ++i) if (this->system_to_base_index(i).first == std::make_pair(base, m)) dof_values[i] = std::numeric_limits::signaling_NaN(); diff --git a/source/fe/fe_trace.cc b/source/fe/fe_trace.cc index ff99eddce9..f1e4fc545f 100644 --- a/source/fe/fe_trace.cc +++ b/source/fe/fe_trace.cc @@ -59,8 +59,8 @@ FE_TraceQ::FE_TraceQ(const unsigned int degree) // initialize unit support points (this makes it possible to assign initial // values to FE_TraceQ). Note that we simply take the points of fe_q but // skip the last ones which are associated with the interior of FE_Q. - this->unit_support_points.resize(this->dofs_per_cell); - for (unsigned int i = 0; i < this->dofs_per_cell; ++i) + this->unit_support_points.resize(this->n_dofs_per_cell()); + for (unsigned int i = 0; i < this->n_dofs_per_cell(); ++i) this->unit_support_points[i] = fe_q.get_unit_support_points()[i]; // Initialize constraint matrices @@ -101,14 +101,14 @@ FE_TraceQ::has_support_on_face( const unsigned int shape_index, const unsigned int face_index) const { - AssertIndexRange(shape_index, this->dofs_per_cell); + AssertIndexRange(shape_index, this->n_dofs_per_cell()); AssertIndexRange(face_index, GeometryInfo::faces_per_cell); // FE_TraceQ shares the numbering of elemental degrees of freedom with FE_Q // except for the missing interior ones (quad dofs in 2D and hex dofs in // 3D). Therefore, it is safe to ask fe_q for the corresponding - // information. The assertion 'shape_index < this->dofs_per_cell' will make - // sure that we only access the trace dofs. + // information. The assertion 'shape_index < this->n_dofs_per_cell()' will + // make sure that we only access the trace dofs. return fe_q.has_support_on_face(shape_index, face_index); } @@ -118,8 +118,8 @@ template std::pair, std::vector> FE_TraceQ::get_constant_modes() const { - Table<2, bool> constant_modes(1, this->dofs_per_cell); - for (unsigned int i = 0; i < this->dofs_per_cell; ++i) + Table<2, bool> constant_modes(1, this->n_dofs_per_cell()); + for (unsigned int i = 0; i < this->n_dofs_per_cell(); ++i) constant_modes(0, i) = true; return std::pair, std::vector>( constant_modes, std::vector(1, 0)); @@ -135,9 +135,9 @@ FE_TraceQ:: AssertDimension(support_point_values.size(), this->get_unit_support_points().size()); AssertDimension(support_point_values.size(), nodal_values.size()); - AssertDimension(this->dofs_per_cell, nodal_values.size()); + AssertDimension(this->n_dofs_per_cell(), nodal_values.size()); - for (unsigned int i = 0; i < this->dofs_per_cell; ++i) + for (unsigned int i = 0; i < this->n_dofs_per_cell(); ++i) { AssertDimension(support_point_values[i].size(), 1); diff --git a/source/fe/fe_values.cc b/source/fe/fe_values.cc index a8cdac76fc..30a696b15f 100644 --- a/source/fe/fe_values.cc +++ b/source/fe/fe_values.cc @@ -79,9 +79,9 @@ namespace internal make_shape_function_to_row_table(const FiniteElement &fe) { std::vector shape_function_to_row_table( - fe.dofs_per_cell * fe.n_components(), numbers::invalid_unsigned_int); + fe.n_dofs_per_cell() * fe.n_components(), numbers::invalid_unsigned_int); unsigned int row = 0; - for (unsigned int i = 0; i < fe.dofs_per_cell; ++i) + for (unsigned int i = 0; i < fe.n_dofs_per_cell(); ++i) { // loop over all components that are nonzero for this particular // shape function. if a component is zero then we leave the @@ -144,7 +144,7 @@ namespace FEValuesViews const unsigned int component) : fe_values(&fe_values) , component(component) - , shape_function_data(this->fe_values->fe->dofs_per_cell) + , shape_function_data(this->fe_values->fe->n_dofs_per_cell()) { const FiniteElement &fe = *this->fe_values->fe; AssertIndexRange(component, fe.n_components()); @@ -155,7 +155,7 @@ namespace FEValuesViews const std::vector shape_function_to_row_table = dealii::internal::make_shape_function_to_row_table(fe); - for (unsigned int i = 0; i < fe.dofs_per_cell; ++i) + for (unsigned int i = 0; i < fe.n_dofs_per_cell(); ++i) { const bool is_primitive = fe.is_primitive() || fe.is_primitive(i); @@ -189,7 +189,7 @@ namespace FEValuesViews const unsigned int first_vector_component) : fe_values(&fe_values) , first_vector_component(first_vector_component) - , shape_function_data(this->fe_values->fe->dofs_per_cell) + , shape_function_data(this->fe_values->fe->n_dofs_per_cell()) { const FiniteElement &fe = *this->fe_values->fe; AssertIndexRange(first_vector_component + spacedim - 1, fe.n_components()); @@ -204,7 +204,7 @@ namespace FEValuesViews { const unsigned int component = first_vector_component + d; - for (unsigned int i = 0; i < fe.dofs_per_cell; ++i) + for (unsigned int i = 0; i < fe.n_dofs_per_cell(); ++i) { const bool is_primitive = fe.is_primitive() || fe.is_primitive(i); @@ -225,7 +225,7 @@ namespace FEValuesViews } } - for (unsigned int i = 0; i < fe.dofs_per_cell; ++i) + for (unsigned int i = 0; i < fe.n_dofs_per_cell(); ++i) { unsigned int n_nonzero_components = 0; for (unsigned int d = 0; d < spacedim; ++d) @@ -268,7 +268,7 @@ namespace FEValuesViews const unsigned int first_tensor_component) : fe_values(&fe_values) , first_tensor_component(first_tensor_component) - , shape_function_data(this->fe_values->fe->dofs_per_cell) + , shape_function_data(this->fe_values->fe->n_dofs_per_cell()) { const FiniteElement &fe = *this->fe_values->fe; Assert(first_tensor_component + (dim * dim + dim) / 2 - 1 < @@ -290,7 +290,7 @@ namespace FEValuesViews { const unsigned int component = first_tensor_component + d; - for (unsigned int i = 0; i < fe.dofs_per_cell; ++i) + for (unsigned int i = 0; i < fe.n_dofs_per_cell(); ++i) { const bool is_primitive = fe.is_primitive() || fe.is_primitive(i); @@ -311,7 +311,7 @@ namespace FEValuesViews } } - for (unsigned int i = 0; i < fe.dofs_per_cell; ++i) + for (unsigned int i = 0; i < fe.n_dofs_per_cell(); ++i) { unsigned int n_nonzero_components = 0; for (unsigned int d = 0; @@ -357,7 +357,7 @@ namespace FEValuesViews const unsigned int first_tensor_component) : fe_values(&fe_values) , first_tensor_component(first_tensor_component) - , shape_function_data(this->fe_values->fe->dofs_per_cell) + , shape_function_data(this->fe_values->fe->n_dofs_per_cell()) { const FiniteElement &fe = *this->fe_values->fe; AssertIndexRange(first_tensor_component + dim * dim - 1, fe.n_components()); @@ -371,7 +371,7 @@ namespace FEValuesViews { const unsigned int component = first_tensor_component + d; - for (unsigned int i = 0; i < fe.dofs_per_cell; ++i) + for (unsigned int i = 0; i < fe.n_dofs_per_cell(); ++i) { const bool is_primitive = fe.is_primitive() || fe.is_primitive(i); @@ -392,7 +392,7 @@ namespace FEValuesViews } } - for (unsigned int i = 0; i < fe.dofs_per_cell; ++i) + for (unsigned int i = 0; i < fe.n_dofs_per_cell(); ++i) { unsigned int n_nonzero_components = 0; for (unsigned int d = 0; d < dim * dim; ++d) @@ -2839,10 +2839,10 @@ FEValuesBase::CellIterator::get_interpolated_dof_values( Assert(cell->is_active(), ExcNotImplemented()); std::vector dof_indices( - cell->get_fe().dofs_per_cell); + cell->get_fe().n_dofs_per_cell()); cell->get_dof_indices(dof_indices); - for (unsigned int i = 0; i < cell->get_fe().dofs_per_cell; ++i) + for (unsigned int i = 0; i < cell->get_fe().n_dofs_per_cell(); ++i) out[i] = (in.is_element(dof_indices[i]) ? 1 : 0); } @@ -3008,9 +3008,9 @@ namespace internal // count the total number of non-zero components accumulated // over all shape functions unsigned int n_nonzero_shape_components = 0; - for (unsigned int i = 0; i < fe.dofs_per_cell; ++i) + for (unsigned int i = 0; i < fe.n_dofs_per_cell(); ++i) n_nonzero_shape_components += fe.n_nonzero_components(i); - Assert(n_nonzero_shape_components >= fe.dofs_per_cell, + Assert(n_nonzero_shape_components >= fe.n_dofs_per_cell(), ExcInternalError()); // with the number of rows now known, initialize those fields @@ -3171,7 +3171,7 @@ namespace internal // see if there the current cell has DoFs at all, and if not // then there is nothing else to do. - const unsigned int dofs_per_cell = fe.dofs_per_cell; + const unsigned int dofs_per_cell = fe.n_dofs_per_cell(); if (dofs_per_cell == 0) return; @@ -3322,7 +3322,7 @@ namespace internal // see if there the current cell has DoFs at all, and if not // then there is nothing else to do. - const unsigned int dofs_per_cell = fe.dofs_per_cell; + const unsigned int dofs_per_cell = fe.n_dofs_per_cell(); if (dofs_per_cell == 0) return; @@ -3467,7 +3467,7 @@ namespace internal // see if there the current cell has DoFs at all, and if not // then there is nothing else to do. - const unsigned int dofs_per_cell = fe.dofs_per_cell; + const unsigned int dofs_per_cell = fe.n_dofs_per_cell(); if (dofs_per_cell == 0) return; @@ -4388,7 +4388,7 @@ FEValues::FEValues(const Mapping & mapping, const Quadrature & q, const UpdateFlags update_flags) : FEValuesBase(q.size(), - fe.dofs_per_cell, + fe.n_dofs_per_cell(), update_default, mapping, fe) @@ -4404,7 +4404,7 @@ FEValues::FEValues(const FiniteElement &fe, const Quadrature & q, const UpdateFlags update_flags) : FEValuesBase(q.size(), - fe.dofs_per_cell, + fe.n_dofs_per_cell(), update_default, StaticMappingQ1::mapping, fe) @@ -4656,7 +4656,7 @@ FEFaceValues::FEFaceValues( const Quadrature & quadrature, const UpdateFlags update_flags) : FEFaceValuesBase(quadrature.size(), - fe.dofs_per_cell, + fe.n_dofs_per_cell(), update_flags, mapping, fe, @@ -4673,7 +4673,7 @@ FEFaceValues::FEFaceValues( const Quadrature & quadrature, const UpdateFlags update_flags) : FEFaceValuesBase(quadrature.size(), - fe.dofs_per_cell, + fe.n_dofs_per_cell(), update_flags, StaticMappingQ1::mapping, fe, @@ -4855,7 +4855,7 @@ FESubfaceValues::FESubfaceValues( const Quadrature & quadrature, const UpdateFlags update_flags) : FEFaceValuesBase(quadrature.size(), - fe.dofs_per_cell, + fe.n_dofs_per_cell(), update_flags, mapping, fe, @@ -4872,7 +4872,7 @@ FESubfaceValues::FESubfaceValues( const Quadrature & quadrature, const UpdateFlags update_flags) : FEFaceValuesBase(quadrature.size(), - fe.dofs_per_cell, + fe.n_dofs_per_cell(), update_flags, StaticMappingQ1::mapping, fe, diff --git a/source/fe/mapping_fe_field.cc b/source/fe/mapping_fe_field.cc index 4fb5ac5702..62824c3f64 100644 --- a/source/fe/mapping_fe_field.cc +++ b/source/fe/mapping_fe_field.cc @@ -63,10 +63,10 @@ MappingFEField::InternalData:: InternalData(const FiniteElement &fe, const ComponentMask & mask) : unit_tangentials() - , n_shape_functions(fe.dofs_per_cell) + , n_shape_functions(fe.n_dofs_per_cell()) , mask(mask) - , local_dof_indices(fe.dofs_per_cell) - , local_dof_values(fe.dofs_per_cell) + , local_dof_indices(fe.n_dofs_per_cell()) + , local_dof_values(fe.n_dofs_per_cell()) {} @@ -384,7 +384,8 @@ MappingFEField::get_vertices( std::lock_guard lock(fe_values_mutex); fe_values.reinit(dof_cell); } - const unsigned int dofs_per_cell = euler_dof_handler->get_fe().dofs_per_cell; + const unsigned int dofs_per_cell = + euler_dof_handler->get_fe().n_dofs_per_cell(); std::vector dof_indices(dofs_per_cell); if (uses_level_dofs) dof_cell->get_mg_dof_indices(dof_indices); diff --git a/source/fe/mapping_q1_eulerian.cc b/source/fe/mapping_q1_eulerian.cc index 90fc1f8a9a..36ff806f39 100644 --- a/source/fe/mapping_q1_eulerian.cc +++ b/source/fe/mapping_q1_eulerian.cc @@ -78,7 +78,7 @@ MappingQ1Eulerian::get_vertices( // now get the values of the shift vectors at the vertices Vector mapping_values( - shiftmap_dof_handler->get_fe().dofs_per_cell); + shiftmap_dof_handler->get_fe().n_dofs_per_cell()); dof_cell->get_dof_values(*euler_transform_vectors, mapping_values); for (const unsigned int i : GeometryInfo::vertex_indices()) diff --git a/source/fe/mapping_q_eulerian.cc b/source/fe/mapping_q_eulerian.cc index d673492748..e10223f422 100644 --- a/source/fe/mapping_q_eulerian.cc +++ b/source/fe/mapping_q_eulerian.cc @@ -212,7 +212,7 @@ MappingQEulerian::MappingQEulerianGeneric:: n_support_pts, Vector(n_components)); std::vector dof_indices( - mapping_q_eulerian.euler_dof_handler->get_fe(0).dofs_per_cell); + mapping_q_eulerian.euler_dof_handler->get_fe(0).n_dofs_per_cell()); // fill shift vector for each support point using an fe_values object. make // sure that the fe_values variable isn't used simultaneously from different // threads diff --git a/source/grid/grid_tools_dof_handlers.cc b/source/grid/grid_tools_dof_handlers.cc index 84f8b1c9e0..56248e8fec 100644 --- a/source/grid/grid_tools_dof_handlers.cc +++ b/source/grid/grid_tools_dof_handlers.cc @@ -1789,7 +1789,8 @@ namespace GridTools // cells including ghost cells if (cell->is_artificial() == false) { - const unsigned int n_dofs_per_cell = cell->get_fe().dofs_per_cell; + const unsigned int n_dofs_per_cell = + cell->get_fe().n_dofs_per_cell(); local_dof_indices.resize(n_dofs_per_cell); // Take care of adding cell pointer to each @@ -1928,7 +1929,7 @@ namespace GridTools // dofs_per_line returns number of dofs // on line not including the vertices of the line. const unsigned int n_dofs_per_line = - 2 * cell->get_fe().dofs_per_vertex + + 2 * cell->get_fe().n_dofs_per_vertex() + cell->get_fe().dofs_per_line; local_line_dof_indices.resize(n_dofs_per_line); @@ -1953,7 +1954,7 @@ namespace GridTools // dofs_per_line returns number of dofs // on line not including the vertices of the line. const unsigned int n_dofs_per_line = - 2 * cell->get_fe().dofs_per_vertex + + 2 * cell->get_fe().n_dofs_per_vertex() + cell->get_fe().dofs_per_line; local_line_dof_indices.resize(n_dofs_per_line); @@ -1970,7 +1971,7 @@ namespace GridTools ExcInternalError()); const unsigned int n_dofs_per_line = - 2 * cell->get_fe().dofs_per_vertex + + 2 * cell->get_fe().n_dofs_per_vertex() + cell->get_fe().dofs_per_line; local_line_dof_indices.resize(n_dofs_per_line); diff --git a/source/meshworker/scratch_data.cc b/source/meshworker/scratch_data.cc index c2229cce32..4edb59a4e3 100644 --- a/source/meshworker/scratch_data.cc +++ b/source/meshworker/scratch_data.cc @@ -37,8 +37,8 @@ namespace MeshWorker , neighbor_cell_update_flags(update_flags) , face_update_flags(face_update_flags) , neighbor_face_update_flags(face_update_flags) - , local_dof_indices(fe.dofs_per_cell) - , neighbor_dof_indices(fe.dofs_per_cell) + , local_dof_indices(fe.n_dofs_per_cell()) + , neighbor_dof_indices(fe.n_dofs_per_cell()) {} @@ -61,8 +61,8 @@ namespace MeshWorker , neighbor_cell_update_flags(neighbor_update_flags) , face_update_flags(face_update_flags) , neighbor_face_update_flags(neighbor_face_update_flags) - , local_dof_indices(fe.dofs_per_cell) - , neighbor_dof_indices(fe.dofs_per_cell) + , local_dof_indices(fe.n_dofs_per_cell()) + , neighbor_dof_indices(fe.n_dofs_per_cell()) {} @@ -155,7 +155,7 @@ namespace MeshWorker *mapping, *fe, face_quadrature, face_update_flags); fe_face_values->reinit(cell, face_no); - local_dof_indices.resize(fe->dofs_per_cell); + local_dof_indices.resize(fe->n_dofs_per_cell()); cell->get_dof_indices(local_dof_indices); current_fe_values = fe_face_values.get(); return *fe_face_values; @@ -176,7 +176,7 @@ namespace MeshWorker fe_subface_values = std::make_unique>( *mapping, *fe, face_quadrature, face_update_flags); fe_subface_values->reinit(cell, face_no, subface_no); - local_dof_indices.resize(fe->dofs_per_cell); + local_dof_indices.resize(fe->n_dofs_per_cell()); cell->get_dof_indices(local_dof_indices); current_fe_values = fe_subface_values.get(); diff --git a/source/multigrid/mg_tools.cc b/source/multigrid/mg_tools.cc index 71f96a8b9e..cd4dae9ea8 100644 --- a/source/multigrid/mg_tools.cc +++ b/source/multigrid/mg_tools.cc @@ -138,7 +138,7 @@ namespace MGTools for (const auto &cell : dofs.cell_iterators_on_level(level)) { const FiniteElement &fe = cell->get_fe(); - cell_indices.resize(fe.dofs_per_cell); + cell_indices.resize(fe.n_dofs_per_cell()); cell->get_mg_dof_indices(cell_indices); unsigned int i = 0; // First, dofs on @@ -159,12 +159,12 @@ namespace MGTools // are identical. Nevertheless, // this will only work if // dofs_per_face is zero and - // dofs_per_vertex is + // n_dofs_per_vertex() is // arbitrary, not the other way // round. // TODO: This assumes that even in hp context, the dofs per face // coincide! - unsigned int increment = fe.dofs_per_cell - dim * fe.dofs_per_face; + unsigned int increment = fe.n_dofs_per_cell() - dim * fe.dofs_per_face; while (i < fe.first_line_index) row_lengths[cell_indices[i++]] += increment; // From now on, if an object is @@ -178,23 +178,23 @@ namespace MGTools // subtract adjacent faces to be // added in the loop below. increment = (dim > 1) ? - fe.dofs_per_cell - (dim - 1) * fe.dofs_per_face : - fe.dofs_per_cell - + fe.n_dofs_per_cell() - (dim - 1) * fe.dofs_per_face : + fe.n_dofs_per_cell() - GeometryInfo::faces_per_cell * fe.dofs_per_face; while (i < fe.first_quad_index) row_lengths[cell_indices[i++]] += increment; // Now quads in 2D and 3D increment = (dim > 2) ? - fe.dofs_per_cell - (dim - 2) * fe.dofs_per_face : - fe.dofs_per_cell - + fe.n_dofs_per_cell() - (dim - 2) * fe.dofs_per_face : + fe.n_dofs_per_cell() - GeometryInfo::faces_per_cell * fe.dofs_per_face; while (i < fe.first_hex_index) row_lengths[cell_indices[i++]] += increment; // Finally, cells in 3D - increment = fe.dofs_per_cell - + increment = fe.n_dofs_per_cell() - GeometryInfo::faces_per_cell * fe.dofs_per_face; - while (i < fe.dofs_per_cell) + while (i < fe.n_dofs_per_cell()) row_lengths[cell_indices[i++]] += increment; // At this point, we have @@ -221,7 +221,8 @@ namespace MGTools if (level_boundary) { - for (unsigned int local_dof = 0; local_dof < fe.dofs_per_cell; + for (unsigned int local_dof = 0; + local_dof < fe.n_dofs_per_cell(); ++local_dof) row_lengths[cell_indices[local_dof]] += fe.dofs_per_face; continue; @@ -242,8 +243,9 @@ namespace MGTools if (flux_coupling != DoFTools::none) { const unsigned int dof_increment = - nfe.dofs_per_cell - nfe.dofs_per_face; - for (unsigned int local_dof = 0; local_dof < fe.dofs_per_cell; + nfe.n_dofs_per_cell() - nfe.dofs_per_face; + for (unsigned int local_dof = 0; + local_dof < fe.n_dofs_per_cell(); ++local_dof) row_lengths[cell_indices[local_dof]] += dof_increment; } @@ -265,12 +267,12 @@ namespace MGTools // is refined, all the fine // face dofs couple with // the coarse one. - neighbor_indices.resize(nfe.dofs_per_cell); + neighbor_indices.resize(nfe.n_dofs_per_cell()); neighbor->get_mg_dof_indices(neighbor_indices); - for (unsigned int local_dof = 0; local_dof < fe.dofs_per_cell; + for (unsigned int local_dof = 0; local_dof < fe.n_dofs_per_cell(); ++local_dof) row_lengths[cell_indices[local_dof]] += nfe.dofs_per_face; - for (unsigned int local_dof = 0; local_dof < nfe.dofs_per_cell; + for (unsigned int local_dof = 0; local_dof < nfe.n_dofs_per_cell(); ++local_dof) row_lengths[neighbor_indices[local_dof]] += fe.dofs_per_face; } @@ -341,7 +343,7 @@ namespace MGTools ExcDimensionMismatch(flux_couplings.n_cols(), fe.n_components())); - cell_indices.resize(fe.dofs_per_cell); + cell_indices.resize(fe.n_dofs_per_cell()); cell->get_mg_dof_indices(cell_indices); unsigned int i = 0; // First, dofs on @@ -362,7 +364,7 @@ namespace MGTools // are identical. Nevertheless, // this will only work if // dofs_per_face is zero and - // dofs_per_vertex is + // n_dofs_per_vertex() is // arbitrary, not the other way // round. unsigned int increment; @@ -375,7 +377,7 @@ namespace MGTools fe.first_block_of_base(base) + mult) != DoFTools::none) { - increment = fe.base_element(base).dofs_per_cell - + increment = fe.base_element(base).n_dofs_per_cell() - dim * fe.base_element(base).dofs_per_face; row_lengths[cell_indices[i]] += increment; } @@ -401,7 +403,7 @@ namespace MGTools mult) != DoFTools::none) { increment = - fe.base_element(base).dofs_per_cell - + fe.base_element(base).n_dofs_per_cell() - ((dim > 1) ? (dim - 1) : GeometryInfo::faces_per_cell) * fe.base_element(base).dofs_per_face; @@ -421,7 +423,7 @@ namespace MGTools mult) != DoFTools::none) { increment = - fe.base_element(base).dofs_per_cell - + fe.base_element(base).n_dofs_per_cell() - ((dim > 2) ? (dim - 2) : GeometryInfo::faces_per_cell) * fe.base_element(base).dofs_per_face; @@ -431,7 +433,7 @@ namespace MGTools } // Finally, cells in 3D - while (i < fe.dofs_per_cell) + while (i < fe.n_dofs_per_cell()) { for (unsigned int base = 0; base < fe.n_base_elements(); ++base) for (unsigned int mult = 0; mult < fe.element_multiplicity(base); @@ -440,7 +442,7 @@ namespace MGTools fe.first_block_of_base(base) + mult) != DoFTools::none) { - increment = fe.base_element(base).dofs_per_cell - + increment = fe.base_element(base).n_dofs_per_cell() - GeometryInfo::faces_per_cell * fe.base_element(base).dofs_per_face; row_lengths[cell_indices[i]] += increment; @@ -472,7 +474,8 @@ namespace MGTools if (level_boundary) { - for (unsigned int local_dof = 0; local_dof < fe.dofs_per_cell; + for (unsigned int local_dof = 0; + local_dof < fe.n_dofs_per_cell(); ++local_dof) row_lengths[cell_indices[local_dof]] += fe.dofs_per_face; continue; @@ -493,14 +496,15 @@ namespace MGTools for (unsigned int base = 0; base < nfe.n_base_elements(); ++base) for (unsigned int mult = 0; mult < nfe.element_multiplicity(base); ++mult) - for (unsigned int local_dof = 0; local_dof < fe.dofs_per_cell; + for (unsigned int local_dof = 0; + local_dof < fe.n_dofs_per_cell(); ++local_dof) if (couple_face[fe_index]( fe.system_to_block_index(local_dof).first, nfe.first_block_of_base(base) + mult) != DoFTools::none) { const unsigned int dof_increment = - nfe.base_element(base).dofs_per_cell - + nfe.base_element(base).n_dofs_per_cell() - nfe.base_element(base).dofs_per_face; row_lengths[cell_indices[local_dof]] += dof_increment; } @@ -531,12 +535,13 @@ namespace MGTools // This will not work with // different couplings on // different cells. - neighbor_indices.resize(nfe.dofs_per_cell); + neighbor_indices.resize(nfe.n_dofs_per_cell()); neighbor->get_mg_dof_indices(neighbor_indices); for (unsigned int base = 0; base < nfe.n_base_elements(); ++base) for (unsigned int mult = 0; mult < nfe.element_multiplicity(base); ++mult) - for (unsigned int local_dof = 0; local_dof < fe.dofs_per_cell; + for (unsigned int local_dof = 0; + local_dof < fe.n_dofs_per_cell(); ++local_dof) if (couple_cell[fe_index]( fe.system_to_component_index(local_dof).first, @@ -546,7 +551,8 @@ namespace MGTools for (unsigned int base = 0; base < fe.n_base_elements(); ++base) for (unsigned int mult = 0; mult < fe.element_multiplicity(base); ++mult) - for (unsigned int local_dof = 0; local_dof < nfe.dofs_per_cell; + for (unsigned int local_dof = 0; + local_dof < nfe.n_dofs_per_cell(); ++local_dof) if (couple_cell[fe_index]( nfe.system_to_component_index(local_dof).first, @@ -574,7 +580,7 @@ namespace MGTools Assert(sparsity.n_cols() == n_dofs, ExcDimensionMismatch(sparsity.n_cols(), n_dofs)); - const unsigned int dofs_per_cell = dof.get_fe().dofs_per_cell; + const unsigned int dofs_per_cell = dof.get_fe().n_dofs_per_cell(); std::vector dofs_on_this_cell(dofs_per_cell); typename DoFHandler::cell_iterator cell = dof.begin(level), endc = dof.end(level); @@ -608,7 +614,7 @@ namespace MGTools Assert(sparsity.n_cols() == n_dofs, ExcDimensionMismatch(sparsity.n_cols(), n_dofs)); - const unsigned int dofs_per_cell = dof.get_fe().dofs_per_cell; + const unsigned int dofs_per_cell = dof.get_fe().n_dofs_per_cell(); std::vector dofs_on_this_cell(dofs_per_cell); std::vector dofs_on_other_cell(dofs_per_cell); typename DoFHandler::cell_iterator cell = dof.begin(level), @@ -690,7 +696,7 @@ namespace MGTools Assert(sparsity.n_cols() == fine_dofs, ExcDimensionMismatch(sparsity.n_cols(), fine_dofs)); - const unsigned int dofs_per_cell = dof.get_fe().dofs_per_cell; + const unsigned int dofs_per_cell = dof.get_fe().n_dofs_per_cell(); std::vector dofs_on_this_cell(dofs_per_cell); std::vector dofs_on_other_cell(dofs_per_cell); typename DoFHandler::cell_iterator cell = dof.begin(level), @@ -765,7 +771,7 @@ namespace MGTools Assert(flux_mask.n_cols() == n_comp, ExcDimensionMismatch(flux_mask.n_cols(), n_comp)); - const unsigned int total_dofs = fe.dofs_per_cell; + const unsigned int total_dofs = fe.n_dofs_per_cell(); std::vector dofs_on_this_cell(total_dofs); std::vector dofs_on_other_cell(total_dofs); Table<2, bool> support_on_face(total_dofs, @@ -956,7 +962,7 @@ namespace MGTools Assert(flux_mask.n_cols() == n_comp, ExcDimensionMismatch(flux_mask.n_cols(), n_comp)); - const unsigned int dofs_per_cell = dof.get_fe().dofs_per_cell; + const unsigned int dofs_per_cell = dof.get_fe().n_dofs_per_cell(); std::vector dofs_on_this_cell(dofs_per_cell); std::vector dofs_on_other_cell(dofs_per_cell); Table<2, bool> support_on_face(dofs_per_cell, @@ -1033,7 +1039,7 @@ namespace MGTools Assert(sparsity.n_cols() == n_dofs, ExcDimensionMismatch(sparsity.n_cols(), n_dofs)); - const unsigned int dofs_per_cell = dof.get_fe().dofs_per_cell; + const unsigned int dofs_per_cell = dof.get_fe().n_dofs_per_cell(); std::vector dofs_on_this_cell(dofs_per_cell); typename DoFHandler::cell_iterator cell = dof.begin(level), endc = dof.end(level); @@ -1365,7 +1371,8 @@ namespace MGTools if (boundary_ids.find(boundary_component) != boundary_ids.end()) // we want to constrain this boundary { - for (unsigned int i = 0; i < cell->get_fe().dofs_per_cell; + for (unsigned int i = 0; + i < cell->get_fe().n_dofs_per_cell(); ++i) { const ComponentMask &nonzero_component_array = @@ -1460,7 +1467,7 @@ namespace MGTools const FiniteElement &fe = mg_dof_handler.get_fe(); - const unsigned int dofs_per_cell = fe.dofs_per_cell; + const unsigned int dofs_per_cell = fe.n_dofs_per_cell(); const unsigned int dofs_per_face = fe.dofs_per_face; std::vector local_dof_indices(dofs_per_cell); diff --git a/source/multigrid/mg_transfer_block.cc b/source/multigrid/mg_transfer_block.cc index 774399cffa..9294c91a5e 100644 --- a/source/multigrid/mg_transfer_block.cc +++ b/source/multigrid/mg_transfer_block.cc @@ -219,7 +219,7 @@ MGTransferBlockBase::build(const DoFHandler &dof_handler) { const FiniteElement &fe = dof_handler.get_fe(); const unsigned int n_blocks = fe.n_blocks(); - const unsigned int dofs_per_cell = fe.dofs_per_cell; + const unsigned int dofs_per_cell = fe.n_dofs_per_cell(); const unsigned int n_levels = dof_handler.get_triangulation().n_levels(); Assert(selected.size() == n_blocks, @@ -505,8 +505,8 @@ MGTransferBlockSelect::build( MGTransferBlockBase::build(dof_handler); std::vector temp_copy_indices; - std::vector global_dof_indices(fe.dofs_per_cell); - std::vector level_dof_indices(fe.dofs_per_cell); + std::vector global_dof_indices(fe.n_dofs_per_cell()); + std::vector level_dof_indices(fe.n_dofs_per_cell()); for (int level = dof_handler.get_triangulation().n_levels() - 1; level >= 0; --level) @@ -531,7 +531,7 @@ MGTransferBlockSelect::build( level_cell->get_dof_indices(global_dof_indices); level_cell->get_mg_dof_indices(level_dof_indices); - for (unsigned int i = 0; i < fe.dofs_per_cell; ++i) + for (unsigned int i = 0; i < fe.n_dofs_per_cell(); ++i) { const unsigned int block = fe.system_to_block_index(i).first; if (selected[block]) @@ -608,8 +608,8 @@ MGTransferBlock::build(const DoFHandler &dof_handler, MGTransferBlockBase::build(dof_handler); std::vector> temp_copy_indices(n_blocks); - std::vector global_dof_indices(fe.dofs_per_cell); - std::vector level_dof_indices(fe.dofs_per_cell); + std::vector global_dof_indices(fe.n_dofs_per_cell()); + std::vector level_dof_indices(fe.n_dofs_per_cell()); for (int level = dof_handler.get_triangulation().n_levels() - 1; level >= 0; --level) { @@ -637,7 +637,7 @@ MGTransferBlock::build(const DoFHandler &dof_handler, level_cell->get_dof_indices(global_dof_indices); level_cell->get_mg_dof_indices(level_dof_indices); - for (unsigned int i = 0; i < fe.dofs_per_cell; ++i) + for (unsigned int i = 0; i < fe.n_dofs_per_cell(); ++i) { const unsigned int block = fe.system_to_block_index(i).first; if (selected[block]) diff --git a/source/multigrid/mg_transfer_component.cc b/source/multigrid/mg_transfer_component.cc index 49ce422847..b4f87eff70 100644 --- a/source/multigrid/mg_transfer_component.cc +++ b/source/multigrid/mg_transfer_component.cc @@ -318,7 +318,7 @@ MGTransferComponentBase::build(const DoFHandler &mg_dof) const unsigned int n_components = *std::max_element(mg_target_component.begin(), mg_target_component.end()) + 1; - const unsigned int dofs_per_cell = fe.dofs_per_cell; + const unsigned int dofs_per_cell = fe.n_dofs_per_cell(); const unsigned int n_levels = mg_dof.get_triangulation().n_levels(); Assert(mg_component_mask.represents_n_components(fe.n_components()), @@ -657,8 +657,8 @@ MGTransferSelect::build( // use a temporary vector to create the // relation between global and level dofs std::vector temp_copy_indices; - std::vector global_dof_indices(fe.dofs_per_cell); - std::vector level_dof_indices(fe.dofs_per_cell); + std::vector global_dof_indices(fe.n_dofs_per_cell()); + std::vector level_dof_indices(fe.n_dofs_per_cell()); for (int level = mg_dof.get_triangulation().n_levels() - 1; level >= 0; --level) { @@ -683,7 +683,7 @@ MGTransferSelect::build( level_cell->get_dof_indices(global_dof_indices); level_cell->get_mg_dof_indices(level_dof_indices); - for (unsigned int i = 0; i < fe.dofs_per_cell; ++i) + for (unsigned int i = 0; i < fe.n_dofs_per_cell(); ++i) { const unsigned int component = fe.system_to_component_index(i).first; diff --git a/source/multigrid/mg_transfer_internal.cc b/source/multigrid/mg_transfer_internal.cc index 0366c67cc7..7ea7a9c466 100644 --- a/source/multigrid/mg_transfer_internal.cc +++ b/source/multigrid/mg_transfer_internal.cc @@ -91,7 +91,7 @@ namespace internal IndexSet globally_relevant; DoFTools::extract_locally_relevant_dofs(dof_handler, globally_relevant); - const unsigned int dofs_per_cell = dof_handler.get_fe().dofs_per_cell; + const unsigned int dofs_per_cell = dof_handler.get_fe().n_dofs_per_cell(); std::vector global_dof_indices(dofs_per_cell); std::vector level_dof_indices(dofs_per_cell); @@ -587,37 +587,37 @@ namespace internal { // currently, we have only FE_Q and FE_DGQ type elements implemented elem_info.n_components = dof_handler.get_fe().element_multiplicity(0); - AssertDimension(Utilities::fixed_power(fe.dofs_per_cell) * + AssertDimension(Utilities::fixed_power(fe.n_dofs_per_cell()) * elem_info.n_components, - dof_handler.get_fe().dofs_per_cell); + dof_handler.get_fe().n_dofs_per_cell()); AssertDimension(fe.degree, dof_handler.get_fe().degree); elem_info.fe_degree = fe.degree; - elem_info.element_is_continuous = fe.dofs_per_vertex > 0; - Assert(fe.dofs_per_vertex < 2, ExcNotImplemented()); + elem_info.element_is_continuous = fe.n_dofs_per_vertex() > 0; + Assert(fe.n_dofs_per_vertex() < 2, ExcNotImplemented()); // step 1.2: get renumbering of 1D basis functions to lexicographic - // numbers. The distinction according to fe.dofs_per_vertex is to support - // both continuous and discontinuous bases. - std::vector renumbering(fe.dofs_per_cell); + // numbers. The distinction according to fe.n_dofs_per_vertex() is to + // support both continuous and discontinuous bases. + std::vector renumbering(fe.n_dofs_per_cell()); { - AssertIndexRange(fe.dofs_per_vertex, 2); + AssertIndexRange(fe.n_dofs_per_vertex(), 2); renumbering[0] = 0; for (unsigned int i = 0; i < fe.dofs_per_line; ++i) - renumbering[i + fe.dofs_per_vertex] = - GeometryInfo<1>::vertices_per_cell * fe.dofs_per_vertex + i; - if (fe.dofs_per_vertex > 0) - renumbering[fe.dofs_per_cell - fe.dofs_per_vertex] = - fe.dofs_per_vertex; + renumbering[i + fe.n_dofs_per_vertex()] = + GeometryInfo<1>::vertices_per_cell * fe.n_dofs_per_vertex() + i; + if (fe.n_dofs_per_vertex() > 0) + renumbering[fe.n_dofs_per_cell() - fe.n_dofs_per_vertex()] = + fe.n_dofs_per_vertex(); } // step 1.3: create a dummy 1D quadrature formula to extract the // lexicographic numbering for the elements - Assert(fe.dofs_per_vertex == 0 || fe.dofs_per_vertex == 1, + Assert(fe.n_dofs_per_vertex() == 0 || fe.n_dofs_per_vertex() == 1, ExcNotImplemented()); - const unsigned int shift = fe.dofs_per_cell - fe.dofs_per_vertex; + const unsigned int shift = fe.n_dofs_per_cell() - fe.n_dofs_per_vertex(); const unsigned int n_child_dofs_1d = - (fe.dofs_per_vertex > 0 ? (2 * fe.dofs_per_cell - 1) : - (2 * fe.dofs_per_cell)); + (fe.n_dofs_per_vertex() > 0 ? (2 * fe.n_dofs_per_cell() - 1) : + (2 * fe.n_dofs_per_cell())); elem_info.n_child_cell_dofs = elem_info.n_components * Utilities::fixed_power(n_child_dofs_1d); @@ -628,12 +628,12 @@ namespace internal elem_info.lexicographic_numbering = shape_info.lexicographic_numbering; // step 1.4: get the 1d prolongation matrix and combine from both children - elem_info.prolongation_matrix_1d.resize(fe.dofs_per_cell * + elem_info.prolongation_matrix_1d.resize(fe.n_dofs_per_cell() * n_child_dofs_1d); for (unsigned int c = 0; c < GeometryInfo<1>::max_children_per_cell; ++c) - for (unsigned int i = 0; i < fe.dofs_per_cell; ++i) - for (unsigned int j = 0; j < fe.dofs_per_cell; ++j) + for (unsigned int i = 0; i < fe.n_dofs_per_cell(); ++i) + for (unsigned int j = 0; j < fe.n_dofs_per_cell(); ++j) elem_info .prolongation_matrix_1d[i * n_child_dofs_1d + j + c * shift] = fe.get_prolongation_matrix(c)(renumbering[j], renumbering[i]); @@ -737,7 +737,7 @@ namespace internal coarse_level_indices[level].resize(tria.n_raw_cells(level), numbers::invalid_unsigned_int); std::vector local_dof_indices( - dof_handler.get_fe().dofs_per_cell); + dof_handler.get_fe().n_dofs_per_cell()); dirichlet_indices.resize(n_levels - 1); AssertDimension(target_partitioners.max_level(), n_levels - 1); @@ -818,8 +818,8 @@ namespace internal ghosted_level_dofs.push_back(local_dof_index); add_child_indices(c, - fe->dofs_per_cell - - fe->dofs_per_vertex, + fe->n_dofs_per_cell() - + fe->n_dofs_per_vertex(), fe->degree, elem_info.lexicographic_numbering, local_dof_indices, @@ -849,14 +849,14 @@ namespace internal tria.n_cells(level); parent_child_connect[level][child_index] = std::make_pair(parent_index, c); - AssertIndexRange(dof_handler.get_fe().dofs_per_cell, + AssertIndexRange(dof_handler.get_fe().n_dofs_per_cell(), static_cast(-1)); // set Dirichlet boundary conditions (as a list of // constrained DoFs) for the child if (mg_constrained_dofs != nullptr) for (unsigned int i = 0; - i < dof_handler.get_fe().dofs_per_cell; + i < dof_handler.get_fe().n_dofs_per_cell(); ++i) if (mg_constrained_dofs->is_boundary_index( level, @@ -895,7 +895,7 @@ namespace internal numbers::invalid_dof_index); add_child_indices( 0, - fe->dofs_per_cell - fe->dofs_per_vertex, + fe->n_dofs_per_cell() - fe->n_dofs_per_vertex(), fe->degree, elem_info.lexicographic_numbering, local_dof_indices, @@ -904,7 +904,7 @@ namespace internal dirichlet_indices[0].emplace_back(); if (mg_constrained_dofs != nullptr) for (unsigned int i = 0; - i < dof_handler.get_fe().dofs_per_cell; + i < dof_handler.get_fe().n_dofs_per_cell(); ++i) if (mg_constrained_dofs->is_boundary_index( 0, @@ -991,7 +991,7 @@ namespace internal // ---------------------- 3. compute weights to make restriction additive const unsigned int n_child_dofs_1d = - fe->degree + 1 + fe->dofs_per_cell - fe->dofs_per_vertex; + fe->degree + 1 + fe->n_dofs_per_cell() - fe->n_dofs_per_vertex(); // get the valence of the individual components and compute the weights as // the inverse of the valence diff --git a/source/multigrid/mg_transfer_prebuilt.cc b/source/multigrid/mg_transfer_prebuilt.cc index d7d3669aca..472942fa46 100644 --- a/source/multigrid/mg_transfer_prebuilt.cc +++ b/source/multigrid/mg_transfer_prebuilt.cc @@ -154,7 +154,7 @@ MGTransferPrebuilt::build( { const unsigned int n_levels = dof_handler.get_triangulation().n_global_levels(); - const unsigned int dofs_per_cell = dof_handler.get_fe().dofs_per_cell; + const unsigned int dofs_per_cell = dof_handler.get_fe().n_dofs_per_cell(); this->sizes.resize(n_levels); for (unsigned int l = 0; l < n_levels; ++l) diff --git a/source/non_matching/coupling.cc b/source/non_matching/coupling.cc index cd1306b1a0..33655dcdc1 100644 --- a/source/non_matching/coupling.cc +++ b/source/non_matching/coupling.cc @@ -231,8 +231,8 @@ namespace NonMatching const auto &immersed_fe = immersed_dh.get_fe(); // Dof indices - std::vector dofs(immersed_fe.dofs_per_cell); - std::vector odofs(space_fe.dofs_per_cell); + std::vector dofs(immersed_fe.n_dofs_per_cell()); + std::vector odofs(space_fe.n_dofs_per_cell()); // Take care of components const ComponentMask space_c = @@ -275,14 +275,14 @@ namespace NonMatching // the version with the dof_mask, this should be uncommented. // // // Construct a dof_mask, used to distribute entries to the sparsity - // able< 2, bool > dof_mask(space_fe.dofs_per_cell, - // immersed_fe.dofs_per_cell); + // able< 2, bool > dof_mask(space_fe.n_dofs_per_cell(), + // immersed_fe.n_dofs_per_cell()); // of_mask.fill(false); - // or (unsigned int i=0; i dofs(immersed_fe.dofs_per_cell); - std::vector odofs(space_fe.dofs_per_cell); + std::vector dofs(immersed_fe.n_dofs_per_cell()); + std::vector odofs(space_fe.n_dofs_per_cell()); // Take care of components const ComponentMask space_c = @@ -446,7 +446,8 @@ namespace NonMatching immersed_gtl[i] = j++; FullMatrix cell_matrix( - space_dh.get_fe().dofs_per_cell, immersed_dh.get_fe().dofs_per_cell); + space_dh.get_fe().n_dofs_per_cell(), + immersed_dh.get_fe().n_dofs_per_cell()); FEValues fe_v(immersed_mapping, immersed_dh.get_fe(), @@ -576,14 +577,15 @@ namespace NonMatching // Reset the matrices. cell_matrix = typename Matrix::value_type(); - for (unsigned int i = 0; i < space_dh.get_fe().dofs_per_cell; + for (unsigned int i = 0; + i < space_dh.get_fe().n_dofs_per_cell(); ++i) { const auto comp_i = space_dh.get_fe().system_to_component_index(i).first; if (space_gtl[comp_i] != numbers::invalid_unsigned_int) for (unsigned int j = 0; - j < immersed_dh.get_fe().dofs_per_cell; + j < immersed_dh.get_fe().n_dofs_per_cell(); ++j) { const auto comp_j = immersed_dh.get_fe() @@ -676,8 +678,8 @@ namespace NonMatching const auto &fe1 = dh1.get_fe(); // Dof indices - std::vector dofs0(fe0.dofs_per_cell); - std::vector dofs1(fe1.dofs_per_cell); + std::vector dofs0(fe0.n_dofs_per_cell()); + std::vector dofs1(fe1.n_dofs_per_cell()); if (outer_loop_on_zero) { @@ -829,12 +831,12 @@ namespace NonMatching update_quadrature_points); // Dof indices - std::vector dofs0(fe0.dofs_per_cell); - std::vector dofs1(fe1.dofs_per_cell); + std::vector dofs0(fe0.n_dofs_per_cell()); + std::vector dofs1(fe1.n_dofs_per_cell()); // Local Matrix - FullMatrix cell_matrix(fe0.dofs_per_cell, - fe1.dofs_per_cell); + FullMatrix cell_matrix(fe0.n_dofs_per_cell(), + fe1.n_dofs_per_cell()); // Global to local indices const auto p = @@ -851,7 +853,7 @@ namespace NonMatching { kernel.set_center(fev0.quadrature_point(q0)); kernel.value_list(fev1.get_quadrature_points(), kernel_values); - for (unsigned int j = 0; j < fe1.dofs_per_cell; ++j) + for (unsigned int j = 0; j < fe1.n_dofs_per_cell(); ++j) { const auto comp_j = fe1.system_to_component_index(j).first; @@ -866,7 +868,7 @@ namespace NonMatching // Now compute the main integral with the sum over q1 already // completed - this gives a cubic complexity as usual rather // than a quartic one with naive loops - for (unsigned int i = 0; i < fe0.dofs_per_cell; ++i) + for (unsigned int i = 0; i < fe0.n_dofs_per_cell(); ++i) { const auto comp_i = fe0.system_to_component_index(i).first; if (gtl0[comp_i] != numbers::invalid_unsigned_int && diff --git a/source/numerics/point_value_history.cc b/source/numerics/point_value_history.cc index f1d5393f94..7fe5560a53 100644 --- a/source/numerics/point_value_history.cc +++ b/source/numerics/point_value_history.cc @@ -270,7 +270,7 @@ PointValueHistory::add_point(const Point &location) std::vector local_dof_indices( - dof_handler->get_fe().dofs_per_cell); + dof_handler->get_fe().n_dofs_per_cell()); std::vector new_solution_indices; current_cell->get_dof_indices(local_dof_indices); // there is an implicit assumption here @@ -419,7 +419,7 @@ PointValueHistory::add_points(const std::vector> &locations) } std::vector local_dof_indices( - dof_handler->get_fe().dofs_per_cell); + dof_handler->get_fe().n_dofs_per_cell()); for (unsigned int point = 0; point < locations.size(); point++) { current_cell[point]->get_dof_indices(local_dof_indices); diff --git a/source/numerics/smoothness_estimator.cc b/source/numerics/smoothness_estimator.cc index cd491bb5ba..39b8f88cf3 100644 --- a/source/numerics/smoothness_estimator.cc +++ b/source/numerics/smoothness_estimator.cc @@ -128,7 +128,7 @@ namespace SmoothnessEstimator cell->active_fe_index()); resize(expansion_coefficients, n_modes); - local_dof_values.reinit(cell->get_fe().dofs_per_cell); + local_dof_values.reinit(cell->get_fe().n_dofs_per_cell()); cell->get_dof_values(solution, local_dof_values); fe_legendre.calculate(local_dof_values, @@ -229,7 +229,7 @@ namespace SmoothnessEstimator // at least N=pe+1 AssertIndexRange(pe, n_modes); - local_dof_values.reinit(cell->get_fe().dofs_per_cell); + local_dof_values.reinit(cell->get_fe().n_dofs_per_cell()); cell->get_dof_values(solution, local_dof_values); fe_legendre.calculate(local_dof_values, @@ -396,7 +396,7 @@ namespace SmoothnessEstimator // degrees of freedom and then need to compute the series // expansion by multiplying this vector with the matrix ${\cal // F}$ corresponding to this finite element. - local_dof_values.reinit(cell->get_fe().dofs_per_cell); + local_dof_values.reinit(cell->get_fe().n_dofs_per_cell()); cell->get_dof_values(solution, local_dof_values); fe_fourier.calculate(local_dof_values, @@ -510,7 +510,7 @@ namespace SmoothnessEstimator // at least N=pe+1 AssertIndexRange(pe, n_modes); - local_dof_values.reinit(cell->get_fe().dofs_per_cell); + local_dof_values.reinit(cell->get_fe().n_dofs_per_cell()); cell->get_dof_values(solution, local_dof_values); fe_fourier.calculate(local_dof_values, diff --git a/source/numerics/solution_transfer.cc b/source/numerics/solution_transfer.cc index 26fe1435cb..9766483eeb 100644 --- a/source/numerics/solution_transfer.cc +++ b/source/numerics/solution_transfer.cc @@ -106,7 +106,7 @@ SolutionTransfer::prepare_for_pure_refinement() for (unsigned int i = 0; cell != endc; ++cell, ++i) { - indices_on_cell[i].resize(cell->get_fe().dofs_per_cell); + indices_on_cell[i].resize(cell->get_fe().n_dofs_per_cell()); // on each cell store the indices of the // dofs. after refining we get the values // on the children by taking these @@ -161,7 +161,7 @@ SolutionTransfer::refine_interpolate( const unsigned int this_fe_index = pointerstruct->second.active_fe_index; const unsigned int dofs_per_cell = - cell->get_dof_handler().get_fe(this_fe_index).dofs_per_cell; + cell->get_dof_handler().get_fe(this_fe_index).n_dofs_per_cell(); local_values.reinit(dofs_per_cell, true); // make sure that the size of the stored indices is the same as @@ -210,7 +210,8 @@ namespace internal for (unsigned int j = 0; j < fe.size(); ++j) if (i != j) { - matrices(i, j).reinit(fe[i].dofs_per_cell, fe[j].dofs_per_cell); + matrices(i, j).reinit(fe[i].n_dofs_per_cell(), + fe[j].n_dofs_per_cell()); // see if we can get the interpolation matrices for this // combination of elements. if not, reset the matrix sizes to zero @@ -246,8 +247,8 @@ namespace internal restriction_is_additive.resize(fe.size()); for (unsigned int f = 0; f < fe.size(); ++f) { - restriction_is_additive[f].resize(fe[f].dofs_per_cell); - for (unsigned int i = 0; i < fe[f].dofs_per_cell; ++i) + restriction_is_additive[f].resize(fe[f].n_dofs_per_cell()); + for (unsigned int i = 0; i < fe[f].n_dofs_per_cell(); ++i) restriction_is_additive[f][i] = fe[f].restriction_is_additive(i); } } @@ -334,7 +335,7 @@ SolutionTransfer:: // CASE 1: active cell that remains as it is if (cell->is_active() && !cell->coarsen_flag_set()) { - const unsigned int dofs_per_cell = cell->get_fe().dofs_per_cell; + const unsigned int dofs_per_cell = cell->get_fe().n_dofs_per_cell(); indices_on_cell[n_sr].resize(dofs_per_cell); // cell will not be coarsened, // so we get away by storing the @@ -377,7 +378,7 @@ SolutionTransfer:: dim>::ExcNoDominatedFiniteElementAmongstChildren()); const unsigned int dofs_per_cell = - dof_handler->get_fe(target_fe_index).dofs_per_cell; + dof_handler->get_fe(target_fe_index).n_dofs_per_cell(); std::vector>( in_size, Vector(dofs_per_cell)) @@ -492,7 +493,8 @@ SolutionTransfer::interpolate( Assert(!cell->has_children(), ExcInternalError()); Assert(indexptr == nullptr, ExcInternalError()); - const unsigned int dofs_per_cell = cell->get_fe().dofs_per_cell; + const unsigned int dofs_per_cell = + cell->get_fe().n_dofs_per_cell(); dofs.resize(dofs_per_cell); // get the local // indices diff --git a/source/particles/utilities.cc b/source/particles/utilities.cc index 2493aa9c91..c90a04079f 100644 --- a/source/particles/utilities.cc +++ b/source/particles/utilities.cc @@ -63,9 +63,9 @@ namespace Particles // the version with the dof_mask, this should be uncommented. // // Construct a dof_mask, used to distribute entries to the sparsity // Table<2, bool> dof_mask(max_particles_per_cell * n_comps, - // fe.dofs_per_cell); + // fe.n_dofs_per_cell()); // dof_mask.fill(false); - // for (unsigned int i = 0; i < space_fe.dofs_per_cell; ++i) + // for (unsigned int i = 0; i < space_fe.n_dofs_per_cell(); ++i) // { // const auto comp_i = space_fe.system_to_component_index(i).first; // if (space_gtl[comp_i] != numbers::invalid_unsigned_int) @@ -73,7 +73,7 @@ namespace Particles // dof_mask(i, j * n_comps + space_gtl[comp_i]) = true; // } - std::vector dof_indices(fe.dofs_per_cell); + std::vector dof_indices(fe.n_dofs_per_cell()); std::vector particle_indices( max_particles_per_cell * n_comps); @@ -91,7 +91,7 @@ namespace Particles for (unsigned int i = 0; particle != pic.end(); ++particle, ++i) { const auto p_id = particle->get_id(); - for (unsigned int j = 0; j < fe.dofs_per_cell; ++j) + for (unsigned int j = 0; j < fe.n_dofs_per_cell(); ++j) { const auto comp_j = space_gtl[fe.system_to_component_index(j).first]; @@ -154,9 +154,9 @@ namespace Particles // the version with the dof_mask, this should be uncommented. // // Construct a dof_mask, used to distribute entries to the sparsity // Table<2, bool> dof_mask(max_particles_per_cell * n_comps, - // fe.dofs_per_cell); + // fe.n_dofs_per_cell()); // dof_mask.fill(false); - // for (unsigned int i = 0; i < space_fe.dofs_per_cell; ++i) + // for (unsigned int i = 0; i < space_fe.n_dofs_per_cell(); ++i) // { // const auto comp_i = space_fe.system_to_component_index(i).first; // if (space_gtl[comp_i] != numbers::invalid_unsigned_int) @@ -164,12 +164,12 @@ namespace Particles // dof_mask(i, j * n_comps + space_gtl[comp_i]) = true; // } - std::vector dof_indices(fe.dofs_per_cell); + std::vector dof_indices(fe.n_dofs_per_cell()); std::vector particle_indices( max_particles_per_cell * n_comps); FullMatrix local_matrix( - max_particles_per_cell * n_comps, fe.dofs_per_cell); + max_particles_per_cell * n_comps, fe.n_dofs_per_cell()); auto particle = particle_handler.begin(); while (particle != particle_handler.end()) @@ -181,7 +181,7 @@ namespace Particles const auto pic = particle_handler.particles_in_cell(cell); const auto n_particles = particle_handler.n_particles_in_cell(cell); particle_indices.resize(n_particles * n_comps); - local_matrix.reinit({n_particles * n_comps, fe.dofs_per_cell}); + local_matrix.reinit({n_particles * n_comps, fe.n_dofs_per_cell()}); Assert(pic.begin() == particle, ExcInternalError()); for (unsigned int i = 0; particle != pic.end(); ++particle, ++i) { @@ -192,7 +192,7 @@ namespace Particles particle_indices[i * n_comps + d] = particle->get_id() * n_comps + d; - for (unsigned int j = 0; j < fe.dofs_per_cell; ++j) + for (unsigned int j = 0; j < fe.n_dofs_per_cell(); ++j) { const auto comp_j = space_gtl[fe.system_to_component_index(j).first]; -- 2.39.5