From: Daniel Arndt Date: Mon, 3 Jul 2023 14:07:21 +0000 (-0400) Subject: Remove deprecations in MatrixFree X-Git-Tag: relicensing~774^2 X-Git-Url: https://gitweb.dealii.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=refs%2Fpull%2F15589%2Fhead;p=dealii.git Remove deprecations in MatrixFree --- diff --git a/include/deal.II/matrix_free/fe_evaluation.h b/include/deal.II/matrix_free/fe_evaluation.h index 51ae971c61..da493cab35 100644 --- a/include/deal.II/matrix_free/fe_evaluation.h +++ b/include/deal.II/matrix_free/fe_evaluation.h @@ -2200,15 +2200,6 @@ public: void evaluate(const EvaluationFlags::EvaluationFlags evaluation_flag); - /** - * Like above but with separate bool flags. - * @deprecated use evaluate() with the EvaluationFlags argument. - */ - DEAL_II_DEPRECATED void - evaluate(const bool evaluate_values, - const bool evaluate_gradients, - const bool evaluate_hessians = false); - /** * Evaluate the function values, the gradients, and the Hessians of the * polynomial interpolation from the DoF values in the input array @p @@ -2225,16 +2216,6 @@ public: evaluate(const VectorizedArrayType * values_array, const EvaluationFlags::EvaluationFlags evaluation_flag); - /** - * Like above but using separate bool flags. - * @deprecated use evaluate() with the EvaluationFlags argument. - */ - DEAL_II_DEPRECATED void - evaluate(const VectorizedArrayType *values_array, - const bool evaluate_values, - const bool evaluate_gradients, - const bool evaluate_hessians = false); - /** * Read from the input vector and evaluates the function values, the * gradients, and the Hessians of the polynomial interpolation of the vector @@ -2253,16 +2234,6 @@ public: gather_evaluate(const VectorType & input_vector, const EvaluationFlags::EvaluationFlags evaluation_flag); - /** - * @deprecated Please use the gather_evaluate() function with the EvaluationFlags argument. - */ - template - DEAL_II_DEPRECATED void - gather_evaluate(const VectorType &input_vector, - const bool evaluate_values, - const bool evaluate_gradients, - const bool evaluate_hessians = false); - /** * This function takes the values and/or gradients that are stored on * quadrature points, tests them by all the basis functions/gradients on the @@ -2276,12 +2247,6 @@ public: void integrate(const EvaluationFlags::EvaluationFlags integration_flag); - /** - * @deprecated Please use the integrate() function with the EvaluationFlags argument. - */ - DEAL_II_DEPRECATED void - integrate(const bool integrate_values, const bool integrate_gradients); - /** * This function takes the values and/or gradients that are stored on * quadrature points, tests them by all the basis functions/gradients on the @@ -2298,14 +2263,6 @@ public: VectorizedArrayType * values_array, const bool sum_into_values = false); - /** - * @deprecated Please use the integrate() function with the EvaluationFlags argument. - */ - DEAL_II_DEPRECATED void - integrate(const bool integrate_values, - const bool integrate_gradients, - VectorizedArrayType *values_array); - /** * This function takes the values and/or gradients that are stored on * quadrature points, tests them by all the basis functions/gradients on the @@ -2324,15 +2281,6 @@ public: integrate_scatter(const EvaluationFlags::EvaluationFlags integration_flag, VectorType & output_vector); - /** - * @deprecated Please use the integrate_scatter() function with the EvaluationFlags argument. - */ - template - DEAL_II_DEPRECATED void - integrate_scatter(const bool integrate_values, - const bool integrate_gradients, - VectorType &output_vector); - /** * Return an object that can be thought of as an array containing all indices * from zero to @p dofs_per_cell. This allows to write code using @@ -2631,12 +2579,6 @@ public: void evaluate(const EvaluationFlags::EvaluationFlags evaluation_flag); - /** - * @deprecated Please use the evaluate() function with the EvaluationFlags argument. - */ - DEAL_II_DEPRECATED void - evaluate(const bool evaluate_values, const bool evaluate_gradients); - /** * Evaluates the function values, the gradients, and the Laplacians of the * FE function given at the DoF values in the input array `values_array` at @@ -2653,14 +2595,6 @@ public: evaluate(const VectorizedArrayType * values_array, const EvaluationFlags::EvaluationFlags evaluation_flag); - /** - * @deprecated Please use the evaluate() function with the EvaluationFlags argument. - */ - DEAL_II_DEPRECATED void - evaluate(const VectorizedArrayType *values_array, - const bool evaluate_values, - const bool evaluate_gradients); - /** * Reads from the input vector and evaluates the function values, the * gradients, and the Laplacians of the FE function at the quadrature points @@ -7815,33 +7749,6 @@ FEEvaluation -inline void -FEEvaluation::evaluate(const bool evaluate_values, - const bool evaluate_gradients, - const bool evaluate_hessians) -{ -# ifdef DEBUG - Assert(this->dof_values_initialized == true, - internal::ExcAccessToUninitializedField()); -# endif - evaluate(this->values_dofs, - evaluate_values, - evaluate_gradients, - evaluate_hessians); -} - - template -inline void -FEEvaluation::evaluate(const VectorizedArrayType - * values_array, - const bool evaluate_values, - const bool evaluate_gradients, - const bool evaluate_hessians) -{ - const EvaluationFlags::EvaluationFlags flag = - ((evaluate_values) ? EvaluationFlags::values : EvaluationFlags::nothing) | - ((evaluate_gradients) ? EvaluationFlags::gradients : - EvaluationFlags::nothing) | - ((evaluate_hessians) ? EvaluationFlags::hessians : - EvaluationFlags::nothing); - - evaluate(values_array, flag); -} - - - template -template -inline void -FEEvaluation< - dim, - fe_degree, - n_q_points_1d, - n_components_, - Number, - VectorizedArrayType>::gather_evaluate(const VectorType &input_vector, - const bool evaluate_values, - const bool evaluate_gradients, - const bool evaluate_hessians) -{ - const EvaluationFlags::EvaluationFlags flag = - ((evaluate_values) ? EvaluationFlags::values : EvaluationFlags::nothing) | - ((evaluate_gradients) ? EvaluationFlags::gradients : - EvaluationFlags::nothing) | - ((evaluate_hessians) ? EvaluationFlags::hessians : - EvaluationFlags::nothing); - - gather_evaluate(input_vector, flag); -} - - namespace internal { /** @@ -8085,30 +7931,6 @@ FEEvaluation -inline void -FEEvaluation::integrate(const bool integrate_values, - const bool integrate_gradients) -{ - integrate(integrate_values, integrate_gradients, this->values_dofs); - -# ifdef DEBUG - this->dof_values_initialized = true; -# endif -} - - - template -inline void -FEEvaluation::integrate(const bool integrate_values, - const bool integrate_gradients, - VectorizedArrayType *values_array) -{ - EvaluationFlags::EvaluationFlags flag = - (integrate_values ? EvaluationFlags::values : EvaluationFlags::nothing) | - (integrate_gradients ? EvaluationFlags::gradients : - EvaluationFlags::nothing); - integrate(flag, values_array); -} - - - template -template -inline void -FEEvaluation< - dim, - fe_degree, - n_q_points_1d, - n_components_, - Number, - VectorizedArrayType>::integrate_scatter(const bool integrate_values, - const bool integrate_gradients, - VectorType &destination) -{ - const EvaluationFlags::EvaluationFlags flag = - ((integrate_values) ? EvaluationFlags::values : EvaluationFlags::nothing) | - ((integrate_gradients) ? EvaluationFlags::gradients : - EvaluationFlags::nothing); - - integrate_scatter(flag, destination); -} - - - template -inline void -FEFaceEvaluation::evaluate(const bool evaluate_values, - const bool evaluate_gradients) -{ -# ifdef DEBUG - Assert(this->dof_values_initialized, ExcNotInitialized()); -# endif - - evaluate(this->values_dofs, evaluate_values, evaluate_gradients); -} - - - template -inline void -FEFaceEvaluation::evaluate(const VectorizedArrayType - * values_array, - const bool evaluate_values, - const bool evaluate_gradients) -{ - const EvaluationFlags::EvaluationFlags flag = - ((evaluate_values) ? EvaluationFlags::values : EvaluationFlags::nothing) | - ((evaluate_gradients) ? EvaluationFlags::gradients : - EvaluationFlags::nothing); - - evaluate(values_array, flag); -} - - - template &phi) { - phi.evaluate(false, true); + phi.evaluate(EvaluationFlags::gradients); for (unsigned int q = 0; q < phi.n_q_points; ++q) phi.submit_gradient(phi.get_gradient(q), q); - phi.integrate(false, true); + phi.integrate(EvaluationFlags::gradients); }); test.do_test(); diff --git a/tests/matrix_free/compute_diagonal_02.cc b/tests/matrix_free/compute_diagonal_02.cc index caeb3f2de1..dc0bb290ab 100644 --- a/tests/matrix_free/compute_diagonal_02.cc +++ b/tests/matrix_free/compute_diagonal_02.cc @@ -111,14 +111,14 @@ test() n_components, Number, VectorizedArrayType> &phi) { - phi.evaluate(false, true, false); + phi.evaluate(EvaluationFlags::gradients); for (unsigned int q = 0; q < phi.n_q_points; ++q) { phi.submit_symmetric_gradient(2.0 * phi.get_symmetric_gradient(q), q); } - phi.integrate(false, true); + phi.integrate(EvaluationFlags::gradients); }); test.do_test(); diff --git a/tests/matrix_free/compute_diagonal_03.cc b/tests/matrix_free/compute_diagonal_03.cc index 013ab7d0a8..bb966d9466 100644 --- a/tests/matrix_free/compute_diagonal_03.cc +++ b/tests/matrix_free/compute_diagonal_03.cc @@ -70,7 +70,7 @@ test() n_components, Number, VectorizedArrayType> &phi) { - phi.evaluate(false, true); + phi.evaluate(EvaluationFlags::gradients); for (unsigned int q = 0; q < phi.n_q_points; ++q) { auto quadrature_point = phi.quadrature_point(q); @@ -86,7 +86,7 @@ test() phi.submit_gradient(coefficient * phi.get_gradient(q), q); } - phi.integrate(false, true); + phi.integrate(EvaluationFlags::gradients); }); test.do_test(); diff --git a/tests/matrix_free/compute_diagonal_04.cc b/tests/matrix_free/compute_diagonal_04.cc index 8762a14058..cb82cfa56a 100644 --- a/tests/matrix_free/compute_diagonal_04.cc +++ b/tests/matrix_free/compute_diagonal_04.cc @@ -74,10 +74,10 @@ test() constraint, [](FEEvaluation &phi) { - phi.evaluate(false, true); + phi.evaluate(EvaluationFlags::gradients); for (unsigned int q = 0; q < phi.n_q_points; ++q) phi.submit_gradient(phi.get_gradient(q), q); - phi.integrate(false, true); + phi.integrate(EvaluationFlags::gradients); }); test.do_test(); diff --git a/tests/matrix_free/compute_diagonal_05.cc b/tests/matrix_free/compute_diagonal_05.cc index a1d5069d11..1275bf81a5 100644 --- a/tests/matrix_free/compute_diagonal_05.cc +++ b/tests/matrix_free/compute_diagonal_05.cc @@ -74,10 +74,10 @@ test() constraint, [](FEEvaluation &phi) { - phi.evaluate(false, true); + phi.evaluate(EvaluationFlags::gradients); for (unsigned int q = 0; q < phi.n_q_points; ++q) phi.submit_gradient(phi.get_gradient(q), q); - phi.integrate(false, true); + phi.integrate(EvaluationFlags::gradients); }); test.do_test(); diff --git a/tests/matrix_free/compute_diagonal_06.cc b/tests/matrix_free/compute_diagonal_06.cc index 4ff19ff58c..83dd50bcb4 100644 --- a/tests/matrix_free/compute_diagonal_06.cc +++ b/tests/matrix_free/compute_diagonal_06.cc @@ -62,10 +62,10 @@ test(const std::vector>> &trias) n_components, Number, VectorizedArrayType> &phi) { - phi.evaluate(false, true); + phi.evaluate(EvaluationFlags::gradients); for (unsigned int q = 0; q < phi.n_q_points; ++q) phi.submit_gradient(phi.get_gradient(q), q); - phi.integrate(false, true); + phi.integrate(EvaluationFlags::gradients); }); test.do_test(); diff --git a/tests/matrix_free/compute_diagonal_07.cc b/tests/matrix_free/compute_diagonal_07.cc index 64397d9a3f..63f92306ea 100644 --- a/tests/matrix_free/compute_diagonal_07.cc +++ b/tests/matrix_free/compute_diagonal_07.cc @@ -82,12 +82,12 @@ test() n_components, Number, VectorizedArrayType> &phi) { - phi.evaluate(false, true, false); + phi.evaluate(EvaluationFlags::gradients); for (unsigned int q = 0; q < phi.n_q_points; ++q) { phi.submit_symmetric_gradient(2.0 * phi.get_symmetric_gradient(q), q); } - phi.integrate(false, true); + phi.integrate(EvaluationFlags::gradients); }; LinearAlgebra::distributed::Vector diagonal_global; diff --git a/tests/matrix_free/ecl.h b/tests/matrix_free/ecl.h index 74c7dda29e..d0906f29ec 100644 --- a/tests/matrix_free/ecl.h +++ b/tests/matrix_free/ecl.h @@ -149,10 +149,10 @@ test(const unsigned int geometry = 0, { phi.reinit(cell); phi.read_dof_values(src); - phi.evaluate(false, true, false); + phi.evaluate(EvaluationFlags::gradients); for (unsigned int q = 0; q < phi.n_q_points; ++q) phi.submit_gradient(phi.get_gradient(q), q); - phi.integrate(false, true); + phi.integrate(EvaluationFlags::gradients); phi.set_dof_values(dst); } }, @@ -163,9 +163,9 @@ test(const unsigned int geometry = 0, phi_p.reinit(face); phi_m.read_dof_values(src); - phi_m.evaluate(true, true); + phi_m.evaluate(EvaluationFlags::values | EvaluationFlags::gradients); phi_p.read_dof_values(src); - phi_p.evaluate(true, true); + phi_p.evaluate(EvaluationFlags::values | EvaluationFlags::gradients); VectorizedArrayType sigmaF = (std::abs( (phi_m.normal_vector(0) * phi_m.inverse_jacobian(0))[dim - 1]) + @@ -240,10 +240,10 @@ test(const unsigned int geometry = 0, { phi.reinit(cell); phi.read_dof_values(src); - phi.evaluate(false, true, false); + phi.evaluate(EvaluationFlags::gradients); for (unsigned int q = 0; q < phi.n_q_points; ++q) phi.submit_gradient(phi.get_gradient(q), q); - phi.integrate(false, true); + phi.integrate(EvaluationFlags::gradients); for (unsigned int face = 0; face < GeometryInfo::faces_per_cell; ++face) diff --git a/tests/matrix_free/interpolate_quadrature_01.cc b/tests/matrix_free/interpolate_quadrature_01.cc index 3311107579..d4223de622 100644 --- a/tests/matrix_free/interpolate_quadrature_01.cc +++ b/tests/matrix_free/interpolate_quadrature_01.cc @@ -104,7 +104,7 @@ test(const unsigned int n_refinements = 1) { phi.reinit(cell); - phi.gather_evaluate(src, true, false); + phi.gather_evaluate(src, EvaluationFlags::values); for (unsigned int face = 0; face < GeometryInfo::faces_per_cell; face++) diff --git a/tests/matrix_free/poisson_dg_hp.cc b/tests/matrix_free/poisson_dg_hp.cc index 7907f02386..f2e45cb7aa 100644 --- a/tests/matrix_free/poisson_dg_hp.cc +++ b/tests/matrix_free/poisson_dg_hp.cc @@ -125,7 +125,7 @@ public: for (unsigned int q = 0; q < phi.n_q_points; ++q) phi.submit_value(1.0, q); - phi.integrate_scatter(true, false, dst); + phi.integrate_scatter(EvaluationFlags::values, dst); } }, vec, diff --git a/tests/simplex/matrix_free_01.cc b/tests/simplex/matrix_free_01.cc index 004c4464dd..37771aeed6 100644 --- a/tests/simplex/matrix_free_01.cc +++ b/tests/simplex/matrix_free_01.cc @@ -85,7 +85,7 @@ public: for (unsigned int q = 0; q < phi.n_q_points; ++q) phi.submit_value(1.0, q); - phi.integrate_scatter(true, false, dst); + phi.integrate_scatter(EvaluationFlags::values, dst); } }, vec, @@ -100,10 +100,14 @@ public: matrix_free.template cell_loop( [&](const auto &, auto &dst, const auto &src, const auto cells) { FEEvaluation phi(matrix_free); + EvaluationFlags::EvaluationFlags fe_eval_flags = + EvaluationFlags::gradients; + if (do_helmholtz) + fe_eval_flags |= EvaluationFlags::values; for (unsigned int cell = cells.first; cell < cells.second; ++cell) { phi.reinit(cell); - phi.gather_evaluate(src, do_helmholtz, true); + phi.gather_evaluate(src, fe_eval_flags); for (unsigned int q = 0; q < phi.n_q_points; ++q) { @@ -113,7 +117,7 @@ public: phi.submit_gradient(phi.get_gradient(q), q); } - phi.integrate_scatter(do_helmholtz, true, dst); + phi.integrate_scatter(fe_eval_flags, dst); } }, dst, diff --git a/tests/simplex/matrix_free_02.cc b/tests/simplex/matrix_free_02.cc index e5a522e654..ed29a62f82 100644 --- a/tests/simplex/matrix_free_02.cc +++ b/tests/simplex/matrix_free_02.cc @@ -88,7 +88,7 @@ public: for (unsigned int q = 0; q < phi.n_q_points; ++q) phi.submit_value(1.0, q); - phi.integrate_scatter(true, false, dst); + phi.integrate_scatter(EvaluationFlags::values, dst); } }, vec, @@ -102,12 +102,16 @@ public: { matrix_free.template cell_loop( [&](const auto &data, auto &dst, const auto &src, const auto range) { - FECellIntegrator phi(matrix_free, range); + FECellIntegrator phi(matrix_free, range); + EvaluationFlags::EvaluationFlags fe_eval_flags = + EvaluationFlags::gradients; + if (do_helmholtz) + fe_eval_flags |= EvaluationFlags::values; for (unsigned int cell = range.first; cell < range.second; ++cell) { phi.reinit(cell); - phi.gather_evaluate(src, do_helmholtz, true); + phi.gather_evaluate(src, fe_eval_flags); for (unsigned int q = 0; q < phi.n_q_points; ++q) { @@ -117,7 +121,7 @@ public: phi.submit_gradient(phi.get_gradient(q), q); } - phi.integrate_scatter(do_helmholtz, true, dst); + phi.integrate_scatter(fe_eval_flags, dst); } }, dst, diff --git a/tests/simplex/matrix_free_03.cc b/tests/simplex/matrix_free_03.cc index d781cdad59..57d3adbb6f 100644 --- a/tests/simplex/matrix_free_03.cc +++ b/tests/simplex/matrix_free_03.cc @@ -138,7 +138,7 @@ public: for (unsigned int q = 0; q < phi.n_q_points; ++q) phi.submit_value(1.0, q); - phi.integrate_scatter(true, false, dst); + phi.integrate_scatter(EvaluationFlags::values, dst); } }, vec, diff --git a/tests/simplex/matrix_free_04.cc b/tests/simplex/matrix_free_04.cc index 5277b5c392..4d95f9a677 100644 --- a/tests/simplex/matrix_free_04.cc +++ b/tests/simplex/matrix_free_04.cc @@ -127,7 +127,7 @@ public: for (unsigned int q = 0; q < phi.n_q_points; ++q) phi.submit_value(1.0, q); - phi.integrate_scatter(true, false, dst); + phi.integrate_scatter(EvaluationFlags::values, dst); } }, vec, diff --git a/tests/simplex/step-12c.cc b/tests/simplex/step-12c.cc index 187073125a..5f233e4b4b 100644 --- a/tests/simplex/step-12c.cc +++ b/tests/simplex/step-12c.cc @@ -746,7 +746,7 @@ public: for (unsigned int q = 0; q < phi.n_q_points; ++q) phi.submit_value(0.0, q); - phi.integrate_scatter(true, false, dst); + phi.integrate_scatter(EvaluationFlags::values, dst); } }, [&](const auto &data, auto &dst, const auto &src, const auto face_range) { @@ -771,7 +771,7 @@ public: q); } - phi.integrate_scatter(true, false, dst); + phi.integrate_scatter(EvaluationFlags::values, dst); } }, vec, @@ -789,12 +789,12 @@ public: ++cell) { phi.reinit(cell); - phi.gather_evaluate(src, true, false); + phi.gather_evaluate(src, EvaluationFlags::values); for (unsigned int q = 0; q < phi.n_q_points; ++q) phi.submit_gradient(-this->beta(phi.quadrature_point(q)) * phi.get_value(q), q); - phi.integrate_scatter(false, true, dst); + phi.integrate_scatter(EvaluationFlags::gradients, dst); } }, [&](const auto &data, auto &dst, const auto &src, const auto face_range) { @@ -831,7 +831,7 @@ public: ++cell) { phi.reinit(cell); - phi.gather_evaluate(src, true, false); + phi.gather_evaluate(src, EvaluationFlags::values); for (unsigned int q = 0; q < phi.n_q_points; ++q) { const auto beta_n =