From c63925ee9d276b8d692ad9447ab05f377263313d Mon Sep 17 00:00:00 2001 From: Andreas Ritthaler Date: Tue, 17 Sep 2024 17:03:31 +0200 Subject: [PATCH] add test --- .../matrix_vector_normal_hessians.cc | 26 +++++++++++++------ .../matrix_vector_normal_hessians.output | 2 ++ 2 files changed, 20 insertions(+), 8 deletions(-) diff --git a/tests/matrix_free/matrix_vector_normal_hessians.cc b/tests/matrix_free/matrix_vector_normal_hessians.cc index 4df6c534f7..adc4d4db6c 100644 --- a/tests/matrix_free/matrix_vector_normal_hessians.cc +++ b/tests/matrix_free/matrix_vector_normal_hessians.cc @@ -27,6 +27,7 @@ #include #include +#include #include #include @@ -46,7 +47,8 @@ template void test_hessians(const unsigned int degree, const dealii::FE_Poly &fe, - const dealii::EvaluationFlags::EvaluationFlags evaluation_flags) + const dealii::EvaluationFlags::EvaluationFlags evaluation_flags, + const bool check_system) { using VectorizedArrayType = VectorizedArray; @@ -61,7 +63,14 @@ test_hessians(const unsigned int degree, tria.execute_coarsening_and_refinement(); DoFHandler dof_handler(tria); - dof_handler.distribute_dofs(fe); + if (check_system) + { + FESystem fe_system(fe, dim + 1); + dof_handler.distribute_dofs(fe_system); + } + else + dof_handler.distribute_dofs(fe); + MappingQGeneric mapping(1); AffineConstraints constraints; @@ -168,12 +177,13 @@ main(int argc, char **argv) deallog << "test_hessians_only" << std::endl; for (unsigned int i = 1; i < 3; ++i) { - test_hessians<1>(i, dealii::FE_Q<1>(i), evaluation_flags); - test_hessians<2>(i, dealii::FE_Q<2>(i), evaluation_flags); - test_hessians<3>(i, dealii::FE_Q<3>(i), evaluation_flags); - test_hessians<1>(i, dealii::FE_DGQ<1>(i), evaluation_flags); - test_hessians<2>(i, dealii::FE_DGQ<2>(i), evaluation_flags); - test_hessians<3>(i, dealii::FE_DGQ<3>(i), evaluation_flags); + test_hessians<1>(i, dealii::FE_Q<1>(i), evaluation_flags, false); + test_hessians<2>(i, dealii::FE_Q<2>(i), evaluation_flags, false); + test_hessians<3>(i, dealii::FE_Q<3>(i), evaluation_flags, false); + test_hessians<1>(i, dealii::FE_DGQ<1>(i), evaluation_flags, false); + test_hessians<2>(i, dealii::FE_DGQ<2>(i), evaluation_flags, false); + test_hessians<3>(i, dealii::FE_DGQ<3>(i), evaluation_flags, false); } + test_hessians<2>(3, dealii::FE_DGQ<2>(3), evaluation_flags, true); } } diff --git a/tests/matrix_free/matrix_vector_normal_hessians.output b/tests/matrix_free/matrix_vector_normal_hessians.output index 24105ddbeb..4f68a4a097 100644 --- a/tests/matrix_free/matrix_vector_normal_hessians.output +++ b/tests/matrix_free/matrix_vector_normal_hessians.output @@ -24,3 +24,5 @@ DEAL::Working with FE_DGQ<2>(2) and 306 dofs DEAL::dst FEE: -87.24207970 115.4371186 -231.0527514 560.7971199 -1003.500158 848.4184633 -161.0790796 263.1111184 -304.8897513 DEAL::Working with FE_DGQ<3>(2) and 783 dofs DEAL::dst FEE: 2.138422207 4.212276390 -2.105358266 -0.9089585142 -15.50152582 0.1505972516 -0.1426991866 0.9662025725 0.2225716328 +DEAL::Working with FE_DGQ<2>(3) and 1632 dofs +DEAL::dst FEE: 174.8219941 887.6768593 -707.7968318 -688.1857659 12700.34925 -32675.82435 33178.15217 -12250.88045 -16623.37207 -- 2.39.5