From 400a8f4e25994035ed56104780513bb415a2de5e Mon Sep 17 00:00:00 2001 From: bangerth Date: Mon, 3 Feb 2014 21:01:26 +0000 Subject: [PATCH] Generalize test. git-svn-id: https://svn.dealii.org/trunk@32397 0785d39b-7218-0410-832d-ea1e28bc413d --- tests/deal.II/fe_values_view_29.cc | 12 ++++++++---- tests/deal.II/fe_values_view_29.output | 18 ++++++++++++++++++ 2 files changed, 26 insertions(+), 4 deletions(-) diff --git a/tests/deal.II/fe_values_view_29.cc b/tests/deal.II/fe_values_view_29.cc index cd8a9795be..e5f27a480a 100644 --- a/tests/deal.II/fe_values_view_29.cc +++ b/tests/deal.II/fe_values_view_29.cc @@ -68,7 +68,8 @@ Tensor<1,3> curl (const Tensor<2,3> &grads) template void test (const Triangulation &tr, - const FiniteElement &fe) + const FiniteElement &fe, + const unsigned int degree) { deallog << "FE=" << fe.get_name() << std::endl; @@ -81,7 +82,7 @@ void test (const Triangulation &tr, // equals the vector function (0,x^2) ConstraintMatrix cm; cm.close (); - VectorTools::project (dof, cm, QGauss<2>(4), F(), fe_function); + VectorTools::project (dof, cm, QGauss<2>(2+degree), F(), fe_function); const QGauss quadrature(2); FEValues fe_values (fe, quadrature, @@ -124,8 +125,11 @@ void test_hyper_cube() Triangulation tr; GridGenerator::hyper_cube(tr); - FE_Nedelec fe(2); - test(tr, fe); + for (unsigned int degree=2; degree<5; ++degree) + { + FE_Nedelec fe(degree); + test(tr, fe, degree); + } } diff --git a/tests/deal.II/fe_values_view_29.output b/tests/deal.II/fe_values_view_29.output index 534b134add..7903818da5 100644 --- a/tests/deal.II/fe_values_view_29.output +++ b/tests/deal.II/fe_values_view_29.output @@ -8,3 +8,21 @@ DEAL:: curls[q]= 0.423 DEAL:: grads[q]= 0.00 0.00 0.423 -2.00e-16 DEAL:: curls[q]= 1.58 DEAL:: grads[q]= 0.00 0.00 1.58 -3.38e-16 +DEAL::FE=FE_Nedelec<2>(3) +DEAL:: curls[q]= 0.423 +DEAL:: grads[q]= 0.00 0.00 0.423 5.69e-17 +DEAL:: curls[q]= 1.58 +DEAL:: grads[q]= 0.00 0.00 1.58 1.29e-15 +DEAL:: curls[q]= 0.423 +DEAL:: grads[q]= 0.00 0.00 0.423 2.40e-15 +DEAL:: curls[q]= 1.58 +DEAL:: grads[q]= 0.00 0.00 1.58 6.52e-16 +DEAL::FE=FE_Nedelec<2>(4) +DEAL:: curls[q]= 0.423 +DEAL:: grads[q]= 0.00 0.00 0.423 -1.06e-15 +DEAL:: curls[q]= 1.58 +DEAL:: grads[q]= 0.00 0.00 1.58 2.32e-15 +DEAL:: curls[q]= 0.423 +DEAL:: grads[q]= 0.00 0.00 0.423 1.64e-15 +DEAL:: curls[q]= 1.58 +DEAL:: grads[q]= 0.00 0.00 1.58 -2.01e-15 -- 2.39.5