From 73efed7bfe6d9b4db63c640a318d977688d47c94 Mon Sep 17 00:00:00 2001 From: Wolfgang Bangerth Date: Fri, 23 Apr 2021 14:33:46 -0600 Subject: [PATCH] Also adjust tests. --- ...w_get_function_from_local_dof_values_01.cc | 90 +++++++++++-------- ...w_get_function_from_local_dof_values_02.cc | 66 ++++++++------ tests/fe/fe_values_views_types.cc | 10 ++- 3 files changed, 97 insertions(+), 69 deletions(-) diff --git a/tests/fe/fe_values_view_get_function_from_local_dof_values_01.cc b/tests/fe/fe_values_view_get_function_from_local_dof_values_01.cc index 150c2d8a5c..d678c09855 100644 --- a/tests/fe/fe_values_view_get_function_from_local_dof_values_01.cc +++ b/tests/fe/fe_values_view_get_function_from_local_dof_values_01.cc @@ -59,7 +59,6 @@ test_view(const Vector & solution, const View &fe_values_view = fe_values[extractor]; // Typedefs - using OutputType = typename View::template OutputType; using value_type = typename ProductType::type; using gradient_type = @@ -73,36 +72,41 @@ test_view(const Vector & solution, NumberType>::type; // Values - std::vector qp_values_local(n_q_points); - std::vector qp_values_global(n_q_points); + std::vector> + qp_values_local(n_q_points); + std::vector qp_values_global(n_q_points); fe_values_view.get_function_values_from_local_dof_values(local_dof_values, qp_values_local); fe_values_view.get_function_values(solution, qp_values_global); // Gradients - std::vector qp_grads_local(n_q_points); - std::vector qp_grads_global(n_q_points); + std::vector> + qp_grads_local(n_q_points); + std::vector qp_grads_global(n_q_points); fe_values_view.get_function_gradients_from_local_dof_values(local_dof_values, qp_grads_local); fe_values_view.get_function_gradients(solution, qp_grads_global); // Hessians - std::vector qp_hess_local(n_q_points); - std::vector qp_hess_global(n_q_points); + std::vector> + qp_hess_local(n_q_points); + std::vector qp_hess_global(n_q_points); fe_values_view.get_function_hessians_from_local_dof_values(local_dof_values, qp_hess_local); fe_values_view.get_function_hessians(solution, qp_hess_global); // Laplacians - std::vector qp_laplace_local(n_q_points); + std::vector> + qp_laplace_local(n_q_points); std::vector qp_laplace_global(n_q_points); fe_values_view.get_function_laplacians_from_local_dof_values( local_dof_values, qp_laplace_local); fe_values_view.get_function_laplacians(solution, qp_laplace_global); // Third derivatives - std::vector qp_third_deriv_local( - n_q_points); + std::vector< + typename View::template solution_third_derivative_type> + qp_third_deriv_local(n_q_points); std::vector qp_third_deriv_global(n_q_points); fe_values_view.get_function_third_derivatives_from_local_dof_values( local_dof_values, qp_third_deriv_local); @@ -145,7 +149,6 @@ test_view(const Vector & solution, const View &fe_values_view = fe_values[extractor]; // Typedefs - using OutputType = typename View::template OutputType; using value_type = typename ProductType::type; using gradient_type = @@ -166,22 +169,25 @@ test_view(const Vector & solution, NumberType>::type; // Values - std::vector qp_values_local(n_q_points); - std::vector qp_values_global(n_q_points); + std::vector> + qp_values_local(n_q_points); + std::vector qp_values_global(n_q_points); fe_values_view.get_function_values_from_local_dof_values(local_dof_values, qp_values_local); fe_values_view.get_function_values(solution, qp_values_global); // Gradients - std::vector qp_grads_local(n_q_points); - std::vector qp_grads_global(n_q_points); + std::vector> + qp_grads_local(n_q_points); + std::vector qp_grads_global(n_q_points); fe_values_view.get_function_gradients_from_local_dof_values(local_dof_values, qp_grads_local); fe_values_view.get_function_gradients(solution, qp_grads_global); // Symmetric gradients - std::vector qp_symm_grads_local( - n_q_points); + std::vector< + typename View::template solution_symmetric_gradient_type> + qp_symm_grads_local(n_q_points); std::vector qp_symm_grads_global(n_q_points); fe_values_view.get_function_symmetric_gradients_from_local_dof_values( local_dof_values, qp_symm_grads_local); @@ -189,36 +195,41 @@ test_view(const Vector & solution, qp_symm_grads_global); // Divergences - std::vector qp_divs_local(n_q_points); - std::vector qp_divs_global(n_q_points); + std::vector> + qp_divs_local(n_q_points); + std::vector qp_divs_global(n_q_points); fe_values_view.get_function_divergences_from_local_dof_values( local_dof_values, qp_divs_local); fe_values_view.get_function_divergences(solution, qp_divs_global); // Curls - std::vector qp_curls_local(n_q_points); - std::vector qp_curls_global(n_q_points); + std::vector> + qp_curls_local(n_q_points); + std::vector qp_curls_global(n_q_points); fe_values_view.get_function_curls_from_local_dof_values(local_dof_values, qp_curls_local); fe_values_view.get_function_curls(solution, qp_curls_global); // Hessians - std::vector qp_hess_local(n_q_points); - std::vector qp_hess_global(n_q_points); + std::vector> + qp_hess_local(n_q_points); + std::vector qp_hess_global(n_q_points); fe_values_view.get_function_hessians_from_local_dof_values(local_dof_values, qp_hess_local); fe_values_view.get_function_hessians(solution, qp_hess_global); // Laplacians - std::vector qp_laplace_local(n_q_points); + std::vector> + qp_laplace_local(n_q_points); std::vector qp_laplace_global(n_q_points); fe_values_view.get_function_laplacians_from_local_dof_values( local_dof_values, qp_laplace_local); fe_values_view.get_function_laplacians(solution, qp_laplace_global); // Third derivatives - std::vector qp_third_deriv_local( - n_q_points); + std::vector< + typename View::template solution_third_derivative_type> + qp_third_deriv_local(n_q_points); std::vector qp_third_deriv_global(n_q_points); fe_values_view.get_function_third_derivatives_from_local_dof_values( local_dof_values, qp_third_deriv_local); @@ -275,22 +286,23 @@ test_view(const Vector & solution, const View &fe_values_view = fe_values[extractor]; // Typedefs - using OutputType = typename View::template OutputType; using value_type = typename ProductType::type; using divergence_type = typename ProductType::type; // Values - std::vector qp_values_local(n_q_points); - std::vector qp_values_global(n_q_points); + std::vector> + qp_values_local(n_q_points); + std::vector qp_values_global(n_q_points); fe_values_view.get_function_values_from_local_dof_values(local_dof_values, qp_values_local); fe_values_view.get_function_values(solution, qp_values_global); // Divergences - std::vector qp_divs_local(n_q_points); - std::vector qp_divs_global(n_q_points); + std::vector> + qp_divs_local(n_q_points); + std::vector qp_divs_global(n_q_points); fe_values_view.get_function_divergences_from_local_dof_values( local_dof_values, qp_divs_local); fe_values_view.get_function_divergences(solution, qp_divs_global); @@ -321,7 +333,6 @@ test_view(const Vector & solution, const View &fe_values_view = fe_values[extractor]; // Typedefs - using OutputType = typename View::template OutputType; using value_type = typename ProductType::type; using gradient_type = @@ -330,22 +341,25 @@ test_view(const Vector & solution, typename ProductType::type; // Values - std::vector qp_values_local(n_q_points); - std::vector qp_values_global(n_q_points); + std::vector> + qp_values_local(n_q_points); + std::vector qp_values_global(n_q_points); fe_values_view.get_function_values_from_local_dof_values(local_dof_values, qp_values_local); fe_values_view.get_function_values(solution, qp_values_global); // Divergences - std::vector qp_divs_local(n_q_points); - std::vector qp_divs_global(n_q_points); + std::vector> + qp_divs_local(n_q_points); + std::vector qp_divs_global(n_q_points); fe_values_view.get_function_divergences_from_local_dof_values( local_dof_values, qp_divs_local); fe_values_view.get_function_divergences(solution, qp_divs_global); // Gradients - std::vector qp_grads_local(n_q_points); - std::vector qp_grads_global(n_q_points); + std::vector> + qp_grads_local(n_q_points); + std::vector qp_grads_global(n_q_points); fe_values_view.get_function_gradients_from_local_dof_values(local_dof_values, qp_grads_local); fe_values_view.get_function_gradients(solution, qp_grads_global); diff --git a/tests/fe/fe_values_view_get_function_from_local_dof_values_02.cc b/tests/fe/fe_values_view_get_function_from_local_dof_values_02.cc index 5045af2f79..c4364d36cb 100644 --- a/tests/fe/fe_values_view_get_function_from_local_dof_values_02.cc +++ b/tests/fe/fe_values_view_get_function_from_local_dof_values_02.cc @@ -65,31 +65,34 @@ test_view(const Vector & solution, const View &fe_values_view = fe_values[extractor]; // Typedefs - using OutputType = typename View::template OutputType; - // Values - std::vector qp_values_local(n_q_points); + std::vector> + qp_values_local(n_q_points); fe_values_view.get_function_values_from_local_dof_values(local_dof_values, qp_values_local); // Gradients - std::vector qp_grads_local(n_q_points); + std::vector> + qp_grads_local(n_q_points); fe_values_view.get_function_gradients_from_local_dof_values(local_dof_values, qp_grads_local); // Hessians - std::vector qp_hess_local(n_q_points); + std::vector> + qp_hess_local(n_q_points); fe_values_view.get_function_hessians_from_local_dof_values(local_dof_values, qp_hess_local); // Laplacians - std::vector qp_laplace_local(n_q_points); + std::vector> + qp_laplace_local(n_q_points); fe_values_view.get_function_laplacians_from_local_dof_values( local_dof_values, qp_laplace_local); // Third derivatives - std::vector qp_third_deriv_local( - n_q_points); + std::vector< + typename View::template solution_third_derivative_type> + qp_third_deriv_local(n_q_points); fe_values_view.get_function_third_derivatives_from_local_dof_values( local_dof_values, qp_third_deriv_local); } @@ -108,47 +111,53 @@ test_view(const Vector & solution, const View &fe_values_view = fe_values[extractor]; // Typedefs - using OutputType = typename View::template OutputType; - // Values - std::vector qp_values_local(n_q_points); + std::vector> + qp_values_local(n_q_points); fe_values_view.get_function_values_from_local_dof_values(local_dof_values, qp_values_local); // Gradients - std::vector qp_grads_local(n_q_points); + std::vector> + qp_grads_local(n_q_points); fe_values_view.get_function_gradients_from_local_dof_values(local_dof_values, qp_grads_local); // Symmetric gradients - std::vector qp_symm_grads_local( - n_q_points); + std::vector< + typename View::template solution_symmetric_gradient_type> + qp_symm_grads_local(n_q_points); fe_values_view.get_function_symmetric_gradients_from_local_dof_values( local_dof_values, qp_symm_grads_local); // Divergences - std::vector qp_divs_local(n_q_points); + std::vector> + qp_divs_local(n_q_points); fe_values_view.get_function_divergences_from_local_dof_values( local_dof_values, qp_divs_local); // Curls - std::vector qp_curls_local(n_q_points); + std::vector> + qp_curls_local(n_q_points); fe_values_view.get_function_curls_from_local_dof_values(local_dof_values, qp_curls_local); // Hessians - std::vector qp_hess_local(n_q_points); + std::vector> + qp_hess_local(n_q_points); fe_values_view.get_function_hessians_from_local_dof_values(local_dof_values, qp_hess_local); // Laplacians - std::vector qp_laplace_local(n_q_points); + std::vector> + qp_laplace_local(n_q_points); fe_values_view.get_function_laplacians_from_local_dof_values( local_dof_values, qp_laplace_local); // Third derivatives - std::vector qp_third_deriv_local( - n_q_points); + std::vector< + typename View::template solution_third_derivative_type> + qp_third_deriv_local(n_q_points); fe_values_view.get_function_third_derivatives_from_local_dof_values( local_dof_values, qp_third_deriv_local); } @@ -167,19 +176,20 @@ test_view(const Vector & solution, const View &fe_values_view = fe_values[extractor]; // Typedefs - using OutputType = typename View::template OutputType; using value_type = typename ProductType::type; using divergence_type = typename ProductType::type; // Values - std::vector qp_values_local(n_q_points); + std::vector> + qp_values_local(n_q_points); fe_values_view.get_function_values_from_local_dof_values(local_dof_values, qp_values_local); // Divergences - std::vector qp_divs_local(n_q_points); + std::vector> + qp_divs_local(n_q_points); fe_values_view.get_function_divergences_from_local_dof_values( local_dof_values, qp_divs_local); } @@ -198,7 +208,6 @@ test_view(const Vector & solution, const View &fe_values_view = fe_values[extractor]; // Typedefs - using OutputType = typename View::template OutputType; using value_type = typename ProductType::type; using gradient_type = @@ -207,17 +216,20 @@ test_view(const Vector & solution, typename ProductType::type; // Values - std::vector qp_values_local(n_q_points); + std::vector> + qp_values_local(n_q_points); fe_values_view.get_function_values_from_local_dof_values(local_dof_values, qp_values_local); // Divergences - std::vector qp_divs_local(n_q_points); + std::vector> + qp_divs_local(n_q_points); fe_values_view.get_function_divergences_from_local_dof_values( local_dof_values, qp_divs_local); // Gradients - std::vector qp_grads_local(n_q_points); + std::vector> + qp_grads_local(n_q_points); fe_values_view.get_function_gradients_from_local_dof_values(local_dof_values, qp_grads_local); } diff --git a/tests/fe/fe_values_views_types.cc b/tests/fe/fe_values_views_types.cc index e6f573900a..b63d71d1e5 100644 --- a/tests/fe/fe_values_views_types.cc +++ b/tests/fe/fe_values_views_types.cc @@ -25,11 +25,13 @@ template void test(const Extractor &) { - typename FEValuesViews::View::template OutputType< - double>::value_type t1; + typename FEValuesViews::View:: + template solution_value_type + t1; - typename FEValuesViews::View::template OutputType< - double>::gradient_type t2; + typename FEValuesViews::View:: + template solution_gradient_type + t2; deallog << "Test<" << Utilities::dim_string(dim, spacedim) << ">" << std::endl << Utilities::type_to_string(t1) << std::endl -- 2.39.5