From: Wolfgang Bangerth Date: Tue, 21 Apr 2009 19:29:11 +0000 (+0000) Subject: Add a bunch of new tests. X-Git-Tag: v8.0.0~7795 X-Git-Url: https://gitweb.dealii.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=6f8e65ccb54eeb534f1c73c2f3aad5789f31a939;p=dealii.git Add a bunch of new tests. git-svn-id: https://svn.dealii.org/trunk@18677 0785d39b-7218-0410-832d-ea1e28bc413d --- diff --git a/tests/fe/Makefile b/tests/fe/Makefile index 912cf3279a..d823b744b1 100644 --- a/tests/fe/Makefile +++ b/tests/fe/Makefile @@ -1,6 +1,6 @@ ############################################################ # Makefile,v 1.15 2002/06/13 12:51:13 hartmann Exp -# Copyright (C) 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008 by the deal.II authors +# Copyright (C) 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009 by the deal.II authors ############################################################ ############################################################ @@ -39,7 +39,9 @@ tests_x=fe_data_test traits fe_tools fe_tools_* mapping \ nedelec* \ up_and_down \ check_derivatives \ - injection_* copy_* + injection_* \ + copy_* \ + cell_similarity_* # from above list of regular expressions, generate the real set of # tests diff --git a/tests/fe/cell_similarity_01.cc b/tests/fe/cell_similarity_01.cc new file mode 100644 index 0000000000..3b3ba5ff54 --- /dev/null +++ b/tests/fe/cell_similarity_01.cc @@ -0,0 +1,174 @@ +//---------------------------------------------------------------------- +// $Id$ +// Version: $Name$ +// +// Copyright (C) 2009 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. +// +//---------------------------------------------------------------------- + + +// since early 2009, the FEValues objects try to be more efficient by only +// recomputing things like gradients of shape functions if the cell on which +// we are is not a translation of the previous one. in this series of tests we +// make sure that this actually works the way it's supposed to be; in +// particular, if we create a mesh of two identical cells but one has a curved +// boundary, then they are the same if we use a Q1 mapping, but not a Q2 +// mapping. so we test that the mass matrix we get from each of these cells is +// actually different in the latter case, but the same in the former +// +// the various tests cell_similarity_?? differ in the mappings and finite +// elements in use + + +#include "../tests.h" +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include + + +bool equal (const FullMatrix &m1, + const FullMatrix &m2) +{ + double d = 0, s = 0; + for (unsigned int i=0; i +void test (const Triangulation& tr) +{ + FE_Q fe(1); + deallog << "FE=" << fe.get_name() << std::endl; + + MappingQ1 mapping; + deallog << "Mapping=Q1" << std::endl; + + + DoFHandler dof(tr); + dof.distribute_dofs(fe); + + const QGauss quadrature(2); + FEValues fe_values (mapping, fe, quadrature, + update_values | update_gradients | + update_JxW_values); + + FullMatrix mass_matrix[2], laplace_matrix[2]; + mass_matrix[0].reinit(fe.dofs_per_cell, fe.dofs_per_cell); + mass_matrix[1].reinit(fe.dofs_per_cell, fe.dofs_per_cell); + laplace_matrix[0].reinit(fe.dofs_per_cell, fe.dofs_per_cell); + laplace_matrix[1].reinit(fe.dofs_per_cell, fe.dofs_per_cell); + + for (typename DoFHandler::active_cell_iterator + cell = dof.begin_active(); + cell != dof.end(); ++cell) + { + fe_values.reinit (cell); + + for (unsigned int i=0; iindex()](i,j) += fe_values.shape_value (i,q) * + fe_values.shape_value (j,q) * + fe_values.JxW(q); + laplace_matrix[cell->index()](i,j) += fe_values.shape_grad (i,q) * + fe_values.shape_grad (j,q) * + fe_values.JxW(q); + } + } + + // check what we expect for this mapping + // about equality or inequality of the + // matrices + deallog << "Mass matrices " + << (equal (mass_matrix[0], mass_matrix[1]) ? "are" : "are not") + << " equal." + << std::endl; + deallog << "Laplace matrices " + << (equal (laplace_matrix[0], laplace_matrix[1]) ? "are" : "are not") + << " equal." + << std::endl; + + for (unsigned int cell=0; cell<2; ++cell) + { + deallog << "cell=" << cell << std::endl; + deallog << "mass_matrix:" << std::endl; + for (unsigned int i=0; i +void test() +{ + Triangulation tr; + Point p1 = Point(); + Point p2 = (dim == 2 ? + Point(2,1) : + Point(2,1,1)); + std::vector subdivisions (dim, 1); + subdivisions[0] = 2; + GridGenerator::subdivided_hyper_rectangle(tr, subdivisions, p1, p2); + + static const HyperBallBoundary boundary; + tr.set_boundary (1, boundary); + + // set boundary id on cell 1 + for (unsigned int f=0; f::faces_per_cell; ++f) + if (tr.begin_active()->at_boundary(f)) + tr.begin_active()->face(f)->set_boundary_indicator (1); + + test(tr); +} + + +int main() +{ + std::ofstream logfile ("cell_similarity_01/output"); + deallog << std::setprecision (4); + + deallog.attach(logfile); + deallog.depth_console (0); + deallog.threshold_double(1.e-7); + + test<2>(); + test<3>(); +} diff --git a/tests/fe/cell_similarity_01/cmp/generic b/tests/fe/cell_similarity_01/cmp/generic new file mode 100644 index 0000000000..e8e4bc0138 --- /dev/null +++ b/tests/fe/cell_similarity_01/cmp/generic @@ -0,0 +1,69 @@ + +DEAL::FE=FE_Q<2>(1) +DEAL::Mapping=Q1 +DEAL::Mass matrices are equal. +DEAL::Laplace matrices are equal. +DEAL::cell=0 +DEAL::mass_matrix: +DEAL::0.1111 0.05556 0.05556 0.02778 +DEAL::0.05556 0.1111 0.02778 0.05556 +DEAL::0.05556 0.02778 0.1111 0.05556 +DEAL::0.02778 0.05556 0.05556 0.1111 +DEAL::laplace_matrix: +DEAL::0.6667 -0.1667 -0.1667 -0.3333 +DEAL::-0.1667 0.6667 -0.3333 -0.1667 +DEAL::-0.1667 -0.3333 0.6667 -0.1667 +DEAL::-0.3333 -0.1667 -0.1667 0.6667 +DEAL::cell=1 +DEAL::mass_matrix: +DEAL::0.1111 0.05556 0.05556 0.02778 +DEAL::0.05556 0.1111 0.02778 0.05556 +DEAL::0.05556 0.02778 0.1111 0.05556 +DEAL::0.02778 0.05556 0.05556 0.1111 +DEAL::laplace_matrix: +DEAL::0.6667 -0.1667 -0.1667 -0.3333 +DEAL::-0.1667 0.6667 -0.3333 -0.1667 +DEAL::-0.1667 -0.3333 0.6667 -0.1667 +DEAL::-0.3333 -0.1667 -0.1667 0.6667 +DEAL::FE=FE_Q<3>(1) +DEAL::Mapping=Q1 +DEAL::Mass matrices are equal. +DEAL::Laplace matrices are equal. +DEAL::cell=0 +DEAL::mass_matrix: +DEAL::0.03704 0.01852 0.01852 0.009259 0.01852 0.009259 0.009259 0.004630 +DEAL::0.01852 0.03704 0.009259 0.01852 0.009259 0.01852 0.004630 0.009259 +DEAL::0.01852 0.009259 0.03704 0.01852 0.009259 0.004630 0.01852 0.009259 +DEAL::0.009259 0.01852 0.01852 0.03704 0.004630 0.009259 0.009259 0.01852 +DEAL::0.01852 0.009259 0.009259 0.004630 0.03704 0.01852 0.01852 0.009259 +DEAL::0.009259 0.01852 0.004630 0.009259 0.01852 0.03704 0.009259 0.01852 +DEAL::0.009259 0.004630 0.01852 0.009259 0.01852 0.009259 0.03704 0.01852 +DEAL::0.004630 0.009259 0.009259 0.01852 0.009259 0.01852 0.01852 0.03704 +DEAL::laplace_matrix: +DEAL::0.3333 0 0 -0.08333 0 -0.08333 -0.08333 -0.08333 +DEAL::0 0.3333 -0.08333 0 -0.08333 0 -0.08333 -0.08333 +DEAL::0 -0.08333 0.3333 0 -0.08333 -0.08333 0 -0.08333 +DEAL::-0.08333 0 0 0.3333 -0.08333 -0.08333 -0.08333 0 +DEAL::0 -0.08333 -0.08333 -0.08333 0.3333 0 0 -0.08333 +DEAL::-0.08333 0 -0.08333 -0.08333 0 0.3333 -0.08333 0 +DEAL::-0.08333 -0.08333 0 -0.08333 0 -0.08333 0.3333 0 +DEAL::-0.08333 -0.08333 -0.08333 0 -0.08333 0 0 0.3333 +DEAL::cell=1 +DEAL::mass_matrix: +DEAL::0.03704 0.01852 0.01852 0.009259 0.01852 0.009259 0.009259 0.004630 +DEAL::0.01852 0.03704 0.009259 0.01852 0.009259 0.01852 0.004630 0.009259 +DEAL::0.01852 0.009259 0.03704 0.01852 0.009259 0.004630 0.01852 0.009259 +DEAL::0.009259 0.01852 0.01852 0.03704 0.004630 0.009259 0.009259 0.01852 +DEAL::0.01852 0.009259 0.009259 0.004630 0.03704 0.01852 0.01852 0.009259 +DEAL::0.009259 0.01852 0.004630 0.009259 0.01852 0.03704 0.009259 0.01852 +DEAL::0.009259 0.004630 0.01852 0.009259 0.01852 0.009259 0.03704 0.01852 +DEAL::0.004630 0.009259 0.009259 0.01852 0.009259 0.01852 0.01852 0.03704 +DEAL::laplace_matrix: +DEAL::0.3333 0 0 -0.08333 0 -0.08333 -0.08333 -0.08333 +DEAL::0 0.3333 -0.08333 0 -0.08333 0 -0.08333 -0.08333 +DEAL::0 -0.08333 0.3333 0 -0.08333 -0.08333 0 -0.08333 +DEAL::-0.08333 0 0 0.3333 -0.08333 -0.08333 -0.08333 0 +DEAL::0 -0.08333 -0.08333 -0.08333 0.3333 0 0 -0.08333 +DEAL::-0.08333 0 -0.08333 -0.08333 0 0.3333 -0.08333 0 +DEAL::-0.08333 -0.08333 0 -0.08333 0 -0.08333 0.3333 0 +DEAL::-0.08333 -0.08333 -0.08333 0 -0.08333 0 0 0.3333 diff --git a/tests/fe/cell_similarity_010.cc b/tests/fe/cell_similarity_010.cc new file mode 100644 index 0000000000..d3bd42af4b --- /dev/null +++ b/tests/fe/cell_similarity_010.cc @@ -0,0 +1,174 @@ +//---------------------------------------------------------------------- +// $Id$ +// Version: $Name$ +// +// Copyright (C) 2009 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. +// +//---------------------------------------------------------------------- + + +// since early 2009, the FEValues objects try to be more efficient by only +// recomputing things like gradients of shape functions if the cell on which +// we are is not a translation of the previous one. in this series of tests we +// make sure that this actually works the way it's supposed to be; in +// particular, if we create a mesh of two identical cells but one has a curved +// boundary, then they are the same if we use a Q1 mapping, but not a Q2 +// mapping. so we test that the mass matrix we get from each of these cells is +// actually different in the latter case, but the same in the former +// +// the various tests cell_similarity_?? differ in the mappings and finite +// elements in use + + +#include "../tests.h" +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include + + +bool equal (const FullMatrix &m1, + const FullMatrix &m2) +{ + double d = 0, s = 0; + for (unsigned int i=0; i +void test (const Triangulation& tr) +{ + FE_Q fe(2); + deallog << "FE=" << fe.get_name() << std::endl; + + MappingCartesian mapping; + deallog << "Mapping=Cartesian" << std::endl; + + + DoFHandler dof(tr); + dof.distribute_dofs(fe); + + const QGauss quadrature(2); + FEValues fe_values (mapping, fe, quadrature, + update_values | update_gradients | + update_JxW_values); + + FullMatrix mass_matrix[2], laplace_matrix[2]; + mass_matrix[0].reinit(fe.dofs_per_cell, fe.dofs_per_cell); + mass_matrix[1].reinit(fe.dofs_per_cell, fe.dofs_per_cell); + laplace_matrix[0].reinit(fe.dofs_per_cell, fe.dofs_per_cell); + laplace_matrix[1].reinit(fe.dofs_per_cell, fe.dofs_per_cell); + + for (typename DoFHandler::active_cell_iterator + cell = dof.begin_active(); + cell != dof.end(); ++cell) + { + fe_values.reinit (cell); + + for (unsigned int i=0; iindex()](i,j) += fe_values.shape_value (i,q) * + fe_values.shape_value (j,q) * + fe_values.JxW(q); + laplace_matrix[cell->index()](i,j) += fe_values.shape_grad (i,q) * + fe_values.shape_grad (j,q) * + fe_values.JxW(q); + } + } + + // check what we expect for this mapping + // about equality or inequality of the + // matrices + deallog << "Mass matrices " + << (equal (mass_matrix[0], mass_matrix[1]) ? "are" : "are not") + << " equal." + << std::endl; + deallog << "Laplace matrices " + << (equal (laplace_matrix[0], laplace_matrix[1]) ? "are" : "are not") + << " equal." + << std::endl; + + for (unsigned int cell=0; cell<2; ++cell) + { + deallog << "cell=" << cell << std::endl; + deallog << "mass_matrix:" << std::endl; + for (unsigned int i=0; i +void test() +{ + Triangulation tr; + Point p1 = Point(); + Point p2 = (dim == 2 ? + Point(2,1) : + Point(2,1,1)); + std::vector subdivisions (dim, 1); + subdivisions[0] = 2; + GridGenerator::subdivided_hyper_rectangle(tr, subdivisions, p1, p2); + + static const HyperBallBoundary boundary; + tr.set_boundary (1, boundary); + + // set boundary id on cell 1 + for (unsigned int f=0; f::faces_per_cell; ++f) + if (tr.begin_active()->at_boundary(f)) + tr.begin_active()->face(f)->set_boundary_indicator (1); + + test(tr); +} + + +int main() +{ + std::ofstream logfile ("cell_similarity_10/output"); + deallog << std::setprecision (4); + + deallog.attach(logfile); + deallog.depth_console (0); + deallog.threshold_double(1.e-7); + + test<2>(); + //test<3>(); +} diff --git a/tests/fe/cell_similarity_010/cmp/generic b/tests/fe/cell_similarity_010/cmp/generic new file mode 100644 index 0000000000..d4520f92e6 --- /dev/null +++ b/tests/fe/cell_similarity_010/cmp/generic @@ -0,0 +1,69 @@ + +DEAL::FE=FE_Q<2>(1) +DEAL::Mapping=Q2 +DEAL::Mass matrices are not equal. +DEAL::Laplace matrices are not equal. +DEAL::cell=0 +DEAL::mass_matrix: +DEAL::0.2371 0.07167 0.06719 0.02582 +DEAL::0.07167 0.04962 0.02582 0.03610 +DEAL::0.06719 0.02582 0.03170 0.03162 +DEAL::0.02582 0.03610 0.03162 0.09477 +DEAL::laplace_matrix: +DEAL::4.337 -0.2381 -2.153 -1.946 +DEAL::-0.2381 0.9387 -0.5940 -0.1066 +DEAL::-2.153 -0.5940 1.899 0.8483 +DEAL::-1.946 -0.1066 0.8483 1.205 +DEAL::cell=1 +DEAL::mass_matrix: +DEAL::0.1111 0.05556 0.05556 0.02778 +DEAL::0.05556 0.1111 0.02778 0.05556 +DEAL::0.05556 0.02778 0.1111 0.05556 +DEAL::0.02778 0.05556 0.05556 0.1111 +DEAL::laplace_matrix: +DEAL::0.6667 -0.1667 -0.1667 -0.3333 +DEAL::-0.1667 0.6667 -0.3333 -0.1667 +DEAL::-0.1667 -0.3333 0.6667 -0.1667 +DEAL::-0.3333 -0.1667 -0.1667 0.6667 +DEAL::FE=FE_Q<3>(1) +DEAL::Mapping=Q2 +DEAL::Mass matrices are not equal. +DEAL::Laplace matrices are not equal. +DEAL::cell=0 +DEAL::mass_matrix: +DEAL::0.07572 0.02718 0.02414 0.009471 0.02414 0.009471 0.008538 0.003898 +DEAL::0.02718 0.03298 0.009471 0.01375 0.009471 0.01375 0.003898 0.007053 +DEAL::0.02414 0.009471 0.02083 0.01071 0.008538 0.003898 0.01001 0.006119 +DEAL::0.009471 0.01375 0.01071 0.02201 0.003898 0.007053 0.006119 0.01447 +DEAL::0.02414 0.009471 0.008538 0.003898 0.02083 0.01071 0.01001 0.006119 +DEAL::0.009471 0.01375 0.003898 0.007053 0.01071 0.02201 0.006119 0.01447 +DEAL::0.008538 0.003898 0.01001 0.006119 0.01001 0.006119 0.01922 0.01377 +DEAL::0.003898 0.007053 0.006119 0.01447 0.006119 0.01447 0.01377 0.03585 +DEAL::laplace_matrix: +DEAL::0.7840 0.04931 0.04652 -0.2138 0.04652 -0.2138 -0.2672 -0.2315 +DEAL::0.04931 0.3584 -0.04035 -0.04210 -0.04035 -0.04210 -0.09114 -0.1517 +DEAL::0.04652 -0.04035 0.2547 0.006678 -0.03606 -0.07879 -0.03423 -0.1051 +DEAL::-0.2138 -0.04210 0.006678 0.3292 -0.07879 -0.05266 0.002197 0.06269 +DEAL::0.04652 -0.04035 -0.03606 -0.07879 0.2547 0.006678 -0.03423 -0.1051 +DEAL::-0.2138 -0.04210 -0.07879 -0.05266 0.006678 0.3292 0.002197 0.06269 +DEAL::-0.2672 -0.09114 -0.03423 0.002197 -0.03423 0.002197 0.3052 0.1173 +DEAL::-0.2315 -0.1517 -0.1051 0.06269 -0.1051 0.06269 0.1173 0.3509 +DEAL::cell=1 +DEAL::mass_matrix: +DEAL::0.03704 0.01852 0.01852 0.009259 0.01852 0.009259 0.009259 0.004630 +DEAL::0.01852 0.03704 0.009259 0.01852 0.009259 0.01852 0.004630 0.009259 +DEAL::0.01852 0.009259 0.03704 0.01852 0.009259 0.004630 0.01852 0.009259 +DEAL::0.009259 0.01852 0.01852 0.03704 0.004630 0.009259 0.009259 0.01852 +DEAL::0.01852 0.009259 0.009259 0.004630 0.03704 0.01852 0.01852 0.009259 +DEAL::0.009259 0.01852 0.004630 0.009259 0.01852 0.03704 0.009259 0.01852 +DEAL::0.009259 0.004630 0.01852 0.009259 0.01852 0.009259 0.03704 0.01852 +DEAL::0.004630 0.009259 0.009259 0.01852 0.009259 0.01852 0.01852 0.03704 +DEAL::laplace_matrix: +DEAL::0.3333 0 0 -0.08333 0 -0.08333 -0.08333 -0.08333 +DEAL::0 0.3333 -0.08333 0 -0.08333 0 -0.08333 -0.08333 +DEAL::0 -0.08333 0.3333 0 -0.08333 -0.08333 0 -0.08333 +DEAL::-0.08333 0 0 0.3333 -0.08333 -0.08333 -0.08333 0 +DEAL::0 -0.08333 -0.08333 -0.08333 0.3333 0 0 -0.08333 +DEAL::-0.08333 0 -0.08333 -0.08333 0 0.3333 -0.08333 0 +DEAL::-0.08333 -0.08333 0 -0.08333 0 -0.08333 0.3333 0 +DEAL::-0.08333 -0.08333 -0.08333 0 -0.08333 0 0 0.3333 diff --git a/tests/fe/cell_similarity_02.cc b/tests/fe/cell_similarity_02.cc new file mode 100644 index 0000000000..7b4638d7e7 --- /dev/null +++ b/tests/fe/cell_similarity_02.cc @@ -0,0 +1,174 @@ +//---------------------------------------------------------------------- +// $Id$ +// Version: $Name$ +// +// Copyright (C) 2009 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. +// +//---------------------------------------------------------------------- + + +// since early 2009, the FEValues objects try to be more efficient by only +// recomputing things like gradients of shape functions if the cell on which +// we are is not a translation of the previous one. in this series of tests we +// make sure that this actually works the way it's supposed to be; in +// particular, if we create a mesh of two identical cells but one has a curved +// boundary, then they are the same if we use a Q1 mapping, but not a Q2 +// mapping. so we test that the mass matrix we get from each of these cells is +// actually different in the latter case, but the same in the former +// +// the various tests cell_similarity_?? differ in the mappings and finite +// elements in use + + +#include "../tests.h" +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include + + +bool equal (const FullMatrix &m1, + const FullMatrix &m2) +{ + double d = 0, s = 0; + for (unsigned int i=0; i +void test (const Triangulation& tr) +{ + FE_Q fe(2); + deallog << "FE=" << fe.get_name() << std::endl; + + MappingQ1 mapping; + deallog << "Mapping=Q1" << std::endl; + + + DoFHandler dof(tr); + dof.distribute_dofs(fe); + + const QGauss quadrature(2); + FEValues fe_values (mapping, fe, quadrature, + update_values | update_gradients | + update_JxW_values); + + FullMatrix mass_matrix[2], laplace_matrix[2]; + mass_matrix[0].reinit(fe.dofs_per_cell, fe.dofs_per_cell); + mass_matrix[1].reinit(fe.dofs_per_cell, fe.dofs_per_cell); + laplace_matrix[0].reinit(fe.dofs_per_cell, fe.dofs_per_cell); + laplace_matrix[1].reinit(fe.dofs_per_cell, fe.dofs_per_cell); + + for (typename DoFHandler::active_cell_iterator + cell = dof.begin_active(); + cell != dof.end(); ++cell) + { + fe_values.reinit (cell); + + for (unsigned int i=0; iindex()](i,j) += fe_values.shape_value (i,q) * + fe_values.shape_value (j,q) * + fe_values.JxW(q); + laplace_matrix[cell->index()](i,j) += fe_values.shape_grad (i,q) * + fe_values.shape_grad (j,q) * + fe_values.JxW(q); + } + } + + // check what we expect for this mapping + // about equality or inequality of the + // matrices + deallog << "Mass matrices " + << (equal (mass_matrix[0], mass_matrix[1]) ? "are" : "are not") + << " equal." + << std::endl; + deallog << "Laplace matrices " + << (equal (laplace_matrix[0], laplace_matrix[1]) ? "are" : "are not") + << " equal." + << std::endl; + + for (unsigned int cell=0; cell<2; ++cell) + { + deallog << "cell=" << cell << std::endl; + deallog << "mass_matrix:" << std::endl; + for (unsigned int i=0; i +void test() +{ + Triangulation tr; + Point p1 = Point(); + Point p2 = (dim == 2 ? + Point(2,1) : + Point(2,1,1)); + std::vector subdivisions (dim, 1); + subdivisions[0] = 2; + GridGenerator::subdivided_hyper_rectangle(tr, subdivisions, p1, p2); + + static const HyperBallBoundary boundary; + tr.set_boundary (1, boundary); + + // set boundary id on cell 1 + for (unsigned int f=0; f::faces_per_cell; ++f) + if (tr.begin_active()->at_boundary(f)) + tr.begin_active()->face(f)->set_boundary_indicator (1); + + test(tr); +} + + +int main() +{ + std::ofstream logfile ("cell_similarity_02/output"); + deallog << std::setprecision (4); + + deallog.attach(logfile); + deallog.depth_console (0); + deallog.threshold_double(1.e-7); + + test<2>(); + test<3>(); +} diff --git a/tests/fe/cell_similarity_02/cmp/generic b/tests/fe/cell_similarity_02/cmp/generic new file mode 100644 index 0000000000..f7f4e43c1b --- /dev/null +++ b/tests/fe/cell_similarity_02/cmp/generic @@ -0,0 +1,165 @@ + +DEAL::FE=FE_Q<2>(2) +DEAL::Mapping=Q1 +DEAL::Mass matrices are equal. +DEAL::Laplace matrices are equal. +DEAL::cell=0 +DEAL::mass_matrix: +DEAL::0.01235 0.006173 0.006173 0.003086 0.01235 0.006173 0.01235 0.006173 0.01235 +DEAL::0.006173 0.01235 0.003086 0.006173 0.006173 0.01235 0.01235 0.006173 0.01235 +DEAL::0.006173 0.003086 0.01235 0.006173 0.01235 0.006173 0.006173 0.01235 0.01235 +DEAL::0.003086 0.006173 0.006173 0.01235 0.006173 0.01235 0.006173 0.01235 0.01235 +DEAL::0.01235 0.006173 0.01235 0.006173 0.04938 -0.02469 0.01235 0.01235 0.04938 +DEAL::0.006173 0.01235 0.006173 0.01235 -0.02469 0.04938 0.01235 0.01235 0.04938 +DEAL::0.01235 0.01235 0.006173 0.006173 0.01235 0.01235 0.04938 -0.02469 0.04938 +DEAL::0.006173 0.006173 0.01235 0.01235 0.01235 0.01235 -0.02469 0.04938 0.04938 +DEAL::0.01235 0.01235 0.01235 0.01235 0.04938 0.04938 0.04938 0.04938 0.1975 +DEAL::laplace_matrix: +DEAL::0.5185 -0.09259 -0.09259 -0.03704 -0.03704 0.1852 -0.03704 0.1852 -0.5926 +DEAL::-0.09259 0.5185 -0.03704 -0.09259 0.1852 -0.03704 -0.03704 0.1852 -0.5926 +DEAL::-0.09259 -0.03704 0.5185 -0.09259 -0.03704 0.1852 0.1852 -0.03704 -0.5926 +DEAL::-0.03704 -0.09259 -0.09259 0.5185 0.1852 -0.03704 0.1852 -0.03704 -0.5926 +DEAL::-0.03704 0.1852 -0.03704 0.1852 1.630 -0.1481 -0.5926 -0.5926 -0.5926 +DEAL::0.1852 -0.03704 0.1852 -0.03704 -0.1481 1.630 -0.5926 -0.5926 -0.5926 +DEAL::-0.03704 -0.03704 0.1852 0.1852 -0.5926 -0.5926 1.630 -0.1481 -0.5926 +DEAL::0.1852 0.1852 -0.03704 -0.03704 -0.5926 -0.5926 -0.1481 1.630 -0.5926 +DEAL::-0.5926 -0.5926 -0.5926 -0.5926 -0.5926 -0.5926 -0.5926 -0.5926 4.741 +DEAL::cell=1 +DEAL::mass_matrix: +DEAL::0.01235 0.006173 0.006173 0.003086 0.01235 0.006173 0.01235 0.006173 0.01235 +DEAL::0.006173 0.01235 0.003086 0.006173 0.006173 0.01235 0.01235 0.006173 0.01235 +DEAL::0.006173 0.003086 0.01235 0.006173 0.01235 0.006173 0.006173 0.01235 0.01235 +DEAL::0.003086 0.006173 0.006173 0.01235 0.006173 0.01235 0.006173 0.01235 0.01235 +DEAL::0.01235 0.006173 0.01235 0.006173 0.04938 -0.02469 0.01235 0.01235 0.04938 +DEAL::0.006173 0.01235 0.006173 0.01235 -0.02469 0.04938 0.01235 0.01235 0.04938 +DEAL::0.01235 0.01235 0.006173 0.006173 0.01235 0.01235 0.04938 -0.02469 0.04938 +DEAL::0.006173 0.006173 0.01235 0.01235 0.01235 0.01235 -0.02469 0.04938 0.04938 +DEAL::0.01235 0.01235 0.01235 0.01235 0.04938 0.04938 0.04938 0.04938 0.1975 +DEAL::laplace_matrix: +DEAL::0.5185 -0.09259 -0.09259 -0.03704 -0.03704 0.1852 -0.03704 0.1852 -0.5926 +DEAL::-0.09259 0.5185 -0.03704 -0.09259 0.1852 -0.03704 -0.03704 0.1852 -0.5926 +DEAL::-0.09259 -0.03704 0.5185 -0.09259 -0.03704 0.1852 0.1852 -0.03704 -0.5926 +DEAL::-0.03704 -0.09259 -0.09259 0.5185 0.1852 -0.03704 0.1852 -0.03704 -0.5926 +DEAL::-0.03704 0.1852 -0.03704 0.1852 1.630 -0.1481 -0.5926 -0.5926 -0.5926 +DEAL::0.1852 -0.03704 0.1852 -0.03704 -0.1481 1.630 -0.5926 -0.5926 -0.5926 +DEAL::-0.03704 -0.03704 0.1852 0.1852 -0.5926 -0.5926 1.630 -0.1481 -0.5926 +DEAL::0.1852 0.1852 -0.03704 -0.03704 -0.5926 -0.5926 -0.1481 1.630 -0.5926 +DEAL::-0.5926 -0.5926 -0.5926 -0.5926 -0.5926 -0.5926 -0.5926 -0.5926 4.741 +DEAL::FE=FE_Q<3>(2) +DEAL::Mapping=Q1 +DEAL::Mass matrices are equal. +DEAL::Laplace matrices are equal. +DEAL::cell=0 +DEAL::mass_matrix: +DEAL::0.001372 0.0006859 0.0006859 0.0003429 0.0006859 0.0003429 0.0003429 0.0001715 0.001372 0.0006859 0.001372 0.0006859 0.0006859 0.0003429 0.0006859 0.0003429 0.001372 0.0006859 0.0006859 0.0003429 0.001372 0.0006859 0.001372 0.0006859 0.001372 0.0006859 0.001372 +DEAL::0.0006859 0.001372 0.0003429 0.0006859 0.0003429 0.0006859 0.0001715 0.0003429 0.0006859 0.001372 0.001372 0.0006859 0.0003429 0.0006859 0.0006859 0.0003429 0.0006859 0.001372 0.0003429 0.0006859 0.0006859 0.001372 0.001372 0.0006859 0.001372 0.0006859 0.001372 +DEAL::0.0006859 0.0003429 0.001372 0.0006859 0.0003429 0.0001715 0.0006859 0.0003429 0.001372 0.0006859 0.0006859 0.001372 0.0006859 0.0003429 0.0003429 0.0006859 0.0006859 0.0003429 0.001372 0.0006859 0.001372 0.0006859 0.0006859 0.001372 0.001372 0.0006859 0.001372 +DEAL::0.0003429 0.0006859 0.0006859 0.001372 0.0001715 0.0003429 0.0003429 0.0006859 0.0006859 0.001372 0.0006859 0.001372 0.0003429 0.0006859 0.0003429 0.0006859 0.0003429 0.0006859 0.0006859 0.001372 0.0006859 0.001372 0.0006859 0.001372 0.001372 0.0006859 0.001372 +DEAL::0.0006859 0.0003429 0.0003429 0.0001715 0.001372 0.0006859 0.0006859 0.0003429 0.0006859 0.0003429 0.0006859 0.0003429 0.001372 0.0006859 0.001372 0.0006859 0.001372 0.0006859 0.0006859 0.0003429 0.001372 0.0006859 0.001372 0.0006859 0.0006859 0.001372 0.001372 +DEAL::0.0003429 0.0006859 0.0001715 0.0003429 0.0006859 0.001372 0.0003429 0.0006859 0.0003429 0.0006859 0.0006859 0.0003429 0.0006859 0.001372 0.001372 0.0006859 0.0006859 0.001372 0.0003429 0.0006859 0.0006859 0.001372 0.001372 0.0006859 0.0006859 0.001372 0.001372 +DEAL::0.0003429 0.0001715 0.0006859 0.0003429 0.0006859 0.0003429 0.001372 0.0006859 0.0006859 0.0003429 0.0003429 0.0006859 0.001372 0.0006859 0.0006859 0.001372 0.0006859 0.0003429 0.001372 0.0006859 0.001372 0.0006859 0.0006859 0.001372 0.0006859 0.001372 0.001372 +DEAL::0.0001715 0.0003429 0.0003429 0.0006859 0.0003429 0.0006859 0.0006859 0.001372 0.0003429 0.0006859 0.0003429 0.0006859 0.0006859 0.001372 0.0006859 0.001372 0.0003429 0.0006859 0.0006859 0.001372 0.0006859 0.001372 0.0006859 0.001372 0.0006859 0.001372 0.001372 +DEAL::0.001372 0.0006859 0.001372 0.0006859 0.0006859 0.0003429 0.0006859 0.0003429 0.005487 0.002743 0.001372 0.001372 0.002743 0.001372 0.0006859 0.0006859 0.001372 0.0006859 0.001372 0.0006859 0.005487 0.002743 0.001372 0.001372 0.005487 0.002743 0.005487 +DEAL::0.0006859 0.001372 0.0006859 0.001372 0.0003429 0.0006859 0.0003429 0.0006859 0.002743 0.005487 0.001372 0.001372 0.001372 0.002743 0.0006859 0.0006859 0.0006859 0.001372 0.0006859 0.001372 0.002743 0.005487 0.001372 0.001372 0.005487 0.002743 0.005487 +DEAL::0.001372 0.001372 0.0006859 0.0006859 0.0006859 0.0006859 0.0003429 0.0003429 0.001372 0.001372 0.005487 0.002743 0.0006859 0.0006859 0.002743 0.001372 0.001372 0.001372 0.0006859 0.0006859 0.001372 0.001372 0.005487 0.002743 0.005487 0.002743 0.005487 +DEAL::0.0006859 0.0006859 0.001372 0.001372 0.0003429 0.0003429 0.0006859 0.0006859 0.001372 0.001372 0.002743 0.005487 0.0006859 0.0006859 0.001372 0.002743 0.0006859 0.0006859 0.001372 0.001372 0.001372 0.001372 0.002743 0.005487 0.005487 0.002743 0.005487 +DEAL::0.0006859 0.0003429 0.0006859 0.0003429 0.001372 0.0006859 0.001372 0.0006859 0.002743 0.001372 0.0006859 0.0006859 0.005487 0.002743 0.001372 0.001372 0.001372 0.0006859 0.001372 0.0006859 0.005487 0.002743 0.001372 0.001372 0.002743 0.005487 0.005487 +DEAL::0.0003429 0.0006859 0.0003429 0.0006859 0.0006859 0.001372 0.0006859 0.001372 0.001372 0.002743 0.0006859 0.0006859 0.002743 0.005487 0.001372 0.001372 0.0006859 0.001372 0.0006859 0.001372 0.002743 0.005487 0.001372 0.001372 0.002743 0.005487 0.005487 +DEAL::0.0006859 0.0006859 0.0003429 0.0003429 0.001372 0.001372 0.0006859 0.0006859 0.0006859 0.0006859 0.002743 0.001372 0.001372 0.001372 0.005487 0.002743 0.001372 0.001372 0.0006859 0.0006859 0.001372 0.001372 0.005487 0.002743 0.002743 0.005487 0.005487 +DEAL::0.0003429 0.0003429 0.0006859 0.0006859 0.0006859 0.0006859 0.001372 0.001372 0.0006859 0.0006859 0.001372 0.002743 0.001372 0.001372 0.002743 0.005487 0.0006859 0.0006859 0.001372 0.001372 0.001372 0.001372 0.002743 0.005487 0.002743 0.005487 0.005487 +DEAL::0.001372 0.0006859 0.0006859 0.0003429 0.001372 0.0006859 0.0006859 0.0003429 0.001372 0.0006859 0.001372 0.0006859 0.001372 0.0006859 0.001372 0.0006859 0.005487 0.002743 0.002743 0.001372 0.005487 0.002743 0.005487 0.002743 0.001372 0.001372 0.005487 +DEAL::0.0006859 0.001372 0.0003429 0.0006859 0.0006859 0.001372 0.0003429 0.0006859 0.0006859 0.001372 0.001372 0.0006859 0.0006859 0.001372 0.001372 0.0006859 0.002743 0.005487 0.001372 0.002743 0.002743 0.005487 0.005487 0.002743 0.001372 0.001372 0.005487 +DEAL::0.0006859 0.0003429 0.001372 0.0006859 0.0006859 0.0003429 0.001372 0.0006859 0.001372 0.0006859 0.0006859 0.001372 0.001372 0.0006859 0.0006859 0.001372 0.002743 0.001372 0.005487 0.002743 0.005487 0.002743 0.002743 0.005487 0.001372 0.001372 0.005487 +DEAL::0.0003429 0.0006859 0.0006859 0.001372 0.0003429 0.0006859 0.0006859 0.001372 0.0006859 0.001372 0.0006859 0.001372 0.0006859 0.001372 0.0006859 0.001372 0.001372 0.002743 0.002743 0.005487 0.002743 0.005487 0.002743 0.005487 0.001372 0.001372 0.005487 +DEAL::0.001372 0.0006859 0.001372 0.0006859 0.001372 0.0006859 0.001372 0.0006859 0.005487 0.002743 0.001372 0.001372 0.005487 0.002743 0.001372 0.001372 0.005487 0.002743 0.005487 0.002743 0.02195 -0.01097 0.005487 0.005487 0.005487 0.005487 0.02195 +DEAL::0.0006859 0.001372 0.0006859 0.001372 0.0006859 0.001372 0.0006859 0.001372 0.002743 0.005487 0.001372 0.001372 0.002743 0.005487 0.001372 0.001372 0.002743 0.005487 0.002743 0.005487 -0.01097 0.02195 0.005487 0.005487 0.005487 0.005487 0.02195 +DEAL::0.001372 0.001372 0.0006859 0.0006859 0.001372 0.001372 0.0006859 0.0006859 0.001372 0.001372 0.005487 0.002743 0.001372 0.001372 0.005487 0.002743 0.005487 0.005487 0.002743 0.002743 0.005487 0.005487 0.02195 -0.01097 0.005487 0.005487 0.02195 +DEAL::0.0006859 0.0006859 0.001372 0.001372 0.0006859 0.0006859 0.001372 0.001372 0.001372 0.001372 0.002743 0.005487 0.001372 0.001372 0.002743 0.005487 0.002743 0.002743 0.005487 0.005487 0.005487 0.005487 -0.01097 0.02195 0.005487 0.005487 0.02195 +DEAL::0.001372 0.001372 0.001372 0.001372 0.0006859 0.0006859 0.0006859 0.0006859 0.005487 0.005487 0.005487 0.005487 0.002743 0.002743 0.002743 0.002743 0.001372 0.001372 0.001372 0.001372 0.005487 0.005487 0.005487 0.005487 0.02195 -0.01097 0.02195 +DEAL::0.0006859 0.0006859 0.0006859 0.0006859 0.001372 0.001372 0.001372 0.001372 0.002743 0.002743 0.002743 0.002743 0.005487 0.005487 0.005487 0.005487 0.001372 0.001372 0.001372 0.001372 0.005487 0.005487 0.005487 0.005487 -0.01097 0.02195 0.02195 +DEAL::0.001372 0.001372 0.001372 0.001372 0.001372 0.001372 0.001372 0.001372 0.005487 0.005487 0.005487 0.005487 0.005487 0.005487 0.005487 0.005487 0.005487 0.005487 0.005487 0.005487 0.02195 0.02195 0.02195 0.02195 0.02195 0.02195 0.08779 +DEAL::laplace_matrix: +DEAL::0.08642 -0.02469 -0.02469 0.003086 -0.02469 0.003086 0.003086 0.003086 0.02469 0.006173 0.02469 0.006173 0.006173 -0.01235 0.006173 -0.01235 0.02469 0.006173 0.006173 -0.01235 -0.03704 0.03704 -0.03704 0.03704 -0.03704 0.03704 -0.09877 +DEAL::-0.02469 0.08642 0.003086 -0.02469 0.003086 -0.02469 0.003086 0.003086 0.006173 0.02469 0.02469 0.006173 -0.01235 0.006173 0.006173 -0.01235 0.006173 0.02469 -0.01235 0.006173 0.03704 -0.03704 -0.03704 0.03704 -0.03704 0.03704 -0.09877 +DEAL::-0.02469 0.003086 0.08642 -0.02469 0.003086 0.003086 -0.02469 0.003086 0.02469 0.006173 0.006173 0.02469 0.006173 -0.01235 -0.01235 0.006173 0.006173 -0.01235 0.02469 0.006173 -0.03704 0.03704 0.03704 -0.03704 -0.03704 0.03704 -0.09877 +DEAL::0.003086 -0.02469 -0.02469 0.08642 0.003086 0.003086 0.003086 -0.02469 0.006173 0.02469 0.006173 0.02469 -0.01235 0.006173 -0.01235 0.006173 -0.01235 0.006173 0.006173 0.02469 0.03704 -0.03704 0.03704 -0.03704 -0.03704 0.03704 -0.09877 +DEAL::-0.02469 0.003086 0.003086 0.003086 0.08642 -0.02469 -0.02469 0.003086 0.006173 -0.01235 0.006173 -0.01235 0.02469 0.006173 0.02469 0.006173 0.02469 0.006173 0.006173 -0.01235 -0.03704 0.03704 -0.03704 0.03704 0.03704 -0.03704 -0.09877 +DEAL::0.003086 -0.02469 0.003086 0.003086 -0.02469 0.08642 0.003086 -0.02469 -0.01235 0.006173 0.006173 -0.01235 0.006173 0.02469 0.02469 0.006173 0.006173 0.02469 -0.01235 0.006173 0.03704 -0.03704 -0.03704 0.03704 0.03704 -0.03704 -0.09877 +DEAL::0.003086 0.003086 -0.02469 0.003086 -0.02469 0.003086 0.08642 -0.02469 0.006173 -0.01235 -0.01235 0.006173 0.02469 0.006173 0.006173 0.02469 0.006173 -0.01235 0.02469 0.006173 -0.03704 0.03704 0.03704 -0.03704 0.03704 -0.03704 -0.09877 +DEAL::0.003086 0.003086 0.003086 -0.02469 0.003086 -0.02469 -0.02469 0.08642 -0.01235 0.006173 -0.01235 0.006173 0.006173 0.02469 0.006173 0.02469 -0.01235 0.006173 0.006173 0.02469 0.03704 -0.03704 0.03704 -0.03704 0.03704 -0.03704 -0.09877 +DEAL::0.02469 0.006173 0.02469 0.006173 0.006173 -0.01235 0.006173 -0.01235 0.2963 -0.07407 -0.03704 -0.03704 -0.07407 0 0.03704 0.03704 -0.03704 0.03704 -0.03704 0.03704 0.04938 0.04938 -0.09877 -0.09877 0.04938 0.04938 -0.1975 +DEAL::0.006173 0.02469 0.006173 0.02469 -0.01235 0.006173 -0.01235 0.006173 -0.07407 0.2963 -0.03704 -0.03704 0 -0.07407 0.03704 0.03704 0.03704 -0.03704 0.03704 -0.03704 0.04938 0.04938 -0.09877 -0.09877 0.04938 0.04938 -0.1975 +DEAL::0.02469 0.02469 0.006173 0.006173 0.006173 0.006173 -0.01235 -0.01235 -0.03704 -0.03704 0.2963 -0.07407 0.03704 0.03704 -0.07407 0 -0.03704 -0.03704 0.03704 0.03704 -0.09877 -0.09877 0.04938 0.04938 0.04938 0.04938 -0.1975 +DEAL::0.006173 0.006173 0.02469 0.02469 -0.01235 -0.01235 0.006173 0.006173 -0.03704 -0.03704 -0.07407 0.2963 0.03704 0.03704 0 -0.07407 0.03704 0.03704 -0.03704 -0.03704 -0.09877 -0.09877 0.04938 0.04938 0.04938 0.04938 -0.1975 +DEAL::0.006173 -0.01235 0.006173 -0.01235 0.02469 0.006173 0.02469 0.006173 -0.07407 0 0.03704 0.03704 0.2963 -0.07407 -0.03704 -0.03704 -0.03704 0.03704 -0.03704 0.03704 0.04938 0.04938 -0.09877 -0.09877 0.04938 0.04938 -0.1975 +DEAL::-0.01235 0.006173 -0.01235 0.006173 0.006173 0.02469 0.006173 0.02469 0 -0.07407 0.03704 0.03704 -0.07407 0.2963 -0.03704 -0.03704 0.03704 -0.03704 0.03704 -0.03704 0.04938 0.04938 -0.09877 -0.09877 0.04938 0.04938 -0.1975 +DEAL::0.006173 0.006173 -0.01235 -0.01235 0.02469 0.02469 0.006173 0.006173 0.03704 0.03704 -0.07407 0 -0.03704 -0.03704 0.2963 -0.07407 -0.03704 -0.03704 0.03704 0.03704 -0.09877 -0.09877 0.04938 0.04938 0.04938 0.04938 -0.1975 +DEAL::-0.01235 -0.01235 0.006173 0.006173 0.006173 0.006173 0.02469 0.02469 0.03704 0.03704 0 -0.07407 -0.03704 -0.03704 -0.07407 0.2963 0.03704 0.03704 -0.03704 -0.03704 -0.09877 -0.09877 0.04938 0.04938 0.04938 0.04938 -0.1975 +DEAL::0.02469 0.006173 0.006173 -0.01235 0.02469 0.006173 0.006173 -0.01235 -0.03704 0.03704 -0.03704 0.03704 -0.03704 0.03704 -0.03704 0.03704 0.2963 -0.07407 -0.07407 0 0.04938 0.04938 0.04938 0.04938 -0.09877 -0.09877 -0.1975 +DEAL::0.006173 0.02469 -0.01235 0.006173 0.006173 0.02469 -0.01235 0.006173 0.03704 -0.03704 -0.03704 0.03704 0.03704 -0.03704 -0.03704 0.03704 -0.07407 0.2963 0 -0.07407 0.04938 0.04938 0.04938 0.04938 -0.09877 -0.09877 -0.1975 +DEAL::0.006173 -0.01235 0.02469 0.006173 0.006173 -0.01235 0.02469 0.006173 -0.03704 0.03704 0.03704 -0.03704 -0.03704 0.03704 0.03704 -0.03704 -0.07407 0 0.2963 -0.07407 0.04938 0.04938 0.04938 0.04938 -0.09877 -0.09877 -0.1975 +DEAL::-0.01235 0.006173 0.006173 0.02469 -0.01235 0.006173 0.006173 0.02469 0.03704 -0.03704 0.03704 -0.03704 0.03704 -0.03704 0.03704 -0.03704 0 -0.07407 -0.07407 0.2963 0.04938 0.04938 0.04938 0.04938 -0.09877 -0.09877 -0.1975 +DEAL::-0.03704 0.03704 -0.03704 0.03704 -0.03704 0.03704 -0.03704 0.03704 0.04938 0.04938 -0.09877 -0.09877 0.04938 0.04938 -0.09877 -0.09877 0.04938 0.04938 0.04938 0.04938 0.9877 -0.1975 -0.1975 -0.1975 -0.1975 -0.1975 0 +DEAL::0.03704 -0.03704 0.03704 -0.03704 0.03704 -0.03704 0.03704 -0.03704 0.04938 0.04938 -0.09877 -0.09877 0.04938 0.04938 -0.09877 -0.09877 0.04938 0.04938 0.04938 0.04938 -0.1975 0.9877 -0.1975 -0.1975 -0.1975 -0.1975 0 +DEAL::-0.03704 -0.03704 0.03704 0.03704 -0.03704 -0.03704 0.03704 0.03704 -0.09877 -0.09877 0.04938 0.04938 -0.09877 -0.09877 0.04938 0.04938 0.04938 0.04938 0.04938 0.04938 -0.1975 -0.1975 0.9877 -0.1975 -0.1975 -0.1975 0 +DEAL::0.03704 0.03704 -0.03704 -0.03704 0.03704 0.03704 -0.03704 -0.03704 -0.09877 -0.09877 0.04938 0.04938 -0.09877 -0.09877 0.04938 0.04938 0.04938 0.04938 0.04938 0.04938 -0.1975 -0.1975 -0.1975 0.9877 -0.1975 -0.1975 0 +DEAL::-0.03704 -0.03704 -0.03704 -0.03704 0.03704 0.03704 0.03704 0.03704 0.04938 0.04938 0.04938 0.04938 0.04938 0.04938 0.04938 0.04938 -0.09877 -0.09877 -0.09877 -0.09877 -0.1975 -0.1975 -0.1975 -0.1975 0.9877 -0.1975 0 +DEAL::0.03704 0.03704 0.03704 0.03704 -0.03704 -0.03704 -0.03704 -0.03704 0.04938 0.04938 0.04938 0.04938 0.04938 0.04938 0.04938 0.04938 -0.09877 -0.09877 -0.09877 -0.09877 -0.1975 -0.1975 -0.1975 -0.1975 -0.1975 0.9877 0 +DEAL::-0.09877 -0.09877 -0.09877 -0.09877 -0.09877 -0.09877 -0.09877 -0.09877 -0.1975 -0.1975 -0.1975 -0.1975 -0.1975 -0.1975 -0.1975 -0.1975 -0.1975 -0.1975 -0.1975 -0.1975 0 0 0 0 0 0 3.160 +DEAL::cell=1 +DEAL::mass_matrix: +DEAL::0.001372 0.0006859 0.0006859 0.0003429 0.0006859 0.0003429 0.0003429 0.0001715 0.001372 0.0006859 0.001372 0.0006859 0.0006859 0.0003429 0.0006859 0.0003429 0.001372 0.0006859 0.0006859 0.0003429 0.001372 0.0006859 0.001372 0.0006859 0.001372 0.0006859 0.001372 +DEAL::0.0006859 0.001372 0.0003429 0.0006859 0.0003429 0.0006859 0.0001715 0.0003429 0.0006859 0.001372 0.001372 0.0006859 0.0003429 0.0006859 0.0006859 0.0003429 0.0006859 0.001372 0.0003429 0.0006859 0.0006859 0.001372 0.001372 0.0006859 0.001372 0.0006859 0.001372 +DEAL::0.0006859 0.0003429 0.001372 0.0006859 0.0003429 0.0001715 0.0006859 0.0003429 0.001372 0.0006859 0.0006859 0.001372 0.0006859 0.0003429 0.0003429 0.0006859 0.0006859 0.0003429 0.001372 0.0006859 0.001372 0.0006859 0.0006859 0.001372 0.001372 0.0006859 0.001372 +DEAL::0.0003429 0.0006859 0.0006859 0.001372 0.0001715 0.0003429 0.0003429 0.0006859 0.0006859 0.001372 0.0006859 0.001372 0.0003429 0.0006859 0.0003429 0.0006859 0.0003429 0.0006859 0.0006859 0.001372 0.0006859 0.001372 0.0006859 0.001372 0.001372 0.0006859 0.001372 +DEAL::0.0006859 0.0003429 0.0003429 0.0001715 0.001372 0.0006859 0.0006859 0.0003429 0.0006859 0.0003429 0.0006859 0.0003429 0.001372 0.0006859 0.001372 0.0006859 0.001372 0.0006859 0.0006859 0.0003429 0.001372 0.0006859 0.001372 0.0006859 0.0006859 0.001372 0.001372 +DEAL::0.0003429 0.0006859 0.0001715 0.0003429 0.0006859 0.001372 0.0003429 0.0006859 0.0003429 0.0006859 0.0006859 0.0003429 0.0006859 0.001372 0.001372 0.0006859 0.0006859 0.001372 0.0003429 0.0006859 0.0006859 0.001372 0.001372 0.0006859 0.0006859 0.001372 0.001372 +DEAL::0.0003429 0.0001715 0.0006859 0.0003429 0.0006859 0.0003429 0.001372 0.0006859 0.0006859 0.0003429 0.0003429 0.0006859 0.001372 0.0006859 0.0006859 0.001372 0.0006859 0.0003429 0.001372 0.0006859 0.001372 0.0006859 0.0006859 0.001372 0.0006859 0.001372 0.001372 +DEAL::0.0001715 0.0003429 0.0003429 0.0006859 0.0003429 0.0006859 0.0006859 0.001372 0.0003429 0.0006859 0.0003429 0.0006859 0.0006859 0.001372 0.0006859 0.001372 0.0003429 0.0006859 0.0006859 0.001372 0.0006859 0.001372 0.0006859 0.001372 0.0006859 0.001372 0.001372 +DEAL::0.001372 0.0006859 0.001372 0.0006859 0.0006859 0.0003429 0.0006859 0.0003429 0.005487 0.002743 0.001372 0.001372 0.002743 0.001372 0.0006859 0.0006859 0.001372 0.0006859 0.001372 0.0006859 0.005487 0.002743 0.001372 0.001372 0.005487 0.002743 0.005487 +DEAL::0.0006859 0.001372 0.0006859 0.001372 0.0003429 0.0006859 0.0003429 0.0006859 0.002743 0.005487 0.001372 0.001372 0.001372 0.002743 0.0006859 0.0006859 0.0006859 0.001372 0.0006859 0.001372 0.002743 0.005487 0.001372 0.001372 0.005487 0.002743 0.005487 +DEAL::0.001372 0.001372 0.0006859 0.0006859 0.0006859 0.0006859 0.0003429 0.0003429 0.001372 0.001372 0.005487 0.002743 0.0006859 0.0006859 0.002743 0.001372 0.001372 0.001372 0.0006859 0.0006859 0.001372 0.001372 0.005487 0.002743 0.005487 0.002743 0.005487 +DEAL::0.0006859 0.0006859 0.001372 0.001372 0.0003429 0.0003429 0.0006859 0.0006859 0.001372 0.001372 0.002743 0.005487 0.0006859 0.0006859 0.001372 0.002743 0.0006859 0.0006859 0.001372 0.001372 0.001372 0.001372 0.002743 0.005487 0.005487 0.002743 0.005487 +DEAL::0.0006859 0.0003429 0.0006859 0.0003429 0.001372 0.0006859 0.001372 0.0006859 0.002743 0.001372 0.0006859 0.0006859 0.005487 0.002743 0.001372 0.001372 0.001372 0.0006859 0.001372 0.0006859 0.005487 0.002743 0.001372 0.001372 0.002743 0.005487 0.005487 +DEAL::0.0003429 0.0006859 0.0003429 0.0006859 0.0006859 0.001372 0.0006859 0.001372 0.001372 0.002743 0.0006859 0.0006859 0.002743 0.005487 0.001372 0.001372 0.0006859 0.001372 0.0006859 0.001372 0.002743 0.005487 0.001372 0.001372 0.002743 0.005487 0.005487 +DEAL::0.0006859 0.0006859 0.0003429 0.0003429 0.001372 0.001372 0.0006859 0.0006859 0.0006859 0.0006859 0.002743 0.001372 0.001372 0.001372 0.005487 0.002743 0.001372 0.001372 0.0006859 0.0006859 0.001372 0.001372 0.005487 0.002743 0.002743 0.005487 0.005487 +DEAL::0.0003429 0.0003429 0.0006859 0.0006859 0.0006859 0.0006859 0.001372 0.001372 0.0006859 0.0006859 0.001372 0.002743 0.001372 0.001372 0.002743 0.005487 0.0006859 0.0006859 0.001372 0.001372 0.001372 0.001372 0.002743 0.005487 0.002743 0.005487 0.005487 +DEAL::0.001372 0.0006859 0.0006859 0.0003429 0.001372 0.0006859 0.0006859 0.0003429 0.001372 0.0006859 0.001372 0.0006859 0.001372 0.0006859 0.001372 0.0006859 0.005487 0.002743 0.002743 0.001372 0.005487 0.002743 0.005487 0.002743 0.001372 0.001372 0.005487 +DEAL::0.0006859 0.001372 0.0003429 0.0006859 0.0006859 0.001372 0.0003429 0.0006859 0.0006859 0.001372 0.001372 0.0006859 0.0006859 0.001372 0.001372 0.0006859 0.002743 0.005487 0.001372 0.002743 0.002743 0.005487 0.005487 0.002743 0.001372 0.001372 0.005487 +DEAL::0.0006859 0.0003429 0.001372 0.0006859 0.0006859 0.0003429 0.001372 0.0006859 0.001372 0.0006859 0.0006859 0.001372 0.001372 0.0006859 0.0006859 0.001372 0.002743 0.001372 0.005487 0.002743 0.005487 0.002743 0.002743 0.005487 0.001372 0.001372 0.005487 +DEAL::0.0003429 0.0006859 0.0006859 0.001372 0.0003429 0.0006859 0.0006859 0.001372 0.0006859 0.001372 0.0006859 0.001372 0.0006859 0.001372 0.0006859 0.001372 0.001372 0.002743 0.002743 0.005487 0.002743 0.005487 0.002743 0.005487 0.001372 0.001372 0.005487 +DEAL::0.001372 0.0006859 0.001372 0.0006859 0.001372 0.0006859 0.001372 0.0006859 0.005487 0.002743 0.001372 0.001372 0.005487 0.002743 0.001372 0.001372 0.005487 0.002743 0.005487 0.002743 0.02195 -0.01097 0.005487 0.005487 0.005487 0.005487 0.02195 +DEAL::0.0006859 0.001372 0.0006859 0.001372 0.0006859 0.001372 0.0006859 0.001372 0.002743 0.005487 0.001372 0.001372 0.002743 0.005487 0.001372 0.001372 0.002743 0.005487 0.002743 0.005487 -0.01097 0.02195 0.005487 0.005487 0.005487 0.005487 0.02195 +DEAL::0.001372 0.001372 0.0006859 0.0006859 0.001372 0.001372 0.0006859 0.0006859 0.001372 0.001372 0.005487 0.002743 0.001372 0.001372 0.005487 0.002743 0.005487 0.005487 0.002743 0.002743 0.005487 0.005487 0.02195 -0.01097 0.005487 0.005487 0.02195 +DEAL::0.0006859 0.0006859 0.001372 0.001372 0.0006859 0.0006859 0.001372 0.001372 0.001372 0.001372 0.002743 0.005487 0.001372 0.001372 0.002743 0.005487 0.002743 0.002743 0.005487 0.005487 0.005487 0.005487 -0.01097 0.02195 0.005487 0.005487 0.02195 +DEAL::0.001372 0.001372 0.001372 0.001372 0.0006859 0.0006859 0.0006859 0.0006859 0.005487 0.005487 0.005487 0.005487 0.002743 0.002743 0.002743 0.002743 0.001372 0.001372 0.001372 0.001372 0.005487 0.005487 0.005487 0.005487 0.02195 -0.01097 0.02195 +DEAL::0.0006859 0.0006859 0.0006859 0.0006859 0.001372 0.001372 0.001372 0.001372 0.002743 0.002743 0.002743 0.002743 0.005487 0.005487 0.005487 0.005487 0.001372 0.001372 0.001372 0.001372 0.005487 0.005487 0.005487 0.005487 -0.01097 0.02195 0.02195 +DEAL::0.001372 0.001372 0.001372 0.001372 0.001372 0.001372 0.001372 0.001372 0.005487 0.005487 0.005487 0.005487 0.005487 0.005487 0.005487 0.005487 0.005487 0.005487 0.005487 0.005487 0.02195 0.02195 0.02195 0.02195 0.02195 0.02195 0.08779 +DEAL::laplace_matrix: +DEAL::0.08642 -0.02469 -0.02469 0.003086 -0.02469 0.003086 0.003086 0.003086 0.02469 0.006173 0.02469 0.006173 0.006173 -0.01235 0.006173 -0.01235 0.02469 0.006173 0.006173 -0.01235 -0.03704 0.03704 -0.03704 0.03704 -0.03704 0.03704 -0.09877 +DEAL::-0.02469 0.08642 0.003086 -0.02469 0.003086 -0.02469 0.003086 0.003086 0.006173 0.02469 0.02469 0.006173 -0.01235 0.006173 0.006173 -0.01235 0.006173 0.02469 -0.01235 0.006173 0.03704 -0.03704 -0.03704 0.03704 -0.03704 0.03704 -0.09877 +DEAL::-0.02469 0.003086 0.08642 -0.02469 0.003086 0.003086 -0.02469 0.003086 0.02469 0.006173 0.006173 0.02469 0.006173 -0.01235 -0.01235 0.006173 0.006173 -0.01235 0.02469 0.006173 -0.03704 0.03704 0.03704 -0.03704 -0.03704 0.03704 -0.09877 +DEAL::0.003086 -0.02469 -0.02469 0.08642 0.003086 0.003086 0.003086 -0.02469 0.006173 0.02469 0.006173 0.02469 -0.01235 0.006173 -0.01235 0.006173 -0.01235 0.006173 0.006173 0.02469 0.03704 -0.03704 0.03704 -0.03704 -0.03704 0.03704 -0.09877 +DEAL::-0.02469 0.003086 0.003086 0.003086 0.08642 -0.02469 -0.02469 0.003086 0.006173 -0.01235 0.006173 -0.01235 0.02469 0.006173 0.02469 0.006173 0.02469 0.006173 0.006173 -0.01235 -0.03704 0.03704 -0.03704 0.03704 0.03704 -0.03704 -0.09877 +DEAL::0.003086 -0.02469 0.003086 0.003086 -0.02469 0.08642 0.003086 -0.02469 -0.01235 0.006173 0.006173 -0.01235 0.006173 0.02469 0.02469 0.006173 0.006173 0.02469 -0.01235 0.006173 0.03704 -0.03704 -0.03704 0.03704 0.03704 -0.03704 -0.09877 +DEAL::0.003086 0.003086 -0.02469 0.003086 -0.02469 0.003086 0.08642 -0.02469 0.006173 -0.01235 -0.01235 0.006173 0.02469 0.006173 0.006173 0.02469 0.006173 -0.01235 0.02469 0.006173 -0.03704 0.03704 0.03704 -0.03704 0.03704 -0.03704 -0.09877 +DEAL::0.003086 0.003086 0.003086 -0.02469 0.003086 -0.02469 -0.02469 0.08642 -0.01235 0.006173 -0.01235 0.006173 0.006173 0.02469 0.006173 0.02469 -0.01235 0.006173 0.006173 0.02469 0.03704 -0.03704 0.03704 -0.03704 0.03704 -0.03704 -0.09877 +DEAL::0.02469 0.006173 0.02469 0.006173 0.006173 -0.01235 0.006173 -0.01235 0.2963 -0.07407 -0.03704 -0.03704 -0.07407 0 0.03704 0.03704 -0.03704 0.03704 -0.03704 0.03704 0.04938 0.04938 -0.09877 -0.09877 0.04938 0.04938 -0.1975 +DEAL::0.006173 0.02469 0.006173 0.02469 -0.01235 0.006173 -0.01235 0.006173 -0.07407 0.2963 -0.03704 -0.03704 0 -0.07407 0.03704 0.03704 0.03704 -0.03704 0.03704 -0.03704 0.04938 0.04938 -0.09877 -0.09877 0.04938 0.04938 -0.1975 +DEAL::0.02469 0.02469 0.006173 0.006173 0.006173 0.006173 -0.01235 -0.01235 -0.03704 -0.03704 0.2963 -0.07407 0.03704 0.03704 -0.07407 0 -0.03704 -0.03704 0.03704 0.03704 -0.09877 -0.09877 0.04938 0.04938 0.04938 0.04938 -0.1975 +DEAL::0.006173 0.006173 0.02469 0.02469 -0.01235 -0.01235 0.006173 0.006173 -0.03704 -0.03704 -0.07407 0.2963 0.03704 0.03704 0 -0.07407 0.03704 0.03704 -0.03704 -0.03704 -0.09877 -0.09877 0.04938 0.04938 0.04938 0.04938 -0.1975 +DEAL::0.006173 -0.01235 0.006173 -0.01235 0.02469 0.006173 0.02469 0.006173 -0.07407 0 0.03704 0.03704 0.2963 -0.07407 -0.03704 -0.03704 -0.03704 0.03704 -0.03704 0.03704 0.04938 0.04938 -0.09877 -0.09877 0.04938 0.04938 -0.1975 +DEAL::-0.01235 0.006173 -0.01235 0.006173 0.006173 0.02469 0.006173 0.02469 0 -0.07407 0.03704 0.03704 -0.07407 0.2963 -0.03704 -0.03704 0.03704 -0.03704 0.03704 -0.03704 0.04938 0.04938 -0.09877 -0.09877 0.04938 0.04938 -0.1975 +DEAL::0.006173 0.006173 -0.01235 -0.01235 0.02469 0.02469 0.006173 0.006173 0.03704 0.03704 -0.07407 0 -0.03704 -0.03704 0.2963 -0.07407 -0.03704 -0.03704 0.03704 0.03704 -0.09877 -0.09877 0.04938 0.04938 0.04938 0.04938 -0.1975 +DEAL::-0.01235 -0.01235 0.006173 0.006173 0.006173 0.006173 0.02469 0.02469 0.03704 0.03704 0 -0.07407 -0.03704 -0.03704 -0.07407 0.2963 0.03704 0.03704 -0.03704 -0.03704 -0.09877 -0.09877 0.04938 0.04938 0.04938 0.04938 -0.1975 +DEAL::0.02469 0.006173 0.006173 -0.01235 0.02469 0.006173 0.006173 -0.01235 -0.03704 0.03704 -0.03704 0.03704 -0.03704 0.03704 -0.03704 0.03704 0.2963 -0.07407 -0.07407 0 0.04938 0.04938 0.04938 0.04938 -0.09877 -0.09877 -0.1975 +DEAL::0.006173 0.02469 -0.01235 0.006173 0.006173 0.02469 -0.01235 0.006173 0.03704 -0.03704 -0.03704 0.03704 0.03704 -0.03704 -0.03704 0.03704 -0.07407 0.2963 0 -0.07407 0.04938 0.04938 0.04938 0.04938 -0.09877 -0.09877 -0.1975 +DEAL::0.006173 -0.01235 0.02469 0.006173 0.006173 -0.01235 0.02469 0.006173 -0.03704 0.03704 0.03704 -0.03704 -0.03704 0.03704 0.03704 -0.03704 -0.07407 0 0.2963 -0.07407 0.04938 0.04938 0.04938 0.04938 -0.09877 -0.09877 -0.1975 +DEAL::-0.01235 0.006173 0.006173 0.02469 -0.01235 0.006173 0.006173 0.02469 0.03704 -0.03704 0.03704 -0.03704 0.03704 -0.03704 0.03704 -0.03704 0 -0.07407 -0.07407 0.2963 0.04938 0.04938 0.04938 0.04938 -0.09877 -0.09877 -0.1975 +DEAL::-0.03704 0.03704 -0.03704 0.03704 -0.03704 0.03704 -0.03704 0.03704 0.04938 0.04938 -0.09877 -0.09877 0.04938 0.04938 -0.09877 -0.09877 0.04938 0.04938 0.04938 0.04938 0.9877 -0.1975 -0.1975 -0.1975 -0.1975 -0.1975 0 +DEAL::0.03704 -0.03704 0.03704 -0.03704 0.03704 -0.03704 0.03704 -0.03704 0.04938 0.04938 -0.09877 -0.09877 0.04938 0.04938 -0.09877 -0.09877 0.04938 0.04938 0.04938 0.04938 -0.1975 0.9877 -0.1975 -0.1975 -0.1975 -0.1975 0 +DEAL::-0.03704 -0.03704 0.03704 0.03704 -0.03704 -0.03704 0.03704 0.03704 -0.09877 -0.09877 0.04938 0.04938 -0.09877 -0.09877 0.04938 0.04938 0.04938 0.04938 0.04938 0.04938 -0.1975 -0.1975 0.9877 -0.1975 -0.1975 -0.1975 0 +DEAL::0.03704 0.03704 -0.03704 -0.03704 0.03704 0.03704 -0.03704 -0.03704 -0.09877 -0.09877 0.04938 0.04938 -0.09877 -0.09877 0.04938 0.04938 0.04938 0.04938 0.04938 0.04938 -0.1975 -0.1975 -0.1975 0.9877 -0.1975 -0.1975 0 +DEAL::-0.03704 -0.03704 -0.03704 -0.03704 0.03704 0.03704 0.03704 0.03704 0.04938 0.04938 0.04938 0.04938 0.04938 0.04938 0.04938 0.04938 -0.09877 -0.09877 -0.09877 -0.09877 -0.1975 -0.1975 -0.1975 -0.1975 0.9877 -0.1975 0 +DEAL::0.03704 0.03704 0.03704 0.03704 -0.03704 -0.03704 -0.03704 -0.03704 0.04938 0.04938 0.04938 0.04938 0.04938 0.04938 0.04938 0.04938 -0.09877 -0.09877 -0.09877 -0.09877 -0.1975 -0.1975 -0.1975 -0.1975 -0.1975 0.9877 0 +DEAL::-0.09877 -0.09877 -0.09877 -0.09877 -0.09877 -0.09877 -0.09877 -0.09877 -0.1975 -0.1975 -0.1975 -0.1975 -0.1975 -0.1975 -0.1975 -0.1975 -0.1975 -0.1975 -0.1975 -0.1975 0 0 0 0 0 0 3.160 diff --git a/tests/fe/cell_similarity_03.cc b/tests/fe/cell_similarity_03.cc new file mode 100644 index 0000000000..482b5d044f --- /dev/null +++ b/tests/fe/cell_similarity_03.cc @@ -0,0 +1,174 @@ +//---------------------------------------------------------------------- +// $Id$ +// Version: $Name$ +// +// Copyright (C) 2009 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. +// +//---------------------------------------------------------------------- + + +// since early 2009, the FEValues objects try to be more efficient by only +// recomputing things like gradients of shape functions if the cell on which +// we are is not a translation of the previous one. in this series of tests we +// make sure that this actually works the way it's supposed to be; in +// particular, if we create a mesh of two identical cells but one has a curved +// boundary, then they are the same if we use a Q1 mapping, but not a Q2 +// mapping. so we test that the mass matrix we get from each of these cells is +// actually different in the latter case, but the same in the former +// +// the various tests cell_similarity_?? differ in the mappings and finite +// elements in use + + +#include "../tests.h" +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include + + +bool equal (const FullMatrix &m1, + const FullMatrix &m2) +{ + double d = 0, s = 0; + for (unsigned int i=0; i +void test (const Triangulation& tr) +{ + FE_Q fe(1); + deallog << "FE=" << fe.get_name() << std::endl; + + MappingQ mapping(1); + deallog << "Mapping=Q1" << std::endl; + + + DoFHandler dof(tr); + dof.distribute_dofs(fe); + + const QGauss quadrature(2); + FEValues fe_values (mapping, fe, quadrature, + update_values | update_gradients | + update_JxW_values); + + FullMatrix mass_matrix[2], laplace_matrix[2]; + mass_matrix[0].reinit(fe.dofs_per_cell, fe.dofs_per_cell); + mass_matrix[1].reinit(fe.dofs_per_cell, fe.dofs_per_cell); + laplace_matrix[0].reinit(fe.dofs_per_cell, fe.dofs_per_cell); + laplace_matrix[1].reinit(fe.dofs_per_cell, fe.dofs_per_cell); + + for (typename DoFHandler::active_cell_iterator + cell = dof.begin_active(); + cell != dof.end(); ++cell) + { + fe_values.reinit (cell); + + for (unsigned int i=0; iindex()](i,j) += fe_values.shape_value (i,q) * + fe_values.shape_value (j,q) * + fe_values.JxW(q); + laplace_matrix[cell->index()](i,j) += fe_values.shape_grad (i,q) * + fe_values.shape_grad (j,q) * + fe_values.JxW(q); + } + } + + // check what we expect for this mapping + // about equality or inequality of the + // matrices + deallog << "Mass matrices " + << (equal (mass_matrix[0], mass_matrix[1]) ? "are" : "are not") + << " equal." + << std::endl; + deallog << "Laplace matrices " + << (equal (laplace_matrix[0], laplace_matrix[1]) ? "are" : "are not") + << " equal." + << std::endl; + + for (unsigned int cell=0; cell<2; ++cell) + { + deallog << "cell=" << cell << std::endl; + deallog << "mass_matrix:" << std::endl; + for (unsigned int i=0; i +void test() +{ + Triangulation tr; + Point p1 = Point(); + Point p2 = (dim == 2 ? + Point(2,1) : + Point(2,1,1)); + std::vector subdivisions (dim, 1); + subdivisions[0] = 2; + GridGenerator::subdivided_hyper_rectangle(tr, subdivisions, p1, p2); + + static const HyperBallBoundary boundary; + tr.set_boundary (1, boundary); + + // set boundary id on cell 1 + for (unsigned int f=0; f::faces_per_cell; ++f) + if (tr.begin_active()->at_boundary(f)) + tr.begin_active()->face(f)->set_boundary_indicator (1); + + test(tr); +} + + +int main() +{ + std::ofstream logfile ("cell_similarity_03/output"); + deallog << std::setprecision (4); + + deallog.attach(logfile); + deallog.depth_console (0); + deallog.threshold_double(1.e-7); + + test<2>(); + test<3>(); +} diff --git a/tests/fe/cell_similarity_03/cmp/generic b/tests/fe/cell_similarity_03/cmp/generic new file mode 100644 index 0000000000..e8e4bc0138 --- /dev/null +++ b/tests/fe/cell_similarity_03/cmp/generic @@ -0,0 +1,69 @@ + +DEAL::FE=FE_Q<2>(1) +DEAL::Mapping=Q1 +DEAL::Mass matrices are equal. +DEAL::Laplace matrices are equal. +DEAL::cell=0 +DEAL::mass_matrix: +DEAL::0.1111 0.05556 0.05556 0.02778 +DEAL::0.05556 0.1111 0.02778 0.05556 +DEAL::0.05556 0.02778 0.1111 0.05556 +DEAL::0.02778 0.05556 0.05556 0.1111 +DEAL::laplace_matrix: +DEAL::0.6667 -0.1667 -0.1667 -0.3333 +DEAL::-0.1667 0.6667 -0.3333 -0.1667 +DEAL::-0.1667 -0.3333 0.6667 -0.1667 +DEAL::-0.3333 -0.1667 -0.1667 0.6667 +DEAL::cell=1 +DEAL::mass_matrix: +DEAL::0.1111 0.05556 0.05556 0.02778 +DEAL::0.05556 0.1111 0.02778 0.05556 +DEAL::0.05556 0.02778 0.1111 0.05556 +DEAL::0.02778 0.05556 0.05556 0.1111 +DEAL::laplace_matrix: +DEAL::0.6667 -0.1667 -0.1667 -0.3333 +DEAL::-0.1667 0.6667 -0.3333 -0.1667 +DEAL::-0.1667 -0.3333 0.6667 -0.1667 +DEAL::-0.3333 -0.1667 -0.1667 0.6667 +DEAL::FE=FE_Q<3>(1) +DEAL::Mapping=Q1 +DEAL::Mass matrices are equal. +DEAL::Laplace matrices are equal. +DEAL::cell=0 +DEAL::mass_matrix: +DEAL::0.03704 0.01852 0.01852 0.009259 0.01852 0.009259 0.009259 0.004630 +DEAL::0.01852 0.03704 0.009259 0.01852 0.009259 0.01852 0.004630 0.009259 +DEAL::0.01852 0.009259 0.03704 0.01852 0.009259 0.004630 0.01852 0.009259 +DEAL::0.009259 0.01852 0.01852 0.03704 0.004630 0.009259 0.009259 0.01852 +DEAL::0.01852 0.009259 0.009259 0.004630 0.03704 0.01852 0.01852 0.009259 +DEAL::0.009259 0.01852 0.004630 0.009259 0.01852 0.03704 0.009259 0.01852 +DEAL::0.009259 0.004630 0.01852 0.009259 0.01852 0.009259 0.03704 0.01852 +DEAL::0.004630 0.009259 0.009259 0.01852 0.009259 0.01852 0.01852 0.03704 +DEAL::laplace_matrix: +DEAL::0.3333 0 0 -0.08333 0 -0.08333 -0.08333 -0.08333 +DEAL::0 0.3333 -0.08333 0 -0.08333 0 -0.08333 -0.08333 +DEAL::0 -0.08333 0.3333 0 -0.08333 -0.08333 0 -0.08333 +DEAL::-0.08333 0 0 0.3333 -0.08333 -0.08333 -0.08333 0 +DEAL::0 -0.08333 -0.08333 -0.08333 0.3333 0 0 -0.08333 +DEAL::-0.08333 0 -0.08333 -0.08333 0 0.3333 -0.08333 0 +DEAL::-0.08333 -0.08333 0 -0.08333 0 -0.08333 0.3333 0 +DEAL::-0.08333 -0.08333 -0.08333 0 -0.08333 0 0 0.3333 +DEAL::cell=1 +DEAL::mass_matrix: +DEAL::0.03704 0.01852 0.01852 0.009259 0.01852 0.009259 0.009259 0.004630 +DEAL::0.01852 0.03704 0.009259 0.01852 0.009259 0.01852 0.004630 0.009259 +DEAL::0.01852 0.009259 0.03704 0.01852 0.009259 0.004630 0.01852 0.009259 +DEAL::0.009259 0.01852 0.01852 0.03704 0.004630 0.009259 0.009259 0.01852 +DEAL::0.01852 0.009259 0.009259 0.004630 0.03704 0.01852 0.01852 0.009259 +DEAL::0.009259 0.01852 0.004630 0.009259 0.01852 0.03704 0.009259 0.01852 +DEAL::0.009259 0.004630 0.01852 0.009259 0.01852 0.009259 0.03704 0.01852 +DEAL::0.004630 0.009259 0.009259 0.01852 0.009259 0.01852 0.01852 0.03704 +DEAL::laplace_matrix: +DEAL::0.3333 0 0 -0.08333 0 -0.08333 -0.08333 -0.08333 +DEAL::0 0.3333 -0.08333 0 -0.08333 0 -0.08333 -0.08333 +DEAL::0 -0.08333 0.3333 0 -0.08333 -0.08333 0 -0.08333 +DEAL::-0.08333 0 0 0.3333 -0.08333 -0.08333 -0.08333 0 +DEAL::0 -0.08333 -0.08333 -0.08333 0.3333 0 0 -0.08333 +DEAL::-0.08333 0 -0.08333 -0.08333 0 0.3333 -0.08333 0 +DEAL::-0.08333 -0.08333 0 -0.08333 0 -0.08333 0.3333 0 +DEAL::-0.08333 -0.08333 -0.08333 0 -0.08333 0 0 0.3333 diff --git a/tests/fe/cell_similarity_04.cc b/tests/fe/cell_similarity_04.cc new file mode 100644 index 0000000000..9d2ec8a659 --- /dev/null +++ b/tests/fe/cell_similarity_04.cc @@ -0,0 +1,174 @@ +//---------------------------------------------------------------------- +// $Id$ +// Version: $Name$ +// +// Copyright (C) 2009 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. +// +//---------------------------------------------------------------------- + + +// since early 2009, the FEValues objects try to be more efficient by only +// recomputing things like gradients of shape functions if the cell on which +// we are is not a translation of the previous one. in this series of tests we +// make sure that this actually works the way it's supposed to be; in +// particular, if we create a mesh of two identical cells but one has a curved +// boundary, then they are the same if we use a Q1 mapping, but not a Q2 +// mapping. so we test that the mass matrix we get from each of these cells is +// actually different in the latter case, but the same in the former +// +// the various tests cell_similarity_?? differ in the mappings and finite +// elements in use + + +#include "../tests.h" +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include + + +bool equal (const FullMatrix &m1, + const FullMatrix &m2) +{ + double d = 0, s = 0; + for (unsigned int i=0; i +void test (const Triangulation& tr) +{ + FE_Q fe(2); + deallog << "FE=" << fe.get_name() << std::endl; + + MappingQ mapping(1); + deallog << "Mapping=Q1" << std::endl; + + + DoFHandler dof(tr); + dof.distribute_dofs(fe); + + const QGauss quadrature(2); + FEValues fe_values (mapping, fe, quadrature, + update_values | update_gradients | + update_JxW_values); + + FullMatrix mass_matrix[2], laplace_matrix[2]; + mass_matrix[0].reinit(fe.dofs_per_cell, fe.dofs_per_cell); + mass_matrix[1].reinit(fe.dofs_per_cell, fe.dofs_per_cell); + laplace_matrix[0].reinit(fe.dofs_per_cell, fe.dofs_per_cell); + laplace_matrix[1].reinit(fe.dofs_per_cell, fe.dofs_per_cell); + + for (typename DoFHandler::active_cell_iterator + cell = dof.begin_active(); + cell != dof.end(); ++cell) + { + fe_values.reinit (cell); + + for (unsigned int i=0; iindex()](i,j) += fe_values.shape_value (i,q) * + fe_values.shape_value (j,q) * + fe_values.JxW(q); + laplace_matrix[cell->index()](i,j) += fe_values.shape_grad (i,q) * + fe_values.shape_grad (j,q) * + fe_values.JxW(q); + } + } + + // check what we expect for this mapping + // about equality or inequality of the + // matrices + deallog << "Mass matrices " + << (equal (mass_matrix[0], mass_matrix[1]) ? "are" : "are not") + << " equal." + << std::endl; + deallog << "Laplace matrices " + << (equal (laplace_matrix[0], laplace_matrix[1]) ? "are" : "are not") + << " equal." + << std::endl; + + for (unsigned int cell=0; cell<2; ++cell) + { + deallog << "cell=" << cell << std::endl; + deallog << "mass_matrix:" << std::endl; + for (unsigned int i=0; i +void test() +{ + Triangulation tr; + Point p1 = Point(); + Point p2 = (dim == 2 ? + Point(2,1) : + Point(2,1,1)); + std::vector subdivisions (dim, 1); + subdivisions[0] = 2; + GridGenerator::subdivided_hyper_rectangle(tr, subdivisions, p1, p2); + + static const HyperBallBoundary boundary; + tr.set_boundary (1, boundary); + + // set boundary id on cell 1 + for (unsigned int f=0; f::faces_per_cell; ++f) + if (tr.begin_active()->at_boundary(f)) + tr.begin_active()->face(f)->set_boundary_indicator (1); + + test(tr); +} + + +int main() +{ + std::ofstream logfile ("cell_similarity_04/output"); + deallog << std::setprecision (4); + + deallog.attach(logfile); + deallog.depth_console (0); + deallog.threshold_double(1.e-7); + + test<2>(); + test<3>(); +} diff --git a/tests/fe/cell_similarity_04/cmp/generic b/tests/fe/cell_similarity_04/cmp/generic new file mode 100644 index 0000000000..f7f4e43c1b --- /dev/null +++ b/tests/fe/cell_similarity_04/cmp/generic @@ -0,0 +1,165 @@ + +DEAL::FE=FE_Q<2>(2) +DEAL::Mapping=Q1 +DEAL::Mass matrices are equal. +DEAL::Laplace matrices are equal. +DEAL::cell=0 +DEAL::mass_matrix: +DEAL::0.01235 0.006173 0.006173 0.003086 0.01235 0.006173 0.01235 0.006173 0.01235 +DEAL::0.006173 0.01235 0.003086 0.006173 0.006173 0.01235 0.01235 0.006173 0.01235 +DEAL::0.006173 0.003086 0.01235 0.006173 0.01235 0.006173 0.006173 0.01235 0.01235 +DEAL::0.003086 0.006173 0.006173 0.01235 0.006173 0.01235 0.006173 0.01235 0.01235 +DEAL::0.01235 0.006173 0.01235 0.006173 0.04938 -0.02469 0.01235 0.01235 0.04938 +DEAL::0.006173 0.01235 0.006173 0.01235 -0.02469 0.04938 0.01235 0.01235 0.04938 +DEAL::0.01235 0.01235 0.006173 0.006173 0.01235 0.01235 0.04938 -0.02469 0.04938 +DEAL::0.006173 0.006173 0.01235 0.01235 0.01235 0.01235 -0.02469 0.04938 0.04938 +DEAL::0.01235 0.01235 0.01235 0.01235 0.04938 0.04938 0.04938 0.04938 0.1975 +DEAL::laplace_matrix: +DEAL::0.5185 -0.09259 -0.09259 -0.03704 -0.03704 0.1852 -0.03704 0.1852 -0.5926 +DEAL::-0.09259 0.5185 -0.03704 -0.09259 0.1852 -0.03704 -0.03704 0.1852 -0.5926 +DEAL::-0.09259 -0.03704 0.5185 -0.09259 -0.03704 0.1852 0.1852 -0.03704 -0.5926 +DEAL::-0.03704 -0.09259 -0.09259 0.5185 0.1852 -0.03704 0.1852 -0.03704 -0.5926 +DEAL::-0.03704 0.1852 -0.03704 0.1852 1.630 -0.1481 -0.5926 -0.5926 -0.5926 +DEAL::0.1852 -0.03704 0.1852 -0.03704 -0.1481 1.630 -0.5926 -0.5926 -0.5926 +DEAL::-0.03704 -0.03704 0.1852 0.1852 -0.5926 -0.5926 1.630 -0.1481 -0.5926 +DEAL::0.1852 0.1852 -0.03704 -0.03704 -0.5926 -0.5926 -0.1481 1.630 -0.5926 +DEAL::-0.5926 -0.5926 -0.5926 -0.5926 -0.5926 -0.5926 -0.5926 -0.5926 4.741 +DEAL::cell=1 +DEAL::mass_matrix: +DEAL::0.01235 0.006173 0.006173 0.003086 0.01235 0.006173 0.01235 0.006173 0.01235 +DEAL::0.006173 0.01235 0.003086 0.006173 0.006173 0.01235 0.01235 0.006173 0.01235 +DEAL::0.006173 0.003086 0.01235 0.006173 0.01235 0.006173 0.006173 0.01235 0.01235 +DEAL::0.003086 0.006173 0.006173 0.01235 0.006173 0.01235 0.006173 0.01235 0.01235 +DEAL::0.01235 0.006173 0.01235 0.006173 0.04938 -0.02469 0.01235 0.01235 0.04938 +DEAL::0.006173 0.01235 0.006173 0.01235 -0.02469 0.04938 0.01235 0.01235 0.04938 +DEAL::0.01235 0.01235 0.006173 0.006173 0.01235 0.01235 0.04938 -0.02469 0.04938 +DEAL::0.006173 0.006173 0.01235 0.01235 0.01235 0.01235 -0.02469 0.04938 0.04938 +DEAL::0.01235 0.01235 0.01235 0.01235 0.04938 0.04938 0.04938 0.04938 0.1975 +DEAL::laplace_matrix: +DEAL::0.5185 -0.09259 -0.09259 -0.03704 -0.03704 0.1852 -0.03704 0.1852 -0.5926 +DEAL::-0.09259 0.5185 -0.03704 -0.09259 0.1852 -0.03704 -0.03704 0.1852 -0.5926 +DEAL::-0.09259 -0.03704 0.5185 -0.09259 -0.03704 0.1852 0.1852 -0.03704 -0.5926 +DEAL::-0.03704 -0.09259 -0.09259 0.5185 0.1852 -0.03704 0.1852 -0.03704 -0.5926 +DEAL::-0.03704 0.1852 -0.03704 0.1852 1.630 -0.1481 -0.5926 -0.5926 -0.5926 +DEAL::0.1852 -0.03704 0.1852 -0.03704 -0.1481 1.630 -0.5926 -0.5926 -0.5926 +DEAL::-0.03704 -0.03704 0.1852 0.1852 -0.5926 -0.5926 1.630 -0.1481 -0.5926 +DEAL::0.1852 0.1852 -0.03704 -0.03704 -0.5926 -0.5926 -0.1481 1.630 -0.5926 +DEAL::-0.5926 -0.5926 -0.5926 -0.5926 -0.5926 -0.5926 -0.5926 -0.5926 4.741 +DEAL::FE=FE_Q<3>(2) +DEAL::Mapping=Q1 +DEAL::Mass matrices are equal. +DEAL::Laplace matrices are equal. +DEAL::cell=0 +DEAL::mass_matrix: +DEAL::0.001372 0.0006859 0.0006859 0.0003429 0.0006859 0.0003429 0.0003429 0.0001715 0.001372 0.0006859 0.001372 0.0006859 0.0006859 0.0003429 0.0006859 0.0003429 0.001372 0.0006859 0.0006859 0.0003429 0.001372 0.0006859 0.001372 0.0006859 0.001372 0.0006859 0.001372 +DEAL::0.0006859 0.001372 0.0003429 0.0006859 0.0003429 0.0006859 0.0001715 0.0003429 0.0006859 0.001372 0.001372 0.0006859 0.0003429 0.0006859 0.0006859 0.0003429 0.0006859 0.001372 0.0003429 0.0006859 0.0006859 0.001372 0.001372 0.0006859 0.001372 0.0006859 0.001372 +DEAL::0.0006859 0.0003429 0.001372 0.0006859 0.0003429 0.0001715 0.0006859 0.0003429 0.001372 0.0006859 0.0006859 0.001372 0.0006859 0.0003429 0.0003429 0.0006859 0.0006859 0.0003429 0.001372 0.0006859 0.001372 0.0006859 0.0006859 0.001372 0.001372 0.0006859 0.001372 +DEAL::0.0003429 0.0006859 0.0006859 0.001372 0.0001715 0.0003429 0.0003429 0.0006859 0.0006859 0.001372 0.0006859 0.001372 0.0003429 0.0006859 0.0003429 0.0006859 0.0003429 0.0006859 0.0006859 0.001372 0.0006859 0.001372 0.0006859 0.001372 0.001372 0.0006859 0.001372 +DEAL::0.0006859 0.0003429 0.0003429 0.0001715 0.001372 0.0006859 0.0006859 0.0003429 0.0006859 0.0003429 0.0006859 0.0003429 0.001372 0.0006859 0.001372 0.0006859 0.001372 0.0006859 0.0006859 0.0003429 0.001372 0.0006859 0.001372 0.0006859 0.0006859 0.001372 0.001372 +DEAL::0.0003429 0.0006859 0.0001715 0.0003429 0.0006859 0.001372 0.0003429 0.0006859 0.0003429 0.0006859 0.0006859 0.0003429 0.0006859 0.001372 0.001372 0.0006859 0.0006859 0.001372 0.0003429 0.0006859 0.0006859 0.001372 0.001372 0.0006859 0.0006859 0.001372 0.001372 +DEAL::0.0003429 0.0001715 0.0006859 0.0003429 0.0006859 0.0003429 0.001372 0.0006859 0.0006859 0.0003429 0.0003429 0.0006859 0.001372 0.0006859 0.0006859 0.001372 0.0006859 0.0003429 0.001372 0.0006859 0.001372 0.0006859 0.0006859 0.001372 0.0006859 0.001372 0.001372 +DEAL::0.0001715 0.0003429 0.0003429 0.0006859 0.0003429 0.0006859 0.0006859 0.001372 0.0003429 0.0006859 0.0003429 0.0006859 0.0006859 0.001372 0.0006859 0.001372 0.0003429 0.0006859 0.0006859 0.001372 0.0006859 0.001372 0.0006859 0.001372 0.0006859 0.001372 0.001372 +DEAL::0.001372 0.0006859 0.001372 0.0006859 0.0006859 0.0003429 0.0006859 0.0003429 0.005487 0.002743 0.001372 0.001372 0.002743 0.001372 0.0006859 0.0006859 0.001372 0.0006859 0.001372 0.0006859 0.005487 0.002743 0.001372 0.001372 0.005487 0.002743 0.005487 +DEAL::0.0006859 0.001372 0.0006859 0.001372 0.0003429 0.0006859 0.0003429 0.0006859 0.002743 0.005487 0.001372 0.001372 0.001372 0.002743 0.0006859 0.0006859 0.0006859 0.001372 0.0006859 0.001372 0.002743 0.005487 0.001372 0.001372 0.005487 0.002743 0.005487 +DEAL::0.001372 0.001372 0.0006859 0.0006859 0.0006859 0.0006859 0.0003429 0.0003429 0.001372 0.001372 0.005487 0.002743 0.0006859 0.0006859 0.002743 0.001372 0.001372 0.001372 0.0006859 0.0006859 0.001372 0.001372 0.005487 0.002743 0.005487 0.002743 0.005487 +DEAL::0.0006859 0.0006859 0.001372 0.001372 0.0003429 0.0003429 0.0006859 0.0006859 0.001372 0.001372 0.002743 0.005487 0.0006859 0.0006859 0.001372 0.002743 0.0006859 0.0006859 0.001372 0.001372 0.001372 0.001372 0.002743 0.005487 0.005487 0.002743 0.005487 +DEAL::0.0006859 0.0003429 0.0006859 0.0003429 0.001372 0.0006859 0.001372 0.0006859 0.002743 0.001372 0.0006859 0.0006859 0.005487 0.002743 0.001372 0.001372 0.001372 0.0006859 0.001372 0.0006859 0.005487 0.002743 0.001372 0.001372 0.002743 0.005487 0.005487 +DEAL::0.0003429 0.0006859 0.0003429 0.0006859 0.0006859 0.001372 0.0006859 0.001372 0.001372 0.002743 0.0006859 0.0006859 0.002743 0.005487 0.001372 0.001372 0.0006859 0.001372 0.0006859 0.001372 0.002743 0.005487 0.001372 0.001372 0.002743 0.005487 0.005487 +DEAL::0.0006859 0.0006859 0.0003429 0.0003429 0.001372 0.001372 0.0006859 0.0006859 0.0006859 0.0006859 0.002743 0.001372 0.001372 0.001372 0.005487 0.002743 0.001372 0.001372 0.0006859 0.0006859 0.001372 0.001372 0.005487 0.002743 0.002743 0.005487 0.005487 +DEAL::0.0003429 0.0003429 0.0006859 0.0006859 0.0006859 0.0006859 0.001372 0.001372 0.0006859 0.0006859 0.001372 0.002743 0.001372 0.001372 0.002743 0.005487 0.0006859 0.0006859 0.001372 0.001372 0.001372 0.001372 0.002743 0.005487 0.002743 0.005487 0.005487 +DEAL::0.001372 0.0006859 0.0006859 0.0003429 0.001372 0.0006859 0.0006859 0.0003429 0.001372 0.0006859 0.001372 0.0006859 0.001372 0.0006859 0.001372 0.0006859 0.005487 0.002743 0.002743 0.001372 0.005487 0.002743 0.005487 0.002743 0.001372 0.001372 0.005487 +DEAL::0.0006859 0.001372 0.0003429 0.0006859 0.0006859 0.001372 0.0003429 0.0006859 0.0006859 0.001372 0.001372 0.0006859 0.0006859 0.001372 0.001372 0.0006859 0.002743 0.005487 0.001372 0.002743 0.002743 0.005487 0.005487 0.002743 0.001372 0.001372 0.005487 +DEAL::0.0006859 0.0003429 0.001372 0.0006859 0.0006859 0.0003429 0.001372 0.0006859 0.001372 0.0006859 0.0006859 0.001372 0.001372 0.0006859 0.0006859 0.001372 0.002743 0.001372 0.005487 0.002743 0.005487 0.002743 0.002743 0.005487 0.001372 0.001372 0.005487 +DEAL::0.0003429 0.0006859 0.0006859 0.001372 0.0003429 0.0006859 0.0006859 0.001372 0.0006859 0.001372 0.0006859 0.001372 0.0006859 0.001372 0.0006859 0.001372 0.001372 0.002743 0.002743 0.005487 0.002743 0.005487 0.002743 0.005487 0.001372 0.001372 0.005487 +DEAL::0.001372 0.0006859 0.001372 0.0006859 0.001372 0.0006859 0.001372 0.0006859 0.005487 0.002743 0.001372 0.001372 0.005487 0.002743 0.001372 0.001372 0.005487 0.002743 0.005487 0.002743 0.02195 -0.01097 0.005487 0.005487 0.005487 0.005487 0.02195 +DEAL::0.0006859 0.001372 0.0006859 0.001372 0.0006859 0.001372 0.0006859 0.001372 0.002743 0.005487 0.001372 0.001372 0.002743 0.005487 0.001372 0.001372 0.002743 0.005487 0.002743 0.005487 -0.01097 0.02195 0.005487 0.005487 0.005487 0.005487 0.02195 +DEAL::0.001372 0.001372 0.0006859 0.0006859 0.001372 0.001372 0.0006859 0.0006859 0.001372 0.001372 0.005487 0.002743 0.001372 0.001372 0.005487 0.002743 0.005487 0.005487 0.002743 0.002743 0.005487 0.005487 0.02195 -0.01097 0.005487 0.005487 0.02195 +DEAL::0.0006859 0.0006859 0.001372 0.001372 0.0006859 0.0006859 0.001372 0.001372 0.001372 0.001372 0.002743 0.005487 0.001372 0.001372 0.002743 0.005487 0.002743 0.002743 0.005487 0.005487 0.005487 0.005487 -0.01097 0.02195 0.005487 0.005487 0.02195 +DEAL::0.001372 0.001372 0.001372 0.001372 0.0006859 0.0006859 0.0006859 0.0006859 0.005487 0.005487 0.005487 0.005487 0.002743 0.002743 0.002743 0.002743 0.001372 0.001372 0.001372 0.001372 0.005487 0.005487 0.005487 0.005487 0.02195 -0.01097 0.02195 +DEAL::0.0006859 0.0006859 0.0006859 0.0006859 0.001372 0.001372 0.001372 0.001372 0.002743 0.002743 0.002743 0.002743 0.005487 0.005487 0.005487 0.005487 0.001372 0.001372 0.001372 0.001372 0.005487 0.005487 0.005487 0.005487 -0.01097 0.02195 0.02195 +DEAL::0.001372 0.001372 0.001372 0.001372 0.001372 0.001372 0.001372 0.001372 0.005487 0.005487 0.005487 0.005487 0.005487 0.005487 0.005487 0.005487 0.005487 0.005487 0.005487 0.005487 0.02195 0.02195 0.02195 0.02195 0.02195 0.02195 0.08779 +DEAL::laplace_matrix: +DEAL::0.08642 -0.02469 -0.02469 0.003086 -0.02469 0.003086 0.003086 0.003086 0.02469 0.006173 0.02469 0.006173 0.006173 -0.01235 0.006173 -0.01235 0.02469 0.006173 0.006173 -0.01235 -0.03704 0.03704 -0.03704 0.03704 -0.03704 0.03704 -0.09877 +DEAL::-0.02469 0.08642 0.003086 -0.02469 0.003086 -0.02469 0.003086 0.003086 0.006173 0.02469 0.02469 0.006173 -0.01235 0.006173 0.006173 -0.01235 0.006173 0.02469 -0.01235 0.006173 0.03704 -0.03704 -0.03704 0.03704 -0.03704 0.03704 -0.09877 +DEAL::-0.02469 0.003086 0.08642 -0.02469 0.003086 0.003086 -0.02469 0.003086 0.02469 0.006173 0.006173 0.02469 0.006173 -0.01235 -0.01235 0.006173 0.006173 -0.01235 0.02469 0.006173 -0.03704 0.03704 0.03704 -0.03704 -0.03704 0.03704 -0.09877 +DEAL::0.003086 -0.02469 -0.02469 0.08642 0.003086 0.003086 0.003086 -0.02469 0.006173 0.02469 0.006173 0.02469 -0.01235 0.006173 -0.01235 0.006173 -0.01235 0.006173 0.006173 0.02469 0.03704 -0.03704 0.03704 -0.03704 -0.03704 0.03704 -0.09877 +DEAL::-0.02469 0.003086 0.003086 0.003086 0.08642 -0.02469 -0.02469 0.003086 0.006173 -0.01235 0.006173 -0.01235 0.02469 0.006173 0.02469 0.006173 0.02469 0.006173 0.006173 -0.01235 -0.03704 0.03704 -0.03704 0.03704 0.03704 -0.03704 -0.09877 +DEAL::0.003086 -0.02469 0.003086 0.003086 -0.02469 0.08642 0.003086 -0.02469 -0.01235 0.006173 0.006173 -0.01235 0.006173 0.02469 0.02469 0.006173 0.006173 0.02469 -0.01235 0.006173 0.03704 -0.03704 -0.03704 0.03704 0.03704 -0.03704 -0.09877 +DEAL::0.003086 0.003086 -0.02469 0.003086 -0.02469 0.003086 0.08642 -0.02469 0.006173 -0.01235 -0.01235 0.006173 0.02469 0.006173 0.006173 0.02469 0.006173 -0.01235 0.02469 0.006173 -0.03704 0.03704 0.03704 -0.03704 0.03704 -0.03704 -0.09877 +DEAL::0.003086 0.003086 0.003086 -0.02469 0.003086 -0.02469 -0.02469 0.08642 -0.01235 0.006173 -0.01235 0.006173 0.006173 0.02469 0.006173 0.02469 -0.01235 0.006173 0.006173 0.02469 0.03704 -0.03704 0.03704 -0.03704 0.03704 -0.03704 -0.09877 +DEAL::0.02469 0.006173 0.02469 0.006173 0.006173 -0.01235 0.006173 -0.01235 0.2963 -0.07407 -0.03704 -0.03704 -0.07407 0 0.03704 0.03704 -0.03704 0.03704 -0.03704 0.03704 0.04938 0.04938 -0.09877 -0.09877 0.04938 0.04938 -0.1975 +DEAL::0.006173 0.02469 0.006173 0.02469 -0.01235 0.006173 -0.01235 0.006173 -0.07407 0.2963 -0.03704 -0.03704 0 -0.07407 0.03704 0.03704 0.03704 -0.03704 0.03704 -0.03704 0.04938 0.04938 -0.09877 -0.09877 0.04938 0.04938 -0.1975 +DEAL::0.02469 0.02469 0.006173 0.006173 0.006173 0.006173 -0.01235 -0.01235 -0.03704 -0.03704 0.2963 -0.07407 0.03704 0.03704 -0.07407 0 -0.03704 -0.03704 0.03704 0.03704 -0.09877 -0.09877 0.04938 0.04938 0.04938 0.04938 -0.1975 +DEAL::0.006173 0.006173 0.02469 0.02469 -0.01235 -0.01235 0.006173 0.006173 -0.03704 -0.03704 -0.07407 0.2963 0.03704 0.03704 0 -0.07407 0.03704 0.03704 -0.03704 -0.03704 -0.09877 -0.09877 0.04938 0.04938 0.04938 0.04938 -0.1975 +DEAL::0.006173 -0.01235 0.006173 -0.01235 0.02469 0.006173 0.02469 0.006173 -0.07407 0 0.03704 0.03704 0.2963 -0.07407 -0.03704 -0.03704 -0.03704 0.03704 -0.03704 0.03704 0.04938 0.04938 -0.09877 -0.09877 0.04938 0.04938 -0.1975 +DEAL::-0.01235 0.006173 -0.01235 0.006173 0.006173 0.02469 0.006173 0.02469 0 -0.07407 0.03704 0.03704 -0.07407 0.2963 -0.03704 -0.03704 0.03704 -0.03704 0.03704 -0.03704 0.04938 0.04938 -0.09877 -0.09877 0.04938 0.04938 -0.1975 +DEAL::0.006173 0.006173 -0.01235 -0.01235 0.02469 0.02469 0.006173 0.006173 0.03704 0.03704 -0.07407 0 -0.03704 -0.03704 0.2963 -0.07407 -0.03704 -0.03704 0.03704 0.03704 -0.09877 -0.09877 0.04938 0.04938 0.04938 0.04938 -0.1975 +DEAL::-0.01235 -0.01235 0.006173 0.006173 0.006173 0.006173 0.02469 0.02469 0.03704 0.03704 0 -0.07407 -0.03704 -0.03704 -0.07407 0.2963 0.03704 0.03704 -0.03704 -0.03704 -0.09877 -0.09877 0.04938 0.04938 0.04938 0.04938 -0.1975 +DEAL::0.02469 0.006173 0.006173 -0.01235 0.02469 0.006173 0.006173 -0.01235 -0.03704 0.03704 -0.03704 0.03704 -0.03704 0.03704 -0.03704 0.03704 0.2963 -0.07407 -0.07407 0 0.04938 0.04938 0.04938 0.04938 -0.09877 -0.09877 -0.1975 +DEAL::0.006173 0.02469 -0.01235 0.006173 0.006173 0.02469 -0.01235 0.006173 0.03704 -0.03704 -0.03704 0.03704 0.03704 -0.03704 -0.03704 0.03704 -0.07407 0.2963 0 -0.07407 0.04938 0.04938 0.04938 0.04938 -0.09877 -0.09877 -0.1975 +DEAL::0.006173 -0.01235 0.02469 0.006173 0.006173 -0.01235 0.02469 0.006173 -0.03704 0.03704 0.03704 -0.03704 -0.03704 0.03704 0.03704 -0.03704 -0.07407 0 0.2963 -0.07407 0.04938 0.04938 0.04938 0.04938 -0.09877 -0.09877 -0.1975 +DEAL::-0.01235 0.006173 0.006173 0.02469 -0.01235 0.006173 0.006173 0.02469 0.03704 -0.03704 0.03704 -0.03704 0.03704 -0.03704 0.03704 -0.03704 0 -0.07407 -0.07407 0.2963 0.04938 0.04938 0.04938 0.04938 -0.09877 -0.09877 -0.1975 +DEAL::-0.03704 0.03704 -0.03704 0.03704 -0.03704 0.03704 -0.03704 0.03704 0.04938 0.04938 -0.09877 -0.09877 0.04938 0.04938 -0.09877 -0.09877 0.04938 0.04938 0.04938 0.04938 0.9877 -0.1975 -0.1975 -0.1975 -0.1975 -0.1975 0 +DEAL::0.03704 -0.03704 0.03704 -0.03704 0.03704 -0.03704 0.03704 -0.03704 0.04938 0.04938 -0.09877 -0.09877 0.04938 0.04938 -0.09877 -0.09877 0.04938 0.04938 0.04938 0.04938 -0.1975 0.9877 -0.1975 -0.1975 -0.1975 -0.1975 0 +DEAL::-0.03704 -0.03704 0.03704 0.03704 -0.03704 -0.03704 0.03704 0.03704 -0.09877 -0.09877 0.04938 0.04938 -0.09877 -0.09877 0.04938 0.04938 0.04938 0.04938 0.04938 0.04938 -0.1975 -0.1975 0.9877 -0.1975 -0.1975 -0.1975 0 +DEAL::0.03704 0.03704 -0.03704 -0.03704 0.03704 0.03704 -0.03704 -0.03704 -0.09877 -0.09877 0.04938 0.04938 -0.09877 -0.09877 0.04938 0.04938 0.04938 0.04938 0.04938 0.04938 -0.1975 -0.1975 -0.1975 0.9877 -0.1975 -0.1975 0 +DEAL::-0.03704 -0.03704 -0.03704 -0.03704 0.03704 0.03704 0.03704 0.03704 0.04938 0.04938 0.04938 0.04938 0.04938 0.04938 0.04938 0.04938 -0.09877 -0.09877 -0.09877 -0.09877 -0.1975 -0.1975 -0.1975 -0.1975 0.9877 -0.1975 0 +DEAL::0.03704 0.03704 0.03704 0.03704 -0.03704 -0.03704 -0.03704 -0.03704 0.04938 0.04938 0.04938 0.04938 0.04938 0.04938 0.04938 0.04938 -0.09877 -0.09877 -0.09877 -0.09877 -0.1975 -0.1975 -0.1975 -0.1975 -0.1975 0.9877 0 +DEAL::-0.09877 -0.09877 -0.09877 -0.09877 -0.09877 -0.09877 -0.09877 -0.09877 -0.1975 -0.1975 -0.1975 -0.1975 -0.1975 -0.1975 -0.1975 -0.1975 -0.1975 -0.1975 -0.1975 -0.1975 0 0 0 0 0 0 3.160 +DEAL::cell=1 +DEAL::mass_matrix: +DEAL::0.001372 0.0006859 0.0006859 0.0003429 0.0006859 0.0003429 0.0003429 0.0001715 0.001372 0.0006859 0.001372 0.0006859 0.0006859 0.0003429 0.0006859 0.0003429 0.001372 0.0006859 0.0006859 0.0003429 0.001372 0.0006859 0.001372 0.0006859 0.001372 0.0006859 0.001372 +DEAL::0.0006859 0.001372 0.0003429 0.0006859 0.0003429 0.0006859 0.0001715 0.0003429 0.0006859 0.001372 0.001372 0.0006859 0.0003429 0.0006859 0.0006859 0.0003429 0.0006859 0.001372 0.0003429 0.0006859 0.0006859 0.001372 0.001372 0.0006859 0.001372 0.0006859 0.001372 +DEAL::0.0006859 0.0003429 0.001372 0.0006859 0.0003429 0.0001715 0.0006859 0.0003429 0.001372 0.0006859 0.0006859 0.001372 0.0006859 0.0003429 0.0003429 0.0006859 0.0006859 0.0003429 0.001372 0.0006859 0.001372 0.0006859 0.0006859 0.001372 0.001372 0.0006859 0.001372 +DEAL::0.0003429 0.0006859 0.0006859 0.001372 0.0001715 0.0003429 0.0003429 0.0006859 0.0006859 0.001372 0.0006859 0.001372 0.0003429 0.0006859 0.0003429 0.0006859 0.0003429 0.0006859 0.0006859 0.001372 0.0006859 0.001372 0.0006859 0.001372 0.001372 0.0006859 0.001372 +DEAL::0.0006859 0.0003429 0.0003429 0.0001715 0.001372 0.0006859 0.0006859 0.0003429 0.0006859 0.0003429 0.0006859 0.0003429 0.001372 0.0006859 0.001372 0.0006859 0.001372 0.0006859 0.0006859 0.0003429 0.001372 0.0006859 0.001372 0.0006859 0.0006859 0.001372 0.001372 +DEAL::0.0003429 0.0006859 0.0001715 0.0003429 0.0006859 0.001372 0.0003429 0.0006859 0.0003429 0.0006859 0.0006859 0.0003429 0.0006859 0.001372 0.001372 0.0006859 0.0006859 0.001372 0.0003429 0.0006859 0.0006859 0.001372 0.001372 0.0006859 0.0006859 0.001372 0.001372 +DEAL::0.0003429 0.0001715 0.0006859 0.0003429 0.0006859 0.0003429 0.001372 0.0006859 0.0006859 0.0003429 0.0003429 0.0006859 0.001372 0.0006859 0.0006859 0.001372 0.0006859 0.0003429 0.001372 0.0006859 0.001372 0.0006859 0.0006859 0.001372 0.0006859 0.001372 0.001372 +DEAL::0.0001715 0.0003429 0.0003429 0.0006859 0.0003429 0.0006859 0.0006859 0.001372 0.0003429 0.0006859 0.0003429 0.0006859 0.0006859 0.001372 0.0006859 0.001372 0.0003429 0.0006859 0.0006859 0.001372 0.0006859 0.001372 0.0006859 0.001372 0.0006859 0.001372 0.001372 +DEAL::0.001372 0.0006859 0.001372 0.0006859 0.0006859 0.0003429 0.0006859 0.0003429 0.005487 0.002743 0.001372 0.001372 0.002743 0.001372 0.0006859 0.0006859 0.001372 0.0006859 0.001372 0.0006859 0.005487 0.002743 0.001372 0.001372 0.005487 0.002743 0.005487 +DEAL::0.0006859 0.001372 0.0006859 0.001372 0.0003429 0.0006859 0.0003429 0.0006859 0.002743 0.005487 0.001372 0.001372 0.001372 0.002743 0.0006859 0.0006859 0.0006859 0.001372 0.0006859 0.001372 0.002743 0.005487 0.001372 0.001372 0.005487 0.002743 0.005487 +DEAL::0.001372 0.001372 0.0006859 0.0006859 0.0006859 0.0006859 0.0003429 0.0003429 0.001372 0.001372 0.005487 0.002743 0.0006859 0.0006859 0.002743 0.001372 0.001372 0.001372 0.0006859 0.0006859 0.001372 0.001372 0.005487 0.002743 0.005487 0.002743 0.005487 +DEAL::0.0006859 0.0006859 0.001372 0.001372 0.0003429 0.0003429 0.0006859 0.0006859 0.001372 0.001372 0.002743 0.005487 0.0006859 0.0006859 0.001372 0.002743 0.0006859 0.0006859 0.001372 0.001372 0.001372 0.001372 0.002743 0.005487 0.005487 0.002743 0.005487 +DEAL::0.0006859 0.0003429 0.0006859 0.0003429 0.001372 0.0006859 0.001372 0.0006859 0.002743 0.001372 0.0006859 0.0006859 0.005487 0.002743 0.001372 0.001372 0.001372 0.0006859 0.001372 0.0006859 0.005487 0.002743 0.001372 0.001372 0.002743 0.005487 0.005487 +DEAL::0.0003429 0.0006859 0.0003429 0.0006859 0.0006859 0.001372 0.0006859 0.001372 0.001372 0.002743 0.0006859 0.0006859 0.002743 0.005487 0.001372 0.001372 0.0006859 0.001372 0.0006859 0.001372 0.002743 0.005487 0.001372 0.001372 0.002743 0.005487 0.005487 +DEAL::0.0006859 0.0006859 0.0003429 0.0003429 0.001372 0.001372 0.0006859 0.0006859 0.0006859 0.0006859 0.002743 0.001372 0.001372 0.001372 0.005487 0.002743 0.001372 0.001372 0.0006859 0.0006859 0.001372 0.001372 0.005487 0.002743 0.002743 0.005487 0.005487 +DEAL::0.0003429 0.0003429 0.0006859 0.0006859 0.0006859 0.0006859 0.001372 0.001372 0.0006859 0.0006859 0.001372 0.002743 0.001372 0.001372 0.002743 0.005487 0.0006859 0.0006859 0.001372 0.001372 0.001372 0.001372 0.002743 0.005487 0.002743 0.005487 0.005487 +DEAL::0.001372 0.0006859 0.0006859 0.0003429 0.001372 0.0006859 0.0006859 0.0003429 0.001372 0.0006859 0.001372 0.0006859 0.001372 0.0006859 0.001372 0.0006859 0.005487 0.002743 0.002743 0.001372 0.005487 0.002743 0.005487 0.002743 0.001372 0.001372 0.005487 +DEAL::0.0006859 0.001372 0.0003429 0.0006859 0.0006859 0.001372 0.0003429 0.0006859 0.0006859 0.001372 0.001372 0.0006859 0.0006859 0.001372 0.001372 0.0006859 0.002743 0.005487 0.001372 0.002743 0.002743 0.005487 0.005487 0.002743 0.001372 0.001372 0.005487 +DEAL::0.0006859 0.0003429 0.001372 0.0006859 0.0006859 0.0003429 0.001372 0.0006859 0.001372 0.0006859 0.0006859 0.001372 0.001372 0.0006859 0.0006859 0.001372 0.002743 0.001372 0.005487 0.002743 0.005487 0.002743 0.002743 0.005487 0.001372 0.001372 0.005487 +DEAL::0.0003429 0.0006859 0.0006859 0.001372 0.0003429 0.0006859 0.0006859 0.001372 0.0006859 0.001372 0.0006859 0.001372 0.0006859 0.001372 0.0006859 0.001372 0.001372 0.002743 0.002743 0.005487 0.002743 0.005487 0.002743 0.005487 0.001372 0.001372 0.005487 +DEAL::0.001372 0.0006859 0.001372 0.0006859 0.001372 0.0006859 0.001372 0.0006859 0.005487 0.002743 0.001372 0.001372 0.005487 0.002743 0.001372 0.001372 0.005487 0.002743 0.005487 0.002743 0.02195 -0.01097 0.005487 0.005487 0.005487 0.005487 0.02195 +DEAL::0.0006859 0.001372 0.0006859 0.001372 0.0006859 0.001372 0.0006859 0.001372 0.002743 0.005487 0.001372 0.001372 0.002743 0.005487 0.001372 0.001372 0.002743 0.005487 0.002743 0.005487 -0.01097 0.02195 0.005487 0.005487 0.005487 0.005487 0.02195 +DEAL::0.001372 0.001372 0.0006859 0.0006859 0.001372 0.001372 0.0006859 0.0006859 0.001372 0.001372 0.005487 0.002743 0.001372 0.001372 0.005487 0.002743 0.005487 0.005487 0.002743 0.002743 0.005487 0.005487 0.02195 -0.01097 0.005487 0.005487 0.02195 +DEAL::0.0006859 0.0006859 0.001372 0.001372 0.0006859 0.0006859 0.001372 0.001372 0.001372 0.001372 0.002743 0.005487 0.001372 0.001372 0.002743 0.005487 0.002743 0.002743 0.005487 0.005487 0.005487 0.005487 -0.01097 0.02195 0.005487 0.005487 0.02195 +DEAL::0.001372 0.001372 0.001372 0.001372 0.0006859 0.0006859 0.0006859 0.0006859 0.005487 0.005487 0.005487 0.005487 0.002743 0.002743 0.002743 0.002743 0.001372 0.001372 0.001372 0.001372 0.005487 0.005487 0.005487 0.005487 0.02195 -0.01097 0.02195 +DEAL::0.0006859 0.0006859 0.0006859 0.0006859 0.001372 0.001372 0.001372 0.001372 0.002743 0.002743 0.002743 0.002743 0.005487 0.005487 0.005487 0.005487 0.001372 0.001372 0.001372 0.001372 0.005487 0.005487 0.005487 0.005487 -0.01097 0.02195 0.02195 +DEAL::0.001372 0.001372 0.001372 0.001372 0.001372 0.001372 0.001372 0.001372 0.005487 0.005487 0.005487 0.005487 0.005487 0.005487 0.005487 0.005487 0.005487 0.005487 0.005487 0.005487 0.02195 0.02195 0.02195 0.02195 0.02195 0.02195 0.08779 +DEAL::laplace_matrix: +DEAL::0.08642 -0.02469 -0.02469 0.003086 -0.02469 0.003086 0.003086 0.003086 0.02469 0.006173 0.02469 0.006173 0.006173 -0.01235 0.006173 -0.01235 0.02469 0.006173 0.006173 -0.01235 -0.03704 0.03704 -0.03704 0.03704 -0.03704 0.03704 -0.09877 +DEAL::-0.02469 0.08642 0.003086 -0.02469 0.003086 -0.02469 0.003086 0.003086 0.006173 0.02469 0.02469 0.006173 -0.01235 0.006173 0.006173 -0.01235 0.006173 0.02469 -0.01235 0.006173 0.03704 -0.03704 -0.03704 0.03704 -0.03704 0.03704 -0.09877 +DEAL::-0.02469 0.003086 0.08642 -0.02469 0.003086 0.003086 -0.02469 0.003086 0.02469 0.006173 0.006173 0.02469 0.006173 -0.01235 -0.01235 0.006173 0.006173 -0.01235 0.02469 0.006173 -0.03704 0.03704 0.03704 -0.03704 -0.03704 0.03704 -0.09877 +DEAL::0.003086 -0.02469 -0.02469 0.08642 0.003086 0.003086 0.003086 -0.02469 0.006173 0.02469 0.006173 0.02469 -0.01235 0.006173 -0.01235 0.006173 -0.01235 0.006173 0.006173 0.02469 0.03704 -0.03704 0.03704 -0.03704 -0.03704 0.03704 -0.09877 +DEAL::-0.02469 0.003086 0.003086 0.003086 0.08642 -0.02469 -0.02469 0.003086 0.006173 -0.01235 0.006173 -0.01235 0.02469 0.006173 0.02469 0.006173 0.02469 0.006173 0.006173 -0.01235 -0.03704 0.03704 -0.03704 0.03704 0.03704 -0.03704 -0.09877 +DEAL::0.003086 -0.02469 0.003086 0.003086 -0.02469 0.08642 0.003086 -0.02469 -0.01235 0.006173 0.006173 -0.01235 0.006173 0.02469 0.02469 0.006173 0.006173 0.02469 -0.01235 0.006173 0.03704 -0.03704 -0.03704 0.03704 0.03704 -0.03704 -0.09877 +DEAL::0.003086 0.003086 -0.02469 0.003086 -0.02469 0.003086 0.08642 -0.02469 0.006173 -0.01235 -0.01235 0.006173 0.02469 0.006173 0.006173 0.02469 0.006173 -0.01235 0.02469 0.006173 -0.03704 0.03704 0.03704 -0.03704 0.03704 -0.03704 -0.09877 +DEAL::0.003086 0.003086 0.003086 -0.02469 0.003086 -0.02469 -0.02469 0.08642 -0.01235 0.006173 -0.01235 0.006173 0.006173 0.02469 0.006173 0.02469 -0.01235 0.006173 0.006173 0.02469 0.03704 -0.03704 0.03704 -0.03704 0.03704 -0.03704 -0.09877 +DEAL::0.02469 0.006173 0.02469 0.006173 0.006173 -0.01235 0.006173 -0.01235 0.2963 -0.07407 -0.03704 -0.03704 -0.07407 0 0.03704 0.03704 -0.03704 0.03704 -0.03704 0.03704 0.04938 0.04938 -0.09877 -0.09877 0.04938 0.04938 -0.1975 +DEAL::0.006173 0.02469 0.006173 0.02469 -0.01235 0.006173 -0.01235 0.006173 -0.07407 0.2963 -0.03704 -0.03704 0 -0.07407 0.03704 0.03704 0.03704 -0.03704 0.03704 -0.03704 0.04938 0.04938 -0.09877 -0.09877 0.04938 0.04938 -0.1975 +DEAL::0.02469 0.02469 0.006173 0.006173 0.006173 0.006173 -0.01235 -0.01235 -0.03704 -0.03704 0.2963 -0.07407 0.03704 0.03704 -0.07407 0 -0.03704 -0.03704 0.03704 0.03704 -0.09877 -0.09877 0.04938 0.04938 0.04938 0.04938 -0.1975 +DEAL::0.006173 0.006173 0.02469 0.02469 -0.01235 -0.01235 0.006173 0.006173 -0.03704 -0.03704 -0.07407 0.2963 0.03704 0.03704 0 -0.07407 0.03704 0.03704 -0.03704 -0.03704 -0.09877 -0.09877 0.04938 0.04938 0.04938 0.04938 -0.1975 +DEAL::0.006173 -0.01235 0.006173 -0.01235 0.02469 0.006173 0.02469 0.006173 -0.07407 0 0.03704 0.03704 0.2963 -0.07407 -0.03704 -0.03704 -0.03704 0.03704 -0.03704 0.03704 0.04938 0.04938 -0.09877 -0.09877 0.04938 0.04938 -0.1975 +DEAL::-0.01235 0.006173 -0.01235 0.006173 0.006173 0.02469 0.006173 0.02469 0 -0.07407 0.03704 0.03704 -0.07407 0.2963 -0.03704 -0.03704 0.03704 -0.03704 0.03704 -0.03704 0.04938 0.04938 -0.09877 -0.09877 0.04938 0.04938 -0.1975 +DEAL::0.006173 0.006173 -0.01235 -0.01235 0.02469 0.02469 0.006173 0.006173 0.03704 0.03704 -0.07407 0 -0.03704 -0.03704 0.2963 -0.07407 -0.03704 -0.03704 0.03704 0.03704 -0.09877 -0.09877 0.04938 0.04938 0.04938 0.04938 -0.1975 +DEAL::-0.01235 -0.01235 0.006173 0.006173 0.006173 0.006173 0.02469 0.02469 0.03704 0.03704 0 -0.07407 -0.03704 -0.03704 -0.07407 0.2963 0.03704 0.03704 -0.03704 -0.03704 -0.09877 -0.09877 0.04938 0.04938 0.04938 0.04938 -0.1975 +DEAL::0.02469 0.006173 0.006173 -0.01235 0.02469 0.006173 0.006173 -0.01235 -0.03704 0.03704 -0.03704 0.03704 -0.03704 0.03704 -0.03704 0.03704 0.2963 -0.07407 -0.07407 0 0.04938 0.04938 0.04938 0.04938 -0.09877 -0.09877 -0.1975 +DEAL::0.006173 0.02469 -0.01235 0.006173 0.006173 0.02469 -0.01235 0.006173 0.03704 -0.03704 -0.03704 0.03704 0.03704 -0.03704 -0.03704 0.03704 -0.07407 0.2963 0 -0.07407 0.04938 0.04938 0.04938 0.04938 -0.09877 -0.09877 -0.1975 +DEAL::0.006173 -0.01235 0.02469 0.006173 0.006173 -0.01235 0.02469 0.006173 -0.03704 0.03704 0.03704 -0.03704 -0.03704 0.03704 0.03704 -0.03704 -0.07407 0 0.2963 -0.07407 0.04938 0.04938 0.04938 0.04938 -0.09877 -0.09877 -0.1975 +DEAL::-0.01235 0.006173 0.006173 0.02469 -0.01235 0.006173 0.006173 0.02469 0.03704 -0.03704 0.03704 -0.03704 0.03704 -0.03704 0.03704 -0.03704 0 -0.07407 -0.07407 0.2963 0.04938 0.04938 0.04938 0.04938 -0.09877 -0.09877 -0.1975 +DEAL::-0.03704 0.03704 -0.03704 0.03704 -0.03704 0.03704 -0.03704 0.03704 0.04938 0.04938 -0.09877 -0.09877 0.04938 0.04938 -0.09877 -0.09877 0.04938 0.04938 0.04938 0.04938 0.9877 -0.1975 -0.1975 -0.1975 -0.1975 -0.1975 0 +DEAL::0.03704 -0.03704 0.03704 -0.03704 0.03704 -0.03704 0.03704 -0.03704 0.04938 0.04938 -0.09877 -0.09877 0.04938 0.04938 -0.09877 -0.09877 0.04938 0.04938 0.04938 0.04938 -0.1975 0.9877 -0.1975 -0.1975 -0.1975 -0.1975 0 +DEAL::-0.03704 -0.03704 0.03704 0.03704 -0.03704 -0.03704 0.03704 0.03704 -0.09877 -0.09877 0.04938 0.04938 -0.09877 -0.09877 0.04938 0.04938 0.04938 0.04938 0.04938 0.04938 -0.1975 -0.1975 0.9877 -0.1975 -0.1975 -0.1975 0 +DEAL::0.03704 0.03704 -0.03704 -0.03704 0.03704 0.03704 -0.03704 -0.03704 -0.09877 -0.09877 0.04938 0.04938 -0.09877 -0.09877 0.04938 0.04938 0.04938 0.04938 0.04938 0.04938 -0.1975 -0.1975 -0.1975 0.9877 -0.1975 -0.1975 0 +DEAL::-0.03704 -0.03704 -0.03704 -0.03704 0.03704 0.03704 0.03704 0.03704 0.04938 0.04938 0.04938 0.04938 0.04938 0.04938 0.04938 0.04938 -0.09877 -0.09877 -0.09877 -0.09877 -0.1975 -0.1975 -0.1975 -0.1975 0.9877 -0.1975 0 +DEAL::0.03704 0.03704 0.03704 0.03704 -0.03704 -0.03704 -0.03704 -0.03704 0.04938 0.04938 0.04938 0.04938 0.04938 0.04938 0.04938 0.04938 -0.09877 -0.09877 -0.09877 -0.09877 -0.1975 -0.1975 -0.1975 -0.1975 -0.1975 0.9877 0 +DEAL::-0.09877 -0.09877 -0.09877 -0.09877 -0.09877 -0.09877 -0.09877 -0.09877 -0.1975 -0.1975 -0.1975 -0.1975 -0.1975 -0.1975 -0.1975 -0.1975 -0.1975 -0.1975 -0.1975 -0.1975 0 0 0 0 0 0 3.160 diff --git a/tests/fe/cell_similarity_05.cc b/tests/fe/cell_similarity_05.cc new file mode 100644 index 0000000000..f79527aa4c --- /dev/null +++ b/tests/fe/cell_similarity_05.cc @@ -0,0 +1,174 @@ +//---------------------------------------------------------------------- +// $Id$ +// Version: $Name$ +// +// Copyright (C) 2009 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. +// +//---------------------------------------------------------------------- + + +// since early 2009, the FEValues objects try to be more efficient by only +// recomputing things like gradients of shape functions if the cell on which +// we are is not a translation of the previous one. in this series of tests we +// make sure that this actually works the way it's supposed to be; in +// particular, if we create a mesh of two identical cells but one has a curved +// boundary, then they are the same if we use a Q1 mapping, but not a Q2 +// mapping. so we test that the mass matrix we get from each of these cells is +// actually different in the latter case, but the same in the former +// +// the various tests cell_similarity_?? differ in the mappings and finite +// elements in use + + +#include "../tests.h" +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include + + +bool equal (const FullMatrix &m1, + const FullMatrix &m2) +{ + double d = 0, s = 0; + for (unsigned int i=0; i +void test (const Triangulation& tr) +{ + FE_Q fe(1); + deallog << "FE=" << fe.get_name() << std::endl; + + MappingQ mapping(2); + deallog << "Mapping=Q2" << std::endl; + + + DoFHandler dof(tr); + dof.distribute_dofs(fe); + + const QGauss quadrature(2); + FEValues fe_values (mapping, fe, quadrature, + update_values | update_gradients | + update_JxW_values); + + FullMatrix mass_matrix[2], laplace_matrix[2]; + mass_matrix[0].reinit(fe.dofs_per_cell, fe.dofs_per_cell); + mass_matrix[1].reinit(fe.dofs_per_cell, fe.dofs_per_cell); + laplace_matrix[0].reinit(fe.dofs_per_cell, fe.dofs_per_cell); + laplace_matrix[1].reinit(fe.dofs_per_cell, fe.dofs_per_cell); + + for (typename DoFHandler::active_cell_iterator + cell = dof.begin_active(); + cell != dof.end(); ++cell) + { + fe_values.reinit (cell); + + for (unsigned int i=0; iindex()](i,j) += fe_values.shape_value (i,q) * + fe_values.shape_value (j,q) * + fe_values.JxW(q); + laplace_matrix[cell->index()](i,j) += fe_values.shape_grad (i,q) * + fe_values.shape_grad (j,q) * + fe_values.JxW(q); + } + } + + // check what we expect for this mapping + // about equality or inequality of the + // matrices + deallog << "Mass matrices " + << (equal (mass_matrix[0], mass_matrix[1]) ? "are" : "are not") + << " equal." + << std::endl; + deallog << "Laplace matrices " + << (equal (laplace_matrix[0], laplace_matrix[1]) ? "are" : "are not") + << " equal." + << std::endl; + + for (unsigned int cell=0; cell<2; ++cell) + { + deallog << "cell=" << cell << std::endl; + deallog << "mass_matrix:" << std::endl; + for (unsigned int i=0; i +void test() +{ + Triangulation tr; + Point p1 = Point(); + Point p2 = (dim == 2 ? + Point(2,1) : + Point(2,1,1)); + std::vector subdivisions (dim, 1); + subdivisions[0] = 2; + GridGenerator::subdivided_hyper_rectangle(tr, subdivisions, p1, p2); + + static const HyperBallBoundary boundary; + tr.set_boundary (1, boundary); + + // set boundary id on cell 1 + for (unsigned int f=0; f::faces_per_cell; ++f) + if (tr.begin_active()->at_boundary(f)) + tr.begin_active()->face(f)->set_boundary_indicator (1); + + test(tr); +} + + +int main() +{ + std::ofstream logfile ("cell_similarity_05/output"); + deallog << std::setprecision (4); + + deallog.attach(logfile); + deallog.depth_console (0); + deallog.threshold_double(1.e-7); + + test<2>(); + test<3>(); +} diff --git a/tests/fe/cell_similarity_05/cmp/generic b/tests/fe/cell_similarity_05/cmp/generic new file mode 100644 index 0000000000..d4520f92e6 --- /dev/null +++ b/tests/fe/cell_similarity_05/cmp/generic @@ -0,0 +1,69 @@ + +DEAL::FE=FE_Q<2>(1) +DEAL::Mapping=Q2 +DEAL::Mass matrices are not equal. +DEAL::Laplace matrices are not equal. +DEAL::cell=0 +DEAL::mass_matrix: +DEAL::0.2371 0.07167 0.06719 0.02582 +DEAL::0.07167 0.04962 0.02582 0.03610 +DEAL::0.06719 0.02582 0.03170 0.03162 +DEAL::0.02582 0.03610 0.03162 0.09477 +DEAL::laplace_matrix: +DEAL::4.337 -0.2381 -2.153 -1.946 +DEAL::-0.2381 0.9387 -0.5940 -0.1066 +DEAL::-2.153 -0.5940 1.899 0.8483 +DEAL::-1.946 -0.1066 0.8483 1.205 +DEAL::cell=1 +DEAL::mass_matrix: +DEAL::0.1111 0.05556 0.05556 0.02778 +DEAL::0.05556 0.1111 0.02778 0.05556 +DEAL::0.05556 0.02778 0.1111 0.05556 +DEAL::0.02778 0.05556 0.05556 0.1111 +DEAL::laplace_matrix: +DEAL::0.6667 -0.1667 -0.1667 -0.3333 +DEAL::-0.1667 0.6667 -0.3333 -0.1667 +DEAL::-0.1667 -0.3333 0.6667 -0.1667 +DEAL::-0.3333 -0.1667 -0.1667 0.6667 +DEAL::FE=FE_Q<3>(1) +DEAL::Mapping=Q2 +DEAL::Mass matrices are not equal. +DEAL::Laplace matrices are not equal. +DEAL::cell=0 +DEAL::mass_matrix: +DEAL::0.07572 0.02718 0.02414 0.009471 0.02414 0.009471 0.008538 0.003898 +DEAL::0.02718 0.03298 0.009471 0.01375 0.009471 0.01375 0.003898 0.007053 +DEAL::0.02414 0.009471 0.02083 0.01071 0.008538 0.003898 0.01001 0.006119 +DEAL::0.009471 0.01375 0.01071 0.02201 0.003898 0.007053 0.006119 0.01447 +DEAL::0.02414 0.009471 0.008538 0.003898 0.02083 0.01071 0.01001 0.006119 +DEAL::0.009471 0.01375 0.003898 0.007053 0.01071 0.02201 0.006119 0.01447 +DEAL::0.008538 0.003898 0.01001 0.006119 0.01001 0.006119 0.01922 0.01377 +DEAL::0.003898 0.007053 0.006119 0.01447 0.006119 0.01447 0.01377 0.03585 +DEAL::laplace_matrix: +DEAL::0.7840 0.04931 0.04652 -0.2138 0.04652 -0.2138 -0.2672 -0.2315 +DEAL::0.04931 0.3584 -0.04035 -0.04210 -0.04035 -0.04210 -0.09114 -0.1517 +DEAL::0.04652 -0.04035 0.2547 0.006678 -0.03606 -0.07879 -0.03423 -0.1051 +DEAL::-0.2138 -0.04210 0.006678 0.3292 -0.07879 -0.05266 0.002197 0.06269 +DEAL::0.04652 -0.04035 -0.03606 -0.07879 0.2547 0.006678 -0.03423 -0.1051 +DEAL::-0.2138 -0.04210 -0.07879 -0.05266 0.006678 0.3292 0.002197 0.06269 +DEAL::-0.2672 -0.09114 -0.03423 0.002197 -0.03423 0.002197 0.3052 0.1173 +DEAL::-0.2315 -0.1517 -0.1051 0.06269 -0.1051 0.06269 0.1173 0.3509 +DEAL::cell=1 +DEAL::mass_matrix: +DEAL::0.03704 0.01852 0.01852 0.009259 0.01852 0.009259 0.009259 0.004630 +DEAL::0.01852 0.03704 0.009259 0.01852 0.009259 0.01852 0.004630 0.009259 +DEAL::0.01852 0.009259 0.03704 0.01852 0.009259 0.004630 0.01852 0.009259 +DEAL::0.009259 0.01852 0.01852 0.03704 0.004630 0.009259 0.009259 0.01852 +DEAL::0.01852 0.009259 0.009259 0.004630 0.03704 0.01852 0.01852 0.009259 +DEAL::0.009259 0.01852 0.004630 0.009259 0.01852 0.03704 0.009259 0.01852 +DEAL::0.009259 0.004630 0.01852 0.009259 0.01852 0.009259 0.03704 0.01852 +DEAL::0.004630 0.009259 0.009259 0.01852 0.009259 0.01852 0.01852 0.03704 +DEAL::laplace_matrix: +DEAL::0.3333 0 0 -0.08333 0 -0.08333 -0.08333 -0.08333 +DEAL::0 0.3333 -0.08333 0 -0.08333 0 -0.08333 -0.08333 +DEAL::0 -0.08333 0.3333 0 -0.08333 -0.08333 0 -0.08333 +DEAL::-0.08333 0 0 0.3333 -0.08333 -0.08333 -0.08333 0 +DEAL::0 -0.08333 -0.08333 -0.08333 0.3333 0 0 -0.08333 +DEAL::-0.08333 0 -0.08333 -0.08333 0 0.3333 -0.08333 0 +DEAL::-0.08333 -0.08333 0 -0.08333 0 -0.08333 0.3333 0 +DEAL::-0.08333 -0.08333 -0.08333 0 -0.08333 0 0 0.3333 diff --git a/tests/fe/cell_similarity_06.cc b/tests/fe/cell_similarity_06.cc new file mode 100644 index 0000000000..2059773b33 --- /dev/null +++ b/tests/fe/cell_similarity_06.cc @@ -0,0 +1,174 @@ +//---------------------------------------------------------------------- +// $Id$ +// Version: $Name$ +// +// Copyright (C) 2009 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. +// +//---------------------------------------------------------------------- + + +// since early 2009, the FEValues objects try to be more efficient by only +// recomputing things like gradients of shape functions if the cell on which +// we are is not a translation of the previous one. in this series of tests we +// make sure that this actually works the way it's supposed to be; in +// particular, if we create a mesh of two identical cells but one has a curved +// boundary, then they are the same if we use a Q1 mapping, but not a Q2 +// mapping. so we test that the mass matrix we get from each of these cells is +// actually different in the latter case, but the same in the former +// +// the various tests cell_similarity_?? differ in the mappings and finite +// elements in use + + +#include "../tests.h" +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include + + +bool equal (const FullMatrix &m1, + const FullMatrix &m2) +{ + double d = 0, s = 0; + for (unsigned int i=0; i +void test (const Triangulation& tr) +{ + FE_Q fe(2); + deallog << "FE=" << fe.get_name() << std::endl; + + MappingQ mapping(2); + deallog << "Mapping=Q2" << std::endl; + + + DoFHandler dof(tr); + dof.distribute_dofs(fe); + + const QGauss quadrature(2); + FEValues fe_values (mapping, fe, quadrature, + update_values | update_gradients | + update_JxW_values); + + FullMatrix mass_matrix[2], laplace_matrix[2]; + mass_matrix[0].reinit(fe.dofs_per_cell, fe.dofs_per_cell); + mass_matrix[1].reinit(fe.dofs_per_cell, fe.dofs_per_cell); + laplace_matrix[0].reinit(fe.dofs_per_cell, fe.dofs_per_cell); + laplace_matrix[1].reinit(fe.dofs_per_cell, fe.dofs_per_cell); + + for (typename DoFHandler::active_cell_iterator + cell = dof.begin_active(); + cell != dof.end(); ++cell) + { + fe_values.reinit (cell); + + for (unsigned int i=0; iindex()](i,j) += fe_values.shape_value (i,q) * + fe_values.shape_value (j,q) * + fe_values.JxW(q); + laplace_matrix[cell->index()](i,j) += fe_values.shape_grad (i,q) * + fe_values.shape_grad (j,q) * + fe_values.JxW(q); + } + } + + // check what we expect for this mapping + // about equality or inequality of the + // matrices + deallog << "Mass matrices " + << (equal (mass_matrix[0], mass_matrix[1]) ? "are" : "are not") + << " equal." + << std::endl; + deallog << "Laplace matrices " + << (equal (laplace_matrix[0], laplace_matrix[1]) ? "are" : "are not") + << " equal." + << std::endl; + + for (unsigned int cell=0; cell<2; ++cell) + { + deallog << "cell=" << cell << std::endl; + deallog << "mass_matrix:" << std::endl; + for (unsigned int i=0; i +void test() +{ + Triangulation tr; + Point p1 = Point(); + Point p2 = (dim == 2 ? + Point(2,1) : + Point(2,1,1)); + std::vector subdivisions (dim, 1); + subdivisions[0] = 2; + GridGenerator::subdivided_hyper_rectangle(tr, subdivisions, p1, p2); + + static const HyperBallBoundary boundary; + tr.set_boundary (1, boundary); + + // set boundary id on cell 1 + for (unsigned int f=0; f::faces_per_cell; ++f) + if (tr.begin_active()->at_boundary(f)) + tr.begin_active()->face(f)->set_boundary_indicator (1); + + test(tr); +} + + +int main() +{ + std::ofstream logfile ("cell_similarity_06/output"); + deallog << std::setprecision (4); + + deallog.attach(logfile); + deallog.depth_console (0); + deallog.threshold_double(1.e-7); + + test<2>(); + test<3>(); +} diff --git a/tests/fe/cell_similarity_06/cmp/generic b/tests/fe/cell_similarity_06/cmp/generic new file mode 100644 index 0000000000..4e51b02e85 --- /dev/null +++ b/tests/fe/cell_similarity_06/cmp/generic @@ -0,0 +1,165 @@ + +DEAL::FE=FE_Q<2>(2) +DEAL::Mapping=Q2 +DEAL::Mass matrices are not equal. +DEAL::Laplace matrices are not equal. +DEAL::cell=0 +DEAL::mass_matrix: +DEAL::0.02634 0.007964 0.007466 0.002869 0.03775 -0.01019 0.03675 0.009193 0.05512 +DEAL::0.007964 0.005514 0.002869 0.004011 -0.01019 0.003005 0.004900 0.002283 -0.01437 +DEAL::0.007466 0.002869 0.003522 0.003513 0.007887 0.001288 0.009193 1.858e-05 -0.01835 +DEAL::0.002869 0.004011 0.003513 0.01053 0.001288 0.01304 0.002283 0.01403 0.02350 +DEAL::0.03775 -0.01019 0.007887 0.001288 0.05973 -0.02295 0.05512 -0.01835 0.07355 +DEAL::-0.01019 0.003005 0.001288 0.01304 -0.02295 0.03209 -0.01437 0.02350 0.01827 +DEAL::0.03675 0.004900 0.009193 0.002283 0.05512 -0.01437 0.06371 -0.02295 0.08151 +DEAL::0.009193 0.002283 1.858e-05 0.01403 -0.01835 0.02350 -0.02295 0.02810 0.01030 +DEAL::0.05512 -0.01437 -0.01835 0.02350 0.07355 0.01827 0.08151 0.01030 0.1836 +DEAL::laplace_matrix: +DEAL::1.086 0.0007442 0.2950 -0.2162 -0.5114 0.5990 0.007372 1.084 -2.328 +DEAL::0.0007442 0.7950 -0.06600 -0.2749 0.1645 1.362 -1.277 0.2042 -0.9067 +DEAL::0.2950 -0.06600 2.485 -0.9357 -4.333 0.8656 0.1882 5.057 -3.557 +DEAL::-0.2162 -0.2749 -0.9357 0.9632 1.633 -0.8646 0.5105 -1.743 0.9273 +DEAL::-0.5114 0.1645 -4.333 1.633 7.947 -1.400 -0.5993 -8.994 6.093 +DEAL::0.5990 1.362 0.8656 -0.8646 -1.400 4.384 -2.653 1.631 -3.923 +DEAL::0.007372 -1.277 0.1882 0.5105 -0.5993 -2.653 2.792 -0.1247 1.171 +DEAL::1.084 0.2042 5.057 -1.743 -8.994 1.631 -0.1247 12.09 -9.205 +DEAL::-2.328 -0.9067 -3.557 0.9273 6.093 -3.923 1.171 -9.205 11.73 +DEAL::cell=1 +DEAL::mass_matrix: +DEAL::0.01235 0.006173 0.006173 0.003086 0.01235 0.006173 0.01235 0.006173 0.01235 +DEAL::0.006173 0.01235 0.003086 0.006173 0.006173 0.01235 0.01235 0.006173 0.01235 +DEAL::0.006173 0.003086 0.01235 0.006173 0.01235 0.006173 0.006173 0.01235 0.01235 +DEAL::0.003086 0.006173 0.006173 0.01235 0.006173 0.01235 0.006173 0.01235 0.01235 +DEAL::0.01235 0.006173 0.01235 0.006173 0.04938 -0.02469 0.01235 0.01235 0.04938 +DEAL::0.006173 0.01235 0.006173 0.01235 -0.02469 0.04938 0.01235 0.01235 0.04938 +DEAL::0.01235 0.01235 0.006173 0.006173 0.01235 0.01235 0.04938 -0.02469 0.04938 +DEAL::0.006173 0.006173 0.01235 0.01235 0.01235 0.01235 -0.02469 0.04938 0.04938 +DEAL::0.01235 0.01235 0.01235 0.01235 0.04938 0.04938 0.04938 0.04938 0.1975 +DEAL::laplace_matrix: +DEAL::0.5185 -0.09259 -0.09259 -0.03704 -0.03704 0.1852 -0.03704 0.1852 -0.5926 +DEAL::-0.09259 0.5185 -0.03704 -0.09259 0.1852 -0.03704 -0.03704 0.1852 -0.5926 +DEAL::-0.09259 -0.03704 0.5185 -0.09259 -0.03704 0.1852 0.1852 -0.03704 -0.5926 +DEAL::-0.03704 -0.09259 -0.09259 0.5185 0.1852 -0.03704 0.1852 -0.03704 -0.5926 +DEAL::-0.03704 0.1852 -0.03704 0.1852 1.630 -0.1481 -0.5926 -0.5926 -0.5926 +DEAL::0.1852 -0.03704 0.1852 -0.03704 -0.1481 1.630 -0.5926 -0.5926 -0.5926 +DEAL::-0.03704 -0.03704 0.1852 0.1852 -0.5926 -0.5926 1.630 -0.1481 -0.5926 +DEAL::0.1852 0.1852 -0.03704 -0.03704 -0.5926 -0.5926 -0.1481 1.630 -0.5926 +DEAL::-0.5926 -0.5926 -0.5926 -0.5926 -0.5926 -0.5926 -0.5926 -0.5926 4.741 +DEAL::FE=FE_Q<3>(2) +DEAL::Mapping=Q2 +DEAL::Mass matrices are not equal. +DEAL::Laplace matrices are not equal. +DEAL::cell=0 +DEAL::mass_matrix: +DEAL::0.002805 0.001006 0.0008940 0.0003508 0.0008940 0.0003508 0.0003162 0.0001444 0.003821 0.001311 0.003596 0.001086 0.001156 0.0004129 0.001086 0.0003437 0.003821 0.001311 0.001156 0.0004129 0.005331 0.001797 0.005020 0.001485 0.005020 0.001485 0.007068 +DEAL::0.001006 0.001221 0.0003508 0.0005092 0.0003508 0.0005092 0.0001444 0.0002612 0.001311 0.001424 0.0004298 0.0003167 0.0004129 0.0004958 0.0003167 0.0002337 0.001311 0.001424 0.0004129 0.0004958 0.001797 0.001857 0.0002261 0.0001660 0.0002261 0.0001660 0.0001202 +DEAL::0.0008940 0.0003508 0.0007714 0.0003967 0.0003162 0.0001444 0.0003708 0.0002266 0.0002452 -9.174e-05 0.001086 0.0007495 0.0001092 0.0001646 0.0003437 0.0002883 0.001156 0.0004129 0.0008012 0.0003400 0.0007088 0.0001457 0.001485 0.0009223 0.0006739 0.0001107 0.001126 +DEAL::0.0003508 0.0005092 0.0003967 0.0008152 0.0001444 0.0002612 0.0002266 0.0005358 -9.174e-05 0.0006122 0.0003167 0.0008371 0.0001646 0.0005491 0.0002337 0.0006182 0.0004129 0.0004958 0.0003400 0.0005589 0.0001457 0.0001262 0.0001660 0.0004378 0.001041 0.0007690 0.0005436 +DEAL::0.0008940 0.0003508 0.0003162 0.0001444 0.0007714 0.0003967 0.0003708 0.0002266 0.001156 0.0004129 0.001086 0.0003437 0.0008012 0.0003400 0.0007495 0.0002883 0.0002452 -9.174e-05 0.0001092 0.0001646 0.0007088 0.0001457 0.0006739 0.0001107 0.001485 0.0009223 0.001126 +DEAL::0.0003508 0.0005092 0.0001444 0.0002612 0.0003967 0.0008152 0.0002266 0.0005358 0.0004129 0.0004958 0.0003167 0.0002337 0.0003400 0.0005589 0.0008371 0.0006182 -9.174e-05 0.0006122 0.0001646 0.0005491 0.0001457 0.0001262 0.001041 0.0007690 0.0001660 0.0004378 0.0005436 +DEAL::0.0003162 0.0001444 0.0003708 0.0002266 0.0003708 0.0002266 0.0007118 0.0005099 0.0001092 0.0001646 0.0003437 0.0002883 0.0006821 0.0005666 0.0002883 0.0004038 0.0001092 0.0001646 0.0006821 0.0005666 0.001146 0.0008040 0.0001107 0.0002310 0.0001107 0.0002310 0.0006834 +DEAL::0.0001444 0.0002612 0.0002266 0.0005358 0.0002266 0.0005358 0.0005099 0.001328 0.0001646 0.0005491 0.0002337 0.0006182 0.0005666 0.001584 0.0006182 0.001636 0.0001646 0.0005491 0.0005666 0.001584 0.0008040 0.002070 0.0007690 0.002035 0.0007690 0.002035 0.002532 +DEAL::0.003821 0.001311 0.0002452 -9.174e-05 0.001156 0.0004129 0.0001092 0.0001646 0.007152 0.002806 0.005020 0.0006739 0.002530 0.001155 0.001485 0.0001107 0.005331 0.001797 0.0007088 0.0001457 0.009245 0.003303 0.007068 0.001126 0.008691 0.002750 0.01188 +DEAL::0.001311 0.001424 -9.174e-05 0.0006122 0.0004129 0.0004958 0.0001646 0.0005491 0.002806 0.004073 0.0002261 0.001041 0.001155 0.002090 0.0001660 0.0007690 0.001797 0.001857 0.0001457 0.0001262 0.003303 0.003967 0.0001202 0.0005436 0.002534 0.001870 0.001328 +DEAL::0.003596 0.0004298 0.001086 0.0003167 0.001086 0.0003167 0.0003437 0.0002337 0.005020 0.0002261 0.008052 0.002806 0.001485 0.0001660 0.002806 0.001155 0.005020 0.0002261 0.001485 0.0001660 0.007068 0.0001202 0.01049 0.003303 0.01049 0.003303 0.01438 +DEAL::0.001086 0.0003167 0.0007495 0.0008371 0.0003437 0.0002337 0.0002883 0.0006182 0.0006739 0.001041 0.002806 0.003173 0.0001107 0.0007690 0.001155 0.001813 0.001485 0.0001660 0.0009223 0.0004378 0.001126 0.0005436 0.003303 0.002720 0.0007339 0.001317 0.001165 +DEAL::0.001156 0.0004129 0.0001092 0.0001646 0.0008012 0.0003400 0.0006821 0.0005666 0.002530 0.001155 0.001485 0.0001107 0.002967 0.001813 0.0009223 0.0002310 0.0007088 0.0001457 0.001146 0.0008040 0.0008737 0.001317 0.001126 0.0006834 0.002750 0.002307 0.0008857 +DEAL::0.0004129 0.0004958 0.0001646 0.0005491 0.0003400 0.0005589 0.0005666 0.001584 0.001155 0.002090 0.0001660 0.0007690 0.001813 0.004286 0.0004378 0.002035 0.0001457 0.0001262 0.0008040 0.002070 0.001317 0.004393 0.0005436 0.002532 0.001870 0.004946 0.006152 +DEAL::0.001086 0.0003167 0.0003437 0.0002337 0.0007495 0.0008371 0.0002883 0.0006182 0.001485 0.0001660 0.002806 0.001155 0.0009223 0.0004378 0.003173 0.001813 0.0006739 0.001041 0.0001107 0.0007690 0.001126 0.0005436 0.0007339 0.001317 0.003303 0.002720 0.001165 +DEAL::0.0003437 0.0002337 0.0002883 0.0006182 0.0002883 0.0006182 0.0004038 0.001636 0.0001107 0.0007690 0.001155 0.001813 0.0002310 0.002035 0.001813 0.004079 0.0001107 0.0007690 0.0002310 0.002035 0.0006834 0.002532 0.001317 0.004532 0.001317 0.004532 0.006432 +DEAL::0.003821 0.001311 0.001156 0.0004129 0.0002452 -9.174e-05 0.0001092 0.0001646 0.005331 0.001797 0.005020 0.001485 0.0007088 0.0001457 0.0006739 0.0001107 0.007152 0.002806 0.002530 0.001155 0.009245 0.003303 0.008691 0.002750 0.007068 0.001126 0.01188 +DEAL::0.001311 0.001424 0.0004129 0.0004958 -9.174e-05 0.0006122 0.0001646 0.0005491 0.001797 0.001857 0.0002261 0.0001660 0.0001457 0.0001262 0.001041 0.0007690 0.002806 0.004073 0.001155 0.002090 0.003303 0.003967 0.002534 0.001870 0.0001202 0.0005436 0.001328 +DEAL::0.001156 0.0004129 0.0008012 0.0003400 0.0001092 0.0001646 0.0006821 0.0005666 0.0007088 0.0001457 0.001485 0.0009223 0.001146 0.0008040 0.0001107 0.0002310 0.002530 0.001155 0.002967 0.001813 0.0008737 0.001317 0.002750 0.002307 0.001126 0.0006834 0.0008857 +DEAL::0.0004129 0.0004958 0.0003400 0.0005589 0.0001646 0.0005491 0.0005666 0.001584 0.0001457 0.0001262 0.0001660 0.0004378 0.0008040 0.002070 0.0007690 0.002035 0.001155 0.002090 0.001813 0.004286 0.001317 0.004393 0.001870 0.004946 0.0005436 0.002532 0.006152 +DEAL::0.005331 0.001797 0.0007088 0.0001457 0.0007088 0.0001457 0.001146 0.0008040 0.009245 0.003303 0.007068 0.001126 0.0008737 0.001317 0.001126 0.0006834 0.009245 0.003303 0.0008737 0.001317 0.02024 0.009239 0.01188 0.0008857 0.01188 0.0008857 0.02200 +DEAL::0.001797 0.001857 0.0001457 0.0001262 0.0001457 0.0001262 0.0008040 0.002070 0.003303 0.003967 0.0001202 0.0005436 0.001317 0.004393 0.0005436 0.002532 0.003303 0.003967 0.001317 0.004393 0.009239 0.01672 0.001328 0.006152 0.001328 0.006152 0.01496 +DEAL::0.005020 0.0002261 0.001485 0.0001660 0.0006739 0.001041 0.0001107 0.0007690 0.007068 0.0001202 0.01049 0.003303 0.001126 0.0005436 0.0007339 0.001317 0.008691 0.002534 0.002750 0.001870 0.01188 0.001328 0.02245 0.009239 0.01438 0.001165 0.02642 +DEAL::0.001485 0.0001660 0.0009223 0.0004378 0.0001107 0.0007690 0.0002310 0.002035 0.001126 0.0005436 0.003303 0.002720 0.0006834 0.002532 0.001317 0.004532 0.002750 0.001870 0.002307 0.004946 0.0008857 0.006152 0.009239 0.01451 0.001165 0.006432 0.01053 +DEAL::0.005020 0.0002261 0.0006739 0.001041 0.001485 0.0001660 0.0001107 0.0007690 0.008691 0.002534 0.01049 0.0007339 0.002750 0.001870 0.003303 0.001317 0.007068 0.0001202 0.001126 0.0005436 0.01188 0.001328 0.01438 0.001165 0.02245 0.009239 0.02642 +DEAL::0.001485 0.0001660 0.0001107 0.0007690 0.0009223 0.0004378 0.0002310 0.002035 0.002750 0.001870 0.003303 0.001317 0.002307 0.004946 0.002720 0.004532 0.001126 0.0005436 0.0006834 0.002532 0.0008857 0.006152 0.001165 0.006432 0.009239 0.01451 0.01053 +DEAL::0.007068 0.0001202 0.001126 0.0005436 0.001126 0.0005436 0.0006834 0.002532 0.01188 0.001328 0.01438 0.001165 0.0008857 0.006152 0.001165 0.006432 0.01188 0.001328 0.0008857 0.006152 0.02200 0.01496 0.02642 0.01053 0.02642 0.01053 0.07391 +DEAL::laplace_matrix: +DEAL::0.1223 -0.02510 -0.02189 0.004440 -0.02189 0.004440 0.007037 0.008576 0.003618 0.02415 0.03501 0.03319 0.03974 -0.03097 0.03319 -0.03628 0.003618 0.02415 0.03974 -0.03097 -0.1124 0.07432 -0.09148 0.1105 -0.09148 0.1105 -0.1842 +DEAL::-0.02510 0.07092 0.001985 -0.01598 0.001985 -0.01598 0.003376 0.0004581 0.01110 0.03551 -0.01101 0.005215 -0.01450 0.004161 0.005215 0.006985 0.01110 0.03551 -0.01450 0.004161 0.05741 0.001033 -0.04566 0.01644 -0.04566 0.01644 -0.08662 +DEAL::-0.02189 0.001985 0.04248 -0.01479 0.001524 0.002918 -0.01102 0.002675 -0.01389 0.007057 0.004571 0.01056 0.004751 0.006585 -0.01162 0.006568 0.009976 -0.01115 0.01120 0.0002068 -0.02030 0.007905 0.04543 -0.02033 -0.01455 0.001842 -0.01554 +DEAL::0.004440 -0.01598 -0.01479 0.07667 0.002918 0.004126 0.006650 -0.02826 0.04541 -0.02951 0.02800 0.002700 -0.01581 0.01779 -0.01291 0.005728 0.009973 -0.01478 -0.02203 0.08609 0.03381 -0.02704 0.03418 -0.01614 -0.07265 0.04785 -0.1076 +DEAL::-0.02189 0.001985 0.001524 0.002918 0.04248 -0.01479 -0.01102 0.002675 0.009976 -0.01115 0.004571 -0.01162 0.01120 0.0002068 0.01056 0.006568 -0.01389 0.007057 0.004751 0.006585 -0.02030 0.007905 -0.01455 0.001842 0.04543 -0.02033 -0.01554 +DEAL::0.004440 -0.01598 0.002918 0.004126 -0.01479 0.07667 0.006650 -0.02826 0.009973 -0.01478 0.02800 -0.01291 -0.02203 0.08609 0.002700 0.005728 0.04541 -0.02951 -0.01581 0.01779 0.03381 -0.02704 -0.07265 0.04785 0.03418 -0.01614 -0.1076 +DEAL::0.007037 0.003376 -0.01102 0.006650 -0.01102 0.006650 0.06586 -0.03138 0.04348 -0.01612 0.008973 -0.01943 -0.02107 0.01333 -0.01943 0.07482 0.04348 -0.01612 -0.02107 0.01333 -0.05751 0.04770 0.03004 -0.02514 0.03004 -0.02514 -0.08832 +DEAL::0.008576 0.0004581 0.002675 -0.02826 0.002675 -0.02826 -0.03138 0.07699 -0.03084 0.02819 -0.02128 0.01153 0.02290 -0.02252 0.01153 0.01321 -0.03084 0.02819 0.02290 -0.02252 0.03804 -0.06107 0.04139 -0.02988 0.04139 -0.02988 -0.01392 +DEAL::0.003618 0.01110 -0.01389 0.04541 0.009976 0.009973 0.04348 -0.03084 0.6490 -0.1225 -0.06429 -0.2163 -0.1058 0.001276 0.03880 0.1274 -0.07986 0.04251 -0.2259 0.1347 0.3024 0.04412 -0.1845 -0.5367 0.3069 0.06781 -0.2355 +DEAL::0.02415 0.03551 0.007057 -0.02951 -0.01115 -0.01478 -0.01612 0.02819 -0.1225 0.2567 -0.1229 0.03239 0.01952 -0.09283 0.03694 0.02095 0.04251 0.06188 0.05513 -0.1177 -0.02646 0.1383 -0.09797 0.02299 -0.06148 0.02457 -0.09341 +DEAL::0.03501 -0.01101 0.004571 0.02800 0.004571 0.02800 0.008973 -0.02128 -0.06429 -0.1229 0.4409 -0.06362 0.04406 0.08174 -0.06362 -0.01426 -0.06429 -0.1229 0.04406 0.08174 -0.2217 -0.2593 0.1539 0.08656 0.1539 0.08656 -0.2355 +DEAL::0.03319 0.005215 0.01056 0.002700 -0.01162 -0.01291 -0.01943 0.01153 -0.2163 0.03239 -0.06362 0.2454 0.04984 0.02203 0.01020 -0.1216 0.03880 0.03694 0.09868 -0.07506 -0.1088 0.006450 -0.01085 0.2734 -0.2110 0.05071 -0.07694 +DEAL::0.03974 -0.01450 0.004751 -0.01581 0.01120 -0.02203 -0.02107 0.02290 -0.1058 0.01952 0.04406 0.04984 0.2627 -0.1341 0.09868 -0.1141 -0.2259 0.05513 0.04674 0.01868 -0.1829 0.03635 -0.1136 0.03918 -0.04142 0.2624 -0.02070 +DEAL::-0.03097 0.004161 0.006585 0.01779 0.0002068 0.08609 0.01333 -0.02252 0.001276 -0.09283 0.08174 0.02203 -0.1341 0.4592 -0.07506 -0.04238 0.1347 -0.1177 0.01868 -0.06856 0.1322 0.01819 -0.1906 -0.1486 0.08174 0.1070 -0.2460 +DEAL::0.03319 0.005215 -0.01162 -0.01291 0.01056 0.002700 -0.01943 0.01153 0.03880 0.03694 -0.06362 0.01020 0.09868 -0.07506 0.2454 -0.1216 -0.2163 0.03239 0.04984 0.02203 -0.1088 0.006450 -0.2110 0.05071 -0.01085 0.2734 -0.07694 +DEAL::-0.03628 0.006985 0.006568 0.005728 0.006568 0.005728 0.07482 0.01321 0.1274 0.02095 -0.01426 -0.1216 -0.1141 -0.04238 -0.1216 0.4818 0.1274 0.02095 -0.1141 -0.04238 -0.1536 -0.1565 0.1490 0.006050 0.1490 0.006050 -0.2774 +DEAL::0.003618 0.01110 0.009976 0.009973 -0.01389 0.04541 0.04348 -0.03084 -0.07986 0.04251 -0.06429 0.03880 -0.2259 0.1347 -0.2163 0.1274 0.6490 -0.1225 -0.1058 0.001276 0.3024 0.04412 0.3069 0.06781 -0.1845 -0.5367 -0.2355 +DEAL::0.02415 0.03551 -0.01115 -0.01478 0.007057 -0.02951 -0.01612 0.02819 0.04251 0.06188 -0.1229 0.03694 0.05513 -0.1177 0.03239 0.02095 -0.1225 0.2567 0.01952 -0.09283 -0.02646 0.1383 -0.06148 0.02457 -0.09797 0.02299 -0.09341 +DEAL::0.03974 -0.01450 0.01120 -0.02203 0.004751 -0.01581 -0.02107 0.02290 -0.2259 0.05513 0.04406 0.09868 0.04674 0.01868 0.04984 -0.1141 -0.1058 0.01952 0.2627 -0.1341 -0.1829 0.03635 -0.04142 0.2624 -0.1136 0.03918 -0.02070 +DEAL::-0.03097 0.004161 0.0002068 0.08609 0.006585 0.01779 0.01333 -0.02252 0.1347 -0.1177 0.08174 -0.07506 0.01868 -0.06856 0.02203 -0.04238 0.001276 -0.09283 -0.1341 0.4592 0.1322 0.01819 0.08174 0.1070 -0.1906 -0.1486 -0.2460 +DEAL::-0.1124 0.05741 -0.02030 0.03381 -0.02030 0.03381 -0.05751 0.03804 0.3024 -0.02646 -0.2217 -0.1088 -0.1829 0.1322 -0.1088 -0.1536 0.3024 -0.02646 -0.1829 0.1322 1.320 -0.2294 0.05689 -0.6022 0.05689 -0.6022 0.1898 +DEAL::0.07432 0.001033 0.007905 -0.02704 0.007905 -0.02704 0.04770 -0.06107 0.04412 0.1383 -0.2593 0.006450 0.03635 0.01819 0.006450 -0.1565 0.04412 0.1383 0.03635 0.01819 -0.2294 1.083 -0.3656 -0.06094 -0.3656 -0.06094 -0.09484 +DEAL::-0.09148 -0.04566 0.04543 0.03418 -0.01455 -0.07265 0.03004 0.04139 -0.1845 -0.09797 0.1539 -0.01085 -0.1136 -0.1906 -0.2110 0.1490 0.3069 -0.06148 -0.04142 0.08174 0.05689 -0.3656 1.274 -0.2473 -0.04871 -0.6694 0.2932 +DEAL::0.1105 0.01644 -0.02033 -0.01614 0.001842 0.04785 -0.02514 -0.02988 -0.5367 0.02299 0.08656 0.2734 0.03918 -0.1486 0.05071 0.006050 0.06781 0.02457 0.2624 0.1070 -0.6022 -0.06094 -0.2473 1.664 -0.6694 -0.08390 -0.3407 +DEAL::-0.09148 -0.04566 -0.01455 -0.07265 0.04543 0.03418 0.03004 0.04139 0.3069 -0.06148 0.1539 -0.2110 -0.04142 0.08174 -0.01085 0.1490 -0.1845 -0.09797 -0.1136 -0.1906 0.05689 -0.3656 -0.04871 -0.6694 1.274 -0.2473 0.2932 +DEAL::0.1105 0.01644 0.001842 0.04785 -0.02033 -0.01614 -0.02514 -0.02988 0.06781 0.02457 0.08656 0.05071 0.2624 0.1070 0.2734 0.006050 -0.5367 0.02299 0.03918 -0.1486 -0.6022 -0.06094 -0.6694 -0.08390 -0.2473 1.664 -0.3407 +DEAL::-0.1842 -0.08662 -0.01554 -0.1076 -0.01554 -0.1076 -0.08832 -0.01392 -0.2355 -0.09341 -0.2355 -0.07694 -0.02070 -0.2460 -0.07694 -0.2774 -0.2355 -0.09341 -0.02070 -0.2460 0.1898 -0.09484 0.2932 -0.3407 0.2932 -0.3407 2.477 +DEAL::cell=1 +DEAL::mass_matrix: +DEAL::0.001372 0.0006859 0.0006859 0.0003429 0.0006859 0.0003429 0.0003429 0.0001715 0.001372 0.0006859 0.001372 0.0006859 0.0006859 0.0003429 0.0006859 0.0003429 0.001372 0.0006859 0.0006859 0.0003429 0.001372 0.0006859 0.001372 0.0006859 0.001372 0.0006859 0.001372 +DEAL::0.0006859 0.001372 0.0003429 0.0006859 0.0003429 0.0006859 0.0001715 0.0003429 0.0006859 0.001372 0.001372 0.0006859 0.0003429 0.0006859 0.0006859 0.0003429 0.0006859 0.001372 0.0003429 0.0006859 0.0006859 0.001372 0.001372 0.0006859 0.001372 0.0006859 0.001372 +DEAL::0.0006859 0.0003429 0.001372 0.0006859 0.0003429 0.0001715 0.0006859 0.0003429 0.001372 0.0006859 0.0006859 0.001372 0.0006859 0.0003429 0.0003429 0.0006859 0.0006859 0.0003429 0.001372 0.0006859 0.001372 0.0006859 0.0006859 0.001372 0.001372 0.0006859 0.001372 +DEAL::0.0003429 0.0006859 0.0006859 0.001372 0.0001715 0.0003429 0.0003429 0.0006859 0.0006859 0.001372 0.0006859 0.001372 0.0003429 0.0006859 0.0003429 0.0006859 0.0003429 0.0006859 0.0006859 0.001372 0.0006859 0.001372 0.0006859 0.001372 0.001372 0.0006859 0.001372 +DEAL::0.0006859 0.0003429 0.0003429 0.0001715 0.001372 0.0006859 0.0006859 0.0003429 0.0006859 0.0003429 0.0006859 0.0003429 0.001372 0.0006859 0.001372 0.0006859 0.001372 0.0006859 0.0006859 0.0003429 0.001372 0.0006859 0.001372 0.0006859 0.0006859 0.001372 0.001372 +DEAL::0.0003429 0.0006859 0.0001715 0.0003429 0.0006859 0.001372 0.0003429 0.0006859 0.0003429 0.0006859 0.0006859 0.0003429 0.0006859 0.001372 0.001372 0.0006859 0.0006859 0.001372 0.0003429 0.0006859 0.0006859 0.001372 0.001372 0.0006859 0.0006859 0.001372 0.001372 +DEAL::0.0003429 0.0001715 0.0006859 0.0003429 0.0006859 0.0003429 0.001372 0.0006859 0.0006859 0.0003429 0.0003429 0.0006859 0.001372 0.0006859 0.0006859 0.001372 0.0006859 0.0003429 0.001372 0.0006859 0.001372 0.0006859 0.0006859 0.001372 0.0006859 0.001372 0.001372 +DEAL::0.0001715 0.0003429 0.0003429 0.0006859 0.0003429 0.0006859 0.0006859 0.001372 0.0003429 0.0006859 0.0003429 0.0006859 0.0006859 0.001372 0.0006859 0.001372 0.0003429 0.0006859 0.0006859 0.001372 0.0006859 0.001372 0.0006859 0.001372 0.0006859 0.001372 0.001372 +DEAL::0.001372 0.0006859 0.001372 0.0006859 0.0006859 0.0003429 0.0006859 0.0003429 0.005487 0.002743 0.001372 0.001372 0.002743 0.001372 0.0006859 0.0006859 0.001372 0.0006859 0.001372 0.0006859 0.005487 0.002743 0.001372 0.001372 0.005487 0.002743 0.005487 +DEAL::0.0006859 0.001372 0.0006859 0.001372 0.0003429 0.0006859 0.0003429 0.0006859 0.002743 0.005487 0.001372 0.001372 0.001372 0.002743 0.0006859 0.0006859 0.0006859 0.001372 0.0006859 0.001372 0.002743 0.005487 0.001372 0.001372 0.005487 0.002743 0.005487 +DEAL::0.001372 0.001372 0.0006859 0.0006859 0.0006859 0.0006859 0.0003429 0.0003429 0.001372 0.001372 0.005487 0.002743 0.0006859 0.0006859 0.002743 0.001372 0.001372 0.001372 0.0006859 0.0006859 0.001372 0.001372 0.005487 0.002743 0.005487 0.002743 0.005487 +DEAL::0.0006859 0.0006859 0.001372 0.001372 0.0003429 0.0003429 0.0006859 0.0006859 0.001372 0.001372 0.002743 0.005487 0.0006859 0.0006859 0.001372 0.002743 0.0006859 0.0006859 0.001372 0.001372 0.001372 0.001372 0.002743 0.005487 0.005487 0.002743 0.005487 +DEAL::0.0006859 0.0003429 0.0006859 0.0003429 0.001372 0.0006859 0.001372 0.0006859 0.002743 0.001372 0.0006859 0.0006859 0.005487 0.002743 0.001372 0.001372 0.001372 0.0006859 0.001372 0.0006859 0.005487 0.002743 0.001372 0.001372 0.002743 0.005487 0.005487 +DEAL::0.0003429 0.0006859 0.0003429 0.0006859 0.0006859 0.001372 0.0006859 0.001372 0.001372 0.002743 0.0006859 0.0006859 0.002743 0.005487 0.001372 0.001372 0.0006859 0.001372 0.0006859 0.001372 0.002743 0.005487 0.001372 0.001372 0.002743 0.005487 0.005487 +DEAL::0.0006859 0.0006859 0.0003429 0.0003429 0.001372 0.001372 0.0006859 0.0006859 0.0006859 0.0006859 0.002743 0.001372 0.001372 0.001372 0.005487 0.002743 0.001372 0.001372 0.0006859 0.0006859 0.001372 0.001372 0.005487 0.002743 0.002743 0.005487 0.005487 +DEAL::0.0003429 0.0003429 0.0006859 0.0006859 0.0006859 0.0006859 0.001372 0.001372 0.0006859 0.0006859 0.001372 0.002743 0.001372 0.001372 0.002743 0.005487 0.0006859 0.0006859 0.001372 0.001372 0.001372 0.001372 0.002743 0.005487 0.002743 0.005487 0.005487 +DEAL::0.001372 0.0006859 0.0006859 0.0003429 0.001372 0.0006859 0.0006859 0.0003429 0.001372 0.0006859 0.001372 0.0006859 0.001372 0.0006859 0.001372 0.0006859 0.005487 0.002743 0.002743 0.001372 0.005487 0.002743 0.005487 0.002743 0.001372 0.001372 0.005487 +DEAL::0.0006859 0.001372 0.0003429 0.0006859 0.0006859 0.001372 0.0003429 0.0006859 0.0006859 0.001372 0.001372 0.0006859 0.0006859 0.001372 0.001372 0.0006859 0.002743 0.005487 0.001372 0.002743 0.002743 0.005487 0.005487 0.002743 0.001372 0.001372 0.005487 +DEAL::0.0006859 0.0003429 0.001372 0.0006859 0.0006859 0.0003429 0.001372 0.0006859 0.001372 0.0006859 0.0006859 0.001372 0.001372 0.0006859 0.0006859 0.001372 0.002743 0.001372 0.005487 0.002743 0.005487 0.002743 0.002743 0.005487 0.001372 0.001372 0.005487 +DEAL::0.0003429 0.0006859 0.0006859 0.001372 0.0003429 0.0006859 0.0006859 0.001372 0.0006859 0.001372 0.0006859 0.001372 0.0006859 0.001372 0.0006859 0.001372 0.001372 0.002743 0.002743 0.005487 0.002743 0.005487 0.002743 0.005487 0.001372 0.001372 0.005487 +DEAL::0.001372 0.0006859 0.001372 0.0006859 0.001372 0.0006859 0.001372 0.0006859 0.005487 0.002743 0.001372 0.001372 0.005487 0.002743 0.001372 0.001372 0.005487 0.002743 0.005487 0.002743 0.02195 -0.01097 0.005487 0.005487 0.005487 0.005487 0.02195 +DEAL::0.0006859 0.001372 0.0006859 0.001372 0.0006859 0.001372 0.0006859 0.001372 0.002743 0.005487 0.001372 0.001372 0.002743 0.005487 0.001372 0.001372 0.002743 0.005487 0.002743 0.005487 -0.01097 0.02195 0.005487 0.005487 0.005487 0.005487 0.02195 +DEAL::0.001372 0.001372 0.0006859 0.0006859 0.001372 0.001372 0.0006859 0.0006859 0.001372 0.001372 0.005487 0.002743 0.001372 0.001372 0.005487 0.002743 0.005487 0.005487 0.002743 0.002743 0.005487 0.005487 0.02195 -0.01097 0.005487 0.005487 0.02195 +DEAL::0.0006859 0.0006859 0.001372 0.001372 0.0006859 0.0006859 0.001372 0.001372 0.001372 0.001372 0.002743 0.005487 0.001372 0.001372 0.002743 0.005487 0.002743 0.002743 0.005487 0.005487 0.005487 0.005487 -0.01097 0.02195 0.005487 0.005487 0.02195 +DEAL::0.001372 0.001372 0.001372 0.001372 0.0006859 0.0006859 0.0006859 0.0006859 0.005487 0.005487 0.005487 0.005487 0.002743 0.002743 0.002743 0.002743 0.001372 0.001372 0.001372 0.001372 0.005487 0.005487 0.005487 0.005487 0.02195 -0.01097 0.02195 +DEAL::0.0006859 0.0006859 0.0006859 0.0006859 0.001372 0.001372 0.001372 0.001372 0.002743 0.002743 0.002743 0.002743 0.005487 0.005487 0.005487 0.005487 0.001372 0.001372 0.001372 0.001372 0.005487 0.005487 0.005487 0.005487 -0.01097 0.02195 0.02195 +DEAL::0.001372 0.001372 0.001372 0.001372 0.001372 0.001372 0.001372 0.001372 0.005487 0.005487 0.005487 0.005487 0.005487 0.005487 0.005487 0.005487 0.005487 0.005487 0.005487 0.005487 0.02195 0.02195 0.02195 0.02195 0.02195 0.02195 0.08779 +DEAL::laplace_matrix: +DEAL::0.08642 -0.02469 -0.02469 0.003086 -0.02469 0.003086 0.003086 0.003086 0.02469 0.006173 0.02469 0.006173 0.006173 -0.01235 0.006173 -0.01235 0.02469 0.006173 0.006173 -0.01235 -0.03704 0.03704 -0.03704 0.03704 -0.03704 0.03704 -0.09877 +DEAL::-0.02469 0.08642 0.003086 -0.02469 0.003086 -0.02469 0.003086 0.003086 0.006173 0.02469 0.02469 0.006173 -0.01235 0.006173 0.006173 -0.01235 0.006173 0.02469 -0.01235 0.006173 0.03704 -0.03704 -0.03704 0.03704 -0.03704 0.03704 -0.09877 +DEAL::-0.02469 0.003086 0.08642 -0.02469 0.003086 0.003086 -0.02469 0.003086 0.02469 0.006173 0.006173 0.02469 0.006173 -0.01235 -0.01235 0.006173 0.006173 -0.01235 0.02469 0.006173 -0.03704 0.03704 0.03704 -0.03704 -0.03704 0.03704 -0.09877 +DEAL::0.003086 -0.02469 -0.02469 0.08642 0.003086 0.003086 0.003086 -0.02469 0.006173 0.02469 0.006173 0.02469 -0.01235 0.006173 -0.01235 0.006173 -0.01235 0.006173 0.006173 0.02469 0.03704 -0.03704 0.03704 -0.03704 -0.03704 0.03704 -0.09877 +DEAL::-0.02469 0.003086 0.003086 0.003086 0.08642 -0.02469 -0.02469 0.003086 0.006173 -0.01235 0.006173 -0.01235 0.02469 0.006173 0.02469 0.006173 0.02469 0.006173 0.006173 -0.01235 -0.03704 0.03704 -0.03704 0.03704 0.03704 -0.03704 -0.09877 +DEAL::0.003086 -0.02469 0.003086 0.003086 -0.02469 0.08642 0.003086 -0.02469 -0.01235 0.006173 0.006173 -0.01235 0.006173 0.02469 0.02469 0.006173 0.006173 0.02469 -0.01235 0.006173 0.03704 -0.03704 -0.03704 0.03704 0.03704 -0.03704 -0.09877 +DEAL::0.003086 0.003086 -0.02469 0.003086 -0.02469 0.003086 0.08642 -0.02469 0.006173 -0.01235 -0.01235 0.006173 0.02469 0.006173 0.006173 0.02469 0.006173 -0.01235 0.02469 0.006173 -0.03704 0.03704 0.03704 -0.03704 0.03704 -0.03704 -0.09877 +DEAL::0.003086 0.003086 0.003086 -0.02469 0.003086 -0.02469 -0.02469 0.08642 -0.01235 0.006173 -0.01235 0.006173 0.006173 0.02469 0.006173 0.02469 -0.01235 0.006173 0.006173 0.02469 0.03704 -0.03704 0.03704 -0.03704 0.03704 -0.03704 -0.09877 +DEAL::0.02469 0.006173 0.02469 0.006173 0.006173 -0.01235 0.006173 -0.01235 0.2963 -0.07407 -0.03704 -0.03704 -0.07407 0 0.03704 0.03704 -0.03704 0.03704 -0.03704 0.03704 0.04938 0.04938 -0.09877 -0.09877 0.04938 0.04938 -0.1975 +DEAL::0.006173 0.02469 0.006173 0.02469 -0.01235 0.006173 -0.01235 0.006173 -0.07407 0.2963 -0.03704 -0.03704 0 -0.07407 0.03704 0.03704 0.03704 -0.03704 0.03704 -0.03704 0.04938 0.04938 -0.09877 -0.09877 0.04938 0.04938 -0.1975 +DEAL::0.02469 0.02469 0.006173 0.006173 0.006173 0.006173 -0.01235 -0.01235 -0.03704 -0.03704 0.2963 -0.07407 0.03704 0.03704 -0.07407 0 -0.03704 -0.03704 0.03704 0.03704 -0.09877 -0.09877 0.04938 0.04938 0.04938 0.04938 -0.1975 +DEAL::0.006173 0.006173 0.02469 0.02469 -0.01235 -0.01235 0.006173 0.006173 -0.03704 -0.03704 -0.07407 0.2963 0.03704 0.03704 0 -0.07407 0.03704 0.03704 -0.03704 -0.03704 -0.09877 -0.09877 0.04938 0.04938 0.04938 0.04938 -0.1975 +DEAL::0.006173 -0.01235 0.006173 -0.01235 0.02469 0.006173 0.02469 0.006173 -0.07407 0 0.03704 0.03704 0.2963 -0.07407 -0.03704 -0.03704 -0.03704 0.03704 -0.03704 0.03704 0.04938 0.04938 -0.09877 -0.09877 0.04938 0.04938 -0.1975 +DEAL::-0.01235 0.006173 -0.01235 0.006173 0.006173 0.02469 0.006173 0.02469 0 -0.07407 0.03704 0.03704 -0.07407 0.2963 -0.03704 -0.03704 0.03704 -0.03704 0.03704 -0.03704 0.04938 0.04938 -0.09877 -0.09877 0.04938 0.04938 -0.1975 +DEAL::0.006173 0.006173 -0.01235 -0.01235 0.02469 0.02469 0.006173 0.006173 0.03704 0.03704 -0.07407 0 -0.03704 -0.03704 0.2963 -0.07407 -0.03704 -0.03704 0.03704 0.03704 -0.09877 -0.09877 0.04938 0.04938 0.04938 0.04938 -0.1975 +DEAL::-0.01235 -0.01235 0.006173 0.006173 0.006173 0.006173 0.02469 0.02469 0.03704 0.03704 0 -0.07407 -0.03704 -0.03704 -0.07407 0.2963 0.03704 0.03704 -0.03704 -0.03704 -0.09877 -0.09877 0.04938 0.04938 0.04938 0.04938 -0.1975 +DEAL::0.02469 0.006173 0.006173 -0.01235 0.02469 0.006173 0.006173 -0.01235 -0.03704 0.03704 -0.03704 0.03704 -0.03704 0.03704 -0.03704 0.03704 0.2963 -0.07407 -0.07407 0 0.04938 0.04938 0.04938 0.04938 -0.09877 -0.09877 -0.1975 +DEAL::0.006173 0.02469 -0.01235 0.006173 0.006173 0.02469 -0.01235 0.006173 0.03704 -0.03704 -0.03704 0.03704 0.03704 -0.03704 -0.03704 0.03704 -0.07407 0.2963 0 -0.07407 0.04938 0.04938 0.04938 0.04938 -0.09877 -0.09877 -0.1975 +DEAL::0.006173 -0.01235 0.02469 0.006173 0.006173 -0.01235 0.02469 0.006173 -0.03704 0.03704 0.03704 -0.03704 -0.03704 0.03704 0.03704 -0.03704 -0.07407 0 0.2963 -0.07407 0.04938 0.04938 0.04938 0.04938 -0.09877 -0.09877 -0.1975 +DEAL::-0.01235 0.006173 0.006173 0.02469 -0.01235 0.006173 0.006173 0.02469 0.03704 -0.03704 0.03704 -0.03704 0.03704 -0.03704 0.03704 -0.03704 0 -0.07407 -0.07407 0.2963 0.04938 0.04938 0.04938 0.04938 -0.09877 -0.09877 -0.1975 +DEAL::-0.03704 0.03704 -0.03704 0.03704 -0.03704 0.03704 -0.03704 0.03704 0.04938 0.04938 -0.09877 -0.09877 0.04938 0.04938 -0.09877 -0.09877 0.04938 0.04938 0.04938 0.04938 0.9877 -0.1975 -0.1975 -0.1975 -0.1975 -0.1975 0 +DEAL::0.03704 -0.03704 0.03704 -0.03704 0.03704 -0.03704 0.03704 -0.03704 0.04938 0.04938 -0.09877 -0.09877 0.04938 0.04938 -0.09877 -0.09877 0.04938 0.04938 0.04938 0.04938 -0.1975 0.9877 -0.1975 -0.1975 -0.1975 -0.1975 0 +DEAL::-0.03704 -0.03704 0.03704 0.03704 -0.03704 -0.03704 0.03704 0.03704 -0.09877 -0.09877 0.04938 0.04938 -0.09877 -0.09877 0.04938 0.04938 0.04938 0.04938 0.04938 0.04938 -0.1975 -0.1975 0.9877 -0.1975 -0.1975 -0.1975 0 +DEAL::0.03704 0.03704 -0.03704 -0.03704 0.03704 0.03704 -0.03704 -0.03704 -0.09877 -0.09877 0.04938 0.04938 -0.09877 -0.09877 0.04938 0.04938 0.04938 0.04938 0.04938 0.04938 -0.1975 -0.1975 -0.1975 0.9877 -0.1975 -0.1975 0 +DEAL::-0.03704 -0.03704 -0.03704 -0.03704 0.03704 0.03704 0.03704 0.03704 0.04938 0.04938 0.04938 0.04938 0.04938 0.04938 0.04938 0.04938 -0.09877 -0.09877 -0.09877 -0.09877 -0.1975 -0.1975 -0.1975 -0.1975 0.9877 -0.1975 0 +DEAL::0.03704 0.03704 0.03704 0.03704 -0.03704 -0.03704 -0.03704 -0.03704 0.04938 0.04938 0.04938 0.04938 0.04938 0.04938 0.04938 0.04938 -0.09877 -0.09877 -0.09877 -0.09877 -0.1975 -0.1975 -0.1975 -0.1975 -0.1975 0.9877 0 +DEAL::-0.09877 -0.09877 -0.09877 -0.09877 -0.09877 -0.09877 -0.09877 -0.09877 -0.1975 -0.1975 -0.1975 -0.1975 -0.1975 -0.1975 -0.1975 -0.1975 -0.1975 -0.1975 -0.1975 -0.1975 0 0 0 0 0 0 3.160 diff --git a/tests/fe/cell_similarity_07.cc b/tests/fe/cell_similarity_07.cc new file mode 100644 index 0000000000..3d5756da45 --- /dev/null +++ b/tests/fe/cell_similarity_07.cc @@ -0,0 +1,174 @@ +//---------------------------------------------------------------------- +// $Id$ +// Version: $Name$ +// +// Copyright (C) 2009 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. +// +//---------------------------------------------------------------------- + + +// since early 2009, the FEValues objects try to be more efficient by only +// recomputing things like gradients of shape functions if the cell on which +// we are is not a translation of the previous one. in this series of tests we +// make sure that this actually works the way it's supposed to be; in +// particular, if we create a mesh of two identical cells but one has a curved +// boundary, then they are the same if we use a Q1 mapping, but not a Q2 +// mapping. so we test that the mass matrix we get from each of these cells is +// actually different in the latter case, but the same in the former +// +// the various tests cell_similarity_?? differ in the mappings and finite +// elements in use + + +#include "../tests.h" +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include + + +bool equal (const FullMatrix &m1, + const FullMatrix &m2) +{ + double d = 0, s = 0; + for (unsigned int i=0; i +void test (const Triangulation& tr) +{ + FE_Q fe(1); + deallog << "FE=" << fe.get_name() << std::endl; + + MappingC1 mapping; + deallog << "Mapping=C1" << std::endl; + + + DoFHandler dof(tr); + dof.distribute_dofs(fe); + + const QGauss quadrature(2); + FEValues fe_values (mapping, fe, quadrature, + update_values | update_gradients | + update_JxW_values); + + FullMatrix mass_matrix[2], laplace_matrix[2]; + mass_matrix[0].reinit(fe.dofs_per_cell, fe.dofs_per_cell); + mass_matrix[1].reinit(fe.dofs_per_cell, fe.dofs_per_cell); + laplace_matrix[0].reinit(fe.dofs_per_cell, fe.dofs_per_cell); + laplace_matrix[1].reinit(fe.dofs_per_cell, fe.dofs_per_cell); + + for (typename DoFHandler::active_cell_iterator + cell = dof.begin_active(); + cell != dof.end(); ++cell) + { + fe_values.reinit (cell); + + for (unsigned int i=0; iindex()](i,j) += fe_values.shape_value (i,q) * + fe_values.shape_value (j,q) * + fe_values.JxW(q); + laplace_matrix[cell->index()](i,j) += fe_values.shape_grad (i,q) * + fe_values.shape_grad (j,q) * + fe_values.JxW(q); + } + } + + // check what we expect for this mapping + // about equality or inequality of the + // matrices + deallog << "Mass matrices " + << (equal (mass_matrix[0], mass_matrix[1]) ? "are" : "are not") + << " equal." + << std::endl; + deallog << "Laplace matrices " + << (equal (laplace_matrix[0], laplace_matrix[1]) ? "are" : "are not") + << " equal." + << std::endl; + + for (unsigned int cell=0; cell<2; ++cell) + { + deallog << "cell=" << cell << std::endl; + deallog << "mass_matrix:" << std::endl; + for (unsigned int i=0; i +void test() +{ + Triangulation tr; + Point p1 = Point(); + Point p2 = (dim == 2 ? + Point(2,1) : + Point(2,1,1)); + std::vector subdivisions (dim, 1); + subdivisions[0] = 2; + GridGenerator::subdivided_hyper_rectangle(tr, subdivisions, p1, p2); + + static const HyperBallBoundary boundary; + tr.set_boundary (1, boundary); + + // set boundary id on cell 1 + for (unsigned int f=0; f::faces_per_cell; ++f) + if (tr.begin_active()->at_boundary(f)) + tr.begin_active()->face(f)->set_boundary_indicator (1); + + test(tr); +} + + +int main() +{ + std::ofstream logfile ("cell_similarity_07/output"); + deallog << std::setprecision (4); + + deallog.attach(logfile); + deallog.depth_console (0); + deallog.threshold_double(1.e-7); + + test<2>(); + //test<3>(); +} diff --git a/tests/fe/cell_similarity_07/cmp/generic b/tests/fe/cell_similarity_07/cmp/generic new file mode 100644 index 0000000000..5031deacca --- /dev/null +++ b/tests/fe/cell_similarity_07/cmp/generic @@ -0,0 +1,27 @@ + +DEAL::FE=FE_Q<2>(1) +DEAL::Mapping=C1 +DEAL::Mass matrices are not equal. +DEAL::Laplace matrices are not equal. +DEAL::cell=0 +DEAL::mass_matrix: +DEAL::nan nan nan nan +DEAL::nan nan nan nan +DEAL::nan nan nan nan +DEAL::nan nan nan nan +DEAL::laplace_matrix: +DEAL::nan nan nan nan +DEAL::nan nan nan nan +DEAL::nan nan nan nan +DEAL::nan nan nan nan +DEAL::cell=1 +DEAL::mass_matrix: +DEAL::0.1111 0.05556 0.05556 0.02778 +DEAL::0.05556 0.1111 0.02778 0.05556 +DEAL::0.05556 0.02778 0.1111 0.05556 +DEAL::0.02778 0.05556 0.05556 0.1111 +DEAL::laplace_matrix: +DEAL::0.6667 -0.1667 -0.1667 -0.3333 +DEAL::-0.1667 0.6667 -0.3333 -0.1667 +DEAL::-0.1667 -0.3333 0.6667 -0.1667 +DEAL::-0.3333 -0.1667 -0.1667 0.6667 diff --git a/tests/fe/cell_similarity_08.cc b/tests/fe/cell_similarity_08.cc new file mode 100644 index 0000000000..926df80caa --- /dev/null +++ b/tests/fe/cell_similarity_08.cc @@ -0,0 +1,174 @@ +//---------------------------------------------------------------------- +// $Id$ +// Version: $Name$ +// +// Copyright (C) 2009 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. +// +//---------------------------------------------------------------------- + + +// since early 2009, the FEValues objects try to be more efficient by only +// recomputing things like gradients of shape functions if the cell on which +// we are is not a translation of the previous one. in this series of tests we +// make sure that this actually works the way it's supposed to be; in +// particular, if we create a mesh of two identical cells but one has a curved +// boundary, then they are the same if we use a Q1 mapping, but not a Q2 +// mapping. so we test that the mass matrix we get from each of these cells is +// actually different in the latter case, but the same in the former +// +// the various tests cell_similarity_?? differ in the mappings and finite +// elements in use + + +#include "../tests.h" +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include + + +bool equal (const FullMatrix &m1, + const FullMatrix &m2) +{ + double d = 0, s = 0; + for (unsigned int i=0; i +void test (const Triangulation& tr) +{ + FE_Q fe(2); + deallog << "FE=" << fe.get_name() << std::endl; + + MappingC1 mapping; + deallog << "Mapping=C1" << std::endl; + + + DoFHandler dof(tr); + dof.distribute_dofs(fe); + + const QGauss quadrature(2); + FEValues fe_values (mapping, fe, quadrature, + update_values | update_gradients | + update_JxW_values); + + FullMatrix mass_matrix[2], laplace_matrix[2]; + mass_matrix[0].reinit(fe.dofs_per_cell, fe.dofs_per_cell); + mass_matrix[1].reinit(fe.dofs_per_cell, fe.dofs_per_cell); + laplace_matrix[0].reinit(fe.dofs_per_cell, fe.dofs_per_cell); + laplace_matrix[1].reinit(fe.dofs_per_cell, fe.dofs_per_cell); + + for (typename DoFHandler::active_cell_iterator + cell = dof.begin_active(); + cell != dof.end(); ++cell) + { + fe_values.reinit (cell); + + for (unsigned int i=0; iindex()](i,j) += fe_values.shape_value (i,q) * + fe_values.shape_value (j,q) * + fe_values.JxW(q); + laplace_matrix[cell->index()](i,j) += fe_values.shape_grad (i,q) * + fe_values.shape_grad (j,q) * + fe_values.JxW(q); + } + } + + // check what we expect for this mapping + // about equality or inequality of the + // matrices + deallog << "Mass matrices " + << (equal (mass_matrix[0], mass_matrix[1]) ? "are" : "are not") + << " equal." + << std::endl; + deallog << "Laplace matrices " + << (equal (laplace_matrix[0], laplace_matrix[1]) ? "are" : "are not") + << " equal." + << std::endl; + + for (unsigned int cell=0; cell<2; ++cell) + { + deallog << "cell=" << cell << std::endl; + deallog << "mass_matrix:" << std::endl; + for (unsigned int i=0; i +void test() +{ + Triangulation tr; + Point p1 = Point(); + Point p2 = (dim == 2 ? + Point(2,1) : + Point(2,1,1)); + std::vector subdivisions (dim, 1); + subdivisions[0] = 2; + GridGenerator::subdivided_hyper_rectangle(tr, subdivisions, p1, p2); + + static const HyperBallBoundary boundary; + tr.set_boundary (1, boundary); + + // set boundary id on cell 1 + for (unsigned int f=0; f::faces_per_cell; ++f) + if (tr.begin_active()->at_boundary(f)) + tr.begin_active()->face(f)->set_boundary_indicator (1); + + test(tr); +} + + +int main() +{ + std::ofstream logfile ("cell_similarity_08/output"); + deallog << std::setprecision (4); + + deallog.attach(logfile); + deallog.depth_console (0); + deallog.threshold_double(1.e-7); + + test<2>(); + //test<3>(); +} diff --git a/tests/fe/cell_similarity_08/cmp/generic b/tests/fe/cell_similarity_08/cmp/generic new file mode 100644 index 0000000000..bb71d20a70 --- /dev/null +++ b/tests/fe/cell_similarity_08/cmp/generic @@ -0,0 +1,47 @@ + +DEAL::FE=FE_Q<2>(2) +DEAL::Mapping=C1 +DEAL::Mass matrices are not equal. +DEAL::Laplace matrices are not equal. +DEAL::cell=0 +DEAL::mass_matrix: +DEAL::nan nan nan nan nan nan nan nan nan +DEAL::nan nan nan nan nan nan nan nan nan +DEAL::nan nan nan nan nan nan nan nan nan +DEAL::nan nan nan nan nan nan nan nan nan +DEAL::nan nan nan nan nan nan nan nan nan +DEAL::nan nan nan nan nan nan nan nan nan +DEAL::nan nan nan nan nan nan nan nan nan +DEAL::nan nan nan nan nan nan nan nan nan +DEAL::nan nan nan nan nan nan nan nan nan +DEAL::laplace_matrix: +DEAL::nan nan nan nan nan nan nan nan nan +DEAL::nan nan nan nan nan nan nan nan nan +DEAL::nan nan nan nan nan nan nan nan nan +DEAL::nan nan nan nan nan nan nan nan nan +DEAL::nan nan nan nan nan nan nan nan nan +DEAL::nan nan nan nan nan nan nan nan nan +DEAL::nan nan nan nan nan nan nan nan nan +DEAL::nan nan nan nan nan nan nan nan nan +DEAL::nan nan nan nan nan nan nan nan nan +DEAL::cell=1 +DEAL::mass_matrix: +DEAL::0.01235 0.006173 0.006173 0.003086 0.01235 0.006173 0.01235 0.006173 0.01235 +DEAL::0.006173 0.01235 0.003086 0.006173 0.006173 0.01235 0.01235 0.006173 0.01235 +DEAL::0.006173 0.003086 0.01235 0.006173 0.01235 0.006173 0.006173 0.01235 0.01235 +DEAL::0.003086 0.006173 0.006173 0.01235 0.006173 0.01235 0.006173 0.01235 0.01235 +DEAL::0.01235 0.006173 0.01235 0.006173 0.04938 -0.02469 0.01235 0.01235 0.04938 +DEAL::0.006173 0.01235 0.006173 0.01235 -0.02469 0.04938 0.01235 0.01235 0.04938 +DEAL::0.01235 0.01235 0.006173 0.006173 0.01235 0.01235 0.04938 -0.02469 0.04938 +DEAL::0.006173 0.006173 0.01235 0.01235 0.01235 0.01235 -0.02469 0.04938 0.04938 +DEAL::0.01235 0.01235 0.01235 0.01235 0.04938 0.04938 0.04938 0.04938 0.1975 +DEAL::laplace_matrix: +DEAL::0.5185 -0.09259 -0.09259 -0.03704 -0.03704 0.1852 -0.03704 0.1852 -0.5926 +DEAL::-0.09259 0.5185 -0.03704 -0.09259 0.1852 -0.03704 -0.03704 0.1852 -0.5926 +DEAL::-0.09259 -0.03704 0.5185 -0.09259 -0.03704 0.1852 0.1852 -0.03704 -0.5926 +DEAL::-0.03704 -0.09259 -0.09259 0.5185 0.1852 -0.03704 0.1852 -0.03704 -0.5926 +DEAL::-0.03704 0.1852 -0.03704 0.1852 1.630 -0.1481 -0.5926 -0.5926 -0.5926 +DEAL::0.1852 -0.03704 0.1852 -0.03704 -0.1481 1.630 -0.5926 -0.5926 -0.5926 +DEAL::-0.03704 -0.03704 0.1852 0.1852 -0.5926 -0.5926 1.630 -0.1481 -0.5926 +DEAL::0.1852 0.1852 -0.03704 -0.03704 -0.5926 -0.5926 -0.1481 1.630 -0.5926 +DEAL::-0.5926 -0.5926 -0.5926 -0.5926 -0.5926 -0.5926 -0.5926 -0.5926 4.741 diff --git a/tests/fe/cell_similarity_09.cc b/tests/fe/cell_similarity_09.cc new file mode 100644 index 0000000000..81b9b56b4a --- /dev/null +++ b/tests/fe/cell_similarity_09.cc @@ -0,0 +1,174 @@ +//---------------------------------------------------------------------- +// $Id$ +// Version: $Name$ +// +// Copyright (C) 2009 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. +// +//---------------------------------------------------------------------- + + +// since early 2009, the FEValues objects try to be more efficient by only +// recomputing things like gradients of shape functions if the cell on which +// we are is not a translation of the previous one. in this series of tests we +// make sure that this actually works the way it's supposed to be; in +// particular, if we create a mesh of two identical cells but one has a curved +// boundary, then they are the same if we use a Q1 mapping, but not a Q2 +// mapping. so we test that the mass matrix we get from each of these cells is +// actually different in the latter case, but the same in the former +// +// the various tests cell_similarity_?? differ in the mappings and finite +// elements in use + + +#include "../tests.h" +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include + + +bool equal (const FullMatrix &m1, + const FullMatrix &m2) +{ + double d = 0, s = 0; + for (unsigned int i=0; i +void test (const Triangulation& tr) +{ + FE_Q fe(1); + deallog << "FE=" << fe.get_name() << std::endl; + + MappingCartesian mapping; + deallog << "Mapping=Cartesian" << std::endl; + + + DoFHandler dof(tr); + dof.distribute_dofs(fe); + + const QGauss quadrature(2); + FEValues fe_values (mapping, fe, quadrature, + update_values | update_gradients | + update_JxW_values); + + FullMatrix mass_matrix[2], laplace_matrix[2]; + mass_matrix[0].reinit(fe.dofs_per_cell, fe.dofs_per_cell); + mass_matrix[1].reinit(fe.dofs_per_cell, fe.dofs_per_cell); + laplace_matrix[0].reinit(fe.dofs_per_cell, fe.dofs_per_cell); + laplace_matrix[1].reinit(fe.dofs_per_cell, fe.dofs_per_cell); + + for (typename DoFHandler::active_cell_iterator + cell = dof.begin_active(); + cell != dof.end(); ++cell) + { + fe_values.reinit (cell); + + for (unsigned int i=0; iindex()](i,j) += fe_values.shape_value (i,q) * + fe_values.shape_value (j,q) * + fe_values.JxW(q); + laplace_matrix[cell->index()](i,j) += fe_values.shape_grad (i,q) * + fe_values.shape_grad (j,q) * + fe_values.JxW(q); + } + } + + // check what we expect for this mapping + // about equality or inequality of the + // matrices + deallog << "Mass matrices " + << (equal (mass_matrix[0], mass_matrix[1]) ? "are" : "are not") + << " equal." + << std::endl; + deallog << "Laplace matrices " + << (equal (laplace_matrix[0], laplace_matrix[1]) ? "are" : "are not") + << " equal." + << std::endl; + + for (unsigned int cell=0; cell<2; ++cell) + { + deallog << "cell=" << cell << std::endl; + deallog << "mass_matrix:" << std::endl; + for (unsigned int i=0; i +void test() +{ + Triangulation tr; + Point p1 = Point(); + Point p2 = (dim == 2 ? + Point(2,1) : + Point(2,1,1)); + std::vector subdivisions (dim, 1); + subdivisions[0] = 2; + GridGenerator::subdivided_hyper_rectangle(tr, subdivisions, p1, p2); + + static const HyperBallBoundary boundary; + tr.set_boundary (1, boundary); + + // set boundary id on cell 1 + for (unsigned int f=0; f::faces_per_cell; ++f) + if (tr.begin_active()->at_boundary(f)) + tr.begin_active()->face(f)->set_boundary_indicator (1); + + test(tr); +} + + +int main() +{ + std::ofstream logfile ("cell_similarity_09/output"); + deallog << std::setprecision (4); + + deallog.attach(logfile); + deallog.depth_console (0); + deallog.threshold_double(1.e-7); + + test<2>(); + //test<3>(); +} diff --git a/tests/fe/cell_similarity_09/cmp/generic b/tests/fe/cell_similarity_09/cmp/generic new file mode 100644 index 0000000000..f400cf28a7 --- /dev/null +++ b/tests/fe/cell_similarity_09/cmp/generic @@ -0,0 +1,27 @@ + +DEAL::FE=FE_Q<2>(1) +DEAL::Mapping=Cartesian +DEAL::Mass matrices are equal. +DEAL::Laplace matrices are equal. +DEAL::cell=0 +DEAL::mass_matrix: +DEAL::0.1111 0.05556 0.05556 0.02778 +DEAL::0.05556 0.1111 0.02778 0.05556 +DEAL::0.05556 0.02778 0.1111 0.05556 +DEAL::0.02778 0.05556 0.05556 0.1111 +DEAL::laplace_matrix: +DEAL::0.6667 -0.1667 -0.1667 -0.3333 +DEAL::-0.1667 0.6667 -0.3333 -0.1667 +DEAL::-0.1667 -0.3333 0.6667 -0.1667 +DEAL::-0.3333 -0.1667 -0.1667 0.6667 +DEAL::cell=1 +DEAL::mass_matrix: +DEAL::0.1111 0.05556 0.05556 0.02778 +DEAL::0.05556 0.1111 0.02778 0.05556 +DEAL::0.05556 0.02778 0.1111 0.05556 +DEAL::0.02778 0.05556 0.05556 0.1111 +DEAL::laplace_matrix: +DEAL::0.6667 -0.1667 -0.1667 -0.3333 +DEAL::-0.1667 0.6667 -0.3333 -0.1667 +DEAL::-0.1667 -0.3333 0.6667 -0.1667 +DEAL::-0.3333 -0.1667 -0.1667 0.6667 diff --git a/tests/fe/cell_similarity_10.cc b/tests/fe/cell_similarity_10.cc new file mode 100644 index 0000000000..d3bd42af4b --- /dev/null +++ b/tests/fe/cell_similarity_10.cc @@ -0,0 +1,174 @@ +//---------------------------------------------------------------------- +// $Id$ +// Version: $Name$ +// +// Copyright (C) 2009 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. +// +//---------------------------------------------------------------------- + + +// since early 2009, the FEValues objects try to be more efficient by only +// recomputing things like gradients of shape functions if the cell on which +// we are is not a translation of the previous one. in this series of tests we +// make sure that this actually works the way it's supposed to be; in +// particular, if we create a mesh of two identical cells but one has a curved +// boundary, then they are the same if we use a Q1 mapping, but not a Q2 +// mapping. so we test that the mass matrix we get from each of these cells is +// actually different in the latter case, but the same in the former +// +// the various tests cell_similarity_?? differ in the mappings and finite +// elements in use + + +#include "../tests.h" +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include + + +bool equal (const FullMatrix &m1, + const FullMatrix &m2) +{ + double d = 0, s = 0; + for (unsigned int i=0; i +void test (const Triangulation& tr) +{ + FE_Q fe(2); + deallog << "FE=" << fe.get_name() << std::endl; + + MappingCartesian mapping; + deallog << "Mapping=Cartesian" << std::endl; + + + DoFHandler dof(tr); + dof.distribute_dofs(fe); + + const QGauss quadrature(2); + FEValues fe_values (mapping, fe, quadrature, + update_values | update_gradients | + update_JxW_values); + + FullMatrix mass_matrix[2], laplace_matrix[2]; + mass_matrix[0].reinit(fe.dofs_per_cell, fe.dofs_per_cell); + mass_matrix[1].reinit(fe.dofs_per_cell, fe.dofs_per_cell); + laplace_matrix[0].reinit(fe.dofs_per_cell, fe.dofs_per_cell); + laplace_matrix[1].reinit(fe.dofs_per_cell, fe.dofs_per_cell); + + for (typename DoFHandler::active_cell_iterator + cell = dof.begin_active(); + cell != dof.end(); ++cell) + { + fe_values.reinit (cell); + + for (unsigned int i=0; iindex()](i,j) += fe_values.shape_value (i,q) * + fe_values.shape_value (j,q) * + fe_values.JxW(q); + laplace_matrix[cell->index()](i,j) += fe_values.shape_grad (i,q) * + fe_values.shape_grad (j,q) * + fe_values.JxW(q); + } + } + + // check what we expect for this mapping + // about equality or inequality of the + // matrices + deallog << "Mass matrices " + << (equal (mass_matrix[0], mass_matrix[1]) ? "are" : "are not") + << " equal." + << std::endl; + deallog << "Laplace matrices " + << (equal (laplace_matrix[0], laplace_matrix[1]) ? "are" : "are not") + << " equal." + << std::endl; + + for (unsigned int cell=0; cell<2; ++cell) + { + deallog << "cell=" << cell << std::endl; + deallog << "mass_matrix:" << std::endl; + for (unsigned int i=0; i +void test() +{ + Triangulation tr; + Point p1 = Point(); + Point p2 = (dim == 2 ? + Point(2,1) : + Point(2,1,1)); + std::vector subdivisions (dim, 1); + subdivisions[0] = 2; + GridGenerator::subdivided_hyper_rectangle(tr, subdivisions, p1, p2); + + static const HyperBallBoundary boundary; + tr.set_boundary (1, boundary); + + // set boundary id on cell 1 + for (unsigned int f=0; f::faces_per_cell; ++f) + if (tr.begin_active()->at_boundary(f)) + tr.begin_active()->face(f)->set_boundary_indicator (1); + + test(tr); +} + + +int main() +{ + std::ofstream logfile ("cell_similarity_10/output"); + deallog << std::setprecision (4); + + deallog.attach(logfile); + deallog.depth_console (0); + deallog.threshold_double(1.e-7); + + test<2>(); + //test<3>(); +} diff --git a/tests/fe/cell_similarity_10/cmp/generic b/tests/fe/cell_similarity_10/cmp/generic new file mode 100644 index 0000000000..6c5912178e --- /dev/null +++ b/tests/fe/cell_similarity_10/cmp/generic @@ -0,0 +1,47 @@ + +DEAL::FE=FE_Q<2>(2) +DEAL::Mapping=Cartesian +DEAL::Mass matrices are equal. +DEAL::Laplace matrices are equal. +DEAL::cell=0 +DEAL::mass_matrix: +DEAL::0.01235 0.006173 0.006173 0.003086 0.01235 0.006173 0.01235 0.006173 0.01235 +DEAL::0.006173 0.01235 0.003086 0.006173 0.006173 0.01235 0.01235 0.006173 0.01235 +DEAL::0.006173 0.003086 0.01235 0.006173 0.01235 0.006173 0.006173 0.01235 0.01235 +DEAL::0.003086 0.006173 0.006173 0.01235 0.006173 0.01235 0.006173 0.01235 0.01235 +DEAL::0.01235 0.006173 0.01235 0.006173 0.04938 -0.02469 0.01235 0.01235 0.04938 +DEAL::0.006173 0.01235 0.006173 0.01235 -0.02469 0.04938 0.01235 0.01235 0.04938 +DEAL::0.01235 0.01235 0.006173 0.006173 0.01235 0.01235 0.04938 -0.02469 0.04938 +DEAL::0.006173 0.006173 0.01235 0.01235 0.01235 0.01235 -0.02469 0.04938 0.04938 +DEAL::0.01235 0.01235 0.01235 0.01235 0.04938 0.04938 0.04938 0.04938 0.1975 +DEAL::laplace_matrix: +DEAL::0.5185 -0.09259 -0.09259 -0.03704 -0.03704 0.1852 -0.03704 0.1852 -0.5926 +DEAL::-0.09259 0.5185 -0.03704 -0.09259 0.1852 -0.03704 -0.03704 0.1852 -0.5926 +DEAL::-0.09259 -0.03704 0.5185 -0.09259 -0.03704 0.1852 0.1852 -0.03704 -0.5926 +DEAL::-0.03704 -0.09259 -0.09259 0.5185 0.1852 -0.03704 0.1852 -0.03704 -0.5926 +DEAL::-0.03704 0.1852 -0.03704 0.1852 1.630 -0.1481 -0.5926 -0.5926 -0.5926 +DEAL::0.1852 -0.03704 0.1852 -0.03704 -0.1481 1.630 -0.5926 -0.5926 -0.5926 +DEAL::-0.03704 -0.03704 0.1852 0.1852 -0.5926 -0.5926 1.630 -0.1481 -0.5926 +DEAL::0.1852 0.1852 -0.03704 -0.03704 -0.5926 -0.5926 -0.1481 1.630 -0.5926 +DEAL::-0.5926 -0.5926 -0.5926 -0.5926 -0.5926 -0.5926 -0.5926 -0.5926 4.741 +DEAL::cell=1 +DEAL::mass_matrix: +DEAL::0.01235 0.006173 0.006173 0.003086 0.01235 0.006173 0.01235 0.006173 0.01235 +DEAL::0.006173 0.01235 0.003086 0.006173 0.006173 0.01235 0.01235 0.006173 0.01235 +DEAL::0.006173 0.003086 0.01235 0.006173 0.01235 0.006173 0.006173 0.01235 0.01235 +DEAL::0.003086 0.006173 0.006173 0.01235 0.006173 0.01235 0.006173 0.01235 0.01235 +DEAL::0.01235 0.006173 0.01235 0.006173 0.04938 -0.02469 0.01235 0.01235 0.04938 +DEAL::0.006173 0.01235 0.006173 0.01235 -0.02469 0.04938 0.01235 0.01235 0.04938 +DEAL::0.01235 0.01235 0.006173 0.006173 0.01235 0.01235 0.04938 -0.02469 0.04938 +DEAL::0.006173 0.006173 0.01235 0.01235 0.01235 0.01235 -0.02469 0.04938 0.04938 +DEAL::0.01235 0.01235 0.01235 0.01235 0.04938 0.04938 0.04938 0.04938 0.1975 +DEAL::laplace_matrix: +DEAL::0.5185 -0.09259 -0.09259 -0.03704 -0.03704 0.1852 -0.03704 0.1852 -0.5926 +DEAL::-0.09259 0.5185 -0.03704 -0.09259 0.1852 -0.03704 -0.03704 0.1852 -0.5926 +DEAL::-0.09259 -0.03704 0.5185 -0.09259 -0.03704 0.1852 0.1852 -0.03704 -0.5926 +DEAL::-0.03704 -0.09259 -0.09259 0.5185 0.1852 -0.03704 0.1852 -0.03704 -0.5926 +DEAL::-0.03704 0.1852 -0.03704 0.1852 1.630 -0.1481 -0.5926 -0.5926 -0.5926 +DEAL::0.1852 -0.03704 0.1852 -0.03704 -0.1481 1.630 -0.5926 -0.5926 -0.5926 +DEAL::-0.03704 -0.03704 0.1852 0.1852 -0.5926 -0.5926 1.630 -0.1481 -0.5926 +DEAL::0.1852 0.1852 -0.03704 -0.03704 -0.5926 -0.5926 -0.1481 1.630 -0.5926 +DEAL::-0.5926 -0.5926 -0.5926 -0.5926 -0.5926 -0.5926 -0.5926 -0.5926 4.741 diff --git a/tests/fe/cell_similarity_dgp_monomial_01.cc b/tests/fe/cell_similarity_dgp_monomial_01.cc new file mode 100644 index 0000000000..382dc19682 --- /dev/null +++ b/tests/fe/cell_similarity_dgp_monomial_01.cc @@ -0,0 +1,174 @@ +//---------------------------------------------------------------------- +// $Id$ +// Version: $Name$ +// +// Copyright (C) 2009 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. +// +//---------------------------------------------------------------------- + + +// since early 2009, the FEValues objects try to be more efficient by only +// recomputing things like gradients of shape functions if the cell on which +// we are is not a translation of the previous one. in this series of tests we +// make sure that this actually works the way it's supposed to be; in +// particular, if we create a mesh of two identical cells but one has a curved +// boundary, then they are the same if we use a Q1 mapping, but not a Q2 +// mapping. so we test that the mass matrix we get from each of these cells is +// actually different in the latter case, but the same in the former +// +// the various tests cell_similarity_dgp_monomial_?? differ in the mappings and finite +// elements in use + + +#include "../tests.h" +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include + + +bool equal (const FullMatrix &m1, + const FullMatrix &m2) +{ + double d = 0, s = 0; + for (unsigned int i=0; i +void test (const Triangulation& tr) +{ + FE_DGPMonomial fe(1); + deallog << "FE=" << fe.get_name() << std::endl; + + MappingQ1 mapping; + deallog << "Mapping=Q1" << std::endl; + + + DoFHandler dof(tr); + dof.distribute_dofs(fe); + + const QGauss quadrature(2); + FEValues fe_values (mapping, fe, quadrature, + update_values | update_gradients | + update_JxW_values); + + FullMatrix mass_matrix[2], laplace_matrix[2]; + mass_matrix[0].reinit(fe.dofs_per_cell, fe.dofs_per_cell); + mass_matrix[1].reinit(fe.dofs_per_cell, fe.dofs_per_cell); + laplace_matrix[0].reinit(fe.dofs_per_cell, fe.dofs_per_cell); + laplace_matrix[1].reinit(fe.dofs_per_cell, fe.dofs_per_cell); + + for (typename DoFHandler::active_cell_iterator + cell = dof.begin_active(); + cell != dof.end(); ++cell) + { + fe_values.reinit (cell); + + for (unsigned int i=0; iindex()](i,j) += fe_values.shape_value (i,q) * + fe_values.shape_value (j,q) * + fe_values.JxW(q); + laplace_matrix[cell->index()](i,j) += fe_values.shape_grad (i,q) * + fe_values.shape_grad (j,q) * + fe_values.JxW(q); + } + } + + // check what we expect for this mapping + // about equality or inequality of the + // matrices + deallog << "Mass matrices " + << (equal (mass_matrix[0], mass_matrix[1]) ? "are" : "are not") + << " equal." + << std::endl; + deallog << "Laplace matrices " + << (equal (laplace_matrix[0], laplace_matrix[1]) ? "are" : "are not") + << " equal." + << std::endl; + + for (unsigned int cell=0; cell<2; ++cell) + { + deallog << "cell=" << cell << std::endl; + deallog << "mass_matrix:" << std::endl; + for (unsigned int i=0; i +void test() +{ + Triangulation tr; + Point p1 = Point(); + Point p2 = (dim == 2 ? + Point(2,1) : + Point(2,1,1)); + std::vector subdivisions (dim, 1); + subdivisions[0] = 2; + GridGenerator::subdivided_hyper_rectangle(tr, subdivisions, p1, p2); + + static const HyperBallBoundary boundary; + tr.set_boundary (1, boundary); + + // set boundary id on cell 1 + for (unsigned int f=0; f::faces_per_cell; ++f) + if (tr.begin_active()->at_boundary(f)) + tr.begin_active()->face(f)->set_boundary_indicator (1); + + test(tr); +} + + +int main() +{ + std::ofstream logfile ("cell_similarity_dgp_monomial_01/output"); + deallog << std::setprecision (4); + + deallog.attach(logfile); + deallog.depth_console (0); + deallog.threshold_double(1.e-7); + + test<2>(); + test<3>(); +} diff --git a/tests/fe/cell_similarity_dgp_monomial_01/cmp/generic b/tests/fe/cell_similarity_dgp_monomial_01/cmp/generic new file mode 100644 index 0000000000..a590492361 --- /dev/null +++ b/tests/fe/cell_similarity_dgp_monomial_01/cmp/generic @@ -0,0 +1,49 @@ + +DEAL::FE=FE_DGPMonomial<2>(1) +DEAL::Mapping=Q1 +DEAL::Mass matrices are equal. +DEAL::Laplace matrices are equal. +DEAL::cell=0 +DEAL::mass_matrix: +DEAL::1.000 0.5000 0.5000 +DEAL::0.5000 0.3333 0.2500 +DEAL::0.5000 0.2500 0.3333 +DEAL::laplace_matrix: +DEAL::0 0 0 +DEAL::0 1.000 0 +DEAL::0 0 1.000 +DEAL::cell=1 +DEAL::mass_matrix: +DEAL::1.000 0.5000 0.5000 +DEAL::0.5000 0.3333 0.2500 +DEAL::0.5000 0.2500 0.3333 +DEAL::laplace_matrix: +DEAL::0 0 0 +DEAL::0 1.000 0 +DEAL::0 0 1.000 +DEAL::FE=FE_DGPMonomial<3>(1) +DEAL::Mapping=Q1 +DEAL::Mass matrices are equal. +DEAL::Laplace matrices are equal. +DEAL::cell=0 +DEAL::mass_matrix: +DEAL::1.000 0.5000 0.5000 0.5000 +DEAL::0.5000 0.3333 0.2500 0.2500 +DEAL::0.5000 0.2500 0.3333 0.2500 +DEAL::0.5000 0.2500 0.2500 0.3333 +DEAL::laplace_matrix: +DEAL::0 0 0 0 +DEAL::0 1.000 0 0 +DEAL::0 0 1.000 0 +DEAL::0 0 0 1.000 +DEAL::cell=1 +DEAL::mass_matrix: +DEAL::1.000 0.5000 0.5000 0.5000 +DEAL::0.5000 0.3333 0.2500 0.2500 +DEAL::0.5000 0.2500 0.3333 0.2500 +DEAL::0.5000 0.2500 0.2500 0.3333 +DEAL::laplace_matrix: +DEAL::0 0 0 0 +DEAL::0 1.000 0 0 +DEAL::0 0 1.000 0 +DEAL::0 0 0 1.000 diff --git a/tests/fe/cell_similarity_dgp_monomial_010.cc b/tests/fe/cell_similarity_dgp_monomial_010.cc new file mode 100644 index 0000000000..e4057e2625 --- /dev/null +++ b/tests/fe/cell_similarity_dgp_monomial_010.cc @@ -0,0 +1,174 @@ +//---------------------------------------------------------------------- +// $Id$ +// Version: $Name$ +// +// Copyright (C) 2009 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. +// +//---------------------------------------------------------------------- + + +// since early 2009, the FEValues objects try to be more efficient by only +// recomputing things like gradients of shape functions if the cell on which +// we are is not a translation of the previous one. in this series of tests we +// make sure that this actually works the way it's supposed to be; in +// particular, if we create a mesh of two identical cells but one has a curved +// boundary, then they are the same if we use a Q1 mapping, but not a Q2 +// mapping. so we test that the mass matrix we get from each of these cells is +// actually different in the latter case, but the same in the former +// +// the various tests cell_similarity_dgp_monomial_?? differ in the mappings and finite +// elements in use + + +#include "../tests.h" +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include + + +bool equal (const FullMatrix &m1, + const FullMatrix &m2) +{ + double d = 0, s = 0; + for (unsigned int i=0; i +void test (const Triangulation& tr) +{ + FE_DGPMonomial fe(2); + deallog << "FE=" << fe.get_name() << std::endl; + + MappingCartesian mapping; + deallog << "Mapping=Cartesian" << std::endl; + + + DoFHandler dof(tr); + dof.distribute_dofs(fe); + + const QGauss quadrature(2); + FEValues fe_values (mapping, fe, quadrature, + update_values | update_gradients | + update_JxW_values); + + FullMatrix mass_matrix[2], laplace_matrix[2]; + mass_matrix[0].reinit(fe.dofs_per_cell, fe.dofs_per_cell); + mass_matrix[1].reinit(fe.dofs_per_cell, fe.dofs_per_cell); + laplace_matrix[0].reinit(fe.dofs_per_cell, fe.dofs_per_cell); + laplace_matrix[1].reinit(fe.dofs_per_cell, fe.dofs_per_cell); + + for (typename DoFHandler::active_cell_iterator + cell = dof.begin_active(); + cell != dof.end(); ++cell) + { + fe_values.reinit (cell); + + for (unsigned int i=0; iindex()](i,j) += fe_values.shape_value (i,q) * + fe_values.shape_value (j,q) * + fe_values.JxW(q); + laplace_matrix[cell->index()](i,j) += fe_values.shape_grad (i,q) * + fe_values.shape_grad (j,q) * + fe_values.JxW(q); + } + } + + // check what we expect for this mapping + // about equality or inequality of the + // matrices + deallog << "Mass matrices " + << (equal (mass_matrix[0], mass_matrix[1]) ? "are" : "are not") + << " equal." + << std::endl; + deallog << "Laplace matrices " + << (equal (laplace_matrix[0], laplace_matrix[1]) ? "are" : "are not") + << " equal." + << std::endl; + + for (unsigned int cell=0; cell<2; ++cell) + { + deallog << "cell=" << cell << std::endl; + deallog << "mass_matrix:" << std::endl; + for (unsigned int i=0; i +void test() +{ + Triangulation tr; + Point p1 = Point(); + Point p2 = (dim == 2 ? + Point(2,1) : + Point(2,1,1)); + std::vector subdivisions (dim, 1); + subdivisions[0] = 2; + GridGenerator::subdivided_hyper_rectangle(tr, subdivisions, p1, p2); + + static const HyperBallBoundary boundary; + tr.set_boundary (1, boundary); + + // set boundary id on cell 1 + for (unsigned int f=0; f::faces_per_cell; ++f) + if (tr.begin_active()->at_boundary(f)) + tr.begin_active()->face(f)->set_boundary_indicator (1); + + test(tr); +} + + +int main() +{ + std::ofstream logfile ("cell_similarity_dgp_monomial_10/output"); + deallog << std::setprecision (4); + + deallog.attach(logfile); + deallog.depth_console (0); + deallog.threshold_double(1.e-7); + + test<2>(); + //test<3>(); +} diff --git a/tests/fe/cell_similarity_dgp_monomial_010/cmp/generic b/tests/fe/cell_similarity_dgp_monomial_010/cmp/generic new file mode 100644 index 0000000000..d4520f92e6 --- /dev/null +++ b/tests/fe/cell_similarity_dgp_monomial_010/cmp/generic @@ -0,0 +1,69 @@ + +DEAL::FE=FE_Q<2>(1) +DEAL::Mapping=Q2 +DEAL::Mass matrices are not equal. +DEAL::Laplace matrices are not equal. +DEAL::cell=0 +DEAL::mass_matrix: +DEAL::0.2371 0.07167 0.06719 0.02582 +DEAL::0.07167 0.04962 0.02582 0.03610 +DEAL::0.06719 0.02582 0.03170 0.03162 +DEAL::0.02582 0.03610 0.03162 0.09477 +DEAL::laplace_matrix: +DEAL::4.337 -0.2381 -2.153 -1.946 +DEAL::-0.2381 0.9387 -0.5940 -0.1066 +DEAL::-2.153 -0.5940 1.899 0.8483 +DEAL::-1.946 -0.1066 0.8483 1.205 +DEAL::cell=1 +DEAL::mass_matrix: +DEAL::0.1111 0.05556 0.05556 0.02778 +DEAL::0.05556 0.1111 0.02778 0.05556 +DEAL::0.05556 0.02778 0.1111 0.05556 +DEAL::0.02778 0.05556 0.05556 0.1111 +DEAL::laplace_matrix: +DEAL::0.6667 -0.1667 -0.1667 -0.3333 +DEAL::-0.1667 0.6667 -0.3333 -0.1667 +DEAL::-0.1667 -0.3333 0.6667 -0.1667 +DEAL::-0.3333 -0.1667 -0.1667 0.6667 +DEAL::FE=FE_Q<3>(1) +DEAL::Mapping=Q2 +DEAL::Mass matrices are not equal. +DEAL::Laplace matrices are not equal. +DEAL::cell=0 +DEAL::mass_matrix: +DEAL::0.07572 0.02718 0.02414 0.009471 0.02414 0.009471 0.008538 0.003898 +DEAL::0.02718 0.03298 0.009471 0.01375 0.009471 0.01375 0.003898 0.007053 +DEAL::0.02414 0.009471 0.02083 0.01071 0.008538 0.003898 0.01001 0.006119 +DEAL::0.009471 0.01375 0.01071 0.02201 0.003898 0.007053 0.006119 0.01447 +DEAL::0.02414 0.009471 0.008538 0.003898 0.02083 0.01071 0.01001 0.006119 +DEAL::0.009471 0.01375 0.003898 0.007053 0.01071 0.02201 0.006119 0.01447 +DEAL::0.008538 0.003898 0.01001 0.006119 0.01001 0.006119 0.01922 0.01377 +DEAL::0.003898 0.007053 0.006119 0.01447 0.006119 0.01447 0.01377 0.03585 +DEAL::laplace_matrix: +DEAL::0.7840 0.04931 0.04652 -0.2138 0.04652 -0.2138 -0.2672 -0.2315 +DEAL::0.04931 0.3584 -0.04035 -0.04210 -0.04035 -0.04210 -0.09114 -0.1517 +DEAL::0.04652 -0.04035 0.2547 0.006678 -0.03606 -0.07879 -0.03423 -0.1051 +DEAL::-0.2138 -0.04210 0.006678 0.3292 -0.07879 -0.05266 0.002197 0.06269 +DEAL::0.04652 -0.04035 -0.03606 -0.07879 0.2547 0.006678 -0.03423 -0.1051 +DEAL::-0.2138 -0.04210 -0.07879 -0.05266 0.006678 0.3292 0.002197 0.06269 +DEAL::-0.2672 -0.09114 -0.03423 0.002197 -0.03423 0.002197 0.3052 0.1173 +DEAL::-0.2315 -0.1517 -0.1051 0.06269 -0.1051 0.06269 0.1173 0.3509 +DEAL::cell=1 +DEAL::mass_matrix: +DEAL::0.03704 0.01852 0.01852 0.009259 0.01852 0.009259 0.009259 0.004630 +DEAL::0.01852 0.03704 0.009259 0.01852 0.009259 0.01852 0.004630 0.009259 +DEAL::0.01852 0.009259 0.03704 0.01852 0.009259 0.004630 0.01852 0.009259 +DEAL::0.009259 0.01852 0.01852 0.03704 0.004630 0.009259 0.009259 0.01852 +DEAL::0.01852 0.009259 0.009259 0.004630 0.03704 0.01852 0.01852 0.009259 +DEAL::0.009259 0.01852 0.004630 0.009259 0.01852 0.03704 0.009259 0.01852 +DEAL::0.009259 0.004630 0.01852 0.009259 0.01852 0.009259 0.03704 0.01852 +DEAL::0.004630 0.009259 0.009259 0.01852 0.009259 0.01852 0.01852 0.03704 +DEAL::laplace_matrix: +DEAL::0.3333 0 0 -0.08333 0 -0.08333 -0.08333 -0.08333 +DEAL::0 0.3333 -0.08333 0 -0.08333 0 -0.08333 -0.08333 +DEAL::0 -0.08333 0.3333 0 -0.08333 -0.08333 0 -0.08333 +DEAL::-0.08333 0 0 0.3333 -0.08333 -0.08333 -0.08333 0 +DEAL::0 -0.08333 -0.08333 -0.08333 0.3333 0 0 -0.08333 +DEAL::-0.08333 0 -0.08333 -0.08333 0 0.3333 -0.08333 0 +DEAL::-0.08333 -0.08333 0 -0.08333 0 -0.08333 0.3333 0 +DEAL::-0.08333 -0.08333 -0.08333 0 -0.08333 0 0 0.3333 diff --git a/tests/fe/cell_similarity_dgp_monomial_02.cc b/tests/fe/cell_similarity_dgp_monomial_02.cc new file mode 100644 index 0000000000..aed7a1225f --- /dev/null +++ b/tests/fe/cell_similarity_dgp_monomial_02.cc @@ -0,0 +1,174 @@ +//---------------------------------------------------------------------- +// $Id$ +// Version: $Name$ +// +// Copyright (C) 2009 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. +// +//---------------------------------------------------------------------- + + +// since early 2009, the FEValues objects try to be more efficient by only +// recomputing things like gradients of shape functions if the cell on which +// we are is not a translation of the previous one. in this series of tests we +// make sure that this actually works the way it's supposed to be; in +// particular, if we create a mesh of two identical cells but one has a curved +// boundary, then they are the same if we use a Q1 mapping, but not a Q2 +// mapping. so we test that the mass matrix we get from each of these cells is +// actually different in the latter case, but the same in the former +// +// the various tests cell_similarity_dgp_monomial_?? differ in the mappings and finite +// elements in use + + +#include "../tests.h" +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include + + +bool equal (const FullMatrix &m1, + const FullMatrix &m2) +{ + double d = 0, s = 0; + for (unsigned int i=0; i +void test (const Triangulation& tr) +{ + FE_DGPMonomial fe(2); + deallog << "FE=" << fe.get_name() << std::endl; + + MappingQ1 mapping; + deallog << "Mapping=Q1" << std::endl; + + + DoFHandler dof(tr); + dof.distribute_dofs(fe); + + const QGauss quadrature(2); + FEValues fe_values (mapping, fe, quadrature, + update_values | update_gradients | + update_JxW_values); + + FullMatrix mass_matrix[2], laplace_matrix[2]; + mass_matrix[0].reinit(fe.dofs_per_cell, fe.dofs_per_cell); + mass_matrix[1].reinit(fe.dofs_per_cell, fe.dofs_per_cell); + laplace_matrix[0].reinit(fe.dofs_per_cell, fe.dofs_per_cell); + laplace_matrix[1].reinit(fe.dofs_per_cell, fe.dofs_per_cell); + + for (typename DoFHandler::active_cell_iterator + cell = dof.begin_active(); + cell != dof.end(); ++cell) + { + fe_values.reinit (cell); + + for (unsigned int i=0; iindex()](i,j) += fe_values.shape_value (i,q) * + fe_values.shape_value (j,q) * + fe_values.JxW(q); + laplace_matrix[cell->index()](i,j) += fe_values.shape_grad (i,q) * + fe_values.shape_grad (j,q) * + fe_values.JxW(q); + } + } + + // check what we expect for this mapping + // about equality or inequality of the + // matrices + deallog << "Mass matrices " + << (equal (mass_matrix[0], mass_matrix[1]) ? "are" : "are not") + << " equal." + << std::endl; + deallog << "Laplace matrices " + << (equal (laplace_matrix[0], laplace_matrix[1]) ? "are" : "are not") + << " equal." + << std::endl; + + for (unsigned int cell=0; cell<2; ++cell) + { + deallog << "cell=" << cell << std::endl; + deallog << "mass_matrix:" << std::endl; + for (unsigned int i=0; i +void test() +{ + Triangulation tr; + Point p1 = Point(); + Point p2 = (dim == 2 ? + Point(2,1) : + Point(2,1,1)); + std::vector subdivisions (dim, 1); + subdivisions[0] = 2; + GridGenerator::subdivided_hyper_rectangle(tr, subdivisions, p1, p2); + + static const HyperBallBoundary boundary; + tr.set_boundary (1, boundary); + + // set boundary id on cell 1 + for (unsigned int f=0; f::faces_per_cell; ++f) + if (tr.begin_active()->at_boundary(f)) + tr.begin_active()->face(f)->set_boundary_indicator (1); + + test(tr); +} + + +int main() +{ + std::ofstream logfile ("cell_similarity_dgp_monomial_02/output"); + deallog << std::setprecision (4); + + deallog.attach(logfile); + deallog.depth_console (0); + deallog.threshold_double(1.e-7); + + test<2>(); + test<3>(); +} diff --git a/tests/fe/cell_similarity_dgp_monomial_02/cmp/generic b/tests/fe/cell_similarity_dgp_monomial_02/cmp/generic new file mode 100644 index 0000000000..a5356addcb --- /dev/null +++ b/tests/fe/cell_similarity_dgp_monomial_02/cmp/generic @@ -0,0 +1,85 @@ + +DEAL::FE=FE_DGPMonomial<2>(2) +DEAL::Mapping=Q1 +DEAL::Mass matrices are equal. +DEAL::Laplace matrices are equal. +DEAL::cell=0 +DEAL::mass_matrix: +DEAL::1.000 0.5000 0.5000 0.2500 0.3333 0.3333 +DEAL::0.5000 0.3333 0.2500 0.1667 0.2500 0.1667 +DEAL::0.5000 0.2500 0.3333 0.1667 0.1667 0.2500 +DEAL::0.2500 0.1667 0.1667 0.1111 0.1250 0.1250 +DEAL::0.3333 0.2500 0.1667 0.1250 0.1944 0.1111 +DEAL::0.3333 0.1667 0.2500 0.1250 0.1111 0.1944 +DEAL::laplace_matrix: +DEAL::0 0 0 0 0 0 +DEAL::0 1.000 0 0.5000 1.000 0 +DEAL::0 0 1.000 0.5000 0 1.000 +DEAL::0 0.5000 0.5000 0.6667 0.5000 0.5000 +DEAL::0 1.000 0 0.5000 1.333 0 +DEAL::0 0 1.000 0.5000 0 1.333 +DEAL::cell=1 +DEAL::mass_matrix: +DEAL::1.000 0.5000 0.5000 0.2500 0.3333 0.3333 +DEAL::0.5000 0.3333 0.2500 0.1667 0.2500 0.1667 +DEAL::0.5000 0.2500 0.3333 0.1667 0.1667 0.2500 +DEAL::0.2500 0.1667 0.1667 0.1111 0.1250 0.1250 +DEAL::0.3333 0.2500 0.1667 0.1250 0.1944 0.1111 +DEAL::0.3333 0.1667 0.2500 0.1250 0.1111 0.1944 +DEAL::laplace_matrix: +DEAL::0 0 0 0 0 0 +DEAL::0 1.000 0 0.5000 1.000 0 +DEAL::0 0 1.000 0.5000 0 1.000 +DEAL::0 0.5000 0.5000 0.6667 0.5000 0.5000 +DEAL::0 1.000 0 0.5000 1.333 0 +DEAL::0 0 1.000 0.5000 0 1.333 +DEAL::FE=FE_DGPMonomial<3>(2) +DEAL::Mapping=Q1 +DEAL::Mass matrices are equal. +DEAL::Laplace matrices are equal. +DEAL::cell=0 +DEAL::mass_matrix: +DEAL::1.000 0.5000 0.5000 0.5000 0.2500 0.2500 0.2500 0.3333 0.3333 0.3333 +DEAL::0.5000 0.3333 0.2500 0.2500 0.1667 0.1667 0.1250 0.2500 0.1667 0.1667 +DEAL::0.5000 0.2500 0.3333 0.2500 0.1667 0.1250 0.1667 0.1667 0.2500 0.1667 +DEAL::0.5000 0.2500 0.2500 0.3333 0.1250 0.1667 0.1667 0.1667 0.1667 0.2500 +DEAL::0.2500 0.1667 0.1667 0.1250 0.1111 0.08333 0.08333 0.1250 0.1250 0.08333 +DEAL::0.2500 0.1667 0.1250 0.1667 0.08333 0.1111 0.08333 0.1250 0.08333 0.1250 +DEAL::0.2500 0.1250 0.1667 0.1667 0.08333 0.08333 0.1111 0.08333 0.1250 0.1250 +DEAL::0.3333 0.2500 0.1667 0.1667 0.1250 0.1250 0.08333 0.1944 0.1111 0.1111 +DEAL::0.3333 0.1667 0.2500 0.1667 0.1250 0.08333 0.1250 0.1111 0.1944 0.1111 +DEAL::0.3333 0.1667 0.1667 0.2500 0.08333 0.1250 0.1250 0.1111 0.1111 0.1944 +DEAL::laplace_matrix: +DEAL::0 0 0 0 0 0 0 0 0 0 +DEAL::0 1.000 0 0 0.5000 0.5000 0 1.000 0 0 +DEAL::0 0 1.000 0 0.5000 0 0.5000 0 1.000 0 +DEAL::0 0 0 1.000 0 0.5000 0.5000 0 0 1.000 +DEAL::0 0.5000 0.5000 0 0.6667 0.2500 0.2500 0.5000 0.5000 0 +DEAL::0 0.5000 0 0.5000 0.2500 0.6667 0.2500 0.5000 0 0.5000 +DEAL::0 0 0.5000 0.5000 0.2500 0.2500 0.6667 0 0.5000 0.5000 +DEAL::0 1.000 0 0 0.5000 0.5000 0 1.333 0 0 +DEAL::0 0 1.000 0 0.5000 0 0.5000 0 1.333 0 +DEAL::0 0 0 1.000 0 0.5000 0.5000 0 0 1.333 +DEAL::cell=1 +DEAL::mass_matrix: +DEAL::1.000 0.5000 0.5000 0.5000 0.2500 0.2500 0.2500 0.3333 0.3333 0.3333 +DEAL::0.5000 0.3333 0.2500 0.2500 0.1667 0.1667 0.1250 0.2500 0.1667 0.1667 +DEAL::0.5000 0.2500 0.3333 0.2500 0.1667 0.1250 0.1667 0.1667 0.2500 0.1667 +DEAL::0.5000 0.2500 0.2500 0.3333 0.1250 0.1667 0.1667 0.1667 0.1667 0.2500 +DEAL::0.2500 0.1667 0.1667 0.1250 0.1111 0.08333 0.08333 0.1250 0.1250 0.08333 +DEAL::0.2500 0.1667 0.1250 0.1667 0.08333 0.1111 0.08333 0.1250 0.08333 0.1250 +DEAL::0.2500 0.1250 0.1667 0.1667 0.08333 0.08333 0.1111 0.08333 0.1250 0.1250 +DEAL::0.3333 0.2500 0.1667 0.1667 0.1250 0.1250 0.08333 0.1944 0.1111 0.1111 +DEAL::0.3333 0.1667 0.2500 0.1667 0.1250 0.08333 0.1250 0.1111 0.1944 0.1111 +DEAL::0.3333 0.1667 0.1667 0.2500 0.08333 0.1250 0.1250 0.1111 0.1111 0.1944 +DEAL::laplace_matrix: +DEAL::0 0 0 0 0 0 0 0 0 0 +DEAL::0 1.000 0 0 0.5000 0.5000 0 1.000 0 0 +DEAL::0 0 1.000 0 0.5000 0 0.5000 0 1.000 0 +DEAL::0 0 0 1.000 0 0.5000 0.5000 0 0 1.000 +DEAL::0 0.5000 0.5000 0 0.6667 0.2500 0.2500 0.5000 0.5000 0 +DEAL::0 0.5000 0 0.5000 0.2500 0.6667 0.2500 0.5000 0 0.5000 +DEAL::0 0 0.5000 0.5000 0.2500 0.2500 0.6667 0 0.5000 0.5000 +DEAL::0 1.000 0 0 0.5000 0.5000 0 1.333 0 0 +DEAL::0 0 1.000 0 0.5000 0 0.5000 0 1.333 0 +DEAL::0 0 0 1.000 0 0.5000 0.5000 0 0 1.333 diff --git a/tests/fe/cell_similarity_dgp_monomial_03.cc b/tests/fe/cell_similarity_dgp_monomial_03.cc new file mode 100644 index 0000000000..35d937eabb --- /dev/null +++ b/tests/fe/cell_similarity_dgp_monomial_03.cc @@ -0,0 +1,174 @@ +//---------------------------------------------------------------------- +// $Id$ +// Version: $Name$ +// +// Copyright (C) 2009 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. +// +//---------------------------------------------------------------------- + + +// since early 2009, the FEValues objects try to be more efficient by only +// recomputing things like gradients of shape functions if the cell on which +// we are is not a translation of the previous one. in this series of tests we +// make sure that this actually works the way it's supposed to be; in +// particular, if we create a mesh of two identical cells but one has a curved +// boundary, then they are the same if we use a Q1 mapping, but not a Q2 +// mapping. so we test that the mass matrix we get from each of these cells is +// actually different in the latter case, but the same in the former +// +// the various tests cell_similarity_dgp_monomial_?? differ in the mappings and finite +// elements in use + + +#include "../tests.h" +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include + + +bool equal (const FullMatrix &m1, + const FullMatrix &m2) +{ + double d = 0, s = 0; + for (unsigned int i=0; i +void test (const Triangulation& tr) +{ + FE_DGPMonomial fe(1); + deallog << "FE=" << fe.get_name() << std::endl; + + MappingQ mapping(1); + deallog << "Mapping=Q1" << std::endl; + + + DoFHandler dof(tr); + dof.distribute_dofs(fe); + + const QGauss quadrature(2); + FEValues fe_values (mapping, fe, quadrature, + update_values | update_gradients | + update_JxW_values); + + FullMatrix mass_matrix[2], laplace_matrix[2]; + mass_matrix[0].reinit(fe.dofs_per_cell, fe.dofs_per_cell); + mass_matrix[1].reinit(fe.dofs_per_cell, fe.dofs_per_cell); + laplace_matrix[0].reinit(fe.dofs_per_cell, fe.dofs_per_cell); + laplace_matrix[1].reinit(fe.dofs_per_cell, fe.dofs_per_cell); + + for (typename DoFHandler::active_cell_iterator + cell = dof.begin_active(); + cell != dof.end(); ++cell) + { + fe_values.reinit (cell); + + for (unsigned int i=0; iindex()](i,j) += fe_values.shape_value (i,q) * + fe_values.shape_value (j,q) * + fe_values.JxW(q); + laplace_matrix[cell->index()](i,j) += fe_values.shape_grad (i,q) * + fe_values.shape_grad (j,q) * + fe_values.JxW(q); + } + } + + // check what we expect for this mapping + // about equality or inequality of the + // matrices + deallog << "Mass matrices " + << (equal (mass_matrix[0], mass_matrix[1]) ? "are" : "are not") + << " equal." + << std::endl; + deallog << "Laplace matrices " + << (equal (laplace_matrix[0], laplace_matrix[1]) ? "are" : "are not") + << " equal." + << std::endl; + + for (unsigned int cell=0; cell<2; ++cell) + { + deallog << "cell=" << cell << std::endl; + deallog << "mass_matrix:" << std::endl; + for (unsigned int i=0; i +void test() +{ + Triangulation tr; + Point p1 = Point(); + Point p2 = (dim == 2 ? + Point(2,1) : + Point(2,1,1)); + std::vector subdivisions (dim, 1); + subdivisions[0] = 2; + GridGenerator::subdivided_hyper_rectangle(tr, subdivisions, p1, p2); + + static const HyperBallBoundary boundary; + tr.set_boundary (1, boundary); + + // set boundary id on cell 1 + for (unsigned int f=0; f::faces_per_cell; ++f) + if (tr.begin_active()->at_boundary(f)) + tr.begin_active()->face(f)->set_boundary_indicator (1); + + test(tr); +} + + +int main() +{ + std::ofstream logfile ("cell_similarity_dgp_monomial_03/output"); + deallog << std::setprecision (4); + + deallog.attach(logfile); + deallog.depth_console (0); + deallog.threshold_double(1.e-7); + + test<2>(); + test<3>(); +} diff --git a/tests/fe/cell_similarity_dgp_monomial_03/cmp/generic b/tests/fe/cell_similarity_dgp_monomial_03/cmp/generic new file mode 100644 index 0000000000..a590492361 --- /dev/null +++ b/tests/fe/cell_similarity_dgp_monomial_03/cmp/generic @@ -0,0 +1,49 @@ + +DEAL::FE=FE_DGPMonomial<2>(1) +DEAL::Mapping=Q1 +DEAL::Mass matrices are equal. +DEAL::Laplace matrices are equal. +DEAL::cell=0 +DEAL::mass_matrix: +DEAL::1.000 0.5000 0.5000 +DEAL::0.5000 0.3333 0.2500 +DEAL::0.5000 0.2500 0.3333 +DEAL::laplace_matrix: +DEAL::0 0 0 +DEAL::0 1.000 0 +DEAL::0 0 1.000 +DEAL::cell=1 +DEAL::mass_matrix: +DEAL::1.000 0.5000 0.5000 +DEAL::0.5000 0.3333 0.2500 +DEAL::0.5000 0.2500 0.3333 +DEAL::laplace_matrix: +DEAL::0 0 0 +DEAL::0 1.000 0 +DEAL::0 0 1.000 +DEAL::FE=FE_DGPMonomial<3>(1) +DEAL::Mapping=Q1 +DEAL::Mass matrices are equal. +DEAL::Laplace matrices are equal. +DEAL::cell=0 +DEAL::mass_matrix: +DEAL::1.000 0.5000 0.5000 0.5000 +DEAL::0.5000 0.3333 0.2500 0.2500 +DEAL::0.5000 0.2500 0.3333 0.2500 +DEAL::0.5000 0.2500 0.2500 0.3333 +DEAL::laplace_matrix: +DEAL::0 0 0 0 +DEAL::0 1.000 0 0 +DEAL::0 0 1.000 0 +DEAL::0 0 0 1.000 +DEAL::cell=1 +DEAL::mass_matrix: +DEAL::1.000 0.5000 0.5000 0.5000 +DEAL::0.5000 0.3333 0.2500 0.2500 +DEAL::0.5000 0.2500 0.3333 0.2500 +DEAL::0.5000 0.2500 0.2500 0.3333 +DEAL::laplace_matrix: +DEAL::0 0 0 0 +DEAL::0 1.000 0 0 +DEAL::0 0 1.000 0 +DEAL::0 0 0 1.000 diff --git a/tests/fe/cell_similarity_dgp_monomial_04.cc b/tests/fe/cell_similarity_dgp_monomial_04.cc new file mode 100644 index 0000000000..af697ef29b --- /dev/null +++ b/tests/fe/cell_similarity_dgp_monomial_04.cc @@ -0,0 +1,174 @@ +//---------------------------------------------------------------------- +// $Id$ +// Version: $Name$ +// +// Copyright (C) 2009 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. +// +//---------------------------------------------------------------------- + + +// since early 2009, the FEValues objects try to be more efficient by only +// recomputing things like gradients of shape functions if the cell on which +// we are is not a translation of the previous one. in this series of tests we +// make sure that this actually works the way it's supposed to be; in +// particular, if we create a mesh of two identical cells but one has a curved +// boundary, then they are the same if we use a Q1 mapping, but not a Q2 +// mapping. so we test that the mass matrix we get from each of these cells is +// actually different in the latter case, but the same in the former +// +// the various tests cell_similarity_dgp_monomial_?? differ in the mappings and finite +// elements in use + + +#include "../tests.h" +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include + + +bool equal (const FullMatrix &m1, + const FullMatrix &m2) +{ + double d = 0, s = 0; + for (unsigned int i=0; i +void test (const Triangulation& tr) +{ + FE_DGPMonomial fe(2); + deallog << "FE=" << fe.get_name() << std::endl; + + MappingQ mapping(1); + deallog << "Mapping=Q1" << std::endl; + + + DoFHandler dof(tr); + dof.distribute_dofs(fe); + + const QGauss quadrature(2); + FEValues fe_values (mapping, fe, quadrature, + update_values | update_gradients | + update_JxW_values); + + FullMatrix mass_matrix[2], laplace_matrix[2]; + mass_matrix[0].reinit(fe.dofs_per_cell, fe.dofs_per_cell); + mass_matrix[1].reinit(fe.dofs_per_cell, fe.dofs_per_cell); + laplace_matrix[0].reinit(fe.dofs_per_cell, fe.dofs_per_cell); + laplace_matrix[1].reinit(fe.dofs_per_cell, fe.dofs_per_cell); + + for (typename DoFHandler::active_cell_iterator + cell = dof.begin_active(); + cell != dof.end(); ++cell) + { + fe_values.reinit (cell); + + for (unsigned int i=0; iindex()](i,j) += fe_values.shape_value (i,q) * + fe_values.shape_value (j,q) * + fe_values.JxW(q); + laplace_matrix[cell->index()](i,j) += fe_values.shape_grad (i,q) * + fe_values.shape_grad (j,q) * + fe_values.JxW(q); + } + } + + // check what we expect for this mapping + // about equality or inequality of the + // matrices + deallog << "Mass matrices " + << (equal (mass_matrix[0], mass_matrix[1]) ? "are" : "are not") + << " equal." + << std::endl; + deallog << "Laplace matrices " + << (equal (laplace_matrix[0], laplace_matrix[1]) ? "are" : "are not") + << " equal." + << std::endl; + + for (unsigned int cell=0; cell<2; ++cell) + { + deallog << "cell=" << cell << std::endl; + deallog << "mass_matrix:" << std::endl; + for (unsigned int i=0; i +void test() +{ + Triangulation tr; + Point p1 = Point(); + Point p2 = (dim == 2 ? + Point(2,1) : + Point(2,1,1)); + std::vector subdivisions (dim, 1); + subdivisions[0] = 2; + GridGenerator::subdivided_hyper_rectangle(tr, subdivisions, p1, p2); + + static const HyperBallBoundary boundary; + tr.set_boundary (1, boundary); + + // set boundary id on cell 1 + for (unsigned int f=0; f::faces_per_cell; ++f) + if (tr.begin_active()->at_boundary(f)) + tr.begin_active()->face(f)->set_boundary_indicator (1); + + test(tr); +} + + +int main() +{ + std::ofstream logfile ("cell_similarity_dgp_monomial_04/output"); + deallog << std::setprecision (4); + + deallog.attach(logfile); + deallog.depth_console (0); + deallog.threshold_double(1.e-7); + + test<2>(); + test<3>(); +} diff --git a/tests/fe/cell_similarity_dgp_monomial_04/cmp/generic b/tests/fe/cell_similarity_dgp_monomial_04/cmp/generic new file mode 100644 index 0000000000..a5356addcb --- /dev/null +++ b/tests/fe/cell_similarity_dgp_monomial_04/cmp/generic @@ -0,0 +1,85 @@ + +DEAL::FE=FE_DGPMonomial<2>(2) +DEAL::Mapping=Q1 +DEAL::Mass matrices are equal. +DEAL::Laplace matrices are equal. +DEAL::cell=0 +DEAL::mass_matrix: +DEAL::1.000 0.5000 0.5000 0.2500 0.3333 0.3333 +DEAL::0.5000 0.3333 0.2500 0.1667 0.2500 0.1667 +DEAL::0.5000 0.2500 0.3333 0.1667 0.1667 0.2500 +DEAL::0.2500 0.1667 0.1667 0.1111 0.1250 0.1250 +DEAL::0.3333 0.2500 0.1667 0.1250 0.1944 0.1111 +DEAL::0.3333 0.1667 0.2500 0.1250 0.1111 0.1944 +DEAL::laplace_matrix: +DEAL::0 0 0 0 0 0 +DEAL::0 1.000 0 0.5000 1.000 0 +DEAL::0 0 1.000 0.5000 0 1.000 +DEAL::0 0.5000 0.5000 0.6667 0.5000 0.5000 +DEAL::0 1.000 0 0.5000 1.333 0 +DEAL::0 0 1.000 0.5000 0 1.333 +DEAL::cell=1 +DEAL::mass_matrix: +DEAL::1.000 0.5000 0.5000 0.2500 0.3333 0.3333 +DEAL::0.5000 0.3333 0.2500 0.1667 0.2500 0.1667 +DEAL::0.5000 0.2500 0.3333 0.1667 0.1667 0.2500 +DEAL::0.2500 0.1667 0.1667 0.1111 0.1250 0.1250 +DEAL::0.3333 0.2500 0.1667 0.1250 0.1944 0.1111 +DEAL::0.3333 0.1667 0.2500 0.1250 0.1111 0.1944 +DEAL::laplace_matrix: +DEAL::0 0 0 0 0 0 +DEAL::0 1.000 0 0.5000 1.000 0 +DEAL::0 0 1.000 0.5000 0 1.000 +DEAL::0 0.5000 0.5000 0.6667 0.5000 0.5000 +DEAL::0 1.000 0 0.5000 1.333 0 +DEAL::0 0 1.000 0.5000 0 1.333 +DEAL::FE=FE_DGPMonomial<3>(2) +DEAL::Mapping=Q1 +DEAL::Mass matrices are equal. +DEAL::Laplace matrices are equal. +DEAL::cell=0 +DEAL::mass_matrix: +DEAL::1.000 0.5000 0.5000 0.5000 0.2500 0.2500 0.2500 0.3333 0.3333 0.3333 +DEAL::0.5000 0.3333 0.2500 0.2500 0.1667 0.1667 0.1250 0.2500 0.1667 0.1667 +DEAL::0.5000 0.2500 0.3333 0.2500 0.1667 0.1250 0.1667 0.1667 0.2500 0.1667 +DEAL::0.5000 0.2500 0.2500 0.3333 0.1250 0.1667 0.1667 0.1667 0.1667 0.2500 +DEAL::0.2500 0.1667 0.1667 0.1250 0.1111 0.08333 0.08333 0.1250 0.1250 0.08333 +DEAL::0.2500 0.1667 0.1250 0.1667 0.08333 0.1111 0.08333 0.1250 0.08333 0.1250 +DEAL::0.2500 0.1250 0.1667 0.1667 0.08333 0.08333 0.1111 0.08333 0.1250 0.1250 +DEAL::0.3333 0.2500 0.1667 0.1667 0.1250 0.1250 0.08333 0.1944 0.1111 0.1111 +DEAL::0.3333 0.1667 0.2500 0.1667 0.1250 0.08333 0.1250 0.1111 0.1944 0.1111 +DEAL::0.3333 0.1667 0.1667 0.2500 0.08333 0.1250 0.1250 0.1111 0.1111 0.1944 +DEAL::laplace_matrix: +DEAL::0 0 0 0 0 0 0 0 0 0 +DEAL::0 1.000 0 0 0.5000 0.5000 0 1.000 0 0 +DEAL::0 0 1.000 0 0.5000 0 0.5000 0 1.000 0 +DEAL::0 0 0 1.000 0 0.5000 0.5000 0 0 1.000 +DEAL::0 0.5000 0.5000 0 0.6667 0.2500 0.2500 0.5000 0.5000 0 +DEAL::0 0.5000 0 0.5000 0.2500 0.6667 0.2500 0.5000 0 0.5000 +DEAL::0 0 0.5000 0.5000 0.2500 0.2500 0.6667 0 0.5000 0.5000 +DEAL::0 1.000 0 0 0.5000 0.5000 0 1.333 0 0 +DEAL::0 0 1.000 0 0.5000 0 0.5000 0 1.333 0 +DEAL::0 0 0 1.000 0 0.5000 0.5000 0 0 1.333 +DEAL::cell=1 +DEAL::mass_matrix: +DEAL::1.000 0.5000 0.5000 0.5000 0.2500 0.2500 0.2500 0.3333 0.3333 0.3333 +DEAL::0.5000 0.3333 0.2500 0.2500 0.1667 0.1667 0.1250 0.2500 0.1667 0.1667 +DEAL::0.5000 0.2500 0.3333 0.2500 0.1667 0.1250 0.1667 0.1667 0.2500 0.1667 +DEAL::0.5000 0.2500 0.2500 0.3333 0.1250 0.1667 0.1667 0.1667 0.1667 0.2500 +DEAL::0.2500 0.1667 0.1667 0.1250 0.1111 0.08333 0.08333 0.1250 0.1250 0.08333 +DEAL::0.2500 0.1667 0.1250 0.1667 0.08333 0.1111 0.08333 0.1250 0.08333 0.1250 +DEAL::0.2500 0.1250 0.1667 0.1667 0.08333 0.08333 0.1111 0.08333 0.1250 0.1250 +DEAL::0.3333 0.2500 0.1667 0.1667 0.1250 0.1250 0.08333 0.1944 0.1111 0.1111 +DEAL::0.3333 0.1667 0.2500 0.1667 0.1250 0.08333 0.1250 0.1111 0.1944 0.1111 +DEAL::0.3333 0.1667 0.1667 0.2500 0.08333 0.1250 0.1250 0.1111 0.1111 0.1944 +DEAL::laplace_matrix: +DEAL::0 0 0 0 0 0 0 0 0 0 +DEAL::0 1.000 0 0 0.5000 0.5000 0 1.000 0 0 +DEAL::0 0 1.000 0 0.5000 0 0.5000 0 1.000 0 +DEAL::0 0 0 1.000 0 0.5000 0.5000 0 0 1.000 +DEAL::0 0.5000 0.5000 0 0.6667 0.2500 0.2500 0.5000 0.5000 0 +DEAL::0 0.5000 0 0.5000 0.2500 0.6667 0.2500 0.5000 0 0.5000 +DEAL::0 0 0.5000 0.5000 0.2500 0.2500 0.6667 0 0.5000 0.5000 +DEAL::0 1.000 0 0 0.5000 0.5000 0 1.333 0 0 +DEAL::0 0 1.000 0 0.5000 0 0.5000 0 1.333 0 +DEAL::0 0 0 1.000 0 0.5000 0.5000 0 0 1.333 diff --git a/tests/fe/cell_similarity_dgp_monomial_05.cc b/tests/fe/cell_similarity_dgp_monomial_05.cc new file mode 100644 index 0000000000..c50061ccef --- /dev/null +++ b/tests/fe/cell_similarity_dgp_monomial_05.cc @@ -0,0 +1,174 @@ +//---------------------------------------------------------------------- +// $Id$ +// Version: $Name$ +// +// Copyright (C) 2009 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. +// +//---------------------------------------------------------------------- + + +// since early 2009, the FEValues objects try to be more efficient by only +// recomputing things like gradients of shape functions if the cell on which +// we are is not a translation of the previous one. in this series of tests we +// make sure that this actually works the way it's supposed to be; in +// particular, if we create a mesh of two identical cells but one has a curved +// boundary, then they are the same if we use a Q1 mapping, but not a Q2 +// mapping. so we test that the mass matrix we get from each of these cells is +// actually different in the latter case, but the same in the former +// +// the various tests cell_similarity_dgp_monomial_?? differ in the mappings and finite +// elements in use + + +#include "../tests.h" +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include + + +bool equal (const FullMatrix &m1, + const FullMatrix &m2) +{ + double d = 0, s = 0; + for (unsigned int i=0; i +void test (const Triangulation& tr) +{ + FE_DGPMonomial fe(1); + deallog << "FE=" << fe.get_name() << std::endl; + + MappingQ mapping(2); + deallog << "Mapping=Q2" << std::endl; + + + DoFHandler dof(tr); + dof.distribute_dofs(fe); + + const QGauss quadrature(2); + FEValues fe_values (mapping, fe, quadrature, + update_values | update_gradients | + update_JxW_values); + + FullMatrix mass_matrix[2], laplace_matrix[2]; + mass_matrix[0].reinit(fe.dofs_per_cell, fe.dofs_per_cell); + mass_matrix[1].reinit(fe.dofs_per_cell, fe.dofs_per_cell); + laplace_matrix[0].reinit(fe.dofs_per_cell, fe.dofs_per_cell); + laplace_matrix[1].reinit(fe.dofs_per_cell, fe.dofs_per_cell); + + for (typename DoFHandler::active_cell_iterator + cell = dof.begin_active(); + cell != dof.end(); ++cell) + { + fe_values.reinit (cell); + + for (unsigned int i=0; iindex()](i,j) += fe_values.shape_value (i,q) * + fe_values.shape_value (j,q) * + fe_values.JxW(q); + laplace_matrix[cell->index()](i,j) += fe_values.shape_grad (i,q) * + fe_values.shape_grad (j,q) * + fe_values.JxW(q); + } + } + + // check what we expect for this mapping + // about equality or inequality of the + // matrices + deallog << "Mass matrices " + << (equal (mass_matrix[0], mass_matrix[1]) ? "are" : "are not") + << " equal." + << std::endl; + deallog << "Laplace matrices " + << (equal (laplace_matrix[0], laplace_matrix[1]) ? "are" : "are not") + << " equal." + << std::endl; + + for (unsigned int cell=0; cell<2; ++cell) + { + deallog << "cell=" << cell << std::endl; + deallog << "mass_matrix:" << std::endl; + for (unsigned int i=0; i +void test() +{ + Triangulation tr; + Point p1 = Point(); + Point p2 = (dim == 2 ? + Point(2,1) : + Point(2,1,1)); + std::vector subdivisions (dim, 1); + subdivisions[0] = 2; + GridGenerator::subdivided_hyper_rectangle(tr, subdivisions, p1, p2); + + static const HyperBallBoundary boundary; + tr.set_boundary (1, boundary); + + // set boundary id on cell 1 + for (unsigned int f=0; f::faces_per_cell; ++f) + if (tr.begin_active()->at_boundary(f)) + tr.begin_active()->face(f)->set_boundary_indicator (1); + + test(tr); +} + + +int main() +{ + std::ofstream logfile ("cell_similarity_dgp_monomial_05/output"); + deallog << std::setprecision (4); + + deallog.attach(logfile); + deallog.depth_console (0); + deallog.threshold_double(1.e-7); + + test<2>(); + test<3>(); +} diff --git a/tests/fe/cell_similarity_dgp_monomial_05/cmp/generic b/tests/fe/cell_similarity_dgp_monomial_05/cmp/generic new file mode 100644 index 0000000000..6ed6e3be78 --- /dev/null +++ b/tests/fe/cell_similarity_dgp_monomial_05/cmp/generic @@ -0,0 +1,49 @@ + +DEAL::FE=FE_DGPMonomial<2>(1) +DEAL::Mapping=Q2 +DEAL::Mass matrices are not equal. +DEAL::Laplace matrices are not equal. +DEAL::cell=0 +DEAL::mass_matrix: +DEAL::0.9296 0.3715 0.3446 +DEAL::0.3715 0.2166 0.1883 +DEAL::0.3446 0.1883 0.1897 +DEAL::laplace_matrix: +DEAL::0 0 0 +DEAL::0 1.930 1.352 +DEAL::0 1.352 4.800 +DEAL::cell=1 +DEAL::mass_matrix: +DEAL::1.000 0.5000 0.5000 +DEAL::0.5000 0.3333 0.2500 +DEAL::0.5000 0.2500 0.3333 +DEAL::laplace_matrix: +DEAL::0 0 0 +DEAL::0 1.000 0 +DEAL::0 0 1.000 +DEAL::FE=FE_DGPMonomial<3>(1) +DEAL::Mapping=Q2 +DEAL::Mass matrices are not equal. +DEAL::Laplace matrices are not equal. +DEAL::cell=0 +DEAL::mass_matrix: +DEAL::0.8419 0.3942 0.3606 0.3606 +DEAL::0.3942 0.2539 0.1892 0.1892 +DEAL::0.3606 0.1892 0.2203 0.1794 +DEAL::0.3606 0.1892 0.1794 0.2203 +DEAL::laplace_matrix: +DEAL::0 0 0 0 +DEAL::0 1.041 0.4212 0.4212 +DEAL::0 0.4212 1.312 0.4953 +DEAL::0 0.4212 0.4953 1.312 +DEAL::cell=1 +DEAL::mass_matrix: +DEAL::1.000 0.5000 0.5000 0.5000 +DEAL::0.5000 0.3333 0.2500 0.2500 +DEAL::0.5000 0.2500 0.3333 0.2500 +DEAL::0.5000 0.2500 0.2500 0.3333 +DEAL::laplace_matrix: +DEAL::0 0 0 0 +DEAL::0 1.000 0 0 +DEAL::0 0 1.000 0 +DEAL::0 0 0 1.000 diff --git a/tests/fe/cell_similarity_dgp_monomial_06.cc b/tests/fe/cell_similarity_dgp_monomial_06.cc new file mode 100644 index 0000000000..f18ab68387 --- /dev/null +++ b/tests/fe/cell_similarity_dgp_monomial_06.cc @@ -0,0 +1,174 @@ +//---------------------------------------------------------------------- +// $Id$ +// Version: $Name$ +// +// Copyright (C) 2009 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. +// +//---------------------------------------------------------------------- + + +// since early 2009, the FEValues objects try to be more efficient by only +// recomputing things like gradients of shape functions if the cell on which +// we are is not a translation of the previous one. in this series of tests we +// make sure that this actually works the way it's supposed to be; in +// particular, if we create a mesh of two identical cells but one has a curved +// boundary, then they are the same if we use a Q1 mapping, but not a Q2 +// mapping. so we test that the mass matrix we get from each of these cells is +// actually different in the latter case, but the same in the former +// +// the various tests cell_similarity_dgp_monomial_?? differ in the mappings and finite +// elements in use + + +#include "../tests.h" +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include + + +bool equal (const FullMatrix &m1, + const FullMatrix &m2) +{ + double d = 0, s = 0; + for (unsigned int i=0; i +void test (const Triangulation& tr) +{ + FE_DGPMonomial fe(2); + deallog << "FE=" << fe.get_name() << std::endl; + + MappingQ mapping(2); + deallog << "Mapping=Q2" << std::endl; + + + DoFHandler dof(tr); + dof.distribute_dofs(fe); + + const QGauss quadrature(2); + FEValues fe_values (mapping, fe, quadrature, + update_values | update_gradients | + update_JxW_values); + + FullMatrix mass_matrix[2], laplace_matrix[2]; + mass_matrix[0].reinit(fe.dofs_per_cell, fe.dofs_per_cell); + mass_matrix[1].reinit(fe.dofs_per_cell, fe.dofs_per_cell); + laplace_matrix[0].reinit(fe.dofs_per_cell, fe.dofs_per_cell); + laplace_matrix[1].reinit(fe.dofs_per_cell, fe.dofs_per_cell); + + for (typename DoFHandler::active_cell_iterator + cell = dof.begin_active(); + cell != dof.end(); ++cell) + { + fe_values.reinit (cell); + + for (unsigned int i=0; iindex()](i,j) += fe_values.shape_value (i,q) * + fe_values.shape_value (j,q) * + fe_values.JxW(q); + laplace_matrix[cell->index()](i,j) += fe_values.shape_grad (i,q) * + fe_values.shape_grad (j,q) * + fe_values.JxW(q); + } + } + + // check what we expect for this mapping + // about equality or inequality of the + // matrices + deallog << "Mass matrices " + << (equal (mass_matrix[0], mass_matrix[1]) ? "are" : "are not") + << " equal." + << std::endl; + deallog << "Laplace matrices " + << (equal (laplace_matrix[0], laplace_matrix[1]) ? "are" : "are not") + << " equal." + << std::endl; + + for (unsigned int cell=0; cell<2; ++cell) + { + deallog << "cell=" << cell << std::endl; + deallog << "mass_matrix:" << std::endl; + for (unsigned int i=0; i +void test() +{ + Triangulation tr; + Point p1 = Point(); + Point p2 = (dim == 2 ? + Point(2,1) : + Point(2,1,1)); + std::vector subdivisions (dim, 1); + subdivisions[0] = 2; + GridGenerator::subdivided_hyper_rectangle(tr, subdivisions, p1, p2); + + static const HyperBallBoundary boundary; + tr.set_boundary (1, boundary); + + // set boundary id on cell 1 + for (unsigned int f=0; f::faces_per_cell; ++f) + if (tr.begin_active()->at_boundary(f)) + tr.begin_active()->face(f)->set_boundary_indicator (1); + + test(tr); +} + + +int main() +{ + std::ofstream logfile ("cell_similarity_dgp_monomial_06/output"); + deallog << std::setprecision (4); + + deallog.attach(logfile); + deallog.depth_console (0); + deallog.threshold_double(1.e-7); + + test<2>(); + test<3>(); +} diff --git a/tests/fe/cell_similarity_dgp_monomial_06/cmp/generic b/tests/fe/cell_similarity_dgp_monomial_06/cmp/generic new file mode 100644 index 0000000000..2cc704bc16 --- /dev/null +++ b/tests/fe/cell_similarity_dgp_monomial_06/cmp/generic @@ -0,0 +1,85 @@ + +DEAL::FE=FE_DGPMonomial<2>(2) +DEAL::Mapping=Q2 +DEAL::Mass matrices are not equal. +DEAL::Laplace matrices are not equal. +DEAL::cell=0 +DEAL::mass_matrix: +DEAL::0.9296 0.3715 0.3446 0.1883 0.2166 0.1897 +DEAL::0.3715 0.2166 0.1883 0.1309 0.1547 0.1264 +DEAL::0.3446 0.1883 0.1897 0.1264 0.1309 0.1323 +DEAL::0.1883 0.1309 0.1264 0.09477 0.09948 0.09500 +DEAL::0.2166 0.1547 0.1309 0.09948 0.1186 0.09477 +DEAL::0.1897 0.1264 0.1323 0.09500 0.09477 0.1006 +DEAL::laplace_matrix: +DEAL::0 0 0 0 0 0 +DEAL::0 1.930 1.352 1.098 2.451 1.602 +DEAL::0 1.352 4.800 2.053 0.9102 7.074 +DEAL::0 1.098 2.053 1.205 1.216 2.949 +DEAL::0 2.451 0.9102 1.216 3.615 0.8631 +DEAL::0 1.602 7.074 2.949 0.8631 10.95 +DEAL::cell=1 +DEAL::mass_matrix: +DEAL::1.000 0.5000 0.5000 0.2500 0.3333 0.3333 +DEAL::0.5000 0.3333 0.2500 0.1667 0.2500 0.1667 +DEAL::0.5000 0.2500 0.3333 0.1667 0.1667 0.2500 +DEAL::0.2500 0.1667 0.1667 0.1111 0.1250 0.1250 +DEAL::0.3333 0.2500 0.1667 0.1250 0.1944 0.1111 +DEAL::0.3333 0.1667 0.2500 0.1250 0.1111 0.1944 +DEAL::laplace_matrix: +DEAL::0 0 0 0 0 0 +DEAL::0 1.000 0 0.5000 1.000 0 +DEAL::0 0 1.000 0.5000 0 1.000 +DEAL::0 0.5000 0.5000 0.6667 0.5000 0.5000 +DEAL::0 1.000 0 0.5000 1.333 0 +DEAL::0 0 1.000 0.5000 0 1.333 +DEAL::FE=FE_DGPMonomial<3>(2) +DEAL::Mapping=Q2 +DEAL::Mass matrices are not equal. +DEAL::Laplace matrices are not equal. +DEAL::cell=0 +DEAL::mass_matrix: +DEAL::0.8419 0.3942 0.3606 0.3606 0.1892 0.1892 0.1794 0.2539 0.2203 0.2203 +DEAL::0.3942 0.2539 0.1892 0.1892 0.1291 0.1291 0.1017 0.1882 0.1235 0.1235 +DEAL::0.3606 0.1892 0.2203 0.1794 0.1235 0.1017 0.1193 0.1291 0.1602 0.1193 +DEAL::0.3606 0.1892 0.1794 0.2203 0.1017 0.1235 0.1193 0.1291 0.1193 0.1602 +DEAL::0.1892 0.1291 0.1235 0.1017 0.08679 0.07184 0.07021 0.09758 0.09198 0.07021 +DEAL::0.1892 0.1291 0.1017 0.1235 0.07184 0.08679 0.07021 0.09758 0.07021 0.09198 +DEAL::0.1794 0.1017 0.1193 0.1193 0.07021 0.07021 0.08261 0.07184 0.08942 0.08942 +DEAL::0.2539 0.1882 0.1291 0.1291 0.09758 0.09758 0.07184 0.1459 0.08679 0.08679 +DEAL::0.2203 0.1235 0.1602 0.1193 0.09198 0.07021 0.08942 0.08679 0.1235 0.08261 +DEAL::0.2203 0.1235 0.1193 0.1602 0.07021 0.09198 0.08942 0.08679 0.08261 0.1235 +DEAL::laplace_matrix: +DEAL::0 0 0 0 0 0 0 0 0 0 +DEAL::0 1.041 0.4212 0.4212 0.6216 0.6216 0.3551 1.086 0.4638 0.4638 +DEAL::0 0.4212 1.312 0.4953 0.8130 0.3591 0.8161 0.3333 1.524 0.4967 +DEAL::0 0.4212 0.4953 1.312 0.3591 0.8130 0.8161 0.3333 0.4967 1.524 +DEAL::0 0.6216 0.8130 0.3591 0.8054 0.4236 0.5330 0.6581 0.9996 0.3187 +DEAL::0 0.6216 0.3591 0.8130 0.4236 0.8054 0.5330 0.6581 0.3187 0.9996 +DEAL::0 0.3551 0.8161 0.8161 0.5330 0.5330 0.8905 0.2349 0.9729 0.9729 +DEAL::0 1.086 0.3333 0.3333 0.6581 0.6581 0.2349 1.478 0.3230 0.3230 +DEAL::0 0.4638 1.524 0.4967 0.9996 0.3187 0.9729 0.3230 2.173 0.3850 +DEAL::0 0.4638 0.4967 1.524 0.3187 0.9996 0.9729 0.3230 0.3850 2.173 +DEAL::cell=1 +DEAL::mass_matrix: +DEAL::1.000 0.5000 0.5000 0.5000 0.2500 0.2500 0.2500 0.3333 0.3333 0.3333 +DEAL::0.5000 0.3333 0.2500 0.2500 0.1667 0.1667 0.1250 0.2500 0.1667 0.1667 +DEAL::0.5000 0.2500 0.3333 0.2500 0.1667 0.1250 0.1667 0.1667 0.2500 0.1667 +DEAL::0.5000 0.2500 0.2500 0.3333 0.1250 0.1667 0.1667 0.1667 0.1667 0.2500 +DEAL::0.2500 0.1667 0.1667 0.1250 0.1111 0.08333 0.08333 0.1250 0.1250 0.08333 +DEAL::0.2500 0.1667 0.1250 0.1667 0.08333 0.1111 0.08333 0.1250 0.08333 0.1250 +DEAL::0.2500 0.1250 0.1667 0.1667 0.08333 0.08333 0.1111 0.08333 0.1250 0.1250 +DEAL::0.3333 0.2500 0.1667 0.1667 0.1250 0.1250 0.08333 0.1944 0.1111 0.1111 +DEAL::0.3333 0.1667 0.2500 0.1667 0.1250 0.08333 0.1250 0.1111 0.1944 0.1111 +DEAL::0.3333 0.1667 0.1667 0.2500 0.08333 0.1250 0.1250 0.1111 0.1111 0.1944 +DEAL::laplace_matrix: +DEAL::0 0 0 0 0 0 0 0 0 0 +DEAL::0 1.000 0 0 0.5000 0.5000 0 1.000 0 0 +DEAL::0 0 1.000 0 0.5000 0 0.5000 0 1.000 0 +DEAL::0 0 0 1.000 0 0.5000 0.5000 0 0 1.000 +DEAL::0 0.5000 0.5000 0 0.6667 0.2500 0.2500 0.5000 0.5000 0 +DEAL::0 0.5000 0 0.5000 0.2500 0.6667 0.2500 0.5000 0 0.5000 +DEAL::0 0 0.5000 0.5000 0.2500 0.2500 0.6667 0 0.5000 0.5000 +DEAL::0 1.000 0 0 0.5000 0.5000 0 1.333 0 0 +DEAL::0 0 1.000 0 0.5000 0 0.5000 0 1.333 0 +DEAL::0 0 0 1.000 0 0.5000 0.5000 0 0 1.333 diff --git a/tests/fe/cell_similarity_dgp_monomial_07.cc b/tests/fe/cell_similarity_dgp_monomial_07.cc new file mode 100644 index 0000000000..eec40d0912 --- /dev/null +++ b/tests/fe/cell_similarity_dgp_monomial_07.cc @@ -0,0 +1,174 @@ +//---------------------------------------------------------------------- +// $Id$ +// Version: $Name$ +// +// Copyright (C) 2009 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. +// +//---------------------------------------------------------------------- + + +// since early 2009, the FEValues objects try to be more efficient by only +// recomputing things like gradients of shape functions if the cell on which +// we are is not a translation of the previous one. in this series of tests we +// make sure that this actually works the way it's supposed to be; in +// particular, if we create a mesh of two identical cells but one has a curved +// boundary, then they are the same if we use a Q1 mapping, but not a Q2 +// mapping. so we test that the mass matrix we get from each of these cells is +// actually different in the latter case, but the same in the former +// +// the various tests cell_similarity_dgp_monomial_?? differ in the mappings and finite +// elements in use + + +#include "../tests.h" +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include + + +bool equal (const FullMatrix &m1, + const FullMatrix &m2) +{ + double d = 0, s = 0; + for (unsigned int i=0; i +void test (const Triangulation& tr) +{ + FE_DGPMonomial fe(1); + deallog << "FE=" << fe.get_name() << std::endl; + + MappingC1 mapping; + deallog << "Mapping=C1" << std::endl; + + + DoFHandler dof(tr); + dof.distribute_dofs(fe); + + const QGauss quadrature(2); + FEValues fe_values (mapping, fe, quadrature, + update_values | update_gradients | + update_JxW_values); + + FullMatrix mass_matrix[2], laplace_matrix[2]; + mass_matrix[0].reinit(fe.dofs_per_cell, fe.dofs_per_cell); + mass_matrix[1].reinit(fe.dofs_per_cell, fe.dofs_per_cell); + laplace_matrix[0].reinit(fe.dofs_per_cell, fe.dofs_per_cell); + laplace_matrix[1].reinit(fe.dofs_per_cell, fe.dofs_per_cell); + + for (typename DoFHandler::active_cell_iterator + cell = dof.begin_active(); + cell != dof.end(); ++cell) + { + fe_values.reinit (cell); + + for (unsigned int i=0; iindex()](i,j) += fe_values.shape_value (i,q) * + fe_values.shape_value (j,q) * + fe_values.JxW(q); + laplace_matrix[cell->index()](i,j) += fe_values.shape_grad (i,q) * + fe_values.shape_grad (j,q) * + fe_values.JxW(q); + } + } + + // check what we expect for this mapping + // about equality or inequality of the + // matrices + deallog << "Mass matrices " + << (equal (mass_matrix[0], mass_matrix[1]) ? "are" : "are not") + << " equal." + << std::endl; + deallog << "Laplace matrices " + << (equal (laplace_matrix[0], laplace_matrix[1]) ? "are" : "are not") + << " equal." + << std::endl; + + for (unsigned int cell=0; cell<2; ++cell) + { + deallog << "cell=" << cell << std::endl; + deallog << "mass_matrix:" << std::endl; + for (unsigned int i=0; i +void test() +{ + Triangulation tr; + Point p1 = Point(); + Point p2 = (dim == 2 ? + Point(2,1) : + Point(2,1,1)); + std::vector subdivisions (dim, 1); + subdivisions[0] = 2; + GridGenerator::subdivided_hyper_rectangle(tr, subdivisions, p1, p2); + + static const HyperBallBoundary boundary; + tr.set_boundary (1, boundary); + + // set boundary id on cell 1 + for (unsigned int f=0; f::faces_per_cell; ++f) + if (tr.begin_active()->at_boundary(f)) + tr.begin_active()->face(f)->set_boundary_indicator (1); + + test(tr); +} + + +int main() +{ + std::ofstream logfile ("cell_similarity_dgp_monomial_07/output"); + deallog << std::setprecision (4); + + deallog.attach(logfile); + deallog.depth_console (0); + deallog.threshold_double(1.e-7); + + test<2>(); + //test<3>(); +} diff --git a/tests/fe/cell_similarity_dgp_monomial_07/cmp/generic b/tests/fe/cell_similarity_dgp_monomial_07/cmp/generic new file mode 100644 index 0000000000..74460e5960 --- /dev/null +++ b/tests/fe/cell_similarity_dgp_monomial_07/cmp/generic @@ -0,0 +1,23 @@ + +DEAL::FE=FE_DGPMonomial<2>(1) +DEAL::Mapping=C1 +DEAL::Mass matrices are not equal. +DEAL::Laplace matrices are not equal. +DEAL::cell=0 +DEAL::mass_matrix: +DEAL::nan nan nan +DEAL::nan nan nan +DEAL::nan nan nan +DEAL::laplace_matrix: +DEAL::nan nan nan +DEAL::nan nan nan +DEAL::nan nan nan +DEAL::cell=1 +DEAL::mass_matrix: +DEAL::1.000 0.5000 0.5000 +DEAL::0.5000 0.3333 0.2500 +DEAL::0.5000 0.2500 0.3333 +DEAL::laplace_matrix: +DEAL::0 0 0 +DEAL::0 1.000 0 +DEAL::0 0 1.000 diff --git a/tests/fe/cell_similarity_dgp_monomial_08.cc b/tests/fe/cell_similarity_dgp_monomial_08.cc new file mode 100644 index 0000000000..677d65db27 --- /dev/null +++ b/tests/fe/cell_similarity_dgp_monomial_08.cc @@ -0,0 +1,174 @@ +//---------------------------------------------------------------------- +// $Id$ +// Version: $Name$ +// +// Copyright (C) 2009 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. +// +//---------------------------------------------------------------------- + + +// since early 2009, the FEValues objects try to be more efficient by only +// recomputing things like gradients of shape functions if the cell on which +// we are is not a translation of the previous one. in this series of tests we +// make sure that this actually works the way it's supposed to be; in +// particular, if we create a mesh of two identical cells but one has a curved +// boundary, then they are the same if we use a Q1 mapping, but not a Q2 +// mapping. so we test that the mass matrix we get from each of these cells is +// actually different in the latter case, but the same in the former +// +// the various tests cell_similarity_dgp_monomial_?? differ in the mappings and finite +// elements in use + + +#include "../tests.h" +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include + + +bool equal (const FullMatrix &m1, + const FullMatrix &m2) +{ + double d = 0, s = 0; + for (unsigned int i=0; i +void test (const Triangulation& tr) +{ + FE_DGPMonomial fe(2); + deallog << "FE=" << fe.get_name() << std::endl; + + MappingC1 mapping; + deallog << "Mapping=C1" << std::endl; + + + DoFHandler dof(tr); + dof.distribute_dofs(fe); + + const QGauss quadrature(2); + FEValues fe_values (mapping, fe, quadrature, + update_values | update_gradients | + update_JxW_values); + + FullMatrix mass_matrix[2], laplace_matrix[2]; + mass_matrix[0].reinit(fe.dofs_per_cell, fe.dofs_per_cell); + mass_matrix[1].reinit(fe.dofs_per_cell, fe.dofs_per_cell); + laplace_matrix[0].reinit(fe.dofs_per_cell, fe.dofs_per_cell); + laplace_matrix[1].reinit(fe.dofs_per_cell, fe.dofs_per_cell); + + for (typename DoFHandler::active_cell_iterator + cell = dof.begin_active(); + cell != dof.end(); ++cell) + { + fe_values.reinit (cell); + + for (unsigned int i=0; iindex()](i,j) += fe_values.shape_value (i,q) * + fe_values.shape_value (j,q) * + fe_values.JxW(q); + laplace_matrix[cell->index()](i,j) += fe_values.shape_grad (i,q) * + fe_values.shape_grad (j,q) * + fe_values.JxW(q); + } + } + + // check what we expect for this mapping + // about equality or inequality of the + // matrices + deallog << "Mass matrices " + << (equal (mass_matrix[0], mass_matrix[1]) ? "are" : "are not") + << " equal." + << std::endl; + deallog << "Laplace matrices " + << (equal (laplace_matrix[0], laplace_matrix[1]) ? "are" : "are not") + << " equal." + << std::endl; + + for (unsigned int cell=0; cell<2; ++cell) + { + deallog << "cell=" << cell << std::endl; + deallog << "mass_matrix:" << std::endl; + for (unsigned int i=0; i +void test() +{ + Triangulation tr; + Point p1 = Point(); + Point p2 = (dim == 2 ? + Point(2,1) : + Point(2,1,1)); + std::vector subdivisions (dim, 1); + subdivisions[0] = 2; + GridGenerator::subdivided_hyper_rectangle(tr, subdivisions, p1, p2); + + static const HyperBallBoundary boundary; + tr.set_boundary (1, boundary); + + // set boundary id on cell 1 + for (unsigned int f=0; f::faces_per_cell; ++f) + if (tr.begin_active()->at_boundary(f)) + tr.begin_active()->face(f)->set_boundary_indicator (1); + + test(tr); +} + + +int main() +{ + std::ofstream logfile ("cell_similarity_dgp_monomial_08/output"); + deallog << std::setprecision (4); + + deallog.attach(logfile); + deallog.depth_console (0); + deallog.threshold_double(1.e-7); + + test<2>(); + //test<3>(); +} diff --git a/tests/fe/cell_similarity_dgp_monomial_08/cmp/generic b/tests/fe/cell_similarity_dgp_monomial_08/cmp/generic new file mode 100644 index 0000000000..ef93432ba5 --- /dev/null +++ b/tests/fe/cell_similarity_dgp_monomial_08/cmp/generic @@ -0,0 +1,35 @@ + +DEAL::FE=FE_DGPMonomial<2>(2) +DEAL::Mapping=C1 +DEAL::Mass matrices are not equal. +DEAL::Laplace matrices are not equal. +DEAL::cell=0 +DEAL::mass_matrix: +DEAL::nan nan nan nan nan nan +DEAL::nan nan nan nan nan nan +DEAL::nan nan nan nan nan nan +DEAL::nan nan nan nan nan nan +DEAL::nan nan nan nan nan nan +DEAL::nan nan nan nan nan nan +DEAL::laplace_matrix: +DEAL::nan nan nan nan nan nan +DEAL::nan nan nan nan nan nan +DEAL::nan nan nan nan nan nan +DEAL::nan nan nan nan nan nan +DEAL::nan nan nan nan nan nan +DEAL::nan nan nan nan nan nan +DEAL::cell=1 +DEAL::mass_matrix: +DEAL::1.000 0.5000 0.5000 0.2500 0.3333 0.3333 +DEAL::0.5000 0.3333 0.2500 0.1667 0.2500 0.1667 +DEAL::0.5000 0.2500 0.3333 0.1667 0.1667 0.2500 +DEAL::0.2500 0.1667 0.1667 0.1111 0.1250 0.1250 +DEAL::0.3333 0.2500 0.1667 0.1250 0.1944 0.1111 +DEAL::0.3333 0.1667 0.2500 0.1250 0.1111 0.1944 +DEAL::laplace_matrix: +DEAL::0 0 0 0 0 0 +DEAL::0 1.000 0 0.5000 1.000 0 +DEAL::0 0 1.000 0.5000 0 1.000 +DEAL::0 0.5000 0.5000 0.6667 0.5000 0.5000 +DEAL::0 1.000 0 0.5000 1.333 0 +DEAL::0 0 1.000 0.5000 0 1.333 diff --git a/tests/fe/cell_similarity_dgp_monomial_09.cc b/tests/fe/cell_similarity_dgp_monomial_09.cc new file mode 100644 index 0000000000..865347c860 --- /dev/null +++ b/tests/fe/cell_similarity_dgp_monomial_09.cc @@ -0,0 +1,174 @@ +//---------------------------------------------------------------------- +// $Id$ +// Version: $Name$ +// +// Copyright (C) 2009 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. +// +//---------------------------------------------------------------------- + + +// since early 2009, the FEValues objects try to be more efficient by only +// recomputing things like gradients of shape functions if the cell on which +// we are is not a translation of the previous one. in this series of tests we +// make sure that this actually works the way it's supposed to be; in +// particular, if we create a mesh of two identical cells but one has a curved +// boundary, then they are the same if we use a Q1 mapping, but not a Q2 +// mapping. so we test that the mass matrix we get from each of these cells is +// actually different in the latter case, but the same in the former +// +// the various tests cell_similarity_dgp_monomial_?? differ in the mappings and finite +// elements in use + + +#include "../tests.h" +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include + + +bool equal (const FullMatrix &m1, + const FullMatrix &m2) +{ + double d = 0, s = 0; + for (unsigned int i=0; i +void test (const Triangulation& tr) +{ + FE_DGPMonomial fe(1); + deallog << "FE=" << fe.get_name() << std::endl; + + MappingCartesian mapping; + deallog << "Mapping=Cartesian" << std::endl; + + + DoFHandler dof(tr); + dof.distribute_dofs(fe); + + const QGauss quadrature(2); + FEValues fe_values (mapping, fe, quadrature, + update_values | update_gradients | + update_JxW_values); + + FullMatrix mass_matrix[2], laplace_matrix[2]; + mass_matrix[0].reinit(fe.dofs_per_cell, fe.dofs_per_cell); + mass_matrix[1].reinit(fe.dofs_per_cell, fe.dofs_per_cell); + laplace_matrix[0].reinit(fe.dofs_per_cell, fe.dofs_per_cell); + laplace_matrix[1].reinit(fe.dofs_per_cell, fe.dofs_per_cell); + + for (typename DoFHandler::active_cell_iterator + cell = dof.begin_active(); + cell != dof.end(); ++cell) + { + fe_values.reinit (cell); + + for (unsigned int i=0; iindex()](i,j) += fe_values.shape_value (i,q) * + fe_values.shape_value (j,q) * + fe_values.JxW(q); + laplace_matrix[cell->index()](i,j) += fe_values.shape_grad (i,q) * + fe_values.shape_grad (j,q) * + fe_values.JxW(q); + } + } + + // check what we expect for this mapping + // about equality or inequality of the + // matrices + deallog << "Mass matrices " + << (equal (mass_matrix[0], mass_matrix[1]) ? "are" : "are not") + << " equal." + << std::endl; + deallog << "Laplace matrices " + << (equal (laplace_matrix[0], laplace_matrix[1]) ? "are" : "are not") + << " equal." + << std::endl; + + for (unsigned int cell=0; cell<2; ++cell) + { + deallog << "cell=" << cell << std::endl; + deallog << "mass_matrix:" << std::endl; + for (unsigned int i=0; i +void test() +{ + Triangulation tr; + Point p1 = Point(); + Point p2 = (dim == 2 ? + Point(2,1) : + Point(2,1,1)); + std::vector subdivisions (dim, 1); + subdivisions[0] = 2; + GridGenerator::subdivided_hyper_rectangle(tr, subdivisions, p1, p2); + + static const HyperBallBoundary boundary; + tr.set_boundary (1, boundary); + + // set boundary id on cell 1 + for (unsigned int f=0; f::faces_per_cell; ++f) + if (tr.begin_active()->at_boundary(f)) + tr.begin_active()->face(f)->set_boundary_indicator (1); + + test(tr); +} + + +int main() +{ + std::ofstream logfile ("cell_similarity_dgp_monomial_09/output"); + deallog << std::setprecision (4); + + deallog.attach(logfile); + deallog.depth_console (0); + deallog.threshold_double(1.e-7); + + test<2>(); + //test<3>(); +} diff --git a/tests/fe/cell_similarity_dgp_monomial_09/cmp/generic b/tests/fe/cell_similarity_dgp_monomial_09/cmp/generic new file mode 100644 index 0000000000..4394282330 --- /dev/null +++ b/tests/fe/cell_similarity_dgp_monomial_09/cmp/generic @@ -0,0 +1,23 @@ + +DEAL::FE=FE_DGPMonomial<2>(1) +DEAL::Mapping=Cartesian +DEAL::Mass matrices are equal. +DEAL::Laplace matrices are equal. +DEAL::cell=0 +DEAL::mass_matrix: +DEAL::1.000 0.5000 0.5000 +DEAL::0.5000 0.3333 0.2500 +DEAL::0.5000 0.2500 0.3333 +DEAL::laplace_matrix: +DEAL::0 0 0 +DEAL::0 1.000 0 +DEAL::0 0 1.000 +DEAL::cell=1 +DEAL::mass_matrix: +DEAL::1.000 0.5000 0.5000 +DEAL::0.5000 0.3333 0.2500 +DEAL::0.5000 0.2500 0.3333 +DEAL::laplace_matrix: +DEAL::0 0 0 +DEAL::0 1.000 0 +DEAL::0 0 1.000 diff --git a/tests/fe/cell_similarity_dgp_monomial_10.cc b/tests/fe/cell_similarity_dgp_monomial_10.cc new file mode 100644 index 0000000000..e4057e2625 --- /dev/null +++ b/tests/fe/cell_similarity_dgp_monomial_10.cc @@ -0,0 +1,174 @@ +//---------------------------------------------------------------------- +// $Id$ +// Version: $Name$ +// +// Copyright (C) 2009 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. +// +//---------------------------------------------------------------------- + + +// since early 2009, the FEValues objects try to be more efficient by only +// recomputing things like gradients of shape functions if the cell on which +// we are is not a translation of the previous one. in this series of tests we +// make sure that this actually works the way it's supposed to be; in +// particular, if we create a mesh of two identical cells but one has a curved +// boundary, then they are the same if we use a Q1 mapping, but not a Q2 +// mapping. so we test that the mass matrix we get from each of these cells is +// actually different in the latter case, but the same in the former +// +// the various tests cell_similarity_dgp_monomial_?? differ in the mappings and finite +// elements in use + + +#include "../tests.h" +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include + + +bool equal (const FullMatrix &m1, + const FullMatrix &m2) +{ + double d = 0, s = 0; + for (unsigned int i=0; i +void test (const Triangulation& tr) +{ + FE_DGPMonomial fe(2); + deallog << "FE=" << fe.get_name() << std::endl; + + MappingCartesian mapping; + deallog << "Mapping=Cartesian" << std::endl; + + + DoFHandler dof(tr); + dof.distribute_dofs(fe); + + const QGauss quadrature(2); + FEValues fe_values (mapping, fe, quadrature, + update_values | update_gradients | + update_JxW_values); + + FullMatrix mass_matrix[2], laplace_matrix[2]; + mass_matrix[0].reinit(fe.dofs_per_cell, fe.dofs_per_cell); + mass_matrix[1].reinit(fe.dofs_per_cell, fe.dofs_per_cell); + laplace_matrix[0].reinit(fe.dofs_per_cell, fe.dofs_per_cell); + laplace_matrix[1].reinit(fe.dofs_per_cell, fe.dofs_per_cell); + + for (typename DoFHandler::active_cell_iterator + cell = dof.begin_active(); + cell != dof.end(); ++cell) + { + fe_values.reinit (cell); + + for (unsigned int i=0; iindex()](i,j) += fe_values.shape_value (i,q) * + fe_values.shape_value (j,q) * + fe_values.JxW(q); + laplace_matrix[cell->index()](i,j) += fe_values.shape_grad (i,q) * + fe_values.shape_grad (j,q) * + fe_values.JxW(q); + } + } + + // check what we expect for this mapping + // about equality or inequality of the + // matrices + deallog << "Mass matrices " + << (equal (mass_matrix[0], mass_matrix[1]) ? "are" : "are not") + << " equal." + << std::endl; + deallog << "Laplace matrices " + << (equal (laplace_matrix[0], laplace_matrix[1]) ? "are" : "are not") + << " equal." + << std::endl; + + for (unsigned int cell=0; cell<2; ++cell) + { + deallog << "cell=" << cell << std::endl; + deallog << "mass_matrix:" << std::endl; + for (unsigned int i=0; i +void test() +{ + Triangulation tr; + Point p1 = Point(); + Point p2 = (dim == 2 ? + Point(2,1) : + Point(2,1,1)); + std::vector subdivisions (dim, 1); + subdivisions[0] = 2; + GridGenerator::subdivided_hyper_rectangle(tr, subdivisions, p1, p2); + + static const HyperBallBoundary boundary; + tr.set_boundary (1, boundary); + + // set boundary id on cell 1 + for (unsigned int f=0; f::faces_per_cell; ++f) + if (tr.begin_active()->at_boundary(f)) + tr.begin_active()->face(f)->set_boundary_indicator (1); + + test(tr); +} + + +int main() +{ + std::ofstream logfile ("cell_similarity_dgp_monomial_10/output"); + deallog << std::setprecision (4); + + deallog.attach(logfile); + deallog.depth_console (0); + deallog.threshold_double(1.e-7); + + test<2>(); + //test<3>(); +} diff --git a/tests/fe/cell_similarity_dgp_monomial_10/cmp/generic b/tests/fe/cell_similarity_dgp_monomial_10/cmp/generic new file mode 100644 index 0000000000..b0657fccff --- /dev/null +++ b/tests/fe/cell_similarity_dgp_monomial_10/cmp/generic @@ -0,0 +1,35 @@ + +DEAL::FE=FE_DGPMonomial<2>(2) +DEAL::Mapping=Cartesian +DEAL::Mass matrices are equal. +DEAL::Laplace matrices are equal. +DEAL::cell=0 +DEAL::mass_matrix: +DEAL::1.000 0.5000 0.5000 0.2500 0.3333 0.3333 +DEAL::0.5000 0.3333 0.2500 0.1667 0.2500 0.1667 +DEAL::0.5000 0.2500 0.3333 0.1667 0.1667 0.2500 +DEAL::0.2500 0.1667 0.1667 0.1111 0.1250 0.1250 +DEAL::0.3333 0.2500 0.1667 0.1250 0.1944 0.1111 +DEAL::0.3333 0.1667 0.2500 0.1250 0.1111 0.1944 +DEAL::laplace_matrix: +DEAL::0 0 0 0 0 0 +DEAL::0 1.000 0 0.5000 1.000 0 +DEAL::0 0 1.000 0.5000 0 1.000 +DEAL::0 0.5000 0.5000 0.6667 0.5000 0.5000 +DEAL::0 1.000 0 0.5000 1.333 0 +DEAL::0 0 1.000 0.5000 0 1.333 +DEAL::cell=1 +DEAL::mass_matrix: +DEAL::1.000 0.5000 0.5000 0.2500 0.3333 0.3333 +DEAL::0.5000 0.3333 0.2500 0.1667 0.2500 0.1667 +DEAL::0.5000 0.2500 0.3333 0.1667 0.1667 0.2500 +DEAL::0.2500 0.1667 0.1667 0.1111 0.1250 0.1250 +DEAL::0.3333 0.2500 0.1667 0.1250 0.1944 0.1111 +DEAL::0.3333 0.1667 0.2500 0.1250 0.1111 0.1944 +DEAL::laplace_matrix: +DEAL::0 0 0 0 0 0 +DEAL::0 1.000 0 0.5000 1.000 0 +DEAL::0 0 1.000 0.5000 0 1.000 +DEAL::0 0.5000 0.5000 0.6667 0.5000 0.5000 +DEAL::0 1.000 0 0.5000 1.333 0 +DEAL::0 0 1.000 0.5000 0 1.333 diff --git a/tests/fe/cell_similarity_dgp_nonparametric_01.cc b/tests/fe/cell_similarity_dgp_nonparametric_01.cc new file mode 100644 index 0000000000..8cadc61f25 --- /dev/null +++ b/tests/fe/cell_similarity_dgp_nonparametric_01.cc @@ -0,0 +1,174 @@ +//---------------------------------------------------------------------- +// $Id$ +// Version: $Name$ +// +// Copyright (C) 2009 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. +// +//---------------------------------------------------------------------- + + +// since early 2009, the FEValues objects try to be more efficient by only +// recomputing things like gradients of shape functions if the cell on which +// we are is not a translation of the previous one. in this series of tests we +// make sure that this actually works the way it's supposed to be; in +// particular, if we create a mesh of two identical cells but one has a curved +// boundary, then they are the same if we use a Q1 mapping, but not a Q2 +// mapping. so we test that the mass matrix we get from each of these cells is +// actually different in the latter case, but the same in the former +// +// the various tests cell_similarity_dgp_nonparametric_?? differ in the mappings and finite +// elements in use + + +#include "../tests.h" +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include + + +bool equal (const FullMatrix &m1, + const FullMatrix &m2) +{ + double d = 0, s = 0; + for (unsigned int i=0; i +void test (const Triangulation& tr) +{ + FE_DGPNonparametric fe(1); + deallog << "FE=" << fe.get_name() << std::endl; + + MappingQ1 mapping; + deallog << "Mapping=Q1" << std::endl; + + + DoFHandler dof(tr); + dof.distribute_dofs(fe); + + const QGauss quadrature(2); + FEValues fe_values (mapping, fe, quadrature, + update_values | update_gradients | + update_JxW_values); + + FullMatrix mass_matrix[2], laplace_matrix[2]; + mass_matrix[0].reinit(fe.dofs_per_cell, fe.dofs_per_cell); + mass_matrix[1].reinit(fe.dofs_per_cell, fe.dofs_per_cell); + laplace_matrix[0].reinit(fe.dofs_per_cell, fe.dofs_per_cell); + laplace_matrix[1].reinit(fe.dofs_per_cell, fe.dofs_per_cell); + + for (typename DoFHandler::active_cell_iterator + cell = dof.begin_active(); + cell != dof.end(); ++cell) + { + fe_values.reinit (cell); + + for (unsigned int i=0; iindex()](i,j) += fe_values.shape_value (i,q) * + fe_values.shape_value (j,q) * + fe_values.JxW(q); + laplace_matrix[cell->index()](i,j) += fe_values.shape_grad (i,q) * + fe_values.shape_grad (j,q) * + fe_values.JxW(q); + } + } + + // check what we expect for this mapping + // about equality or inequality of the + // matrices + deallog << "Mass matrices " + << (equal (mass_matrix[0], mass_matrix[1]) ? "are" : "are not") + << " equal." + << std::endl; + deallog << "Laplace matrices " + << (equal (laplace_matrix[0], laplace_matrix[1]) ? "are" : "are not") + << " equal." + << std::endl; + + for (unsigned int cell=0; cell<2; ++cell) + { + deallog << "cell=" << cell << std::endl; + deallog << "mass_matrix:" << std::endl; + for (unsigned int i=0; i +void test() +{ + Triangulation tr; + Point p1 = Point(); + Point p2 = (dim == 2 ? + Point(2,1) : + Point(2,1,1)); + std::vector subdivisions (dim, 1); + subdivisions[0] = 2; + GridGenerator::subdivided_hyper_rectangle(tr, subdivisions, p1, p2); + + static const HyperBallBoundary boundary; + tr.set_boundary (1, boundary); + + // set boundary id on cell 1 + for (unsigned int f=0; f::faces_per_cell; ++f) + if (tr.begin_active()->at_boundary(f)) + tr.begin_active()->face(f)->set_boundary_indicator (1); + + test(tr); +} + + +int main() +{ + std::ofstream logfile ("cell_similarity_dgp_nonparametric_01/output"); + deallog << std::setprecision (4); + + deallog.attach(logfile); + deallog.depth_console (0); + deallog.threshold_double(1.e-7); + + test<2>(); + test<3>(); +} diff --git a/tests/fe/cell_similarity_dgp_nonparametric_01/cmp/generic b/tests/fe/cell_similarity_dgp_nonparametric_01/cmp/generic new file mode 100644 index 0000000000..1a5d155aad --- /dev/null +++ b/tests/fe/cell_similarity_dgp_nonparametric_01/cmp/generic @@ -0,0 +1,49 @@ + +DEAL::FE=FE_DGPNonparametric<2>(1) +DEAL::Mapping=Q1 +DEAL::Mass matrices are not equal. +DEAL::Laplace matrices are equal. +DEAL::cell=0 +DEAL::mass_matrix: +DEAL::1.000 0 0 +DEAL::0 1.000 0 +DEAL::0 0 1.000 +DEAL::laplace_matrix: +DEAL::0 0 0 +DEAL::0 12.00 0 +DEAL::0 0 12.00 +DEAL::cell=1 +DEAL::mass_matrix: +DEAL::1.000 3.464 0 +DEAL::3.464 13.00 0 +DEAL::0 0 1.000 +DEAL::laplace_matrix: +DEAL::0 0 0 +DEAL::0 12.00 0 +DEAL::0 0 12.00 +DEAL::FE=FE_DGPNonparametric<3>(1) +DEAL::Mapping=Q1 +DEAL::Mass matrices are not equal. +DEAL::Laplace matrices are equal. +DEAL::cell=0 +DEAL::mass_matrix: +DEAL::1.000 0 0 0 +DEAL::0 1.000 0 0 +DEAL::0 0 1.000 0 +DEAL::0 0 0 1.000 +DEAL::laplace_matrix: +DEAL::0 0 0 0 +DEAL::0 12.00 0 0 +DEAL::0 0 12.00 0 +DEAL::0 0 0 12.00 +DEAL::cell=1 +DEAL::mass_matrix: +DEAL::1.000 3.464 0 0 +DEAL::3.464 13.00 0 0 +DEAL::0 0 1.000 0 +DEAL::0 0 0 1.000 +DEAL::laplace_matrix: +DEAL::0 0 0 0 +DEAL::0 12.00 0 0 +DEAL::0 0 12.00 0 +DEAL::0 0 0 12.00 diff --git a/tests/fe/cell_similarity_dgp_nonparametric_010.cc b/tests/fe/cell_similarity_dgp_nonparametric_010.cc new file mode 100644 index 0000000000..5496724efb --- /dev/null +++ b/tests/fe/cell_similarity_dgp_nonparametric_010.cc @@ -0,0 +1,174 @@ +//---------------------------------------------------------------------- +// $Id$ +// Version: $Name$ +// +// Copyright (C) 2009 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. +// +//---------------------------------------------------------------------- + + +// since early 2009, the FEValues objects try to be more efficient by only +// recomputing things like gradients of shape functions if the cell on which +// we are is not a translation of the previous one. in this series of tests we +// make sure that this actually works the way it's supposed to be; in +// particular, if we create a mesh of two identical cells but one has a curved +// boundary, then they are the same if we use a Q1 mapping, but not a Q2 +// mapping. so we test that the mass matrix we get from each of these cells is +// actually different in the latter case, but the same in the former +// +// the various tests cell_similarity_dgp_nonparametric_?? differ in the mappings and finite +// elements in use + + +#include "../tests.h" +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include + + +bool equal (const FullMatrix &m1, + const FullMatrix &m2) +{ + double d = 0, s = 0; + for (unsigned int i=0; i +void test (const Triangulation& tr) +{ + FE_DGPNonparametric fe(2); + deallog << "FE=" << fe.get_name() << std::endl; + + MappingCartesian mapping; + deallog << "Mapping=Cartesian" << std::endl; + + + DoFHandler dof(tr); + dof.distribute_dofs(fe); + + const QGauss quadrature(2); + FEValues fe_values (mapping, fe, quadrature, + update_values | update_gradients | + update_JxW_values); + + FullMatrix mass_matrix[2], laplace_matrix[2]; + mass_matrix[0].reinit(fe.dofs_per_cell, fe.dofs_per_cell); + mass_matrix[1].reinit(fe.dofs_per_cell, fe.dofs_per_cell); + laplace_matrix[0].reinit(fe.dofs_per_cell, fe.dofs_per_cell); + laplace_matrix[1].reinit(fe.dofs_per_cell, fe.dofs_per_cell); + + for (typename DoFHandler::active_cell_iterator + cell = dof.begin_active(); + cell != dof.end(); ++cell) + { + fe_values.reinit (cell); + + for (unsigned int i=0; iindex()](i,j) += fe_values.shape_value (i,q) * + fe_values.shape_value (j,q) * + fe_values.JxW(q); + laplace_matrix[cell->index()](i,j) += fe_values.shape_grad (i,q) * + fe_values.shape_grad (j,q) * + fe_values.JxW(q); + } + } + + // check what we expect for this mapping + // about equality or inequality of the + // matrices + deallog << "Mass matrices " + << (equal (mass_matrix[0], mass_matrix[1]) ? "are" : "are not") + << " equal." + << std::endl; + deallog << "Laplace matrices " + << (equal (laplace_matrix[0], laplace_matrix[1]) ? "are" : "are not") + << " equal." + << std::endl; + + for (unsigned int cell=0; cell<2; ++cell) + { + deallog << "cell=" << cell << std::endl; + deallog << "mass_matrix:" << std::endl; + for (unsigned int i=0; i +void test() +{ + Triangulation tr; + Point p1 = Point(); + Point p2 = (dim == 2 ? + Point(2,1) : + Point(2,1,1)); + std::vector subdivisions (dim, 1); + subdivisions[0] = 2; + GridGenerator::subdivided_hyper_rectangle(tr, subdivisions, p1, p2); + + static const HyperBallBoundary boundary; + tr.set_boundary (1, boundary); + + // set boundary id on cell 1 + for (unsigned int f=0; f::faces_per_cell; ++f) + if (tr.begin_active()->at_boundary(f)) + tr.begin_active()->face(f)->set_boundary_indicator (1); + + test(tr); +} + + +int main() +{ + std::ofstream logfile ("cell_similarity_dgp_nonparametric_10/output"); + deallog << std::setprecision (4); + + deallog.attach(logfile); + deallog.depth_console (0); + deallog.threshold_double(1.e-7); + + test<2>(); + //test<3>(); +} diff --git a/tests/fe/cell_similarity_dgp_nonparametric_010/cmp/generic b/tests/fe/cell_similarity_dgp_nonparametric_010/cmp/generic new file mode 100644 index 0000000000..d4520f92e6 --- /dev/null +++ b/tests/fe/cell_similarity_dgp_nonparametric_010/cmp/generic @@ -0,0 +1,69 @@ + +DEAL::FE=FE_Q<2>(1) +DEAL::Mapping=Q2 +DEAL::Mass matrices are not equal. +DEAL::Laplace matrices are not equal. +DEAL::cell=0 +DEAL::mass_matrix: +DEAL::0.2371 0.07167 0.06719 0.02582 +DEAL::0.07167 0.04962 0.02582 0.03610 +DEAL::0.06719 0.02582 0.03170 0.03162 +DEAL::0.02582 0.03610 0.03162 0.09477 +DEAL::laplace_matrix: +DEAL::4.337 -0.2381 -2.153 -1.946 +DEAL::-0.2381 0.9387 -0.5940 -0.1066 +DEAL::-2.153 -0.5940 1.899 0.8483 +DEAL::-1.946 -0.1066 0.8483 1.205 +DEAL::cell=1 +DEAL::mass_matrix: +DEAL::0.1111 0.05556 0.05556 0.02778 +DEAL::0.05556 0.1111 0.02778 0.05556 +DEAL::0.05556 0.02778 0.1111 0.05556 +DEAL::0.02778 0.05556 0.05556 0.1111 +DEAL::laplace_matrix: +DEAL::0.6667 -0.1667 -0.1667 -0.3333 +DEAL::-0.1667 0.6667 -0.3333 -0.1667 +DEAL::-0.1667 -0.3333 0.6667 -0.1667 +DEAL::-0.3333 -0.1667 -0.1667 0.6667 +DEAL::FE=FE_Q<3>(1) +DEAL::Mapping=Q2 +DEAL::Mass matrices are not equal. +DEAL::Laplace matrices are not equal. +DEAL::cell=0 +DEAL::mass_matrix: +DEAL::0.07572 0.02718 0.02414 0.009471 0.02414 0.009471 0.008538 0.003898 +DEAL::0.02718 0.03298 0.009471 0.01375 0.009471 0.01375 0.003898 0.007053 +DEAL::0.02414 0.009471 0.02083 0.01071 0.008538 0.003898 0.01001 0.006119 +DEAL::0.009471 0.01375 0.01071 0.02201 0.003898 0.007053 0.006119 0.01447 +DEAL::0.02414 0.009471 0.008538 0.003898 0.02083 0.01071 0.01001 0.006119 +DEAL::0.009471 0.01375 0.003898 0.007053 0.01071 0.02201 0.006119 0.01447 +DEAL::0.008538 0.003898 0.01001 0.006119 0.01001 0.006119 0.01922 0.01377 +DEAL::0.003898 0.007053 0.006119 0.01447 0.006119 0.01447 0.01377 0.03585 +DEAL::laplace_matrix: +DEAL::0.7840 0.04931 0.04652 -0.2138 0.04652 -0.2138 -0.2672 -0.2315 +DEAL::0.04931 0.3584 -0.04035 -0.04210 -0.04035 -0.04210 -0.09114 -0.1517 +DEAL::0.04652 -0.04035 0.2547 0.006678 -0.03606 -0.07879 -0.03423 -0.1051 +DEAL::-0.2138 -0.04210 0.006678 0.3292 -0.07879 -0.05266 0.002197 0.06269 +DEAL::0.04652 -0.04035 -0.03606 -0.07879 0.2547 0.006678 -0.03423 -0.1051 +DEAL::-0.2138 -0.04210 -0.07879 -0.05266 0.006678 0.3292 0.002197 0.06269 +DEAL::-0.2672 -0.09114 -0.03423 0.002197 -0.03423 0.002197 0.3052 0.1173 +DEAL::-0.2315 -0.1517 -0.1051 0.06269 -0.1051 0.06269 0.1173 0.3509 +DEAL::cell=1 +DEAL::mass_matrix: +DEAL::0.03704 0.01852 0.01852 0.009259 0.01852 0.009259 0.009259 0.004630 +DEAL::0.01852 0.03704 0.009259 0.01852 0.009259 0.01852 0.004630 0.009259 +DEAL::0.01852 0.009259 0.03704 0.01852 0.009259 0.004630 0.01852 0.009259 +DEAL::0.009259 0.01852 0.01852 0.03704 0.004630 0.009259 0.009259 0.01852 +DEAL::0.01852 0.009259 0.009259 0.004630 0.03704 0.01852 0.01852 0.009259 +DEAL::0.009259 0.01852 0.004630 0.009259 0.01852 0.03704 0.009259 0.01852 +DEAL::0.009259 0.004630 0.01852 0.009259 0.01852 0.009259 0.03704 0.01852 +DEAL::0.004630 0.009259 0.009259 0.01852 0.009259 0.01852 0.01852 0.03704 +DEAL::laplace_matrix: +DEAL::0.3333 0 0 -0.08333 0 -0.08333 -0.08333 -0.08333 +DEAL::0 0.3333 -0.08333 0 -0.08333 0 -0.08333 -0.08333 +DEAL::0 -0.08333 0.3333 0 -0.08333 -0.08333 0 -0.08333 +DEAL::-0.08333 0 0 0.3333 -0.08333 -0.08333 -0.08333 0 +DEAL::0 -0.08333 -0.08333 -0.08333 0.3333 0 0 -0.08333 +DEAL::-0.08333 0 -0.08333 -0.08333 0 0.3333 -0.08333 0 +DEAL::-0.08333 -0.08333 0 -0.08333 0 -0.08333 0.3333 0 +DEAL::-0.08333 -0.08333 -0.08333 0 -0.08333 0 0 0.3333 diff --git a/tests/fe/cell_similarity_dgp_nonparametric_02.cc b/tests/fe/cell_similarity_dgp_nonparametric_02.cc new file mode 100644 index 0000000000..3d23fea05a --- /dev/null +++ b/tests/fe/cell_similarity_dgp_nonparametric_02.cc @@ -0,0 +1,174 @@ +//---------------------------------------------------------------------- +// $Id$ +// Version: $Name$ +// +// Copyright (C) 2009 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. +// +//---------------------------------------------------------------------- + + +// since early 2009, the FEValues objects try to be more efficient by only +// recomputing things like gradients of shape functions if the cell on which +// we are is not a translation of the previous one. in this series of tests we +// make sure that this actually works the way it's supposed to be; in +// particular, if we create a mesh of two identical cells but one has a curved +// boundary, then they are the same if we use a Q1 mapping, but not a Q2 +// mapping. so we test that the mass matrix we get from each of these cells is +// actually different in the latter case, but the same in the former +// +// the various tests cell_similarity_dgp_nonparametric_?? differ in the mappings and finite +// elements in use + + +#include "../tests.h" +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include + + +bool equal (const FullMatrix &m1, + const FullMatrix &m2) +{ + double d = 0, s = 0; + for (unsigned int i=0; i +void test (const Triangulation& tr) +{ + FE_DGPNonparametric fe(2); + deallog << "FE=" << fe.get_name() << std::endl; + + MappingQ1 mapping; + deallog << "Mapping=Q1" << std::endl; + + + DoFHandler dof(tr); + dof.distribute_dofs(fe); + + const QGauss quadrature(2); + FEValues fe_values (mapping, fe, quadrature, + update_values | update_gradients | + update_JxW_values); + + FullMatrix mass_matrix[2], laplace_matrix[2]; + mass_matrix[0].reinit(fe.dofs_per_cell, fe.dofs_per_cell); + mass_matrix[1].reinit(fe.dofs_per_cell, fe.dofs_per_cell); + laplace_matrix[0].reinit(fe.dofs_per_cell, fe.dofs_per_cell); + laplace_matrix[1].reinit(fe.dofs_per_cell, fe.dofs_per_cell); + + for (typename DoFHandler::active_cell_iterator + cell = dof.begin_active(); + cell != dof.end(); ++cell) + { + fe_values.reinit (cell); + + for (unsigned int i=0; iindex()](i,j) += fe_values.shape_value (i,q) * + fe_values.shape_value (j,q) * + fe_values.JxW(q); + laplace_matrix[cell->index()](i,j) += fe_values.shape_grad (i,q) * + fe_values.shape_grad (j,q) * + fe_values.JxW(q); + } + } + + // check what we expect for this mapping + // about equality or inequality of the + // matrices + deallog << "Mass matrices " + << (equal (mass_matrix[0], mass_matrix[1]) ? "are" : "are not") + << " equal." + << std::endl; + deallog << "Laplace matrices " + << (equal (laplace_matrix[0], laplace_matrix[1]) ? "are" : "are not") + << " equal." + << std::endl; + + for (unsigned int cell=0; cell<2; ++cell) + { + deallog << "cell=" << cell << std::endl; + deallog << "mass_matrix:" << std::endl; + for (unsigned int i=0; i +void test() +{ + Triangulation tr; + Point p1 = Point(); + Point p2 = (dim == 2 ? + Point(2,1) : + Point(2,1,1)); + std::vector subdivisions (dim, 1); + subdivisions[0] = 2; + GridGenerator::subdivided_hyper_rectangle(tr, subdivisions, p1, p2); + + static const HyperBallBoundary boundary; + tr.set_boundary (1, boundary); + + // set boundary id on cell 1 + for (unsigned int f=0; f::faces_per_cell; ++f) + if (tr.begin_active()->at_boundary(f)) + tr.begin_active()->face(f)->set_boundary_indicator (1); + + test(tr); +} + + +int main() +{ + std::ofstream logfile ("cell_similarity_dgp_nonparametric_02/output"); + deallog << std::setprecision (4); + + deallog.attach(logfile); + deallog.depth_console (0); + deallog.threshold_double(1.e-7); + + test<2>(); + test<3>(); +} diff --git a/tests/fe/cell_similarity_dgp_nonparametric_02/cmp/generic b/tests/fe/cell_similarity_dgp_nonparametric_02/cmp/generic new file mode 100644 index 0000000000..fc930ea8a3 --- /dev/null +++ b/tests/fe/cell_similarity_dgp_nonparametric_02/cmp/generic @@ -0,0 +1,85 @@ + +DEAL::FE=FE_DGPNonparametric<2>(2) +DEAL::Mapping=Q1 +DEAL::Mass matrices are not equal. +DEAL::Laplace matrices are not equal. +DEAL::cell=0 +DEAL::mass_matrix: +DEAL::1.000 0 0 0 0 0 +DEAL::0 1.000 0 0 0 0 +DEAL::0 0 0 0 0 0 +DEAL::0 0 0 1.000 0 0 +DEAL::0 0 0 0 1.000 0 +DEAL::0 0 0 0 0 0 +DEAL::laplace_matrix: +DEAL::0 0 0 0 0 0 +DEAL::0 12.00 0 0 0 0 +DEAL::0 0 60.00 0 0 0 +DEAL::0 0 0 12.00 0 0 +DEAL::0 0 0 0 24.00 0 +DEAL::0 0 0 0 0 60.00 +DEAL::cell=1 +DEAL::mass_matrix: +DEAL::1.000 3.464 13.42 0 0 0 +DEAL::3.464 13.00 54.22 0 0 0 +DEAL::13.42 54.22 240.0 0 0 0 +DEAL::0 0 0 1.000 3.464 0 +DEAL::0 0 0 3.464 13.00 0 +DEAL::0 0 0 0 0 0 +DEAL::laplace_matrix: +DEAL::0 0 0 0 0 0 +DEAL::0 12.00 92.95 0 0 0 +DEAL::0 92.95 780.0 0 0 0 +DEAL::0 0 0 12.00 41.57 0 +DEAL::0 0 0 41.57 168.0 0 +DEAL::0 0 0 0 0 60.00 +DEAL::FE=FE_DGPNonparametric<3>(2) +DEAL::Mapping=Q1 +DEAL::Mass matrices are not equal. +DEAL::Laplace matrices are not equal. +DEAL::cell=0 +DEAL::mass_matrix: +DEAL::1.000 0 0 0 0 0 0 0 0 0 +DEAL::0 1.000 0 0 0 0 0 0 0 0 +DEAL::0 0 0 0 0 0 0 0 0 0 +DEAL::0 0 0 1.000 0 0 0 0 0 0 +DEAL::0 0 0 0 1.000 0 0 0 0 0 +DEAL::0 0 0 0 0 0 0 0 0 0 +DEAL::0 0 0 0 0 0 1.000 0 0 0 +DEAL::0 0 0 0 0 0 0 1.000 0 0 +DEAL::0 0 0 0 0 0 0 0 1.000 0 +DEAL::0 0 0 0 0 0 0 0 0 0 +DEAL::laplace_matrix: +DEAL::0 0 0 0 0 0 0 0 0 0 +DEAL::0 12.00 0 0 0 0 0 0 0 0 +DEAL::0 0 60.00 0 0 0 0 0 0 0 +DEAL::0 0 0 12.00 0 0 0 0 0 0 +DEAL::0 0 0 0 24.00 0 0 0 0 0 +DEAL::0 0 0 0 0 60.00 0 0 0 0 +DEAL::0 0 0 0 0 0 12.00 0 0 0 +DEAL::0 0 0 0 0 0 0 24.00 0 0 +DEAL::0 0 0 0 0 0 0 0 24.00 0 +DEAL::0 0 0 0 0 0 0 0 0 60.00 +DEAL::cell=1 +DEAL::mass_matrix: +DEAL::1.000 3.464 13.42 0 0 0 0 0 0 0 +DEAL::3.464 13.00 54.22 0 0 0 0 0 0 0 +DEAL::13.42 54.22 240.0 0 0 0 0 0 0 0 +DEAL::0 0 0 1.000 3.464 0 0 0 0 0 +DEAL::0 0 0 3.464 13.00 0 0 0 0 0 +DEAL::0 0 0 0 0 0 0 0 0 0 +DEAL::0 0 0 0 0 0 1.000 3.464 0 0 +DEAL::0 0 0 0 0 0 3.464 13.00 0 0 +DEAL::0 0 0 0 0 0 0 0 1.000 0 +DEAL::0 0 0 0 0 0 0 0 0 0 +DEAL::laplace_matrix: +DEAL::0 0 0 0 0 0 0 0 0 0 +DEAL::0 12.00 92.95 0 0 0 0 0 0 0 +DEAL::0 92.95 780.0 0 0 0 0 0 0 0 +DEAL::0 0 0 12.00 41.57 0 0 0 0 0 +DEAL::0 0 0 41.57 168.0 0 0 0 0 0 +DEAL::0 0 0 0 0 60.00 0 0 0 0 +DEAL::0 0 0 0 0 0 12.00 41.57 0 0 +DEAL::0 0 0 0 0 0 41.57 168.0 0 0 +DEAL::0 0 0 0 0 0 0 0 24.00 0 +DEAL::0 0 0 0 0 0 0 0 0 60.00 diff --git a/tests/fe/cell_similarity_dgp_nonparametric_03.cc b/tests/fe/cell_similarity_dgp_nonparametric_03.cc new file mode 100644 index 0000000000..393f485345 --- /dev/null +++ b/tests/fe/cell_similarity_dgp_nonparametric_03.cc @@ -0,0 +1,174 @@ +//---------------------------------------------------------------------- +// $Id$ +// Version: $Name$ +// +// Copyright (C) 2009 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. +// +//---------------------------------------------------------------------- + + +// since early 2009, the FEValues objects try to be more efficient by only +// recomputing things like gradients of shape functions if the cell on which +// we are is not a translation of the previous one. in this series of tests we +// make sure that this actually works the way it's supposed to be; in +// particular, if we create a mesh of two identical cells but one has a curved +// boundary, then they are the same if we use a Q1 mapping, but not a Q2 +// mapping. so we test that the mass matrix we get from each of these cells is +// actually different in the latter case, but the same in the former +// +// the various tests cell_similarity_dgp_nonparametric_?? differ in the mappings and finite +// elements in use + + +#include "../tests.h" +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include + + +bool equal (const FullMatrix &m1, + const FullMatrix &m2) +{ + double d = 0, s = 0; + for (unsigned int i=0; i +void test (const Triangulation& tr) +{ + FE_DGPNonparametric fe(1); + deallog << "FE=" << fe.get_name() << std::endl; + + MappingQ mapping(1); + deallog << "Mapping=Q1" << std::endl; + + + DoFHandler dof(tr); + dof.distribute_dofs(fe); + + const QGauss quadrature(2); + FEValues fe_values (mapping, fe, quadrature, + update_values | update_gradients | + update_JxW_values); + + FullMatrix mass_matrix[2], laplace_matrix[2]; + mass_matrix[0].reinit(fe.dofs_per_cell, fe.dofs_per_cell); + mass_matrix[1].reinit(fe.dofs_per_cell, fe.dofs_per_cell); + laplace_matrix[0].reinit(fe.dofs_per_cell, fe.dofs_per_cell); + laplace_matrix[1].reinit(fe.dofs_per_cell, fe.dofs_per_cell); + + for (typename DoFHandler::active_cell_iterator + cell = dof.begin_active(); + cell != dof.end(); ++cell) + { + fe_values.reinit (cell); + + for (unsigned int i=0; iindex()](i,j) += fe_values.shape_value (i,q) * + fe_values.shape_value (j,q) * + fe_values.JxW(q); + laplace_matrix[cell->index()](i,j) += fe_values.shape_grad (i,q) * + fe_values.shape_grad (j,q) * + fe_values.JxW(q); + } + } + + // check what we expect for this mapping + // about equality or inequality of the + // matrices + deallog << "Mass matrices " + << (equal (mass_matrix[0], mass_matrix[1]) ? "are" : "are not") + << " equal." + << std::endl; + deallog << "Laplace matrices " + << (equal (laplace_matrix[0], laplace_matrix[1]) ? "are" : "are not") + << " equal." + << std::endl; + + for (unsigned int cell=0; cell<2; ++cell) + { + deallog << "cell=" << cell << std::endl; + deallog << "mass_matrix:" << std::endl; + for (unsigned int i=0; i +void test() +{ + Triangulation tr; + Point p1 = Point(); + Point p2 = (dim == 2 ? + Point(2,1) : + Point(2,1,1)); + std::vector subdivisions (dim, 1); + subdivisions[0] = 2; + GridGenerator::subdivided_hyper_rectangle(tr, subdivisions, p1, p2); + + static const HyperBallBoundary boundary; + tr.set_boundary (1, boundary); + + // set boundary id on cell 1 + for (unsigned int f=0; f::faces_per_cell; ++f) + if (tr.begin_active()->at_boundary(f)) + tr.begin_active()->face(f)->set_boundary_indicator (1); + + test(tr); +} + + +int main() +{ + std::ofstream logfile ("cell_similarity_dgp_nonparametric_03/output"); + deallog << std::setprecision (4); + + deallog.attach(logfile); + deallog.depth_console (0); + deallog.threshold_double(1.e-7); + + test<2>(); + test<3>(); +} diff --git a/tests/fe/cell_similarity_dgp_nonparametric_03/cmp/generic b/tests/fe/cell_similarity_dgp_nonparametric_03/cmp/generic new file mode 100644 index 0000000000..1a5d155aad --- /dev/null +++ b/tests/fe/cell_similarity_dgp_nonparametric_03/cmp/generic @@ -0,0 +1,49 @@ + +DEAL::FE=FE_DGPNonparametric<2>(1) +DEAL::Mapping=Q1 +DEAL::Mass matrices are not equal. +DEAL::Laplace matrices are equal. +DEAL::cell=0 +DEAL::mass_matrix: +DEAL::1.000 0 0 +DEAL::0 1.000 0 +DEAL::0 0 1.000 +DEAL::laplace_matrix: +DEAL::0 0 0 +DEAL::0 12.00 0 +DEAL::0 0 12.00 +DEAL::cell=1 +DEAL::mass_matrix: +DEAL::1.000 3.464 0 +DEAL::3.464 13.00 0 +DEAL::0 0 1.000 +DEAL::laplace_matrix: +DEAL::0 0 0 +DEAL::0 12.00 0 +DEAL::0 0 12.00 +DEAL::FE=FE_DGPNonparametric<3>(1) +DEAL::Mapping=Q1 +DEAL::Mass matrices are not equal. +DEAL::Laplace matrices are equal. +DEAL::cell=0 +DEAL::mass_matrix: +DEAL::1.000 0 0 0 +DEAL::0 1.000 0 0 +DEAL::0 0 1.000 0 +DEAL::0 0 0 1.000 +DEAL::laplace_matrix: +DEAL::0 0 0 0 +DEAL::0 12.00 0 0 +DEAL::0 0 12.00 0 +DEAL::0 0 0 12.00 +DEAL::cell=1 +DEAL::mass_matrix: +DEAL::1.000 3.464 0 0 +DEAL::3.464 13.00 0 0 +DEAL::0 0 1.000 0 +DEAL::0 0 0 1.000 +DEAL::laplace_matrix: +DEAL::0 0 0 0 +DEAL::0 12.00 0 0 +DEAL::0 0 12.00 0 +DEAL::0 0 0 12.00 diff --git a/tests/fe/cell_similarity_dgp_nonparametric_04.cc b/tests/fe/cell_similarity_dgp_nonparametric_04.cc new file mode 100644 index 0000000000..4b7fea12e5 --- /dev/null +++ b/tests/fe/cell_similarity_dgp_nonparametric_04.cc @@ -0,0 +1,174 @@ +//---------------------------------------------------------------------- +// $Id$ +// Version: $Name$ +// +// Copyright (C) 2009 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. +// +//---------------------------------------------------------------------- + + +// since early 2009, the FEValues objects try to be more efficient by only +// recomputing things like gradients of shape functions if the cell on which +// we are is not a translation of the previous one. in this series of tests we +// make sure that this actually works the way it's supposed to be; in +// particular, if we create a mesh of two identical cells but one has a curved +// boundary, then they are the same if we use a Q1 mapping, but not a Q2 +// mapping. so we test that the mass matrix we get from each of these cells is +// actually different in the latter case, but the same in the former +// +// the various tests cell_similarity_dgp_nonparametric_?? differ in the mappings and finite +// elements in use + + +#include "../tests.h" +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include + + +bool equal (const FullMatrix &m1, + const FullMatrix &m2) +{ + double d = 0, s = 0; + for (unsigned int i=0; i +void test (const Triangulation& tr) +{ + FE_DGPNonparametric fe(2); + deallog << "FE=" << fe.get_name() << std::endl; + + MappingQ mapping(1); + deallog << "Mapping=Q1" << std::endl; + + + DoFHandler dof(tr); + dof.distribute_dofs(fe); + + const QGauss quadrature(2); + FEValues fe_values (mapping, fe, quadrature, + update_values | update_gradients | + update_JxW_values); + + FullMatrix mass_matrix[2], laplace_matrix[2]; + mass_matrix[0].reinit(fe.dofs_per_cell, fe.dofs_per_cell); + mass_matrix[1].reinit(fe.dofs_per_cell, fe.dofs_per_cell); + laplace_matrix[0].reinit(fe.dofs_per_cell, fe.dofs_per_cell); + laplace_matrix[1].reinit(fe.dofs_per_cell, fe.dofs_per_cell); + + for (typename DoFHandler::active_cell_iterator + cell = dof.begin_active(); + cell != dof.end(); ++cell) + { + fe_values.reinit (cell); + + for (unsigned int i=0; iindex()](i,j) += fe_values.shape_value (i,q) * + fe_values.shape_value (j,q) * + fe_values.JxW(q); + laplace_matrix[cell->index()](i,j) += fe_values.shape_grad (i,q) * + fe_values.shape_grad (j,q) * + fe_values.JxW(q); + } + } + + // check what we expect for this mapping + // about equality or inequality of the + // matrices + deallog << "Mass matrices " + << (equal (mass_matrix[0], mass_matrix[1]) ? "are" : "are not") + << " equal." + << std::endl; + deallog << "Laplace matrices " + << (equal (laplace_matrix[0], laplace_matrix[1]) ? "are" : "are not") + << " equal." + << std::endl; + + for (unsigned int cell=0; cell<2; ++cell) + { + deallog << "cell=" << cell << std::endl; + deallog << "mass_matrix:" << std::endl; + for (unsigned int i=0; i +void test() +{ + Triangulation tr; + Point p1 = Point(); + Point p2 = (dim == 2 ? + Point(2,1) : + Point(2,1,1)); + std::vector subdivisions (dim, 1); + subdivisions[0] = 2; + GridGenerator::subdivided_hyper_rectangle(tr, subdivisions, p1, p2); + + static const HyperBallBoundary boundary; + tr.set_boundary (1, boundary); + + // set boundary id on cell 1 + for (unsigned int f=0; f::faces_per_cell; ++f) + if (tr.begin_active()->at_boundary(f)) + tr.begin_active()->face(f)->set_boundary_indicator (1); + + test(tr); +} + + +int main() +{ + std::ofstream logfile ("cell_similarity_dgp_nonparametric_04/output"); + deallog << std::setprecision (4); + + deallog.attach(logfile); + deallog.depth_console (0); + deallog.threshold_double(1.e-7); + + test<2>(); + test<3>(); +} diff --git a/tests/fe/cell_similarity_dgp_nonparametric_04/cmp/generic b/tests/fe/cell_similarity_dgp_nonparametric_04/cmp/generic new file mode 100644 index 0000000000..fc930ea8a3 --- /dev/null +++ b/tests/fe/cell_similarity_dgp_nonparametric_04/cmp/generic @@ -0,0 +1,85 @@ + +DEAL::FE=FE_DGPNonparametric<2>(2) +DEAL::Mapping=Q1 +DEAL::Mass matrices are not equal. +DEAL::Laplace matrices are not equal. +DEAL::cell=0 +DEAL::mass_matrix: +DEAL::1.000 0 0 0 0 0 +DEAL::0 1.000 0 0 0 0 +DEAL::0 0 0 0 0 0 +DEAL::0 0 0 1.000 0 0 +DEAL::0 0 0 0 1.000 0 +DEAL::0 0 0 0 0 0 +DEAL::laplace_matrix: +DEAL::0 0 0 0 0 0 +DEAL::0 12.00 0 0 0 0 +DEAL::0 0 60.00 0 0 0 +DEAL::0 0 0 12.00 0 0 +DEAL::0 0 0 0 24.00 0 +DEAL::0 0 0 0 0 60.00 +DEAL::cell=1 +DEAL::mass_matrix: +DEAL::1.000 3.464 13.42 0 0 0 +DEAL::3.464 13.00 54.22 0 0 0 +DEAL::13.42 54.22 240.0 0 0 0 +DEAL::0 0 0 1.000 3.464 0 +DEAL::0 0 0 3.464 13.00 0 +DEAL::0 0 0 0 0 0 +DEAL::laplace_matrix: +DEAL::0 0 0 0 0 0 +DEAL::0 12.00 92.95 0 0 0 +DEAL::0 92.95 780.0 0 0 0 +DEAL::0 0 0 12.00 41.57 0 +DEAL::0 0 0 41.57 168.0 0 +DEAL::0 0 0 0 0 60.00 +DEAL::FE=FE_DGPNonparametric<3>(2) +DEAL::Mapping=Q1 +DEAL::Mass matrices are not equal. +DEAL::Laplace matrices are not equal. +DEAL::cell=0 +DEAL::mass_matrix: +DEAL::1.000 0 0 0 0 0 0 0 0 0 +DEAL::0 1.000 0 0 0 0 0 0 0 0 +DEAL::0 0 0 0 0 0 0 0 0 0 +DEAL::0 0 0 1.000 0 0 0 0 0 0 +DEAL::0 0 0 0 1.000 0 0 0 0 0 +DEAL::0 0 0 0 0 0 0 0 0 0 +DEAL::0 0 0 0 0 0 1.000 0 0 0 +DEAL::0 0 0 0 0 0 0 1.000 0 0 +DEAL::0 0 0 0 0 0 0 0 1.000 0 +DEAL::0 0 0 0 0 0 0 0 0 0 +DEAL::laplace_matrix: +DEAL::0 0 0 0 0 0 0 0 0 0 +DEAL::0 12.00 0 0 0 0 0 0 0 0 +DEAL::0 0 60.00 0 0 0 0 0 0 0 +DEAL::0 0 0 12.00 0 0 0 0 0 0 +DEAL::0 0 0 0 24.00 0 0 0 0 0 +DEAL::0 0 0 0 0 60.00 0 0 0 0 +DEAL::0 0 0 0 0 0 12.00 0 0 0 +DEAL::0 0 0 0 0 0 0 24.00 0 0 +DEAL::0 0 0 0 0 0 0 0 24.00 0 +DEAL::0 0 0 0 0 0 0 0 0 60.00 +DEAL::cell=1 +DEAL::mass_matrix: +DEAL::1.000 3.464 13.42 0 0 0 0 0 0 0 +DEAL::3.464 13.00 54.22 0 0 0 0 0 0 0 +DEAL::13.42 54.22 240.0 0 0 0 0 0 0 0 +DEAL::0 0 0 1.000 3.464 0 0 0 0 0 +DEAL::0 0 0 3.464 13.00 0 0 0 0 0 +DEAL::0 0 0 0 0 0 0 0 0 0 +DEAL::0 0 0 0 0 0 1.000 3.464 0 0 +DEAL::0 0 0 0 0 0 3.464 13.00 0 0 +DEAL::0 0 0 0 0 0 0 0 1.000 0 +DEAL::0 0 0 0 0 0 0 0 0 0 +DEAL::laplace_matrix: +DEAL::0 0 0 0 0 0 0 0 0 0 +DEAL::0 12.00 92.95 0 0 0 0 0 0 0 +DEAL::0 92.95 780.0 0 0 0 0 0 0 0 +DEAL::0 0 0 12.00 41.57 0 0 0 0 0 +DEAL::0 0 0 41.57 168.0 0 0 0 0 0 +DEAL::0 0 0 0 0 60.00 0 0 0 0 +DEAL::0 0 0 0 0 0 12.00 41.57 0 0 +DEAL::0 0 0 0 0 0 41.57 168.0 0 0 +DEAL::0 0 0 0 0 0 0 0 24.00 0 +DEAL::0 0 0 0 0 0 0 0 0 60.00 diff --git a/tests/fe/cell_similarity_dgp_nonparametric_05.cc b/tests/fe/cell_similarity_dgp_nonparametric_05.cc new file mode 100644 index 0000000000..00369b0ca9 --- /dev/null +++ b/tests/fe/cell_similarity_dgp_nonparametric_05.cc @@ -0,0 +1,174 @@ +//---------------------------------------------------------------------- +// $Id$ +// Version: $Name$ +// +// Copyright (C) 2009 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. +// +//---------------------------------------------------------------------- + + +// since early 2009, the FEValues objects try to be more efficient by only +// recomputing things like gradients of shape functions if the cell on which +// we are is not a translation of the previous one. in this series of tests we +// make sure that this actually works the way it's supposed to be; in +// particular, if we create a mesh of two identical cells but one has a curved +// boundary, then they are the same if we use a Q1 mapping, but not a Q2 +// mapping. so we test that the mass matrix we get from each of these cells is +// actually different in the latter case, but the same in the former +// +// the various tests cell_similarity_dgp_nonparametric_?? differ in the mappings and finite +// elements in use + + +#include "../tests.h" +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include + + +bool equal (const FullMatrix &m1, + const FullMatrix &m2) +{ + double d = 0, s = 0; + for (unsigned int i=0; i +void test (const Triangulation& tr) +{ + FE_DGPNonparametric fe(1); + deallog << "FE=" << fe.get_name() << std::endl; + + MappingQ mapping(2); + deallog << "Mapping=Q2" << std::endl; + + + DoFHandler dof(tr); + dof.distribute_dofs(fe); + + const QGauss quadrature(2); + FEValues fe_values (mapping, fe, quadrature, + update_values | update_gradients | + update_JxW_values); + + FullMatrix mass_matrix[2], laplace_matrix[2]; + mass_matrix[0].reinit(fe.dofs_per_cell, fe.dofs_per_cell); + mass_matrix[1].reinit(fe.dofs_per_cell, fe.dofs_per_cell); + laplace_matrix[0].reinit(fe.dofs_per_cell, fe.dofs_per_cell); + laplace_matrix[1].reinit(fe.dofs_per_cell, fe.dofs_per_cell); + + for (typename DoFHandler::active_cell_iterator + cell = dof.begin_active(); + cell != dof.end(); ++cell) + { + fe_values.reinit (cell); + + for (unsigned int i=0; iindex()](i,j) += fe_values.shape_value (i,q) * + fe_values.shape_value (j,q) * + fe_values.JxW(q); + laplace_matrix[cell->index()](i,j) += fe_values.shape_grad (i,q) * + fe_values.shape_grad (j,q) * + fe_values.JxW(q); + } + } + + // check what we expect for this mapping + // about equality or inequality of the + // matrices + deallog << "Mass matrices " + << (equal (mass_matrix[0], mass_matrix[1]) ? "are" : "are not") + << " equal." + << std::endl; + deallog << "Laplace matrices " + << (equal (laplace_matrix[0], laplace_matrix[1]) ? "are" : "are not") + << " equal." + << std::endl; + + for (unsigned int cell=0; cell<2; ++cell) + { + deallog << "cell=" << cell << std::endl; + deallog << "mass_matrix:" << std::endl; + for (unsigned int i=0; i +void test() +{ + Triangulation tr; + Point p1 = Point(); + Point p2 = (dim == 2 ? + Point(2,1) : + Point(2,1,1)); + std::vector subdivisions (dim, 1); + subdivisions[0] = 2; + GridGenerator::subdivided_hyper_rectangle(tr, subdivisions, p1, p2); + + static const HyperBallBoundary boundary; + tr.set_boundary (1, boundary); + + // set boundary id on cell 1 + for (unsigned int f=0; f::faces_per_cell; ++f) + if (tr.begin_active()->at_boundary(f)) + tr.begin_active()->face(f)->set_boundary_indicator (1); + + test(tr); +} + + +int main() +{ + std::ofstream logfile ("cell_similarity_dgp_nonparametric_05/output"); + deallog << std::setprecision (4); + + deallog.attach(logfile); + deallog.depth_console (0); + deallog.threshold_double(1.e-7); + + test<2>(); + test<3>(); +} diff --git a/tests/fe/cell_similarity_dgp_nonparametric_05/cmp/generic b/tests/fe/cell_similarity_dgp_nonparametric_05/cmp/generic new file mode 100644 index 0000000000..2930838742 --- /dev/null +++ b/tests/fe/cell_similarity_dgp_nonparametric_05/cmp/generic @@ -0,0 +1,49 @@ + +DEAL::FE=FE_DGPNonparametric<2>(1) +DEAL::Mapping=Q2 +DEAL::Mass matrices are not equal. +DEAL::Laplace matrices are not equal. +DEAL::cell=0 +DEAL::mass_matrix: +DEAL::0.9296 0.1103 -0.03228 +DEAL::0.1103 0.4840 0.1078 +DEAL::-0.03228 0.1078 0.3581 +DEAL::laplace_matrix: +DEAL::0 0 0 +DEAL::0 11.16 0 +DEAL::0 0 11.16 +DEAL::cell=1 +DEAL::mass_matrix: +DEAL::1.000 3.464 0 +DEAL::3.464 13.00 0 +DEAL::0 0 1.000 +DEAL::laplace_matrix: +DEAL::0 0 0 +DEAL::0 12.00 0 +DEAL::0 0 12.00 +DEAL::FE=FE_DGPNonparametric<3>(1) +DEAL::Mapping=Q2 +DEAL::Mass matrices are not equal. +DEAL::Laplace matrices are not equal. +DEAL::cell=0 +DEAL::mass_matrix: +DEAL::0.8419 0.02942 -0.1157 -0.1157 +DEAL::0.02942 0.7414 0.003550 0.003550 +DEAL::-0.1157 0.003550 0.5949 0.05282 +DEAL::-0.1157 0.003550 0.05282 0.5949 +DEAL::laplace_matrix: +DEAL::0 0 0 0 +DEAL::0 10.10 0 0 +DEAL::0 0 10.10 0 +DEAL::0 0 0 10.10 +DEAL::cell=1 +DEAL::mass_matrix: +DEAL::1.000 3.464 0 0 +DEAL::3.464 13.00 0 0 +DEAL::0 0 1.000 0 +DEAL::0 0 0 1.000 +DEAL::laplace_matrix: +DEAL::0 0 0 0 +DEAL::0 12.00 0 0 +DEAL::0 0 12.00 0 +DEAL::0 0 0 12.00 diff --git a/tests/fe/cell_similarity_dgp_nonparametric_06.cc b/tests/fe/cell_similarity_dgp_nonparametric_06.cc new file mode 100644 index 0000000000..fd190da7b6 --- /dev/null +++ b/tests/fe/cell_similarity_dgp_nonparametric_06.cc @@ -0,0 +1,174 @@ +//---------------------------------------------------------------------- +// $Id$ +// Version: $Name$ +// +// Copyright (C) 2009 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. +// +//---------------------------------------------------------------------- + + +// since early 2009, the FEValues objects try to be more efficient by only +// recomputing things like gradients of shape functions if the cell on which +// we are is not a translation of the previous one. in this series of tests we +// make sure that this actually works the way it's supposed to be; in +// particular, if we create a mesh of two identical cells but one has a curved +// boundary, then they are the same if we use a Q1 mapping, but not a Q2 +// mapping. so we test that the mass matrix we get from each of these cells is +// actually different in the latter case, but the same in the former +// +// the various tests cell_similarity_dgp_nonparametric_?? differ in the mappings and finite +// elements in use + + +#include "../tests.h" +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include + + +bool equal (const FullMatrix &m1, + const FullMatrix &m2) +{ + double d = 0, s = 0; + for (unsigned int i=0; i +void test (const Triangulation& tr) +{ + FE_DGPNonparametric fe(2); + deallog << "FE=" << fe.get_name() << std::endl; + + MappingQ mapping(2); + deallog << "Mapping=Q2" << std::endl; + + + DoFHandler dof(tr); + dof.distribute_dofs(fe); + + const QGauss quadrature(2); + FEValues fe_values (mapping, fe, quadrature, + update_values | update_gradients | + update_JxW_values); + + FullMatrix mass_matrix[2], laplace_matrix[2]; + mass_matrix[0].reinit(fe.dofs_per_cell, fe.dofs_per_cell); + mass_matrix[1].reinit(fe.dofs_per_cell, fe.dofs_per_cell); + laplace_matrix[0].reinit(fe.dofs_per_cell, fe.dofs_per_cell); + laplace_matrix[1].reinit(fe.dofs_per_cell, fe.dofs_per_cell); + + for (typename DoFHandler::active_cell_iterator + cell = dof.begin_active(); + cell != dof.end(); ++cell) + { + fe_values.reinit (cell); + + for (unsigned int i=0; iindex()](i,j) += fe_values.shape_value (i,q) * + fe_values.shape_value (j,q) * + fe_values.JxW(q); + laplace_matrix[cell->index()](i,j) += fe_values.shape_grad (i,q) * + fe_values.shape_grad (j,q) * + fe_values.JxW(q); + } + } + + // check what we expect for this mapping + // about equality or inequality of the + // matrices + deallog << "Mass matrices " + << (equal (mass_matrix[0], mass_matrix[1]) ? "are" : "are not") + << " equal." + << std::endl; + deallog << "Laplace matrices " + << (equal (laplace_matrix[0], laplace_matrix[1]) ? "are" : "are not") + << " equal." + << std::endl; + + for (unsigned int cell=0; cell<2; ++cell) + { + deallog << "cell=" << cell << std::endl; + deallog << "mass_matrix:" << std::endl; + for (unsigned int i=0; i +void test() +{ + Triangulation tr; + Point p1 = Point(); + Point p2 = (dim == 2 ? + Point(2,1) : + Point(2,1,1)); + std::vector subdivisions (dim, 1); + subdivisions[0] = 2; + GridGenerator::subdivided_hyper_rectangle(tr, subdivisions, p1, p2); + + static const HyperBallBoundary boundary; + tr.set_boundary (1, boundary); + + // set boundary id on cell 1 + for (unsigned int f=0; f::faces_per_cell; ++f) + if (tr.begin_active()->at_boundary(f)) + tr.begin_active()->face(f)->set_boundary_indicator (1); + + test(tr); +} + + +int main() +{ + std::ofstream logfile ("cell_similarity_dgp_nonparametric_06/output"); + deallog << std::setprecision (4); + + deallog.attach(logfile); + deallog.depth_console (0); + deallog.threshold_double(1.e-7); + + test<2>(); + test<3>(); +} diff --git a/tests/fe/cell_similarity_dgp_nonparametric_06/cmp/generic b/tests/fe/cell_similarity_dgp_nonparametric_06/cmp/generic new file mode 100644 index 0000000000..ab3cd27eba --- /dev/null +++ b/tests/fe/cell_similarity_dgp_nonparametric_06/cmp/generic @@ -0,0 +1,85 @@ + +DEAL::FE=FE_DGPNonparametric<2>(2) +DEAL::Mapping=Q2 +DEAL::Mass matrices are not equal. +DEAL::Laplace matrices are not equal. +DEAL::cell=0 +DEAL::mass_matrix: +DEAL::0.9296 0.1103 -0.4982 -0.03228 0.1078 -0.6390 +DEAL::0.1103 0.4840 0.3899 0.1078 0.003193 0.1013 +DEAL::-0.4982 0.3899 0.8769 0.03966 -0.3244 0.6142 +DEAL::-0.03228 0.1078 0.03966 0.3581 0.2009 0.1898 +DEAL::0.1078 0.003193 -0.3244 0.2009 0.4039 -0.1713 +DEAL::-0.6390 0.1013 0.6142 0.1898 -0.1713 0.6670 +DEAL::laplace_matrix: +DEAL::0 0 0 0 0 0 +DEAL::0 11.16 2.959 0 -0.3873 0 +DEAL::0 2.959 29.04 0 2.893 0 +DEAL::0 0 0 11.16 1.323 -0.8661 +DEAL::0 -0.3873 2.893 1.323 10.11 2.893 +DEAL::0 0 0 -0.8661 2.893 21.49 +DEAL::cell=1 +DEAL::mass_matrix: +DEAL::1.000 3.464 13.42 0 0 0 +DEAL::3.464 13.00 54.22 0 0 0 +DEAL::13.42 54.22 240.0 0 0 0 +DEAL::0 0 0 1.000 3.464 0 +DEAL::0 0 0 3.464 13.00 0 +DEAL::0 0 0 0 0 0 +DEAL::laplace_matrix: +DEAL::0 0 0 0 0 0 +DEAL::0 12.00 92.95 0 0 0 +DEAL::0 92.95 780.0 0 0 0 +DEAL::0 0 0 12.00 41.57 0 +DEAL::0 0 0 41.57 168.0 0 +DEAL::0 0 0 0 0 60.00 +DEAL::FE=FE_DGPNonparametric<3>(2) +DEAL::Mapping=Q2 +DEAL::Mass matrices are not equal. +DEAL::Laplace matrices are not equal. +DEAL::cell=0 +DEAL::mass_matrix: +DEAL::0.8419 0.02942 -0.1123 -0.1157 0.003550 -0.2762 -0.1157 0.003550 0.05282 -0.2762 +DEAL::0.02942 0.7414 0.2219 0.003550 -0.08994 0.03889 0.003550 -0.08994 -0.03985 0.03889 +DEAL::-0.1123 0.2219 0.2460 0.02874 -0.2454 0.1126 0.02874 -0.2454 -0.02620 0.1126 +DEAL::-0.1157 0.003550 0.02874 0.5949 0.06421 0.1207 0.05282 -0.03985 -0.04795 0.07570 +DEAL::0.003550 -0.08994 -0.2454 0.06421 0.5845 -0.1252 -0.03985 0.02939 -0.01761 -0.02365 +DEAL::-0.2762 0.03889 0.1126 0.1207 -0.1252 0.1920 0.07570 -0.02365 -0.1859 0.1656 +DEAL::-0.1157 0.003550 0.02874 0.05282 -0.03985 0.07570 0.5949 0.06421 -0.04795 0.1207 +DEAL::0.003550 -0.08994 -0.2454 -0.03985 0.02939 -0.02365 0.06421 0.5845 -0.01761 -0.1252 +DEAL::0.05282 -0.03985 -0.02620 -0.04795 -0.01761 -0.1859 -0.04795 -0.01761 0.4803 -0.1859 +DEAL::-0.2762 0.03889 0.1126 0.07570 -0.02365 0.1656 0.1207 -0.1252 -0.1859 0.1920 +DEAL::laplace_matrix: +DEAL::0 0 0 0 0 0 0 0 0 0 +DEAL::0 10.10 0.7895 0 -1.388 0 0 -1.388 0 0 +DEAL::0 0.7895 44.49 0 0.09526 0 0 0.09526 0 0 +DEAL::0 0 0 10.10 0.3531 -3.103 0 0 -1.388 0 +DEAL::0 -1.388 0.09526 0.3531 16.04 0.09526 0 0.6338 0.04260 0 +DEAL::0 0 0 -3.103 0.09526 35.69 0 0 1.417 0 +DEAL::0 0 0 0 0 0 10.10 0.3531 -1.388 -3.103 +DEAL::0 -1.388 0.09526 0 0.6338 0 0.3531 16.04 0.04260 0.09526 +DEAL::0 0 0 -1.388 0.04260 1.417 -1.388 0.04260 14.28 1.417 +DEAL::0 0 0 0 0 0 -3.103 0.09526 1.417 35.69 +DEAL::cell=1 +DEAL::mass_matrix: +DEAL::1.000 3.464 13.42 0 0 0 0 0 0 0 +DEAL::3.464 13.00 54.22 0 0 0 0 0 0 0 +DEAL::13.42 54.22 240.0 0 0 0 0 0 0 0 +DEAL::0 0 0 1.000 3.464 0 0 0 0 0 +DEAL::0 0 0 3.464 13.00 0 0 0 0 0 +DEAL::0 0 0 0 0 0 0 0 0 0 +DEAL::0 0 0 0 0 0 1.000 3.464 0 0 +DEAL::0 0 0 0 0 0 3.464 13.00 0 0 +DEAL::0 0 0 0 0 0 0 0 1.000 0 +DEAL::0 0 0 0 0 0 0 0 0 0 +DEAL::laplace_matrix: +DEAL::0 0 0 0 0 0 0 0 0 0 +DEAL::0 12.00 92.95 0 0 0 0 0 0 0 +DEAL::0 92.95 780.0 0 0 0 0 0 0 0 +DEAL::0 0 0 12.00 41.57 0 0 0 0 0 +DEAL::0 0 0 41.57 168.0 0 0 0 0 0 +DEAL::0 0 0 0 0 60.00 0 0 0 0 +DEAL::0 0 0 0 0 0 12.00 41.57 0 0 +DEAL::0 0 0 0 0 0 41.57 168.0 0 0 +DEAL::0 0 0 0 0 0 0 0 24.00 0 +DEAL::0 0 0 0 0 0 0 0 0 60.00 diff --git a/tests/fe/cell_similarity_dgp_nonparametric_07.cc b/tests/fe/cell_similarity_dgp_nonparametric_07.cc new file mode 100644 index 0000000000..fe634d22fe --- /dev/null +++ b/tests/fe/cell_similarity_dgp_nonparametric_07.cc @@ -0,0 +1,174 @@ +//---------------------------------------------------------------------- +// $Id$ +// Version: $Name$ +// +// Copyright (C) 2009 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. +// +//---------------------------------------------------------------------- + + +// since early 2009, the FEValues objects try to be more efficient by only +// recomputing things like gradients of shape functions if the cell on which +// we are is not a translation of the previous one. in this series of tests we +// make sure that this actually works the way it's supposed to be; in +// particular, if we create a mesh of two identical cells but one has a curved +// boundary, then they are the same if we use a Q1 mapping, but not a Q2 +// mapping. so we test that the mass matrix we get from each of these cells is +// actually different in the latter case, but the same in the former +// +// the various tests cell_similarity_dgp_nonparametric_?? differ in the mappings and finite +// elements in use + + +#include "../tests.h" +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include + + +bool equal (const FullMatrix &m1, + const FullMatrix &m2) +{ + double d = 0, s = 0; + for (unsigned int i=0; i +void test (const Triangulation& tr) +{ + FE_DGPNonparametric fe(1); + deallog << "FE=" << fe.get_name() << std::endl; + + MappingC1 mapping; + deallog << "Mapping=C1" << std::endl; + + + DoFHandler dof(tr); + dof.distribute_dofs(fe); + + const QGauss quadrature(2); + FEValues fe_values (mapping, fe, quadrature, + update_values | update_gradients | + update_JxW_values); + + FullMatrix mass_matrix[2], laplace_matrix[2]; + mass_matrix[0].reinit(fe.dofs_per_cell, fe.dofs_per_cell); + mass_matrix[1].reinit(fe.dofs_per_cell, fe.dofs_per_cell); + laplace_matrix[0].reinit(fe.dofs_per_cell, fe.dofs_per_cell); + laplace_matrix[1].reinit(fe.dofs_per_cell, fe.dofs_per_cell); + + for (typename DoFHandler::active_cell_iterator + cell = dof.begin_active(); + cell != dof.end(); ++cell) + { + fe_values.reinit (cell); + + for (unsigned int i=0; iindex()](i,j) += fe_values.shape_value (i,q) * + fe_values.shape_value (j,q) * + fe_values.JxW(q); + laplace_matrix[cell->index()](i,j) += fe_values.shape_grad (i,q) * + fe_values.shape_grad (j,q) * + fe_values.JxW(q); + } + } + + // check what we expect for this mapping + // about equality or inequality of the + // matrices + deallog << "Mass matrices " + << (equal (mass_matrix[0], mass_matrix[1]) ? "are" : "are not") + << " equal." + << std::endl; + deallog << "Laplace matrices " + << (equal (laplace_matrix[0], laplace_matrix[1]) ? "are" : "are not") + << " equal." + << std::endl; + + for (unsigned int cell=0; cell<2; ++cell) + { + deallog << "cell=" << cell << std::endl; + deallog << "mass_matrix:" << std::endl; + for (unsigned int i=0; i +void test() +{ + Triangulation tr; + Point p1 = Point(); + Point p2 = (dim == 2 ? + Point(2,1) : + Point(2,1,1)); + std::vector subdivisions (dim, 1); + subdivisions[0] = 2; + GridGenerator::subdivided_hyper_rectangle(tr, subdivisions, p1, p2); + + static const HyperBallBoundary boundary; + tr.set_boundary (1, boundary); + + // set boundary id on cell 1 + for (unsigned int f=0; f::faces_per_cell; ++f) + if (tr.begin_active()->at_boundary(f)) + tr.begin_active()->face(f)->set_boundary_indicator (1); + + test(tr); +} + + +int main() +{ + std::ofstream logfile ("cell_similarity_dgp_nonparametric_07/output"); + deallog << std::setprecision (4); + + deallog.attach(logfile); + deallog.depth_console (0); + deallog.threshold_double(1.e-7); + + test<2>(); + //test<3>(); +} diff --git a/tests/fe/cell_similarity_dgp_nonparametric_07/cmp/generic b/tests/fe/cell_similarity_dgp_nonparametric_07/cmp/generic new file mode 100644 index 0000000000..f6a9046ff0 --- /dev/null +++ b/tests/fe/cell_similarity_dgp_nonparametric_07/cmp/generic @@ -0,0 +1,23 @@ + +DEAL::FE=FE_DGPNonparametric<2>(1) +DEAL::Mapping=C1 +DEAL::Mass matrices are not equal. +DEAL::Laplace matrices are not equal. +DEAL::cell=0 +DEAL::mass_matrix: +DEAL::nan nan nan +DEAL::nan nan nan +DEAL::nan nan nan +DEAL::laplace_matrix: +DEAL::nan nan nan +DEAL::nan nan nan +DEAL::nan nan nan +DEAL::cell=1 +DEAL::mass_matrix: +DEAL::1.000 3.464 0 +DEAL::3.464 13.00 0 +DEAL::0 0 1.000 +DEAL::laplace_matrix: +DEAL::0 0 0 +DEAL::0 12.00 0 +DEAL::0 0 12.00 diff --git a/tests/fe/cell_similarity_dgp_nonparametric_08.cc b/tests/fe/cell_similarity_dgp_nonparametric_08.cc new file mode 100644 index 0000000000..b092fbc876 --- /dev/null +++ b/tests/fe/cell_similarity_dgp_nonparametric_08.cc @@ -0,0 +1,174 @@ +//---------------------------------------------------------------------- +// $Id$ +// Version: $Name$ +// +// Copyright (C) 2009 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. +// +//---------------------------------------------------------------------- + + +// since early 2009, the FEValues objects try to be more efficient by only +// recomputing things like gradients of shape functions if the cell on which +// we are is not a translation of the previous one. in this series of tests we +// make sure that this actually works the way it's supposed to be; in +// particular, if we create a mesh of two identical cells but one has a curved +// boundary, then they are the same if we use a Q1 mapping, but not a Q2 +// mapping. so we test that the mass matrix we get from each of these cells is +// actually different in the latter case, but the same in the former +// +// the various tests cell_similarity_dgp_nonparametric_?? differ in the mappings and finite +// elements in use + + +#include "../tests.h" +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include + + +bool equal (const FullMatrix &m1, + const FullMatrix &m2) +{ + double d = 0, s = 0; + for (unsigned int i=0; i +void test (const Triangulation& tr) +{ + FE_DGPNonparametric fe(2); + deallog << "FE=" << fe.get_name() << std::endl; + + MappingC1 mapping; + deallog << "Mapping=C1" << std::endl; + + + DoFHandler dof(tr); + dof.distribute_dofs(fe); + + const QGauss quadrature(2); + FEValues fe_values (mapping, fe, quadrature, + update_values | update_gradients | + update_JxW_values); + + FullMatrix mass_matrix[2], laplace_matrix[2]; + mass_matrix[0].reinit(fe.dofs_per_cell, fe.dofs_per_cell); + mass_matrix[1].reinit(fe.dofs_per_cell, fe.dofs_per_cell); + laplace_matrix[0].reinit(fe.dofs_per_cell, fe.dofs_per_cell); + laplace_matrix[1].reinit(fe.dofs_per_cell, fe.dofs_per_cell); + + for (typename DoFHandler::active_cell_iterator + cell = dof.begin_active(); + cell != dof.end(); ++cell) + { + fe_values.reinit (cell); + + for (unsigned int i=0; iindex()](i,j) += fe_values.shape_value (i,q) * + fe_values.shape_value (j,q) * + fe_values.JxW(q); + laplace_matrix[cell->index()](i,j) += fe_values.shape_grad (i,q) * + fe_values.shape_grad (j,q) * + fe_values.JxW(q); + } + } + + // check what we expect for this mapping + // about equality or inequality of the + // matrices + deallog << "Mass matrices " + << (equal (mass_matrix[0], mass_matrix[1]) ? "are" : "are not") + << " equal." + << std::endl; + deallog << "Laplace matrices " + << (equal (laplace_matrix[0], laplace_matrix[1]) ? "are" : "are not") + << " equal." + << std::endl; + + for (unsigned int cell=0; cell<2; ++cell) + { + deallog << "cell=" << cell << std::endl; + deallog << "mass_matrix:" << std::endl; + for (unsigned int i=0; i +void test() +{ + Triangulation tr; + Point p1 = Point(); + Point p2 = (dim == 2 ? + Point(2,1) : + Point(2,1,1)); + std::vector subdivisions (dim, 1); + subdivisions[0] = 2; + GridGenerator::subdivided_hyper_rectangle(tr, subdivisions, p1, p2); + + static const HyperBallBoundary boundary; + tr.set_boundary (1, boundary); + + // set boundary id on cell 1 + for (unsigned int f=0; f::faces_per_cell; ++f) + if (tr.begin_active()->at_boundary(f)) + tr.begin_active()->face(f)->set_boundary_indicator (1); + + test(tr); +} + + +int main() +{ + std::ofstream logfile ("cell_similarity_dgp_nonparametric_08/output"); + deallog << std::setprecision (4); + + deallog.attach(logfile); + deallog.depth_console (0); + deallog.threshold_double(1.e-7); + + test<2>(); + //test<3>(); +} diff --git a/tests/fe/cell_similarity_dgp_nonparametric_08/cmp/generic b/tests/fe/cell_similarity_dgp_nonparametric_08/cmp/generic new file mode 100644 index 0000000000..7365b3baed --- /dev/null +++ b/tests/fe/cell_similarity_dgp_nonparametric_08/cmp/generic @@ -0,0 +1,35 @@ + +DEAL::FE=FE_DGPNonparametric<2>(2) +DEAL::Mapping=C1 +DEAL::Mass matrices are not equal. +DEAL::Laplace matrices are not equal. +DEAL::cell=0 +DEAL::mass_matrix: +DEAL::nan nan nan nan nan nan +DEAL::nan nan nan nan nan nan +DEAL::nan nan nan nan nan nan +DEAL::nan nan nan nan nan nan +DEAL::nan nan nan nan nan nan +DEAL::nan nan nan nan nan nan +DEAL::laplace_matrix: +DEAL::nan nan nan nan nan nan +DEAL::nan nan nan nan nan nan +DEAL::nan nan nan nan nan nan +DEAL::nan nan nan nan nan nan +DEAL::nan nan nan nan nan nan +DEAL::nan nan nan nan nan nan +DEAL::cell=1 +DEAL::mass_matrix: +DEAL::1.000 3.464 13.42 0 0 0 +DEAL::3.464 13.00 54.22 0 0 0 +DEAL::13.42 54.22 240.0 0 0 0 +DEAL::0 0 0 1.000 3.464 0 +DEAL::0 0 0 3.464 13.00 0 +DEAL::0 0 0 0 0 0 +DEAL::laplace_matrix: +DEAL::0 0 0 0 0 0 +DEAL::0 12.00 92.95 0 0 0 +DEAL::0 92.95 780.0 0 0 0 +DEAL::0 0 0 12.00 41.57 0 +DEAL::0 0 0 41.57 168.0 0 +DEAL::0 0 0 0 0 60.00 diff --git a/tests/fe/cell_similarity_dgp_nonparametric_09.cc b/tests/fe/cell_similarity_dgp_nonparametric_09.cc new file mode 100644 index 0000000000..d8fcdef4a9 --- /dev/null +++ b/tests/fe/cell_similarity_dgp_nonparametric_09.cc @@ -0,0 +1,174 @@ +//---------------------------------------------------------------------- +// $Id$ +// Version: $Name$ +// +// Copyright (C) 2009 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. +// +//---------------------------------------------------------------------- + + +// since early 2009, the FEValues objects try to be more efficient by only +// recomputing things like gradients of shape functions if the cell on which +// we are is not a translation of the previous one. in this series of tests we +// make sure that this actually works the way it's supposed to be; in +// particular, if we create a mesh of two identical cells but one has a curved +// boundary, then they are the same if we use a Q1 mapping, but not a Q2 +// mapping. so we test that the mass matrix we get from each of these cells is +// actually different in the latter case, but the same in the former +// +// the various tests cell_similarity_dgp_nonparametric_?? differ in the mappings and finite +// elements in use + + +#include "../tests.h" +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include + + +bool equal (const FullMatrix &m1, + const FullMatrix &m2) +{ + double d = 0, s = 0; + for (unsigned int i=0; i +void test (const Triangulation& tr) +{ + FE_DGPNonparametric fe(1); + deallog << "FE=" << fe.get_name() << std::endl; + + MappingCartesian mapping; + deallog << "Mapping=Cartesian" << std::endl; + + + DoFHandler dof(tr); + dof.distribute_dofs(fe); + + const QGauss quadrature(2); + FEValues fe_values (mapping, fe, quadrature, + update_values | update_gradients | + update_JxW_values); + + FullMatrix mass_matrix[2], laplace_matrix[2]; + mass_matrix[0].reinit(fe.dofs_per_cell, fe.dofs_per_cell); + mass_matrix[1].reinit(fe.dofs_per_cell, fe.dofs_per_cell); + laplace_matrix[0].reinit(fe.dofs_per_cell, fe.dofs_per_cell); + laplace_matrix[1].reinit(fe.dofs_per_cell, fe.dofs_per_cell); + + for (typename DoFHandler::active_cell_iterator + cell = dof.begin_active(); + cell != dof.end(); ++cell) + { + fe_values.reinit (cell); + + for (unsigned int i=0; iindex()](i,j) += fe_values.shape_value (i,q) * + fe_values.shape_value (j,q) * + fe_values.JxW(q); + laplace_matrix[cell->index()](i,j) += fe_values.shape_grad (i,q) * + fe_values.shape_grad (j,q) * + fe_values.JxW(q); + } + } + + // check what we expect for this mapping + // about equality or inequality of the + // matrices + deallog << "Mass matrices " + << (equal (mass_matrix[0], mass_matrix[1]) ? "are" : "are not") + << " equal." + << std::endl; + deallog << "Laplace matrices " + << (equal (laplace_matrix[0], laplace_matrix[1]) ? "are" : "are not") + << " equal." + << std::endl; + + for (unsigned int cell=0; cell<2; ++cell) + { + deallog << "cell=" << cell << std::endl; + deallog << "mass_matrix:" << std::endl; + for (unsigned int i=0; i +void test() +{ + Triangulation tr; + Point p1 = Point(); + Point p2 = (dim == 2 ? + Point(2,1) : + Point(2,1,1)); + std::vector subdivisions (dim, 1); + subdivisions[0] = 2; + GridGenerator::subdivided_hyper_rectangle(tr, subdivisions, p1, p2); + + static const HyperBallBoundary boundary; + tr.set_boundary (1, boundary); + + // set boundary id on cell 1 + for (unsigned int f=0; f::faces_per_cell; ++f) + if (tr.begin_active()->at_boundary(f)) + tr.begin_active()->face(f)->set_boundary_indicator (1); + + test(tr); +} + + +int main() +{ + std::ofstream logfile ("cell_similarity_dgp_nonparametric_09/output"); + deallog << std::setprecision (4); + + deallog.attach(logfile); + deallog.depth_console (0); + deallog.threshold_double(1.e-7); + + test<2>(); + //test<3>(); +} diff --git a/tests/fe/cell_similarity_dgp_nonparametric_09/cmp/generic b/tests/fe/cell_similarity_dgp_nonparametric_09/cmp/generic new file mode 100644 index 0000000000..112aa99fdc --- /dev/null +++ b/tests/fe/cell_similarity_dgp_nonparametric_09/cmp/generic @@ -0,0 +1,23 @@ + +DEAL::FE=FE_DGPNonparametric<2>(1) +DEAL::Mapping=Cartesian +DEAL::Mass matrices are not equal. +DEAL::Laplace matrices are equal. +DEAL::cell=0 +DEAL::mass_matrix: +DEAL::1.000 0 0 +DEAL::0 1.000 0 +DEAL::0 0 1.000 +DEAL::laplace_matrix: +DEAL::0 0 0 +DEAL::0 12.00 0 +DEAL::0 0 12.00 +DEAL::cell=1 +DEAL::mass_matrix: +DEAL::1.000 3.464 0 +DEAL::3.464 13.00 0 +DEAL::0 0 1.000 +DEAL::laplace_matrix: +DEAL::0 0 0 +DEAL::0 12.00 0 +DEAL::0 0 12.00 diff --git a/tests/fe/cell_similarity_dgp_nonparametric_10.cc b/tests/fe/cell_similarity_dgp_nonparametric_10.cc new file mode 100644 index 0000000000..5496724efb --- /dev/null +++ b/tests/fe/cell_similarity_dgp_nonparametric_10.cc @@ -0,0 +1,174 @@ +//---------------------------------------------------------------------- +// $Id$ +// Version: $Name$ +// +// Copyright (C) 2009 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. +// +//---------------------------------------------------------------------- + + +// since early 2009, the FEValues objects try to be more efficient by only +// recomputing things like gradients of shape functions if the cell on which +// we are is not a translation of the previous one. in this series of tests we +// make sure that this actually works the way it's supposed to be; in +// particular, if we create a mesh of two identical cells but one has a curved +// boundary, then they are the same if we use a Q1 mapping, but not a Q2 +// mapping. so we test that the mass matrix we get from each of these cells is +// actually different in the latter case, but the same in the former +// +// the various tests cell_similarity_dgp_nonparametric_?? differ in the mappings and finite +// elements in use + + +#include "../tests.h" +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include + + +bool equal (const FullMatrix &m1, + const FullMatrix &m2) +{ + double d = 0, s = 0; + for (unsigned int i=0; i +void test (const Triangulation& tr) +{ + FE_DGPNonparametric fe(2); + deallog << "FE=" << fe.get_name() << std::endl; + + MappingCartesian mapping; + deallog << "Mapping=Cartesian" << std::endl; + + + DoFHandler dof(tr); + dof.distribute_dofs(fe); + + const QGauss quadrature(2); + FEValues fe_values (mapping, fe, quadrature, + update_values | update_gradients | + update_JxW_values); + + FullMatrix mass_matrix[2], laplace_matrix[2]; + mass_matrix[0].reinit(fe.dofs_per_cell, fe.dofs_per_cell); + mass_matrix[1].reinit(fe.dofs_per_cell, fe.dofs_per_cell); + laplace_matrix[0].reinit(fe.dofs_per_cell, fe.dofs_per_cell); + laplace_matrix[1].reinit(fe.dofs_per_cell, fe.dofs_per_cell); + + for (typename DoFHandler::active_cell_iterator + cell = dof.begin_active(); + cell != dof.end(); ++cell) + { + fe_values.reinit (cell); + + for (unsigned int i=0; iindex()](i,j) += fe_values.shape_value (i,q) * + fe_values.shape_value (j,q) * + fe_values.JxW(q); + laplace_matrix[cell->index()](i,j) += fe_values.shape_grad (i,q) * + fe_values.shape_grad (j,q) * + fe_values.JxW(q); + } + } + + // check what we expect for this mapping + // about equality or inequality of the + // matrices + deallog << "Mass matrices " + << (equal (mass_matrix[0], mass_matrix[1]) ? "are" : "are not") + << " equal." + << std::endl; + deallog << "Laplace matrices " + << (equal (laplace_matrix[0], laplace_matrix[1]) ? "are" : "are not") + << " equal." + << std::endl; + + for (unsigned int cell=0; cell<2; ++cell) + { + deallog << "cell=" << cell << std::endl; + deallog << "mass_matrix:" << std::endl; + for (unsigned int i=0; i +void test() +{ + Triangulation tr; + Point p1 = Point(); + Point p2 = (dim == 2 ? + Point(2,1) : + Point(2,1,1)); + std::vector subdivisions (dim, 1); + subdivisions[0] = 2; + GridGenerator::subdivided_hyper_rectangle(tr, subdivisions, p1, p2); + + static const HyperBallBoundary boundary; + tr.set_boundary (1, boundary); + + // set boundary id on cell 1 + for (unsigned int f=0; f::faces_per_cell; ++f) + if (tr.begin_active()->at_boundary(f)) + tr.begin_active()->face(f)->set_boundary_indicator (1); + + test(tr); +} + + +int main() +{ + std::ofstream logfile ("cell_similarity_dgp_nonparametric_10/output"); + deallog << std::setprecision (4); + + deallog.attach(logfile); + deallog.depth_console (0); + deallog.threshold_double(1.e-7); + + test<2>(); + //test<3>(); +} diff --git a/tests/fe/cell_similarity_dgp_nonparametric_10/cmp/generic b/tests/fe/cell_similarity_dgp_nonparametric_10/cmp/generic new file mode 100644 index 0000000000..ac8e3e0012 --- /dev/null +++ b/tests/fe/cell_similarity_dgp_nonparametric_10/cmp/generic @@ -0,0 +1,35 @@ + +DEAL::FE=FE_DGPNonparametric<2>(2) +DEAL::Mapping=Cartesian +DEAL::Mass matrices are not equal. +DEAL::Laplace matrices are not equal. +DEAL::cell=0 +DEAL::mass_matrix: +DEAL::1.000 0 0 0 0 0 +DEAL::0 1.000 0 0 0 0 +DEAL::0 0 0 0 0 0 +DEAL::0 0 0 1.000 0 0 +DEAL::0 0 0 0 1.000 0 +DEAL::0 0 0 0 0 0 +DEAL::laplace_matrix: +DEAL::0 0 0 0 0 0 +DEAL::0 12.00 0 0 0 0 +DEAL::0 0 60.00 0 0 0 +DEAL::0 0 0 12.00 0 0 +DEAL::0 0 0 0 24.00 0 +DEAL::0 0 0 0 0 60.00 +DEAL::cell=1 +DEAL::mass_matrix: +DEAL::1.000 3.464 13.42 0 0 0 +DEAL::3.464 13.00 54.22 0 0 0 +DEAL::13.42 54.22 240.0 0 0 0 +DEAL::0 0 0 1.000 3.464 0 +DEAL::0 0 0 3.464 13.00 0 +DEAL::0 0 0 0 0 0 +DEAL::laplace_matrix: +DEAL::0 0 0 0 0 0 +DEAL::0 12.00 92.95 0 0 0 +DEAL::0 92.95 780.0 0 0 0 +DEAL::0 0 0 12.00 41.57 0 +DEAL::0 0 0 41.57 168.0 0 +DEAL::0 0 0 0 0 60.00