]> https://gitweb.dealii.org/ - dealii.git/commitdiff
add test
authorAndreas Ritthaler <andreas.ritthaler@tum.de>
Tue, 17 Sep 2024 15:03:31 +0000 (17:03 +0200)
committerAndreas Ritthaler <andreas.ritthaler@tum.de>
Tue, 17 Sep 2024 15:03:31 +0000 (17:03 +0200)
tests/matrix_free/matrix_vector_normal_hessians.cc
tests/matrix_free/matrix_vector_normal_hessians.output

index 4df6c534f7ac7dfcbc3bc9276b0b25a2fd1edc36..adc4d4db6c7cfdca4ee80a1a251814a48fe2c864 100644 (file)
@@ -27,6 +27,7 @@
 
 #include <deal.II/fe/fe_dgq.h>
 #include <deal.II/fe/fe_q.h>
+#include <deal.II/fe/fe_system.h>
 #include <deal.II/fe/fe_values.h>
 #include <deal.II/fe/mapping_q_generic.h>
 
@@ -46,7 +47,8 @@ template <int dim>
 void
 test_hessians(const unsigned int                             degree,
               const dealii::FE_Poly<dim>                    &fe,
-              const dealii::EvaluationFlags::EvaluationFlags evaluation_flags)
+              const dealii::EvaluationFlags::EvaluationFlags evaluation_flags,
+              const bool                                     check_system)
 {
   using VectorizedArrayType = VectorizedArray<double>;
 
@@ -61,7 +63,14 @@ test_hessians(const unsigned int                             degree,
   tria.execute_coarsening_and_refinement();
 
   DoFHandler<dim> dof_handler(tria);
-  dof_handler.distribute_dofs(fe);
+  if (check_system)
+    {
+      FESystem<dim> fe_system(fe, dim + 1);
+      dof_handler.distribute_dofs(fe_system);
+    }
+  else
+    dof_handler.distribute_dofs(fe);
+
   MappingQGeneric<dim> mapping(1);
 
   AffineConstraints<double> 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);
   }
 }
index 24105ddbebb4bdfc974d759506395fc6c11a183d..4f68a4a097bad628eeddd3d412c55a10eebba6fc 100644 (file)
@@ -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 

In the beginning the Universe was created. This has made a lot of people very angry and has been widely regarded as a bad move.

Douglas Adams


Typeset in Trocchi and Trocchi Bold Sans Serif.