]> https://gitweb.dealii.org/ - dealii-svn.git/commitdiff
Test for avoiding bug in FE_Q with arbitrary nodes: the hp line/quad identities need...
authorkronbichler <kronbichler@0785d39b-7218-0410-832d-ea1e28bc413d>
Mon, 11 Jul 2011 12:15:19 +0000 (12:15 +0000)
committerkronbichler <kronbichler@0785d39b-7218-0410-832d-ea1e28bc413d>
Mon, 11 Jul 2011 12:15:19 +0000 (12:15 +0000)
git-svn-id: https://svn.dealii.org/trunk@23940 0785d39b-7218-0410-832d-ea1e28bc413d

tests/hp/hp_line_dof_identities_q_gl.cc [new file with mode: 0644]
tests/hp/hp_line_dof_identities_q_gl/cmp/generic [new file with mode: 0644]
tests/hp/hp_quad_dof_identities_q_gl.cc [new file with mode: 0644]
tests/hp/hp_quad_dof_identities_q_gl/cmp/generic [new file with mode: 0644]

diff --git a/tests/hp/hp_line_dof_identities_q_gl.cc b/tests/hp/hp_line_dof_identities_q_gl.cc
new file mode 100644 (file)
index 0000000..d500515
--- /dev/null
@@ -0,0 +1,76 @@
+//--------------------  hp_line_dof_identities_q_gl.cc  ----------------------
+//    $Id$
+//    Version: $Name$
+//
+//    Copyright (C) 2005, 2006, 2011 by the deal.II authors
+//
+//    This file is subject to QPL and may not be  distributed
+//    without copyright and license information. Please refer
+//    to the file deal.II/doc/license.html for the  text  and
+//    further information on this license.
+//
+//--------------------  hp_line_dof_identities_q.cc  -------------------------
+
+
+// check FE_Q::hp_line_dof_identities for Gauss-Lobatto nodes
+
+
+#include "../tests.h"
+#include <deal.II/base/logstream.h>
+#include <deal.II/hp/fe_collection.h>
+#include <deal.II/fe/fe_q.h>
+#include <deal.II/base/quadrature_lib.h>
+
+#include <fstream>
+
+
+template <int dim>
+void test ()
+{
+  hp::FECollection<dim> fe_collection;
+  for (unsigned int i=1; i<8-dim; ++i)
+    fe_collection.push_back (FE_Q<dim>(QGaussLobatto<1>(i+1)));
+
+  for (unsigned int i=0; i<fe_collection.size(); ++i)
+    for (unsigned int j=0; j<fe_collection.size(); ++j)
+      {
+       const std::vector<std::pair<unsigned int, unsigned int> >
+         identities = fe_collection[i].hp_line_dof_identities (fe_collection[j]);
+
+       deallog << "Identities for "
+               << fe_collection[i].get_name() << " and "
+               << fe_collection[j].get_name() << ": "
+               << identities.size()
+               << std::endl;
+
+       for (unsigned int k=0; k<identities.size(); ++k)
+         {
+           Assert (identities[k].first < fe_collection[i].dofs_per_line,
+                   ExcInternalError());
+           Assert (identities[k].second < fe_collection[j].dofs_per_line,
+                   ExcInternalError());
+
+           deallog << identities[k].first << ' '
+                   << identities[k].second
+                   << std::endl;
+         }
+      }
+}
+
+
+
+int main ()
+{
+  std::ofstream logfile("hp_line_dof_identities_q_gl/output");
+  logfile.precision(2);
+
+  deallog.attach(logfile);
+  deallog.depth_console(0);
+  deallog.threshold_double(1.e-10);
+
+  test<1> ();
+  test<2> ();
+  test<3> ();
+
+  deallog << "OK" << std::endl;
+}
diff --git a/tests/hp/hp_line_dof_identities_q_gl/cmp/generic b/tests/hp/hp_line_dof_identities_q_gl/cmp/generic
new file mode 100644 (file)
index 0000000..acc8bec
--- /dev/null
@@ -0,0 +1,120 @@
+
+DEAL::Identities for FE_Q<1>(1) and FE_Q<1>(1): 0
+DEAL::Identities for FE_Q<1>(1) and FE_Q<1>(2): 0
+DEAL::Identities for FE_Q<1>(1) and FE_Q<1>(QGaussLobatto(4)): 0
+DEAL::Identities for FE_Q<1>(1) and FE_Q<1>(QGaussLobatto(5)): 0
+DEAL::Identities for FE_Q<1>(1) and FE_Q<1>(QGaussLobatto(6)): 0
+DEAL::Identities for FE_Q<1>(1) and FE_Q<1>(QGaussLobatto(7)): 0
+DEAL::Identities for FE_Q<1>(2) and FE_Q<1>(1): 0
+DEAL::Identities for FE_Q<1>(2) and FE_Q<1>(2): 1
+DEAL::0 0
+DEAL::Identities for FE_Q<1>(2) and FE_Q<1>(QGaussLobatto(4)): 0
+DEAL::Identities for FE_Q<1>(2) and FE_Q<1>(QGaussLobatto(5)): 1
+DEAL::0 1
+DEAL::Identities for FE_Q<1>(2) and FE_Q<1>(QGaussLobatto(6)): 0
+DEAL::Identities for FE_Q<1>(2) and FE_Q<1>(QGaussLobatto(7)): 1
+DEAL::0 2
+DEAL::Identities for FE_Q<1>(QGaussLobatto(4)) and FE_Q<1>(1): 0
+DEAL::Identities for FE_Q<1>(QGaussLobatto(4)) and FE_Q<1>(2): 0
+DEAL::Identities for FE_Q<1>(QGaussLobatto(4)) and FE_Q<1>(QGaussLobatto(4)): 2
+DEAL::0 0
+DEAL::1 1
+DEAL::Identities for FE_Q<1>(QGaussLobatto(4)) and FE_Q<1>(QGaussLobatto(5)): 0
+DEAL::Identities for FE_Q<1>(QGaussLobatto(4)) and FE_Q<1>(QGaussLobatto(6)): 0
+DEAL::Identities for FE_Q<1>(QGaussLobatto(4)) and FE_Q<1>(QGaussLobatto(7)): 0
+DEAL::Identities for FE_Q<1>(QGaussLobatto(5)) and FE_Q<1>(1): 0
+DEAL::Identities for FE_Q<1>(QGaussLobatto(5)) and FE_Q<1>(2): 1
+DEAL::1 0
+DEAL::Identities for FE_Q<1>(QGaussLobatto(5)) and FE_Q<1>(QGaussLobatto(4)): 0
+DEAL::Identities for FE_Q<1>(QGaussLobatto(5)) and FE_Q<1>(QGaussLobatto(5)): 3
+DEAL::0 0
+DEAL::1 1
+DEAL::2 2
+DEAL::Identities for FE_Q<1>(QGaussLobatto(5)) and FE_Q<1>(QGaussLobatto(6)): 0
+DEAL::Identities for FE_Q<1>(QGaussLobatto(5)) and FE_Q<1>(QGaussLobatto(7)): 1
+DEAL::1 2
+DEAL::Identities for FE_Q<1>(QGaussLobatto(6)) and FE_Q<1>(1): 0
+DEAL::Identities for FE_Q<1>(QGaussLobatto(6)) and FE_Q<1>(2): 0
+DEAL::Identities for FE_Q<1>(QGaussLobatto(6)) and FE_Q<1>(QGaussLobatto(4)): 0
+DEAL::Identities for FE_Q<1>(QGaussLobatto(6)) and FE_Q<1>(QGaussLobatto(5)): 0
+DEAL::Identities for FE_Q<1>(QGaussLobatto(6)) and FE_Q<1>(QGaussLobatto(6)): 4
+DEAL::0 0
+DEAL::1 1
+DEAL::2 2
+DEAL::3 3
+DEAL::Identities for FE_Q<1>(QGaussLobatto(6)) and FE_Q<1>(QGaussLobatto(7)): 0
+DEAL::Identities for FE_Q<1>(QGaussLobatto(7)) and FE_Q<1>(1): 0
+DEAL::Identities for FE_Q<1>(QGaussLobatto(7)) and FE_Q<1>(2): 1
+DEAL::2 0
+DEAL::Identities for FE_Q<1>(QGaussLobatto(7)) and FE_Q<1>(QGaussLobatto(4)): 0
+DEAL::Identities for FE_Q<1>(QGaussLobatto(7)) and FE_Q<1>(QGaussLobatto(5)): 1
+DEAL::2 1
+DEAL::Identities for FE_Q<1>(QGaussLobatto(7)) and FE_Q<1>(QGaussLobatto(6)): 0
+DEAL::Identities for FE_Q<1>(QGaussLobatto(7)) and FE_Q<1>(QGaussLobatto(7)): 5
+DEAL::0 0
+DEAL::1 1
+DEAL::2 2
+DEAL::3 3
+DEAL::4 4
+DEAL::Identities for FE_Q<2>(1) and FE_Q<2>(1): 0
+DEAL::Identities for FE_Q<2>(1) and FE_Q<2>(2): 0
+DEAL::Identities for FE_Q<2>(1) and FE_Q<2>(QGaussLobatto(4)): 0
+DEAL::Identities for FE_Q<2>(1) and FE_Q<2>(QGaussLobatto(5)): 0
+DEAL::Identities for FE_Q<2>(1) and FE_Q<2>(QGaussLobatto(6)): 0
+DEAL::Identities for FE_Q<2>(2) and FE_Q<2>(1): 0
+DEAL::Identities for FE_Q<2>(2) and FE_Q<2>(2): 1
+DEAL::0 0
+DEAL::Identities for FE_Q<2>(2) and FE_Q<2>(QGaussLobatto(4)): 0
+DEAL::Identities for FE_Q<2>(2) and FE_Q<2>(QGaussLobatto(5)): 1
+DEAL::0 1
+DEAL::Identities for FE_Q<2>(2) and FE_Q<2>(QGaussLobatto(6)): 0
+DEAL::Identities for FE_Q<2>(QGaussLobatto(4)) and FE_Q<2>(1): 0
+DEAL::Identities for FE_Q<2>(QGaussLobatto(4)) and FE_Q<2>(2): 0
+DEAL::Identities for FE_Q<2>(QGaussLobatto(4)) and FE_Q<2>(QGaussLobatto(4)): 2
+DEAL::0 0
+DEAL::1 1
+DEAL::Identities for FE_Q<2>(QGaussLobatto(4)) and FE_Q<2>(QGaussLobatto(5)): 0
+DEAL::Identities for FE_Q<2>(QGaussLobatto(4)) and FE_Q<2>(QGaussLobatto(6)): 0
+DEAL::Identities for FE_Q<2>(QGaussLobatto(5)) and FE_Q<2>(1): 0
+DEAL::Identities for FE_Q<2>(QGaussLobatto(5)) and FE_Q<2>(2): 1
+DEAL::1 0
+DEAL::Identities for FE_Q<2>(QGaussLobatto(5)) and FE_Q<2>(QGaussLobatto(4)): 0
+DEAL::Identities for FE_Q<2>(QGaussLobatto(5)) and FE_Q<2>(QGaussLobatto(5)): 3
+DEAL::0 0
+DEAL::1 1
+DEAL::2 2
+DEAL::Identities for FE_Q<2>(QGaussLobatto(5)) and FE_Q<2>(QGaussLobatto(6)): 0
+DEAL::Identities for FE_Q<2>(QGaussLobatto(6)) and FE_Q<2>(1): 0
+DEAL::Identities for FE_Q<2>(QGaussLobatto(6)) and FE_Q<2>(2): 0
+DEAL::Identities for FE_Q<2>(QGaussLobatto(6)) and FE_Q<2>(QGaussLobatto(4)): 0
+DEAL::Identities for FE_Q<2>(QGaussLobatto(6)) and FE_Q<2>(QGaussLobatto(5)): 0
+DEAL::Identities for FE_Q<2>(QGaussLobatto(6)) and FE_Q<2>(QGaussLobatto(6)): 4
+DEAL::0 0
+DEAL::1 1
+DEAL::2 2
+DEAL::3 3
+DEAL::Identities for FE_Q<3>(1) and FE_Q<3>(1): 0
+DEAL::Identities for FE_Q<3>(1) and FE_Q<3>(2): 0
+DEAL::Identities for FE_Q<3>(1) and FE_Q<3>(QGaussLobatto(4)): 0
+DEAL::Identities for FE_Q<3>(1) and FE_Q<3>(QGaussLobatto(5)): 0
+DEAL::Identities for FE_Q<3>(2) and FE_Q<3>(1): 0
+DEAL::Identities for FE_Q<3>(2) and FE_Q<3>(2): 1
+DEAL::0 0
+DEAL::Identities for FE_Q<3>(2) and FE_Q<3>(QGaussLobatto(4)): 0
+DEAL::Identities for FE_Q<3>(2) and FE_Q<3>(QGaussLobatto(5)): 1
+DEAL::0 1
+DEAL::Identities for FE_Q<3>(QGaussLobatto(4)) and FE_Q<3>(1): 0
+DEAL::Identities for FE_Q<3>(QGaussLobatto(4)) and FE_Q<3>(2): 0
+DEAL::Identities for FE_Q<3>(QGaussLobatto(4)) and FE_Q<3>(QGaussLobatto(4)): 2
+DEAL::0 0
+DEAL::1 1
+DEAL::Identities for FE_Q<3>(QGaussLobatto(4)) and FE_Q<3>(QGaussLobatto(5)): 0
+DEAL::Identities for FE_Q<3>(QGaussLobatto(5)) and FE_Q<3>(1): 0
+DEAL::Identities for FE_Q<3>(QGaussLobatto(5)) and FE_Q<3>(2): 1
+DEAL::1 0
+DEAL::Identities for FE_Q<3>(QGaussLobatto(5)) and FE_Q<3>(QGaussLobatto(4)): 0
+DEAL::Identities for FE_Q<3>(QGaussLobatto(5)) and FE_Q<3>(QGaussLobatto(5)): 3
+DEAL::0 0
+DEAL::1 1
+DEAL::2 2
+DEAL::OK
diff --git a/tests/hp/hp_quad_dof_identities_q_gl.cc b/tests/hp/hp_quad_dof_identities_q_gl.cc
new file mode 100644 (file)
index 0000000..3da0b16
--- /dev/null
@@ -0,0 +1,75 @@
+//--------------------  hp_quad_dof_identities_q_gl.cc  ----------------------
+//    $Id$
+//    Version: $Name$
+//
+//    Copyright (C) 2005, 2006 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.
+//
+//--------------------  hp_quad_dof_identities_q_gl.cc  ----------------------
+
+
+// check FE_Q::hp_quad_dof_identities for Gauss-Lobatto nodes
+
+
+#include "../tests.h"
+#include <deal.II/base/logstream.h>
+#include <deal.II/hp/fe_collection.h>
+#include <deal.II/fe/fe_q.h>
+#include <deal.II/base/quadrature_lib.h>
+
+#include <fstream>
+
+
+template <int dim>
+void test ()
+{
+  hp::FECollection<dim> fe_collection;
+  for (unsigned int i=1; i<8-dim; ++i)
+    fe_collection.push_back (FE_Q<dim>(QGaussLobatto<1>(i+1)));
+
+  for (unsigned int i=0; i<fe_collection.size(); ++i)
+    for (unsigned int j=0; j<fe_collection.size(); ++j)
+      {
+       const std::vector<std::pair<unsigned int, unsigned int> >
+         identities = fe_collection[i].hp_quad_dof_identities (fe_collection[j]);
+
+       deallog << "Identities for "
+               << fe_collection[i].get_name() << " and "
+               << fe_collection[j].get_name() << ": "
+               << identities.size()
+               << std::endl;
+
+       for (unsigned int k=0; k<identities.size(); ++k)
+         {
+           Assert (identities[k].first < fe_collection[i].dofs_per_quad,
+                   ExcInternalError());
+           Assert (identities[k].second < fe_collection[j].dofs_per_quad,
+                   ExcInternalError());
+
+           deallog << identities[k].first << ' '
+                   << identities[k].second
+                   << std::endl;
+         }
+      }
+}
+
+
+
+int main ()
+{
+  std::ofstream logfile("hp_quad_dof_identities_q_gl/output");
+  logfile.precision(2);
+
+  deallog.attach(logfile);
+  deallog.depth_console(0);
+  deallog.threshold_double(1.e-10);
+
+  test<2> ();
+  test<3> ();
+
+  deallog << "OK" << std::endl;
+}
diff --git a/tests/hp/hp_quad_dof_identities_q_gl/cmp/generic b/tests/hp/hp_quad_dof_identities_q_gl/cmp/generic
new file mode 100644 (file)
index 0000000..7f29523
--- /dev/null
@@ -0,0 +1,91 @@
+
+DEAL::Identities for FE_Q<2>(1) and FE_Q<2>(1): 0
+DEAL::Identities for FE_Q<2>(1) and FE_Q<2>(2): 0
+DEAL::Identities for FE_Q<2>(1) and FE_Q<2>(QGaussLobatto(4)): 0
+DEAL::Identities for FE_Q<2>(1) and FE_Q<2>(QGaussLobatto(5)): 0
+DEAL::Identities for FE_Q<2>(1) and FE_Q<2>(QGaussLobatto(6)): 0
+DEAL::Identities for FE_Q<2>(2) and FE_Q<2>(1): 0
+DEAL::Identities for FE_Q<2>(2) and FE_Q<2>(2): 1
+DEAL::0 0
+DEAL::Identities for FE_Q<2>(2) and FE_Q<2>(QGaussLobatto(4)): 0
+DEAL::Identities for FE_Q<2>(2) and FE_Q<2>(QGaussLobatto(5)): 1
+DEAL::0 4
+DEAL::Identities for FE_Q<2>(2) and FE_Q<2>(QGaussLobatto(6)): 0
+DEAL::Identities for FE_Q<2>(QGaussLobatto(4)) and FE_Q<2>(1): 0
+DEAL::Identities for FE_Q<2>(QGaussLobatto(4)) and FE_Q<2>(2): 0
+DEAL::Identities for FE_Q<2>(QGaussLobatto(4)) and FE_Q<2>(QGaussLobatto(4)): 4
+DEAL::0 0
+DEAL::1 1
+DEAL::2 2
+DEAL::3 3
+DEAL::Identities for FE_Q<2>(QGaussLobatto(4)) and FE_Q<2>(QGaussLobatto(5)): 0
+DEAL::Identities for FE_Q<2>(QGaussLobatto(4)) and FE_Q<2>(QGaussLobatto(6)): 0
+DEAL::Identities for FE_Q<2>(QGaussLobatto(5)) and FE_Q<2>(1): 0
+DEAL::Identities for FE_Q<2>(QGaussLobatto(5)) and FE_Q<2>(2): 1
+DEAL::4 0
+DEAL::Identities for FE_Q<2>(QGaussLobatto(5)) and FE_Q<2>(QGaussLobatto(4)): 0
+DEAL::Identities for FE_Q<2>(QGaussLobatto(5)) and FE_Q<2>(QGaussLobatto(5)): 9
+DEAL::0 0
+DEAL::1 1
+DEAL::2 2
+DEAL::3 3
+DEAL::4 4
+DEAL::5 5
+DEAL::6 6
+DEAL::7 7
+DEAL::8 8
+DEAL::Identities for FE_Q<2>(QGaussLobatto(5)) and FE_Q<2>(QGaussLobatto(6)): 0
+DEAL::Identities for FE_Q<2>(QGaussLobatto(6)) and FE_Q<2>(1): 0
+DEAL::Identities for FE_Q<2>(QGaussLobatto(6)) and FE_Q<2>(2): 0
+DEAL::Identities for FE_Q<2>(QGaussLobatto(6)) and FE_Q<2>(QGaussLobatto(4)): 0
+DEAL::Identities for FE_Q<2>(QGaussLobatto(6)) and FE_Q<2>(QGaussLobatto(5)): 0
+DEAL::Identities for FE_Q<2>(QGaussLobatto(6)) and FE_Q<2>(QGaussLobatto(6)): 16
+DEAL::0 0
+DEAL::1 1
+DEAL::2 2
+DEAL::3 3
+DEAL::4 4
+DEAL::5 5
+DEAL::6 6
+DEAL::7 7
+DEAL::8 8
+DEAL::9 9
+DEAL::10 10
+DEAL::11 11
+DEAL::12 12
+DEAL::13 13
+DEAL::14 14
+DEAL::15 15
+DEAL::Identities for FE_Q<3>(1) and FE_Q<3>(1): 0
+DEAL::Identities for FE_Q<3>(1) and FE_Q<3>(2): 0
+DEAL::Identities for FE_Q<3>(1) and FE_Q<3>(QGaussLobatto(4)): 0
+DEAL::Identities for FE_Q<3>(1) and FE_Q<3>(QGaussLobatto(5)): 0
+DEAL::Identities for FE_Q<3>(2) and FE_Q<3>(1): 0
+DEAL::Identities for FE_Q<3>(2) and FE_Q<3>(2): 1
+DEAL::0 0
+DEAL::Identities for FE_Q<3>(2) and FE_Q<3>(QGaussLobatto(4)): 0
+DEAL::Identities for FE_Q<3>(2) and FE_Q<3>(QGaussLobatto(5)): 1
+DEAL::0 4
+DEAL::Identities for FE_Q<3>(QGaussLobatto(4)) and FE_Q<3>(1): 0
+DEAL::Identities for FE_Q<3>(QGaussLobatto(4)) and FE_Q<3>(2): 0
+DEAL::Identities for FE_Q<3>(QGaussLobatto(4)) and FE_Q<3>(QGaussLobatto(4)): 4
+DEAL::0 0
+DEAL::1 1
+DEAL::2 2
+DEAL::3 3
+DEAL::Identities for FE_Q<3>(QGaussLobatto(4)) and FE_Q<3>(QGaussLobatto(5)): 0
+DEAL::Identities for FE_Q<3>(QGaussLobatto(5)) and FE_Q<3>(1): 0
+DEAL::Identities for FE_Q<3>(QGaussLobatto(5)) and FE_Q<3>(2): 1
+DEAL::4 0
+DEAL::Identities for FE_Q<3>(QGaussLobatto(5)) and FE_Q<3>(QGaussLobatto(4)): 0
+DEAL::Identities for FE_Q<3>(QGaussLobatto(5)) and FE_Q<3>(QGaussLobatto(5)): 9
+DEAL::0 0
+DEAL::1 1
+DEAL::2 2
+DEAL::3 3
+DEAL::4 4
+DEAL::5 5
+DEAL::6 6
+DEAL::7 7
+DEAL::8 8
+DEAL::OK

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

Douglas Adams


Typeset in Trocchi and Trocchi Bold Sans Serif.