From e110b09a87139406d9e1629e540470712f1c9a91 Mon Sep 17 00:00:00 2001 From: Martin Kronbichler Date: Tue, 12 Oct 2021 11:02:01 +0200 Subject: [PATCH] step-70: Remove quadrature_formula class attributes --- examples/step-70/step-70.cc | 25 +++++++++---------------- 1 file changed, 9 insertions(+), 16 deletions(-) diff --git a/examples/step-70/step-70.cc b/examples/step-70/step-70.cc index 79212bec0b..3e2d0360e9 100644 --- a/examples/step-70/step-70.cc +++ b/examples/step-70/step-70.cc @@ -622,12 +622,12 @@ namespace Step70 parallel::distributed::Triangulation fluid_tria; parallel::distributed::Triangulation solid_tria; - // Next come descriptions of the finite elements in use, along with - // appropriate quadrature formulas and the corresponding DoFHandler objects. - // For the current implementation, only `fluid_fe` is really necessary. For - // completeness, and to allow easy extension, we also keep the `solid_fe` - // around, which is however initialized to a FE_Nothing finite element - // space, i.e., one that has no degrees of freedom. + // Next come descriptions of the finite elements in use, along with the + // corresponding DoFHandler objects. For the current implementation, only + // `fluid_fe` is really necessary. For completeness, and to allow easy + // extension, we also keep the `solid_fe` around, which is however + // initialized to a FE_Nothing finite element space, i.e., one that has no + // degrees of freedom. // // We declare both finite element spaces as `std::unique_ptr` objects rather // than regular member variables, to allow their generation after @@ -636,9 +636,6 @@ namespace Step70 std::unique_ptr> fluid_fe; std::unique_ptr> solid_fe; - std::unique_ptr> fluid_quadrature_formula; - std::unique_ptr> solid_quadrature_formula; - DoFHandler fluid_dh; DoFHandler solid_dh; @@ -1202,11 +1199,6 @@ namespace Step70 solid_fe = std::make_unique>(); solid_dh.distribute_dofs(*solid_fe); - - fluid_quadrature_formula = - std::make_unique>(par.velocity_degree + 1); - solid_quadrature_formula = - std::make_unique>(par.velocity_degree + 1); } @@ -1335,14 +1327,15 @@ namespace Step70 TimerOutput::Scope t(computing_timer, "Assemble Stokes terms"); + QGauss quadrature_formula(fluid_fe->degree + 1); FEValues fe_values(*fluid_fe, - *fluid_quadrature_formula, + quadrature_formula, update_values | update_gradients | update_quadrature_points | update_JxW_values); const unsigned int dofs_per_cell = fluid_fe->n_dofs_per_cell(); - const unsigned int n_q_points = fluid_quadrature_formula->size(); + const unsigned int n_q_points = quadrature_formula.size(); FullMatrix cell_matrix(dofs_per_cell, dofs_per_cell); FullMatrix cell_matrix2(dofs_per_cell, dofs_per_cell); -- 2.39.5