From: Martin Kronbichler Date: Tue, 12 Oct 2021 09:02:01 +0000 (+0200) Subject: step-70: Remove quadrature_formula class attributes X-Git-Tag: v9.4.0-rc1~944^2 X-Git-Url: https://gitweb.dealii.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=refs%2Fpull%2F12818%2Fhead;p=dealii.git step-70: Remove quadrature_formula class attributes --- 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);