From e163b97e9e5bd3e90c9561c8f3922f7f4e8a1e26 Mon Sep 17 00:00:00 2001 From: Wolfgang Bangerth Date: Fri, 22 Apr 2011 04:39:56 +0000 Subject: [PATCH] Choose a better FE field for which the divergence is not always a vector of type (a,a) or (a,a,a). git-svn-id: https://svn.dealii.org/trunk@23621 0785d39b-7218-0410-832d-ea1e28bc413d --- tests/deal.II/fe_values_view_23.cc | 2 +- tests/deal.II/fe_values_view_23/cmp/generic | 48 ++++---- tests/deal.II/fe_values_view_24.cc | 104 ++++++++++++++++++ tests/deal.II/fe_values_view_24/cmp/generic | 51 +++++++++ .../fe_values_view_09/cmp/generic | 91 +++++++++++++++ 5 files changed, 271 insertions(+), 25 deletions(-) create mode 100644 tests/deal.II/fe_values_view_24.cc create mode 100644 tests/deal.II/fe_values_view_24/cmp/generic create mode 100644 tests/deal.II/fe_values_view_24/fe_values_view_09/cmp/generic diff --git a/tests/deal.II/fe_values_view_23.cc b/tests/deal.II/fe_values_view_23.cc index 37e4fd1c09..20baccf409 100644 --- a/tests/deal.II/fe_values_view_23.cc +++ b/tests/deal.II/fe_values_view_23.cc @@ -45,7 +45,7 @@ void test (const Triangulation& tr, Vector fe_function(dof.n_dofs()); for (unsigned int i=0; i quadrature(2); FEValues fe_values (fe, quadrature, diff --git a/tests/deal.II/fe_values_view_23/cmp/generic b/tests/deal.II/fe_values_view_23/cmp/generic index 62bab9f620..9dba018604 100644 --- a/tests/deal.II/fe_values_view_23/cmp/generic +++ b/tests/deal.II/fe_values_view_23/cmp/generic @@ -1,51 +1,51 @@ DEAL::FE=FESystem<2>[FE_Q<2>(1)^3] DEAL::q_point=0 -DEAL:: method 1: 15.5 15.5 -DEAL:: method 2: 15.5 15.5 +DEAL:: method 1: 210. 193. +DEAL:: method 2: 210. 193. DEAL:: DEAL::q_point=1 -DEAL:: method 1: 18.3 18.3 -DEAL:: method 2: 18.3 18.3 +DEAL:: method 1: 295. 273. +DEAL:: method 2: 295. 273. DEAL:: DEAL::q_point=2 -DEAL:: method 1: 16.2 16.2 -DEAL:: method 2: 16.2 16.2 +DEAL:: method 1: 223. 215. +DEAL:: method 2: 223. 215. DEAL:: DEAL::q_point=3 -DEAL:: method 1: 20.7 20.7 -DEAL:: method 2: 20.7 20.7 +DEAL:: method 1: 362. 344. +DEAL:: method 2: 362. 344. DEAL:: DEAL::FE=FESystem<3>[FE_Q<3>(1)^6] DEAL::q_point=0 -DEAL:: method 1: 99.4 99.4 99.4 -DEAL:: method 2: 99.4 99.4 99.4 +DEAL:: method 1: 3.72e+03 3.80e+03 3.72e+03 +DEAL:: method 2: 3.72e+03 3.80e+03 3.72e+03 DEAL:: DEAL::q_point=1 -DEAL:: method 1: 99.4 99.4 99.4 -DEAL:: method 2: 99.4 99.4 99.4 +DEAL:: method 1: 4.31e+03 4.39e+03 4.31e+03 +DEAL:: method 2: 4.31e+03 4.39e+03 4.31e+03 DEAL:: DEAL::q_point=2 -DEAL:: method 1: 99.4 99.4 99.4 -DEAL:: method 2: 99.4 99.4 99.4 +DEAL:: method 1: 4.70e+03 4.79e+03 4.70e+03 +DEAL:: method 2: 4.70e+03 4.79e+03 4.70e+03 DEAL:: DEAL::q_point=3 -DEAL:: method 1: 99.4 99.4 99.4 -DEAL:: method 2: 99.4 99.4 99.4 +DEAL:: method 1: 5.29e+03 5.38e+03 5.29e+03 +DEAL:: method 2: 5.29e+03 5.38e+03 5.29e+03 DEAL:: DEAL::q_point=4 -DEAL:: method 1: 99.4 99.4 99.4 -DEAL:: method 2: 99.4 99.4 99.4 +DEAL:: method 1: 4.90e+03 4.98e+03 4.90e+03 +DEAL:: method 2: 4.90e+03 4.98e+03 4.90e+03 DEAL:: DEAL::q_point=5 -DEAL:: method 1: 99.4 99.4 99.4 -DEAL:: method 2: 99.4 99.4 99.4 +DEAL:: method 1: 5.49e+03 5.58e+03 5.49e+03 +DEAL:: method 2: 5.49e+03 5.58e+03 5.49e+03 DEAL:: DEAL::q_point=6 -DEAL:: method 1: 99.4 99.4 99.4 -DEAL:: method 2: 99.4 99.4 99.4 +DEAL:: method 1: 5.88e+03 5.97e+03 5.88e+03 +DEAL:: method 2: 5.88e+03 5.97e+03 5.88e+03 DEAL:: DEAL::q_point=7 -DEAL:: method 1: 99.4 99.4 99.4 -DEAL:: method 2: 99.4 99.4 99.4 +DEAL:: method 1: 6.47e+03 6.56e+03 6.47e+03 +DEAL:: method 2: 6.47e+03 6.56e+03 6.47e+03 DEAL:: diff --git a/tests/deal.II/fe_values_view_24.cc b/tests/deal.II/fe_values_view_24.cc new file mode 100644 index 0000000000..ea381c1280 --- /dev/null +++ b/tests/deal.II/fe_values_view_24.cc @@ -0,0 +1,104 @@ +//---------------------------------------------------------------------- +// $Id$ +// Version: $Name$ +// +// Copyright (C) 2007, 2008, 2010, 2011 by the deal.II authors +// +// This file is subject to QPL and may not be distributed +// without copyright and license information. Please refer +// to the file deal.II/doc/license.html for the text and +// further information on this license. +// +//---------------------------------------------------------------------- + + +// there was a bug in getting the divergence of shape functions for the +// SymmetricTensor extractors. test that it is fixed by comparing with +// get_function_divergences + +#include "../tests.h" +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include + + + +template +void test (const Triangulation& tr, + const FiniteElement& fe) +{ + deallog << "FE=" << fe.get_name() + << std::endl; + + DoFHandler dof(tr); + dof.distribute_dofs(fe); + + Vector fe_function(dof.n_dofs()); + for (unsigned int i=0; i quadrature(2); + FEValues fe_values (fe, quadrature, + update_values | update_gradients); + fe_values.reinit (dof.begin_active()); + + // let the FEValues object compute the + // divergences at quadrature points + std::vector > divergences (quadrature.size()); + FEValuesExtractors::SymmetricTensor<2> extractor(0); + fe_values[extractor] + .get_function_divergences (fe_function, divergences); + + // now do the same "by hand" + std::vector local_dof_indices (fe.dofs_per_cell); + dof.begin_active()->get_dof_indices (local_dof_indices); + + for (unsigned int i=0; i(); + test_hyper_sphere<3>(); +} diff --git a/tests/deal.II/fe_values_view_24/cmp/generic b/tests/deal.II/fe_values_view_24/cmp/generic new file mode 100644 index 0000000000..62bab9f620 --- /dev/null +++ b/tests/deal.II/fe_values_view_24/cmp/generic @@ -0,0 +1,51 @@ + +DEAL::FE=FESystem<2>[FE_Q<2>(1)^3] +DEAL::q_point=0 +DEAL:: method 1: 15.5 15.5 +DEAL:: method 2: 15.5 15.5 +DEAL:: +DEAL::q_point=1 +DEAL:: method 1: 18.3 18.3 +DEAL:: method 2: 18.3 18.3 +DEAL:: +DEAL::q_point=2 +DEAL:: method 1: 16.2 16.2 +DEAL:: method 2: 16.2 16.2 +DEAL:: +DEAL::q_point=3 +DEAL:: method 1: 20.7 20.7 +DEAL:: method 2: 20.7 20.7 +DEAL:: +DEAL::FE=FESystem<3>[FE_Q<3>(1)^6] +DEAL::q_point=0 +DEAL:: method 1: 99.4 99.4 99.4 +DEAL:: method 2: 99.4 99.4 99.4 +DEAL:: +DEAL::q_point=1 +DEAL:: method 1: 99.4 99.4 99.4 +DEAL:: method 2: 99.4 99.4 99.4 +DEAL:: +DEAL::q_point=2 +DEAL:: method 1: 99.4 99.4 99.4 +DEAL:: method 2: 99.4 99.4 99.4 +DEAL:: +DEAL::q_point=3 +DEAL:: method 1: 99.4 99.4 99.4 +DEAL:: method 2: 99.4 99.4 99.4 +DEAL:: +DEAL::q_point=4 +DEAL:: method 1: 99.4 99.4 99.4 +DEAL:: method 2: 99.4 99.4 99.4 +DEAL:: +DEAL::q_point=5 +DEAL:: method 1: 99.4 99.4 99.4 +DEAL:: method 2: 99.4 99.4 99.4 +DEAL:: +DEAL::q_point=6 +DEAL:: method 1: 99.4 99.4 99.4 +DEAL:: method 2: 99.4 99.4 99.4 +DEAL:: +DEAL::q_point=7 +DEAL:: method 1: 99.4 99.4 99.4 +DEAL:: method 2: 99.4 99.4 99.4 +DEAL:: diff --git a/tests/deal.II/fe_values_view_24/fe_values_view_09/cmp/generic b/tests/deal.II/fe_values_view_24/fe_values_view_09/cmp/generic new file mode 100644 index 0000000000..977609c8f4 --- /dev/null +++ b/tests/deal.II/fe_values_view_24/fe_values_view_09/cmp/generic @@ -0,0 +1,91 @@ + +DEAL::FE=FESystem<2>[FE_Q<2>(1)-FE_RaviartThomas<2>(1)-FE_Nedelec<2>(1)] +DEAL::component=0 +DEAL::0.807 4.36 +DEAL::0.807 5.29 +DEAL::1.31 4.07 +DEAL::1.31 5.59 +DEAL::component=1 +DEAL::18.2 352. +DEAL::-18.2 337. +DEAL::333. 180. +DEAL::-295. 296. +DEAL::component=2 +DEAL::43.2 -31.7 +DEAL::43.2 118. +DEAL::125. -61.1 +DEAL::125. -40.8 +DEAL::component=3 +DEAL::2.58e-16 5.84 +DEAL::2.58e-16 5.84 +DEAL::3.58e-16 9.52 +DEAL::3.58e-16 9.52 +DEAL::component=4 +DEAL::5.84 -6.75 +DEAL::5.84 6.75 +DEAL::9.52 -11.0 +DEAL::9.52 11.0 +DEAL::FE=FESystem<3>[FE_Q<3>(1)-FE_RaviartThomas<3>(1)-FE_Nedelec<3>(1)] +DEAL::component=0 +DEAL::2.37 4.73 9.46 +DEAL::2.37 4.73 9.46 +DEAL::2.37 4.73 9.46 +DEAL::2.37 4.73 9.46 +DEAL::2.37 4.73 9.46 +DEAL::2.37 4.73 9.46 +DEAL::2.37 4.73 9.46 +DEAL::2.37 4.73 9.46 +DEAL::component=1 +DEAL::8.18e-13 -275. -138. +DEAL::-5.71e-13 -275. -138. +DEAL::-367. -275. 4.71e+03 +DEAL::367. -275. 4.92e+03 +DEAL::-184. 4.57e+03 -138. +DEAL::184. 4.79e+03 -138. +DEAL::4.80e+03 4.57e+03 4.71e+03 +DEAL::-4.38e+03 4.79e+03 4.92e+03 +DEAL::component=2 +DEAL::-275. 1.30e-12 -138. +DEAL::-275. -459. 4.80e+03 +DEAL::-275. -1.40e-12 -138. +DEAL::-275. 459. 5.02e+03 +DEAL::4.67e+03 -91.8 -138. +DEAL::4.67e+03 3.52e+03 4.80e+03 +DEAL::4.88e+03 91.8 -138. +DEAL::4.88e+03 -3.09e+03 5.02e+03 +DEAL::component=3 +DEAL::-275. -138. 1.36e-12 +DEAL::-275. 4.90e+03 -367. +DEAL::4.76e+03 -138. -184. +DEAL::4.76e+03 4.90e+03 2.23e+03 +DEAL::-275. -138. -3.64e-12 +DEAL::-275. 5.11e+03 367. +DEAL::4.97e+03 -138. 184. +DEAL::4.97e+03 5.11e+03 -1.81e+03 +DEAL::component=4 +DEAL::-7.70e-16 5.60 22.4 +DEAL::-7.70e-16 5.60 22.4 +DEAL::-6.69e-16 5.60 22.4 +DEAL::-6.69e-16 5.60 22.4 +DEAL::1.58e-16 5.60 22.4 +DEAL::1.58e-16 5.60 22.4 +DEAL::9.52e-16 5.60 22.4 +DEAL::9.52e-16 5.60 22.4 +DEAL::component=5 +DEAL::5.60 5.78e-16 22.4 +DEAL::5.60 -1.39e-15 22.4 +DEAL::5.60 5.78e-16 22.4 +DEAL::5.60 -1.39e-15 22.4 +DEAL::5.60 -6.60e-16 22.4 +DEAL::5.60 3.53e-16 22.4 +DEAL::5.60 -6.60e-16 22.4 +DEAL::5.60 3.53e-16 22.4 +DEAL::component=6 +DEAL::5.60 11.2 -1.38e-15 +DEAL::5.60 11.2 1.96e-16 +DEAL::5.60 11.2 1.23e-17 +DEAL::5.60 11.2 1.50e-15 +DEAL::5.60 11.2 -1.38e-15 +DEAL::5.60 11.2 1.96e-16 +DEAL::5.60 11.2 1.23e-17 +DEAL::5.60 11.2 1.50e-15 -- 2.39.5