From c5c974b59ba34c0e2560d533179ae77cf088c179 Mon Sep 17 00:00:00 2001 From: Peter Munch Date: Thu, 16 Jul 2020 09:06:06 +0200 Subject: [PATCH] Use more n_dofs_per_ and add functions for offsets --- examples/step-12/step-12.cc | 5 +- examples/step-12b/step-12b.cc | 2 +- examples/step-13/step-13.cc | 4 +- examples/step-14/step-14.cc | 4 +- examples/step-15/step-15.cc | 4 +- examples/step-16/step-16.cc | 2 +- examples/step-17/step-17.cc | 2 +- examples/step-18/doc/results.dox | 4 +- examples/step-18/step-18.cc | 2 +- examples/step-20/step-20.cc | 2 +- examples/step-21/step-21.cc | 4 +- examples/step-22/step-22.cc | 2 +- examples/step-24/step-24.cc | 2 +- examples/step-25/step-25.cc | 4 +- examples/step-27/step-27.cc | 4 +- examples/step-28/step-28.cc | 33 ++-- examples/step-29/step-29.cc | 2 +- examples/step-3/doc/intro.dox | 2 +- examples/step-3/step-3.cc | 2 +- examples/step-30/step-30.cc | 6 +- examples/step-31/step-31.cc | 8 +- examples/step-32/step-32.cc | 58 +++---- examples/step-33/step-33.cc | 4 +- examples/step-34/step-34.cc | 23 +-- examples/step-35/step-35.cc | 22 +-- examples/step-36/step-36.cc | 2 +- examples/step-37/doc/intro.dox | 2 +- examples/step-38/step-38.cc | 2 +- examples/step-4/step-4.cc | 2 +- examples/step-40/step-40.cc | 2 +- examples/step-41/step-41.cc | 6 +- examples/step-42/step-42.cc | 8 +- examples/step-43/step-43.cc | 16 +- examples/step-44/step-44.cc | 14 +- examples/step-45/step-45.cc | 2 +- examples/step-46/doc/intro.dox | 2 +- examples/step-46/step-46.cc | 19 +- examples/step-47/step-47.cc | 4 +- examples/step-5/step-5.cc | 2 +- examples/step-50/step-50.cc | 4 +- examples/step-51/step-51.cc | 38 ++-- examples/step-52/step-52.cc | 4 +- examples/step-55/step-55.cc | 2 +- examples/step-56/step-56.cc | 4 +- examples/step-57/step-57.cc | 2 +- examples/step-58/step-58.cc | 2 +- examples/step-6/step-6.cc | 2 +- examples/step-61/step-61.cc | 8 +- examples/step-62/step-62.cc | 4 +- examples/step-63/step-63.cc | 2 +- examples/step-64/step-64.cu | 2 +- examples/step-65/step-65.cc | 2 +- examples/step-69/step-69.cc | 8 +- examples/step-7/step-7.cc | 2 +- examples/step-70/step-70.cc | 15 +- examples/step-8/step-8.cc | 2 +- examples/step-9/step-9.cc | 2 +- include/deal.II/dofs/dof_accessor.templates.h | 66 +++---- include/deal.II/fe/fe.h | 6 +- include/deal.II/fe/fe_base.h | 67 +++++++ include/deal.II/fe/fe_poly_face.templates.h | 26 +-- include/deal.II/fe/fe_tools.templates.h | 111 ++++++------ .../fe/fe_tools_extrapolate.templates.h | 2 +- include/deal.II/hp/fe_collection.h | 16 +- .../matrix_free/cuda_hanging_nodes_internal.h | 16 +- .../matrix_free/matrix_free.templates.h | 2 +- .../deal.II/multigrid/mg_constrained_dofs.h | 2 +- .../numerics/matrix_creator.templates.h | 4 +- .../vector_tools_boundary.templates.h | 80 +++++---- .../vector_tools_constraints.templates.h | 14 +- .../numerics/vector_tools_project.templates.h | 5 +- source/dofs/dof_handler.cc | 61 ++++--- source/dofs/dof_handler_policy.cc | 41 +++-- source/dofs/dof_tools.cc | 22 +-- source/dofs/dof_tools_constraints.cc | 164 ++++++++++-------- source/dofs/dof_tools_sparsity.cc | 4 +- source/fe/fe.cc | 63 +++---- source/fe/fe_abf.cc | 20 +-- source/fe/fe_bdm.cc | 18 +- source/fe/fe_bernstein.cc | 20 +-- source/fe/fe_enriched.cc | 2 +- source/fe/fe_face.cc | 60 ++++--- source/fe/fe_nedelec.cc | 64 +++---- source/fe/fe_nedelec_sz.cc | 12 +- source/fe/fe_poly_tensor.cc | 6 +- source/fe/fe_q_base.cc | 75 ++++---- source/fe/fe_q_hierarchical.cc | 153 ++++++++-------- source/fe/fe_raviart_thomas.cc | 20 +-- source/fe/fe_raviart_thomas_nodal.cc | 64 +++---- source/fe/fe_rt_bubbles.cc | 22 +-- source/fe/fe_system.cc | 116 +++++++------ source/fe/fe_trace.cc | 9 +- source/grid/grid_tools_dof_handlers.cc | 12 +- source/multigrid/mg_tools.cc | 59 +++---- source/multigrid/mg_transfer_internal.cc | 2 +- 95 files changed, 1023 insertions(+), 878 deletions(-) diff --git a/examples/step-12/step-12.cc b/examples/step-12/step-12.cc index 9a9dfc9c53..ac096ba256 100644 --- a/examples/step-12/step-12.cc +++ b/examples/step-12/step-12.cc @@ -301,7 +301,8 @@ namespace Step12 const auto cell_worker = [&](const Iterator & cell, ScratchData &scratch_data, CopyData & copy_data) { - const unsigned int n_dofs = scratch_data.fe_values.get_fe().dofs_per_cell; + const unsigned int n_dofs = + scratch_data.fe_values.get_fe().n_dofs_per_cell(); copy_data.reinit(cell, n_dofs); scratch_data.fe_values.reinit(cell); @@ -476,7 +477,7 @@ namespace Step12 PreconditionBlockSSOR> preconditioner; // then assign the matrix to it and set the right block size: - preconditioner.initialize(system_matrix, fe.dofs_per_cell); + preconditioner.initialize(system_matrix, fe.n_dofs_per_cell()); // After these preparations we are ready to start the linear solver. solver.solve(system_matrix, solution, right_hand_side, preconditioner); diff --git a/examples/step-12b/step-12b.cc b/examples/step-12b/step-12b.cc index fc6c72445e..5b57f5f070 100644 --- a/examples/step-12b/step-12b.cc +++ b/examples/step-12b/step-12b.cc @@ -515,7 +515,7 @@ namespace Step12 PreconditionBlockSSOR> preconditioner; // then assign the matrix to it and set the right block size: - preconditioner.initialize(system_matrix, fe.dofs_per_cell); + preconditioner.initialize(system_matrix, fe.n_dofs_per_cell()); // After these preparations we are ready to start the linear solver. solver.solve(system_matrix, solution, right_hand_side, preconditioner); diff --git a/examples/step-13/step-13.cc b/examples/step-13/step-13.cc index 2a7c381349..a64963d3ad 100644 --- a/examples/step-13/step-13.cc +++ b/examples/step-13/step-13.cc @@ -876,7 +876,7 @@ namespace Step13 AssemblyScratchData & scratch_data, AssemblyCopyData & copy_data) const { - 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_q_points = quadrature->size(); copy_data.cell_matrix.reinit(dofs_per_cell, dofs_per_cell); @@ -1052,7 +1052,7 @@ namespace Step13 update_values | update_quadrature_points | update_JxW_values); - const unsigned int dofs_per_cell = this->fe->dofs_per_cell; + const unsigned int dofs_per_cell = this->fe->n_dofs_per_cell(); const unsigned int n_q_points = this->quadrature->size(); Vector cell_rhs(dofs_per_cell); diff --git a/examples/step-14/step-14.cc b/examples/step-14/step-14.cc index a32ece26a6..109866d65c 100644 --- a/examples/step-14/step-14.cc +++ b/examples/step-14/step-14.cc @@ -580,7 +580,7 @@ namespace Step14 AssemblyScratchData & scratch_data, AssemblyCopyData & copy_data) const { - 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_q_points = quadrature->size(); copy_data.cell_matrix.reinit(dofs_per_cell, dofs_per_cell); @@ -764,7 +764,7 @@ namespace Step14 update_values | update_quadrature_points | update_JxW_values); - const unsigned int dofs_per_cell = this->fe->dofs_per_cell; + const unsigned int dofs_per_cell = this->fe->n_dofs_per_cell(); const unsigned int n_q_points = this->quadrature->size(); Vector cell_rhs(dofs_per_cell); diff --git a/examples/step-15/step-15.cc b/examples/step-15/step-15.cc index 7f95648f1f..f633133420 100644 --- a/examples/step-15/step-15.cc +++ b/examples/step-15/step-15.cc @@ -240,7 +240,7 @@ namespace Step15 update_gradients | update_quadrature_points | update_JxW_values); - 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_q_points = quadrature_formula.size(); FullMatrix cell_matrix(dofs_per_cell, dofs_per_cell); @@ -506,7 +506,7 @@ namespace Step15 update_gradients | update_quadrature_points | update_JxW_values); - 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_q_points = quadrature_formula.size(); Vector cell_residual(dofs_per_cell); diff --git a/examples/step-16/step-16.cc b/examples/step-16/step-16.cc index 084f30e02e..b90a68667a 100644 --- a/examples/step-16/step-16.cc +++ b/examples/step-16/step-16.cc @@ -338,7 +338,7 @@ namespace Step16 FEValues &fe_values = scratch_data.fe_values; fe_values.reinit(cell); - const unsigned int dofs_per_cell = fe_values.get_fe().dofs_per_cell; + const unsigned int dofs_per_cell = fe_values.get_fe().n_dofs_per_cell(); const unsigned int n_q_points = fe_values.get_quadrature().size(); copy_data.reinit(cell, dofs_per_cell); diff --git a/examples/step-17/step-17.cc b/examples/step-17/step-17.cc index 21a830ead9..99c0e0b223 100644 --- a/examples/step-17/step-17.cc +++ b/examples/step-17/step-17.cc @@ -436,7 +436,7 @@ namespace Step17 update_values | update_gradients | update_quadrature_points | update_JxW_values); - 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_q_points = quadrature_formula.size(); FullMatrix cell_matrix(dofs_per_cell, dofs_per_cell); diff --git a/examples/step-18/doc/results.dox b/examples/step-18/doc/results.dox index e647b34585..28f9c16dcb 100644 --- a/examples/step-18/doc/results.dox +++ b/examples/step-18/doc/results.dox @@ -532,7 +532,7 @@ general approach to this would go like this: { history_field[i][j].reinit(history_dof_handler.n_dofs()); local_history_values_at_qpoints[i][j].reinit(quadrature.size()); - local_history_fe_values[i][j].reinit(history_fe.dofs_per_cell); + local_history_fe_values[i][j].reinit(history_fe.n_dofs_per_cell()); } FullMatrix qpoint_to_dof_matrix (history_fe.dofs_per_cell, @@ -582,7 +582,7 @@ general approach to this would go like this: will do that: @code FullMatrix dof_to_qpoint_matrix (quadrature.size(), - history_fe.dofs_per_cell); + history_fe.n_dofs_per_cell()); FETools::compute_interpolation_to_quadrature_points_matrix (history_fe, quadrature, diff --git a/examples/step-18/step-18.cc b/examples/step-18/step-18.cc index d167104419..268b9ef651 100644 --- a/examples/step-18/step-18.cc +++ b/examples/step-18/step-18.cc @@ -924,7 +924,7 @@ namespace Step18 update_values | update_gradients | update_quadrature_points | update_JxW_values); - 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_q_points = quadrature_formula.size(); FullMatrix cell_matrix(dofs_per_cell, dofs_per_cell); diff --git a/examples/step-20/step-20.cc b/examples/step-20/step-20.cc index d3ae850cbe..c4e64df7a2 100644 --- a/examples/step-20/step-20.cc +++ b/examples/step-20/step-20.cc @@ -464,7 +464,7 @@ namespace Step20 update_quadrature_points | update_JxW_values); - 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_q_points = quadrature_formula.size(); const unsigned int n_face_q_points = face_quadrature_formula.size(); diff --git a/examples/step-21/step-21.cc b/examples/step-21/step-21.cc index 1f4b131b47..1a8ec623dd 100644 --- a/examples/step-21/step-21.cc +++ b/examples/step-21/step-21.cc @@ -631,7 +631,7 @@ namespace Step21 update_quadrature_points | update_JxW_values); - 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_q_points = quadrature_formula.size(); const unsigned int n_face_q_points = face_quadrature_formula.size(); @@ -785,7 +785,7 @@ namespace Step21 face_quadrature_formula, update_values); - 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_q_points = quadrature_formula.size(); const unsigned int n_face_q_points = face_quadrature_formula.size(); diff --git a/examples/step-22/step-22.cc b/examples/step-22/step-22.cc index 9febac04c5..0738307a8f 100644 --- a/examples/step-22/step-22.cc +++ b/examples/step-22/step-22.cc @@ -620,7 +620,7 @@ namespace Step22 update_values | update_quadrature_points | update_JxW_values | update_gradients); - 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_q_points = quadrature_formula.size(); diff --git a/examples/step-24/step-24.cc b/examples/step-24/step-24.cc index 058c49037a..7b6e05937c 100644 --- a/examples/step-24/step-24.cc +++ b/examples/step-24/step-24.cc @@ -333,7 +333,7 @@ namespace Step24 quadrature_formula, update_values | update_JxW_values); - 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_q_points = quadrature_formula.size(); FullMatrix cell_matrix(dofs_per_cell, dofs_per_cell); diff --git a/examples/step-25/step-25.cc b/examples/step-25/step-25.cc index 09beecdb4f..72b0082c4a 100644 --- a/examples/step-25/step-25.cc +++ b/examples/step-25/step-25.cc @@ -401,7 +401,7 @@ namespace Step25 update_values | update_JxW_values | update_quadrature_points); - 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_q_points = quadrature_formula.size(); Vector local_nl_term(dofs_per_cell); @@ -461,7 +461,7 @@ namespace Step25 update_values | update_JxW_values | update_quadrature_points); - 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_q_points = quadrature_formula.size(); FullMatrix local_nl_matrix(dofs_per_cell, dofs_per_cell); diff --git a/examples/step-27/step-27.cc b/examples/step-27/step-27.cc index 0a2d9cf66b..a371f16980 100644 --- a/examples/step-27/step-27.cc +++ b/examples/step-27/step-27.cc @@ -329,7 +329,7 @@ namespace Step27 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(); cell_matrix.reinit(dofs_per_cell, dofs_per_cell); cell_matrix = 0; @@ -677,7 +677,7 @@ namespace Step27 // that has to be provided with the local_dof_values, // cell->active_fe_index() and a Table to store // coefficients. - 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); fourier->calculate(local_dof_values, diff --git a/examples/step-28/step-28.cc b/examples/step-28/step-28.cc index e5f9688093..b9b5a06bba 100644 --- a/examples/step-28/step-28.cc +++ b/examples/step-28/step-28.cc @@ -664,7 +664,7 @@ namespace Step28 update_values | update_gradients | update_JxW_values); - 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_q_points = quadrature_formula.size(); FullMatrix cell_matrix(dofs_per_cell, dofs_per_cell); @@ -729,7 +729,7 @@ namespace Step28 const QGauss quadrature_formula(fe.degree + 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_q_points = quadrature_formula.size(); FEValues fe_values(fe, @@ -801,7 +801,7 @@ namespace Step28 for (const auto &cell_pair : cell_list) { - FullMatrix unit_matrix(fe.dofs_per_cell); + FullMatrix unit_matrix(fe.n_dofs_per_cell()); for (unsigned int i = 0; i < unit_matrix.m(); ++i) unit_matrix(i, i) = 1; assemble_cross_group_rhs_recursive(g_prime, @@ -875,14 +875,14 @@ namespace Step28 group, cell_g_prime->material_id()); - FullMatrix local_mass_matrix_f(fe.dofs_per_cell, - fe.dofs_per_cell); - FullMatrix local_mass_matrix_g(fe.dofs_per_cell, - fe.dofs_per_cell); + FullMatrix local_mass_matrix_f(fe.n_dofs_per_cell(), + fe.n_dofs_per_cell()); + FullMatrix local_mass_matrix_g(fe.n_dofs_per_cell(), + fe.n_dofs_per_cell()); for (unsigned int q_point = 0; q_point < n_q_points; ++q_point) - 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) { local_mass_matrix_f(i, j) += (fission_dist_XS * fe_values.shape_value(i, q_point) * @@ -903,13 +903,13 @@ namespace Step28 // or the product with the transpose matrix using Tvmult. // After doing so, we transfer the result into the global right hand // side vector of energy group $g$. - Vector g_prime_new_values(fe.dofs_per_cell); - Vector g_prime_old_values(fe.dofs_per_cell); + Vector g_prime_new_values(fe.n_dofs_per_cell()); + Vector g_prime_old_values(fe.n_dofs_per_cell()); cell_g_prime->get_dof_values(g_prime.solution_old, g_prime_old_values); cell_g_prime->get_dof_values(g_prime.solution, g_prime_new_values); - Vector cell_rhs(fe.dofs_per_cell); - Vector tmp(fe.dofs_per_cell); + Vector cell_rhs(fe.n_dofs_per_cell()); + Vector tmp(fe.n_dofs_per_cell()); if (cell_g->level() > cell_g_prime->level()) { @@ -929,10 +929,10 @@ namespace Step28 } std::vector local_dof_indices( - fe.dofs_per_cell); + fe.n_dofs_per_cell()); cell_g->get_dof_indices(local_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) system_rhs(local_dof_indices[i]) += cell_rhs(i); } @@ -948,7 +948,8 @@ namespace Step28 child < GeometryInfo::max_children_per_cell; ++child) { - FullMatrix new_matrix(fe.dofs_per_cell, fe.dofs_per_cell); + FullMatrix new_matrix(fe.n_dofs_per_cell(), + fe.n_dofs_per_cell()); fe.get_prolongation_matrix(child).mmult(new_matrix, prolongation_matrix); diff --git a/examples/step-29/step-29.cc b/examples/step-29/step-29.cc index c76c718a09..df2319b1ac 100644 --- a/examples/step-29/step-29.cc +++ b/examples/step-29/step-29.cc @@ -541,7 +541,7 @@ namespace Step29 const unsigned int n_q_points = quadrature_formula.size(), n_face_q_points = face_quadrature_formula.size(), - dofs_per_cell = fe.dofs_per_cell; + dofs_per_cell = fe.n_dofs_per_cell(); // The FEValues objects will evaluate the shape functions for us. For the // part of the bilinear form that involves integration on $\Omega$, we'll diff --git a/examples/step-3/doc/intro.dox b/examples/step-3/doc/intro.dox index 7f7e3f2a47..ab01d67767 100644 --- a/examples/step-3/doc/intro.dox +++ b/examples/step-3/doc/intro.dox @@ -390,7 +390,7 @@ following piece of the code: @endcode where local_dof_indices is declared as @code - std::vector local_dof_indices (fe.dofs_per_cell); + std::vector local_dof_indices (fe.n_dofs_per_cell()); @endcode The name of this variable might be a bit of a misnomer -- it stands for "the global indices of those degrees of freedom locally defined on the current diff --git a/examples/step-3/step-3.cc b/examples/step-3/step-3.cc index 32972d4504..9aa93c174e 100644 --- a/examples/step-3/step-3.cc +++ b/examples/step-3/step-3.cc @@ -364,7 +364,7 @@ void Step3::assemble_system() // loops a bit more readable. You will see such shortcuts in many places in // larger programs, and `dofs_per_cell` is one that is more or less the // conventional name for this kind of object. - const unsigned int dofs_per_cell = fe.dofs_per_cell; + const unsigned int dofs_per_cell = fe.n_dofs_per_cell(); // Now, we said that we wanted to assemble the global matrix and vector // cell-by-cell. We could write the results directly into the global matrix, diff --git a/examples/step-30/step-30.cc b/examples/step-30/step-30.cc index e24b8ebfc0..a5abbf0a57 100644 --- a/examples/step-30/step-30.cc +++ b/examples/step-30/step-30.cc @@ -376,7 +376,7 @@ namespace Step30 (GeometryInfo::faces_per_cell * GeometryInfo::max_children_per_face + 1) * - fe.dofs_per_cell); + fe.n_dofs_per_cell()); DoFTools::make_flux_sparsity_pattern(dof_handler, sparsity_pattern); @@ -403,7 +403,7 @@ namespace Step30 template void DGMethod::assemble_system() { - 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 dofs(dofs_per_cell); std::vector dofs_neighbor(dofs_per_cell); @@ -646,7 +646,7 @@ namespace Step30 PreconditionBlockSSOR> preconditioner; - preconditioner.initialize(system_matrix, fe.dofs_per_cell); + preconditioner.initialize(system_matrix, fe.n_dofs_per_cell()); solver.solve(system_matrix, solution, right_hand_side, preconditioner); } diff --git a/examples/step-31/step-31.cc b/examples/step-31/step-31.cc index a0ad4a6784..27fe2bc106 100644 --- a/examples/step-31/step-31.cc +++ b/examples/step-31/step-31.cc @@ -1045,7 +1045,7 @@ namespace Step31 update_JxW_values | update_values | update_gradients); - const unsigned int dofs_per_cell = stokes_fe.dofs_per_cell; + const unsigned int dofs_per_cell = stokes_fe.n_dofs_per_cell(); const unsigned int n_q_points = quadrature_formula.size(); FullMatrix local_matrix(dofs_per_cell, dofs_per_cell); @@ -1250,7 +1250,7 @@ namespace Step31 quadrature_formula, update_values); - const unsigned int dofs_per_cell = stokes_fe.dofs_per_cell; + const unsigned int dofs_per_cell = stokes_fe.n_dofs_per_cell(); const unsigned int n_q_points = quadrature_formula.size(); FullMatrix local_matrix(dofs_per_cell, dofs_per_cell); @@ -1414,7 +1414,7 @@ namespace Step31 update_values | update_gradients | update_JxW_values); - const unsigned int dofs_per_cell = temperature_fe.dofs_per_cell; + const unsigned int dofs_per_cell = temperature_fe.n_dofs_per_cell(); const unsigned int n_q_points = quadrature_formula.size(); FullMatrix local_mass_matrix(dofs_per_cell, dofs_per_cell); @@ -1522,7 +1522,7 @@ namespace Step31 quadrature_formula, update_values); - const unsigned int dofs_per_cell = temperature_fe.dofs_per_cell; + const unsigned int dofs_per_cell = temperature_fe.n_dofs_per_cell(); const unsigned int n_q_points = quadrature_formula.size(); Vector local_rhs(dofs_per_cell); diff --git a/examples/step-32/step-32.cc b/examples/step-32/step-32.cc index 58a976c7b7..f74c6f741f 100644 --- a/examples/step-32/step-32.cc +++ b/examples/step-32/step-32.cc @@ -366,8 +366,8 @@ namespace Step32 const Mapping & mapping, const UpdateFlags update_flags) : stokes_fe_values(mapping, stokes_fe, stokes_quadrature, update_flags) - , grad_phi_u(stokes_fe.dofs_per_cell) - , phi_p(stokes_fe.dofs_per_cell) + , grad_phi_u(stokes_fe.n_dofs_per_cell()) + , phi_p(stokes_fe.n_dofs_per_cell()) {} @@ -434,9 +434,9 @@ namespace Step32 temperature_fe, stokes_quadrature, temperature_update_flags) - , phi_u(stokes_fe.dofs_per_cell) - , grads_phi_u(stokes_fe.dofs_per_cell) - , div_phi_u(stokes_fe.dofs_per_cell) + , phi_u(stokes_fe.n_dofs_per_cell()) + , grads_phi_u(stokes_fe.n_dofs_per_cell()) + , div_phi_u(stokes_fe.n_dofs_per_cell()) , old_temperature_values(stokes_quadrature.size()) {} @@ -486,8 +486,8 @@ namespace Step32 temperature_quadrature, update_values | update_gradients | update_JxW_values) - , phi_T(temperature_fe.dofs_per_cell) - , grad_phi_T(temperature_fe.dofs_per_cell) + , phi_T(temperature_fe.n_dofs_per_cell()) + , grad_phi_T(temperature_fe.n_dofs_per_cell()) {} @@ -562,8 +562,8 @@ namespace Step32 stokes_fe, quadrature, update_values | update_gradients) - , phi_T(temperature_fe.dofs_per_cell) - , grad_phi_T(temperature_fe.dofs_per_cell) + , phi_T(temperature_fe.n_dofs_per_cell()) + , grad_phi_T(temperature_fe.n_dofs_per_cell()) , old_velocity_values(quadrature.size()) @@ -637,8 +637,8 @@ namespace Step32 template StokesPreconditioner::StokesPreconditioner( const FiniteElement &stokes_fe) - : local_matrix(stokes_fe.dofs_per_cell, stokes_fe.dofs_per_cell) - , local_dof_indices(stokes_fe.dofs_per_cell) + : local_matrix(stokes_fe.n_dofs_per_cell(), stokes_fe.n_dofs_per_cell()) + , local_dof_indices(stokes_fe.n_dofs_per_cell()) {} template @@ -661,7 +661,7 @@ namespace Step32 template StokesSystem::StokesSystem(const FiniteElement &stokes_fe) : StokesPreconditioner(stokes_fe) - , local_rhs(stokes_fe.dofs_per_cell) + , local_rhs(stokes_fe.n_dofs_per_cell()) {} @@ -679,11 +679,11 @@ namespace Step32 template TemperatureMatrix::TemperatureMatrix( const FiniteElement &temperature_fe) - : local_mass_matrix(temperature_fe.dofs_per_cell, - temperature_fe.dofs_per_cell) - , local_stiffness_matrix(temperature_fe.dofs_per_cell, - temperature_fe.dofs_per_cell) - , local_dof_indices(temperature_fe.dofs_per_cell) + : local_mass_matrix(temperature_fe.n_dofs_per_cell(), + temperature_fe.n_dofs_per_cell()) + , local_stiffness_matrix(temperature_fe.n_dofs_per_cell(), + temperature_fe.n_dofs_per_cell()) + , local_dof_indices(temperature_fe.n_dofs_per_cell()) {} @@ -701,10 +701,10 @@ namespace Step32 template TemperatureRHS::TemperatureRHS( const FiniteElement &temperature_fe) - : local_rhs(temperature_fe.dofs_per_cell) - , local_dof_indices(temperature_fe.dofs_per_cell) - , matrix_for_bc(temperature_fe.dofs_per_cell, - temperature_fe.dofs_per_cell) + : local_rhs(temperature_fe.n_dofs_per_cell()) + , local_dof_indices(temperature_fe.n_dofs_per_cell()) + , matrix_for_bc(temperature_fe.n_dofs_per_cell(), + temperature_fe.n_dofs_per_cell()) {} } // namespace CopyData } // namespace Assembly @@ -2016,7 +2016,7 @@ namespace Step32 Assembly::Scratch::StokesPreconditioner & scratch, Assembly::CopyData::StokesPreconditioner & data) { - const unsigned int dofs_per_cell = stokes_fe.dofs_per_cell; + const unsigned int dofs_per_cell = stokes_fe.n_dofs_per_cell(); const unsigned int n_q_points = scratch.stokes_fe_values.n_quadrature_points; @@ -2213,7 +2213,7 @@ namespace Step32 Assembly::CopyData::StokesSystem & data) { const unsigned int dofs_per_cell = - scratch.stokes_fe_values.get_fe().dofs_per_cell; + scratch.stokes_fe_values.get_fe().n_dofs_per_cell(); const unsigned int n_q_points = scratch.stokes_fe_values.n_quadrature_points; @@ -2360,7 +2360,7 @@ namespace Step32 Assembly::CopyData::TemperatureMatrix & data) { const unsigned int dofs_per_cell = - scratch.temperature_fe_values.get_fe().dofs_per_cell; + scratch.temperature_fe_values.get_fe().n_dofs_per_cell(); const unsigned int n_q_points = scratch.temperature_fe_values.n_quadrature_points; @@ -2477,7 +2477,7 @@ namespace Step32 const bool use_bdf2_scheme = (timestep_number != 0); const unsigned int dofs_per_cell = - scratch.temperature_fe_values.get_fe().dofs_per_cell; + scratch.temperature_fe_values.get_fe().n_dofs_per_cell(); const unsigned int n_q_points = scratch.temperature_fe_values.n_quadrature_points; @@ -3155,11 +3155,11 @@ namespace Step32 { std::vector local_joint_dof_indices( - joint_fe.dofs_per_cell); + joint_fe.n_dofs_per_cell()); std::vector local_stokes_dof_indices( - stokes_fe.dofs_per_cell); + stokes_fe.n_dofs_per_cell()); std::vector local_temperature_dof_indices( - temperature_fe.dofs_per_cell); + temperature_fe.n_dofs_per_cell()); typename DoFHandler::active_cell_iterator joint_cell = joint_dof_handler.begin_active(), @@ -3174,7 +3174,7 @@ namespace Step32 stokes_cell->get_dof_indices(local_stokes_dof_indices); temperature_cell->get_dof_indices(local_temperature_dof_indices); - for (unsigned int i = 0; i < joint_fe.dofs_per_cell; ++i) + for (unsigned int i = 0; i < joint_fe.n_dofs_per_cell(); ++i) if (joint_fe.system_to_base_index(i).first.first == 0) { Assert(joint_fe.system_to_base_index(i).second < diff --git a/examples/step-33/step-33.cc b/examples/step-33/step-33.cc index ba56ae6a97..aa657dc310 100644 --- a/examples/step-33/step-33.cc +++ b/examples/step-33/step-33.cc @@ -447,7 +447,7 @@ namespace Step33 const Vector & solution, Vector & refinement_indicators) { - 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 dofs(dofs_per_cell); const QMidpoint quadrature_formula; @@ -1439,7 +1439,7 @@ namespace Step33 template void ConservationLaw::assemble_system() { - 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 dof_indices(dofs_per_cell); std::vector dof_indices_neighbor(dofs_per_cell); diff --git a/examples/step-34/step-34.cc b/examples/step-34/step-34.cc index 0ce41220c0..f23eaafa3f 100644 --- a/examples/step-34/step-34.cc +++ b/examples/step-34/step-34.cc @@ -564,7 +564,8 @@ namespace Step34 const unsigned int n_q_points = fe_v.n_quadrature_points; - std::vector local_dof_indices(fe.dofs_per_cell); + std::vector local_dof_indices( + fe.n_dofs_per_cell()); std::vector> cell_wind(n_q_points, Vector(dim)); double normal_wind; @@ -576,7 +577,7 @@ namespace Step34 // cell. This is done using a vector of fe.dofs_per_cell elements, which // will then be distributed to the matrix in the global row $i$. The // following object will hold this information: - Vector local_matrix_row_i(fe.dofs_per_cell); + Vector local_matrix_row_i(fe.n_dofs_per_cell()); // The index $i$ runs on the collocation points, which are the support // points of the $i$th basis function, while $j$ runs on inner integration @@ -617,7 +618,7 @@ namespace Step34 bool is_singular = false; unsigned int singular_index = numbers::invalid_unsigned_int; - for (unsigned int j = 0; j < fe.dofs_per_cell; ++j) + for (unsigned int j = 0; j < fe.n_dofs_per_cell(); ++j) if (local_dof_indices[j] == i) { singular_index = j; @@ -642,7 +643,7 @@ namespace Step34 system_rhs(i) += (LaplaceKernel::single_layer(R) * normal_wind * fe_v.JxW(q)); - for (unsigned int j = 0; j < fe.dofs_per_cell; ++j) + for (unsigned int j = 0; j < fe.n_dofs_per_cell(); ++j) local_matrix_row_i(j) -= ((LaplaceKernel::double_layer(R) * normals[q]) * @@ -702,7 +703,7 @@ namespace Step34 system_rhs(i) += (LaplaceKernel::single_layer(R) * normal_wind * fe_v_singular.JxW(q)); - for (unsigned int j = 0; j < fe.dofs_per_cell; ++j) + for (unsigned int j = 0; j < fe.n_dofs_per_cell(); ++j) { local_matrix_row_i(j) -= ((LaplaceKernel::double_layer(R) * @@ -715,7 +716,7 @@ namespace Step34 // Finally, we need to add the contributions of the current cell // to the global matrix. - for (unsigned int j = 0; j < fe.dofs_per_cell; ++j) + for (unsigned int j = 0; j < fe.n_dofs_per_cell(); ++j) system_matrix(i, local_dof_indices[j]) += local_matrix_row_i(j); } } @@ -866,11 +867,12 @@ namespace Step34 const DoFHandler<2, 3>::active_cell_iterator &, const unsigned int index) const { - Assert(index < fe.dofs_per_cell, ExcIndexRange(0, fe.dofs_per_cell, index)); + Assert(index < fe.n_dofs_per_cell(), + ExcIndexRange(0, fe.n_dofs_per_cell(), index)); static std::vector> quadratures; if (quadratures.size() == 0) - for (unsigned int i = 0; i < fe.dofs_per_cell; ++i) + for (unsigned int i = 0; i < fe.n_dofs_per_cell(); ++i) quadratures.emplace_back(singular_quadrature_order, fe.get_unit_support_points()[i], true); @@ -883,7 +885,8 @@ namespace Step34 const DoFHandler<1, 2>::active_cell_iterator &cell, const unsigned int index) const { - Assert(index < fe.dofs_per_cell, ExcIndexRange(0, fe.dofs_per_cell, index)); + Assert(index < fe.n_dofs_per_cell(), + ExcIndexRange(0, fe.n_dofs_per_cell(), index)); static Quadrature<1> *q_pointer = nullptr; if (q_pointer) @@ -936,7 +939,7 @@ namespace Step34 const unsigned int n_q_points = fe_v.n_quadrature_points; - std::vector dofs(fe.dofs_per_cell); + std::vector dofs(fe.n_dofs_per_cell()); std::vector local_phi(n_q_points); std::vector normal_wind(n_q_points); diff --git a/examples/step-35/step-35.cc b/examples/step-35/step-35.cc index 4298f427ab..8472332d0c 100644 --- a/examples/step-35/step-35.cc +++ b/examples/step-35/step-35.cc @@ -636,7 +636,7 @@ namespace Step35 const QGauss &quad, const UpdateFlags flags) : nqp(quad.size()) - , dpc(fe.dofs_per_cell) + , dpc(fe.n_dofs_per_cell()) , u_star_local(nqp) , grad_u_star(nqp) , u_star_tmp(nqp) @@ -885,8 +885,8 @@ namespace Step35 } InitGradPerTaskData per_task_data(0, - fe_velocity.dofs_per_cell, - fe_pressure.dofs_per_cell); + fe_velocity.n_dofs_per_cell(), + fe_pressure.n_dofs_per_cell()); InitGradScratchData scratch_data(fe_velocity, fe_pressure, quadrature_velocity, @@ -1133,7 +1133,7 @@ namespace Step35 void NavierStokesProjection::assemble_advection_term() { vel_Advection = 0.; - AdvectionPerTaskData data(fe_velocity.dofs_per_cell); + AdvectionPerTaskData data(fe_velocity.n_dofs_per_cell()); AdvectionScratchData scratch(fe_velocity, quadrature_velocity, update_values | update_JxW_values | @@ -1197,8 +1197,8 @@ namespace Step35 void NavierStokesProjection::copy_advection_local_to_global( const AdvectionPerTaskData &data) { - for (unsigned int i = 0; i < fe_velocity.dofs_per_cell; ++i) - for (unsigned int j = 0; j < fe_velocity.dofs_per_cell; ++j) + for (unsigned int i = 0; i < fe_velocity.n_dofs_per_cell(); ++i) + for (unsigned int j = 0; j < fe_velocity.n_dofs_per_cell(); ++j) vel_Advection.add(data.local_dof_indices[i], data.local_dof_indices[j], data.local_advection(i, j)); @@ -1306,9 +1306,9 @@ namespace Step35 ExcInternalError()); Vector joint_solution(joint_dof_handler.n_dofs()); std::vector loc_joint_dof_indices( - joint_fe.dofs_per_cell), - loc_vel_dof_indices(fe_velocity.dofs_per_cell), - loc_pres_dof_indices(fe_pressure.dofs_per_cell); + joint_fe.n_dofs_per_cell()), + loc_vel_dof_indices(fe_velocity.n_dofs_per_cell()), + loc_pres_dof_indices(fe_pressure.n_dofs_per_cell()); typename DoFHandler::active_cell_iterator joint_cell = joint_dof_handler.begin_active(), joint_endc = joint_dof_handler.end(), @@ -1319,7 +1319,7 @@ namespace Step35 joint_cell->get_dof_indices(loc_joint_dof_indices); vel_cell->get_dof_indices(loc_vel_dof_indices); pres_cell->get_dof_indices(loc_pres_dof_indices); - for (unsigned int i = 0; i < joint_fe.dofs_per_cell; ++i) + for (unsigned int i = 0; i < joint_fe.n_dofs_per_cell(); ++i) switch (joint_fe.system_to_base_index(i).first.first) { case 0: @@ -1390,7 +1390,7 @@ namespace Step35 quadrature_velocity, update_gradients | update_JxW_values | update_values); - const unsigned int dpc = fe_velocity.dofs_per_cell, + const unsigned int dpc = fe_velocity.n_dofs_per_cell(), nqp = quadrature_velocity.size(); std::vector ldi(dpc); Vector loc_rot(dpc); diff --git a/examples/step-36/step-36.cc b/examples/step-36/step-36.cc index d42ba4e502..b0e6a09c23 100644 --- a/examples/step-36/step-36.cc +++ b/examples/step-36/step-36.cc @@ -244,7 +244,7 @@ namespace Step36 update_values | update_gradients | update_quadrature_points | update_JxW_values); - 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_q_points = quadrature_formula.size(); FullMatrix cell_stiffness_matrix(dofs_per_cell, dofs_per_cell); diff --git a/examples/step-37/doc/intro.dox b/examples/step-37/doc/intro.dox index 929d817da5..e302529e4d 100644 --- a/examples/step-37/doc/intro.dox +++ b/examples/step-37/doc/intro.dox @@ -103,7 +103,7 @@ Matrixfree::vmult (Vector &dst, update_gradients | update_JxW_values| update_quadrature_points); - 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_q_points = quadrature_formula.size(); FullMatrix cell_matrix (dofs_per_cell, dofs_per_cell); diff --git a/examples/step-38/step-38.cc b/examples/step-38/step-38.cc index 84c2b21c21..614b6cd456 100644 --- a/examples/step-38/step-38.cc +++ b/examples/step-38/step-38.cc @@ -362,7 +362,7 @@ namespace Step38 update_quadrature_points | update_JxW_values); - 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_q_points = quadrature_formula.size(); FullMatrix cell_matrix(dofs_per_cell, dofs_per_cell); diff --git a/examples/step-4/step-4.cc b/examples/step-4/step-4.cc index 3fe7b9c6bd..b7a4368775 100644 --- a/examples/step-4/step-4.cc +++ b/examples/step-4/step-4.cc @@ -342,7 +342,7 @@ void Step4::assemble_system() // are presently using, but the FiniteElement class does all the necessary // work for you and you don't have to care about the dimension dependent // parts: - const unsigned int dofs_per_cell = fe.dofs_per_cell; + const unsigned int dofs_per_cell = fe.n_dofs_per_cell(); FullMatrix cell_matrix(dofs_per_cell, dofs_per_cell); Vector cell_rhs(dofs_per_cell); diff --git a/examples/step-40/step-40.cc b/examples/step-40/step-40.cc index 4e2d481159..2d5daa4113 100644 --- a/examples/step-40/step-40.cc +++ b/examples/step-40/step-40.cc @@ -366,7 +366,7 @@ namespace Step40 update_values | update_gradients | update_quadrature_points | update_JxW_values); - 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_q_points = quadrature_formula.size(); FullMatrix cell_matrix(dofs_per_cell, dofs_per_cell); diff --git a/examples/step-41/step-41.cc b/examples/step-41/step-41.cc index 755ff35f42..b1d05969af 100644 --- a/examples/step-41/step-41.cc +++ b/examples/step-41/step-41.cc @@ -276,7 +276,7 @@ namespace Step41 update_values | update_gradients | update_quadrature_points | update_JxW_values); - 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_q_points = quadrature_formula.size(); FullMatrix cell_matrix(dofs_per_cell, dofs_per_cell); @@ -350,7 +350,7 @@ namespace Step41 quadrature_formula, update_values | update_JxW_values); - 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_q_points = quadrature_formula.size(); FullMatrix cell_matrix(dofs_per_cell, dofs_per_cell); @@ -445,7 +445,7 @@ namespace Step41 for (const auto &cell : dof_handler.active_cell_iterators()) for (unsigned int v = 0; v < GeometryInfo::vertices_per_cell; ++v) { - Assert(dof_handler.get_fe().dofs_per_cell == + Assert(dof_handler.get_fe().n_dofs_per_cell() == GeometryInfo::vertices_per_cell, ExcNotImplemented()); diff --git a/examples/step-42/step-42.cc b/examples/step-42/step-42.cc index de08c54a6b..2d766976d0 100644 --- a/examples/step-42/step-42.cc +++ b/examples/step-42/step-42.cc @@ -1132,7 +1132,7 @@ namespace Step42 face_quadrature_formula, update_values | update_JxW_values); - 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_face_q_points = face_quadrature_formula.size(); FullMatrix cell_matrix(dofs_per_cell, dofs_per_cell); @@ -1224,7 +1224,7 @@ namespace Step42 face_quadrature, update_quadrature_points); - const unsigned int dofs_per_face = fe.dofs_per_face; + const unsigned int dofs_per_face = fe.n_dofs_per_face(); const unsigned int n_face_q_points = face_quadrature.size(); std::vector dof_indices(dofs_per_face); @@ -1342,7 +1342,7 @@ namespace Step42 update_values | update_quadrature_points | update_JxW_values); - 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_q_points = quadrature_formula.size(); const unsigned int n_face_q_points = face_quadrature_formula.size(); @@ -1495,7 +1495,7 @@ namespace Step42 update_values | update_quadrature_points | update_JxW_values); - 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_q_points = quadrature_formula.size(); const unsigned int n_face_q_points = face_quadrature_formula.size(); diff --git a/examples/step-43/step-43.cc b/examples/step-43/step-43.cc index ea33694210..5163bbce66 100644 --- a/examples/step-43/step-43.cc +++ b/examples/step-43/step-43.cc @@ -864,7 +864,7 @@ namespace Step43 quadrature_formula, update_values); - const unsigned int dofs_per_cell = darcy_fe.dofs_per_cell; + const unsigned int dofs_per_cell = darcy_fe.n_dofs_per_cell(); const unsigned int n_q_points = quadrature_formula.size(); std::vector> k_inverse_values(n_q_points); @@ -1008,7 +1008,7 @@ namespace Step43 update_quadrature_points | update_JxW_values); - const unsigned int dofs_per_cell = darcy_fe.dofs_per_cell; + const unsigned int dofs_per_cell = darcy_fe.n_dofs_per_cell(); const unsigned int n_q_points = quadrature_formula.size(); const unsigned int n_face_q_points = face_quadrature_formula.size(); @@ -1198,7 +1198,7 @@ namespace Step43 quadrature_formula, update_values | update_JxW_values); - const unsigned int dofs_per_cell = saturation_fe.dofs_per_cell; + const unsigned int dofs_per_cell = saturation_fe.n_dofs_per_cell(); const unsigned int n_q_points = quadrature_formula.size(); @@ -1282,7 +1282,7 @@ namespace Step43 saturation_fe, face_quadrature_formula, update_values); const unsigned int dofs_per_cell = - saturation_dof_handler.get_fe().dofs_per_cell; + saturation_dof_handler.get_fe().n_dofs_per_cell(); std::vector local_dof_indices(dofs_per_cell); const double global_max_u_F_prime = get_max_u_F_prime(); @@ -1753,11 +1753,11 @@ namespace Step43 { std::vector local_joint_dof_indices( - joint_fe.dofs_per_cell); + joint_fe.n_dofs_per_cell()); std::vector local_darcy_dof_indices( - darcy_fe.dofs_per_cell); + darcy_fe.n_dofs_per_cell()); std::vector local_saturation_dof_indices( - saturation_fe.dofs_per_cell); + saturation_fe.n_dofs_per_cell()); auto joint_cell = joint_dof_handler.begin_active(); const auto joint_endc = joint_dof_handler.end(); @@ -1771,7 +1771,7 @@ namespace Step43 darcy_cell->get_dof_indices(local_darcy_dof_indices); saturation_cell->get_dof_indices(local_saturation_dof_indices); - for (unsigned int i = 0; i < joint_fe.dofs_per_cell; ++i) + for (unsigned int i = 0; i < joint_fe.n_dofs_per_cell(); ++i) if (joint_fe.system_to_base_index(i).first.first == 0) { Assert(joint_fe.system_to_base_index(i).second < diff --git a/examples/step-44/step-44.cc b/examples/step-44/step-44.cc index 55f13a7b20..dcd39426eb 100644 --- a/examples/step-44/step-44.cc +++ b/examples/step-44/step-44.cc @@ -1063,7 +1063,7 @@ namespace Step44 1) , // dilatation dof_handler(triangulation) - , dofs_per_cell(fe.dofs_per_cell) + , dofs_per_cell(fe.n_dofs_per_cell()) , u_fe(first_u_component) , p_fe(p_component) , J_fe(J_component) @@ -1196,12 +1196,12 @@ namespace Step44 const QGauss & qf_cell, const UpdateFlags uf_cell) : fe_values(fe_cell, qf_cell, uf_cell) - , Nx(qf_cell.size(), std::vector(fe_cell.dofs_per_cell)) + , Nx(qf_cell.size(), std::vector(fe_cell.n_dofs_per_cell())) , grad_Nx(qf_cell.size(), - std::vector>(fe_cell.dofs_per_cell)) + std::vector>(fe_cell.n_dofs_per_cell())) , symm_grad_Nx(qf_cell.size(), std::vector>( - fe_cell.dofs_per_cell)) + fe_cell.n_dofs_per_cell())) {} ScratchData_K(const ScratchData_K &rhs) @@ -1271,10 +1271,10 @@ namespace Step44 const UpdateFlags uf_face) : fe_values(fe_cell, qf_cell, uf_cell) , fe_face_values(fe_cell, qf_face, uf_face) - , Nx(qf_cell.size(), std::vector(fe_cell.dofs_per_cell)) + , Nx(qf_cell.size(), std::vector(fe_cell.n_dofs_per_cell())) , symm_grad_Nx(qf_cell.size(), std::vector>( - fe_cell.dofs_per_cell)) + fe_cell.n_dofs_per_cell())) {} ScratchData_RHS(const ScratchData_RHS &rhs) @@ -1613,7 +1613,7 @@ namespace Step44 element_indices_p.clear(); element_indices_J.clear(); - for (unsigned int k = 0; k < fe.dofs_per_cell; ++k) + for (unsigned int k = 0; k < fe.n_dofs_per_cell(); ++k) { const unsigned int k_group = fe.system_to_base_index(k).first.first; if (k_group == u_dof) diff --git a/examples/step-45/step-45.cc b/examples/step-45/step-45.cc index 606d7d5445..17384110ec 100644 --- a/examples/step-45/step-45.cc +++ b/examples/step-45/step-45.cc @@ -560,7 +560,7 @@ namespace Step45 update_values | update_quadrature_points | update_JxW_values | update_gradients); - 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_q_points = quadrature_formula.size(); diff --git a/examples/step-46/doc/intro.dox b/examples/step-46/doc/intro.dox index cd2b14e28f..2455b1e65f 100644 --- a/examples/step-46/doc/intro.dox +++ b/examples/step-46/doc/intro.dox @@ -181,7 +181,7 @@ comes in: it describes a finite dimensional function space of functions that are constant zero. A particular property of this peculiar linear vector space is that it has no degrees of freedom: it isn't just finite dimensional, it is in fact zero dimensional, and -consequently for objects of this type, FiniteElement::dofs_per_cell +consequently for objects of this type, FiniteElement::n_dofs_per_cell() will return zero. For discussion below, let us give this space a proper symbol: @f[ diff --git a/examples/step-46/step-46.cc b/examples/step-46/step-46.cc index 165324c736..c4b942b7e1 100644 --- a/examples/step-46/step-46.cc +++ b/examples/step-46/step-46.cc @@ -364,7 +364,7 @@ namespace Step46 // introduction: { std::vector local_face_dof_indices( - stokes_fe.dofs_per_face); + stokes_fe.n_dofs_per_face()); for (const auto &cell : dof_handler.active_cell_iterators()) if (cell_is_in_fluid_domain(cell)) for (unsigned int face_no : GeometryInfo::face_indices()) @@ -498,8 +498,9 @@ namespace Step46 // ...to objects that are needed to describe the local contributions to // the global linear system... - const unsigned int stokes_dofs_per_cell = stokes_fe.dofs_per_cell; - const unsigned int elasticity_dofs_per_cell = elasticity_fe.dofs_per_cell; + const unsigned int stokes_dofs_per_cell = stokes_fe.n_dofs_per_cell(); + const unsigned int elasticity_dofs_per_cell = + elasticity_fe.n_dofs_per_cell(); FullMatrix local_matrix; FullMatrix local_interface_matrix(elasticity_dofs_per_cell, @@ -538,9 +539,9 @@ namespace Step46 const FEValues &fe_values = hp_fe_values.get_present_fe_values(); - local_matrix.reinit(cell->get_fe().dofs_per_cell, - cell->get_fe().dofs_per_cell); - local_rhs.reinit(cell->get_fe().dofs_per_cell); + local_matrix.reinit(cell->get_fe().n_dofs_per_cell(), + cell->get_fe().n_dofs_per_cell()); + local_rhs.reinit(cell->get_fe().n_dofs_per_cell()); // With all of this done, we continue to assemble the cell terms for // cells that are part of the Stokes and elastic regions. While we @@ -558,7 +559,7 @@ namespace Step46 // documentation module for the elasticity equations: if (cell_is_in_fluid_domain(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(); Assert(dofs_per_cell == stokes_dofs_per_cell, ExcInternalError()); for (unsigned int q = 0; q < fe_values.n_quadrature_points; ++q) @@ -584,7 +585,7 @@ namespace Step46 } else { - 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(); Assert(dofs_per_cell == elasticity_dofs_per_cell, ExcInternalError()); @@ -622,7 +623,7 @@ namespace Step46 // along since the elimination of nonzero boundary values requires the // modification of local and consequently also global right hand side // 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); constraints.distribute_local_to_global(local_matrix, local_rhs, diff --git a/examples/step-47/step-47.cc b/examples/step-47/step-47.cc index cfabc753cc..42d1b2754c 100644 --- a/examples/step-47/step-47.cc +++ b/examples/step-47/step-47.cc @@ -401,7 +401,7 @@ namespace Step47 const ExactSolution::RightHandSide right_hand_side; const unsigned int dofs_per_cell = - scratch_data.fe_values.get_fe().dofs_per_cell; + scratch_data.fe_values.get_fe().n_dofs_per_cell(); for (unsigned int qpoint = 0; qpoint < fe_values.n_quadrature_points; ++qpoint) @@ -713,7 +713,7 @@ namespace Step47 update_values | update_gradients | update_hessians | update_quadrature_points | update_JxW_values | update_normal_vectors); - CopyData copy_data(dof_handler.get_fe().dofs_per_cell); + CopyData copy_data(dof_handler.get_fe().n_dofs_per_cell()); MeshWorker::mesh_loop(dof_handler.begin_active(), dof_handler.end(), cell_worker, diff --git a/examples/step-5/step-5.cc b/examples/step-5/step-5.cc index 78c7ebd188..5b9d6710d8 100644 --- a/examples/step-5/step-5.cc +++ b/examples/step-5/step-5.cc @@ -169,7 +169,7 @@ void Step5::assemble_system() update_values | update_gradients | update_quadrature_points | update_JxW_values); - const unsigned int dofs_per_cell = fe.dofs_per_cell; + const unsigned int dofs_per_cell = fe.n_dofs_per_cell(); FullMatrix cell_matrix(dofs_per_cell, dofs_per_cell); Vector cell_rhs(dofs_per_cell); diff --git a/examples/step-50/step-50.cc b/examples/step-50/step-50.cc index b09a823792..7d3b4cc544 100644 --- a/examples/step-50/step-50.cc +++ b/examples/step-50/step-50.cc @@ -744,7 +744,7 @@ void LaplaceProblem::assemble_system() update_values | update_gradients | update_quadrature_points | update_JxW_values); - 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_q_points = quadrature_formula.size(); FullMatrix cell_matrix(dofs_per_cell, dofs_per_cell); @@ -816,7 +816,7 @@ void LaplaceProblem::assemble_multigrid() update_values | update_gradients | update_quadrature_points | update_JxW_values); - 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_q_points = quadrature_formula.size(); FullMatrix cell_matrix(dofs_per_cell, dofs_per_cell); diff --git a/examples/step-51/step-51.cc b/examples/step-51/step-51.cc index b44a8b022c..e8e1c1eb1a 100644 --- a/examples/step-51/step-51.cc +++ b/examples/step-51/step-51.cc @@ -436,7 +436,7 @@ namespace Step51 { DynamicSparsityPattern dsp(dof_handler.n_dofs()); DoFTools::make_sparsity_pattern(dof_handler, dsp, constraints, false); - sparsity_pattern.copy_from(dsp, fe.dofs_per_face); + sparsity_pattern.copy_from(dsp, fe.n_dofs_per_face()); } system_matrix.reinit(sparsity_pattern); } @@ -531,31 +531,31 @@ namespace Step51 face_quadrature_formula, local_face_flags) , fe_face_values(fe, face_quadrature_formula, flags) - , ll_matrix(fe_local.dofs_per_cell, fe_local.dofs_per_cell) - , lf_matrix(fe_local.dofs_per_cell, fe.dofs_per_cell) - , fl_matrix(fe.dofs_per_cell, fe_local.dofs_per_cell) - , tmp_matrix(fe.dofs_per_cell, fe_local.dofs_per_cell) - , l_rhs(fe_local.dofs_per_cell) - , tmp_rhs(fe_local.dofs_per_cell) - , q_phi(fe_local.dofs_per_cell) - , q_phi_div(fe_local.dofs_per_cell) - , u_phi(fe_local.dofs_per_cell) - , u_phi_grad(fe_local.dofs_per_cell) - , tr_phi(fe.dofs_per_cell) + , ll_matrix(fe_local.n_dofs_per_cell(), fe_local.n_dofs_per_cell()) + , lf_matrix(fe_local.n_dofs_per_cell(), fe.n_dofs_per_cell()) + , fl_matrix(fe.n_dofs_per_cell(), fe_local.n_dofs_per_cell()) + , tmp_matrix(fe.n_dofs_per_cell(), fe_local.n_dofs_per_cell()) + , l_rhs(fe_local.n_dofs_per_cell()) + , tmp_rhs(fe_local.n_dofs_per_cell()) + , q_phi(fe_local.n_dofs_per_cell()) + , q_phi_div(fe_local.n_dofs_per_cell()) + , u_phi(fe_local.n_dofs_per_cell()) + , u_phi_grad(fe_local.n_dofs_per_cell()) + , tr_phi(fe.n_dofs_per_cell()) , trace_values(face_quadrature_formula.size()) , fe_local_support_on_face(GeometryInfo::faces_per_cell) , fe_support_on_face(GeometryInfo::faces_per_cell) , exact_solution() { for (unsigned int face_no : GeometryInfo::face_indices()) - for (unsigned int i = 0; i < fe_local.dofs_per_cell; ++i) + for (unsigned int i = 0; i < fe_local.n_dofs_per_cell(); ++i) { if (fe_local.has_support_on_face(i, face_no)) fe_local_support_on_face[face_no].push_back(i); } for (unsigned int face_no : GeometryInfo::face_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_no)) fe_support_on_face[face_no].push_back(i); @@ -618,9 +618,9 @@ namespace Step51 , fe_values(fe, quadrature_formula, flags) , u_values(quadrature_formula.size()) , u_gradients(quadrature_formula.size()) - , cell_matrix(fe.dofs_per_cell, fe.dofs_per_cell) - , cell_rhs(fe.dofs_per_cell) - , cell_sol(fe.dofs_per_cell) + , cell_matrix(fe.n_dofs_per_cell(), fe.n_dofs_per_cell()) + , cell_rhs(fe.n_dofs_per_cell()) + , cell_sol(fe.n_dofs_per_cell()) {} PostProcessScratchData(const PostProcessScratchData &sd) @@ -670,7 +670,7 @@ namespace Step51 const UpdateFlags flags(update_values | update_normal_vectors | update_quadrature_points | update_JxW_values); - PerTaskData task_data(fe.dofs_per_cell, trace_reconstruct); + PerTaskData task_data(fe.n_dofs_per_cell(), trace_reconstruct); ScratchData scratch(fe, fe_local, quadrature_formula, @@ -712,7 +712,7 @@ namespace Step51 scratch.fe_face_values_local.get_quadrature().size(); const unsigned int loc_dofs_per_cell = - scratch.fe_values_local.get_fe().dofs_per_cell; + scratch.fe_values_local.get_fe().n_dofs_per_cell(); const FEValuesExtractors::Vector fluxes(0); const FEValuesExtractors::Scalar scalar(dim); diff --git a/examples/step-52/step-52.cc b/examples/step-52/step-52.cc index 2e6928bd83..7e7ef9b636 100644 --- a/examples/step-52/step-52.cc +++ b/examples/step-52/step-52.cc @@ -207,7 +207,7 @@ namespace Step52 update_values | update_gradients | update_JxW_values); - 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_q_points = quadrature_formula.size(); FullMatrix cell_matrix(dofs_per_cell, dofs_per_cell); @@ -301,7 +301,7 @@ namespace Step52 update_JxW_values); - 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_q_points = quadrature_formula.size(); Vector cell_source(dofs_per_cell); diff --git a/examples/step-55/step-55.cc b/examples/step-55/step-55.cc index 24027299dd..8b35d9f6ae 100644 --- a/examples/step-55/step-55.cc +++ b/examples/step-55/step-55.cc @@ -497,7 +497,7 @@ namespace Step55 update_values | update_gradients | update_quadrature_points | update_JxW_values); - 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_q_points = quadrature_formula.size(); FullMatrix cell_matrix(dofs_per_cell, dofs_per_cell); diff --git a/examples/step-56/step-56.cc b/examples/step-56/step-56.cc index 3a5f57b71d..4ccce37e98 100644 --- a/examples/step-56/step-56.cc +++ b/examples/step-56/step-56.cc @@ -620,7 +620,7 @@ namespace Step56 update_values | update_quadrature_points | update_JxW_values | update_gradients); - 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_q_points = quadrature_formula.size(); @@ -718,7 +718,7 @@ namespace Step56 update_values | update_quadrature_points | update_JxW_values | update_gradients); - const unsigned int dofs_per_cell = velocity_fe.dofs_per_cell; + const unsigned int dofs_per_cell = velocity_fe.n_dofs_per_cell(); const unsigned int n_q_points = quadrature_formula.size(); FullMatrix cell_matrix(dofs_per_cell, dofs_per_cell); diff --git a/examples/step-57/step-57.cc b/examples/step-57/step-57.cc index d43a68b2e4..b1982db5aa 100644 --- a/examples/step-57/step-57.cc +++ b/examples/step-57/step-57.cc @@ -375,7 +375,7 @@ namespace Step57 update_values | update_quadrature_points | update_JxW_values | update_gradients); - 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_q_points = quadrature_formula.size(); const FEValuesExtractors::Vector velocities(0); diff --git a/examples/step-58/step-58.cc b/examples/step-58/step-58.cc index 9a2674d8d2..32f29daed5 100644 --- a/examples/step-58/step-58.cc +++ b/examples/step-58/step-58.cc @@ -263,7 +263,7 @@ namespace Step58 update_values | update_gradients | update_quadrature_points | update_JxW_values); - 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_q_points = quadrature_formula.size(); FullMatrix> cell_matrix_lhs(dofs_per_cell, diff --git a/examples/step-6/step-6.cc b/examples/step-6/step-6.cc index 508c9f7c27..bc8b93a715 100644 --- a/examples/step-6/step-6.cc +++ b/examples/step-6/step-6.cc @@ -264,7 +264,7 @@ void Step6::assemble_system() update_values | update_gradients | update_quadrature_points | update_JxW_values); - const unsigned int dofs_per_cell = fe.dofs_per_cell; + const unsigned int dofs_per_cell = fe.n_dofs_per_cell(); FullMatrix cell_matrix(dofs_per_cell, dofs_per_cell); Vector cell_rhs(dofs_per_cell); diff --git a/examples/step-61/step-61.cc b/examples/step-61/step-61.cc index 459512886f..776f31e268 100644 --- a/examples/step-61/step-61.cc +++ b/examples/step-61/step-61.cc @@ -412,8 +412,8 @@ namespace Step61 update_quadrature_points | update_JxW_values); - const unsigned int dofs_per_cell = fe.dofs_per_cell; - const unsigned int dofs_per_cell_dgrt = fe_dgrt.dofs_per_cell; + const unsigned int dofs_per_cell = fe.n_dofs_per_cell(); + const unsigned int dofs_per_cell_dgrt = fe_dgrt.n_dofs_per_cell(); const unsigned int n_q_points = fe_values.get_quadrature().size(); const unsigned int n_q_points_dgrt = fe_values_dgrt.get_quadrature().size(); @@ -666,8 +666,8 @@ namespace Step61 update_quadrature_points | update_JxW_values); - const unsigned int dofs_per_cell = fe.dofs_per_cell; - const unsigned int dofs_per_cell_dgrt = fe_dgrt.dofs_per_cell; + const unsigned int dofs_per_cell = fe.n_dofs_per_cell(); + const unsigned int dofs_per_cell_dgrt = fe_dgrt.n_dofs_per_cell(); const unsigned int n_q_points = fe_values.get_quadrature().size(); const unsigned int n_q_points_dgrt = fe_values_dgrt.get_quadrature().size(); diff --git a/examples/step-62/step-62.cc b/examples/step-62/step-62.cc index 88ff8e2047..99bc192bd5 100644 --- a/examples/step-62/step-62.cc +++ b/examples/step-62/step-62.cc @@ -794,7 +794,7 @@ namespace step62 quadrature_formula, update_values | update_gradients | update_quadrature_points | update_JxW_values); - 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_q_points = quadrature_formula.size(); FullMatrix> cell_matrix(dofs_per_cell, dofs_per_cell); @@ -1228,7 +1228,7 @@ namespace step62 quadrature_cache.resize(triangulation.n_locally_owned_active_cells() * quadrature_formula.size(), - QuadratureCache(fe.dofs_per_cell)); + QuadratureCache(fe.n_dofs_per_cell())); unsigned int cache_index = 0; for (const auto &cell : triangulation.active_cell_iterators()) if (cell->is_locally_owned()) diff --git a/examples/step-63/step-63.cc b/examples/step-63/step-63.cc index 8a75ab4f08..3f24fc4268 100644 --- a/examples/step-63/step-63.cc +++ b/examples/step-63/step-63.cc @@ -701,7 +701,7 @@ namespace Step63 copy_data.level = cell->level(); const unsigned int dofs_per_cell = - scratch_data.fe_values.get_fe().dofs_per_cell; + scratch_data.fe_values.get_fe().n_dofs_per_cell(); copy_data.dofs_per_cell = dofs_per_cell; copy_data.cell_matrix.reinit(dofs_per_cell, dofs_per_cell); diff --git a/examples/step-64/step-64.cu b/examples/step-64/step-64.cu index 5e81d6c1b3..66e9e69e51 100644 --- a/examples/step-64/step-64.cu +++ b/examples/step-64/step-64.cu @@ -450,7 +450,7 @@ namespace Step64 update_values | update_quadrature_points | update_JxW_values); - 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_q_points = quadrature_formula.size(); Vector cell_rhs(dofs_per_cell); diff --git a/examples/step-65/step-65.cc b/examples/step-65/step-65.cc index f329184978..7986e091c2 100644 --- a/examples/step-65/step-65.cc +++ b/examples/step-65/step-65.cc @@ -381,7 +381,7 @@ namespace Step65 update_values | update_gradients | update_quadrature_points | update_JxW_values); - 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_q_points = quadrature_formula.size(); FullMatrix cell_matrix(dofs_per_cell, dofs_per_cell); diff --git a/examples/step-69/step-69.cc b/examples/step-69/step-69.cc index 07aa4c7e84..183a427e1a 100644 --- a/examples/step-69/step-69.cc +++ b/examples/step-69/step-69.cc @@ -767,7 +767,8 @@ namespace Step69 DynamicSparsityPattern dsp(n_locally_relevant, n_locally_relevant); - const auto dofs_per_cell = discretization->finite_element.dofs_per_cell; + const auto dofs_per_cell = + discretization->finite_element.n_dofs_per_cell(); std::vector dof_indices(dofs_per_cell); for (const auto &cell : dof_handler.active_cell_iterators()) @@ -1016,8 +1017,9 @@ namespace Step69 for (auto &matrix : nij_matrix) matrix = 0.; - unsigned int dofs_per_cell = discretization->finite_element.dofs_per_cell; - unsigned int n_q_points = discretization->quadrature.size(); + unsigned int dofs_per_cell = + discretization->finite_element.n_dofs_per_cell(); + unsigned int n_q_points = discretization->quadrature.size(); // What follows is the initialization of the scratch data required by // WorkStream diff --git a/examples/step-7/step-7.cc b/examples/step-7/step-7.cc index b48bdb9081..495d3dcf6a 100644 --- a/examples/step-7/step-7.cc +++ b/examples/step-7/step-7.cc @@ -539,7 +539,7 @@ namespace Step7 const unsigned int n_q_points = quadrature_formula.size(); const unsigned int n_face_q_points = face_quadrature_formula.size(); - const unsigned int dofs_per_cell = fe->dofs_per_cell; + const unsigned int dofs_per_cell = fe->n_dofs_per_cell(); FullMatrix cell_matrix(dofs_per_cell, dofs_per_cell); Vector cell_rhs(dofs_per_cell); diff --git a/examples/step-70/step-70.cc b/examples/step-70/step-70.cc index dbadf946e4..e887674939 100644 --- a/examples/step-70/step-70.cc +++ b/examples/step-70/step-70.cc @@ -1380,7 +1380,7 @@ namespace Step70 update_quadrature_points | update_JxW_values); - const unsigned int dofs_per_cell = fluid_fe->dofs_per_cell; + const unsigned int dofs_per_cell = fluid_fe->n_dofs_per_cell(); const unsigned int n_q_points = fluid_quadrature_formula->size(); FullMatrix cell_matrix(dofs_per_cell, dofs_per_cell); @@ -1473,11 +1473,11 @@ namespace Step70 SolidVelocity solid_velocity(par.angular_velocity); std::vector fluid_dof_indices( - fluid_fe->dofs_per_cell); + fluid_fe->n_dofs_per_cell()); - FullMatrix local_matrix(fluid_fe->dofs_per_cell, - fluid_fe->dofs_per_cell); - dealii::Vector local_rhs(fluid_fe->dofs_per_cell); + FullMatrix local_matrix(fluid_fe->n_dofs_per_cell(), + fluid_fe->n_dofs_per_cell()); + dealii::Vector local_rhs(fluid_fe->n_dofs_per_cell()); const auto penalty_parameter = 1.0 / GridTools::minimal_cell_diameter(fluid_tria); @@ -1527,13 +1527,14 @@ namespace Step70 const auto &real_q = p.get_location(); const auto &JxW = p.get_properties()[0]; - for (unsigned int i = 0; i < fluid_fe->dofs_per_cell; ++i) + for (unsigned int i = 0; i < fluid_fe->n_dofs_per_cell(); ++i) { const auto comp_i = fluid_fe->system_to_component_index(i).first; if (comp_i < spacedim) { - for (unsigned int j = 0; j < fluid_fe->dofs_per_cell; ++j) + for (unsigned int j = 0; j < fluid_fe->n_dofs_per_cell(); + ++j) { const auto comp_j = fluid_fe->system_to_component_index(j).first; diff --git a/examples/step-8/step-8.cc b/examples/step-8/step-8.cc index 0dda834deb..18e2c6e196 100644 --- a/examples/step-8/step-8.cc +++ b/examples/step-8/step-8.cc @@ -271,7 +271,7 @@ namespace Step8 update_values | update_gradients | update_quadrature_points | update_JxW_values); - 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_q_points = quadrature_formula.size(); FullMatrix cell_matrix(dofs_per_cell, dofs_per_cell); diff --git a/examples/step-9/step-9.cc b/examples/step-9/step-9.cc index 86daab2d0d..277093b63a 100644 --- a/examples/step-9/step-9.cc +++ b/examples/step-9/step-9.cc @@ -609,7 +609,7 @@ namespace Step9 AssemblyCopyData & copy_data) { // We define some abbreviations to avoid unnecessarily long lines: - 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_q_points = scratch_data.fe_values.get_quadrature().size(); const unsigned int n_face_q_points = diff --git a/include/deal.II/dofs/dof_accessor.templates.h b/include/deal.II/dofs/dof_accessor.templates.h index dffbaa2dfb..2f61a8c443 100644 --- a/include/deal.II/dofs/dof_accessor.templates.h +++ b/include/deal.II/dofs/dof_accessor.templates.h @@ -614,7 +614,7 @@ namespace internal accessor.set_mg_vertex_dof_index( level, vertex, dof, *next++, fe_index); - for (unsigned int dof = 0; dof < fe.dofs_per_line; ++dof) + for (unsigned int dof = 0; dof < fe.n_dofs_per_line(); ++dof) accessor.set_mg_dof_index(level, dof, *next++); Assert(next == dof_indices.end(), ExcInternalError()); @@ -640,10 +640,10 @@ namespace internal level, vertex, dof, *next++, fe_index); for (unsigned int line = 0; line < accessor.n_lines(); ++line) - for (unsigned int dof = 0; dof < fe.dofs_per_line; ++dof) + for (unsigned int dof = 0; dof < fe.n_dofs_per_line(); ++dof) accessor.line(line)->set_mg_dof_index(level, dof, *next++); - for (unsigned int dof = 0; dof < fe.dofs_per_quad; ++dof) + for (unsigned int dof = 0; dof < fe.n_dofs_per_quad(); ++dof) accessor.set_mg_dof_index(level, dof, *next++); Assert(next == dof_indices.end(), ExcInternalError()); @@ -670,7 +670,7 @@ namespace internal level, vertex, dof, *next++, fe_index); for (unsigned int line = 0; line < accessor.n_lines(); ++line) - for (unsigned int dof = 0; dof < fe.dofs_per_line; ++dof) + for (unsigned int dof = 0; dof < fe.n_dofs_per_line(); ++dof) accessor.line(line)->set_mg_dof_index( level, fe.adjust_line_dof_index_for_line_orientation( @@ -678,7 +678,7 @@ namespace internal *next++); for (unsigned int quad = 0; quad < accessor.n_faces(); ++quad) - for (unsigned int dof = 0; dof < fe.dofs_per_quad; ++dof) + for (unsigned int dof = 0; dof < fe.n_dofs_per_quad(); ++dof) accessor.quad(quad)->set_mg_dof_index( level, fe.adjust_quad_dof_index_for_face_orientation( @@ -688,7 +688,7 @@ namespace internal accessor.face_rotation(quad)), *next++); - for (unsigned int dof = 0; dof < fe.dofs_per_hex; ++dof) + for (unsigned int dof = 0; dof < fe.n_dofs_per_hex(); ++dof) accessor.set_mg_dof_index(level, dof, *next++); Assert(next == dof_indices.end(), ExcInternalError()); @@ -808,9 +808,9 @@ namespace internal { 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; // + dofs_per_line = accessor.get_fe(fe_index).n_dofs_per_line(), // + dofs_per_quad = accessor.get_fe(fe_index).n_dofs_per_quad(), // + dofs_per_hex = accessor.get_fe(fe_index).n_dofs_per_hex(); // const unsigned int inner_dofs = structdim == 1 ? dofs_per_line : @@ -1296,7 +1296,7 @@ namespace internal 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) + for (unsigned int dof = 0; dof < fe.n_dofs_per_line(); ++dof) *next++ = accessor.mg_dof_index(level, dof); Assert(next == dof_indices.end(), ExcInternalError()); @@ -1322,10 +1322,10 @@ namespace internal *next++ = accessor.mg_vertex_dof_index(level, vertex, dof); for (unsigned int line = 0; line < accessor.n_lines(); ++line) - for (unsigned int dof = 0; dof < fe.dofs_per_line; ++dof) + for (unsigned int dof = 0; dof < fe.n_dofs_per_line(); ++dof) *next++ = accessor.line(line)->mg_dof_index(level, dof); - for (unsigned int dof = 0; dof < fe.dofs_per_quad; ++dof) + for (unsigned int dof = 0; dof < fe.n_dofs_per_quad(); ++dof) *next++ = accessor.mg_dof_index(level, dof); Assert(next == dof_indices.end(), ExcInternalError()); @@ -1351,7 +1351,7 @@ namespace internal *next++ = accessor.mg_vertex_dof_index(level, vertex, dof); for (unsigned int line = 0; line < accessor.n_lines(); ++line) - for (unsigned int dof = 0; dof < fe.dofs_per_line; ++dof) + for (unsigned int dof = 0; dof < fe.n_dofs_per_line(); ++dof) *next++ = accessor.line(line)->mg_dof_index( level, accessor.get_fe(fe_index) @@ -1359,7 +1359,7 @@ namespace internal dof, accessor.line_orientation(line))); for (unsigned int quad = 0; quad < accessor.n_faces(); ++quad) - for (unsigned int dof = 0; dof < fe.dofs_per_quad; ++dof) + for (unsigned int dof = 0; dof < fe.n_dofs_per_quad(); ++dof) *next++ = accessor.quad(quad)->mg_dof_index( level, accessor.get_fe(fe_index) @@ -1369,7 +1369,7 @@ namespace internal accessor.face_flip(quad), accessor.face_rotation(quad))); - for (unsigned int dof = 0; dof < fe.dofs_per_hex; ++dof) + for (unsigned int dof = 0; dof < fe.n_dofs_per_hex(); ++dof) *next++ = accessor.mg_dof_index(level, dof); Assert(next == dof_indices.end(), ExcInternalError()); @@ -1407,7 +1407,7 @@ DoFAccessor::get_dof_indices( Assert(dof_indices.size() == (this->n_vertices() * this->dof_handler->get_fe(fe_index).n_dofs_per_vertex() + - this->dof_handler->get_fe(fe_index).dofs_per_line), + this->dof_handler->get_fe(fe_index).n_dofs_per_line()), ExcVectorDoesNotMatch()); break; case 2: @@ -1415,8 +1415,8 @@ DoFAccessor::get_dof_indices( (this->n_vertices() * 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), + this->dof_handler->get_fe(fe_index).n_dofs_per_line() + + this->dof_handler->get_fe(fe_index).n_dofs_per_quad()), ExcVectorDoesNotMatch()); break; case 3: @@ -1424,10 +1424,10 @@ DoFAccessor::get_dof_indices( (this->n_vertices() * 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).n_dofs_per_line() + this->n_faces() * - this->dof_handler->get_fe(fe_index).dofs_per_quad + - this->dof_handler->get_fe(fe_index).dofs_per_hex), + this->dof_handler->get_fe(fe_index).n_dofs_per_quad() + + this->dof_handler->get_fe(fe_index).n_dofs_per_hex()), ExcVectorDoesNotMatch()); break; default: @@ -1480,7 +1480,7 @@ DoFAccessor::get_mg_dof_indices( Assert(dof_indices.size() == (this->n_vertices() * this->dof_handler->get_fe(fe_index).n_dofs_per_vertex() + - this->dof_handler->get_fe(fe_index).dofs_per_line), + this->dof_handler->get_fe(fe_index).n_dofs_per_line()), ExcVectorDoesNotMatch()); break; case 2: @@ -1488,8 +1488,8 @@ DoFAccessor::get_mg_dof_indices( (this->n_vertices() * 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), + this->dof_handler->get_fe(fe_index).n_dofs_per_line() + + this->dof_handler->get_fe(fe_index).n_dofs_per_quad()), ExcVectorDoesNotMatch()); break; case 3: @@ -1497,10 +1497,10 @@ DoFAccessor::get_mg_dof_indices( (this->n_vertices() * 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).n_dofs_per_line() + this->n_faces() * - this->dof_handler->get_fe(fe_index).dofs_per_quad + - this->dof_handler->get_fe(fe_index).dofs_per_hex), + this->dof_handler->get_fe(fe_index).n_dofs_per_quad() + + this->dof_handler->get_fe(fe_index).n_dofs_per_hex()), ExcVectorDoesNotMatch()); break; default: @@ -1536,7 +1536,7 @@ DoFAccessor::set_mg_dof_indices( Assert(dof_indices.size() == this->n_vertices() * this->dof_handler->get_fe(fe_index).n_dofs_per_vertex() + - this->dof_handler->get_fe(fe_index).dofs_per_line, + this->dof_handler->get_fe(fe_index).n_dofs_per_line(), ExcVectorDoesNotMatch()); break; } @@ -1547,8 +1547,8 @@ DoFAccessor::set_mg_dof_indices( this->n_vertices() * 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, + this->dof_handler->get_fe(fe_index).n_dofs_per_line() + + this->dof_handler->get_fe(fe_index).n_dofs_per_quad(), ExcVectorDoesNotMatch()); break; } @@ -1559,10 +1559,10 @@ DoFAccessor::set_mg_dof_indices( this->n_vertices() * 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).n_dofs_per_line() + this->n_faces() * - this->dof_handler->get_fe(fe_index).dofs_per_quad + - this->dof_handler->get_fe(fe_index).dofs_per_hex, + this->dof_handler->get_fe(fe_index).n_dofs_per_quad() + + this->dof_handler->get_fe(fe_index).n_dofs_per_hex(), ExcVectorDoesNotMatch()); break; } diff --git a/include/deal.II/fe/fe.h b/include/deal.II/fe/fe.h index 49d7098419..586a3784ff 100644 --- a/include/deal.II/fe/fe.h +++ b/include/deal.II/fe/fe.h @@ -3289,11 +3289,11 @@ FiniteElement::get_associated_geometry_primitive( // just go through the usual cases, taking into account how DoFs // are enumerated on the reference cell - if (cell_dof_index < this->first_line_index) + if (cell_dof_index < this->get_first_line_index()) return GeometryPrimitive::vertex; - else if (cell_dof_index < this->first_quad_index) + else if (cell_dof_index < this->get_first_quad_index()) return GeometryPrimitive::line; - else if (cell_dof_index < this->first_hex_index) + else if (cell_dof_index < this->get_first_hex_index()) return GeometryPrimitive::quad; else return GeometryPrimitive::hex; diff --git a/include/deal.II/fe/fe_base.h b/include/deal.II/fe/fe_base.h index 653dc07b47..938a6d6a72 100644 --- a/include/deal.II/fe/fe_base.h +++ b/include/deal.II/fe/fe_base.h @@ -446,6 +446,36 @@ public: */ bool operator==(const FiniteElementData &) const; + + /** + * Return first index of dof on a line. + */ + unsigned int + get_first_line_index() const; + + /** + * Return first index of dof on a quad. + */ + unsigned int + get_first_quad_index() const; + + /** + * Return first index of dof on a hexahedron. + */ + unsigned int + get_first_hex_index() const; + + /** + * Return first index of dof on a line for face data. + */ + unsigned int + get_first_face_line_index() const; + + /** + * Return first index of dof on a quad for face data. + */ + unsigned int + get_first_face_quad_index() const; }; @@ -623,6 +653,43 @@ FiniteElementData::conforms(const Conformity space) const } + +template +unsigned int +FiniteElementData::get_first_line_index() const +{ + return first_line_index; +} + +template +unsigned int +FiniteElementData::get_first_quad_index() const +{ + return first_quad_index; +} + +template +unsigned int +FiniteElementData::get_first_hex_index() const +{ + return first_hex_index; +} + +template +unsigned int +FiniteElementData::get_first_face_line_index() const +{ + return first_face_line_index; +} + +template +unsigned int +FiniteElementData::get_first_face_quad_index() const +{ + return first_face_quad_index; +} + + #endif // DOXYGEN diff --git a/include/deal.II/fe/fe_poly_face.templates.h b/include/deal.II/fe/fe_poly_face.templates.h index 9599cc539a..fb94219cc1 100644 --- a/include/deal.II/fe/fe_poly_face.templates.h +++ b/include/deal.II/fe/fe_poly_face.templates.h @@ -141,14 +141,16 @@ FE_PolyFace::fill_fe_face_values( case 3: { // Fill data for quad shape functions - if (this->dofs_per_quad != 0) + if (this->n_dofs_per_quad() != 0) { const unsigned int foffset = - this->first_quad_index + this->dofs_per_quad * face_no; - for (unsigned int k = 0; k < this->dofs_per_quad; ++k) + this->get_first_quad_index() + + this->n_dofs_per_quad() * face_no; + for (unsigned int k = 0; k < this->n_dofs_per_quad(); ++k) output_data.shape_values(foffset + k, i) = fe_data - .shape_values[k + this->first_face_quad_index][i]; + .shape_values[k + this->get_first_face_quad_index()] + [i]; } } DEAL_II_FALLTHROUGH; @@ -156,24 +158,24 @@ FE_PolyFace::fill_fe_face_values( case 2: { // Fill data for line shape functions - if (this->dofs_per_line != 0) + if (this->n_dofs_per_line() != 0) { - const unsigned int foffset = this->first_line_index; + const unsigned int foffset = this->get_first_line_index(); for (unsigned int line = 0; line < GeometryInfo::lines_per_face; ++line) { - for (unsigned int k = 0; k < this->dofs_per_line; ++k) + for (unsigned int k = 0; k < this->n_dofs_per_line(); + ++k) output_data.shape_values( foffset + GeometryInfo::face_to_cell_lines(face_no, line) * - this->dofs_per_line + + this->n_dofs_per_line() + k, - i) = - fe_data - .shape_values[k + (line * this->dofs_per_line) + - this->first_face_line_index][i]; + i) = fe_data.shape_values + [k + (line * this->n_dofs_per_line()) + + this->get_first_face_line_index()][i]; } } } diff --git a/include/deal.II/fe/fe_tools.templates.h b/include/deal.II/fe/fe_tools.templates.h index bd25eb58be..0f5eb724df 100644 --- a/include/deal.II/fe/fe_tools.templates.h +++ b/include/deal.II/fe/fe_tools.templates.h @@ -109,10 +109,11 @@ namespace FETools multiplied_dofs_per_vertex += fes[i]->n_dofs_per_vertex() * multiplicities[i]; multiplied_dofs_per_line += - fes[i]->dofs_per_line * multiplicities[i]; + fes[i]->n_dofs_per_line() * multiplicities[i]; multiplied_dofs_per_quad += - fes[i]->dofs_per_quad * multiplicities[i]; - multiplied_dofs_per_hex += fes[i]->dofs_per_hex * multiplicities[i]; + fes[i]->n_dofs_per_quad() * multiplicities[i]; + multiplied_dofs_per_hex += + fes[i]->n_dofs_per_hex() * multiplicities[i]; multiplied_n_components += fes[i]->n_components() * multiplicities[i]; @@ -255,12 +256,12 @@ 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_line; + local_index < fes[base]->n_dofs_per_line(); ++local_index, ++total_index) { const unsigned int index_in_base = - (fes[base]->dofs_per_line * line_number + local_index + - fes[base]->first_line_index); + (fes[base]->n_dofs_per_line() * line_number + local_index + + fes[base]->get_first_line_index()); Assert(index_in_base < fes[base]->n_dofs_per_cell(), ExcInternalError()); @@ -277,12 +278,12 @@ 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_quad; + local_index < fes[base]->n_dofs_per_quad(); ++local_index, ++total_index) { const unsigned int index_in_base = - (fes[base]->dofs_per_quad * quad_number + local_index + - fes[base]->first_quad_index); + (fes[base]->n_dofs_per_quad() * quad_number + local_index + + fes[base]->get_first_quad_index()); Assert(index_in_base < fes[base]->n_dofs_per_cell(), ExcInternalError()); @@ -299,12 +300,12 @@ 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_hex; + local_index < fes[base]->n_dofs_per_hex(); ++local_index, ++total_index) { const unsigned int index_in_base = - (fes[base]->dofs_per_hex * hex_number + local_index + - fes[base]->first_hex_index); + (fes[base]->n_dofs_per_hex() * hex_number + local_index + + fes[base]->get_first_hex_index()); Assert(index_in_base < fes[base]->n_dofs_per_cell(), ExcInternalError()); @@ -460,12 +461,12 @@ namespace FETools comp_start += fes[base]->n_components() * do_tensor_product) for (unsigned int local_index = 0; - local_index < fes[base]->dofs_per_line; + local_index < fes[base]->n_dofs_per_line(); ++local_index, ++total_index) { const unsigned int index_in_base = - (fes[base]->dofs_per_line * line_number + local_index + - fes[base]->first_line_index); + (fes[base]->n_dofs_per_line() * line_number + local_index + + fes[base]->get_first_line_index()); Assert(comp_start + fes[base]->n_components() <= retval[total_index].size(), @@ -494,12 +495,12 @@ namespace FETools comp_start += fes[base]->n_components() * do_tensor_product) for (unsigned int local_index = 0; - local_index < fes[base]->dofs_per_quad; + local_index < fes[base]->n_dofs_per_quad(); ++local_index, ++total_index) { const unsigned int index_in_base = - (fes[base]->dofs_per_quad * quad_number + local_index + - fes[base]->first_quad_index); + (fes[base]->n_dofs_per_quad() * quad_number + local_index + + fes[base]->get_first_quad_index()); Assert(comp_start + fes[base]->n_components() <= retval[total_index].size(), @@ -528,12 +529,12 @@ namespace FETools comp_start += fes[base]->n_components() * do_tensor_product) for (unsigned int local_index = 0; - local_index < fes[base]->dofs_per_hex; + local_index < fes[base]->n_dofs_per_hex(); ++local_index, ++total_index) { const unsigned int index_in_base = - (fes[base]->dofs_per_hex * hex_number + local_index + - fes[base]->first_hex_index); + (fes[base]->n_dofs_per_hex() * hex_number + local_index + + fes[base]->get_first_hex_index()); Assert(comp_start + fes[base]->n_components() <= retval[total_index].size(), @@ -711,12 +712,13 @@ 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_line; + local_index < fe.base_element(base).n_dofs_per_line(); ++local_index, ++total_index) { const unsigned int index_in_base = - (fe.base_element(base).dofs_per_line * line_number + - local_index + fe.base_element(base).first_line_index); + (fe.base_element(base).n_dofs_per_line() * line_number + + local_index + + fe.base_element(base).get_first_line_index()); system_to_base_table[total_index] = std::make_pair(std::make_pair(base, m), index_in_base); @@ -754,12 +756,13 @@ 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_quad; + local_index < fe.base_element(base).n_dofs_per_quad(); ++local_index, ++total_index) { const unsigned int index_in_base = - (fe.base_element(base).dofs_per_quad * quad_number + - local_index + fe.base_element(base).first_quad_index); + (fe.base_element(base).n_dofs_per_quad() * quad_number + + local_index + + fe.base_element(base).get_first_quad_index()); system_to_base_table[total_index] = std::make_pair(std::make_pair(base, m), index_in_base); @@ -797,12 +800,12 @@ 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_hex; + local_index < fe.base_element(base).n_dofs_per_hex(); ++local_index, ++total_index) { const unsigned int index_in_base = - (fe.base_element(base).dofs_per_hex * hex_number + - local_index + fe.base_element(base).first_hex_index); + (fe.base_element(base).n_dofs_per_hex() * hex_number + + local_index + fe.base_element(base).get_first_hex_index()); system_to_base_table[total_index] = std::make_pair(std::make_pair(base, m), index_in_base); @@ -916,17 +919,18 @@ 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_line; + local_index < fe.base_element(base).n_dofs_per_line(); ++local_index, ++total_index) { // do everything alike for this type of object const unsigned int index_in_base = - (fe.base_element(base).dofs_per_line * line_number + - local_index + fe.base_element(base).first_line_index); + (fe.base_element(base).n_dofs_per_line() * line_number + + local_index + + fe.base_element(base).get_first_line_index()); const unsigned int face_index_in_base = - (fe.base_element(base).first_face_line_index + - fe.base_element(base).dofs_per_line * line_number + + (fe.base_element(base).get_first_face_line_index() + + fe.base_element(base).n_dofs_per_line() * line_number + local_index); face_system_to_base_table[total_index] = @@ -965,17 +969,18 @@ 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_quad; + local_index < fe.base_element(base).n_dofs_per_quad(); ++local_index, ++total_index) { // do everything alike for this type of object const unsigned int index_in_base = - (fe.base_element(base).dofs_per_quad * quad_number + - local_index + fe.base_element(base).first_quad_index); + (fe.base_element(base).n_dofs_per_quad() * quad_number + + local_index + + fe.base_element(base).get_first_quad_index()); const unsigned int face_index_in_base = - (fe.base_element(base).first_face_quad_index + - fe.base_element(base).dofs_per_quad * quad_number + + (fe.base_element(base).get_first_face_quad_index() + + fe.base_element(base).n_dofs_per_quad() * quad_number + local_index); face_system_to_base_table[total_index] = @@ -1000,7 +1005,7 @@ namespace FETools non_primitive_index; } } - Assert(total_index == fe.dofs_per_face, ExcInternalError()); + Assert(total_index == fe.n_dofs_per_face(), ExcInternalError()); Assert(total_index == face_system_to_component_table.size(), ExcInternalError()); Assert(total_index == face_system_to_base_table.size(), @@ -1919,7 +1924,7 @@ namespace FETools Assert(face_fine == 0, ExcNotImplemented()); const unsigned int nc = GeometryInfo::max_children_per_face; - const unsigned int n = fe.dofs_per_face; + const unsigned int n = fe.n_dofs_per_face(); const unsigned int nd = fe.n_components(); const unsigned int degree = fe.degree; @@ -1959,14 +1964,14 @@ namespace FETools for (unsigned int i = 1; i <= GeometryInfo::lines_per_face; ++i) { const unsigned int offset_c = - fe.first_line_index + + fe.get_first_line_index() + GeometryInfo::face_to_cell_lines(face_coarse, i - 1) * - fe.dofs_per_line; + fe.n_dofs_per_line(); const unsigned int offset_f = - fe.first_line_index + + fe.get_first_line_index() + GeometryInfo::face_to_cell_lines(face_fine, i - 1) * - fe.dofs_per_line; - for (unsigned int j = 0; j < fe.dofs_per_line; ++j) + fe.n_dofs_per_line(); + for (unsigned int j = 0; j < fe.n_dofs_per_line(); ++j) { face_c_dofs[face_dof] = offset_c + j; face_f_dofs[face_dof] = offset_f + j; @@ -1976,17 +1981,17 @@ namespace FETools for (unsigned int i = 1; i <= GeometryInfo::quads_per_face; ++i) { const unsigned int offset_c = - fe.first_quad_index + face_coarse * fe.dofs_per_quad; + fe.get_first_quad_index() + face_coarse * fe.n_dofs_per_quad(); const unsigned int offset_f = - fe.first_quad_index + face_fine * fe.dofs_per_quad; - for (unsigned int j = 0; j < fe.dofs_per_quad; ++j) + fe.get_first_quad_index() + face_fine * fe.n_dofs_per_quad(); + for (unsigned int j = 0; j < fe.n_dofs_per_quad(); ++j) { face_c_dofs[face_dof] = offset_c + j; face_f_dofs[face_dof] = offset_f + j; ++face_dof; } } - Assert(face_dof == fe.dofs_per_face, ExcInternalError()); + Assert(face_dof == fe.n_dofs_per_face(), ExcInternalError()); } // Set up meshes, one with a single @@ -3289,7 +3294,7 @@ namespace FETools { 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); + hierarchic_to_lexicographic_numbering(fe.n_dofs_per_line() + 1, h2l); } @@ -3299,7 +3304,7 @@ namespace FETools hierarchic_to_lexicographic_numbering(const FiniteElementData &fe) { Assert(fe.n_components() == 1, ExcInvalidFE()); - return hierarchic_to_lexicographic_numbering(fe.dofs_per_line + 1); + return hierarchic_to_lexicographic_numbering(fe.n_dofs_per_line() + 1); } diff --git a/include/deal.II/fe/fe_tools_extrapolate.templates.h b/include/deal.II/fe/fe_tools_extrapolate.templates.h index 1abefa66ec..9f622655ad 100644 --- a/include/deal.II/fe/fe_tools_extrapolate.templates.h +++ b/include/deal.II/fe/fe_tools_extrapolate.templates.h @@ -1413,7 +1413,7 @@ namespace FETools // exclude dofs on more refined ghosted cells const FiniteElement &fe = dof2.get_fe(); - const unsigned int dofs_per_face = fe.dofs_per_face; + const unsigned int dofs_per_face = fe.n_dofs_per_face(); if (dofs_per_face > 0) { const unsigned int dofs_per_cell = fe.n_dofs_per_cell(); diff --git a/include/deal.II/hp/fe_collection.h b/include/deal.II/hp/fe_collection.h index cf2138110f..2dfe8194f1 100644 --- a/include/deal.II/hp/fe_collection.h +++ b/include/deal.II/hp/fe_collection.h @@ -900,8 +900,8 @@ namespace hp unsigned int max = 0; for (unsigned int i = 0; i < finite_elements.size(); ++i) - if (finite_elements[i]->dofs_per_line > max) - max = finite_elements[i]->dofs_per_line; + if (finite_elements[i]->n_dofs_per_line() > max) + max = finite_elements[i]->n_dofs_per_line(); return max; } @@ -916,8 +916,8 @@ namespace hp unsigned int max = 0; for (unsigned int i = 0; i < finite_elements.size(); ++i) - if (finite_elements[i]->dofs_per_quad > max) - max = finite_elements[i]->dofs_per_quad; + if (finite_elements[i]->n_dofs_per_quad() > max) + max = finite_elements[i]->n_dofs_per_quad(); return max; } @@ -932,8 +932,8 @@ namespace hp unsigned int max = 0; for (unsigned int i = 0; i < finite_elements.size(); ++i) - if (finite_elements[i]->dofs_per_hex > max) - max = finite_elements[i]->dofs_per_hex; + if (finite_elements[i]->n_dofs_per_hex() > max) + max = finite_elements[i]->n_dofs_per_hex(); return max; } @@ -948,8 +948,8 @@ namespace hp unsigned int max = 0; for (unsigned int i = 0; i < finite_elements.size(); ++i) - if (finite_elements[i]->dofs_per_face > max) - max = finite_elements[i]->dofs_per_face; + if (finite_elements[i]->n_dofs_per_face() > max) + max = finite_elements[i]->n_dofs_per_face(); return max; } diff --git a/include/deal.II/matrix_free/cuda_hanging_nodes_internal.h b/include/deal.II/matrix_free/cuda_hanging_nodes_internal.h index 01a3ea6970..7e993a6d11 100644 --- a/include/deal.II/matrix_free/cuda_hanging_nodes_internal.h +++ b/include/deal.II/matrix_free/cuda_hanging_nodes_internal.h @@ -141,24 +141,24 @@ namespace CUDAWrappers setup_constraint_weigths(unsigned int fe_degree) { FE_Q<2> fe_q(fe_degree); - FullMatrix interpolation_matrix(fe_q.dofs_per_face, - fe_q.dofs_per_face); + FullMatrix interpolation_matrix(fe_q.n_dofs_per_face(), + fe_q.n_dofs_per_face()); fe_q.get_subface_interpolation_matrix(fe_q, 0, interpolation_matrix); std::vector mapping = FETools::lexicographic_to_hierarchic_numbering<1>(fe_degree); - FullMatrix mapped_matrix(fe_q.dofs_per_face, - fe_q.dofs_per_face); - for (unsigned int i = 0; i < fe_q.dofs_per_face; ++i) - for (unsigned int j = 0; j < fe_q.dofs_per_face; ++j) + FullMatrix mapped_matrix(fe_q.n_dofs_per_face(), + fe_q.n_dofs_per_face()); + for (unsigned int i = 0; i < fe_q.n_dofs_per_face(); ++i) + for (unsigned int j = 0; j < fe_q.n_dofs_per_face(); ++j) mapped_matrix(i, j) = interpolation_matrix(mapping[i], mapping[j]); cudaError_t error_code = cudaMemcpyToSymbol(internal::constraint_weights, &mapped_matrix[0][0], - sizeof(double) * fe_q.dofs_per_face * - fe_q.dofs_per_face); + sizeof(double) * fe_q.n_dofs_per_face() * + fe_q.n_dofs_per_face()); AssertCuda(error_code); } } // namespace internal diff --git a/include/deal.II/matrix_free/matrix_free.templates.h b/include/deal.II/matrix_free/matrix_free.templates.h index e1a33459e0..19e6710dac 100644 --- a/include/deal.II/matrix_free/matrix_free.templates.h +++ b/include/deal.II/matrix_free/matrix_free.templates.h @@ -760,7 +760,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.n_dofs_per_cell()); - dof_info[no].dofs_per_face.push_back(fe.dofs_per_face); + dof_info[no].dofs_per_face.push_back(fe.n_dofs_per_face()); dof_info[no].dimension = dim; dof_info[no].n_base_elements = fe.n_base_elements(); dof_info[no].n_components.resize(dof_info[no].n_base_elements); diff --git a/include/deal.II/multigrid/mg_constrained_dofs.h b/include/deal.II/multigrid/mg_constrained_dofs.h index beddf94a71..b115930f73 100644 --- a/include/deal.II/multigrid/mg_constrained_dofs.h +++ b/include/deal.II/multigrid/mg_constrained_dofs.h @@ -290,7 +290,7 @@ MGConstrainedDoFs::initialize(const DoFHandler &dof) } const unsigned int dofs_per_face = - cell->face(f)->get_fe(0).dofs_per_face; + cell->face(f)->get_fe(0).n_dofs_per_face(); std::vector dofs_1(dofs_per_face); std::vector dofs_2(dofs_per_face); diff --git a/include/deal.II/numerics/matrix_creator.templates.h b/include/deal.II/numerics/matrix_creator.templates.h index d1fd6b72f0..3b37e5b399 100644 --- a/include/deal.II/numerics/matrix_creator.templates.h +++ b/include/deal.II/numerics/matrix_creator.templates.h @@ -948,7 +948,7 @@ namespace MatrixCreator const bool fe_is_system = (n_components != 1); const bool fe_is_primitive = fe.is_primitive(); - const unsigned int dofs_per_face = fe.dofs_per_face; + const unsigned int dofs_per_face = fe.n_dofs_per_face(); copy_data.cell = cell; copy_data.dofs_per_cell = fe.n_dofs_per_cell(); @@ -1379,7 +1379,7 @@ namespace MatrixCreator const FiniteElement &fe = cell->get_fe(); const bool fe_is_system = (n_components != 1); const bool fe_is_primitive = fe.is_primitive(); - const unsigned int dofs_per_face = fe.dofs_per_face; + const unsigned int dofs_per_face = fe.n_dofs_per_face(); copy_data.cell = cell; copy_data.dofs_per_cell = fe.n_dofs_per_cell(); diff --git a/include/deal.II/numerics/vector_tools_boundary.templates.h b/include/deal.II/numerics/vector_tools_boundary.templates.h index 0088a8d8ba..0e8c79faf0 100644 --- a/include/deal.II/numerics/vector_tools_boundary.templates.h +++ b/include/deal.II/numerics/vector_tools_boundary.templates.h @@ -194,9 +194,9 @@ namespace VectorTools // components we are interested in are primitive (by the above // check), we can safely put such a check in front std::vector> unit_support_points( - fe.dofs_per_face); + fe.n_dofs_per_face()); - for (unsigned int i = 0; i < fe.dofs_per_face; ++i) + for (unsigned int i = 0; i < fe.n_dofs_per_face(); ++i) if (fe.is_primitive(fe.face_to_cell_index(i, 0))) if (component_mask[fe.face_system_to_component_index(i) .first] == true) @@ -260,7 +260,7 @@ namespace VectorTools // element in use here has DoFs on the face at all if ((function_map.find(boundary_component) != function_map.end()) && - (cell->get_fe().dofs_per_face > 0)) + (cell->get_fe().n_dofs_per_face() > 0)) { // face is of the right component x_fe_values.reinit(cell, face_no); @@ -269,7 +269,7 @@ namespace VectorTools // get indices, physical location and boundary values of // dofs on this face - face_dofs.resize(fe.dofs_per_face); + face_dofs.resize(fe.n_dofs_per_face()); face->get_dof_indices(face_dofs, cell->active_fe_index()); const std::vector> &dof_locations = fe_values.get_quadrature_points(); @@ -278,12 +278,12 @@ namespace VectorTools { // resize array. avoid construction of a memory // allocating temporary if possible - if (dof_values_system.size() < fe.dofs_per_face) - dof_values_system.resize(fe.dofs_per_face, + if (dof_values_system.size() < fe.n_dofs_per_face()) + dof_values_system.resize(fe.n_dofs_per_face(), Vector( fe.n_components())); else - dof_values_system.resize(fe.dofs_per_face); + dof_values_system.resize(fe.n_dofs_per_face()); function_map.find(boundary_component) ->second->vector_value_list(dof_locations, @@ -317,14 +317,16 @@ namespace VectorTools (i < 4 * fe.n_dofs_per_vertex() ? i : (i < 4 * fe.n_dofs_per_vertex() + - 4 * fe.dofs_per_line ? + 4 * + fe.n_dofs_per_line() ? i + 4 * fe.n_dofs_per_vertex() : i + 4 * fe.n_dofs_per_vertex() + - 8 * fe.dofs_per_line)) : + 8 * + fe.n_dofs_per_line())) : numbers::invalid_unsigned_int))); Assert(cell_i < fe.n_dofs_per_cell(), ExcInternalError()); @@ -358,7 +360,7 @@ namespace VectorTools // fe has only one component, so save some computations { // get only the one component that this function has - dof_values_scalar.resize(fe.dofs_per_face); + dof_values_scalar.resize(fe.n_dofs_per_face()); function_map.find(boundary_component) ->second->value_list(dof_locations, dof_values_scalar, @@ -1024,7 +1026,7 @@ namespace VectorTools // Compute the degrees of // freedom. - for (unsigned int i = 0; i < fe.dofs_per_face; ++i) + for (unsigned int i = 0; i < fe.n_dofs_per_face(); ++i) if (((dynamic_cast *>(&fe) != nullptr) && (fe.system_to_base_index(fe.face_to_cell_index(i, face)) .first == base_indices) && @@ -1199,7 +1201,7 @@ namespace VectorTools // Compute the degrees // of freedom. - for (unsigned int i = 0; i < fe.dofs_per_face; ++i) + for (unsigned int i = 0; i < fe.n_dofs_per_face(); ++i) if (((dynamic_cast *>(&fe) != nullptr) && (fe.system_to_base_index( @@ -1269,7 +1271,7 @@ namespace VectorTools for (unsigned int d = 0; d < dim; ++d) tmp[d] = values[q_point](first_vector_component + d); - for (unsigned int i = 0; i < fe.dofs_per_face; ++i) + for (unsigned int i = 0; i < fe.n_dofs_per_face(); ++i) if (((dynamic_cast *>(&fe) != nullptr) && (fe.system_to_base_index( @@ -1335,7 +1337,7 @@ namespace VectorTools unsigned int index = 0; - for (unsigned int i = 0; i < fe.dofs_per_face; ++i) + for (unsigned int i = 0; i < fe.n_dofs_per_face(); ++i) if (((dynamic_cast *>(&fe) != nullptr) && (fe.system_to_base_index( @@ -1389,7 +1391,7 @@ namespace VectorTools { unsigned int index = 0; - for (unsigned int i = 0; i < fe.dofs_per_face; ++i) + for (unsigned int i = 0; i < fe.n_dofs_per_face(); ++i) if (((dynamic_cast *>(&fe) != nullptr) && (fe.system_to_base_index(fe.face_to_cell_index(i, face)) .first == base_indices) && @@ -1429,7 +1431,7 @@ namespace VectorTools for (unsigned int d = 0; d < dim; ++d) tmp[d] = values[q_point](first_vector_component + d); - for (unsigned int i = 0; i < fe.dofs_per_face; ++i) + for (unsigned int i = 0; i < fe.n_dofs_per_face(); ++i) if (((dynamic_cast *>(&fe) != nullptr) && (fe.system_to_base_index( @@ -1485,7 +1487,7 @@ namespace VectorTools unsigned int index = 0; - for (unsigned int i = 0; i < fe.dofs_per_face; ++i) + for (unsigned int i = 0; i < fe.n_dofs_per_face(); ++i) if (((dynamic_cast *>(&fe) != nullptr) && (fe.system_to_base_index( @@ -1525,7 +1527,7 @@ namespace VectorTools unsigned int index = 0; - for (unsigned int i = 0; i < fe.dofs_per_face; ++i) + for (unsigned int i = 0; i < fe.n_dofs_per_face(); ++i) if (((dynamic_cast *>(&fe) != nullptr) && (fe.system_to_base_index(fe.face_to_cell_index(i, face)) .first == base_indices) && @@ -1581,7 +1583,7 @@ namespace VectorTools // corresponding degrees of freedom. const unsigned int superdegree = dof_handler.get_fe().degree; const QGauss reference_face_quadrature(2 * superdegree); - const unsigned int dofs_per_face = dof_handler.get_fe().dofs_per_face; + const unsigned int dofs_per_face = dof_handler.get_fe().n_dofs_per_face(); const hp::FECollection &fe_collection(dof_handler.get_fe_collection()); const hp::MappingCollection mapping_collection(mapping); hp::QCollection face_quadrature_collection; @@ -1858,7 +1860,7 @@ namespace VectorTools } const unsigned int dofs_per_face = - cell->get_fe().dofs_per_face; + cell->get_fe().n_dofs_per_face(); dofs_processed.resize(dofs_per_face); dof_values.resize(dofs_per_face); @@ -1951,7 +1953,7 @@ namespace VectorTools const unsigned int superdegree = cell->get_fe().degree; const unsigned int degree = superdegree - 1; const unsigned int dofs_per_face = - cell->get_fe().dofs_per_face; + cell->get_fe().n_dofs_per_face(); dofs_processed.resize(dofs_per_face); dof_values.resize(dofs_per_face); @@ -2137,7 +2139,7 @@ namespace VectorTools .face_to_cell_index((line + 1) * (degree + 1) - 1, face); unsigned int associated_edge_dof_index = 0; - for (unsigned int line_dof_idx = 0; line_dof_idx < fe.dofs_per_line; + for (unsigned int line_dof_idx = 0; line_dof_idx < fe.n_dofs_per_line(); ++line_dof_idx) { // For each DoF associated with the (interior of) the line, we need @@ -2155,7 +2157,7 @@ namespace VectorTools const unsigned int face_dof_idx = GeometryInfo::vertices_per_face * fe.n_dofs_per_vertex() + - line * fe.dofs_per_line + line_dof_idx; + line * fe.n_dofs_per_line() + line_dof_idx; // Note, assuming that the edge orientations are "standard" // i.e. cell->line_orientation(line) = true. @@ -2426,7 +2428,7 @@ namespace VectorTools 1); unsigned int associated_edge_dof_index = 0; - for (unsigned int face_idx = 0; face_idx < fe.dofs_per_face; + for (unsigned int face_idx = 0; face_idx < fe.n_dofs_per_face(); ++face_idx) { const unsigned int cell_idx = @@ -2572,7 +2574,7 @@ namespace VectorTools unsigned int associated_edge_dof_index = 0; for (unsigned int line_dof_idx = 0; - line_dof_idx < fe.dofs_per_line; + line_dof_idx < fe.n_dofs_per_line(); ++line_dof_idx) { // For each DoF associated with the (interior of) the @@ -2591,7 +2593,7 @@ namespace VectorTools const unsigned int face_dof_idx = GeometryInfo::vertices_per_face * fe.n_dofs_per_vertex() + - line * fe.dofs_per_line + line_dof_idx; + line * fe.n_dofs_per_line() + line_dof_idx; // Next, translate from face to cell. Note, this might be // assuming that the edge orientations are "standard" (not @@ -2661,13 +2663,13 @@ namespace VectorTools // Loop over these quad-interior dofs. unsigned int associated_face_dof_index = 0; for (unsigned int quad_dof_idx = 0; - quad_dof_idx < fe.dofs_per_quad; + quad_dof_idx < fe.n_dofs_per_quad(); ++quad_dof_idx) { const unsigned int face_idx = GeometryInfo::vertices_per_face * fe.n_dofs_per_vertex() + - lines_per_face * fe.dofs_per_line + quad_dof_idx; + lines_per_face * fe.n_dofs_per_line() + quad_dof_idx; const unsigned int cell_idx = fe.face_to_cell_index(face_idx, face); if (((dynamic_cast *>(&fe) != nullptr) && @@ -2923,7 +2925,7 @@ namespace VectorTools } const unsigned int dofs_per_face = - cell->get_fe().dofs_per_face; + cell->get_fe().n_dofs_per_face(); dofs_processed.resize(dofs_per_face); dof_values.resize(dofs_per_face); @@ -3049,7 +3051,7 @@ namespace VectorTools cell->get_fe().degree; const unsigned int degree = superdegree - 1; const unsigned int dofs_per_face = - cell->get_fe().dofs_per_face; + cell->get_fe().n_dofs_per_face(); dofs_processed.resize(dofs_per_face); dof_values.resize(dofs_per_face); @@ -3204,7 +3206,7 @@ namespace VectorTools 0}; std::vector> values(fe_values.n_quadrature_points, Vector(2)); - Vector dof_values(fe.dofs_per_face); + Vector dof_values(fe.n_dofs_per_face()); // Get the values of the boundary function at the quadrature points. { @@ -3229,7 +3231,7 @@ namespace VectorTools jacobians[q_point][1][face_coordinate_direction[face]] * jacobians[q_point][1][face_coordinate_direction[face]]); - for (unsigned int i = 0; i < fe.dofs_per_face; ++i) + for (unsigned int i = 0; i < fe.n_dofs_per_face(); ++i) dof_values(i) += tmp * (normals[q_point] * fe_values[vec].value( @@ -3241,14 +3243,15 @@ namespace VectorTools q_point)); } - std::vector face_dof_indices(fe.dofs_per_face); + std::vector face_dof_indices( + fe.n_dofs_per_face()); cell->face(face)->get_dof_indices(face_dof_indices, cell->active_fe_index()); // Copy the computed values in the AffineConstraints only, if the degree // of freedom is not already constrained. - for (unsigned int i = 0; i < fe.dofs_per_face; ++i) + for (unsigned int i = 0; i < fe.n_dofs_per_face(); ++i) if (!(constraints.is_constrained(face_dof_indices[i])) && fe.get_nonzero_components(fe.face_to_cell_index( i, @@ -3304,7 +3307,7 @@ namespace VectorTools {1, 2}, {1, 2}, {2, 0}, {2, 0}, {0, 1}, {0, 1}}; std::vector> values(fe_values.n_quadrature_points, Vector(3)); - Vector dof_values_local(fe.dofs_per_face); + Vector dof_values_local(fe.n_dofs_per_face()); { const std::vector> &quadrature_points = @@ -3337,7 +3340,7 @@ namespace VectorTools jacobians[q_point][2][face_coordinate_directions[face][1]] * jacobians[q_point][2][face_coordinate_directions[face][1]])); - for (unsigned int i = 0; i < fe.dofs_per_face; ++i) + for (unsigned int i = 0; i < fe.n_dofs_per_face(); ++i) dof_values_local(i) += tmp * (normals[q_point] * fe_values[vec].value( @@ -3349,12 +3352,13 @@ namespace VectorTools q_point)); } - std::vector face_dof_indices(fe.dofs_per_face); + std::vector face_dof_indices( + fe.n_dofs_per_face()); cell->face(face)->get_dof_indices(face_dof_indices, cell->active_fe_index()); - for (unsigned int i = 0; i < fe.dofs_per_face; ++i) + for (unsigned int i = 0; i < fe.n_dofs_per_face(); ++i) if (projected_dofs[face_dof_indices[i]] < fe.degree && fe.get_nonzero_components(fe.face_to_cell_index( i, diff --git a/include/deal.II/numerics/vector_tools_constraints.templates.h b/include/deal.II/numerics/vector_tools_constraints.templates.h index 11e202ecab..410f034c41 100644 --- a/include/deal.II/numerics/vector_tools_constraints.templates.h +++ b/include/deal.II/numerics/vector_tools_constraints.templates.h @@ -499,7 +499,7 @@ namespace VectorTools const std::vector> &unit_support_points = fe_collection[i].get_unit_face_support_points(); - Assert(unit_support_points.size() == fe_collection[i].dofs_per_face, + Assert(unit_support_points.size() == fe_collection[i].n_dofs_per_face(), ExcInternalError()); face_quadrature_collection.push_back( @@ -549,7 +549,7 @@ namespace VectorTools cell->face(face_no); // get the indices of the dofs on this cell... - face_dofs.resize(fe.dofs_per_face); + face_dofs.resize(fe.n_dofs_per_face()); face->get_dof_indices(face_dofs, cell->active_fe_index()); x_fe_face_values.reinit(cell, face_no); @@ -572,7 +572,7 @@ namespace VectorTools "Error: the finite element does not have enough components " "to define a normal direction.")); - for (unsigned int k = 0; k < fe.dofs_per_face; ++k) + for (unsigned int k = 0; k < fe.n_dofs_per_face(); ++k) if ((k != i) && (face_quadrature_collection[cell->active_fe_index()] .point(k) == @@ -1085,7 +1085,7 @@ namespace VectorTools const std::vector> &unit_support_points = fe_collection[i].get_unit_face_support_points(); - Assert(unit_support_points.size() == fe_collection[i].dofs_per_face, + Assert(unit_support_points.size() == fe_collection[i].n_dofs_per_face(), ExcInternalError()); face_quadrature_collection.push_back( @@ -1123,7 +1123,7 @@ namespace VectorTools cell->face(face_no); // get the indices of the dofs on this cell... - face_dofs.resize(fe.dofs_per_face); + face_dofs.resize(fe.n_dofs_per_face()); face->get_dof_indices(face_dofs, cell->active_fe_index()); x_fe_face_values.reinit(cell, face_no); @@ -1133,8 +1133,8 @@ namespace VectorTools std::map dof_to_b_value; unsigned int n_scalar_indices = 0; - cell_vector_dofs.resize(fe.dofs_per_face); - for (unsigned int i = 0; i < fe.dofs_per_face; ++i) + cell_vector_dofs.resize(fe.n_dofs_per_face()); + for (unsigned int i = 0; i < fe.n_dofs_per_face(); ++i) { if (fe.face_system_to_component_index(i).first >= first_vector_component && diff --git a/include/deal.II/numerics/vector_tools_project.templates.h b/include/deal.II/numerics/vector_tools_project.templates.h index 8748496ebe..6db682e4e1 100644 --- a/include/deal.II/numerics/vector_tools_project.templates.h +++ b/include/deal.II/numerics/vector_tools_project.templates.h @@ -83,10 +83,11 @@ namespace VectorTools for (auto f : GeometryInfo::face_indices()) if (cell->at_boundary(f)) { - face_dof_indices.resize(cell->get_fe().dofs_per_face); + face_dof_indices.resize(cell->get_fe().n_dofs_per_face()); cell->face(f)->get_dof_indices(face_dof_indices, cell->active_fe_index()); - for (unsigned int i = 0; i < cell->get_fe().dofs_per_face; ++i) + for (unsigned int i = 0; i < cell->get_fe().n_dofs_per_face(); + ++i) // enter zero boundary values // for all boundary nodes // diff --git a/source/dofs/dof_handler.cc b/source/dofs/dof_handler.cc index ec9004b891..485bf07ebb 100644 --- a/source/dofs/dof_handler.cc +++ b/source/dofs/dof_handler.cc @@ -268,7 +268,7 @@ namespace internal { dof_handler.object_dof_indices[i][1].resize( dof_handler.tria->n_raw_cells(i) * - dof_handler.get_fe().dofs_per_line, + dof_handler.get_fe().n_dofs_per_line(), numbers::invalid_dof_index); dof_handler.object_dof_ptr[i][1].reserve( @@ -276,7 +276,7 @@ namespace internal for (unsigned int j = 0; j < dof_handler.tria->n_raw_cells(i) + 1; j++) dof_handler.object_dof_ptr[i][1].push_back( - j * dof_handler.get_fe().dofs_per_line); + j * dof_handler.get_fe().n_dofs_per_line()); dof_handler.cell_dof_cache_indices[i].resize( dof_handler.tria->n_raw_cells(i) * @@ -309,7 +309,7 @@ namespace internal { dof_handler.object_dof_indices[i][2].resize( dof_handler.tria->n_raw_cells(i) * - dof_handler.get_fe().dofs_per_quad, + dof_handler.get_fe().n_dofs_per_quad(), numbers::invalid_dof_index); dof_handler.object_dof_ptr[i][2].reserve( @@ -317,7 +317,7 @@ namespace internal for (unsigned int j = 0; j < dof_handler.tria->n_raw_cells(i) + 1; j++) dof_handler.object_dof_ptr[i][2].push_back( - j * dof_handler.get_fe().dofs_per_quad); + j * dof_handler.get_fe().n_dofs_per_quad()); dof_handler.cell_dof_cache_indices[i].resize( dof_handler.tria->n_raw_cells(i) * @@ -345,11 +345,11 @@ namespace internal for (unsigned int i = 0; i < dof_handler.tria->n_raw_lines() + 1; i++) dof_handler.object_dof_ptr[0][1].push_back( - i * dof_handler.get_fe().dofs_per_line); + i * dof_handler.get_fe().n_dofs_per_line()); dof_handler.object_dof_indices[0][1].resize( dof_handler.tria->n_raw_lines() * - dof_handler.get_fe().dofs_per_line, + dof_handler.get_fe().n_dofs_per_line(), numbers::invalid_dof_index); } } @@ -366,7 +366,7 @@ namespace internal { dof_handler.object_dof_indices[i][3].resize( dof_handler.tria->n_raw_cells(i) * - dof_handler.get_fe().dofs_per_hex, + dof_handler.get_fe().n_dofs_per_hex(), numbers::invalid_dof_index); dof_handler.object_dof_ptr[i][3].reserve( @@ -374,7 +374,7 @@ namespace internal for (unsigned int j = 0; j < dof_handler.tria->n_raw_cells(i) + 1; j++) dof_handler.object_dof_ptr[i][3].push_back( - j * dof_handler.get_fe().dofs_per_hex); + j * dof_handler.get_fe().n_dofs_per_hex()); dof_handler.cell_dof_cache_indices[i].resize( dof_handler.tria->n_raw_cells(i) * @@ -402,11 +402,11 @@ namespace internal for (unsigned int i = 0; i < dof_handler.tria->n_raw_lines() + 1; i++) dof_handler.object_dof_ptr[0][1].push_back( - i * dof_handler.get_fe().dofs_per_line); + i * dof_handler.get_fe().n_dofs_per_line()); dof_handler.object_dof_indices[0][1].resize( dof_handler.tria->n_raw_lines() * - dof_handler.get_fe().dofs_per_line, + dof_handler.get_fe().n_dofs_per_line(), numbers::invalid_dof_index); // faces @@ -415,11 +415,11 @@ namespace internal for (unsigned int i = 0; i < dof_handler.tria->n_raw_quads() + 1; i++) dof_handler.object_dof_ptr[0][2].push_back( - i * dof_handler.get_fe().dofs_per_quad); + i * dof_handler.get_fe().n_dofs_per_quad()); dof_handler.object_dof_indices[0][2].resize( dof_handler.tria->n_raw_quads() * - dof_handler.get_fe().dofs_per_quad, + dof_handler.get_fe().n_dofs_per_quad(), numbers::invalid_dof_index); } } @@ -433,8 +433,9 @@ namespace internal const dealii::Triangulation<1, spacedim> &tria = dof_handler.get_triangulation(); - const unsigned int dofs_per_line = dof_handler.get_fe().dofs_per_line; - const unsigned int n_levels = tria.n_levels(); + const unsigned int dofs_per_line = + dof_handler.get_fe().n_dofs_per_line(); + const unsigned int n_levels = tria.n_levels(); for (unsigned int i = 0; i < n_levels; ++i) { @@ -511,14 +512,16 @@ namespace internal internal::DoFHandlerImplementation::DoFLevel<2>>()); dof_handler.mg_levels.back()->dof_object.dofs = std::vector(tria.n_raw_quads(i) * - fe.dofs_per_quad, + fe.n_dofs_per_quad(), numbers::invalid_dof_index); } dof_handler.mg_faces = std::make_unique>(); - dof_handler.mg_faces->lines.dofs = std::vector( - tria.n_raw_lines() * fe.dofs_per_line, numbers::invalid_dof_index); + dof_handler.mg_faces->lines.dofs = + std::vector(tria.n_raw_lines() * + fe.n_dofs_per_line(), + numbers::invalid_dof_index); const unsigned int n_vertices = tria.n_vertices(); @@ -584,16 +587,20 @@ namespace internal internal::DoFHandlerImplementation::DoFLevel<3>>()); dof_handler.mg_levels.back()->dof_object.dofs = std::vector(tria.n_raw_hexs(i) * - fe.dofs_per_hex, + fe.n_dofs_per_hex(), numbers::invalid_dof_index); } dof_handler.mg_faces = std::make_unique>(); - dof_handler.mg_faces->lines.dofs = std::vector( - tria.n_raw_lines() * fe.dofs_per_line, numbers::invalid_dof_index); - dof_handler.mg_faces->quads.dofs = std::vector( - tria.n_raw_quads() * fe.dofs_per_quad, numbers::invalid_dof_index); + dof_handler.mg_faces->lines.dofs = + std::vector(tria.n_raw_lines() * + fe.n_dofs_per_line(), + numbers::invalid_dof_index); + dof_handler.mg_faces->quads.dofs = + std::vector(tria.n_raw_quads() * + fe.n_dofs_per_quad(), + numbers::invalid_dof_index); const unsigned int n_vertices = tria.n_vertices(); @@ -1615,7 +1622,7 @@ namespace internal { fe_slots_needed++; line_slots_needed += - dof_handler.get_fe(fe).dofs_per_line; + dof_handler.get_fe(fe).n_dofs_per_line(); } } } @@ -1641,7 +1648,7 @@ namespace internal dof_handler.object_dof_indices[l][d].size()); for (unsigned int i = 0; - i < dof_handler.get_fe(fe).dofs_per_line; + i < dof_handler.get_fe(fe).n_dofs_per_line(); i++) dof_handler.object_dof_indices[l][d].push_back( numbers::invalid_dof_index); @@ -2267,7 +2274,8 @@ DoFHandler::n_boundary_dofs() const const auto face = cell->face(iface); if (face->at_boundary()) { - const unsigned int dofs_per_face = cell->get_fe().dofs_per_face; + const unsigned int dofs_per_face = + cell->get_fe().n_dofs_per_face(); dofs_on_face.resize(dofs_per_face); face->get_dof_indices(dofs_on_face, cell->active_fe_index()); @@ -2318,7 +2326,8 @@ DoFHandler::n_boundary_dofs( if (face->at_boundary() && (boundary_ids.find(boundary_id) != boundary_ids.end())) { - const unsigned int dofs_per_face = cell->get_fe().dofs_per_face; + const unsigned int dofs_per_face = + cell->get_fe().n_dofs_per_face(); dofs_on_face.resize(dofs_per_face); face->get_dof_indices(dofs_on_face, cell->active_fe_index()); diff --git a/source/dofs/dof_handler_policy.cc b/source/dofs/dof_handler_policy.cc index 4803ec877b..3be6f810c5 100644 --- a/source/dofs/dof_handler_policy.cc +++ b/source/dofs/dof_handler_policy.cc @@ -458,13 +458,15 @@ namespace internal // FE_Q objects of the same order, from which one is // enhanced by a bubble function that is zero on the // boundary. - if ((dof_handler.get_fe(fe_index_1).dofs_per_line == - dof_handler.get_fe(fe_index_2).dofs_per_line) && - (dof_handler.get_fe(fe_index_1).dofs_per_line > 0)) + if ((dof_handler.get_fe(fe_index_1).n_dofs_per_line() == + dof_handler.get_fe(fe_index_2) + .n_dofs_per_line()) && + (dof_handler.get_fe(fe_index_1).n_dofs_per_line() > + 0)) { // the number of dofs per line is identical const unsigned int dofs_per_line = - dof_handler.get_fe(fe_index_1).dofs_per_line; + dof_handler.get_fe(fe_index_1).n_dofs_per_line(); ensure_existence_of_dof_identities<1>( dof_handler.get_fe(fe_index_1), @@ -1290,13 +1292,15 @@ namespace internal fe_index_2 = line->nth_active_fe_index(g); - if ((dof_handler.get_fe(fe_index_1).dofs_per_line == - dof_handler.get_fe(fe_index_2).dofs_per_line) && - (dof_handler.get_fe(fe_index_1).dofs_per_line > 0)) + if ((dof_handler.get_fe(fe_index_1).n_dofs_per_line() == + dof_handler.get_fe(fe_index_2) + .n_dofs_per_line()) && + (dof_handler.get_fe(fe_index_1).n_dofs_per_line() > + 0)) { // the number of dofs per line is identical const unsigned int dofs_per_line = - dof_handler.get_fe(fe_index_1).dofs_per_line; + dof_handler.get_fe(fe_index_1).n_dofs_per_line(); ensure_existence_of_dof_identities<1>( dof_handler.get_fe(fe_index_1), @@ -2129,7 +2133,8 @@ namespace internal line->nth_active_fe_index(f); for (unsigned int d = 0; - d < dof_handler.get_fe(fe_index).dofs_per_line; + d < + dof_handler.get_fe(fe_index).n_dofs_per_line(); ++d) { const types::global_dof_index old_dof_index = @@ -2238,7 +2243,8 @@ namespace internal line->nth_active_fe_index(f); for (unsigned int d = 0; - d < dof_handler.get_fe(fe_index).dofs_per_line; + d < + dof_handler.get_fe(fe_index).n_dofs_per_line(); ++d) { const types::global_dof_index old_dof_index = @@ -2316,7 +2322,8 @@ namespace internal quad->nth_active_fe_index(f); for (unsigned int d = 0; - d < dof_handler.get_fe(fe_index).dofs_per_quad; + d < + dof_handler.get_fe(fe_index).n_dofs_per_quad(); ++d) { const types::global_dof_index old_dof_index = @@ -2552,7 +2559,7 @@ namespace internal const unsigned int level, const bool check_validity) { - if (dof_handler.get_fe().dofs_per_line > 0) + if (dof_handler.get_fe().n_dofs_per_line() > 0) { // save user flags as they will be modified std::vector user_flags; @@ -2580,7 +2587,7 @@ namespace internal if (cell->line(l)->user_flag_set()) { for (unsigned int d = 0; - d < dof_handler.get_fe().dofs_per_line; + d < dof_handler.get_fe().n_dofs_per_line(); ++d) { const dealii::types::global_dof_index idx = @@ -2618,8 +2625,8 @@ namespace internal const unsigned int level, const bool check_validity) { - if (dof_handler.get_fe().dofs_per_line > 0 || - dof_handler.get_fe().dofs_per_quad > 0) + if (dof_handler.get_fe().n_dofs_per_line() > 0 || + dof_handler.get_fe().n_dofs_per_quad() > 0) { // save user flags as they will be modified std::vector user_flags; @@ -2647,7 +2654,7 @@ namespace internal if (cell->line(l)->user_flag_set()) { for (unsigned int d = 0; - d < dof_handler.get_fe().dofs_per_line; + d < dof_handler.get_fe().n_dofs_per_line(); ++d) { const dealii::types::global_dof_index idx = @@ -2686,7 +2693,7 @@ namespace internal if (cell->quad(l)->user_flag_set()) { for (unsigned int d = 0; - d < dof_handler.get_fe().dofs_per_quad; + d < dof_handler.get_fe().n_dofs_per_quad(); ++d) { const dealii::types::global_dof_index idx = diff --git a/source/dofs/dof_tools.cc b/source/dofs/dof_tools.cc index 0df1d77db1..3eeb74f2fc 100644 --- a/source/dofs/dof_tools.cc +++ b/source/dofs/dof_tools.cc @@ -712,12 +712,12 @@ namespace DoFTools { const FiniteElement &fe = cell->get_fe(); - const unsigned int dofs_per_face = fe.dofs_per_face; + const unsigned int dofs_per_face = fe.n_dofs_per_face(); face_dof_indices.resize(dofs_per_face); cell->face(face)->get_dof_indices(face_dof_indices, cell->active_fe_index()); - for (unsigned int i = 0; i < fe.dofs_per_face; ++i) + for (unsigned int i = 0; i < fe.n_dofs_per_face(); ++i) if (!check_vector_component) selected_dofs.add_index(face_dof_indices[i]); else @@ -737,10 +737,10 @@ namespace DoFTools (dim == 3 ? (i < 4 * fe.n_dofs_per_vertex() ? i : (i < 4 * fe.n_dofs_per_vertex() + - 4 * fe.dofs_per_line ? + 4 * fe.n_dofs_per_line() ? i + 4 * fe.n_dofs_per_vertex() : i + 4 * fe.n_dofs_per_vertex() + - 8 * fe.dofs_per_line)) : + 8 * fe.n_dofs_per_line())) : numbers::invalid_unsigned_int))); if (fe.is_primitive(cell_index)) { @@ -1002,7 +1002,7 @@ namespace DoFTools if (cell->neighbor_child_on_subface(face, child) ->is_artificial()) continue; - for (unsigned int dof = 0; dof != fe.dofs_per_line; + for (unsigned int dof = 0; dof != fe.n_dofs_per_line(); ++dof) selected_dofs.add_index( line->child(child)->dof_index(dof)); @@ -1041,7 +1041,7 @@ namespace DoFTools { // simply take all DoFs that live on this subface std::vector ldi( - fe.dofs_per_face); + fe.n_dofs_per_face()); face->child(child)->get_dof_indices(ldi); selected_dofs.add_indices(ldi.begin(), ldi.end()); } @@ -2111,7 +2111,7 @@ namespace DoFTools for (const unsigned int f : GeometryInfo::face_indices()) if (cell->at_boundary(f)) { - const unsigned int dofs_per_face = cell->get_fe().dofs_per_face; + const unsigned int dofs_per_face = cell->get_fe().n_dofs_per_face(); dofs_on_face.resize(dofs_per_face); cell->face(f)->get_dof_indices(dofs_on_face, cell->active_fe_index()); @@ -2156,7 +2156,7 @@ namespace DoFTools if (boundary_ids.find(cell->face(f)->boundary_id()) != boundary_ids.end()) { - const unsigned int dofs_per_face = cell->get_fe().dofs_per_face; + const unsigned int dofs_per_face = cell->get_fe().n_dofs_per_face(); dofs_on_face.resize(dofs_per_face); cell->face(f)->get_dof_indices(dofs_on_face, cell->active_fe_index()); @@ -2533,7 +2533,7 @@ namespace DoFTools // Exclude degrees of freedom on faces opposite to the vertex exclude.resize(fe.n_dofs_per_cell()); std::fill(exclude.begin(), exclude.end(), false); - const unsigned int dpf = fe.dofs_per_face; + const unsigned int dpf = fe.n_dofs_per_face(); for (const unsigned int face : GeometryInfo::face_indices()) if (cell->at_boundary(face) || @@ -2594,7 +2594,7 @@ namespace DoFTools { // Eliminate dofs on faces of the child which are on faces // of the parent - const unsigned int dpf = fe.dofs_per_face; + const unsigned int dpf = fe.n_dofs_per_face(); for (unsigned int d = 0; d < dim; ++d) { @@ -2750,7 +2750,7 @@ namespace DoFTools // vertex exclude.resize(fe.n_dofs_per_cell()); std::fill(exclude.begin(), exclude.end(), false); - const unsigned int dpf = fe.dofs_per_face; + const unsigned int dpf = fe.n_dofs_per_face(); for (unsigned int d = 0; d < dim; ++d) { diff --git a/source/dofs/dof_tools_constraints.cc b/source/dofs/dof_tools_constraints.cc index f701ba8e6a..6bb690de9e 100644 --- a/source/dofs/dof_tools_constraints.cc +++ b/source/dofs/dof_tools_constraints.cc @@ -175,13 +175,15 @@ namespace DoFTools const FullMatrix & face_interpolation_matrix, std::vector & primary_dof_mask) { - Assert(fe1.dofs_per_face >= fe2.dofs_per_face, ExcInternalError()); - AssertDimension(primary_dof_mask.size(), fe1.dofs_per_face); + Assert(fe1.n_dofs_per_face() >= fe2.n_dofs_per_face(), + ExcInternalError()); + AssertDimension(primary_dof_mask.size(), fe1.n_dofs_per_face()); 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), + Assert(fe2.n_dofs_per_line() <= fe1.n_dofs_per_line(), + ExcInternalError()); + Assert((dim < 3) || (fe2.n_dofs_per_quad() <= fe1.n_dofs_per_quad()), ExcInternalError()); // the idea here is to designate as many DoFs in fe1 per object (vertex, @@ -243,9 +245,9 @@ namespace DoFTools // same algorithm as above unsigned int dofs_added = 0; unsigned int i = 0; - while (dofs_added < fe2.dofs_per_line) + while (dofs_added < fe2.n_dofs_per_line()) { - Assert(i < fe1.dofs_per_line, ExcInternalError()); + Assert(i < fe1.n_dofs_per_line(), ExcInternalError()); primary_dof_list.push_back(index + i); if (check_primary_dof_list(face_interpolation_matrix, @@ -256,7 +258,7 @@ namespace DoFTools ++i; } - index += fe1.dofs_per_line; + index += fe1.n_dofs_per_line(); } for (int q = 0; @@ -266,9 +268,9 @@ namespace DoFTools // same algorithm as above unsigned int dofs_added = 0; unsigned int i = 0; - while (dofs_added < fe2.dofs_per_quad) + while (dofs_added < fe2.n_dofs_per_quad()) { - Assert(i < fe1.dofs_per_quad, ExcInternalError()); + Assert(i < fe1.n_dofs_per_quad(), ExcInternalError()); primary_dof_list.push_back(index + i); if (check_primary_dof_list(face_interpolation_matrix, @@ -279,11 +281,11 @@ namespace DoFTools ++i; } - index += fe1.dofs_per_quad; + index += fe1.n_dofs_per_quad(); } - AssertDimension(index, fe1.dofs_per_face); - AssertDimension(primary_dof_list.size(), fe2.dofs_per_face); + AssertDimension(index, fe1.n_dofs_per_face()); + AssertDimension(primary_dof_list.size(), fe2.n_dofs_per_face()); // finally copy the list into the mask std::fill(primary_dof_mask.begin(), primary_dof_mask.end(), false); @@ -308,7 +310,7 @@ namespace DoFTools if (primary_dof_mask == nullptr) { primary_dof_mask = - std::make_unique>(fe1.dofs_per_face); + std::make_unique>(fe1.n_dofs_per_face()); select_primary_dofs_for_face_restriction(fe1, fe2, face_interpolation_matrix, @@ -332,8 +334,9 @@ namespace DoFTools { if (matrix == nullptr) { - matrix = std::make_unique>(fe2.dofs_per_face, - fe1.dofs_per_face); + matrix = + std::make_unique>(fe2.n_dofs_per_face(), + fe1.n_dofs_per_face()); fe1.get_face_interpolation_matrix(fe2, *matrix); } } @@ -353,8 +356,9 @@ namespace DoFTools { if (matrix == nullptr) { - matrix = std::make_unique>(fe2.dofs_per_face, - fe1.dofs_per_face); + matrix = + std::make_unique>(fe2.n_dofs_per_face(), + fe1.n_dofs_per_face()); fe1.get_subface_interpolation_matrix(fe2, subface, *matrix); } } @@ -648,9 +652,10 @@ namespace DoFTools const unsigned int n_dofs_on_mother = 2 * fe.n_dofs_per_vertex() + - fe.dofs_per_line, - n_dofs_on_children = fe.n_dofs_per_vertex() + - 2 * fe.dofs_per_line; + fe.n_dofs_per_line(), + n_dofs_on_children = + fe.n_dofs_per_vertex() + + 2 * fe.n_dofs_per_line(); dofs_on_mother.resize(n_dofs_on_mother); // we might not use all of those in case of artificial cells, so @@ -676,7 +681,7 @@ namespace DoFTools ++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) + for (unsigned int dof = 0; dof != fe.n_dofs_per_line(); ++dof) dofs_on_mother[next_index++] = this_face->dof_index(dof, fe_index); AssertDimension(next_index, dofs_on_mother.size()); @@ -690,7 +695,8 @@ namespace DoFTools if (cell->neighbor_child_on_subface(face, child) ->is_artificial()) continue; - for (unsigned int dof = 0; dof != fe.dofs_per_line; ++dof) + for (unsigned int dof = 0; dof != fe.n_dofs_per_line(); + ++dof) dofs_on_children.push_back( this_face->child(child)->dof_index(dof, fe_index)); } @@ -768,7 +774,7 @@ namespace DoFTools // first of all, make sure that we treat a case which is // possible, i.e. either no dofs on the face at all or no // anisotropic refinement - if (cell->get_fe().dofs_per_face == 0) + if (cell->get_fe().n_dofs_per_face() == 0) continue; Assert(cell->face(face)->refinement_case() == @@ -830,10 +836,10 @@ namespace DoFTools const FiniteElement &fe = cell->get_fe(); const unsigned int fe_index = cell->active_fe_index(); - const unsigned int n_dofs_on_mother = fe.dofs_per_face; + const unsigned int n_dofs_on_mother = fe.n_dofs_per_face(); const unsigned int n_dofs_on_children = - (5 * fe.n_dofs_per_vertex() + 12 * fe.dofs_per_line + - 4 * fe.dofs_per_quad); + (5 * fe.n_dofs_per_vertex() + 12 * fe.n_dofs_per_line() + + 4 * fe.n_dofs_per_quad()); // TODO[TL]: think about this and the following in case of // anisotropic refinement @@ -863,10 +869,10 @@ namespace DoFTools dofs_on_mother[next_index++] = this_face->vertex_dof_index(vertex, dof, fe_index); for (unsigned int line = 0; line < 4; ++line) - for (unsigned int dof = 0; dof != fe.dofs_per_line; ++dof) + for (unsigned int dof = 0; dof != fe.n_dofs_per_line(); ++dof) dofs_on_mother[next_index++] = this_face->line(line)->dof_index(dof, fe_index); - for (unsigned int dof = 0; dof != fe.dofs_per_quad; ++dof) + for (unsigned int dof = 0; dof != fe.n_dofs_per_quad(); ++dof) dofs_on_mother[next_index++] = this_face->dof_index(dof, fe_index); AssertDimension(next_index, dofs_on_mother.size()); @@ -900,16 +906,16 @@ namespace DoFTools // next the dofs on the lines interior to the face; the order of // these lines is laid down in the FiniteElement class // documentation - for (unsigned int dof = 0; dof < fe.dofs_per_line; ++dof) + for (unsigned int dof = 0; dof < fe.n_dofs_per_line(); ++dof) dofs_on_children.push_back( this_face->child(0)->line(1)->dof_index(dof, fe_index)); - for (unsigned int dof = 0; dof < fe.dofs_per_line; ++dof) + for (unsigned int dof = 0; dof < fe.n_dofs_per_line(); ++dof) dofs_on_children.push_back( this_face->child(2)->line(1)->dof_index(dof, fe_index)); - for (unsigned int dof = 0; dof < fe.dofs_per_line; ++dof) + for (unsigned int dof = 0; dof < fe.n_dofs_per_line(); ++dof) dofs_on_children.push_back( this_face->child(0)->line(3)->dof_index(dof, fe_index)); - for (unsigned int dof = 0; dof < fe.dofs_per_line; ++dof) + for (unsigned int dof = 0; dof < fe.n_dofs_per_line(); ++dof) dofs_on_children.push_back( this_face->child(1)->line(3)->dof_index(dof, fe_index)); @@ -917,7 +923,8 @@ namespace DoFTools for (unsigned int line = 0; line < 4; ++line) for (unsigned int child = 0; child < 2; ++child) { - for (unsigned int dof = 0; dof != fe.dofs_per_line; ++dof) + for (unsigned int dof = 0; dof != fe.n_dofs_per_line(); + ++dof) dofs_on_children.push_back( this_face->line(line)->child(child)->dof_index( dof, fe_index)); @@ -930,7 +937,8 @@ namespace DoFTools if (cell->neighbor_child_on_subface(face, child) ->is_artificial()) continue; - for (unsigned int dof = 0; dof != fe.dofs_per_quad; ++dof) + for (unsigned int dof = 0; dof != fe.n_dofs_per_quad(); + ++dof) dofs_on_children.push_back( this_face->child(child)->dof_index(dof, fe_index)); } @@ -1040,7 +1048,7 @@ namespace DoFTools // first of all, make sure that we treat a case which is // possible, i.e. either no dofs on the face at all or no // anisotropic refinement - if (cell->get_fe().dofs_per_face == 0) + if (cell->get_fe().n_dofs_per_face() == 0) continue; Assert(cell->face(face)->refinement_case() == @@ -1112,7 +1120,7 @@ namespace DoFTools // // so we are going to constrain the DoFs on the face // children against the DoFs on the face itself - primary_dofs.resize(cell->get_fe().dofs_per_face); + primary_dofs.resize(cell->get_fe().n_dofs_per_face()); cell->face(face)->get_dof_indices( primary_dofs, cell->active_fe_index()); @@ -1157,7 +1165,8 @@ namespace DoFTools // Same procedure as for the mother cell. Extract // the face DoFs from the cell DoFs. dependent_dofs.resize( - subface->get_fe(subface_fe_index).dofs_per_face); + subface->get_fe(subface_fe_index) + .n_dofs_per_face()); subface->get_dof_indices(dependent_dofs, subface_fe_index); @@ -1266,8 +1275,8 @@ namespace DoFTools // first get the interpolation matrix from the mother to // the virtual dofs - Assert(dominating_fe.dofs_per_face <= - cell->get_fe().dofs_per_face, + Assert(dominating_fe.n_dofs_per_face() <= + cell->get_fe().n_dofs_per_face(), ExcInternalError()); ensure_existence_of_face_matrix( @@ -1308,16 +1317,17 @@ namespace DoFTools // now compute the constraint matrix as the product // between the inverse matrix and the dependent part - constraint_matrix.reinit(cell->get_fe().dofs_per_face - - dominating_fe.dofs_per_face, - dominating_fe.dofs_per_face); + constraint_matrix.reinit( + cell->get_fe().n_dofs_per_face() - + dominating_fe.n_dofs_per_face(), + dominating_fe.n_dofs_per_face()); restrict_mother_to_virtual_dependent.mmult( constraint_matrix, restrict_mother_to_virtual_primary_inv); // then figure out the global numbers of primary and // dependent dofs and apply constraints - scratch_dofs.resize(cell->get_fe().dofs_per_face); + scratch_dofs.resize(cell->get_fe().n_dofs_per_face()); cell->face(face)->get_dof_indices( scratch_dofs, cell->active_fe_index()); @@ -1325,7 +1335,7 @@ namespace DoFTools primary_dofs.clear(); dependent_dofs.clear(); for (unsigned int i = 0; - i < cell->get_fe().dofs_per_face; + i < cell->get_fe().n_dofs_per_face(); ++i) if ((*primary_dof_masks[dominating_fe_index] [cell @@ -1336,10 +1346,10 @@ namespace DoFTools dependent_dofs.push_back(scratch_dofs[i]); AssertDimension(primary_dofs.size(), - dominating_fe.dofs_per_face); + dominating_fe.n_dofs_per_face()); AssertDimension(dependent_dofs.size(), - cell->get_fe().dofs_per_face - - dominating_fe.dofs_per_face); + cell->get_fe().n_dofs_per_face() - + dominating_fe.n_dofs_per_face()); filter_constraints(primary_dofs, dependent_dofs, @@ -1376,8 +1386,8 @@ namespace DoFTools // first get the interpolation matrix from the // subface to the virtual dofs - Assert(dominating_fe.dofs_per_face <= - subface_fe.dofs_per_face, + Assert(dominating_fe.n_dofs_per_face() <= + subface_fe.n_dofs_per_face(), ExcInternalError()); ensure_existence_of_subface_matrix( dominating_fe, @@ -1392,14 +1402,14 @@ namespace DoFTools [dominating_fe_index][subface_fe_index][sf]); constraint_matrix.reinit( - subface_fe.dofs_per_face, - dominating_fe.dofs_per_face); + subface_fe.n_dofs_per_face(), + dominating_fe.n_dofs_per_face()); restrict_subface_to_virtual.mmult( constraint_matrix, restrict_mother_to_virtual_primary_inv); - dependent_dofs.resize(subface_fe.dofs_per_face); + dependent_dofs.resize(subface_fe.n_dofs_per_face()); cell->face(face)->child(sf)->get_dof_indices( dependent_dofs, subface_fe_index); @@ -1460,7 +1470,8 @@ namespace DoFTools { // Get DoFs on dominating and dominated side of the // face - primary_dofs.resize(cell->get_fe().dofs_per_face); + primary_dofs.resize( + cell->get_fe().n_dofs_per_face()); cell->face(face)->get_dof_indices( primary_dofs, cell->active_fe_index()); @@ -1471,7 +1482,7 @@ namespace DoFTools break; dependent_dofs.resize( - neighbor->get_fe().dofs_per_face); + neighbor->get_fe().n_dofs_per_face()); cell->face(face)->get_dof_indices( dependent_dofs, neighbor->active_fe_index()); @@ -1578,8 +1589,8 @@ namespace DoFTools // first get the interpolation matrix from main FE // to the virtual dofs - Assert(dominating_fe.dofs_per_face <= - cell->get_fe().dofs_per_face, + Assert(dominating_fe.n_dofs_per_face() <= + cell->get_fe().n_dofs_per_face(), ExcInternalError()); ensure_existence_of_face_matrix( @@ -1622,16 +1633,17 @@ namespace DoFTools // now compute the constraint matrix as the product // between the inverse matrix and the dependent part constraint_matrix.reinit( - cell->get_fe().dofs_per_face - - dominating_fe.dofs_per_face, - dominating_fe.dofs_per_face); + cell->get_fe().n_dofs_per_face() - + dominating_fe.n_dofs_per_face(), + dominating_fe.n_dofs_per_face()); restrict_mother_to_virtual_dependent.mmult( constraint_matrix, restrict_mother_to_virtual_primary_inv); // then figure out the global numbers of primary and // dependent dofs and apply constraints - scratch_dofs.resize(cell->get_fe().dofs_per_face); + scratch_dofs.resize( + cell->get_fe().n_dofs_per_face()); cell->face(face)->get_dof_indices( scratch_dofs, cell->active_fe_index()); @@ -1639,7 +1651,7 @@ namespace DoFTools primary_dofs.clear(); dependent_dofs.clear(); for (unsigned int i = 0; - i < cell->get_fe().dofs_per_face; + i < cell->get_fe().n_dofs_per_face(); ++i) if ((*primary_dof_masks[dominating_fe_index] [cell->active_fe_index()]) @@ -1649,10 +1661,10 @@ namespace DoFTools dependent_dofs.push_back(scratch_dofs[i]); AssertDimension(primary_dofs.size(), - dominating_fe.dofs_per_face); + dominating_fe.n_dofs_per_face()); AssertDimension(dependent_dofs.size(), - cell->get_fe().dofs_per_face - - dominating_fe.dofs_per_face); + cell->get_fe().n_dofs_per_face() - + dominating_fe.n_dofs_per_face()); filter_constraints(primary_dofs, dependent_dofs, @@ -1662,8 +1674,8 @@ namespace DoFTools // now do the same for another FE this is pretty // much the same we do above to resolve h-refinement // constraints - Assert(dominating_fe.dofs_per_face <= - neighbor->get_fe().dofs_per_face, + Assert(dominating_fe.n_dofs_per_face() <= + neighbor->get_fe().n_dofs_per_face(), ExcInternalError()); ensure_existence_of_face_matrix( @@ -1680,15 +1692,15 @@ namespace DoFTools [neighbor->active_fe_index()]); constraint_matrix.reinit( - neighbor->get_fe().dofs_per_face, - dominating_fe.dofs_per_face); + neighbor->get_fe().n_dofs_per_face(), + dominating_fe.n_dofs_per_face()); restrict_secondface_to_virtual.mmult( constraint_matrix, restrict_mother_to_virtual_primary_inv); dependent_dofs.resize( - neighbor->get_fe().dofs_per_face); + neighbor->get_fe().n_dofs_per_face()); cell->face(face)->get_dof_indices( dependent_dofs, neighbor->active_fe_index()); @@ -1794,7 +1806,7 @@ namespace DoFTools ExcNotImplemented()); const unsigned int dofs_per_face = - face_1->get_fe(face_1->nth_active_fe_index(0)).dofs_per_face; + face_1->get_fe(face_1->nth_active_fe_index(0)).n_dofs_per_face(); FullMatrix child_transformation(dofs_per_face, dofs_per_face); FullMatrix subface_interpolation(dofs_per_face, dofs_per_face); @@ -1840,7 +1852,7 @@ namespace DoFTools "zero or equal to the number of components in the finite " "element.")); - const unsigned int dofs_per_face = fe.dofs_per_face; + const unsigned int dofs_per_face = fe.n_dofs_per_face(); std::vector dofs_1(dofs_per_face); std::vector dofs_2(dofs_per_face); @@ -2110,7 +2122,7 @@ namespace DoFTools { Assert(matrix.m() == matrix.n(), ExcInternalError()); - const unsigned int n_dofs_per_face = fe.dofs_per_face; + const unsigned int n_dofs_per_face = fe.n_dofs_per_face(); if (matrix.m() == n_dofs_per_face) { @@ -2244,7 +2256,7 @@ namespace DoFTools { Assert(face_1->n_active_fe_indices() == 1, ExcInternalError()); const unsigned int n_dofs_per_face = - face_1->get_fe(face_1->nth_active_fe_index(0)).dofs_per_face; + face_1->get_fe(face_1->nth_active_fe_index(0)).n_dofs_per_face(); Assert(matrix.m() == 0 || (first_vector_components.empty() && @@ -2261,7 +2273,7 @@ namespace DoFTools { Assert(face_2->n_active_fe_indices() == 1, ExcInternalError()); const unsigned int n_dofs_per_face = - face_2->get_fe(face_2->nth_active_fe_index(0)).dofs_per_face; + face_2->get_fe(face_2->nth_active_fe_index(0)).n_dofs_per_face(); Assert(matrix.m() == 0 || (first_vector_components.empty() && @@ -2360,7 +2372,7 @@ namespace DoFTools face_2->get_fe(face_2->nth_active_fe_index(0)) : face_1->get_fe(face_1->nth_active_fe_index(0)); - const unsigned int n_dofs_per_face = fe.dofs_per_face; + const unsigned int n_dofs_per_face = fe.n_dofs_per_face(); // Sometimes we just have nothing to do (for all finite elements, or // systems which accidentally don't have any dofs on the boundary). @@ -3396,7 +3408,7 @@ namespace DoFTools (face->boundary_id() == boundary_id))) { // get indices and physical location on this face - face_dofs.resize(fe.dofs_per_face); + face_dofs.resize(fe.n_dofs_per_face()); face->get_dof_indices(face_dofs, cell->active_fe_index()); // enter those dofs into the list that match the component diff --git a/source/dofs/dof_tools_sparsity.cc b/source/dofs/dof_tools_sparsity.cc index 5c3ab54412..c7c2668fb8 100644 --- a/source/dofs/dof_tools_sparsity.cc +++ b/source/dofs/dof_tools_sparsity.cc @@ -407,7 +407,7 @@ namespace DoFTools for (const unsigned int f : GeometryInfo::face_indices()) if (cell->at_boundary(f)) { - const unsigned int dofs_per_face = cell->get_fe().dofs_per_face; + const unsigned int dofs_per_face = cell->get_fe().n_dofs_per_face(); dofs_on_this_face.resize(dofs_per_face); cell->face(f)->get_dof_indices(dofs_on_this_face, cell->active_fe_index()); @@ -504,7 +504,7 @@ namespace DoFTools if (boundary_ids.find(cell->face(f)->boundary_id()) != boundary_ids.end()) { - const unsigned int dofs_per_face = cell->get_fe().dofs_per_face; + const unsigned int dofs_per_face = cell->get_fe().n_dofs_per_face(); dofs_on_this_face.resize(dofs_per_face); cell->face(f)->get_dof_indices(dofs_on_this_face, cell->active_fe_index()); diff --git a/source/fe/fe.cc b/source/fe/fe.cc index 87254982c9..f95944c77a 100644 --- a/source/fe/fe.cc +++ b/source/fe/fe.cc @@ -60,13 +60,13 @@ FiniteElement::FiniteElement( const std::vector &nonzero_c) : FiniteElementData(fe_data) , adjust_quad_dof_index_for_face_orientation_table(dim == 3 ? - this->dofs_per_quad : + this->n_dofs_per_quad() : 0, dim == 3 ? 8 : 0) , adjust_line_dof_index_for_line_orientation_table( - dim == 3 ? this->dofs_per_line : 0) + dim == 3 ? this->n_dofs_per_line() : 0) , system_to_base_table(this->n_dofs_per_cell()) - , face_system_to_base_table(this->dofs_per_face) + , face_system_to_base_table(this->n_dofs_per_face()) , component_to_base_table(this->components, std::make_pair(std::make_pair(0U, 0U), 0U)) , @@ -109,16 +109,16 @@ FiniteElement::FiniteElement( if (this->is_primitive()) { system_to_component_table.resize(this->n_dofs_per_cell()); - face_system_to_component_table.resize(this->dofs_per_face); + face_system_to_component_table.resize(this->n_dofs_per_face()); 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) + for (unsigned int j = 0; j < this->n_dofs_per_face(); ++j) face_system_to_component_table[j] = std::pair(0, 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) + for (unsigned int j = 0; j < this->n_dofs_per_face(); ++j) face_system_to_base_table[j] = std::make_pair(std::make_pair(0U, 0U), j); // Fill with default value; may be changed by constructor of derived class. @@ -544,7 +544,7 @@ FiniteElement::face_to_cell_index(const unsigned int face_index, const bool face_flip, const bool face_rotation) const { - AssertIndexRange(face_index, this->dofs_per_face); + AssertIndexRange(face_index, this->n_dofs_per_face()); AssertIndexRange(face, GeometryInfo::faces_per_cell); // TODO: we could presumably solve the 3d case below using the @@ -562,7 +562,7 @@ FiniteElement::face_to_cell_index(const unsigned int face_index, // other than standard orientation if ((face_orientation != true) || (face_flip != false) || (face_rotation != false)) - Assert((this->dofs_per_line <= 1) && (this->dofs_per_quad <= 1), + Assert((this->n_dofs_per_line() <= 1) && (this->n_dofs_per_quad() <= 1), ExcMessage( "The function in this base class can not handle this case. " "Rather, the derived class you are using must provide " @@ -571,7 +571,7 @@ FiniteElement::face_to_cell_index(const unsigned int face_index, // we need to distinguish between DoFs on vertices, lines and in 3d quads. // do so in a sequence of if-else statements - if (face_index < this->first_face_line_index) + if (face_index < this->get_first_face_line_index()) // DoF is on a vertex { // get the number of the vertex on the face that corresponds to this DoF, @@ -587,20 +587,20 @@ FiniteElement::face_to_cell_index(const unsigned int face_index, this->n_dofs_per_vertex() + dof_index_on_vertex); } - else if (face_index < this->first_face_quad_index) + else if (face_index < this->get_first_face_quad_index()) // DoF is on a face { // do the same kind of translation as before. we need to only consider // DoFs on the lines, i.e., ignoring those on the vertices - const unsigned int index = face_index - this->first_face_line_index; + const unsigned int index = face_index - this->get_first_face_line_index(); - const unsigned int face_line = index / this->dofs_per_line; - const unsigned int dof_index_on_line = index % this->dofs_per_line; + const unsigned int face_line = index / this->n_dofs_per_line(); + const unsigned int dof_index_on_line = index % this->n_dofs_per_line(); - return (this->first_line_index + + return (this->get_first_line_index() + GeometryInfo::face_to_cell_lines( face, face_line, face_orientation, face_flip, face_rotation) * - this->dofs_per_line + + this->n_dofs_per_line() + dof_index_on_line); } else @@ -609,9 +609,10 @@ FiniteElement::face_to_cell_index(const unsigned int face_index, Assert(dim >= 3, ExcInternalError()); // ignore vertex and line dofs - const unsigned int index = face_index - this->first_face_quad_index; + const unsigned int index = face_index - this->get_first_face_quad_index(); - return (this->first_quad_index + face * this->dofs_per_quad + index); + return (this->get_first_quad_index() + face * this->n_dofs_per_quad() + + index); } } @@ -642,9 +643,9 @@ FiniteElement::adjust_quad_dof_index_for_face_orientation( // in 3d), so we don't need the table, but // the function should also not have been // called - AssertIndexRange(index, this->dofs_per_quad); + AssertIndexRange(index, this->n_dofs_per_quad()); Assert(adjust_quad_dof_index_for_face_orientation_table.n_elements() == - 8 * this->dofs_per_quad, + 8 * this->n_dofs_per_quad(), ExcInternalError()); return index + adjust_quad_dof_index_for_face_orientation_table( index, 4 * face_orientation + 2 * face_flip + face_rotation); @@ -665,9 +666,9 @@ FiniteElement::adjust_line_dof_index_for_line_orientation( if (dim < 3) return index; - AssertIndexRange(index, this->dofs_per_line); + AssertIndexRange(index, this->n_dofs_per_line()); Assert(adjust_line_dof_index_for_line_orientation_table.size() == - this->dofs_per_line, + this->n_dofs_per_line(), ExcInternalError()); if (line_orientation) return index; @@ -795,7 +796,7 @@ FiniteElement::constraints_are_implemented( const internal::SubfaceCase &subface_case) const { if (subface_case == internal::SubfaceCase::case_isotropic) - return (this->dofs_per_face == 0) || (interface_constraints.m() != 0); + return (this->n_dofs_per_face() == 0) || (interface_constraints.m() != 0); else return false; } @@ -823,7 +824,7 @@ FiniteElement::constraints( "(which is always the case in 2d, and in 3d requires " "that the neighboring cell of a coarse cell presents " "exactly four children on the common face).")); - Assert((this->dofs_per_face == 0) || (interface_constraints.m() != 0), + Assert((this->n_dofs_per_face() == 0) || (interface_constraints.m() != 0), ExcMessage("The finite element for which you try to obtain " "hanging node constraints does not appear to " "implement them.")); @@ -847,12 +848,12 @@ FiniteElement::interface_constraints_size() const case 1: return {0U, 0U}; case 2: - return {this->n_dofs_per_vertex() + 2 * this->dofs_per_line, - this->dofs_per_face}; + return {this->n_dofs_per_vertex() + 2 * this->n_dofs_per_line(), + this->n_dofs_per_face()}; case 3: - return {5 * this->n_dofs_per_vertex() + 12 * this->dofs_per_line + - 4 * this->dofs_per_quad, - this->dofs_per_face}; + return {5 * this->n_dofs_per_vertex() + 12 * this->n_dofs_per_line() + + 4 * this->n_dofs_per_quad(), + this->n_dofs_per_face()}; default: Assert(false, ExcNotImplemented()); } @@ -1048,7 +1049,7 @@ FiniteElement::get_unit_face_support_points() const // there are as many as there are // degrees of freedom on a face Assert((unit_face_support_points.size() == 0) || - (unit_face_support_points.size() == this->dofs_per_face), + (unit_face_support_points.size() == this->n_dofs_per_face()), ExcInternalError()); return unit_face_support_points; } @@ -1069,8 +1070,8 @@ Point FiniteElement::unit_face_support_point( const unsigned int index) const { - AssertIndexRange(index, this->dofs_per_face); - Assert(unit_face_support_points.size() == this->dofs_per_face, + AssertIndexRange(index, this->n_dofs_per_face()); + Assert(unit_face_support_points.size() == this->n_dofs_per_face(), ExcFEHasNoSupportPoints()); return unit_face_support_points[index]; } diff --git a/source/fe/fe_abf.cc b/source/fe/fe_abf.cc index 455b4ebf6e..432f891806 100644 --- a/source/fe/fe_abf.cc +++ b/source/fe/fe_abf.cc @@ -92,13 +92,13 @@ FE_ABF::FE_ABF(const unsigned int deg) // submatrices with an array for each refine case std::vector> face_embeddings( 1 << (dim - 1), - FullMatrix(this->dofs_per_face, this->dofs_per_face)); + FullMatrix(this->n_dofs_per_face(), this->n_dofs_per_face())); // TODO: Something goes wrong there. The error of the least squares fit // is to large ... // FETools::compute_face_embedding_matrices(*this, face_embeddings.data(), 0, // 0); - this->interface_constraints.reinit((1 << (dim - 1)) * this->dofs_per_face, - this->dofs_per_face); + this->interface_constraints.reinit((1 << (dim - 1)) * this->n_dofs_per_face(), + this->n_dofs_per_face()); unsigned int target_row = 0; for (const auto &face_embedding : face_embeddings) for (unsigned int i = 0; i < face_embedding.m(); ++i) @@ -189,7 +189,7 @@ FE_ABF::initialize_support_points(const unsigned int deg) boundary_weights.reinit(n_face_points, legendre.n()); - // Assert (face_points.size() == this->dofs_per_face, + // Assert (face_points.size() == this->n_dofs_per_face(), // ExcInternalError()); for (unsigned int k = 0; k < n_face_points; ++k) @@ -377,7 +377,7 @@ FE_ABF::initialize_restriction() for (unsigned int k = 0; k < n_face_points; ++k) 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; + for (unsigned int i_face = 0; i_face < this->n_dofs_per_face(); ++i_face) { // The quadrature @@ -385,13 +385,13 @@ FE_ABF::initialize_restriction() // subcell are NOT // transformed, so we // have to do it here. - this->restriction[iso][child](face * this->dofs_per_face + + this->restriction[iso][child](face * this->n_dofs_per_face() + i_face, i_child) += Utilities::fixed_power(.5) * q_sub.weight(k) * cached_values_face(i_child, k) * this->shape_value_component( - face * this->dofs_per_face + i_face, + face * this->n_dofs_per_face() + i_face, q_sub.point(k), GeometryInfo::unit_normal_direction[face]); } @@ -417,7 +417,7 @@ FE_ABF::initialize_restriction() QGauss q_cell(rt_order + 1); const unsigned int start_cell_dofs = - GeometryInfo::faces_per_cell * this->dofs_per_face; + GeometryInfo::faces_per_cell * this->n_dofs_per_face(); // Store shape values, since the // evaluation suffers if not @@ -554,14 +554,14 @@ FE_ABF::convert_generalized_support_point_values_to_dof_values( for (unsigned int k = 0; k < n_face_points; ++k) for (unsigned int i = 0; i < boundary_weights.size(1); ++i) { - nodal_values[i + face * this->dofs_per_face] += + nodal_values[i + face * this->n_dofs_per_face()] += boundary_weights(k, i) * support_point_values[face * n_face_points + k][GeometryInfo< dim>::unit_normal_direction[face]]; } const unsigned int start_cell_dofs = - GeometryInfo::faces_per_cell * this->dofs_per_face; + GeometryInfo::faces_per_cell * this->n_dofs_per_face(); const unsigned int start_cell_points = GeometryInfo::faces_per_cell * n_face_points; diff --git a/source/fe/fe_bdm.cc b/source/fe/fe_bdm.cc index baa4a17306..264203cfb3 100644 --- a/source/fe/fe_bdm.cc +++ b/source/fe/fe_bdm.cc @@ -82,10 +82,10 @@ FE_BDM::FE_BDM(const unsigned int deg) FullMatrix face_embeddings[GeometryInfo::max_children_per_face]; for (unsigned int i = 0; i < GeometryInfo::max_children_per_face; ++i) - face_embeddings[i].reinit(this->dofs_per_face, this->dofs_per_face); + face_embeddings[i].reinit(this->n_dofs_per_face(), this->n_dofs_per_face()); FETools::compute_face_embedding_matrices(*this, face_embeddings, 0, 0, 1.); - this->interface_constraints.reinit((1 << (dim - 1)) * this->dofs_per_face, - this->dofs_per_face); + this->interface_constraints.reinit((1 << (dim - 1)) * this->n_dofs_per_face(), + this->n_dofs_per_face()); unsigned int target_row = 0; for (unsigned int d = 0; d < GeometryInfo::max_children_per_face; ++d) for (unsigned int i = 0; i < face_embeddings[d].m(); ++i) @@ -155,15 +155,15 @@ FE_BDM::convert_generalized_support_point_values_to_dof_values( // initialize_support_points() if (test_values_face.size() == 0) { - for (unsigned int i = 0; i < this->dofs_per_face; ++i) + for (unsigned int i = 0; i < this->n_dofs_per_face(); ++i) nodal_values[dbase + i] = support_point_values[pbase + i] [GeometryInfo::unit_normal_direction[f]]; - pbase += this->dofs_per_face; + pbase += this->n_dofs_per_face(); } else { - for (unsigned int i = 0; i < this->dofs_per_face; ++i) + for (unsigned int i = 0; i < this->n_dofs_per_face(); ++i) { double s = 0.; for (unsigned int k = 0; k < test_values_face.size(); ++k) @@ -175,11 +175,11 @@ FE_BDM::convert_generalized_support_point_values_to_dof_values( } pbase += test_values_face.size(); } - dbase += this->dofs_per_face; + dbase += this->n_dofs_per_face(); } AssertDimension(dbase, - this->dofs_per_face * GeometryInfo::faces_per_cell); + this->n_dofs_per_face() * GeometryInfo::faces_per_cell); AssertDimension(pbase, this->generalized_support_points.size() - test_values_cell.size()); @@ -355,7 +355,7 @@ FE_BDM::initialize_support_points(const unsigned int deg) ++k) this->generalized_support_points[k] = faces.point(k + QProjector::DataSetDescriptor::face( - 0, true, false, false, this->dofs_per_face)); + 0, true, false, false, this->n_dofs_per_face())); // Currently, for backward compatibility, we do not use moments, but // point values on faces in 2D. In 3D, this is impossible, since the diff --git a/source/fe/fe_bernstein.cc b/source/fe/fe_bernstein.cc index 5465595bba..f8078b5173 100644 --- a/source/fe/fe_bernstein.cc +++ b/source/fe/fe_bernstein.cc @@ -111,9 +111,9 @@ FE_Bernstein::get_subface_interpolation_matrix( const unsigned int subface, FullMatrix & interpolation_matrix) const { - Assert(interpolation_matrix.m() == x_source_fe.dofs_per_face, + Assert(interpolation_matrix.m() == x_source_fe.n_dofs_per_face(), ExcDimensionMismatch(interpolation_matrix.m(), - x_source_fe.dofs_per_face)); + x_source_fe.n_dofs_per_face())); // see if source is a Bernstein element if (const FE_Bernstein *source_fe = @@ -121,9 +121,9 @@ FE_Bernstein::get_subface_interpolation_matrix( { // have this test in here since a table of size 2x0 reports its size as // 0x0 - Assert(interpolation_matrix.n() == this->dofs_per_face, + Assert(interpolation_matrix.n() == this->n_dofs_per_face(), ExcDimensionMismatch(interpolation_matrix.n(), - this->dofs_per_face)); + this->n_dofs_per_face())); // Make sure that the element for which the DoFs should be constrained // is the one with the higher polynomial degree. Actually the procedure @@ -131,7 +131,7 @@ FE_Bernstein::get_subface_interpolation_matrix( // produced in that case might lead to problems in the hp procedures, // which use this method. Assert( - this->dofs_per_face <= source_fe->dofs_per_face, + this->n_dofs_per_face() <= source_fe->n_dofs_per_face(), (typename FiniteElement::ExcInterpolationNotImplemented())); @@ -155,10 +155,10 @@ FE_Bernstein::get_subface_interpolation_matrix( QProjector::project_to_face(quad_face_support, 0) : QProjector::project_to_subface(quad_face_support, 0, subface); - for (unsigned int i = 0; i < source_fe->dofs_per_face; ++i) + for (unsigned int i = 0; i < source_fe->n_dofs_per_face(); ++i) { const Point &p = subface_quadrature.point(i); - for (unsigned int j = 0; j < this->dofs_per_face; ++j) + for (unsigned int j = 0; j < this->n_dofs_per_face(); ++j) { double matrix_entry = this->shape_value(this->face_to_cell_index(j, 0), p); @@ -177,11 +177,11 @@ FE_Bernstein::get_subface_interpolation_matrix( // 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 j = 0; j < source_fe->dofs_per_face; ++j) + for (unsigned int j = 0; j < source_fe->n_dofs_per_face(); ++j) { double sum = 0.; - for (unsigned int i = 0; i < this->dofs_per_face; ++i) + for (unsigned int i = 0; i < this->n_dofs_per_face(); ++i) sum += interpolation_matrix(j, i); Assert(std::fabs(sum - 1) < eps, ExcInternalError()); @@ -228,7 +228,7 @@ FE_Bernstein::hp_vertex_dof_identities( // equivalencies to be recorded return std::vector>(); } - else if (fe_other.dofs_per_face == 0) + else if (fe_other.n_dofs_per_face() == 0) { // if the other element has no elements on faces at all, // then it would be impossible to enforce any kind of diff --git a/source/fe/fe_enriched.cc b/source/fe/fe_enriched.cc index 11ededa286..3a37f8fd2b 100644 --- a/source/fe/fe_enriched.cc +++ b/source/fe/fe_enriched.cc @@ -440,7 +440,7 @@ FE_Enriched::initialize( // If the system is not primitive, these have not been initialized by // FiniteElement this->system_to_component_table.resize(this->n_dofs_per_cell()); - this->face_system_to_component_table.resize(this->dofs_per_face); + this->face_system_to_component_table.resize(this->n_dofs_per_face()); FETools::Compositing::build_cell_tables(this->system_to_base_table, this->system_to_component_table, diff --git a/source/fe/fe_face.cc b/source/fe/fe_face.cc index b0bb00e993..8eefdcbbb6 100644 --- a/source/fe/fe_face.cc +++ b/source/fe/fe_face.cc @@ -164,11 +164,12 @@ FE_FaceQ::get_subface_interpolation_matrix( { // this function is similar to the respective method in FE_Q - Assert(interpolation_matrix.n() == this->dofs_per_face, - ExcDimensionMismatch(interpolation_matrix.n(), this->dofs_per_face)); - Assert(interpolation_matrix.m() == x_source_fe.dofs_per_face, + Assert(interpolation_matrix.n() == this->n_dofs_per_face(), + ExcDimensionMismatch(interpolation_matrix.n(), + this->n_dofs_per_face())); + Assert(interpolation_matrix.m() == x_source_fe.n_dofs_per_face(), ExcDimensionMismatch(interpolation_matrix.m(), - x_source_fe.dofs_per_face)); + x_source_fe.n_dofs_per_face())); // see if source is a FaceQ element if (const FE_FaceQ *source_fe = @@ -180,7 +181,7 @@ FE_FaceQ::get_subface_interpolation_matrix( // produced in that case might lead to problems in the hp procedures, // which use this method. Assert( - this->dofs_per_face <= source_fe->dofs_per_face, + this->n_dofs_per_face() <= source_fe->n_dofs_per_face(), (typename FiniteElement::ExcInterpolationNotImplemented())); @@ -195,7 +196,7 @@ FE_FaceQ::get_subface_interpolation_matrix( // compute the interpolation matrix by simply taking the value at the // support points. - for (unsigned int i = 0; i < source_fe->dofs_per_face; ++i) + for (unsigned int i = 0; i < source_fe->n_dofs_per_face(); ++i) { const Point p = subface == numbers::invalid_unsigned_int ? @@ -203,7 +204,7 @@ FE_FaceQ::get_subface_interpolation_matrix( GeometryInfo::child_to_cell_coordinates( face_quadrature.point(i), subface); - for (unsigned int j = 0; j < this->dofs_per_face; ++j) + for (unsigned int j = 0; j < this->n_dofs_per_face(); ++j) { double matrix_entry = this->poly_space.compute_value(j, p); @@ -221,11 +222,11 @@ FE_FaceQ::get_subface_interpolation_matrix( // 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 j = 0; j < source_fe->dofs_per_face; ++j) + for (unsigned int j = 0; j < source_fe->n_dofs_per_face(); ++j) { double sum = 0.; - for (unsigned int i = 0; i < this->dofs_per_face; ++i) + for (unsigned int i = 0; i < this->n_dofs_per_face(); ++i) sum += interpolation_matrix(j, i); Assert(std::fabs(sum - 1) < eps, ExcInternalError()); @@ -250,7 +251,7 @@ FE_FaceQ::has_support_on_face( const unsigned int shape_index, const unsigned int face_index) const { - return (face_index == (shape_index / this->dofs_per_face)); + return (face_index == (shape_index / this->n_dofs_per_face())); } @@ -336,7 +337,7 @@ FE_FaceQ::hp_line_dof_identities( // equivalencies to be recorded return std::vector>(); } - else if (fe_other.dofs_per_face == 0) + else if (fe_other.n_dofs_per_face() == 0) { // if the other element has no elements on faces at all, // then it would be impossible to enforce any kind of @@ -413,7 +414,7 @@ FE_FaceQ::hp_quad_dof_identities( // equivalencies to be recorded return std::vector>(); } - else if (fe_other.dofs_per_face == 0) + else if (fe_other.n_dofs_per_face() == 0) { // if the other element has no elements on faces at all, // then it would be impossible to enforce any kind of @@ -569,11 +570,12 @@ FE_FaceQ<1, spacedim>::get_subface_interpolation_matrix( FullMatrix &interpolation_matrix) const { (void)x_source_fe; - Assert(interpolation_matrix.n() == this->dofs_per_face, - ExcDimensionMismatch(interpolation_matrix.n(), this->dofs_per_face)); - Assert(interpolation_matrix.m() == x_source_fe.dofs_per_face, + Assert(interpolation_matrix.n() == this->n_dofs_per_face(), + ExcDimensionMismatch(interpolation_matrix.n(), + this->n_dofs_per_face())); + Assert(interpolation_matrix.m() == x_source_fe.n_dofs_per_face(), ExcDimensionMismatch(interpolation_matrix.m(), - x_source_fe.dofs_per_face)); + x_source_fe.n_dofs_per_face())); interpolation_matrix(0, 0) = 1.; } @@ -788,7 +790,7 @@ FE_FaceP::has_support_on_face( const unsigned int shape_index, const unsigned int face_index) const { - return (face_index == (shape_index / this->dofs_per_face)); + return (face_index == (shape_index / this->n_dofs_per_face())); } @@ -879,11 +881,12 @@ FE_FaceP::get_subface_interpolation_matrix( { // this function is similar to the respective method in FE_Q - Assert(interpolation_matrix.n() == this->dofs_per_face, - ExcDimensionMismatch(interpolation_matrix.n(), this->dofs_per_face)); - Assert(interpolation_matrix.m() == x_source_fe.dofs_per_face, + Assert(interpolation_matrix.n() == this->n_dofs_per_face(), + ExcDimensionMismatch(interpolation_matrix.n(), + this->n_dofs_per_face())); + Assert(interpolation_matrix.m() == x_source_fe.n_dofs_per_face(), ExcDimensionMismatch(interpolation_matrix.m(), - x_source_fe.dofs_per_face)); + x_source_fe.n_dofs_per_face())); // see if source is a FaceP element if (const FE_FaceP *source_fe = @@ -895,7 +898,7 @@ FE_FaceP::get_subface_interpolation_matrix( // produced in that case might lead to problems in the hp procedures, // which use this method. Assert( - this->dofs_per_face <= source_fe->dofs_per_face, + this->n_dofs_per_face() <= source_fe->n_dofs_per_face(), (typename FiniteElement::ExcInterpolationNotImplemented())); @@ -909,7 +912,8 @@ FE_FaceP::get_subface_interpolation_matrix( // zero. const double eps = 2e-13 * (this->degree + 1) * (dim - 1); - FullMatrix mass(face_quadrature.size(), source_fe->dofs_per_face); + FullMatrix mass(face_quadrature.size(), + source_fe->n_dofs_per_face()); for (unsigned int k = 0; k < face_quadrature.size(); ++k) { @@ -919,18 +923,18 @@ FE_FaceP::get_subface_interpolation_matrix( GeometryInfo::child_to_cell_coordinates( face_quadrature.point(k), subface); - for (unsigned int j = 0; j < source_fe->dofs_per_face; ++j) + for (unsigned int j = 0; j < source_fe->n_dofs_per_face(); ++j) mass(k, j) = source_fe->poly_space.compute_value(j, p); } Householder H(mass); Vector v_in(face_quadrature.size()); - Vector v_out(source_fe->dofs_per_face); + Vector v_out(source_fe->n_dofs_per_face()); // compute the interpolation matrix by evaluating on the fine side and // then solving the least squares problem - for (unsigned int i = 0; i < this->dofs_per_face; ++i) + for (unsigned int i = 0; i < this->n_dofs_per_face(); ++i) { for (unsigned int k = 0; k < face_quadrature.size(); ++k) { @@ -945,7 +949,7 @@ FE_FaceP::get_subface_interpolation_matrix( (void)result; Assert(result < 1e-12, FETools::ExcLeastSquaresError(result)); - for (unsigned int j = 0; j < source_fe->dofs_per_face; ++j) + for (unsigned int j = 0; j < source_fe->n_dofs_per_face(); ++j) { double matrix_entry = v_out(j); @@ -980,7 +984,7 @@ FE_FaceP::get_constant_modes() const { 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; + constant_modes(0, face * this->n_dofs_per_face()) = true; return std::pair, std::vector>( constant_modes, std::vector(1, 0)); } diff --git a/source/fe/fe_nedelec.cc b/source/fe/fe_nedelec.cc index c774591786..a6b9717f79 100644 --- a/source/fe/fe_nedelec.cc +++ b/source/fe/fe_nedelec.cc @@ -109,7 +109,7 @@ FE_Nedelec::FE_Nedelec(const unsigned int order) FullMatrix face_embeddings[GeometryInfo::max_children_per_face]; for (unsigned int i = 0; i < GeometryInfo::max_children_per_face; ++i) - face_embeddings[i].reinit(this->dofs_per_face, this->dofs_per_face); + face_embeddings[i].reinit(this->n_dofs_per_face(), this->n_dofs_per_face()); FETools::compute_face_embedding_matrices( *this, @@ -128,31 +128,31 @@ FE_Nedelec::FE_Nedelec(const unsigned int order) case 2: { - this->interface_constraints.reinit(2 * this->dofs_per_face, - this->dofs_per_face); + this->interface_constraints.reinit(2 * this->n_dofs_per_face(), + this->n_dofs_per_face()); for (unsigned int i = 0; i < GeometryInfo<2>::max_children_per_face; ++i) - for (unsigned int j = 0; j < this->dofs_per_face; ++j) - for (unsigned int k = 0; k < this->dofs_per_face; ++k) - this->interface_constraints(i * this->dofs_per_face + j, k) = - face_embeddings[i](j, k); + for (unsigned int j = 0; j < this->n_dofs_per_face(); ++j) + for (unsigned int k = 0; k < this->n_dofs_per_face(); ++k) + this->interface_constraints(i * this->n_dofs_per_face() + j, + k) = face_embeddings[i](j, k); break; } case 3: { - this->interface_constraints.reinit(4 * (this->dofs_per_face - + this->interface_constraints.reinit(4 * (this->n_dofs_per_face() - this->degree), - this->dofs_per_face); + this->n_dofs_per_face()); unsigned int target_row = 0; for (unsigned int i = 0; i < 2; ++i) for (unsigned int j = this->degree; j < 2 * this->degree; ++j, ++target_row) - for (unsigned int k = 0; k < this->dofs_per_face; ++k) + for (unsigned int k = 0; k < this->n_dofs_per_face(); ++k) this->interface_constraints(target_row, k) = face_embeddings[2 * i](j, k); @@ -160,7 +160,7 @@ FE_Nedelec::FE_Nedelec(const unsigned int order) for (unsigned int j = 3 * this->degree; j < GeometryInfo<3>::lines_per_face * this->degree; ++j, ++target_row) - for (unsigned int k = 0; k < this->dofs_per_face; ++k) + for (unsigned int k = 0; k < this->n_dofs_per_face(); ++k) this->interface_constraints(target_row, k) = face_embeddings[i](j, k); @@ -169,7 +169,7 @@ FE_Nedelec::FE_Nedelec(const unsigned int order) for (unsigned int k = i * this->degree; k < (i + 1) * this->degree; ++k, ++target_row) - for (unsigned int l = 0; l < this->dofs_per_face; ++l) + for (unsigned int l = 0; l < this->n_dofs_per_face(); ++l) this->interface_constraints(target_row, l) = face_embeddings[i + 2 * j](k, l); @@ -178,7 +178,7 @@ FE_Nedelec::FE_Nedelec(const unsigned int order) for (unsigned int k = (i + 2) * this->degree; k < (i + 3) * this->degree; ++k, ++target_row) - for (unsigned int l = 0; l < this->dofs_per_face; ++l) + for (unsigned int l = 0; l < this->n_dofs_per_face(); ++l) this->interface_constraints(target_row, l) = face_embeddings[2 * i + j](k, l); @@ -186,9 +186,9 @@ FE_Nedelec::FE_Nedelec(const unsigned int order) ++i) for (unsigned int j = GeometryInfo<3>::lines_per_face * this->degree; - j < this->dofs_per_face; + j < this->n_dofs_per_face(); ++j, ++target_row) - for (unsigned int k = 0; k < this->dofs_per_face; ++k) + for (unsigned int k = 0; k < this->n_dofs_per_face(); ++k) this->interface_constraints(target_row, k) = face_embeddings[i](j, k); @@ -2430,10 +2430,12 @@ FE_Nedelec::get_face_interpolation_matrix( AssertThrow((source.get_name().find("FE_Nedelec<") == 0) || (dynamic_cast *>(&source) != nullptr), (typename FiniteElement::ExcInterpolationNotImplemented())); - Assert(interpolation_matrix.m() == source.dofs_per_face, - ExcDimensionMismatch(interpolation_matrix.m(), source.dofs_per_face)); - Assert(interpolation_matrix.n() == this->dofs_per_face, - ExcDimensionMismatch(interpolation_matrix.n(), this->dofs_per_face)); + Assert(interpolation_matrix.m() == source.n_dofs_per_face(), + ExcDimensionMismatch(interpolation_matrix.m(), + source.n_dofs_per_face())); + Assert(interpolation_matrix.n() == this->n_dofs_per_face(), + ExcDimensionMismatch(interpolation_matrix.n(), + this->n_dofs_per_face())); // ok, source is a Nedelec element, so // we will be able to do the work @@ -2451,7 +2453,7 @@ FE_Nedelec::get_face_interpolation_matrix( // lead to problems in the // hp procedures, which use this // method. - Assert(this->dofs_per_face <= source_fe.dofs_per_face, + Assert(this->n_dofs_per_face() <= source_fe.n_dofs_per_face(), (typename FiniteElement::ExcInterpolationNotImplemented())); interpolation_matrix = 0; @@ -2533,10 +2535,12 @@ FE_Nedelec::get_subface_interpolation_matrix( AssertThrow((source.get_name().find("FE_Nedelec<") == 0) || (dynamic_cast *>(&source) != nullptr), typename FiniteElement::ExcInterpolationNotImplemented()); - Assert(interpolation_matrix.m() == source.dofs_per_face, - ExcDimensionMismatch(interpolation_matrix.m(), source.dofs_per_face)); - Assert(interpolation_matrix.n() == this->dofs_per_face, - ExcDimensionMismatch(interpolation_matrix.n(), this->dofs_per_face)); + Assert(interpolation_matrix.m() == source.n_dofs_per_face(), + ExcDimensionMismatch(interpolation_matrix.m(), + source.n_dofs_per_face())); + Assert(interpolation_matrix.n() == this->n_dofs_per_face(), + ExcDimensionMismatch(interpolation_matrix.n(), + this->n_dofs_per_face())); // ok, source is a Nedelec element, so // we will be able to do the work @@ -2554,7 +2558,7 @@ FE_Nedelec::get_subface_interpolation_matrix( // lead to problems in the // hp procedures, which use this // method. - Assert(this->dofs_per_face <= source_fe.dofs_per_face, + Assert(this->n_dofs_per_face() <= source_fe.n_dofs_per_face(), (typename FiniteElement::ExcInterpolationNotImplemented())); interpolation_matrix = 0.0; // Perform projection-based interpolation @@ -2568,7 +2572,7 @@ FE_Nedelec::get_subface_interpolation_matrix( { case 2: { - for (unsigned int dof = 0; dof < this->dofs_per_face; ++dof) + for (unsigned int dof = 0; dof < this->n_dofs_per_face(); ++dof) for (unsigned int q_point = 0; q_point < n_edge_quadrature_points; ++q_point) { @@ -2616,7 +2620,7 @@ FE_Nedelec::get_subface_interpolation_matrix( Vector solution(source_fe.degree - 1); Vector system_rhs(source_fe.degree - 1); - for (unsigned int dof = 0; dof < this->dofs_per_face; ++dof) + for (unsigned int dof = 0; dof < this->n_dofs_per_face(); ++dof) { system_rhs = 0.0; @@ -2663,7 +2667,7 @@ FE_Nedelec::get_subface_interpolation_matrix( {0.0, 1.0}, {1.0, 1.0}}; - for (unsigned int dof = 0; dof < this->dofs_per_face; ++dof) + for (unsigned int dof = 0; dof < this->n_dofs_per_face(); ++dof) for (unsigned int q_point = 0; q_point < n_edge_quadrature_points; ++q_point) { @@ -2732,7 +2736,7 @@ FE_Nedelec::get_subface_interpolation_matrix( GeometryInfo::lines_per_face); Vector tmp(GeometryInfo::lines_per_face); - for (unsigned int dof = 0; dof < this->dofs_per_face; ++dof) + for (unsigned int dof = 0; dof < this->n_dofs_per_face(); ++dof) { system_rhs = 0.0; @@ -2855,7 +2859,7 @@ FE_Nedelec::get_subface_interpolation_matrix( system_rhs.reinit(system_matrix_inv.m(), 2); tmp.reinit(2); - for (unsigned int dof = 0; dof < this->dofs_per_face; ++dof) + for (unsigned int dof = 0; dof < this->n_dofs_per_face(); ++dof) { system_rhs = 0.0; diff --git a/source/fe/fe_nedelec_sz.cc b/source/fe/fe_nedelec_sz.cc index 861bb8afb4..ebf33c332b 100644 --- a/source/fe/fe_nedelec_sz.cc +++ b/source/fe/fe_nedelec_sz.cc @@ -146,8 +146,8 @@ FE_NedelecSZ::get_data( const unsigned int lines_per_cell = GeometryInfo::lines_per_cell; const unsigned int faces_per_cell = GeometryInfo::faces_per_cell; - const unsigned int n_line_dofs = this->dofs_per_line * lines_per_cell; - const unsigned int n_face_dofs = this->dofs_per_quad * faces_per_cell; + const unsigned int n_line_dofs = this->n_dofs_per_line() * lines_per_cell; + const unsigned int n_face_dofs = this->n_dofs_per_quad() * faces_per_cell; const UpdateFlags flags(data.update_each); const unsigned int n_q_points = quadrature.size(); @@ -1251,7 +1251,7 @@ FE_NedelecSZ::fill_edge_values( for (unsigned int m = 0; m < lines_per_cell; ++m) { - const unsigned int shift_m(m * this->dofs_per_line); + const unsigned int shift_m(m * this->n_dofs_per_line()); for (unsigned int q = 0; q < n_q_points; ++q) { // Only compute 1d polynomials if degree>0. @@ -1440,7 +1440,7 @@ FE_NedelecSZ::fill_edge_values( degree, std::vector(poly_length)); for (unsigned int m = 0; m < lines_per_cell; ++m) { - const unsigned int shift_m(m * this->dofs_per_line); + const unsigned int shift_m(m * this->n_dofs_per_line()); for (unsigned int q = 0; q < n_q_points; ++q) { // precompute values of all 1d polynomials required: @@ -1580,7 +1580,7 @@ FE_NedelecSZ::fill_face_values( // DoF info: const unsigned int n_line_dofs = - this->dofs_per_line * GeometryInfo::lines_per_cell; + this->n_dofs_per_line() * GeometryInfo::lines_per_cell; // First we find the global face orientations on the current cell. std::vector> face_orientation( @@ -1695,7 +1695,7 @@ FE_NedelecSZ::fill_face_values( // Loop through quad points: for (unsigned int m = 0; m < faces_per_cell; ++m) { - const unsigned int shift_m(m * this->dofs_per_quad); + const unsigned int shift_m(m * this->n_dofs_per_quad()); // Calculate the offsets for each face-based shape function: // // Type-1 (gradients) diff --git a/source/fe/fe_poly_tensor.cc b/source/fe/fe_poly_tensor.cc index 21efff6175..0f7abca45d 100644 --- a/source/fe/fe_poly_tensor.cc +++ b/source/fe/fe_poly_tensor.cc @@ -83,11 +83,11 @@ namespace internal const unsigned int nn = cell->neighbor_face_no(f); if (nn < GeometryInfo::faces_per_cell / 2) - for (unsigned int j = 0; j < fe.dofs_per_face; ++j) + for (unsigned int j = 0; j < fe.n_dofs_per_face(); ++j) { const unsigned int cell_j = fe.face_to_cell_index(j, f); - Assert(f * fe.dofs_per_face + j < face_sign.size(), + Assert(f * fe.n_dofs_per_face() + j < face_sign.size(), ExcInternalError()); Assert(mapping_kind.size() == 1 || cell_j < mapping_kind.size(), @@ -98,7 +98,7 @@ namespace internal if ((mapping_kind.size() > 1 ? mapping_kind[cell_j] : mapping_kind[0]) == mapping_raviart_thomas) - face_sign[f * fe.dofs_per_face + j] = -1.0; + face_sign[f * fe.n_dofs_per_face() + j] = -1.0; } } } diff --git a/source/fe/fe_q_base.cc b/source/fe/fe_q_base.cc index 3cd7b0e002..03e69ae8a0 100644 --- a/source/fe/fe_q_base.cc +++ b/source/fe/fe_q_base.cc @@ -617,9 +617,9 @@ FE_Q_Base::get_subface_interpolation_matrix( const unsigned int subface, FullMatrix & interpolation_matrix) const { - Assert(interpolation_matrix.m() == x_source_fe.dofs_per_face, + Assert(interpolation_matrix.m() == x_source_fe.n_dofs_per_face(), ExcDimensionMismatch(interpolation_matrix.m(), - x_source_fe.dofs_per_face)); + x_source_fe.n_dofs_per_face())); // see if source is a Q element if (const FE_Q_Base *source_fe = @@ -628,9 +628,9 @@ FE_Q_Base::get_subface_interpolation_matrix( { // have this test in here since a table of size 2x0 reports its size as // 0x0 - Assert(interpolation_matrix.n() == this->dofs_per_face, + Assert(interpolation_matrix.n() == this->n_dofs_per_face(), ExcDimensionMismatch(interpolation_matrix.n(), - this->dofs_per_face)); + this->n_dofs_per_face())); // Make sure that the element for which the DoFs should be constrained // is the one with the higher polynomial degree. Actually the procedure @@ -638,7 +638,7 @@ FE_Q_Base::get_subface_interpolation_matrix( // produced in that case might lead to problems in the hp procedures, // which use this method. Assert( - this->dofs_per_face <= source_fe->dofs_per_face, + this->n_dofs_per_face() <= source_fe->n_dofs_per_face(), (typename FiniteElement::ExcInterpolationNotImplemented())); @@ -660,11 +660,11 @@ FE_Q_Base::get_subface_interpolation_matrix( subface == numbers::invalid_unsigned_int ? QProjector::project_to_face(quad_face_support, 0) : QProjector::project_to_subface(quad_face_support, 0, subface); - for (unsigned int i = 0; i < source_fe->dofs_per_face; ++i) + for (unsigned int i = 0; i < source_fe->n_dofs_per_face(); ++i) { const Point &p = subface_quadrature.point(i); - for (unsigned int j = 0; j < this->dofs_per_face; ++j) + for (unsigned int j = 0; j < this->n_dofs_per_face(); ++j) { double matrix_entry = this->shape_value(this->face_to_cell_index(j, 0), p); @@ -683,11 +683,11 @@ FE_Q_Base::get_subface_interpolation_matrix( // 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 j = 0; j < source_fe->dofs_per_face; ++j) + for (unsigned int j = 0; j < source_fe->n_dofs_per_face(); ++j) { double sum = 0.; - for (unsigned int i = 0; i < this->dofs_per_face; ++i) + for (unsigned int i = 0; i < this->n_dofs_per_face(); ++i) sum += interpolation_matrix(j, i); Assert(std::fabs(sum - 1) < eps, ExcInternalError()); @@ -736,7 +736,7 @@ FE_Q_Base::hp_vertex_dof_identities( // equivalencies to be recorded return std::vector>(); } - else if (fe_other.dofs_per_face == 0) + else if (fe_other.n_dofs_per_face() == 0) { // if the other element has no elements on faces at all, // then it would be impossible to enforce any kind of @@ -801,7 +801,7 @@ FE_Q_Base::hp_line_dof_identities( // equivalencies to be recorded return std::vector>(); } - else if (fe_other.dofs_per_face == 0) + else if (fe_other.n_dofs_per_face() == 0) { // if the other element has no elements on faces at all, // then it would be impossible to enforce any kind of @@ -871,7 +871,7 @@ FE_Q_Base::hp_quad_dof_identities( // equivalencies to be recorded return std::vector>(); } - else if (fe_other.dofs_per_face == 0) + else if (fe_other.n_dofs_per_face() == 0) { // if the other element has no elements on faces at all, // then it would be impossible to enforce any kind of @@ -965,11 +965,11 @@ FE_Q_Base:: return; Assert(this->adjust_quad_dof_index_for_face_orientation_table.n_elements() == - 8 * this->dofs_per_quad, + 8 * this->n_dofs_per_quad(), ExcInternalError()); const unsigned int n = q_degree - 1; - Assert(n * n == this->dofs_per_quad, ExcInternalError()); + Assert(n * n == this->n_dofs_per_quad(), ExcInternalError()); // the dofs on a face are connected to a n x n matrix. for example, for // degree==4 we have the following dofs on a quad @@ -989,7 +989,7 @@ FE_Q_Base:: // rotated and mirrored numbers. - for (unsigned int local = 0; local < this->dofs_per_quad; ++local) + for (unsigned int local = 0; local < this->n_dofs_per_quad(); ++local) // face support points are in lexicographic ordering with x running // fastest. invert that (y running fastest) { @@ -1021,9 +1021,9 @@ FE_Q_Base:: } // additionally initialize reordering of line dofs - for (unsigned int i = 0; i < this->dofs_per_line; ++i) + for (unsigned int i = 0; i < this->n_dofs_per_line(); ++i) this->adjust_line_dof_index_for_line_orientation_table[i] = - this->dofs_per_line - 1 - i - i; + this->n_dofs_per_line() - 1 - i - i; } @@ -1037,7 +1037,7 @@ FE_Q_Base::face_to_cell_index( const bool face_flip, const bool face_rotation) const { - AssertIndexRange(face_index, this->dofs_per_face); + AssertIndexRange(face_index, this->n_dofs_per_face()); AssertIndexRange(face, GeometryInfo::faces_per_cell); // TODO: we could presumably solve the 3d case below using the @@ -1051,7 +1051,7 @@ FE_Q_Base::face_to_cell_index( // we need to distinguish between DoFs on vertices, lines and in 3d quads. // do so in a sequence of if-else statements - if (face_index < this->first_face_line_index) + if (face_index < this->get_first_face_line_index()) // DoF is on a vertex { // get the number of the vertex on the face that corresponds to this DoF, @@ -1067,15 +1067,15 @@ FE_Q_Base::face_to_cell_index( this->n_dofs_per_vertex() + dof_index_on_vertex); } - else if (face_index < this->first_face_quad_index) + else if (face_index < this->get_first_face_quad_index()) // DoF is on a face { // do the same kind of translation as before. we need to only consider // DoFs on the lines, i.e., ignoring those on the vertices - const unsigned int index = face_index - this->first_face_line_index; + const unsigned int index = face_index - this->get_first_face_line_index(); - const unsigned int face_line = index / this->dofs_per_line; - const unsigned int dof_index_on_line = index % this->dofs_per_line; + const unsigned int face_line = index / this->n_dofs_per_line(); + const unsigned int dof_index_on_line = index % this->n_dofs_per_line(); // we now also need to adjust the line index for the case of // face orientation, face flips, etc @@ -1093,7 +1093,7 @@ FE_Q_Base::face_to_cell_index( adjusted_dof_index_on_line = dof_index_on_line; else adjusted_dof_index_on_line = - this->dofs_per_line - dof_index_on_line - 1; + this->n_dofs_per_line() - dof_index_on_line - 1; break; case 3: @@ -1104,7 +1104,7 @@ FE_Q_Base::face_to_cell_index( // // that said, the Q2 case is easy enough to implement, as is the // case where everything is in standard orientation - Assert((this->dofs_per_line <= 1) || + Assert((this->n_dofs_per_line() <= 1) || ((face_orientation == true) && (face_flip == false) && (face_rotation == false)), ExcNotImplemented()); @@ -1115,10 +1115,10 @@ FE_Q_Base::face_to_cell_index( Assert(false, ExcInternalError()); } - return (this->first_line_index + + return (this->get_first_line_index() + GeometryInfo::face_to_cell_lines( face, face_line, face_orientation, face_flip, face_rotation) * - this->dofs_per_line + + this->n_dofs_per_line() + adjusted_dof_index_on_line); } else @@ -1127,16 +1127,17 @@ FE_Q_Base::face_to_cell_index( Assert(dim >= 3, ExcInternalError()); // ignore vertex and line dofs - const unsigned int index = face_index - this->first_face_quad_index; + const unsigned int index = face_index - this->get_first_face_quad_index(); // the same is true here as above for the 3d case -- someone will // just have to draw a bunch of pictures. in the meantime, // we can implement the Q2 case in which it is simple - Assert((this->dofs_per_quad <= 1) || + Assert((this->n_dofs_per_quad() <= 1) || ((face_orientation == true) && (face_flip == false) && (face_rotation == false)), ExcNotImplemented()); - return (this->first_quad_index + face * this->dofs_per_quad + index); + return (this->get_first_quad_index() + face * this->n_dofs_per_quad() + + index); } } @@ -1528,12 +1529,12 @@ FE_Q_Base::has_support_on_face( // first, special-case interior shape functions, since they have no support // no-where on the boundary - if (((dim == 2) && (shape_index >= this->first_quad_index)) || - ((dim == 3) && (shape_index >= this->first_hex_index))) + if (((dim == 2) && (shape_index >= this->get_first_quad_index())) || + ((dim == 3) && (shape_index >= this->get_first_hex_index()))) return false; // let's see whether this is a vertex - if (shape_index < this->first_line_index) + if (shape_index < this->get_first_line_index()) { // for Q elements, there is one dof per vertex, so // shape_index==vertex_number. check whether this vertex is on the given @@ -1549,11 +1550,11 @@ FE_Q_Base::has_support_on_face( return false; } - else if (shape_index < this->first_quad_index) + else if (shape_index < this->get_first_quad_index()) // ok, dof is on a line { const unsigned int line_index = - (shape_index - this->first_line_index) / this->dofs_per_line; + (shape_index - this->get_first_line_index()) / this->n_dofs_per_line(); Assert(line_index < GeometryInfo::lines_per_cell, ExcInternalError()); @@ -1576,11 +1577,11 @@ FE_Q_Base::has_support_on_face( else Assert(false, ExcNotImplemented()); } - else if (shape_index < this->first_hex_index) + else if (shape_index < this->get_first_hex_index()) // dof is on a quad { const unsigned int quad_index = - (shape_index - this->first_quad_index) / this->dofs_per_quad; + (shape_index - this->get_first_quad_index()) / this->n_dofs_per_quad(); Assert(static_cast(quad_index) < static_cast(GeometryInfo::quads_per_cell), ExcInternalError()); diff --git a/source/fe/fe_q_hierarchical.cc b/source/fe/fe_q_hierarchical.cc index d20ba0b49b..964aae3ba3 100644 --- a/source/fe/fe_q_hierarchical.cc +++ b/source/fe/fe_q_hierarchical.cc @@ -94,12 +94,14 @@ 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->n_dofs_per_vertex() + this->dofs_per_line, - 2 * this->n_dofs_per_vertex() + this->dofs_per_line)); + FullMatrix(2 * this->n_dofs_per_vertex() + this->n_dofs_per_line(), + 2 * this->n_dofs_per_vertex() + + this->n_dofs_per_line())); std::vector> dofs_subcell( GeometryInfo<1>::max_children_per_cell, - FullMatrix(2 * this->n_dofs_per_vertex() + this->dofs_per_line, - 2 * this->n_dofs_per_vertex() + this->dofs_per_line)); + FullMatrix(2 * this->n_dofs_per_vertex() + this->n_dofs_per_line(), + 2 * this->n_dofs_per_vertex() + + this->n_dofs_per_line())); // build these fields, as they are // needed as auxiliary fields later // on @@ -266,8 +268,8 @@ FE_Q_Hierarchical::hp_line_dof_identities( // one is an FE_Nothing. if (dynamic_cast *>(&fe_other) != nullptr) { - const unsigned int this_dpl = this->dofs_per_line; - const unsigned int other_dpl = fe_other.dofs_per_line; + const unsigned int this_dpl = this->n_dofs_per_line(); + const unsigned int other_dpl = fe_other.n_dofs_per_line(); // we deal with hierarchical 1d polynomials where dofs are enumerated // increasingly. Thus we return a vector of pairs for the first N-1, where @@ -304,8 +306,8 @@ FE_Q_Hierarchical::hp_quad_dof_identities( // one is an FE_Nothing. if (dynamic_cast *>(&fe_other) != nullptr) { - const unsigned int this_dpq = this->dofs_per_quad; - const unsigned int other_dpq = fe_other.dofs_per_quad; + const unsigned int this_dpq = this->n_dofs_per_quad(); + const unsigned int other_dpq = fe_other.n_dofs_per_quad(); // we deal with hierarchical 1d polynomials where dofs are enumerated // increasingly. Thus we return a vector of pairs for the first N-1, where @@ -390,7 +392,7 @@ FE_Q_Hierarchical::build_dofs_cell( std::vector> &dofs_subcell) const { const unsigned int dofs_1d = - 2 * this->n_dofs_per_vertex() + this->dofs_per_line; + 2 * this->n_dofs_per_vertex() + this->n_dofs_per_line(); // The dofs_subcell matrices are transposed // (4.19), (4.21) and (4.27),(4.28),(4.30) in @@ -504,7 +506,7 @@ FE_Q_Hierarchical::initialize_constraints( const std::vector> &dofs_subcell) { const unsigned int dofs_1d = - 2 * this->n_dofs_per_vertex() + this->dofs_per_line; + 2 * this->n_dofs_per_vertex() + this->n_dofs_per_line(); this->interface_constraints.TableBase<2, double>::reinit( this->interface_constraints_size()); @@ -678,7 +680,7 @@ FE_Q_Hierarchical::initialize_embedding_and_restriction( unsigned int iso = RefinementCase::isotropic_refinement - 1; const unsigned int dofs_1d = - 2 * this->n_dofs_per_vertex() + this->dofs_per_line; + 2 * this->n_dofs_per_vertex() + this->n_dofs_per_line(); TensorProductPolynomials *poly_space_derived_ptr = dynamic_cast *>(this->poly_space.get()); const std::vector &renumber = @@ -932,11 +934,12 @@ FE_Q_Hierarchical::get_face_interpolation_matrix( nullptr), (typename FiniteElement::ExcInterpolationNotImplemented())); - Assert(interpolation_matrix.n() == this->dofs_per_face, - ExcDimensionMismatch(interpolation_matrix.n(), this->dofs_per_face)); - Assert(interpolation_matrix.m() == x_source_fe.dofs_per_face, + Assert(interpolation_matrix.n() == this->n_dofs_per_face(), + ExcDimensionMismatch(interpolation_matrix.n(), + this->n_dofs_per_face())); + Assert(interpolation_matrix.m() == x_source_fe.n_dofs_per_face(), ExcDimensionMismatch(interpolation_matrix.m(), - x_source_fe.dofs_per_face)); + x_source_fe.n_dofs_per_face())); // ok, source is a Q_Hierarchical element, so // we will be able to do the work @@ -955,7 +958,7 @@ FE_Q_Hierarchical::get_face_interpolation_matrix( // lead to problems in the // hp procedures, which use this // method. - Assert(this->dofs_per_face <= source_fe.dofs_per_face, + Assert(this->n_dofs_per_face() <= source_fe.n_dofs_per_face(), (typename FiniteElement::ExcInterpolationNotImplemented())); interpolation_matrix = 0; @@ -969,7 +972,7 @@ FE_Q_Hierarchical::get_face_interpolation_matrix( // element, which corresponds to 1 on diagonal of the matrix. // DoFs which correspond to higher polynomials // are zeroed (zero rows in the matrix). - for (unsigned int i = 0; i < this->dofs_per_face; ++i) + for (unsigned int i = 0; i < this->n_dofs_per_face(); ++i) interpolation_matrix(i, i) = 1; break; @@ -1019,11 +1022,12 @@ FE_Q_Hierarchical::get_subface_interpolation_matrix( nullptr), (typename FiniteElement::ExcInterpolationNotImplemented())); - Assert(interpolation_matrix.n() == this->dofs_per_face, - ExcDimensionMismatch(interpolation_matrix.n(), this->dofs_per_face)); - Assert(interpolation_matrix.m() == x_source_fe.dofs_per_face, + Assert(interpolation_matrix.n() == this->n_dofs_per_face(), + ExcDimensionMismatch(interpolation_matrix.n(), + this->n_dofs_per_face())); + Assert(interpolation_matrix.m() == x_source_fe.n_dofs_per_face(), ExcDimensionMismatch(interpolation_matrix.m(), - x_source_fe.dofs_per_face)); + x_source_fe.n_dofs_per_face())); // ok, source is a Q_Hierarchical element, so // we will be able to do the work @@ -1041,7 +1045,7 @@ FE_Q_Hierarchical::get_subface_interpolation_matrix( // lead to problems in the // hp procedures, which use this // method. - Assert(this->dofs_per_face <= source_fe.dofs_per_face, + Assert(this->n_dofs_per_face() <= source_fe.n_dofs_per_face(), (typename FiniteElement::ExcInterpolationNotImplemented())); switch (dim) @@ -1056,7 +1060,7 @@ FE_Q_Hierarchical::get_subface_interpolation_matrix( interpolation_matrix(1, 0) = 0.5; interpolation_matrix(1, 1) = 0.5; - for (unsigned int dof = 2; dof < this->dofs_per_face;) + for (unsigned int dof = 2; dof < this->n_dofs_per_face();) { interpolation_matrix(1, dof) = -1.0; dof = dof + 2; @@ -1064,14 +1068,15 @@ FE_Q_Hierarchical::get_subface_interpolation_matrix( int factorial_i = 1; - for (unsigned int i = 2; i < this->dofs_per_face; ++i) + for (unsigned int i = 2; i < this->n_dofs_per_face(); ++i) { interpolation_matrix(i, i) = std::pow(0.5, i); factorial_i *= i; int factorial_j = factorial_i; int factorial_ij = 1; - for (unsigned int j = i + 1; j < this->dofs_per_face; ++j) + for (unsigned int j = i + 1; j < this->n_dofs_per_face(); + ++j) { factorial_ij *= j - i; factorial_j *= j; @@ -1096,7 +1101,7 @@ FE_Q_Hierarchical::get_subface_interpolation_matrix( interpolation_matrix(0, 0) = 0.5; interpolation_matrix(0, 1) = 0.5; - for (unsigned int dof = 2; dof < this->dofs_per_face;) + for (unsigned int dof = 2; dof < this->n_dofs_per_face();) { interpolation_matrix(0, dof) = -1.0; dof = dof + 2; @@ -1106,14 +1111,15 @@ FE_Q_Hierarchical::get_subface_interpolation_matrix( int factorial_i = 1; - for (unsigned int i = 2; i < this->dofs_per_face; ++i) + for (unsigned int i = 2; i < this->n_dofs_per_face(); ++i) { interpolation_matrix(i, i) = std::pow(0.5, i); factorial_i *= i; int factorial_j = factorial_i; int factorial_ij = 1; - for (unsigned int j = i + 1; j < this->dofs_per_face; ++j) + for (unsigned int j = i + 1; j < this->n_dofs_per_face(); + ++j) { factorial_ij *= j - i; factorial_j *= j; @@ -1957,7 +1963,7 @@ FE_Q_Hierarchical::hierarchic_to_fe_q_hierarchical_numbering( std::vector h2l(fe.n_dofs_per_cell()); // polynomial degree - const unsigned int degree = fe.dofs_per_line + 1; + const unsigned int degree = fe.n_dofs_per_line() + 1; // number of grid points in each // direction const unsigned int n = degree + 1; @@ -2006,22 +2012,23 @@ FE_Q_Hierarchical::hierarchic_to_fe_q_hierarchical_numbering( h2l[next_index++] = n; h2l[next_index++] = n + 1; // left line - for (unsigned int i = 0; i < fe.dofs_per_line; ++i) + for (unsigned int i = 0; i < fe.n_dofs_per_line(); ++i) h2l[next_index++] = (2 + i) * n; // right line - for (unsigned int i = 0; i < fe.dofs_per_line; ++i) + for (unsigned int i = 0; i < fe.n_dofs_per_line(); ++i) h2l[next_index++] = (2 + i) * n + 1; // bottom line - for (unsigned int i = 0; i < fe.dofs_per_line; ++i) + for (unsigned int i = 0; i < fe.n_dofs_per_line(); ++i) h2l[next_index++] = 2 + i; // top line - for (unsigned int i = 0; i < fe.dofs_per_line; ++i) + for (unsigned int i = 0; i < fe.n_dofs_per_line(); ++i) h2l[next_index++] = n + 2 + i; // inside quad - Assert(fe.dofs_per_quad == fe.dofs_per_line * fe.dofs_per_line, + Assert(fe.n_dofs_per_quad() == + fe.n_dofs_per_line() * fe.n_dofs_per_line(), ExcInternalError()); - for (unsigned int i = 0; i < fe.dofs_per_line; ++i) - for (unsigned int j = 0; j < fe.dofs_per_line; ++j) + for (unsigned int i = 0; i < fe.n_dofs_per_line(); ++i) + for (unsigned int j = 0; j < fe.n_dofs_per_line(); ++j) h2l[next_index++] = (2 + i) * n + 2 + j; Assert(next_index == fe.n_dofs_per_cell(), ExcInternalError()); @@ -2047,67 +2054,69 @@ FE_Q_Hierarchical::hierarchic_to_fe_q_hierarchical_numbering( // now the lines // bottom face - for (unsigned int i = 0; i < fe.dofs_per_line; ++i) + for (unsigned int i = 0; i < fe.n_dofs_per_line(); ++i) h2l[next_index++] = (2 + i) * n; - for (unsigned int i = 0; i < fe.dofs_per_line; ++i) + for (unsigned int i = 0; i < fe.n_dofs_per_line(); ++i) h2l[next_index++] = (2 + i) * n + 1; - for (unsigned int i = 0; i < fe.dofs_per_line; ++i) + for (unsigned int i = 0; i < fe.n_dofs_per_line(); ++i) h2l[next_index++] = 2 + i; - for (unsigned int i = 0; i < fe.dofs_per_line; ++i) + for (unsigned int i = 0; i < fe.n_dofs_per_line(); ++i) h2l[next_index++] = n + 2 + i; // top face - for (unsigned int i = 0; i < fe.dofs_per_line; ++i) + for (unsigned int i = 0; i < fe.n_dofs_per_line(); ++i) h2l[next_index++] = n2 + (2 + i) * n; - for (unsigned int i = 0; i < fe.dofs_per_line; ++i) + for (unsigned int i = 0; i < fe.n_dofs_per_line(); ++i) h2l[next_index++] = n2 + (2 + i) * n + 1; - for (unsigned int i = 0; i < fe.dofs_per_line; ++i) + for (unsigned int i = 0; i < fe.n_dofs_per_line(); ++i) h2l[next_index++] = n2 + 2 + i; - for (unsigned int i = 0; i < fe.dofs_per_line; ++i) + for (unsigned int i = 0; i < fe.n_dofs_per_line(); ++i) h2l[next_index++] = n2 + n + 2 + i; // lines in z-direction - for (unsigned int i = 0; i < fe.dofs_per_line; ++i) + for (unsigned int i = 0; i < fe.n_dofs_per_line(); ++i) h2l[next_index++] = (2 + i) * n2; - for (unsigned int i = 0; i < fe.dofs_per_line; ++i) + for (unsigned int i = 0; i < fe.n_dofs_per_line(); ++i) h2l[next_index++] = (2 + i) * n2 + 1; - for (unsigned int i = 0; i < fe.dofs_per_line; ++i) + for (unsigned int i = 0; i < fe.n_dofs_per_line(); ++i) h2l[next_index++] = (2 + i) * n2 + n; - for (unsigned int i = 0; i < fe.dofs_per_line; ++i) + for (unsigned int i = 0; i < fe.n_dofs_per_line(); ++i) h2l[next_index++] = (2 + i) * n2 + n + 1; // inside quads - Assert(fe.dofs_per_quad == fe.dofs_per_line * fe.dofs_per_line, + Assert(fe.n_dofs_per_quad() == + fe.n_dofs_per_line() * fe.n_dofs_per_line(), ExcInternalError()); // left face - for (unsigned int i = 0; i < fe.dofs_per_line; ++i) - for (unsigned int j = 0; j < fe.dofs_per_line; ++j) + for (unsigned int i = 0; i < fe.n_dofs_per_line(); ++i) + for (unsigned int j = 0; j < fe.n_dofs_per_line(); ++j) h2l[next_index++] = (2 + i) * n2 + (2 + j) * n; // right face - for (unsigned int i = 0; i < fe.dofs_per_line; ++i) - for (unsigned int j = 0; j < fe.dofs_per_line; ++j) + for (unsigned int i = 0; i < fe.n_dofs_per_line(); ++i) + for (unsigned int j = 0; j < fe.n_dofs_per_line(); ++j) h2l[next_index++] = (2 + i) * n2 + (2 + j) * n + 1; // front face - for (unsigned int i = 0; i < fe.dofs_per_line; ++i) - for (unsigned int j = 0; j < fe.dofs_per_line; ++j) + for (unsigned int i = 0; i < fe.n_dofs_per_line(); ++i) + for (unsigned int j = 0; j < fe.n_dofs_per_line(); ++j) h2l[next_index++] = (2 + i) * n2 + 2 + j; // back face - for (unsigned int i = 0; i < fe.dofs_per_line; ++i) - for (unsigned int j = 0; j < fe.dofs_per_line; ++j) + for (unsigned int i = 0; i < fe.n_dofs_per_line(); ++i) + for (unsigned int j = 0; j < fe.n_dofs_per_line(); ++j) h2l[next_index++] = (2 + i) * n2 + n + 2 + j; // bottom face - for (unsigned int i = 0; i < fe.dofs_per_line; ++i) - for (unsigned int j = 0; j < fe.dofs_per_line; ++j) + for (unsigned int i = 0; i < fe.n_dofs_per_line(); ++i) + for (unsigned int j = 0; j < fe.n_dofs_per_line(); ++j) h2l[next_index++] = (2 + i) * n + 2 + j; // top face - for (unsigned int i = 0; i < fe.dofs_per_line; ++i) - for (unsigned int j = 0; j < fe.dofs_per_line; ++j) + for (unsigned int i = 0; i < fe.n_dofs_per_line(); ++i) + for (unsigned int j = 0; j < fe.n_dofs_per_line(); ++j) h2l[next_index++] = n2 + (2 + i) * n + 2 + j; // inside hex - Assert(fe.dofs_per_hex == fe.dofs_per_quad * fe.dofs_per_line, + Assert(fe.n_dofs_per_hex() == + fe.n_dofs_per_quad() * fe.n_dofs_per_line(), ExcInternalError()); - for (unsigned int i = 0; i < fe.dofs_per_line; ++i) - for (unsigned int j = 0; j < fe.dofs_per_line; ++j) - for (unsigned int k = 0; k < fe.dofs_per_line; ++k) + for (unsigned int i = 0; i < fe.n_dofs_per_line(); ++i) + for (unsigned int j = 0; j < fe.n_dofs_per_line(); ++j) + for (unsigned int k = 0; k < fe.n_dofs_per_line(); ++k) h2l[next_index++] = (2 + i) * n2 + (2 + j) * n + 2 + k; Assert(next_index == fe.n_dofs_per_cell(), ExcInternalError()); @@ -2178,13 +2187,13 @@ FE_Q_Hierarchical::has_support_on_face(const unsigned int shape_index, // shape functions, since they // have no support no-where on // the boundary - if (((dim == 2) && (shape_index >= this->first_quad_index)) || - ((dim == 3) && (shape_index >= this->first_hex_index))) + if (((dim == 2) && (shape_index >= this->get_first_quad_index())) || + ((dim == 3) && (shape_index >= this->get_first_hex_index()))) return false; // let's see whether this is a // vertex - if (shape_index < this->first_line_index) + if (shape_index < this->get_first_line_index()) { // for Q elements, there is // one dof per vertex, so @@ -2200,11 +2209,11 @@ FE_Q_Hierarchical::has_support_on_face(const unsigned int shape_index, return true; return false; } - else if (shape_index < this->first_quad_index) + else if (shape_index < this->get_first_quad_index()) // ok, dof is on a line { const unsigned int line_index = - (shape_index - this->first_line_index) / this->dofs_per_line; + (shape_index - this->get_first_line_index()) / this->n_dofs_per_line(); Assert(line_index < GeometryInfo::lines_per_cell, ExcInternalError()); @@ -2213,11 +2222,11 @@ FE_Q_Hierarchical::has_support_on_face(const unsigned int shape_index, return true; return false; } - else if (shape_index < this->first_hex_index) + else if (shape_index < this->get_first_hex_index()) // dof is on a quad { const unsigned int quad_index = - (shape_index - this->first_quad_index) / this->dofs_per_quad; + (shape_index - this->get_first_quad_index()) / this->n_dofs_per_quad(); Assert(static_cast(quad_index) < static_cast(GeometryInfo::quads_per_cell), ExcInternalError()); diff --git a/source/fe/fe_raviart_thomas.cc b/source/fe/fe_raviart_thomas.cc index a24c029a6d..19e0582061 100644 --- a/source/fe/fe_raviart_thomas.cc +++ b/source/fe/fe_raviart_thomas.cc @@ -91,13 +91,13 @@ FE_RaviartThomas::FE_RaviartThomas(const unsigned int deg) // submatrices with an array for each refine case FullMatrix face_embeddings[GeometryInfo::max_children_per_face]; for (unsigned int i = 0; i < GeometryInfo::max_children_per_face; ++i) - face_embeddings[i].reinit(this->dofs_per_face, this->dofs_per_face); + face_embeddings[i].reinit(this->n_dofs_per_face(), this->n_dofs_per_face()); FETools::compute_face_embedding_matrices(*this, face_embeddings, 0, 0); - this->interface_constraints.reinit((1 << (dim - 1)) * this->dofs_per_face, - this->dofs_per_face); + this->interface_constraints.reinit((1 << (dim - 1)) * this->n_dofs_per_face(), + this->n_dofs_per_face()); unsigned int target_row = 0; for (unsigned int d = 0; d < GeometryInfo::max_children_per_face; ++d) for (unsigned int i = 0; i < face_embeddings[d].m(); ++i) @@ -173,7 +173,7 @@ FE_RaviartThomas::initialize_support_points(const unsigned int deg) boundary_weights.reinit(n_face_points, legendre.n()); - // Assert (face_points.size() == this->dofs_per_face, + // Assert (face_points.size() == this->n_dofs_per_face(), // ExcInternalError()); for (unsigned int k = 0; k < n_face_points; ++k) @@ -314,7 +314,7 @@ FE_RaviartThomas::initialize_restriction() for (unsigned int k = 0; k < n_face_points; ++k) 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; + for (unsigned int i_face = 0; i_face < this->n_dofs_per_face(); ++i_face) { // The quadrature @@ -322,13 +322,13 @@ FE_RaviartThomas::initialize_restriction() // subcell are NOT // transformed, so we // have to do it here. - this->restriction[iso][child](face * this->dofs_per_face + + this->restriction[iso][child](face * this->n_dofs_per_face() + i_face, i_child) += Utilities::fixed_power(.5) * q_sub.weight(k) * cached_values_on_face(i_child, k) * this->shape_value_component( - face * this->dofs_per_face + i_face, + face * this->n_dofs_per_face() + i_face, q_sub.point(k), GeometryInfo::unit_normal_direction[face]); } @@ -355,7 +355,7 @@ FE_RaviartThomas::initialize_restriction() QGauss q_cell(this->degree); const unsigned int start_cell_dofs = - GeometryInfo::faces_per_cell * this->dofs_per_face; + GeometryInfo::faces_per_cell * this->n_dofs_per_face(); // Store shape values, since the // evaluation suffers if not @@ -500,14 +500,14 @@ FE_RaviartThomas::convert_generalized_support_point_values_to_dof_values( for (unsigned int k = 0; k < n_face_points; ++k) for (unsigned int i = 0; i < boundary_weights.size(1); ++i) { - nodal_values[i + face * this->dofs_per_face] += + nodal_values[i + face * this->n_dofs_per_face()] += boundary_weights(k, i) * support_point_values[face * n_face_points + k]( GeometryInfo::unit_normal_direction[face]); } const unsigned int start_cell_dofs = - GeometryInfo::faces_per_cell * this->dofs_per_face; + GeometryInfo::faces_per_cell * this->n_dofs_per_face(); const unsigned int start_cell_points = GeometryInfo::faces_per_cell * n_face_points; diff --git a/source/fe/fe_raviart_thomas_nodal.cc b/source/fe/fe_raviart_thomas_nodal.cc index 8e5f9161e2..19b150ef5d 100644 --- a/source/fe/fe_raviart_thomas_nodal.cc +++ b/source/fe/fe_raviart_thomas_nodal.cc @@ -88,13 +88,13 @@ FE_RaviartThomasNodal::FE_RaviartThomasNodal(const unsigned int deg) // submatrices with an array for each refine case FullMatrix face_embeddings[GeometryInfo::max_children_per_face]; for (unsigned int i = 0; i < GeometryInfo::max_children_per_face; ++i) - face_embeddings[i].reinit(this->dofs_per_face, this->dofs_per_face); + face_embeddings[i].reinit(this->n_dofs_per_face(), this->n_dofs_per_face()); FETools::compute_face_embedding_matrices(*this, face_embeddings, 0, 0); - this->interface_constraints.reinit((1 << (dim - 1)) * this->dofs_per_face, - this->dofs_per_face); + this->interface_constraints.reinit((1 << (dim - 1)) * this->n_dofs_per_face(), + this->n_dofs_per_face()); unsigned int target_row = 0; for (unsigned int d = 0; d < GeometryInfo::max_children_per_face; ++d) for (unsigned int i = 0; i < face_embeddings[d].m(); ++i) @@ -148,7 +148,7 @@ void FE_RaviartThomasNodal::initialize_support_points(const unsigned int deg) { this->generalized_support_points.resize(this->n_dofs_per_cell()); - this->generalized_face_support_points.resize(this->dofs_per_face); + this->generalized_face_support_points.resize(this->n_dofs_per_face()); // Number of the point being entered unsigned int current = 0; @@ -162,19 +162,19 @@ FE_RaviartThomasNodal::initialize_support_points(const unsigned int deg) if (dim > 1) { QGauss face_points(deg + 1); - Assert(face_points.size() == this->dofs_per_face, ExcInternalError()); - for (unsigned int k = 0; k < this->dofs_per_face; ++k) + Assert(face_points.size() == this->n_dofs_per_face(), ExcInternalError()); + for (unsigned int k = 0; k < this->n_dofs_per_face(); ++k) this->generalized_face_support_points[k] = face_points.point(k); Quadrature faces = QProjector::project_to_all_faces(face_points); for (unsigned int k = 0; - k < this->dofs_per_face * GeometryInfo::faces_per_cell; + k < this->n_dofs_per_face() * GeometryInfo::faces_per_cell; ++k) this->generalized_support_points[k] = faces.point(k + QProjector::DataSetDescriptor::face( - 0, true, false, false, this->dofs_per_face)); + 0, true, false, false, this->n_dofs_per_face())); - current = this->dofs_per_face * GeometryInfo::faces_per_cell; + current = this->n_dofs_per_face() * GeometryInfo::faces_per_cell; } if (deg == 0) @@ -323,9 +323,9 @@ FE_RaviartThomasNodal:: unsigned int fbase = 0; unsigned int f = 0; for (; f < GeometryInfo::faces_per_cell; - ++f, fbase += this->dofs_per_face) + ++f, fbase += this->n_dofs_per_face()) { - for (unsigned int i = 0; i < this->dofs_per_face; ++i) + for (unsigned int i = 0; i < this->n_dofs_per_face(); ++i) { nodal_values[fbase + i] = support_point_values[fbase + i]( GeometryInfo::unit_normal_direction[f]); @@ -472,8 +472,8 @@ FE_RaviartThomasNodal::hp_quad_dof_identities( // this works exactly like the line // case above - const unsigned int p = this->dofs_per_quad; - const unsigned int q = fe_q_other->dofs_per_quad; + const unsigned int p = this->n_dofs_per_quad(); + const unsigned int q = fe_q_other->n_dofs_per_quad(); std::vector> identities; @@ -575,11 +575,12 @@ FE_RaviartThomasNodal::get_face_interpolation_matrix( &x_source_fe) != nullptr), typename FiniteElement::ExcInterpolationNotImplemented()); - Assert(interpolation_matrix.n() == this->dofs_per_face, - ExcDimensionMismatch(interpolation_matrix.n(), this->dofs_per_face)); - Assert(interpolation_matrix.m() == x_source_fe.dofs_per_face, + Assert(interpolation_matrix.n() == this->n_dofs_per_face(), + ExcDimensionMismatch(interpolation_matrix.n(), + this->n_dofs_per_face())); + Assert(interpolation_matrix.m() == x_source_fe.n_dofs_per_face(), ExcDimensionMismatch(interpolation_matrix.m(), - x_source_fe.dofs_per_face)); + x_source_fe.n_dofs_per_face())); // ok, source is a RaviartThomasNodal element, so // we will be able to do the work @@ -597,7 +598,7 @@ FE_RaviartThomasNodal::get_face_interpolation_matrix( // lead to problems in the // hp procedures, which use this // method. - Assert(this->dofs_per_face <= source_fe.dofs_per_face, + Assert(this->n_dofs_per_face() <= source_fe.n_dofs_per_face(), typename FiniteElement::ExcInterpolationNotImplemented()); // generate a quadrature @@ -622,11 +623,11 @@ FE_RaviartThomasNodal::get_face_interpolation_matrix( const Quadrature face_projection = QProjector::project_to_face(quad_face_support, 0); - for (unsigned int i = 0; i < source_fe.dofs_per_face; ++i) + for (unsigned int i = 0; i < source_fe.n_dofs_per_face(); ++i) { const Point &p = face_projection.point(i); - for (unsigned int j = 0; j < this->dofs_per_face; ++j) + for (unsigned int j = 0; j < this->n_dofs_per_face(); ++j) { double matrix_entry = this->shape_value_component(this->face_to_cell_index(j, 0), p, 0); @@ -651,11 +652,11 @@ FE_RaviartThomasNodal::get_face_interpolation_matrix( // this point. this must be so // since the shape functions sum up // to 1 - for (unsigned int j = 0; j < source_fe.dofs_per_face; ++j) + for (unsigned int j = 0; j < source_fe.n_dofs_per_face(); ++j) { double sum = 0.; - for (unsigned int i = 0; i < this->dofs_per_face; ++i) + for (unsigned int i = 0; i < this->n_dofs_per_face(); ++i) sum += interpolation_matrix(j, i); Assert(std::fabs(sum - 1) < 2e-13 * this->degree * (dim - 1), @@ -679,11 +680,12 @@ FE_RaviartThomasNodal::get_subface_interpolation_matrix( &x_source_fe) != nullptr), typename FiniteElement::ExcInterpolationNotImplemented()); - Assert(interpolation_matrix.n() == this->dofs_per_face, - ExcDimensionMismatch(interpolation_matrix.n(), this->dofs_per_face)); - Assert(interpolation_matrix.m() == x_source_fe.dofs_per_face, + Assert(interpolation_matrix.n() == this->n_dofs_per_face(), + ExcDimensionMismatch(interpolation_matrix.n(), + this->n_dofs_per_face())); + Assert(interpolation_matrix.m() == x_source_fe.n_dofs_per_face(), ExcDimensionMismatch(interpolation_matrix.m(), - x_source_fe.dofs_per_face)); + x_source_fe.n_dofs_per_face())); // ok, source is a RaviartThomasNodal element, so // we will be able to do the work @@ -701,7 +703,7 @@ FE_RaviartThomasNodal::get_subface_interpolation_matrix( // lead to problems in the // hp procedures, which use this // method. - Assert(this->dofs_per_face <= source_fe.dofs_per_face, + Assert(this->n_dofs_per_face() <= source_fe.n_dofs_per_face(), typename FiniteElement::ExcInterpolationNotImplemented()); // generate a quadrature @@ -727,11 +729,11 @@ FE_RaviartThomasNodal::get_subface_interpolation_matrix( const Quadrature subface_projection = QProjector::project_to_subface(quad_face_support, 0, subface); - for (unsigned int i = 0; i < source_fe.dofs_per_face; ++i) + for (unsigned int i = 0; i < source_fe.n_dofs_per_face(); ++i) { const Point &p = subface_projection.point(i); - for (unsigned int j = 0; j < this->dofs_per_face; ++j) + for (unsigned int j = 0; j < this->n_dofs_per_face(); ++j) { double matrix_entry = this->shape_value_component(this->face_to_cell_index(j, 0), p, 0); @@ -756,11 +758,11 @@ FE_RaviartThomasNodal::get_subface_interpolation_matrix( // this point. this must be so // since the shape functions sum up // to 1 - for (unsigned int j = 0; j < source_fe.dofs_per_face; ++j) + for (unsigned int j = 0; j < source_fe.n_dofs_per_face(); ++j) { double sum = 0.; - for (unsigned int i = 0; i < this->dofs_per_face; ++i) + for (unsigned int i = 0; i < this->n_dofs_per_face(); ++i) sum += interpolation_matrix(j, i); Assert(std::fabs(sum - 1) < 2e-13 * this->degree * (dim - 1), diff --git a/source/fe/fe_rt_bubbles.cc b/source/fe/fe_rt_bubbles.cc index d4d3554fcc..aacdccfcfd 100644 --- a/source/fe/fe_rt_bubbles.cc +++ b/source/fe/fe_rt_bubbles.cc @@ -80,13 +80,13 @@ FE_RT_Bubbles::FE_RT_Bubbles(const unsigned int deg) FETools::compute_embedding_matrices(*this, this->prolongation, true, 1.0); FullMatrix face_embeddings[GeometryInfo::max_children_per_face]; for (unsigned int i = 0; i < GeometryInfo::max_children_per_face; ++i) - face_embeddings[i].reinit(this->dofs_per_face, this->dofs_per_face); + face_embeddings[i].reinit(this->n_dofs_per_face(), this->n_dofs_per_face()); FETools::compute_face_embedding_matrices(*this, face_embeddings, 0, 0); - this->interface_constraints.reinit((1 << (dim - 1)) * this->dofs_per_face, - this->dofs_per_face); + this->interface_constraints.reinit((1 << (dim - 1)) * this->n_dofs_per_face(), + this->n_dofs_per_face()); unsigned int target_row = 0; for (unsigned int d = 0; d < GeometryInfo::max_children_per_face; ++d) for (unsigned int i = 0; i < face_embeddings[d].m(); ++i) @@ -132,7 +132,7 @@ void FE_RT_Bubbles::initialize_support_points(const unsigned int deg) { this->generalized_support_points.resize(this->n_dofs_per_cell()); - this->generalized_face_support_points.resize(this->dofs_per_face); + this->generalized_face_support_points.resize(this->n_dofs_per_face()); // Index of the point being entered unsigned int current = 0; @@ -143,19 +143,19 @@ FE_RT_Bubbles::initialize_support_points(const unsigned int deg) if (dim > 1) { QGaussLobatto face_points(deg + 1); - Assert(face_points.size() == this->dofs_per_face, ExcInternalError()); - for (unsigned int k = 0; k < this->dofs_per_face; ++k) + Assert(face_points.size() == this->n_dofs_per_face(), ExcInternalError()); + for (unsigned int k = 0; k < this->n_dofs_per_face(); ++k) this->generalized_face_support_points[k] = face_points.point(k); Quadrature faces = QProjector::project_to_all_faces(face_points); for (unsigned int k = 0; - k < this->dofs_per_face * GeometryInfo::faces_per_cell; + k < this->n_dofs_per_face() * GeometryInfo::faces_per_cell; ++k) this->generalized_support_points[k] = faces.point(k + QProjector::DataSetDescriptor::face( - 0, true, false, false, this->dofs_per_face)); + 0, true, false, false, this->n_dofs_per_face())); - current = this->dofs_per_face * GeometryInfo::faces_per_cell; + current = this->n_dofs_per_face() * GeometryInfo::faces_per_cell; } if (deg == 1) @@ -277,9 +277,9 @@ FE_RT_Bubbles::convert_generalized_support_point_values_to_dof_values( unsigned int fbase = 0; unsigned int f = 0; for (; f < GeometryInfo::faces_per_cell; - ++f, fbase += this->dofs_per_face) + ++f, fbase += this->n_dofs_per_face()) { - for (unsigned int i = 0; i < this->dofs_per_face; ++i) + for (unsigned int i = 0; i < this->n_dofs_per_face(); ++i) { nodal_values[fbase + i] = support_point_values[fbase + i]( GeometryInfo::unit_normal_direction[f]); diff --git a/source/fe/fe_system.cc b/source/fe/fe_system.cc index c65c2b99ce..2c169eb84e 100644 --- a/source/fe/fe_system.cc +++ b/source/fe/fe_system.cc @@ -1450,9 +1450,9 @@ FESystem::build_interface_constraints() // then come the two sets of line indices { const unsigned int index_in_line = - (m - this->n_dofs_per_vertex()) % this->dofs_per_line; + (m - this->n_dofs_per_vertex()) % this->n_dofs_per_line(); const unsigned int sub_line = - (m - this->n_dofs_per_vertex()) / this->dofs_per_line; + (m - this->n_dofs_per_vertex()) / this->n_dofs_per_line(); Assert(sub_line < 2, ExcInternalError()); // from this information, try to get base element and @@ -1479,12 +1479,12 @@ FESystem::build_interface_constraints() const unsigned int tmp2 = this->face_system_to_base_table[tmp1].second - 2 * base_element(m_index.first.first).n_dofs_per_vertex(); - Assert(tmp2 < - base_element(m_index.first.first).dofs_per_line, + Assert(tmp2 < base_element(m_index.first.first) + .n_dofs_per_line(), ExcInternalError()); m_index.second = base_element(m_index.first.first).n_dofs_per_vertex() + - base_element(m_index.first.first).dofs_per_line * + base_element(m_index.first.first).n_dofs_per_line() * sub_line + tmp2; } @@ -1502,14 +1502,16 @@ FESystem::build_interface_constraints() m_index = this->system_to_base_table[m]; else // then come the 12 sets of line indices - if (m < - 5 * this->n_dofs_per_vertex() + 12 * this->dofs_per_line) + if (m < 5 * this->n_dofs_per_vertex() + + 12 * this->n_dofs_per_line()) { // for the meaning of all this, see the 2d part const unsigned int index_in_line = - (m - 5 * this->n_dofs_per_vertex()) % this->dofs_per_line; + (m - 5 * this->n_dofs_per_vertex()) % + this->n_dofs_per_line(); const unsigned int sub_line = - (m - 5 * this->n_dofs_per_vertex()) / this->dofs_per_line; + (m - 5 * this->n_dofs_per_vertex()) / + this->n_dofs_per_line(); Assert(sub_line < 12, ExcInternalError()); const unsigned int tmp1 = @@ -1523,13 +1525,13 @@ FESystem::build_interface_constraints() const unsigned int tmp2 = this->face_system_to_base_table[tmp1].second - 4 * base_element(m_index.first.first).n_dofs_per_vertex(); - Assert(tmp2 < - base_element(m_index.first.first).dofs_per_line, + Assert(tmp2 < base_element(m_index.first.first) + .n_dofs_per_line(), ExcInternalError()); m_index.second = 5 * base_element(m_index.first.first).n_dofs_per_vertex() + - base_element(m_index.first.first).dofs_per_line * + base_element(m_index.first.first).n_dofs_per_line() * sub_line + tmp2; } @@ -1539,42 +1541,42 @@ FESystem::build_interface_constraints() // for the meaning of all this, see the 2d part const unsigned int index_in_quad = (m - 5 * this->n_dofs_per_vertex() - - 12 * this->dofs_per_line) % - this->dofs_per_quad; - Assert(index_in_quad < this->dofs_per_quad, + 12 * this->n_dofs_per_line()) % + this->n_dofs_per_quad(); + Assert(index_in_quad < this->n_dofs_per_quad(), ExcInternalError()); const unsigned int sub_quad = ((m - 5 * this->n_dofs_per_vertex() - - 12 * this->dofs_per_line) / - this->dofs_per_quad); + 12 * this->n_dofs_per_line()) / + this->n_dofs_per_quad()); Assert(sub_quad < 4, ExcInternalError()); const unsigned int tmp1 = 4 * this->n_dofs_per_vertex() + - 4 * this->dofs_per_line + + 4 * this->n_dofs_per_line() + index_in_quad; Assert(tmp1 < this->face_system_to_base_table.size(), ExcInternalError()); 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) - .n_dofs_per_vertex() + - 4 * base_element(m_index.first.first).dofs_per_line, - ExcInternalError()); + Assert(this->face_system_to_base_table[tmp1].second >= + 4 * base_element(m_index.first.first) + .n_dofs_per_vertex() + + 4 * base_element(m_index.first.first) + .n_dofs_per_line(), + ExcInternalError()); const unsigned int tmp2 = this->face_system_to_base_table[tmp1].second - 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, + 4 * base_element(m_index.first.first).n_dofs_per_line(); + Assert(tmp2 < base_element(m_index.first.first) + .n_dofs_per_quad(), ExcInternalError()); m_index.second = 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 * + 12 * base_element(m_index.first.first).n_dofs_per_line() + + base_element(m_index.first.first).n_dofs_per_quad() * sub_quad + tmp2; } @@ -1643,7 +1645,7 @@ FESystem::initialize( // If the system is not primitive, these have not been initialized by // FiniteElement this->system_to_component_table.resize(this->n_dofs_per_cell()); - this->face_system_to_component_table.resize(this->dofs_per_face); + this->face_system_to_component_table.resize(this->n_dofs_per_face()); FETools::Compositing::build_cell_tables(this->system_to_base_table, this->system_to_component_table, @@ -1709,7 +1711,7 @@ FESystem::initialize( 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_face > 0)) + (base_element(base_el).n_dofs_per_face() > 0)) { this->unit_face_support_points.resize(0); return; @@ -1718,9 +1720,9 @@ FESystem::initialize( // generate unit face support points from unit support points of sub // elements - this->unit_face_support_points.resize(this->dofs_per_face); + this->unit_face_support_points.resize(this->n_dofs_per_face()); - for (unsigned int i = 0; i < this->dofs_per_face; ++i) + for (unsigned int i = 0; i < this->n_dofs_per_face(); ++i) { const unsigned int base_i = this->face_system_to_base_table[i].first.first; @@ -1810,7 +1812,7 @@ FESystem::initialize( // the array into which we want to write should have the correct size // already. Assert(this->adjust_quad_dof_index_for_face_orientation_table - .n_elements() == 8 * this->dofs_per_quad, + .n_elements() == 8 * this->n_dofs_per_quad(), ExcInternalError()); // to obtain the shifts for this composed element, copy the shift @@ -1830,11 +1832,11 @@ FESystem::initialize( index += temp.size(0); } } - Assert(index == this->dofs_per_quad, ExcInternalError()); + Assert(index == this->n_dofs_per_quad(), ExcInternalError()); // additionally compose the permutation information for lines Assert(this->adjust_line_dof_index_for_line_orientation_table.size() == - this->dofs_per_line, + this->n_dofs_per_line(), ExcInternalError()); index = 0; for (unsigned int b = 0; b < this->n_base_elements(); ++b) @@ -1852,7 +1854,7 @@ FESystem::initialize( index += temp2.size(); } } - Assert(index == this->dofs_per_line, ExcInternalError()); + Assert(index == this->n_dofs_per_line(), ExcInternalError()); }); // wait for all of this to finish @@ -1880,11 +1882,12 @@ FESystem::get_face_interpolation_matrix( const FiniteElement &x_source_fe, FullMatrix & interpolation_matrix) const { - Assert(interpolation_matrix.n() == this->dofs_per_face, - ExcDimensionMismatch(interpolation_matrix.n(), this->dofs_per_face)); - Assert(interpolation_matrix.m() == x_source_fe.dofs_per_face, + Assert(interpolation_matrix.n() == this->n_dofs_per_face(), + ExcDimensionMismatch(interpolation_matrix.n(), + this->n_dofs_per_face())); + Assert(interpolation_matrix.m() == x_source_fe.n_dofs_per_face(), ExcDimensionMismatch(interpolation_matrix.m(), - x_source_fe.dofs_per_face)); + x_source_fe.n_dofs_per_face())); // since dofs for each base are independent, we only have to stack things up // from base element to base element @@ -1920,18 +1923,19 @@ FESystem::get_face_interpolation_matrix( ExcNotImplemented()); // get the interpolation from the bases - base_to_base_interpolation.reinit(base_other.dofs_per_face, - base.dofs_per_face); + base_to_base_interpolation.reinit(base_other.n_dofs_per_face(), + base.n_dofs_per_face()); base.get_face_interpolation_matrix(base_other, base_to_base_interpolation); // now translate entries. we'd like to have something like // face_base_to_system_index, but that doesn't exist. rather, all we // have is the reverse. well, use that then - for (unsigned int i = 0; i < this->dofs_per_face; ++i) + for (unsigned int i = 0; i < this->n_dofs_per_face(); ++i) if (this->face_system_to_base_index(i).first == std::make_pair(base_index, multiplicity)) - for (unsigned int j = 0; j < fe_other_system->dofs_per_face; ++j) + for (unsigned int j = 0; j < fe_other_system->n_dofs_per_face(); + ++j) if (fe_other_system->face_system_to_base_index(j).first == std::make_pair(base_index_other, multiplicity_other)) interpolation_matrix(j, i) = base_to_base_interpolation( @@ -1995,11 +1999,12 @@ FESystem::get_subface_interpolation_matrix( (dynamic_cast *>(&x_source_fe) != nullptr), (typename FiniteElement::ExcInterpolationNotImplemented())); - Assert(interpolation_matrix.n() == this->dofs_per_face, - ExcDimensionMismatch(interpolation_matrix.n(), this->dofs_per_face)); - Assert(interpolation_matrix.m() == x_source_fe.dofs_per_face, + Assert(interpolation_matrix.n() == this->n_dofs_per_face(), + ExcDimensionMismatch(interpolation_matrix.n(), + this->n_dofs_per_face())); + Assert(interpolation_matrix.m() == x_source_fe.n_dofs_per_face(), ExcDimensionMismatch(interpolation_matrix.m(), - x_source_fe.dofs_per_face)); + x_source_fe.n_dofs_per_face())); // since dofs for each base are independent, we only have to stack things up // from base element to base element @@ -2036,8 +2041,8 @@ FESystem::get_subface_interpolation_matrix( ExcNotImplemented()); // get the interpolation from the bases - base_to_base_interpolation.reinit(base_other.dofs_per_face, - base.dofs_per_face); + base_to_base_interpolation.reinit(base_other.n_dofs_per_face(), + base.n_dofs_per_face()); base.get_subface_interpolation_matrix(base_other, subface, base_to_base_interpolation); @@ -2045,10 +2050,11 @@ FESystem::get_subface_interpolation_matrix( // now translate entries. we'd like to have something like // face_base_to_system_index, but that doesn't exist. rather, all we // have is the reverse. well, use that then - for (unsigned int i = 0; i < this->dofs_per_face; ++i) + for (unsigned int i = 0; i < this->n_dofs_per_face(); ++i) if (this->face_system_to_base_index(i).first == std::make_pair(base_index, multiplicity)) - for (unsigned int j = 0; j < fe_other_system->dofs_per_face; ++j) + for (unsigned int j = 0; j < fe_other_system->n_dofs_per_face(); + ++j) if (fe_other_system->face_system_to_base_index(j).first == std::make_pair(base_index_other, multiplicity_other)) interpolation_matrix(j, i) = base_to_base_interpolation( @@ -2337,8 +2343,8 @@ template Point FESystem::unit_face_support_point(const unsigned int index) const { - AssertIndexRange(index, this->dofs_per_face); - Assert((this->unit_face_support_points.size() == this->dofs_per_face) || + AssertIndexRange(index, this->n_dofs_per_face()); + Assert((this->unit_face_support_points.size() == this->n_dofs_per_face()) || (this->unit_face_support_points.size() == 0), (typename FiniteElement::ExcFEHasNoSupportPoints())); diff --git a/source/fe/fe_trace.cc b/source/fe/fe_trace.cc index f1e4fc545f..97cb68e8b8 100644 --- a/source/fe/fe_trace.cc +++ b/source/fe/fe_trace.cc @@ -232,11 +232,12 @@ FE_TraceQ::get_subface_interpolation_matrix( FullMatrix & interpolation_matrix) const { // this is the code from FE_FaceQ - Assert(interpolation_matrix.n() == this->dofs_per_face, - ExcDimensionMismatch(interpolation_matrix.n(), this->dofs_per_face)); - Assert(interpolation_matrix.m() == x_source_fe.dofs_per_face, + Assert(interpolation_matrix.n() == this->n_dofs_per_face(), + ExcDimensionMismatch(interpolation_matrix.n(), + this->n_dofs_per_face())); + Assert(interpolation_matrix.m() == x_source_fe.n_dofs_per_face(), ExcDimensionMismatch(interpolation_matrix.m(), - x_source_fe.dofs_per_face)); + x_source_fe.n_dofs_per_face())); // see if source is a FaceQ element if (const FE_TraceQ *source_fe = diff --git a/source/grid/grid_tools_dof_handlers.cc b/source/grid/grid_tools_dof_handlers.cc index 56248e8fec..88598a00cf 100644 --- a/source/grid/grid_tools_dof_handlers.cc +++ b/source/grid/grid_tools_dof_handlers.cc @@ -1830,7 +1830,7 @@ namespace GridTools ExcInternalError()); const unsigned int n_dofs_per_face = - cell->get_fe().dofs_per_face; + cell->get_fe().n_dofs_per_face(); local_face_dof_indices.resize(n_dofs_per_face); cell->face(f)->child(c)->get_dof_indices( @@ -1865,7 +1865,7 @@ namespace GridTools unsigned int subface = neighbor_face_no_subface_no.second; const unsigned int n_dofs_per_face = - cell->get_fe().dofs_per_face; + cell->get_fe().n_dofs_per_face(); local_face_dof_indices.resize(n_dofs_per_face); cell->neighbor(f)->face(face_no)->get_dof_indices( @@ -1884,7 +1884,7 @@ namespace GridTools // original cell { const unsigned int n_dofs_per_face = - cell->get_fe().dofs_per_face; + cell->get_fe().n_dofs_per_face(); local_face_dof_indices.resize(n_dofs_per_face); Assert(cell->neighbor(f) @@ -1930,7 +1930,7 @@ namespace GridTools // on line not including the vertices of the line. const unsigned int n_dofs_per_line = 2 * cell->get_fe().n_dofs_per_vertex() + - cell->get_fe().dofs_per_line; + cell->get_fe().n_dofs_per_line(); local_line_dof_indices.resize(n_dofs_per_line); cell->line(l)->child(c)->get_dof_indices( @@ -1955,7 +1955,7 @@ namespace GridTools // on line not including the vertices of the line. const unsigned int n_dofs_per_line = 2 * cell->get_fe().n_dofs_per_vertex() + - cell->get_fe().dofs_per_line; + cell->get_fe().n_dofs_per_line(); local_line_dof_indices.resize(n_dofs_per_line); parent_line->get_dof_indices(local_line_dof_indices); @@ -1972,7 +1972,7 @@ namespace GridTools const unsigned int n_dofs_per_line = 2 * cell->get_fe().n_dofs_per_vertex() + - cell->get_fe().dofs_per_line; + cell->get_fe().n_dofs_per_line(); local_line_dof_indices.resize(n_dofs_per_line); parent_line->child(c)->get_dof_indices( diff --git a/source/multigrid/mg_tools.cc b/source/multigrid/mg_tools.cc index cd4dae9ea8..bde170821e 100644 --- a/source/multigrid/mg_tools.cc +++ b/source/multigrid/mg_tools.cc @@ -164,8 +164,9 @@ namespace MGTools // round. // TODO: This assumes that even in hp context, the dofs per face // coincide! - unsigned int increment = fe.n_dofs_per_cell() - dim * fe.dofs_per_face; - while (i < fe.first_line_index) + unsigned int increment = + fe.n_dofs_per_cell() - dim * fe.n_dofs_per_face(); + while (i < fe.get_first_line_index()) row_lengths[cell_indices[i++]] += increment; // From now on, if an object is // a cell, its dofs only couple @@ -178,22 +179,22 @@ namespace MGTools // subtract adjacent faces to be // added in the loop below. increment = (dim > 1) ? - 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) + fe.n_dofs_per_cell() - (dim - 1) * fe.n_dofs_per_face() : + fe.n_dofs_per_cell() - GeometryInfo::faces_per_cell * + fe.n_dofs_per_face(); + while (i < fe.get_first_quad_index()) row_lengths[cell_indices[i++]] += increment; // Now quads in 2D and 3D increment = (dim > 2) ? - 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) + fe.n_dofs_per_cell() - (dim - 2) * fe.n_dofs_per_face() : + fe.n_dofs_per_cell() - GeometryInfo::faces_per_cell * + fe.n_dofs_per_face(); + while (i < fe.get_first_hex_index()) row_lengths[cell_indices[i++]] += increment; // Finally, cells in 3D increment = fe.n_dofs_per_cell() - - GeometryInfo::faces_per_cell * fe.dofs_per_face; + GeometryInfo::faces_per_cell * fe.n_dofs_per_face(); while (i < fe.n_dofs_per_cell()) row_lengths[cell_indices[i++]] += increment; @@ -224,7 +225,7 @@ namespace MGTools 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; + row_lengths[cell_indices[local_dof]] += fe.n_dofs_per_face(); continue; } @@ -243,7 +244,7 @@ namespace MGTools if (flux_coupling != DoFTools::none) { const unsigned int dof_increment = - nfe.n_dofs_per_cell() - nfe.dofs_per_face; + nfe.n_dofs_per_cell() - nfe.n_dofs_per_face(); for (unsigned int local_dof = 0; local_dof < fe.n_dofs_per_cell(); ++local_dof) @@ -271,10 +272,10 @@ namespace MGTools neighbor->get_mg_dof_indices(neighbor_indices); 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; + row_lengths[cell_indices[local_dof]] += nfe.n_dofs_per_face(); 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; + row_lengths[neighbor_indices[local_dof]] += fe.n_dofs_per_face(); } } user_flags_triangulation.load_user_flags(old_flags); @@ -368,7 +369,7 @@ namespace MGTools // arbitrary, not the other way // round. unsigned int increment; - while (i < fe.first_line_index) + while (i < fe.get_first_line_index()) { for (unsigned int base = 0; base < fe.n_base_elements(); ++base) for (unsigned int mult = 0; mult < fe.element_multiplicity(base); @@ -378,7 +379,7 @@ namespace MGTools mult) != DoFTools::none) { increment = fe.base_element(base).n_dofs_per_cell() - - dim * fe.base_element(base).dofs_per_face; + dim * fe.base_element(base).n_dofs_per_face(); row_lengths[cell_indices[i]] += increment; } ++i; @@ -393,7 +394,7 @@ namespace MGTools // In all other cases we // subtract adjacent faces to be // added in the loop below. - while (i < fe.first_quad_index) + while (i < fe.get_first_quad_index()) { for (unsigned int base = 0; base < fe.n_base_elements(); ++base) for (unsigned int mult = 0; mult < fe.element_multiplicity(base); @@ -406,14 +407,14 @@ namespace MGTools fe.base_element(base).n_dofs_per_cell() - ((dim > 1) ? (dim - 1) : GeometryInfo::faces_per_cell) * - fe.base_element(base).dofs_per_face; + fe.base_element(base).n_dofs_per_face(); row_lengths[cell_indices[i]] += increment; } ++i; } // Now quads in 2D and 3D - while (i < fe.first_hex_index) + while (i < fe.get_first_hex_index()) { for (unsigned int base = 0; base < fe.n_base_elements(); ++base) for (unsigned int mult = 0; mult < fe.element_multiplicity(base); @@ -426,7 +427,7 @@ namespace MGTools fe.base_element(base).n_dofs_per_cell() - ((dim > 2) ? (dim - 2) : GeometryInfo::faces_per_cell) * - fe.base_element(base).dofs_per_face; + fe.base_element(base).n_dofs_per_face(); row_lengths[cell_indices[i]] += increment; } ++i; @@ -444,7 +445,7 @@ namespace MGTools { increment = fe.base_element(base).n_dofs_per_cell() - GeometryInfo::faces_per_cell * - fe.base_element(base).dofs_per_face; + fe.base_element(base).n_dofs_per_face(); row_lengths[cell_indices[i]] += increment; } ++i; @@ -477,7 +478,7 @@ namespace MGTools 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; + row_lengths[cell_indices[local_dof]] += fe.n_dofs_per_face(); continue; } @@ -505,7 +506,7 @@ namespace MGTools { const unsigned int dof_increment = nfe.base_element(base).n_dofs_per_cell() - - nfe.base_element(base).dofs_per_face; + nfe.base_element(base).n_dofs_per_face(); row_lengths[cell_indices[local_dof]] += dof_increment; } @@ -547,7 +548,7 @@ namespace MGTools fe.system_to_component_index(local_dof).first, nfe.first_block_of_base(base) + mult) != DoFTools::none) row_lengths[cell_indices[local_dof]] += - nfe.base_element(base).dofs_per_face; + nfe.base_element(base).n_dofs_per_face(); for (unsigned int base = 0; base < fe.n_base_elements(); ++base) for (unsigned int mult = 0; mult < fe.element_multiplicity(base); ++mult) @@ -558,7 +559,7 @@ namespace MGTools nfe.system_to_component_index(local_dof).first, fe.first_block_of_base(base) + mult) != DoFTools::none) row_lengths[neighbor_indices[local_dof]] += - fe.base_element(base).dofs_per_face; + fe.base_element(base).n_dofs_per_face(); } } user_flags_triangulation.load_user_flags(old_flags); @@ -1327,7 +1328,7 @@ namespace MGTools continue; const FiniteElement &fe = cell->get_fe(); const unsigned int level = cell->level(); - local_dofs.resize(fe.dofs_per_face); + local_dofs.resize(fe.n_dofs_per_face()); for (const unsigned int face_no : GeometryInfo::face_indices()) if (cell->at_boundary(face_no) == true) @@ -1400,7 +1401,7 @@ namespace MGTools // get indices, physical location and boundary values of // dofs on this face - local_dofs.resize(fe.dofs_per_face); + local_dofs.resize(fe.n_dofs_per_face()); face->get_mg_dof_indices(level, local_dofs); if (fe_is_system) { @@ -1468,7 +1469,7 @@ namespace MGTools const FiniteElement &fe = mg_dof_handler.get_fe(); const unsigned int dofs_per_cell = fe.n_dofs_per_cell(); - const unsigned int dofs_per_face = fe.dofs_per_face; + const unsigned int dofs_per_face = fe.n_dofs_per_face(); std::vector local_dof_indices(dofs_per_cell); diff --git a/source/multigrid/mg_transfer_internal.cc b/source/multigrid/mg_transfer_internal.cc index 7ea7a9c466..99106b8e3c 100644 --- a/source/multigrid/mg_transfer_internal.cc +++ b/source/multigrid/mg_transfer_internal.cc @@ -602,7 +602,7 @@ namespace internal { AssertIndexRange(fe.n_dofs_per_vertex(), 2); renumbering[0] = 0; - for (unsigned int i = 0; i < fe.dofs_per_line; ++i) + for (unsigned int i = 0; i < fe.n_dofs_per_line(); ++i) 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) -- 2.39.5